Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
member-api
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
曲欣亮
member-api
Commits
46da17a7
Commit
46da17a7
authored
Aug 30, 2018
by
曲欣亮
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
重构简化
parent
000d52f4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
47 additions
and
73 deletions
+47
-73
LanguageController.java
src/main/java/com/egolm/lang/LanguageController.java
+29
-41
T_lang_tree.java
src/main/java/com/egolm/lang/bean/T_lang_tree.java
+3
-1
LanguageService.java
src/main/java/com/egolm/lang/service/LanguageService.java
+4
-6
LanguageServiceImpl.java
...java/com/egolm/lang/service/impl/LanguageServiceImpl.java
+11
-25
No files found.
src/main/java/com/egolm/lang/LanguageController.java
View file @
46da17a7
...
@@ -21,6 +21,7 @@ import com.alibaba.fastjson.JSON;
...
@@ -21,6 +21,7 @@ import com.alibaba.fastjson.JSON;
import
com.egolm.common.GsonUtil
;
import
com.egolm.common.GsonUtil
;
import
com.egolm.common.StringUtil
;
import
com.egolm.common.StringUtil
;
import
com.egolm.common.bean.Rjx
;
import
com.egolm.common.bean.Rjx
;
import
com.egolm.lang.bean.T_lang_tree
;
import
com.egolm.lang.config.XException
;
import
com.egolm.lang.config.XException
;
import
com.egolm.lang.model.ContentArgs
;
import
com.egolm.lang.model.ContentArgs
;
import
com.egolm.lang.service.LanguageService
;
import
com.egolm.lang.service.LanguageService
;
...
@@ -52,15 +53,13 @@ public class LanguageController {
...
@@ -52,15 +53,13 @@ public class LanguageController {
})
})
public
Object
menus
(
String
sParentLink
)
{
public
Object
menus
(
String
sParentLink
)
{
List
<
Map
<
String
,
Object
>>
list
=
new
ArrayList
<
Map
<
String
,
Object
>>();
List
<
Map
<
String
,
Object
>>
list
=
new
ArrayList
<
Map
<
String
,
Object
>>();
String
sParentID
=
service
.
getNodeIDByLink
(
sParentLink
);
T_lang_tree
node
=
service
.
getNodeByLink
(
sParentLink
);
if
(
sParentID
!=
null
)
{
if
(
node
!=
null
)
{
Map
<
String
,
Object
>
nodeMap
=
service
.
getNodeMapByID
(
sParentID
);
list
=
service
.
getListByTopID
(
node
.
getsTopID
());
String
sTopID
=
(
String
)
nodeMap
.
get
(
"sTopID"
);
list
=
service
.
getListByTopID
(
sTopID
);
}
else
{
}
else
{
list
=
service
.
getListAll
();
list
=
service
.
getListAll
();
}
}
return
Rjx
.
jsonOk
().
setData
(
this
.
toNodesTree
(
list
,
sParentID
,
sParentLink
==
null
?
new
ArrayList
<
String
>()
:
Arrays
.
asList
(
sParentLink
)));
return
Rjx
.
jsonOk
().
setData
(
this
.
toNodesTree
(
list
,
node
==
null
?
null
:
node
.
getsNodeID
()
,
sParentLink
==
null
?
new
ArrayList
<
String
>()
:
Arrays
.
asList
(
sParentLink
)));
}
}
private
List
<
Map
<
String
,
Object
>>
toNodesTree
(
List
<
Map
<
String
,
Object
>>
list
,
String
sParentID
,
List
<
String
>
sParentLink
)
{
private
List
<
Map
<
String
,
Object
>>
toNodesTree
(
List
<
Map
<
String
,
Object
>>
list
,
String
sParentID
,
List
<
String
>
sParentLink
)
{
...
@@ -100,8 +99,8 @@ public class LanguageController {
...
@@ -100,8 +99,8 @@ public class LanguageController {
@ApiImplicitParam
(
paramType
=
"header"
,
name
=
"sig"
,
dataType
=
"string"
,
required
=
false
,
value
=
"sig"
),
@ApiImplicitParam
(
paramType
=
"header"
,
name
=
"sig"
,
dataType
=
"string"
,
required
=
false
,
value
=
"sig"
),
})
})
public
Object
append
(
String
sLink
)
{
public
Object
append
(
String
sLink
)
{
service
.
append
(
sLink
);
T_lang_tree
node
=
service
.
getNodeByLink
(
sLink
,
true
);
return
Rjx
.
jsonOk
();
return
Rjx
.
jsonOk
()
.
setData
(
node
)
;
}
}
@ResponseBody
@ResponseBody
...
@@ -112,8 +111,8 @@ public class LanguageController {
...
@@ -112,8 +111,8 @@ public class LanguageController {
@ApiImplicitParam
(
paramType
=
"header"
,
name
=
"sig"
,
dataType
=
"string"
,
required
=
false
,
value
=
"sig"
),
@ApiImplicitParam
(
paramType
=
"header"
,
name
=
"sig"
,
dataType
=
"string"
,
required
=
false
,
value
=
"sig"
),
})
})
public
Object
delete
(
String
sLink
)
{
public
Object
delete
(
String
sLink
)
{
String
sNodeID
=
service
.
getNodeID
ByLink
(
sLink
);
T_lang_tree
node
=
service
.
getNode
ByLink
(
sLink
);
service
.
delete
(
sNodeID
);
service
.
delete
(
node
.
getsNodeID
()
);
return
Rjx
.
jsonOk
();
return
Rjx
.
jsonOk
();
}
}
...
@@ -125,9 +124,9 @@ public class LanguageController {
...
@@ -125,9 +124,9 @@ public class LanguageController {
@ApiImplicitParam
(
paramType
=
"header"
,
name
=
"sig"
,
dataType
=
"string"
,
required
=
false
,
value
=
"sig"
),
@ApiImplicitParam
(
paramType
=
"header"
,
name
=
"sig"
,
dataType
=
"string"
,
required
=
false
,
value
=
"sig"
),
})
})
public
Object
move
(
String
sLink
,
String
sParentLink
)
{
public
Object
move
(
String
sLink
,
String
sParentLink
)
{
String
sNodeID
=
service
.
getNodeID
ByLink
(
sLink
);
T_lang_tree
node
=
service
.
getNode
ByLink
(
sLink
);
String
sParentID
=
service
.
getNodeID
ByLink
(
sParentLink
);
T_lang_tree
parent
=
service
.
getNode
ByLink
(
sParentLink
);
service
.
move
(
sNodeID
,
sParentID
);
service
.
move
(
node
.
getsNodeID
(),
parent
.
getsNodeID
()
);
return
Rjx
.
jsonOk
();
return
Rjx
.
jsonOk
();
}
}
...
@@ -139,8 +138,8 @@ public class LanguageController {
...
@@ -139,8 +138,8 @@ public class LanguageController {
@ApiImplicitParam
(
paramType
=
"header"
,
name
=
"sig"
,
dataType
=
"string"
,
required
=
false
,
value
=
"sig"
),
@ApiImplicitParam
(
paramType
=
"header"
,
name
=
"sig"
,
dataType
=
"string"
,
required
=
false
,
value
=
"sig"
),
})
})
public
Object
rename
(
String
sLink
,
String
sNodeNO
)
{
public
Object
rename
(
String
sLink
,
String
sNodeNO
)
{
String
sNodeID
=
service
.
getNodeID
ByLink
(
sLink
);
T_lang_tree
node
=
service
.
getNode
ByLink
(
sLink
);
service
.
rename
(
sNodeID
,
sNodeNO
);
service
.
rename
(
node
.
getsNodeID
()
,
sNodeNO
);
return
Rjx
.
jsonOk
();
return
Rjx
.
jsonOk
();
}
}
...
@@ -152,7 +151,7 @@ public class LanguageController {
...
@@ -152,7 +151,7 @@ public class LanguageController {
@ApiImplicitParam
(
paramType
=
"header"
,
name
=
"sig"
,
dataType
=
"string"
,
required
=
false
,
value
=
"sig"
),
@ApiImplicitParam
(
paramType
=
"header"
,
name
=
"sig"
,
dataType
=
"string"
,
required
=
false
,
value
=
"sig"
),
})
})
public
Object
update
(
String
sLink
,
String
sContentText
)
{
public
Object
update
(
String
sLink
,
String
sContentText
)
{
String
sNodeID
=
service
.
getNodeID
ByLink
(
sLink
,
true
);
T_lang_tree
node
=
service
.
getNode
ByLink
(
sLink
,
true
);
Map
<
String
,
Object
>
contentMap
=
GsonUtil
.
toMap
(
sContentText
);
Map
<
String
,
Object
>
contentMap
=
GsonUtil
.
toMap
(
sContentText
);
Map
<
String
,
Object
>
tmp
=
new
HashMap
<
String
,
Object
>();
Map
<
String
,
Object
>
tmp
=
new
HashMap
<
String
,
Object
>();
String
sCaption
=
(
String
)
contentMap
.
get
(
"sCaption"
);
String
sCaption
=
(
String
)
contentMap
.
get
(
"sCaption"
);
...
@@ -178,7 +177,7 @@ public class LanguageController {
...
@@ -178,7 +177,7 @@ public class LanguageController {
if
(
StringUtil
.
isNotBlank
(
sCaption
))
{
if
(
StringUtil
.
isNotBlank
(
sCaption
))
{
tmp
.
put
(
"sCaption"
,
sCaption
);
tmp
.
put
(
"sCaption"
,
sCaption
);
}
}
service
.
update
(
sNodeID
,
JSON
.
toJSONString
(
tmp
,
true
));
service
.
update
(
node
.
getsNodeID
()
,
JSON
.
toJSONString
(
tmp
,
true
));
return
Rjx
.
jsonOk
();
return
Rjx
.
jsonOk
();
}
}
...
@@ -190,8 +189,8 @@ public class LanguageController {
...
@@ -190,8 +189,8 @@ public class LanguageController {
@ApiImplicitParam
(
paramType
=
"header"
,
name
=
"sig"
,
dataType
=
"string"
,
required
=
false
,
value
=
"sig"
),
@ApiImplicitParam
(
paramType
=
"header"
,
name
=
"sig"
,
dataType
=
"string"
,
required
=
false
,
value
=
"sig"
),
})
})
public
Object
queryByLink
(
String
sLink
)
{
public
Object
queryByLink
(
String
sLink
)
{
String
sNodeID
=
service
.
getNodeID
ByLink
(
sLink
);
T_lang_tree
node
=
service
.
getNode
ByLink
(
sLink
);
return
Rjx
.
jsonOk
().
setData
(
service
.
getNodeMapByID
(
sNodeID
)
);
return
Rjx
.
jsonOk
().
setData
(
node
);
}
}
@ResponseBody
@ResponseBody
...
@@ -203,10 +202,8 @@ public class LanguageController {
...
@@ -203,10 +202,8 @@ public class LanguageController {
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"sLink"
,
dataType
=
"string"
,
required
=
true
,
value
=
"要查询文档树的目录"
)
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"sLink"
,
dataType
=
"string"
,
required
=
true
,
value
=
"要查询文档树的目录"
)
})
})
public
Object
getDocumentsByLink
(
String
sLink
)
{
public
Object
getDocumentsByLink
(
String
sLink
)
{
String
sNodeID
=
service
.
getNodeIDByLink
(
sLink
);
T_lang_tree
node
=
service
.
getNodeByLink
(
sLink
);
Map
<
String
,
Object
>
map
=
service
.
getNodeMapByID
(
sNodeID
);
Map
<
String
,
Object
>
contentMap
=
GsonUtil
.
toMap
(
node
.
getsContentText
());
String
sContentText
=
(
String
)
map
.
get
(
"sContentText"
);
Map
<
String
,
Object
>
contentMap
=
GsonUtil
.
toMap
(
sContentText
);
List
<?>
ary
=
(
List
<?>)
contentMap
.
get
(
"sDocuments"
);
List
<?>
ary
=
(
List
<?>)
contentMap
.
get
(
"sDocuments"
);
Map
<
String
,
String
>
result
=
new
HashMap
<
String
,
String
>();
Map
<
String
,
String
>
result
=
new
HashMap
<
String
,
String
>();
if
(
ary
!=
null
&&
ary
.
size
()
>
0
)
{
if
(
ary
!=
null
&&
ary
.
size
()
>
0
)
{
...
@@ -233,16 +230,11 @@ public class LanguageController {
...
@@ -233,16 +230,11 @@ public class LanguageController {
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"sTopLink"
,
dataType
=
"string"
,
required
=
false
,
value
=
"要查询文档树的根[最上层]目录"
)
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"sTopLink"
,
dataType
=
"string"
,
required
=
false
,
value
=
"要查询文档树的根[最上层]目录"
)
})
})
public
Object
getTreeByLink
(
String
sTopLink
)
{
public
Object
getTreeByLink
(
String
sTopLink
)
{
String
sTopID
=
service
.
getNodeID
ByLink
(
sTopLink
);
T_lang_tree
node
=
service
.
getNode
ByLink
(
sTopLink
);
if
(
StringUtil
.
isBlank
(
sTopID
)
)
{
if
(
node
==
null
)
{
throw
new
XException
(
"找不到节点["
+
sTopLink
+
"]"
);
throw
new
XException
(
"找不到节点["
+
sTopLink
+
"]"
);
}
}
List
<
Map
<
String
,
Object
>>
list
=
null
;
List
<
Map
<
String
,
Object
>>
list
=
service
.
getListByTopID
(
node
.
getsTopID
());
if
(
sTopID
==
null
)
{
list
=
service
.
getListAll
();
}
else
{
list
=
service
.
getListByTopID
(
sTopID
);
}
return
Rjx
.
jsonOk
().
setData
(
this
.
toDoc
(
list
,
null
));
return
Rjx
.
jsonOk
().
setData
(
this
.
toDoc
(
list
,
null
));
}
}
...
@@ -293,10 +285,8 @@ public class LanguageController {
...
@@ -293,10 +285,8 @@ public class LanguageController {
tmp
.
add
(
map
);
tmp
.
add
(
map
);
}
}
}
}
String
sNodeID
=
service
.
getNodeIDByLink
(
sLink
,
true
);
T_lang_tree
node
=
service
.
getNodeByLink
(
sLink
);
Map
<
String
,
Object
>
nodeMap
=
service
.
getNodeMapByID
(
sNodeID
);
Map
<
String
,
Object
>
textMap
=
GsonUtil
.
toMap
(
node
.
getsContentText
());
String
sContentText
=
(
String
)
nodeMap
.
get
(
"sContentText"
);
Map
<
String
,
Object
>
textMap
=
GsonUtil
.
toMap
(
sContentText
);
String
caption
=
(
String
)
textMap
.
get
(
"sCaption"
);
String
caption
=
(
String
)
textMap
.
get
(
"sCaption"
);
List
<?>
list
=
(
List
<?>)
textMap
.
get
(
"sDocuments"
);
List
<?>
list
=
(
List
<?>)
textMap
.
get
(
"sDocuments"
);
if
(
list
!=
null
&&
list
.
size
()
>
0
)
{
if
(
list
!=
null
&&
list
.
size
()
>
0
)
{
...
@@ -327,7 +317,7 @@ public class LanguageController {
...
@@ -327,7 +317,7 @@ public class LanguageController {
map
.
put
(
"sCaption"
,
caption
);
map
.
put
(
"sCaption"
,
caption
);
map
.
put
(
"sDocuments"
,
tmp
);
map
.
put
(
"sDocuments"
,
tmp
);
if
(
isUpdate
)
{
if
(
isUpdate
)
{
service
.
update
(
sNodeID
,
JSON
.
toJSONString
(
map
,
true
));
service
.
update
(
node
.
getsNodeID
()
,
JSON
.
toJSONString
(
map
,
true
));
}
}
Map
<
String
,
String
>
result
=
new
HashMap
<
String
,
String
>();
Map
<
String
,
String
>
result
=
new
HashMap
<
String
,
String
>();
result
.
put
(
"Caption"
,
caption
);
result
.
put
(
"Caption"
,
caption
);
...
@@ -358,10 +348,8 @@ public class LanguageController {
...
@@ -358,10 +348,8 @@ public class LanguageController {
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"sDocument"
,
dataType
=
"string"
,
required
=
false
,
value
=
"sDocument"
)
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"sDocument"
,
dataType
=
"string"
,
required
=
false
,
value
=
"sDocument"
)
})
})
public
Object
translate
(
String
sLink
,
String
sDocument
)
{
public
Object
translate
(
String
sLink
,
String
sDocument
)
{
String
sNodeID
=
service
.
getNodeIDByLink
(
sLink
,
true
);
T_lang_tree
node
=
service
.
getNodeByLink
(
sLink
);
Map
<
String
,
Object
>
nodeMap
=
service
.
getNodeMapByID
(
sNodeID
);
Map
<
String
,
Object
>
textMap
=
GsonUtil
.
toMap
(
node
.
getsContentText
());
String
sContentText
=
(
String
)
nodeMap
.
get
(
"sContentText"
);
Map
<
String
,
Object
>
textMap
=
GsonUtil
.
toMap
(
sContentText
);
String
sCaption
=
(
String
)
textMap
.
get
(
"sCaption"
);
String
sCaption
=
(
String
)
textMap
.
get
(
"sCaption"
);
List
<?>
objList
=
(
List
<?>)
textMap
.
get
(
"sDocuments"
);
List
<?>
objList
=
(
List
<?>)
textMap
.
get
(
"sDocuments"
);
List
<
Object
>
list
=
objList
==
null
?
new
ArrayList
<
Object
>()
:
new
ArrayList
<
Object
>(
objList
);
List
<
Object
>
list
=
objList
==
null
?
new
ArrayList
<
Object
>()
:
new
ArrayList
<
Object
>(
objList
);
...
@@ -389,7 +377,7 @@ public class LanguageController {
...
@@ -389,7 +377,7 @@ public class LanguageController {
Map
<
String
,
Object
>
tmp
=
new
HashMap
<
String
,
Object
>();
Map
<
String
,
Object
>
tmp
=
new
HashMap
<
String
,
Object
>();
tmp
.
put
(
"sCaption"
,
sCaption
);
tmp
.
put
(
"sCaption"
,
sCaption
);
tmp
.
put
(
"sDocuments"
,
list
);
tmp
.
put
(
"sDocuments"
,
list
);
service
.
update
(
sNodeID
,
JSON
.
toJSONString
(
tmp
,
true
));
service
.
update
(
node
.
getsNodeID
()
,
JSON
.
toJSONString
(
tmp
,
true
));
}
}
return
Rjx
.
jsonOk
().
setData
(
dst
);
return
Rjx
.
jsonOk
().
setData
(
dst
);
}
}
...
...
src/main/java/com/egolm/lang/bean/T_lang_tree.java
View file @
46da17a7
...
@@ -3,12 +3,14 @@ package com.egolm.lang.bean;
...
@@ -3,12 +3,14 @@ package com.egolm.lang.bean;
import
java.io.Serializable
;
import
java.io.Serializable
;
import
javax.persistence.Entity
;
import
javax.persistence.Entity
;
import
javax.persistence.Id
;
@Entity
@Entity
(
name
=
"t_lang_tree"
)
public
class
T_lang_tree
implements
Serializable
{
public
class
T_lang_tree
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
private
static
final
long
serialVersionUID
=
1L
;
@Id
private
String
sNodeID
;
private
String
sNodeID
;
private
String
sNodeNO
;
private
String
sNodeNO
;
private
String
sParentID
;
private
String
sParentID
;
...
...
src/main/java/com/egolm/lang/service/LanguageService.java
View file @
46da17a7
...
@@ -3,13 +3,13 @@ package com.egolm.lang.service;
...
@@ -3,13 +3,13 @@ package com.egolm.lang.service;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
public
interface
LanguageService
{
import
com.egolm.lang.bean.T_lang_tree
;
public
String
getNodeIDByLink
(
String
sLink
);
public
interface
LanguageService
{
public
String
getNodeIDByLink
(
String
sLink
,
boolean
ifNullCreate
);
public
T_lang_tree
getNodeByLink
(
String
sLink
);
public
Map
<
String
,
Object
>
getNodeMapByID
(
String
sNodeID
);
public
T_lang_tree
getNodeByLink
(
String
sLink
,
boolean
ifNullCreate
);
public
void
update
(
String
sNodeID
,
String
sContentText
);
public
void
update
(
String
sNodeID
,
String
sContentText
);
...
@@ -19,8 +19,6 @@ public interface LanguageService {
...
@@ -19,8 +19,6 @@ public interface LanguageService {
public
void
delete
(
String
sNodeID
);
public
void
delete
(
String
sNodeID
);
public
void
append
(
String
sLink
);
public
List
<
Map
<
String
,
Object
>>
getListByTopID
(
String
sTopID
);
public
List
<
Map
<
String
,
Object
>>
getListByTopID
(
String
sTopID
);
public
List
<
Map
<
String
,
Object
>>
getListAll
();
public
List
<
Map
<
String
,
Object
>>
getListAll
();
...
...
src/main/java/com/egolm/lang/service/impl/LanguageServiceImpl.java
View file @
46da17a7
...
@@ -28,17 +28,16 @@ public class LanguageServiceImpl implements LanguageService {
...
@@ -28,17 +28,16 @@ public class LanguageServiceImpl implements LanguageService {
this
.
jdbcTemplate
=
jdbcTemplate
;
this
.
jdbcTemplate
=
jdbcTemplate
;
}
}
@Override
public
T_lang_tree
getNodeByLink
(
String
sLink
)
{
public
String
getNodeIDByLink
(
String
sLink
)
{
return
this
.
getNodeByLink
(
sLink
,
false
);
return
this
.
getNodeIDByLink
(
sLink
,
false
);
}
}
@Override
public
T_lang_tree
getNodeByLink
(
String
sLink
,
boolean
ifNullCreate
)
{
public
String
getNodeIDByLink
(
String
sLink
,
boolean
ifNullCreate
)
{
T_lang_tree
node
=
null
;
String
sNodeID
=
null
;
String
sTopID
=
null
;
if
(
sLink
!=
null
)
{
if
(
sLink
!=
null
)
{
for
(
String
sNodeNO
:
sLink
.
split
(
"[/]+"
))
{
for
(
String
sNodeNO
:
sLink
.
split
(
"[/]+"
))
{
String
sNodeID
=
node
==
null
?
null
:
node
.
getsNodeID
();
String
sTopID
=
node
==
null
?
null
:
node
.
getsTopID
();
List
<
String
>
args
=
new
ArrayList
<
String
>();
List
<
String
>
args
=
new
ArrayList
<
String
>();
List
<
Object
>
objs
=
new
ArrayList
<
Object
>();
List
<
Object
>
objs
=
new
ArrayList
<
Object
>();
args
.
add
(
"sNodeNO = ?"
);
args
.
add
(
"sNodeNO = ?"
);
...
@@ -50,35 +49,27 @@ public class LanguageServiceImpl implements LanguageService {
...
@@ -50,35 +49,27 @@ public class LanguageServiceImpl implements LanguageService {
objs
.
add
(
sNodeID
);
objs
.
add
(
sNodeID
);
}
}
String
sql
=
"select sNodeID, sTopID from t_lang_tree"
+
StringUtil
.
join
(
" and "
,
" where "
,
args
);
String
sql
=
"select sNodeID, sTopID from t_lang_tree"
+
StringUtil
.
join
(
" and "
,
" where "
,
args
);
List
<
Map
<
String
,
Object
>>
list
=
jdbcTemplate
.
queryForList
(
sql
,
objs
.
toArray
());
List
<
T_lang_tree
>
list
=
jdbcTemplate
.
queryForBeans
(
sql
,
T_lang_tree
.
class
,
objs
.
toArray
());
if
(
list
.
size
()
==
0
)
{
if
(
list
.
size
()
==
0
)
{
if
(
ifNullCreate
)
{
if
(
ifNullCreate
)
{
T_lang_tree
node
=
new
T_lang_tree
();
node
=
new
T_lang_tree
();
node
.
setsNodeID
(
StringUtil
.
getUid
());
node
.
setsNodeID
(
StringUtil
.
getUid
());
node
.
setsParentID
(
sNodeID
);
node
.
setsParentID
(
sNodeID
);
node
.
setsTopID
(
sTopID
==
null
?
node
.
getsNodeID
()
:
sTopID
);
node
.
setsTopID
(
sTopID
==
null
?
node
.
getsNodeID
()
:
sTopID
);
node
.
setnDelFlag
(
0
);
node
.
setnDelFlag
(
0
);
node
.
setsNodeNO
(
sNodeNO
);
node
.
setsNodeNO
(
sNodeNO
);
jdbcTemplate
.
save
(
node
);
jdbcTemplate
.
save
(
node
);
sNodeID
=
node
.
getsNodeID
();
sTopID
=
node
.
getsTopID
();
}
else
{
}
else
{
return
null
;
return
null
;
}
}
}
else
if
(
list
.
size
()
==
1
)
{
}
else
if
(
list
.
size
()
==
1
)
{
sNodeID
=
(
String
)
list
.
get
(
0
).
get
(
"sNodeID"
);
node
=
list
.
get
(
0
);
sTopID
=
(
String
)
list
.
get
(
0
).
get
(
"sTopID"
);
}
else
{
}
else
{
throw
new
XException
(
"节点编号重复["
+
sNodeNO
+
"]"
);
throw
new
XException
(
"节点编号重复["
+
sNodeNO
+
"]"
);
}
}
}
}
}
}
return
sNodeID
;
return
node
;
}
@Override
public
Map
<
String
,
Object
>
getNodeMapByID
(
String
sNodeID
)
{
return
jdbcTemplate
.
queryForMap
(
"select * from t_lang_tree where sNodeID = ?"
,
sNodeID
);
}
}
@Override
@Override
...
@@ -101,11 +92,6 @@ public class LanguageServiceImpl implements LanguageService {
...
@@ -101,11 +92,6 @@ public class LanguageServiceImpl implements LanguageService {
jdbcTemplate
.
executeUpdate
(
"delete from t_lang_tree where sNodeID = ?"
,
sNodeID
);
jdbcTemplate
.
executeUpdate
(
"delete from t_lang_tree where sNodeID = ?"
,
sNodeID
);
}
}
@Override
public
void
append
(
String
sLink
)
{
this
.
getNodeIDByLink
(
sLink
,
true
);
}
@Override
@Override
public
List
<
Map
<
String
,
Object
>>
getListByTopID
(
String
sTopID
)
{
public
List
<
Map
<
String
,
Object
>>
getListByTopID
(
String
sTopID
)
{
String
sql
=
"select * from t_lang_tree where sTopID = ? and nDelFlag = ?"
;
String
sql
=
"select * from t_lang_tree where sTopID = ? and nDelFlag = ?"
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment