Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
T
topsun-bpm
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
鲁鑫
topsun-bpm
Commits
3099a277
Commit
3099a277
authored
Nov 14, 2023
by
鲁鑫
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
资源库树结构和资源类型增删改查
parent
5846e3ec
Show whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
1023 additions
and
271 deletions
+1023
-271
jquery.commonTree.js
huigou-xt/src/main/webapp/lib/jquery/jquery.commonTree.js
+371
-200
spring-mybatis-plus.xml
.../src/main/resources/config/spring/spring-mybatis-plus.xml
+1
-1
spring-resource-basenames.xml
...ain/resources/config/spring/spring-resource-basenames.xml
+1
-9
HomePage.jsp
topsun-xt/src/main/webapp/HomePage.jsp
+2
-2
fieldTreeDetail.js
...xt/src/main/webapp/biz/topsun/resource/fieldTreeDetail.js
+113
-0
fieldTreeDetail.jsp
...t/src/main/webapp/biz/topsun/resource/fieldTreeDetail.jsp
+27
-0
fieldValueDetail.js
...t/src/main/webapp/biz/topsun/resource/fieldValueDetail.js
+38
-0
fieldValueDetail.jsp
.../src/main/webapp/biz/topsun/resource/fieldValueDetail.jsp
+15
-0
resourceList.js
...un-xt/src/main/webapp/biz/topsun/resource/resourceList.js
+208
-0
resourceList.jsp
...n-xt/src/main/webapp/biz/topsun/resource/resourceList.jsp
+26
-3
ResourceController.java
...huigou/topsun/resource/controller/ResourceController.java
+67
-13
ResourceFieldController.java
...u/topsun/resource/controller/ResourceFieldController.java
+24
-4
ResourceFiled.java
...java/com/huigou/topsun/resource/domain/ResourceFiled.java
+0
-5
ResourceTypeMapper.java
...com/huigou/topsun/resource/mapper/ResourceTypeMapper.java
+6
-0
ResourceTypeService.java
...m/huigou/topsun/resource/service/ResourceTypeService.java
+6
-2
ResourceFiledServiceImpl.java
...opsun/resource/service/impl/ResourceFiledServiceImpl.java
+22
-7
ResourceTypeServiceImpl.java
...topsun/resource/service/impl/ResourceTypeServiceImpl.java
+22
-15
ResourceFiledVo.java
...n/java/com/huigou/topsun/resource/vo/ResourceFiledVo.java
+9
-7
ResourceTypeTreeVo.java
...ava/com/huigou/topsun/resource/vo/ResourceTypeTreeVo.java
+35
-0
A
topsun/src/main/resources/config/topsun/mapper/A
+0
-0
ResourceFiledMapper.xml
...ces/config/topsun/mapper/resource/ResourceFiledMapper.xml
+9
-3
ResourceTypeMapper.xml
...rces/config/topsun/mapper/resource/ResourceTypeMapper.xml
+21
-0
No files found.
huigou-xt/src/main/webapp/lib/jquery/jquery.commonTree.js
View file @
3099a277
...
@@ -11,10 +11,10 @@
...
@@ -11,10 +11,10 @@
new
CommonTree
(
this
,
op
);
new
CommonTree
(
this
,
op
);
}
else
{
}
else
{
if
(
typeof
op
==
"string"
)
{
if
(
typeof
op
==
"string"
)
{
var
_self
=
this
,
value
=
null
,
args
=
arguments
;
var
_self
=
this
,
value
=
null
,
args
=
arguments
;
var
_ms
=
[
'refresh'
,
'refreshParent'
,
'reload'
];
var
_ms
=
[
'refresh'
,
'refreshParent'
,
'reload'
];
_ms
.
push
(
'expandById'
,
'updateNode'
,
'updateNodeName'
);
_ms
.
push
(
'expandById'
,
'updateNode'
,
'updateNodeName'
);
_ms
.
push
(
'getSelectedId'
,
'getSelected'
,
'getChecked'
,
'cancelSelect'
,
'selectNode'
);
_ms
.
push
(
'getSelectedId'
,
'getSelected'
,
'getChecked'
,
'cancelSelect'
,
'selectNode'
);
$
.
each
(
_ms
,
function
(
i
,
m
)
{
$
.
each
(
_ms
,
function
(
i
,
m
)
{
if
(
op
==
m
)
{
if
(
op
==
m
)
{
args
=
Array
.
prototype
.
slice
.
call
(
args
,
1
);
args
=
Array
.
prototype
.
slice
.
call
(
args
,
1
);
...
@@ -29,6 +29,7 @@
...
@@ -29,6 +29,7 @@
}
}
return
this
;
return
this
;
};
};
//公用树类定义
//公用树类定义
function
CommonTree
(
el
,
op
)
{
function
CommonTree
(
el
,
op
)
{
this
.
options
=
{};
this
.
options
=
{};
...
@@ -46,12 +47,16 @@
...
@@ -46,12 +47,16 @@
this
.
options
=
$
.
extend
({
this
.
options
=
$
.
extend
({
loadTreesAction
:
'commonTree/queryCommonTrees.ajax'
,
loadTreesAction
:
'commonTree/queryCommonTrees.ajax'
,
addFolderAction
:
'commonTree/forwardCommonTreeDetail.load'
,
addFolderAction
:
'commonTree/forwardCommonTreeDetail.load'
,
addFieldMenuAction
:
'resource/forwardFieldTreeDetail.load'
,
updateFieldMenuAction
:
'resource/forwardUpdateFieldTreeDetail.load'
,
deleteFieldAction
:
'resource/deleteResourceType.ajax'
,
saveFieldMenuAction
:
'resource/saveResourceType.ajax'
,
appendAction
:
'commonTree/insertCommonTree.ajax'
,
appendAction
:
'commonTree/insertCommonTree.ajax'
,
loadNodeAction
:
'commonTree/loadCommonTree.load'
,
loadNodeAction
:
'commonTree/loadCommonTree.load'
,
updateAction
:
'commonTree/updateCommonTree.ajax'
,
updateAction
:
'commonTree/updateCommonTree.ajax'
,
deleteAction
:
'commonTree/deleteCommonTree.ajax'
,
deleteAction
:
'commonTree/deleteCommonTree.ajax'
,
updateSequenceAction
:
'commonTree/updateCommonTreeSequence.ajax'
,
updateSequenceAction
:
'commonTree/updateCommonTreeSequence.ajax'
,
dialogWidth
:
350
,
dialogWidth
:
350
,
root
:
'Rows'
,
root
:
'Rows'
,
idFieldName
:
'id'
,
idFieldName
:
'id'
,
parentIDFieldName
:
'parentId'
,
parentIDFieldName
:
'parentId'
,
...
@@ -61,9 +66,9 @@
...
@@ -61,9 +66,9 @@
sortorderParmName
:
'sortorder'
,
//页排序方向(提交给服务器)
sortorderParmName
:
'sortorder'
,
//页排序方向(提交给服务器)
sortName
:
'sequence'
,
//排序列名
sortName
:
'sequence'
,
//排序列名
sortOrder
:
'asc'
,
//排序方向
sortOrder
:
'asc'
,
//排序方向
manageType
:
null
,
//查询使用的管理权限类别
manageType
:
null
,
//查询使用的管理权限类别
nodeWidth
:
180
,
nodeWidth
:
180
,
nodeClassName
:
null
,
nodeClassName
:
null
,
getParam
:
null
,
//动态获取参数方法
getParam
:
null
,
//动态获取参数方法
kindId
:
1
,
kindId
:
1
,
parentId
:
0
,
parentId
:
0
,
...
@@ -71,82 +76,84 @@
...
@@ -71,82 +76,84 @@
onAfterAppend
:
null
,
onAfterAppend
:
null
,
changeNodeIcon
:
null
,
changeNodeIcon
:
null
,
onbeforeShowMenu
:
null
,
onbeforeShowMenu
:
null
,
onDelay
:
null
,
onDelay
:
null
,
dataRender
:
null
,
dataRender
:
null
,
isLeaf
:
null
,
isLeaf
:
null
,
menuName
:
'文件夹'
,
menuName
:
'文件夹'
,
IsShowMenu
:
true
,
//是否显示菜单
IsShowMenu
:
true
,
//是否显示菜单
formBar
:
true
IsShowFieldMenu
:
false
,
//是否显示添加字段菜单
formBar
:
true
},
this
.
options
,
op
||
{});
},
this
.
options
,
op
||
{});
},
},
init
:
function
(
el
)
{
init
:
function
(
el
)
{
var
opt
=
this
.
options
,
_self
=
this
;
var
opt
=
this
.
options
,
_self
=
this
;
var
menuName
=
opt
.
menuName
var
menuName
=
opt
.
menuName
if
(
opt
.
IsShowMenu
)
{
if
(
opt
.
IsShowMenu
)
{
if
(
opt
.
formBar
)
{
if
(
opt
.
formBar
)
{
var
div
=
$
(
'<div class="ui-form-bar dom-overflow"></div>'
).
appendTo
(
$
(
el
).
parent
());
var
div
=
$
(
'<div class="ui-form-bar dom-overflow"></div>'
).
appendTo
(
$
(
el
).
parent
());
$
(
'<div class="ui-hold-bar"></div>'
).
insertAfter
(
div
);
$
(
'<div class="ui-hold-bar"></div>'
).
insertAfter
(
div
);
var
offset
=
$
(
el
).
offset
();
var
offset
=
$
(
el
).
offset
();
div
.
css
({
position
:
'absolute'
,
textAlign
:
'center'
,
zIndex
:
100
});
div
.
css
({
position
:
'absolute'
,
textAlign
:
'center'
,
zIndex
:
100
});
var
html
=
[
'<div class="btn-group btn-group-sm">'
];
var
html
=
[
'<div class="btn-group btn-group-sm">'
];
html
.
push
(
'<button data-kind="add" title="'
,
$
.
i18nProp
(
'common.button.add'
),
'" type="button" class="btn btn-gray"><i class="fa fa-plus"></i></button>'
);
html
.
push
(
'<button data-kind="add" title="'
,
$
.
i18nProp
(
'common.button.add'
),
'" type="button" class="btn btn-gray"><i class="fa fa-plus"></i></button>'
);
html
.
push
(
'<button data-kind="update" title="'
,
$
.
i18nProp
(
'common.button.update'
),
'" type="button" class="btn btn-gray"><i class="fa fa-edit"></i></button>'
);
html
.
push
(
'<button data-kind="update" title="'
,
$
.
i18nProp
(
'common.button.update'
),
'" type="button" class="btn btn-gray"><i class="fa fa-edit"></i></button>'
);
html
.
push
(
'<button data-kind="delete" title="'
,
$
.
i18nProp
(
'common.button.delete'
),
'" type="button" class="btn btn-gray"><i class="fa fa-trash-o"></i></button>'
);
html
.
push
(
'<button data-kind="delete" title="'
,
$
.
i18nProp
(
'common.button.delete'
),
'" type="button" class="btn btn-gray"><i class="fa fa-trash-o"></i></button>'
);
html
.
push
(
'<button data-kind="moveUp" title="'
,
$
.
i18nProp
(
'common.button.move.up'
),
'" type="button" class="btn btn-gray"><i class="fa fa-arrow-circle-up"></i></button>'
);
html
.
push
(
'<button data-kind="moveUp" title="'
,
$
.
i18nProp
(
'common.button.move.up'
),
'" type="button" class="btn btn-gray"><i class="fa fa-arrow-circle-up"></i></button>'
);
html
.
push
(
'<button data-kind="moveDown" title="'
,
$
.
i18nProp
(
'common.button.move.down'
),
'" type="button" class="btn btn-gray"><i class="fa fa-arrow-circle-down"></i></button>'
);
html
.
push
(
'<button data-kind="moveDown" title="'
,
$
.
i18nProp
(
'common.button.move.down'
),
'" type="button" class="btn btn-gray"><i class="fa fa-arrow-circle-down"></i></button>'
);
html
.
push
(
'<button data-kind="refresh" title="'
,
$
.
i18nProp
(
'common.button.refresh'
),
'" type="button" class="btn btn-gray"><i class="fa fa-repeat"></i></button>'
);
html
.
push
(
'<button data-kind="refresh" title="'
,
$
.
i18nProp
(
'common.button.refresh'
),
'" type="button" class="btn btn-gray"><i class="fa fa-repeat"></i></button>'
);
html
.
push
(
'</div>'
);
html
.
push
(
'</div>'
);
div
.
html
(
html
.
join
(
''
));
div
.
html
(
html
.
join
(
''
));
div
.
on
(
'click'
,
function
(
e
)
{
div
.
on
(
'click'
,
function
(
e
)
{
var
$clicked
=
$
(
e
.
target
||
e
.
srcElement
);
var
$clicked
=
$
(
e
.
target
||
e
.
srcElement
);
if
(
$clicked
.
hasClass
(
'fa'
))
{
if
(
$clicked
.
hasClass
(
'fa'
))
{
$clicked
=
$clicked
.
parent
();
$clicked
=
$clicked
.
parent
();
}
}
if
(
$clicked
.
is
(
'button'
))
{
if
(
$clicked
.
is
(
'button'
))
{
var
_kind
=
$clicked
.
data
(
'kind'
),
_eventName
=
_kind
+
'BarEvent'
;
var
_kind
=
$clicked
.
data
(
'kind'
),
_eventName
=
_kind
+
'BarEvent'
;
var
node
=
_self
.
treeManager
.
getSelected
();
var
node
=
_self
.
treeManager
.
getSelected
();
if
(
$
.
isFunction
(
opt
[
_eventName
])){
if
(
$
.
isFunction
(
opt
[
_eventName
]))
{
opt
[
_eventName
].
call
(
_self
,
node
);
opt
[
_eventName
].
call
(
_self
,
node
);
return
;
node
return
;
node
}
}
if
(
_kind
==
'refresh'
)
{
if
(
_kind
==
'refresh'
)
{
if
(
node
)
{
if
(
node
)
{
_self
.
_refreshNode
(
node
.
data
[
opt
.
idFieldName
]);
_self
.
_refreshNode
(
node
.
data
[
opt
.
idFieldName
]);
}
else
{
}
else
{
_self
.
reload
();
_self
.
reload
();
}
}
return
;
return
;
}
}
if
(
!
node
)
{
if
(
!
node
)
{
//新增根节点
//新增根节点
if
(
_kind
==
'add'
)
{
if
(
_kind
==
'add'
)
{
_self
.
id
=
opt
.
parentId
;
_self
.
id
=
opt
.
parentId
;
_self
.
_addFolder
();
_self
.
_addFolder
();
return
;
return
;
}
else
{
}
else
{
Public
.
tip
(
'common.warning.not.nodetree'
);
Public
.
tip
(
'common.warning.not.nodetree'
);
return
false
;
return
false
;
}
}
}
}
_self
.
id
=
node
.
data
[
opt
.
idFieldName
];
_self
.
id
=
node
.
data
[
opt
.
idFieldName
];
_self
.
kindId
=
node
.
data
.
kindId
;
_self
.
kindId
=
node
.
data
.
kindId
;
if
(
_kind
==
'add'
)
{
if
(
_kind
==
'add'
)
{
_self
.
_addFolder
();
_self
.
_addFolder
();
return
;
return
;
}
else
if
(
_kind
==
'update'
)
{
}
else
if
(
_kind
==
'update'
)
{
_self
.
_updateFolder
();
_self
.
_updateFolder
();
return
;
return
;
}
else
if
(
_kind
==
'delete'
)
{
}
else
if
(
_kind
==
'delete'
)
{
_self
.
_deleteFolder
();
_self
.
_deleteFolder
();
return
;
return
;
}
else
if
(
_kind
==
'moveDown'
)
{
}
else
if
(
_kind
==
'moveDown'
)
{
if
(
!
_self
.
_checkMoveFolderByClassName
(
node
,
'down'
))
{
if
(
!
_self
.
_checkMoveFolderByClassName
(
node
,
'down'
))
{
return
false
;
return
false
;
}
}
_self
.
_moveFolder
(
false
);
_self
.
_moveFolder
(
false
);
return
;
return
;
}
else
if
(
_kind
==
'moveUp'
)
{
}
else
if
(
_kind
==
'moveUp'
)
{
if
(
!
_self
.
_checkMoveFolderByClassName
(
node
,
'up'
))
{
if
(
!
_self
.
_checkMoveFolderByClassName
(
node
,
'up'
))
{
return
false
;
return
false
;
}
}
_self
.
_moveFolder
(
true
);
_self
.
_moveFolder
(
true
);
...
@@ -156,12 +163,72 @@
...
@@ -156,12 +163,72 @@
});
});
}
}
}
}
if
(
opt
.
IsShowFieldMenu
)
{
if
(
opt
.
formBar
)
{
var
div
=
$
(
'<div class="ui-form-bar dom-overflow"></div>'
).
appendTo
(
$
(
el
).
parent
());
$
(
'<div class="ui-hold-bar"></div>'
).
insertAfter
(
div
);
var
offset
=
$
(
el
).
offset
();
div
.
css
({
position
:
'absolute'
,
textAlign
:
'center'
,
zIndex
:
100
});
var
html
=
[
'<div class="btn-group btn-group-sm">'
];
html
.
push
(
'<button data-kind="add" title="'
,
$
.
i18nProp
(
'common.button.add'
),
'" type="button" class="btn btn-gray"><i class="fa fa-plus"></i></button>'
);
html
.
push
(
'<button data-kind="update" title="'
,
$
.
i18nProp
(
'common.button.update'
),
'" type="button" class="btn btn-gray"><i class="fa fa-edit"></i></button>'
);
html
.
push
(
'<button data-kind="delete" title="'
,
$
.
i18nProp
(
'common.button.delete'
),
'" type="button" class="btn btn-gray"><i class="fa fa-trash-o"></i></button>'
);
html
.
push
(
'</div>'
);
div
.
html
(
html
.
join
(
''
));
div
.
on
(
'click'
,
function
(
e
)
{
var
$clicked
=
$
(
e
.
target
||
e
.
srcElement
);
if
(
$clicked
.
hasClass
(
'fa'
))
{
$clicked
=
$clicked
.
parent
();
}
if
(
$clicked
.
is
(
'button'
))
{
var
_kind
=
$clicked
.
data
(
'kind'
),
_eventName
=
_kind
+
'BarEvent'
;
var
node
=
_self
.
treeManager
.
getSelected
();
if
(
$
.
isFunction
(
opt
[
_eventName
]))
{
opt
[
_eventName
].
call
(
_self
,
node
);
return
;
node
}
if
(
_kind
==
'refresh'
)
{
if
(
node
)
{
_self
.
_refreshNode
(
node
.
data
[
opt
.
idFieldName
]);
}
else
{
_self
.
reload
();
}
return
;
}
if
(
!
node
)
{
//新增根节点
if
(
_kind
==
'add'
)
{
_self
.
id
=
opt
.
parentId
;
_self
.
_addField
();
return
;
}
else
{
Public
.
tip
(
'common.warning.not.nodetree'
);
return
false
;
}
}
_self
.
id
=
node
.
data
[
opt
.
idFieldName
];
_self
.
kindId
=
node
.
data
.
kindId
;
if
(
_kind
==
'add'
)
{
_self
.
_addField
();
return
;
}
else
if
(
_kind
==
'update'
){
_self
.
_updateField
();
return
;
}
else
if
(
_kind
==
'delete'
){
_self
.
_deleteField
();
return
;
}
}
});
}
}
this
.
kindId
=
opt
.
kindId
;
this
.
kindId
=
opt
.
kindId
;
var
param
=
{
kindId
:
opt
.
kindId
};
var
param
=
{
kindId
:
opt
.
kindId
};
param
[
opt
.
parentIDFieldName
]
=
opt
.
parentId
;
param
[
opt
.
parentIDFieldName
]
=
opt
.
parentId
;
param
[
opt
.
sortnameParmName
]
=
opt
.
sortName
;
param
[
opt
.
sortnameParmName
]
=
opt
.
sortName
;
param
[
opt
.
sortorderParmName
]
=
opt
.
sortOrder
;
param
[
opt
.
sortorderParmName
]
=
opt
.
sortOrder
;
if
(
opt
.
manageType
)
{
if
(
opt
.
manageType
)
{
param
[
Public
.
manageTypeParmName
]
=
opt
.
manageType
;
param
[
Public
.
manageTypeParmName
]
=
opt
.
manageType
;
}
}
if
(
$
.
isFunction
(
opt
.
getParam
))
{
if
(
$
.
isFunction
(
opt
.
getParam
))
{
...
@@ -176,15 +243,15 @@
...
@@ -176,15 +243,15 @@
parentIDFieldName
:
opt
.
parentIDFieldName
,
parentIDFieldName
:
opt
.
parentIDFieldName
,
textFieldName
:
opt
.
textFieldName
,
textFieldName
:
opt
.
textFieldName
,
iconFieldName
:
opt
.
iconFieldName
,
iconFieldName
:
opt
.
iconFieldName
,
autoCheckboxEven
:
opt
.
autoCheckboxEven
||
false
,
autoCheckboxEven
:
opt
.
autoCheckboxEven
||
false
,
nodeWidth
:
opt
.
nodeWidth
,
nodeWidth
:
opt
.
nodeWidth
,
checkbox
:
opt
.
checkbox
||
false
,
checkbox
:
opt
.
checkbox
||
false
,
nodeClassName
:
opt
.
nodeClassName
,
nodeClassName
:
opt
.
nodeClassName
,
dataRender
:
function
(
data
)
{
dataRender
:
function
(
data
)
{
if
(
$
.
isFunction
(
opt
.
dataRender
))
{
if
(
$
.
isFunction
(
opt
.
dataRender
))
{
return
opt
.
dataRender
.
call
(
_self
,
data
);
return
opt
.
dataRender
.
call
(
_self
,
data
);
}
}
return
data
[
opt
.
root
]
||
data
;
return
data
[
opt
.
root
]
||
data
;
},
},
isLeaf
:
function
(
data
)
{
isLeaf
:
function
(
data
)
{
if
(
$
.
isFunction
(
opt
.
changeNodeIcon
))
{
if
(
$
.
isFunction
(
opt
.
changeNodeIcon
))
{
...
@@ -193,7 +260,7 @@
...
@@ -193,7 +260,7 @@
if
(
$
.
isFunction
(
opt
.
isLeaf
))
{
if
(
$
.
isFunction
(
opt
.
isLeaf
))
{
return
opt
.
isLeaf
.
call
(
_self
,
data
);
return
opt
.
isLeaf
.
call
(
_self
,
data
);
}
}
if
(
!
$
.
isArray
(
data
.
children
))
{
if
(
!
$
.
isArray
(
data
.
children
))
{
data
.
children
=
[];
data
.
children
=
[];
}
}
return
parseInt
(
data
.
hasChildren
)
==
0
;
return
parseInt
(
data
.
hasChildren
)
==
0
;
...
@@ -213,33 +280,33 @@
...
@@ -213,33 +280,33 @@
return
_self
.
_onContextmenu
.
call
(
_self
,
node
,
e
);
return
_self
.
_onContextmenu
.
call
(
_self
,
node
,
e
);
},
},
delay
:
function
(
e
)
{
delay
:
function
(
e
)
{
if
(
$
.
isFunction
(
opt
.
onDelay
))
{
if
(
$
.
isFunction
(
opt
.
onDelay
))
{
return
opt
.
onDelay
.
call
(
this
,
e
,
opt
);
return
opt
.
onDelay
.
call
(
this
,
e
,
opt
);
}
}
var
param
=
{};
var
param
=
{};
param
[
opt
.
parentIDFieldName
]
=
e
.
data
[
opt
.
idFieldName
];
param
[
opt
.
parentIDFieldName
]
=
e
.
data
[
opt
.
idFieldName
];
param
[
opt
.
sortnameParmName
]
=
opt
.
sortName
;
param
[
opt
.
sortnameParmName
]
=
opt
.
sortName
;
param
[
opt
.
sortorderParmName
]
=
opt
.
sortOrder
;
param
[
opt
.
sortorderParmName
]
=
opt
.
sortOrder
;
if
(
opt
.
manageType
)
{
if
(
opt
.
manageType
)
{
param
[
Public
.
manageTypeParmName
]
=
opt
.
manageType
;
param
[
Public
.
manageTypeParmName
]
=
opt
.
manageType
;
}
}
if
(
$
.
isFunction
(
opt
.
getParam
))
{
if
(
$
.
isFunction
(
opt
.
getParam
))
{
var
p
=
opt
.
getParam
.
call
(
this
,
e
.
data
);
var
p
=
opt
.
getParam
.
call
(
this
,
e
.
data
);
param
=
$
.
extend
(
param
,
p
||
{});
param
=
$
.
extend
(
param
,
p
||
{});
}
}
return
{
url
:
web_app
.
name
+
'/'
+
opt
.
loadTreesAction
,
parms
:
param
};
return
{
url
:
web_app
.
name
+
'/'
+
opt
.
loadTreesAction
,
parms
:
param
};
}
}
});
});
},
},
_checkMoveFolderByClassName
:
function
(
node
,
button
)
{
_checkMoveFolderByClassName
:
function
(
node
,
button
)
{
if
(
node
.
target
.
className
.
indexOf
(
'l-onlychild'
)
>=
0
)
{
if
(
node
.
target
.
className
.
indexOf
(
'l-onlychild'
)
>=
0
)
{
return
false
;
return
false
;
}
else
if
(
node
.
target
.
className
.
indexOf
(
'l-first'
)
>=
0
)
{
}
else
if
(
node
.
target
.
className
.
indexOf
(
'l-first'
)
>=
0
)
{
if
(
button
==
'up'
)
{
if
(
button
==
'up'
)
{
return
false
;
return
false
;
}
}
}
else
if
(
node
.
target
.
className
.
indexOf
(
'l-last'
)
>=
0
)
{
}
else
if
(
node
.
target
.
className
.
indexOf
(
'l-last'
)
>=
0
)
{
if
(
button
==
'down'
)
{
if
(
button
==
'down'
)
{
return
false
;
return
false
;
}
}
}
}
...
@@ -251,6 +318,9 @@
...
@@ -251,6 +318,9 @@
if
(
!
opt
.
IsShowMenu
)
{
if
(
!
opt
.
IsShowMenu
)
{
return
false
;
return
false
;
}
}
if
(
!
opt
.
IsShowFieldMenu
)
{
return
false
;
}
if
(
$
.
isFunction
(
opt
.
onbeforeShowMenu
))
{
if
(
$
.
isFunction
(
opt
.
onbeforeShowMenu
))
{
if
(
opt
.
onbeforeShowMenu
.
call
(
this
,
node
)
===
false
)
{
if
(
opt
.
onbeforeShowMenu
.
call
(
this
,
node
)
===
false
)
{
return
false
;
return
false
;
...
@@ -291,7 +361,7 @@
...
@@ -291,7 +361,7 @@
/*新增节点*/
/*新增节点*/
_addFolder
:
function
(
callBack
)
{
_addFolder
:
function
(
callBack
)
{
var
opt
=
this
.
options
,
_self
=
this
;
var
opt
=
this
.
options
,
_self
=
this
;
var
menuName
=
opt
.
menuName
var
menuName
=
opt
.
menuName
UICtrl
.
showAjaxDialog
({
UICtrl
.
showAjaxDialog
({
url
:
web_app
.
name
+
"/"
+
opt
.
addFolderAction
,
url
:
web_app
.
name
+
"/"
+
opt
.
addFolderAction
,
param
:
{
parentId
:
_self
.
id
},
param
:
{
parentId
:
_self
.
id
},
...
@@ -299,16 +369,17 @@
...
@@ -299,16 +369,17 @@
width
:
opt
.
dialogWidth
,
width
:
opt
.
dialogWidth
,
ok
:
function
(
doc
)
{
ok
:
function
(
doc
)
{
var
dialog
=
this
;
var
dialog
=
this
;
$
(
'form:first'
,
doc
).
ajaxSubmit
({
url
:
web_app
.
name
+
'/'
+
opt
.
appendAction
,
$
(
'form:first'
,
doc
).
ajaxSubmit
({
url
:
web_app
.
name
+
'/'
+
opt
.
appendAction
,
param
:
{
parentId
:
_self
.
id
,
kindId
:
_self
.
kindId
},
param
:
{
parentId
:
_self
.
id
,
kindId
:
_self
.
kindId
},
success
:
function
(
data
)
{
success
:
function
(
data
)
{
dialog
.
close
();
dialog
.
close
();
if
(
$
.
isFunction
(
callBack
))
{
if
(
$
.
isFunction
(
callBack
))
{
callBack
.
call
(
window
);
callBack
.
call
(
window
);
}
else
{
}
else
{
if
(
_self
.
id
==
opt
.
parentId
)
{
if
(
_self
.
id
==
opt
.
parentId
)
{
_self
.
reload
();
_self
.
reload
();
}
else
{
}
else
{
_self
.
_refreshNode
();
_self
.
_refreshNode
();
}
}
}
}
...
@@ -320,7 +391,7 @@
...
@@ -320,7 +391,7 @@
/*编辑节点*/
/*编辑节点*/
_updateFolder
:
function
()
{
_updateFolder
:
function
()
{
var
opt
=
this
.
options
,
_self
=
this
;
var
opt
=
this
.
options
,
_self
=
this
;
var
menuName
=
opt
.
menuName
;
var
menuName
=
opt
.
menuName
;
UICtrl
.
showAjaxDialog
({
UICtrl
.
showAjaxDialog
({
url
:
web_app
.
name
+
"/"
+
opt
.
loadNodeAction
,
url
:
web_app
.
name
+
"/"
+
opt
.
loadNodeAction
,
param
:
{
id
:
_self
.
id
},
param
:
{
id
:
_self
.
id
},
...
@@ -328,15 +399,16 @@
...
@@ -328,15 +399,16 @@
width
:
opt
.
dialogWidth
,
width
:
opt
.
dialogWidth
,
ok
:
function
(
doc
)
{
ok
:
function
(
doc
)
{
var
dialog
=
this
;
var
dialog
=
this
;
$
(
'form:first'
,
doc
).
ajaxSubmit
({
url
:
web_app
.
name
+
'/'
+
opt
.
updateAction
,
$
(
'form:first'
,
doc
).
ajaxSubmit
({
url
:
web_app
.
name
+
'/'
+
opt
.
updateAction
,
param
:
{
id
:
_self
.
id
},
param
:
{
id
:
_self
.
id
},
success
:
function
(
data
)
{
success
:
function
(
data
)
{
var
name
=
$
(
'input[name="'
+
opt
.
textFieldName
+
'"]'
,
doc
).
val
();
var
name
=
$
(
'input[name="'
+
opt
.
textFieldName
+
'"]'
,
doc
).
val
();
var
node
=
_self
.
treeManager
.
getSelected
();
var
node
=
_self
.
treeManager
.
getSelected
();
if
(
node
)
{
if
(
node
)
{
var
newnodedata
=
{};
var
newnodedata
=
{};
newnodedata
[
opt
.
textFieldName
]
=
name
;
newnodedata
[
opt
.
textFieldName
]
=
name
;
_self
.
treeManager
.
update
(
node
.
data
,
newnodedata
);
_self
.
treeManager
.
update
(
node
.
data
,
newnodedata
);
}
}
dialog
.
close
();
dialog
.
close
();
}
}
...
@@ -352,10 +424,109 @@
...
@@ -352,10 +424,109 @@
_self
.
id
=
null
;
_self
.
id
=
null
;
var
node
=
_self
.
treeManager
.
getSelected
();
var
node
=
_self
.
treeManager
.
getSelected
();
if
(
node
)
{
if
(
node
)
{
var
parentId
=
node
.
data
[
opt
.
parentIDFieldName
];
var
parentId
=
node
.
data
[
opt
.
parentIDFieldName
];
if
(
parentId
==
opt
.
parentId
){
//删除的是根节点
if
(
parentId
==
opt
.
parentId
)
{
//删除的是根节点
_self
.
reload
();
}
else
{
_self
.
_refreshNode
(
parentId
);
}
}
});
});
},
/*新增字段*/
_addField
:
function
(
callBack
)
{
var
opt
=
this
.
options
,
_self
=
this
;
UICtrl
.
showAjaxDialog
({
url
:
web_app
.
name
+
"/"
+
opt
.
addFieldMenuAction
,
param
:
{
tableName
:
_self
.
id
},
title
:
'字段'
,
width
:
800
,
ok
:
function
(
doc
)
{
var
dialog
=
this
;
var
resourceField
=
null
;
var
contactManager
=
UICtrl
.
getGridManager
(
'#resourceFieldGrid'
);
if
(
contactManager
)
{
var
resourceField
=
DataUtil
.
getGridData
({
gridManager
:
contactManager
,
isAllData
:
true
});
resourceField
=
Public
.
encodeJSONURI
(
resourceField
);
}
$
(
'#submitForm'
).
ajaxSubmit
({
url
:
web_app
.
name
+
'/resource/saveResourceType.ajax'
,
param
:
{
resourceFields
:
resourceField
,
},
success
:
function
(
data
)
{
dialog
.
close
();
if
(
$
.
isFunction
(
callBack
))
{
callBack
.
call
(
window
);
}
else
{
if
(
_self
.
id
==
opt
.
parentId
)
{
_self
.
reload
();
}
else
{
_self
.
_refreshNode
();
}
}
}
});
}
});
},
_updateField
:
function
()
{
var
opt
=
this
.
options
,
_self
=
this
;
UICtrl
.
showAjaxDialog
({
url
:
web_app
.
name
+
"/"
+
opt
.
updateFieldMenuAction
,
param
:
{
tableName
:
_self
.
id
},
title
:
'字段'
,
width
:
800
,
ok
:
function
(
doc
)
{
var
dialog
=
this
;
var
resourceField
=
null
;
var
contactManager
=
UICtrl
.
getGridManager
(
'#resourceFieldGrid'
);
if
(
contactManager
)
{
var
resourceField
=
DataUtil
.
getGridData
({
gridManager
:
contactManager
,
isAllData
:
true
});
resourceField
=
Public
.
encodeJSONURI
(
resourceField
);
}
$
(
'#submitForm'
).
ajaxSubmit
({
url
:
web_app
.
name
+
'/resource/updateResourceType.ajax'
,
param
:
{
resourceFields
:
resourceField
,
},
success
:
function
(
data
)
{
dialog
.
close
();
if
(
$
.
isFunction
(
callBack
))
{
callBack
.
call
(
window
);
}
else
{
if
(
_self
.
id
==
opt
.
parentId
)
{
_self
.
reload
();
}
else
{
_self
.
_refreshNode
();
}
}
}
});
}
});
},
/*删除节点*/
_deleteField
:
function
()
{
var
opt
=
this
.
options
,
_self
=
this
;
UICtrl
.
confirm
(
'common.confirm.delete.unrecoverable'
,
function
()
{
Public
.
ajax
(
web_app
.
name
+
'/'
+
opt
.
deleteFieldAction
,
{
tableName
:
_self
.
id
},
function
()
{
_self
.
id
=
null
;
var
node
=
_self
.
treeManager
.
getSelected
();
if
(
node
)
{
var
parentId
=
node
.
data
[
opt
.
parentIDFieldName
];
if
(
parentId
==
opt
.
parentId
)
{
//删除的是根节点
_self
.
reload
();
_self
.
reload
();
}
else
{
}
else
{
_self
.
_refreshNode
(
parentId
);
_self
.
_refreshNode
(
parentId
);
}
}
}
}
...
@@ -365,8 +536,8 @@
...
@@ -365,8 +536,8 @@
/*刷新节点*/
/*刷新节点*/
_refreshNode
:
function
(
parentId
)
{
_refreshNode
:
function
(
parentId
)
{
var
opt
=
this
.
options
,
_self
=
this
;
var
opt
=
this
.
options
,
_self
=
this
;
parentId
=
parentId
||
_self
.
id
;
parentId
=
parentId
||
_self
.
id
;
var
parentData
=
_self
.
treeManager
.
getDataByID
(
parentId
);
var
parentData
=
_self
.
treeManager
.
getDataByID
(
parentId
);
if
(
parentData
)
{
if
(
parentData
)
{
var
param
=
{
kindId
:
_self
.
kindId
,
parentId
:
parentData
[
opt
.
idFieldName
]};
var
param
=
{
kindId
:
_self
.
kindId
,
parentId
:
parentData
[
opt
.
idFieldName
]};
param
[
opt
.
sortnameParmName
]
=
opt
.
sortName
;
param
[
opt
.
sortnameParmName
]
=
opt
.
sortName
;
...
@@ -377,7 +548,7 @@
...
@@ -377,7 +548,7 @@
}
}
_self
.
treeManager
.
loadData
(
parentData
,
web_app
.
name
+
'/'
+
opt
.
loadTreesAction
,
param
,
_self
.
treeManager
.
loadData
(
parentData
,
web_app
.
name
+
'/'
+
opt
.
loadTreesAction
,
param
,
{
{
beforeAppend
:
function
()
{
beforeAppend
:
function
()
{
_self
.
treeManager
.
clear
(
parentData
);
_self
.
treeManager
.
clear
(
parentData
);
var
parentNode
=
_self
.
treeManager
.
getNodeDom
(
parentData
);
var
parentNode
=
_self
.
treeManager
.
getNodeDom
(
parentData
);
_self
.
treeManager
.
demotion
(
parentNode
);
_self
.
treeManager
.
demotion
(
parentNode
);
...
@@ -390,7 +561,7 @@
...
@@ -390,7 +561,7 @@
},
},
/*移动节点*/
/*移动节点*/
_moveFolder
:
function
(
flag
)
{
_moveFolder
:
function
(
flag
)
{
var
opt
=
this
.
options
,
_self
=
this
,
node
=
null
;
var
opt
=
this
.
options
,
_self
=
this
,
node
=
null
;
var
params
=
new
PublicMap
(),
moveNode
;
var
params
=
new
PublicMap
(),
moveNode
;
if
(
_self
.
treeManager
)
{
if
(
_self
.
treeManager
)
{
node
=
_self
.
treeManager
.
getSelected
();
node
=
_self
.
treeManager
.
getSelected
();
...
@@ -410,22 +581,22 @@
...
@@ -410,22 +581,22 @@
return
;
return
;
}
}
Public
.
ajax
(
web_app
.
name
+
'/'
+
opt
.
updateSequenceAction
,
{
data
:
params
.
toString
()},
function
()
{
Public
.
ajax
(
web_app
.
name
+
'/'
+
opt
.
updateSequenceAction
,
{
data
:
params
.
toString
()},
function
()
{
var
parentId
=
node
.
data
[
opt
.
parentIDFieldName
];
var
parentId
=
node
.
data
[
opt
.
parentIDFieldName
];
if
(
parentId
==
opt
.
parentId
)
{
if
(
parentId
==
opt
.
parentId
)
{
_self
.
reload
();
_self
.
reload
();
}
else
{
}
else
{
_self
.
_refreshNode
(
parentId
);
_self
.
_refreshNode
(
parentId
);
}
}
});
});
},
},
refresh
:
function
(
el
,
id
)
{
refresh
:
function
(
el
,
id
)
{
if
(
id
)
{
if
(
id
)
{
if
(
id
==
this
.
options
.
parentId
)
{
//删除的是根节点
if
(
id
==
this
.
options
.
parentId
)
{
//删除的是根节点
this
.
reload
();
this
.
reload
();
}
else
{
}
else
{
this
.
_refreshNode
(
id
);
this
.
_refreshNode
(
id
);
}
}
}
else
{
}
else
{
this
.
reload
();
this
.
reload
();
}
}
},
},
...
@@ -443,27 +614,27 @@
...
@@ -443,27 +614,27 @@
}
}
return
null
;
return
null
;
},
},
cancelSelect
:
function
(
node
)
{
cancelSelect
:
function
(
node
)
{
this
.
treeManager
.
cancelSelect
(
node
);
this
.
treeManager
.
cancelSelect
(
node
);
},
},
getChecked
:
function
()
{
getChecked
:
function
()
{
return
this
.
treeManager
.
getChecked
();
return
this
.
treeManager
.
getChecked
();
},
},
getNodeById
:
function
(
id
)
{
getNodeById
:
function
(
id
)
{
var
node
=
this
.
treeManager
.
getDataByID
(
id
);
var
node
=
this
.
treeManager
.
getDataByID
(
id
);
return
node
;
return
node
;
},
},
refreshParent
:
function
(
el
,
id
)
{
refreshParent
:
function
(
el
,
id
)
{
var
node
=
this
.
getNodeById
(
id
);
var
node
=
this
.
getNodeById
(
id
);
if
(
!
node
)
return
;
if
(
!
node
)
return
;
this
.
_refreshNode
(
node
[
this
.
options
.
parentIDFieldName
]);
this
.
_refreshNode
(
node
[
this
.
options
.
parentIDFieldName
]);
},
},
reload
:
function
()
{
reload
:
function
()
{
var
g
=
this
.
treeManager
,
p
=
this
.
options
;
var
g
=
this
.
treeManager
,
p
=
this
.
options
;
g
.
clear
();
g
.
clear
();
g
.
loadData
(
null
,
web_app
.
name
+
'/'
+
p
.
loadTreesAction
);
g
.
loadData
(
null
,
web_app
.
name
+
'/'
+
p
.
loadTreesAction
);
},
},
expandById
:
function
(
el
,
id
)
{
expandById
:
function
(
el
,
id
)
{
this
.
treeManager
.
selectNode
(
id
);
this
.
treeManager
.
selectNode
(
id
);
var
node
=
this
.
treeManager
.
getSelected
();
var
node
=
this
.
treeManager
.
getSelected
();
if
(
node
)
{
if
(
node
)
{
...
@@ -475,22 +646,22 @@
...
@@ -475,22 +646,22 @@
}
}
return
false
;
return
false
;
},
},
updateNodeName
:
function
(
el
,
id
,
nodeName
)
{
updateNodeName
:
function
(
el
,
id
,
nodeName
)
{
var
node
=
this
.
getNodeById
(
id
);
var
node
=
this
.
getNodeById
(
id
);
if
(
!
node
)
return
;
if
(
!
node
)
return
;
var
opt
=
this
.
options
,
newnodedata
=
{};
var
opt
=
this
.
options
,
newnodedata
=
{};
newnodedata
[
opt
.
textFieldName
]
=
nodeName
;
newnodedata
[
opt
.
textFieldName
]
=
nodeName
;
this
.
treeManager
.
update
(
node
,
newnodedata
);
this
.
treeManager
.
update
(
node
,
newnodedata
);
},
},
updateNode
:
function
(
el
,
id
,
newNode
)
{
updateNode
:
function
(
el
,
id
,
newNode
)
{
var
node
=
this
.
getNodeById
(
id
);
var
node
=
this
.
getNodeById
(
id
);
if
(
!
node
)
return
;
if
(
!
node
)
return
;
var
newnodedata
=
$
.
extend
({},
node
,
newNode
);
var
newnodedata
=
$
.
extend
({},
node
,
newNode
);
this
.
treeManager
.
update
(
node
,
newnodedata
);
this
.
treeManager
.
update
(
node
,
newnodedata
);
},
},
selectNode
:
function
(
el
,
id
)
{
selectNode
:
function
(
el
,
id
)
{
var
node
=
this
.
getNodeById
(
id
);
var
node
=
this
.
getNodeById
(
id
);
if
(
!
node
)
return
;
if
(
!
node
)
return
;
this
.
treeManager
.
selectNode
(
id
);
this
.
treeManager
.
selectNode
(
id
);
}
}
});
});
...
@@ -518,22 +689,22 @@ CommonTreeKind.Dictionary = 9;
...
@@ -518,22 +689,22 @@ CommonTreeKind.Dictionary = 9;
/*数据导入模板分类*/
/*数据导入模板分类*/
CommonTreeKind
.
ExpTemplet
=
10
;
CommonTreeKind
.
ExpTemplet
=
10
;
/*消息提醒分类*/
/*消息提醒分类*/
CommonTreeKind
.
MessageRemind
=
15
;
CommonTreeKind
.
MessageRemind
=
15
;
/*权限字段分类*/
/*权限字段分类*/
CommonTreeKind
.
UIElement
=
16
;
CommonTreeKind
.
UIElement
=
16
;
/*基础管理权限分类*/
/*基础管理权限分类*/
CommonTreeKind
.
BaseManagementType
=
17
;
CommonTreeKind
.
BaseManagementType
=
17
;
/*业务管理权限分类*/
/*业务管理权限分类*/
CommonTreeKind
.
BizManagementType
=
18
;
CommonTreeKind
.
BizManagementType
=
18
;
/*附件配置分类*/
/*附件配置分类*/
CommonTreeKind
.
AttachmentConfig
=
21
;
CommonTreeKind
.
AttachmentConfig
=
21
;
/*任务类别分类*/
/*任务类别分类*/
CommonTreeKind
.
TaskKind
=
22
;
CommonTreeKind
.
TaskKind
=
22
;
/*系统用户分组设置*/
/*系统用户分组设置*/
CommonTreeKind
.
UserGroupKind
=
25
;
CommonTreeKind
.
UserGroupKind
=
25
;
/*用户自定义分组设置*/
/*用户自定义分组设置*/
CommonTreeKind
.
UserCustomGroup
=
26
;
CommonTreeKind
.
UserCustomGroup
=
26
;
/*审批驳回理由*/
/*审批驳回理由*/
CommonTreeKind
.
ApprovalRejectedReason
=
50
;
CommonTreeKind
.
ApprovalRejectedReason
=
50
;
/*国际化资源*/
/*国际化资源*/
CommonTreeKind
.
i18nProperties
=
55
;
CommonTreeKind
.
i18nProperties
=
55
;
topsun-xt/src/main/resources/config/spring/spring-mybatis-plus.xml
View file @
3099a277
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
<bean
id=
"sqlSessionFactory"
class=
"com.baomidou.mybatisplus.extension.spring.MybatisSqlSessionFactoryBean"
>
<bean
id=
"sqlSessionFactory"
class=
"com.baomidou.mybatisplus.extension.spring.MybatisSqlSessionFactoryBean"
>
<property
name=
"dataSource"
ref=
"dataSource"
/>
<property
name=
"dataSource"
ref=
"dataSource"
/>
<!-- <property name="configuration" ref="configuration"/>-->
<!-- <property name="configuration" ref="configuration"/>-->
<property
name=
"mapperLocations"
value=
"classpath:
com/huigou/topsun/**/mapper/xml
/*.xml"
/>
<property
name=
"mapperLocations"
value=
"classpath:
/config/topsun/mapper/**
/*.xml"
/>
<property
name=
"globalConfig"
ref=
"globalConfig"
/>
<property
name=
"globalConfig"
ref=
"globalConfig"
/>
<property
name=
"plugins"
>
<property
name=
"plugins"
>
<array>
<array>
...
...
topsun-xt/src/main/resources/config/spring/spring-resource-basenames.xml
View file @
3099a277
...
@@ -16,15 +16,7 @@
...
@@ -16,15 +16,7 @@
<bean
id=
"messageSourceBasenames"
class=
"com.huigou.context.MessageSourceBasenames"
>
<bean
id=
"messageSourceBasenames"
class=
"com.huigou.context.MessageSourceBasenames"
>
<property
name=
"basenames"
>
<property
name=
"basenames"
>
<list>
<list>
<value>
i18n/techBase
</value>
<value>
i18n/topsun
</value>
<!--<value>i18n/tech_reimbursement</value>
<value>i18n/tech_project</value>
<value>i18n/tech_mm</value>
<value>i18n/tech_pm</value>-->
<value>
i18n/tech_bm
</value>
<value>
i18n/ssrf_hx
</value>
<value>
i18n/ssrf_budget
</value>
<value>
i18n/ssrf_contract
</value>
</list>
</list>
</property>
</property>
</bean>
</bean>
...
...
topsun-xt/src/main/webapp/HomePage.jsp
View file @
3099a277
...
@@ -4,13 +4,13 @@
...
@@ -4,13 +4,13 @@
<!DOCTYPE html>
<!DOCTYPE html>
<html>
<html>
<head>
<head>
<x:base
include=
"dialog,dateTime,tree,combox
,echart
"
/>
<x:base
include=
"dialog,dateTime,tree,combox"
/>
<x:script
src=
'/system/taskCenter/TasksExecute.js'
/>
<x:script
src=
'/system/taskCenter/TasksExecute.js'
/>
<x:script
src=
'/system/bpm/BpmUtil.js'
/>
<x:script
src=
'/system/bpm/BpmUtil.js'
/>
<x:script
src=
'/javaScript/remind.js'
/>
<x:script
src=
'/javaScript/remind.js'
/>
<x:script
src=
'/javaScript/addFunction.js'
/>
<x:script
src=
'/javaScript/addFunction.js'
/>
<x:script
src=
'/javaScript/HomePage.js'
/>
<x:script
src=
'/javaScript/HomePage.js'
/>
<
x:script
src=
'/javaScript/HomePageEcharts.js'
/
>
<
%--<x:script src='/javaScript/HomePageEcharts.js'/>--%
>
</head>
</head>
<body>
<body>
<div
class=
"container-gray-bg"
>
<div
class=
"container-gray-bg"
>
...
...
topsun-xt/src/main/webapp/biz/topsun/resource/fieldTreeDetail.js
0 → 100644
View file @
3099a277
$
(
document
).
ready
(
function
()
{
initResourceFieldGrid
();
});
//初始化研制人员
function
initResourceFieldGrid
(){
var
toolbarOptions
=
UICtrl
.
getDefaultToolbarOptions
({
addHandler
:
function
(){
UICtrl
.
addGridRow
(
resourceFieldGrid
);
},
deleteHandler
:
function
()
{
var
_grid
=
UICtrl
.
getGridManager
(
'#resourceFieldGrid'
);
DataUtil
.
delSelectedRows
({
action
:
'purchase/deleteProviderBids.ajax'
,
param
:
{},
gridManager
:
_grid
,
onSuccess
:
function
()
{
reloadGrid
();
}
});
}
});
resourceFieldGrid
=
UICtrl
.
grid
(
'#resourceFieldGrid'
,
{
columns
:
getGridColumns
(),
dataAction
:
'server'
,
url
:
web_app
.
name
+
'/resource/findResourceTypeFields.ajax'
,
parms
:
{
tableName
:
$
(
"#tableName"
).
val
()
||
$
(
"#parentTableName"
).
val
()},
width
:
'99.8%'
,
height
:
'400'
,
checkbox
:
true
,
heightDiff
:
-
5
,
sortName
:
'contact'
,
enabledEdit
:
true
,
sortOrder
:
'asc'
,
toolbar
:
toolbarOptions
,
/*onLoadData: function () {
const contractId = getEntityId();
if (!contractId) {
return false;
}
if (gridEntityContactManager) {
gridEntityContactManager.setParm('contractId', contractId);
}
}*/
});
}
function
getGridColumns
(){
var
columns
=
[];
columns
.
push
({
display
:
"字段名称"
,
name
:
"resourceFiledTitle"
,
width
:
150
,
minWidth
:
60
,
type
:
"string"
,
align
:
"center"
,
editor
:
{
type
:
'text'
,
required
:
true
}
});
columns
.
push
({
display
:
"字段类型"
,
name
:
"resourceFieldTypeTextView"
,
width
:
150
,
minWidth
:
60
,
type
:
"string"
,
align
:
"center"
,
editor
:
{
type
:
'combobox'
,
data
:
$
(
"#resourceFieldType"
).
combox
(
'getJSONData'
),
required
:
true
,
valueField
:
'resourceFieldType'
}
});
columns
.
push
({
display
:
"是否可见"
,
name
:
"resourceFieldShowTextView"
,
width
:
150
,
minWidth
:
60
,
type
:
"string"
,
align
:
"center"
,
editor
:
{
type
:
'combobox'
,
data
:
$
(
"#yesorno"
).
combox
(
'getJSONData'
),
required
:
false
,
valueField
:
'resourceFieldShow'
}
});
columns
.
push
({
display
:
"字段大小"
,
name
:
"resourceFieldSize"
,
width
:
150
,
minWidth
:
60
,
type
:
"string"
,
align
:
"center"
,
editor
:
{
type
:
'text'
,
required
:
false
}
});
columns
.
push
({
display
:
"整型长度"
,
name
:
"integerLength"
,
width
:
150
,
minWidth
:
60
,
type
:
"string"
,
align
:
"center"
,
editor
:
{
type
:
'text'
,
required
:
false
}
});
columns
.
push
({
display
:
"小数点位数"
,
name
:
"decimalPrecision"
,
width
:
150
,
minWidth
:
60
,
type
:
"string"
,
align
:
"center"
,
editor
:
{
type
:
'text'
,
required
:
false
}
});
columns
.
push
({
display
:
"序号"
,
name
:
"sortNum"
,
width
:
150
,
minWidth
:
60
,
type
:
"string"
,
align
:
"center"
,
editor
:
{
type
:
'text'
,
required
:
false
}
});
columns
.
push
({
display
:
"数据字典"
,
name
:
"dictCode"
,
width
:
150
,
minWidth
:
60
,
type
:
"string"
,
align
:
"center"
,
editor
:
{
type
:
'text'
,
required
:
false
}
});
return
columns
;
}
function
reloadGrid
()
{
var
param
=
{
tableName
:
$
(
"#tableName"
).
val
()};
$
(
'#resourceFieldGrid'
).
ligerGetGridManager
().
options
.
url
=
web_app
.
name
+
'/resource/findParentResourceTypeAndFields.ajax'
;
_grid
=
UICtrl
.
getGridManager
(
'#resourceFieldGrid'
);
UICtrl
.
gridSearch
(
_grid
,
param
);
}
// $('#ok').click(function () {
// $('#submitForm').ajaxSubmit({
// url: web_app.name + '/resource/saveResourceType.ajax',
// param: {
// resourceFields: $.toJSON(resourceFieldGrid.getData()),
// },
// success: function (data) {
// //reloadData();
// },
// });
// })
topsun-xt/src/main/webapp/biz/topsun/resource/fieldTreeDetail.jsp
0 → 100644
View file @
3099a277
<%@ page
language=
"java"
contentType=
"text/html; charset=utf-8"
%>
<%@taglib
uri=
"/WEB-INF/taglib.tld"
prefix=
"x"
%>
<%@ taglib
uri=
"http://java.sun.com/jsp/jstl/core"
prefix=
"c"
%>
<head>
<x:script
src=
'/biz/topsun/resource/fieldTreeDetail.js'
/>
</head>
<form
class=
"hg-form"
method=
"post"
action=
""
id=
"submitForm"
>
<x:hidden
name=
"tableName"
/>
<x:hidden
name=
"resourceTypeId"
/>
<div
class=
"hg-form-cols"
>
<div
class=
"hg-form-row"
>
<x:inputC
name=
"resourceTableTitle"
required=
"true"
label=
"资源名称"
labelCol=
"2"
fieldCol=
"4"
/>
<x:inputC
name=
"resourceTableName"
required=
"false"
readonly=
"true"
label=
"资源表"
labelCol=
"2"
fieldCol=
"4"
/>
</div>
<div
class=
"hg-form-row"
>
<x:inputC
name=
"parentTableTitle"
required=
"false"
readonly=
"true"
label=
"父类名称"
labelCol=
"2"
fieldCol=
"4"
/>
<x:inputC
name=
"parentTableName"
required=
"false"
readonly=
"true"
label=
"父类表"
labelCol=
"2"
fieldCol=
"4"
/>
</div>
<div
class=
"hg-form-row"
>
<x:inputC
name=
"superTableTitle"
required=
"false"
readonly=
"true"
label=
"超类名称"
labelCol=
"2"
fieldCol=
"4"
/>
<x:inputC
name=
"superTableName"
required=
"false"
readonly=
"true"
label=
"超类表"
labelCol=
"2"
fieldCol=
"4"
/>
</div>
</div>
<div
class=
"hg-form-row"
>
<div
id=
"resourceFieldGrid"
></div>
</div>
</form>
\ No newline at end of file
topsun-xt/src/main/webapp/biz/topsun/resource/fieldValueDetail.js
0 → 100644
View file @
3099a277
$
(
document
).
ready
(
function
()
{
initResourceFields
();
});
function
initResourceFields
()
{
Public
.
ajax
(
web_app
.
name
+
"/resourceField/getResourceField.ajax"
,
{
resourceTypeId
:
$
(
"#resourceTypeId"
).
val
()
},
function
(
data
)
{
debugger
;
var
$d
=
$
(
'#rowDiv'
);
for
(
var
i
=
0
;
i
<
data
.
length
;
i
++
)
{
var
field
=
data
[
i
];
//var s = $(`<input name="${field.resourceFieldName}" label="${field.resourceFiledTitle}" labelCol="2" fieldCol="4"/>`);
//var input = $("<x:inputC name='").append(field.resourceFieldName).append("' label='").append(field.resourceFiledTitle).append("'").append("/>");
/*var ss = $(`<div class="col-xs-4 col-sm-2">
<label class="hg-form-label" id="${field.resourceFiledTitle}_label" title="${field.resourceFiledTitle}">
${field.resourceFiledTitle} :
</label>
</div>
<div class="col-xs-8 col-sm-4 col-warp col-white-bg">
<input type="text" name="${field.resourceFieldName}" id="${field.resourceFieldName}" label="${field.resourceFiledTitle}">
</div>`)*/
var
ss
=
$
(
`<div class="col-xs-4 col-sm-2">
<label class="hg-form-label" id="resourceFiledTitle_label" title="哈哈哈哈哈哈">
哈哈哈哈 :
</label>
</div>
`
)
var
s2
=
$
(
`<div class="col-xs-8 col-sm-4 col-warp col-white-bg">
<input type="text" name="name" id="name" label="hhhhhhh">
</div>`
);
$d
.
append
(
ss
,
s2
);
//input1.attr('value', data[i]);
}
}
)
}
topsun-xt/src/main/webapp/biz/topsun/resource/fieldValueDetail.jsp
0 → 100644
View file @
3099a277
<%@ page
language=
"java"
contentType=
"text/html; charset=utf-8"
%>
<%@taglib
uri=
"/WEB-INF/taglib.tld"
prefix=
"x"
%>
<%@ taglib
uri=
"http://java.sun.com/jsp/jstl/core"
prefix=
"c"
%>
<head>
<x:script
src=
'/biz/topsun/resource/fieldValueDetail.js'
/>
</head>
<form
class=
"hg-form"
method=
"post"
action=
""
id=
"submitForm"
>
<x:hidden
name=
"tableName"
/>
<x:hidden
name=
"resourceTypeId"
/>
<div
class=
"hg-form-cols"
>
<div
class=
"hg-form-row"
id=
"rowDiv>
<x:inputC
name=
"resourceTableTitle"
required=
"true"
label=
"资源名称"
labelCol=
"2"
fieldCol=
"4"
/>
</div>
</div>
</form>
\ No newline at end of file
topsun-xt/src/main/webapp/biz/topsun/resource/resourceList.js
0 → 100644
View file @
3099a277
var
gridManager
=
null
,
refreshFlag
=
false
,
OrgRootId
=
0
,
columnData
=
null
;
$
(
document
).
ready
(
function
()
{
initializeUI
();
initializeGrid
();
});
function
initializeUI
(){
UICtrl
.
layout
(
"#layoutDiv"
,{
leftWidth
:
2
});
$
(
'#maintree'
).
commonTree
({
loadTreesAction
:
'resource/findResourceTypes.ajax'
,
parentId
:
OrgRootId
,
getParam
:
function
(
e
){
return
{
showDisabledOrg
:
0
,
displayableOrgKinds
:
"ogn"
};
},
changeNodeIcon
:
function
(
data
){
data
[
this
.
options
.
iconFieldName
]
=
OpmUtil
.
getOrgImgUrl
(
data
.
orgKindId
,
data
.
status
);
},
IsShowMenu
:
false
,
IsShowFieldMenu
:
true
,
onClick
:
function
(
data
){
var
html
=
[];
html
.
push
(
'<span class="tomato-color">['
,
data
.
name
,
']</span>'
);
$
(
'#layoutDiv'
).
layout
(
'setCenterTitle'
,
html
.
join
(
''
));
// 创建表格
var
table
=
document
.
getElementById
(
"maingrid"
);
var
thead
=
table
.
querySelector
(
"thead tr"
);
$
(
"#resourceTypeId"
).
val
(
data
.
resourceTypeId
);
getFieldAndTitle
(
data
.
resourceTypeId
);
}
});
}
//初始化表格
function
initializeGrid
()
{
var
toolbarOptions
=
UICtrl
.
getDefaultToolbarOptions
({
addHandler
:
addHandler
,
updateHandler
:
function
(){
updateHandler
();
},
deleteHandler
:
deleteHandler
});
gridManager
=
UICtrl
.
grid
(
'#maingrid'
,
{
//columns: columnData,
dataAction
:
'server'
,
url
:
web_app
.
name
+
'/resourceField/getResourceFieldValue.ajax'
,
parms
:
{
resourceTypeId
:
$
(
"#resourceTypeId"
).
val
()},
checkbox
:
true
,
width
:
'100%'
,
height
:
'100%'
,
heightDiff
:
-
5
,
sortName
:
'code'
,
sortOrder
:
'asc'
,
toolbar
:
toolbarOptions
,
onDblClickRow
:
function
(
data
,
rowindex
,
rowobj
)
{
updateHandler
(
data
.
id
);
}
});
$
(
'#maingrid'
).
on
(
'click'
,
function
(
e
){
var
$clicked
=
$
(
e
.
target
||
e
.
srcElement
);
if
(
$clicked
.
is
(
'a.budgetFrozen'
)){
//报销授权
showBudgetFrozen
(
$clicked
.
data
(
'code'
));
return
false
;
}
if
(
$clicked
.
is
(
'a.budgetLog'
)){
//报销授权查询
showBudgetLog
(
$clicked
.
data
(
'code'
));
return
false
;
}
});
UICtrl
.
setSearchAreaToggle
(
gridManager
);
}
// 查询
function
query
(
obj
)
{
var
param
=
$
(
obj
).
formToJSON
();
UICtrl
.
gridSearch
(
gridManager
,
param
);
}
//刷新表格
function
reloadGrid
()
{
gridManager
.
loadData
();
}
//重置表单
function
resetForm
(
obj
)
{
$
(
obj
).
formClean
();
}
//关闭对话框
function
dialogClose
(){
if
(
refreshFlag
){
reloadGrid
();
refreshFlag
=
false
;
}
}
//添加按钮
function
addHandler
()
{
var
resourceTypeId
=
$
(
'#resourceTypeId'
).
val
();
if
(
Public
.
isBlank
(
resourceTypeId
))
{
Public
.
tip
(
'请选择资源!'
);
return
;
}
UICtrl
.
showAjaxDialog
({
title
:
$
.
i18nProp
(
'资源值'
),
url
:
web_app
.
name
+
'/resourceField/forwardAddResourceFieldValue.load'
,
//init:initDetailDialog,
param
:{
resourceTypeId
:
resourceTypeId
},
ok
:
insert
,
width
:
600
,
close
:
dialogClose
});
}
//新增保存
function
insert
()
{
var
_self
=
this
,
systemId
=
$
(
'#treeSystemId'
).
val
();
$
(
'#submitForm'
).
ajaxSubmit
({
url
:
web_app
.
name
+
'/ssrfPurchaseBudget/insertSsrfBudgetRecord.ajax'
,
param
:{
systemId
:
systemId
},
success
:
function
(
data
)
{
_self
.
close
();
reloadGrid
();
}
});
}
//编辑按钮
function
updateHandler
(
id
)
{
if
(
!
id
)
{
id
=
DataUtil
.
getUpdateRowId
(
gridManager
);
if
(
!
id
)
{
return
;
}
}
UICtrl
.
showAjaxDialog
({
title
:
$
.
i18nProp
(
'common.field.modif.title'
,
'预算'
),
width
:
600
,
url
:
web_app
.
name
+
'/ssrfPurchaseBudget/showLoadSsrfBudgetRecord.load'
,
init
:
initDetailDialog
,
param
:
{
id
:
id
},
ok
:
update
,
close
:
dialogClose
});
}
//编辑保存
function
update
()
{
var
_self
=
this
;
$
(
'#submitForm'
).
ajaxSubmit
({
url
:
web_app
.
name
+
'/ssrfPurchaseBudget/updateSsrfBudgetRecord.ajax'
,
success
:
function
()
{
refreshFlag
=
true
;
_self
.
close
();
}
});
}
//删除按钮
function
deleteHandler
()
{
DataUtil
.
del
({
action
:
'ssrfPurchaseBudget/deleteSsrfBudgetRecord.ajax'
,
gridManager
:
gridManager
,
idFieldName
:
'id'
,
onSuccess
:
function
()
{
reloadGrid
();
}
});
}
//启用
function
enableHandler
(){
DataUtil
.
updateById
({
action
:
'ssrfPurchaseBudget/updateHaseBudgetStatus.ajax'
,
gridManager
:
gridManager
,
idFieldName
:
'id'
,
param
:{
status
:
1
},
message
:
'common.confirm.enable'
,
onSuccess
:
function
(){
reloadGrid
();
}
});
}
//禁用
function
disableHandler
(){
DataUtil
.
updateById
({
action
:
'ssrfPurchaseBudget/updateHaseBudgetStatus.ajax'
,
gridManager
:
gridManager
,
idFieldName
:
'id'
,
param
:{
status
:
0
},
message
:
'common.confirm.disable'
,
onSuccess
:
function
(){
reloadGrid
();
}
});
}
function
getFieldAndTitle
(
resourceTypeId
){
Public
.
ajax
(
web_app
.
name
+
'/resourceField/getResourceField.ajax?resourceTypeId='
+
resourceTypeId
,
{}
,
function
(
data
)
{
// 动态生成列配置
columnData
=
data
.
map
(
function
(
column
)
{
return
{
name
:
column
.
resourceFieldName
,
display
:
column
.
resourceFiledTitle
,
sorting
:
true
,
// 如果需要启用排序
};
});
gridManager
=
UICtrl
.
getGridManager
(
'#maingrid'
);
UICtrl
.
reRenderGridColumns
(
gridManager
,
columnData
);
UICtrl
.
gridSearch
(
gridManager
,{
resourceTypeId
:
$
(
"#resourceTypeId"
).
val
()});
});
}
topsun-xt/src/main/webapp/biz/topsun/resource/resourceList.jsp
View file @
3099a277
...
@@ -3,13 +3,36 @@
...
@@ -3,13 +3,36 @@
<%@ taglib
uri=
"http://java.sun.com/jsp/jstl/core"
prefix=
"c"
%>
<%@ taglib
uri=
"http://java.sun.com/jsp/jstl/core"
prefix=
"c"
%>
<html>
<html>
<head>
<head>
<x:base
include=
"
dialog,grid,combox,comboDialog,attachment"
/>
<x:base
include=
"
layout,dialog,grid,tree,combox,date,commonTree,attachment,datetime,excelImp,selectOrg"
/>
<x:i
18n name="topsun"
/>
<x:i
18n name="topsun"
/>
<x:script
src=
'/system/opm/js/OpmUtil.js'
/>
<x:script
src=
'/biz/topsun/common/purchaseCommon.js'
/>
<x:script
src=
'/biz/topsun/resource/resourceList.js'
/>
</head>
</head>
<body>
<body>
<div
class=
"container-fluid"
>
<div
class=
"container-fluid"
>
<h1>
哈哈哈哈
</h1>
<div
class=
"ui-hide"
>
<x:select
name=
"resourceFieldType"
dictionary=
"resourceFieldType"
/>
<x:select
name=
"yesorno"
dictionary=
"yesorno"
/>
</div>
<div
id=
"layoutDiv"
>
<div
position=
"left"
title=
"
<x:message
key=
"common.field.org"
/>
"
>
<ul
id=
"maintree"
></ul>
</div>
<div
position=
"center"
title=
"资源列表"
>
<x:title
title=
"common.button.query"
isHide=
"true"
hideTable=
"queryMainForm"
/>
<x:hidden
name=
"resourceTypeId"
id=
"resourceTypeId"
/>
<form
method=
"post"
class=
"hg-form ui-hide"
action=
""
id=
"queryMainForm"
>
<x:inputC
name=
"code"
title=
"编码"
required=
"false"
label=
"common.field.code"
labelCol=
"1"
/>
<x:inputC
name=
"name"
title=
"名称"
required=
"false"
label=
"common.field.name"
labelCol=
"1"
/>
<x:inputC
name=
"orderNumber"
required=
"false"
label=
"common.field.sequence"
labelCol=
"1"
/>
<div
class=
"clearfix"
></div>
<x:searchButtons/>
</form>
<div
class=
"blank_div clearfix"
></div>
<div
id=
"maingrid"
></div>
</div>
</div>
</div>
</div>
</body>
</body>
</html>
</html>
topsun/src/main/java/com/huigou/topsun/resource/controller/ResourceController.java
View file @
3099a277
package
com
.
huigou
.
topsun
.
resource
.
controller
;
package
com
.
huigou
.
topsun
.
resource
.
controller
;
import
com.huigou.cache.DictUtil
;
import
com.huigou.topsun.resource.service.ResourceTypeService
;
import
com.huigou.topsun.resource.service.ResourceTypeService
;
import
com.huigou.topsun.resource.vo.ResourceFiledVo
;
import
com.huigou.topsun.resource.vo.ResourceTypeTreeVo
;
import
com.huigou.topsun.resource.vo.ResourceTypeVo
;
import
com.huigou.topsun.resource.vo.ResourceTypeVo
;
import
com.huigou.uasp.annotation.ControllerMapping
;
import
com.huigou.uasp.annotation.ControllerMapping
;
import
com.huigou.uasp.client.CommonController
;
import
com.huigou.uasp.client.CommonController
;
import
com.huigou.util.SDO
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.*
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
/**
/**
* @Auther: xin.lu
* @Auther: xin.lu
...
@@ -26,30 +31,73 @@ public class ResourceController extends CommonController {
...
@@ -26,30 +31,73 @@ public class ResourceController extends CommonController {
@Resource
@Resource
private
ResourceTypeService
resourceTypeService
;
private
ResourceTypeService
resourceTypeService
;
/**
* 资源列表页
* @return
*/
public
String
forwardResourceList
(){
public
String
forwardResourceList
(){
Map
<
String
,
String
>
resourceFieldType
=
DictUtil
.
getDictionary
(
"resourceFieldType"
);
this
.
putAttribute
(
"resourceFieldType"
,
resourceFieldType
);
Map
<
String
,
String
>
yesorno
=
DictUtil
.
getDictionary
(
"yesorno"
);
this
.
putAttribute
(
"yesorno"
,
yesorno
);
return
forward
(
"resourceList"
);
return
forward
(
"resourceList"
);
}
}
/**
* 添加资源页面
* @return
*/
public
String
forwardFieldTreeDetail
(){
SDO
sdo
=
this
.
getSDO
();
String
tableName
=
sdo
.
getString
(
"tableName"
);
ResourceTypeVo
resourceTypeVo
=
resourceTypeService
.
initResourceTypeVo
(
tableName
);
return
forward
(
"fieldTreeDetail"
,
resourceTypeVo
);
}
/**
* 修改资源页面
* @return
*/
public
String
forwardUpdateFieldTreeDetail
(){
SDO
sdo
=
this
.
getSDO
();
String
tableName
=
sdo
.
getString
(
"tableName"
);
ResourceTypeVo
resourceTypeVo
=
resourceTypeService
.
findByTableName
(
tableName
);
return
forward
(
"fieldTreeDetail"
,
resourceTypeVo
);
}
//@Operation(summary = "保存资源类型")
//@Operation(summary = "保存资源类型")
public
String
saveResourceType
(
@RequestBody
ResourceTypeVo
resourceTypeVo
){
public
String
saveResourceType
(){
SDO
sdo
=
this
.
getSDO
();
ResourceTypeVo
resourceTypeVo
=
sdo
.
toObject
(
ResourceTypeVo
.
class
);
List
<
ResourceFiledVo
>
resourceFields
=
sdo
.
getList
(
"resourceFields"
,
ResourceFiledVo
.
class
);
resourceTypeVo
.
setResourceFileds
(
resourceFields
);
resourceTypeService
.
saveResourceTypeMain
(
resourceTypeVo
);
resourceTypeService
.
saveResourceTypeMain
(
resourceTypeVo
);
return
toResult
(
resourceTypeVo
);
return
toResult
(
resourceTypeVo
);
}
}
//@Operation(summary = "修改资源类型")
//@Operation(summary = "修改资源类型")
public
String
updateResourceType
(
@RequestBody
ResourceTypeVo
resourceTypeVo
){
public
String
updateResourceType
(){
SDO
sdo
=
this
.
getSDO
();
ResourceTypeVo
resourceTypeVo
=
sdo
.
toObject
(
ResourceTypeVo
.
class
);
List
<
ResourceFiledVo
>
resourceFields
=
sdo
.
getList
(
"resourceFields"
,
ResourceFiledVo
.
class
);
resourceTypeVo
.
setResourceFileds
(
resourceFields
);
resourceTypeService
.
updateResourceTypeMain
(
resourceTypeVo
);
resourceTypeService
.
updateResourceTypeMain
(
resourceTypeVo
);
return
toResult
(
resourceTypeVo
);
return
toResult
(
resourceTypeVo
);
}
}
//@Operation(summary = "根据id删除资源")
//@Operation(summary = "根据id删除资源")
public
String
deleteResourceType
(
@RequestParam
(
"id"
)
Long
id
){
public
String
deleteResourceType
(){
resourceTypeService
.
deleteById
(
id
);
SDO
sdo
=
this
.
getSDO
();
String
tableName
=
sdo
.
getString
(
"tableName"
);
ResourceTypeVo
resourceTypeVo
=
resourceTypeService
.
findByTableName
(
tableName
);
resourceTypeService
.
deleteById
(
resourceTypeVo
.
getResourceTypeId
());
return
success
();
return
success
();
}
}
//@Operation(summary = "根据id查询资源")
//@Operation(summary = "根据id查询资源")
public
String
findById
(
@RequestParam
(
"id"
)
Long
id
){
public
String
findById
(){
SDO
sdo
=
this
.
getSDO
();
Long
id
=
sdo
.
getLong
(
"id"
);
ResourceTypeVo
resourceTypeVo
=
resourceTypeService
.
findById
(
id
);
ResourceTypeVo
resourceTypeVo
=
resourceTypeService
.
findById
(
id
);
return
toResult
(
resourceTypeVo
);
return
toResult
(
resourceTypeVo
);
}
}
...
@@ -59,20 +107,26 @@ public class ResourceController extends CommonController {
...
@@ -59,20 +107,26 @@ public class ResourceController extends CommonController {
return
toResult
(
resourceTypeService
.
findList
());
return
toResult
(
resourceTypeService
.
findList
());
}
}
public
String
findResourceTypes
(){
SDO
sdo
=
this
.
getSDO
();
String
parentTableName
=
sdo
.
getString
(
"parentId"
);
List
<
ResourceTypeTreeVo
>
resourceTypeTreeVoList
=
resourceTypeService
.
queryResourceTypes
(
parentTableName
);
HashMap
<
Object
,
Object
>
hashMap
=
new
HashMap
<>();
hashMap
.
put
(
"Rows"
,
resourceTypeTreeVoList
);
return
toResult
(
hashMap
);
}
/*@Operation(summary = "根据表名,递归查询该表及父类字段")
/*@Operation(summary = "根据表名,递归查询该表及父类字段")
@GetMapping("/findParentResourceFields")
@GetMapping("/findParentResourceFields")
public Result<Set<ResourceFiled>> findParentResourceFields(@RequestParam String tableName){
public Result<Set<ResourceFiled>> findParentResourceFields(@RequestParam String tableName){
return Result.ok(resourceTypeService.findParentResourceFileds(tableName));
return Result.ok(resourceTypeService.findParentResourceFileds(tableName));
}*/
}*/
//@Operation(summary = "新增资源类型时,根据对象的父类表名,返回父类和超类及所属的字段")
public
String
findParentResourceTypeAndFields
(
@RequestParam
String
tableName
){
return
toResult
(
resourceTypeService
.
findParentResourceTypeAndFields
(
tableName
));
}
//@Operation(summary = "修改/查看资源类型时,根据当前表名,返回自己和父类和超类及所属的字段")
//@Operation(summary = "修改/查看资源类型时,根据当前表名,返回自己和父类和超类及所属的字段")
public
String
findResourceTypeAndFields
(
@RequestParam
String
tableName
){
public
String
findResourceTypeFields
(){
return
toResult
(
resourceTypeService
.
findResourceTypeAndFields
(
tableName
));
SDO
sdo
=
this
.
getSDO
();
String
tableName
=
sdo
.
getString
(
"tableName"
);
return
packGridDataAndResult
(
resourceTypeService
.
findResourceTypeFields
(
tableName
));
}
}
}
}
topsun/src/main/java/com/huigou/topsun/resource/controller/ResourceFieldController.java
View file @
3099a277
...
@@ -3,11 +3,14 @@ package com.huigou.topsun.resource.controller;
...
@@ -3,11 +3,14 @@ package com.huigou.topsun.resource.controller;
import
com.huigou.topsun.resource.service.ResourceFiledService
;
import
com.huigou.topsun.resource.service.ResourceFiledService
;
import
com.huigou.uasp.annotation.ControllerMapping
;
import
com.huigou.uasp.annotation.ControllerMapping
;
import
com.huigou.uasp.client.CommonController
;
import
com.huigou.uasp.client.CommonController
;
import
com.huigou.util.SDO
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
/**
/**
* @Auther: xin.lu
* @Auther: xin.lu
...
@@ -18,12 +21,23 @@ import java.util.HashMap;
...
@@ -18,12 +21,23 @@ import java.util.HashMap;
@Controller
@Controller
@ControllerMapping
(
"/resourceField"
)
@ControllerMapping
(
"/resourceField"
)
public
class
ResourceFieldController
extends
CommonController
{
public
class
ResourceFieldController
extends
CommonController
{
protected
String
getPagePath
()
{
return
"/biz/topsun/resource/"
;
}
@Resource
@Resource
private
ResourceFiledService
resourceFiledService
;
private
ResourceFiledService
resourceFiledService
;
public
String
forwardAddResourceFieldValue
(){
SDO
sdo
=
this
.
getSDO
();
String
resourceTypeId
=
sdo
.
getString
(
"resourceTypeId"
);
this
.
putAttribute
(
"resourceTypeId"
,
resourceTypeId
);
return
forward
(
"fieldValueDetail"
);
}
//@Operation(summary = "根据资源类型id,查询资源字段")
//@Operation(summary = "根据资源类型id,查询资源字段")
public
String
getResourceField
(
@RequestParam
(
"resourceTypeId"
)
Long
resourceTypeId
){
public
String
getResourceField
(){
SDO
sdo
=
this
.
getSDO
();
Long
resourceTypeId
=
sdo
.
getLong
(
"resourceTypeId"
);
return
toResult
(
resourceFiledService
.
findByResourceTypeId
(
resourceTypeId
));
return
toResult
(
resourceFiledService
.
findByResourceTypeId
(
resourceTypeId
));
}
}
...
@@ -38,8 +52,14 @@ public class ResourceFieldController extends CommonController {
...
@@ -38,8 +52,14 @@ public class ResourceFieldController extends CommonController {
}
}
//@Operation(summary = "根据资源类型id,获取资源值")
//@Operation(summary = "根据资源类型id,获取资源值")
public
String
getResourceFieldValue
(
@RequestParam
(
"resourceTypeId"
)
Long
resourceTypeId
){
public
String
getResourceFieldValue
(){
return
toResult
(
resourceFiledService
.
getResourceFieldValue
(
resourceTypeId
));
SDO
sdo
=
this
.
getSDO
();
Long
resourceTypeId
=
sdo
.
getLong
(
"resourceTypeId"
);
List
<
Map
<
String
,
Object
>>
resourceFieldValue
=
resourceFiledService
.
getResourceFieldValue
(
resourceTypeId
);
HashMap
<
Object
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"Rows"
,
resourceFieldValue
);
return
toResult
(
map
);
//return success();
}
}
//@Operation(summary = "根据资源类型id和数据id删除资源值")
//@Operation(summary = "根据资源类型id和数据id删除资源值")
...
...
topsun/src/main/java/com/huigou/topsun/resource/domain/ResourceFiled.java
View file @
3099a277
...
@@ -91,11 +91,6 @@ public class ResourceFiled implements Serializable {
...
@@ -91,11 +91,6 @@ public class ResourceFiled implements Serializable {
@TableField
(
value
=
"dict_code"
)
@TableField
(
value
=
"dict_code"
)
private
String
dictCode
;
private
String
dictCode
;
//@Schema(description = "假删除标记(-1已删除,0正常)")
@TableField
(
value
=
"deleted"
)
@TableLogic
//逻辑删除
private
Integer
deleted
;
@TableField
(
exist
=
false
)
@TableField
(
exist
=
false
)
private
static
final
long
serialVersionUID
=
1L
;
private
static
final
long
serialVersionUID
=
1L
;
}
}
\ No newline at end of file
topsun/src/main/java/com/huigou/topsun/resource/mapper/ResourceTypeMapper.java
View file @
3099a277
...
@@ -3,9 +3,12 @@ package com.huigou.topsun.resource.mapper;
...
@@ -3,9 +3,12 @@ package com.huigou.topsun.resource.mapper;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.huigou.topsun.resource.domain.ResourceType
;
import
com.huigou.topsun.resource.domain.ResourceType
;
import
com.huigou.topsun.resource.vo.ResourceTypeTreeVo
;
import
com.huigou.topsun.resource.vo.ResourceTypeVo
;
import
com.huigou.topsun.resource.vo.ResourceTypeVo
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
/**
/**
* @author 16508
* @author 16508
...
@@ -15,6 +18,9 @@ import java.util.List;
...
@@ -15,6 +18,9 @@ import java.util.List;
*/
*/
public
interface
ResourceTypeMapper
extends
BaseMapper
<
ResourceType
>
{
public
interface
ResourceTypeMapper
extends
BaseMapper
<
ResourceType
>
{
List
<
ResourceTypeVo
>
noteTree
();
List
<
ResourceTypeVo
>
noteTree
();
List
<
ResourceTypeTreeVo
>
queryResourceTypes
(
@Param
(
"parentTableName"
)
String
parentTableName
);
}
}
...
...
topsun/src/main/java/com/huigou/topsun/resource/service/ResourceTypeService.java
View file @
3099a277
...
@@ -4,9 +4,11 @@ package com.huigou.topsun.resource.service;
...
@@ -4,9 +4,11 @@ package com.huigou.topsun.resource.service;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.huigou.topsun.resource.domain.ResourceType
;
import
com.huigou.topsun.resource.domain.ResourceType
;
import
com.huigou.topsun.resource.vo.ResourceFiledVo
;
import
com.huigou.topsun.resource.vo.ResourceFiledVo
;
import
com.huigou.topsun.resource.vo.ResourceTypeTreeVo
;
import
com.huigou.topsun.resource.vo.ResourceTypeVo
;
import
com.huigou.topsun.resource.vo.ResourceTypeVo
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Set
;
import
java.util.Set
;
/**
/**
...
@@ -33,7 +35,9 @@ public interface ResourceTypeService extends IService<ResourceType> {
...
@@ -33,7 +35,9 @@ public interface ResourceTypeService extends IService<ResourceType> {
void
findParentMenusRecursively
(
String
tableName
,
Set
<
ResourceFiledVo
>
resourceFileds
);
void
findParentMenusRecursively
(
String
tableName
,
Set
<
ResourceFiledVo
>
resourceFileds
);
ResourceTypeVo
findParentResourceTypeAndFields
(
String
tableName
);
ResourceTypeVo
initResourceTypeVo
(
String
tableName
);
ResourceTypeVo
findResourceTypeAndFields
(
String
tableName
);
List
<
ResourceFiledVo
>
findResourceTypeFields
(
String
tableName
);
List
<
ResourceTypeTreeVo
>
queryResourceTypes
(
String
parentTableName
);
}
}
topsun/src/main/java/com/huigou/topsun/resource/service/impl/ResourceFiledServiceImpl.java
View file @
3099a277
...
@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON;
...
@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.huigou.cache.DictUtil
;
import
com.huigou.topsun.resource.domain.ResourceFieldValue
;
import
com.huigou.topsun.resource.domain.ResourceFieldValue
;
import
com.huigou.topsun.resource.domain.ResourceFiled
;
import
com.huigou.topsun.resource.domain.ResourceFiled
;
import
com.huigou.topsun.resource.domain.ResourceType
;
import
com.huigou.topsun.resource.domain.ResourceType
;
...
@@ -37,7 +38,7 @@ public class ResourceFiledServiceImpl extends ServiceImpl<ResourceFiledMapper, R
...
@@ -37,7 +38,7 @@ public class ResourceFiledServiceImpl extends ServiceImpl<ResourceFiledMapper, R
public
ResourceFiledVo
saveResourceFiled
(
ResourceFiledVo
resourceFiledVo
)
{
public
ResourceFiledVo
saveResourceFiled
(
ResourceFiledVo
resourceFiledVo
)
{
ResourceFiled
resourceFiled
=
ResourceFiledVo
.
getResourceFiled
(
resourceFiledVo
);
ResourceFiled
resourceFiled
=
ResourceFiledVo
.
getResourceFiled
(
resourceFiledVo
);
this
.
save
(
resourceFiled
);
this
.
save
(
resourceFiled
);
resourceFiledVo
.
setResourceFieldId
(
resourceFiled
.
getResourceFieldId
());
resourceFiledVo
.
setResourceFieldId
(
resourceFiled
.
getResourceFieldId
()
.
toString
()
);
return
resourceFiledVo
;
return
resourceFiledVo
;
}
}
...
@@ -114,7 +115,16 @@ public class ResourceFiledServiceImpl extends ServiceImpl<ResourceFiledMapper, R
...
@@ -114,7 +115,16 @@ public class ResourceFiledServiceImpl extends ServiceImpl<ResourceFiledMapper, R
LambdaQueryWrapper
<
ResourceFiled
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
LambdaQueryWrapper
<
ResourceFiled
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
queryWrapper
.
eq
(
ResourceFiled:
:
getResourceTypeId
,
resourceTypeId
);
queryWrapper
.
eq
(
ResourceFiled:
:
getResourceTypeId
,
resourceTypeId
);
List
<
ResourceFiled
>
list
=
this
.
list
(
queryWrapper
);
List
<
ResourceFiled
>
list
=
this
.
list
(
queryWrapper
);
return
JSON
.
parseArray
(
JSON
.
toJSONString
(
list
),
ResourceFiledVo
.
class
);
List
<
ResourceFiledVo
>
resourceFiledVos
=
JSON
.
parseArray
(
JSON
.
toJSONString
(
list
),
ResourceFiledVo
.
class
);
resourceFiledVos
.
forEach
(
resourceFiledVo
->
{
String
resourceFieldTypeText
=
DictUtil
.
getDictionaryDetailText
(
"resourceFieldType"
,
resourceFiledVo
.
getResourceFieldType
());
resourceFiledVo
.
setResourceFieldTypeTextView
(
resourceFieldTypeText
);
String
yesornoText
=
DictUtil
.
getDictionaryDetailText
(
"yesorno"
,
resourceFiledVo
.
getResourceFieldShow
());
resourceFiledVo
.
setResourceFieldShowTextView
(
yesornoText
);
});
return
resourceFiledVos
;
}
}
@Override
@Override
...
@@ -177,12 +187,17 @@ public class ResourceFiledServiceImpl extends ServiceImpl<ResourceFiledMapper, R
...
@@ -177,12 +187,17 @@ public class ResourceFiledServiceImpl extends ServiceImpl<ResourceFiledMapper, R
@Override
@Override
public
List
<
Map
<
String
,
Object
>>
getResourceFieldValue
(
Long
resourceTypeId
){
public
List
<
Map
<
String
,
Object
>>
getResourceFieldValue
(
Long
resourceTypeId
){
List
<
Map
<
String
,
Object
>>
maps
=
new
ArrayList
<>();
if
(
resourceTypeId
==
null
){
return
maps
;
}
else
{
ResourceType
resourceType
=
resourceTypeMapper
.
selectById
(
resourceTypeId
);
ResourceType
resourceType
=
resourceTypeMapper
.
selectById
(
resourceTypeId
);
//获取表名
//获取表名
String
tableName
=
resourceType
.
getResourceTableName
();
String
tableName
=
resourceType
.
getResourceTableName
();
List
<
Map
<
String
,
Object
>>
maps
=
resourceFiledMapper
.
selectDataList
(
tableName
);
maps
=
resourceFiledMapper
.
selectDataList
(
tableName
);
return
maps
;
return
maps
;
}
}
}
@Override
@Override
public
int
deleteResourceFieldValue
(
Long
resourceTypeId
,
Long
id
){
public
int
deleteResourceFieldValue
(
Long
resourceTypeId
,
Long
id
){
...
...
topsun/src/main/java/com/huigou/topsun/resource/service/impl/ResourceTypeServiceImpl.java
View file @
3099a277
...
@@ -9,6 +9,7 @@ import com.huigou.topsun.resource.service.ResourceFiledService;
...
@@ -9,6 +9,7 @@ import com.huigou.topsun.resource.service.ResourceFiledService;
import
com.huigou.topsun.resource.service.ResourceTypeService
;
import
com.huigou.topsun.resource.service.ResourceTypeService
;
import
com.huigou.topsun.resource.util.PinyinHelperUtil
;
import
com.huigou.topsun.resource.util.PinyinHelperUtil
;
import
com.huigou.topsun.resource.vo.ResourceFiledVo
;
import
com.huigou.topsun.resource.vo.ResourceFiledVo
;
import
com.huigou.topsun.resource.vo.ResourceTypeTreeVo
;
import
com.huigou.topsun.resource.vo.ResourceTypeVo
;
import
com.huigou.topsun.resource.vo.ResourceTypeVo
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
...
@@ -46,9 +47,8 @@ public class ResourceTypeServiceImpl extends ServiceImpl<ResourceTypeMapper, Res
...
@@ -46,9 +47,8 @@ public class ResourceTypeServiceImpl extends ServiceImpl<ResourceTypeMapper, Res
List
<
String
>
fieldList
=
new
ArrayList
<>();
List
<
String
>
fieldList
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
resourceFileds
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
resourceFileds
.
size
();
i
++)
{
ResourceFiledVo
resourceFiled
=
resourceFileds
.
get
(
i
);
ResourceFiledVo
resourceFiled
=
resourceFileds
.
get
(
i
);
resourceFiled
.
setResourceTypeId
(
resourceType
.
getResourceTypeId
());
resourceFiled
.
setResourceTypeId
(
resourceType
.
getResourceTypeId
()
.
toString
()
);
resourceFiled
.
setResourceFieldId
(
null
);
resourceFiled
.
setResourceFieldId
(
null
);
resourceFiled
.
setDeleted
(
0
);
//字段名称首字母小写
//字段名称首字母小写
String
pinYinHeadChar
=
PinyinHelperUtil
.
getPinYinHeadChar
(
resourceFiled
.
getResourceFiledTitle
());
String
pinYinHeadChar
=
PinyinHelperUtil
.
getPinYinHeadChar
(
resourceFiled
.
getResourceFiledTitle
());
if
(
fieldList
.
indexOf
(
pinYinHeadChar
)
>
0
)
{
if
(
fieldList
.
indexOf
(
pinYinHeadChar
)
>
0
)
{
...
@@ -62,8 +62,7 @@ public class ResourceTypeServiceImpl extends ServiceImpl<ResourceTypeMapper, Res
...
@@ -62,8 +62,7 @@ public class ResourceTypeServiceImpl extends ServiceImpl<ResourceTypeMapper, Res
resourceFiled
.
setResourceFieldSize
(
resourceFiled
.
getResourceFieldSize
()
==
null
?
255
:
resourceFiled
.
getResourceFieldSize
());
resourceFiled
.
setResourceFieldSize
(
resourceFiled
.
getResourceFieldSize
()
==
null
?
255
:
resourceFiled
.
getResourceFieldSize
());
}
}
if
(
"float"
.
equals
(
resourceFiled
.
getResourceFieldType
())
if
(
"float"
.
equals
(
resourceFiled
.
getResourceFieldType
())
||
"double"
.
equals
(
resourceFiled
.
getResourceFieldType
())
||
"double"
.
equals
(
resourceFiled
.
getResourceFieldType
())){
||
"decimal"
.
equals
(
resourceFiled
.
getResourceFieldType
())){
resourceFiled
.
setIntegerLength
(
resourceFiled
.
getIntegerLength
()
==
null
?
10
:
resourceFiled
.
getIntegerLength
());
resourceFiled
.
setIntegerLength
(
resourceFiled
.
getIntegerLength
()
==
null
?
10
:
resourceFiled
.
getIntegerLength
());
resourceFiled
.
setDecimalPrecision
(
resourceFiled
.
getDecimalPrecision
()
==
null
?
2
:
resourceFiled
.
getDecimalPrecision
());
resourceFiled
.
setDecimalPrecision
(
resourceFiled
.
getDecimalPrecision
()
==
null
?
2
:
resourceFiled
.
getDecimalPrecision
());
}
}
...
@@ -82,15 +81,17 @@ public class ResourceTypeServiceImpl extends ServiceImpl<ResourceTypeMapper, Res
...
@@ -82,15 +81,17 @@ public class ResourceTypeServiceImpl extends ServiceImpl<ResourceTypeMapper, Res
//先获取到数据库资源表配置字段
//先获取到数据库资源表配置字段
this
.
updateById
(
ResourceTypeVo
.
getResourceType
(
resourceTypeVo
));
this
.
updateById
(
ResourceTypeVo
.
getResourceType
(
resourceTypeVo
));
List
<
ResourceFiledVo
>
resourceFileds
=
resourceTypeVo
.
getResourceFileds
();
List
<
ResourceFiledVo
>
resourceFileds
=
resourceTypeVo
.
getResourceFileds
();
List
<
ResourceFiledVo
>
dbFiledVoList
=
resourceFiledService
.
findByResourceTypeId
(
resourceTypeVo
.
getResourceTypeId
());
//先根据资源类型id删除字段,再保存
//先根据资源类型id删除字段,再保存
resourceFiledService
.
deleteByResourceTypeId
(
resourceTypeVo
.
getResourceTypeId
());
resourceFiledService
.
deleteByResourceTypeId
(
resourceTypeVo
.
getResourceTypeId
());
this
.
dealResourceFileds
(
resourceFileds
,
resourceTypeVo
.
getResourceTableName
());
this
.
dealResourceFileds
(
resourceFileds
,
dbFiledVoList
,
resourceTypeVo
.
getResourceTableName
());
for
(
ResourceFiledVo
resourceFiledVo
:
resourceFileds
)
{
for
(
ResourceFiledVo
resourceFiledVo
:
resourceFileds
)
{
//字段名称首字母小写
//字段名称首字母小写
String
pinYinHeadChar
=
PinyinHelperUtil
.
getPinYinHeadChar
(
resourceFiledVo
.
getResourceFieldName
());
String
pinYinHeadChar
=
PinyinHelperUtil
.
getPinYinHeadChar
(
resourceFiledVo
.
getResourceFieldName
());
resourceFiledVo
.
setResourceFieldName
(
pinYinHeadChar
);
resourceFiledVo
.
setResourceFieldName
(
pinYinHeadChar
);
resourceFiledVo
.
setResourceTypeId
(
resourceTypeVo
.
getResourceTypeId
());
resourceFiledVo
.
setResourceTypeId
(
resourceTypeVo
.
getResourceTypeId
()
.
toString
()
);
resourceFiledService
.
saveResourceFiled
(
resourceFiledVo
);
resourceFiledService
.
saveResourceFiled
(
resourceFiledVo
);
}
}
//更新表
//更新表
...
@@ -98,7 +99,7 @@ public class ResourceTypeServiceImpl extends ServiceImpl<ResourceTypeMapper, Res
...
@@ -98,7 +99,7 @@ public class ResourceTypeServiceImpl extends ServiceImpl<ResourceTypeMapper, Res
}
}
@Transactional
@Transactional
public
void
dealResourceFileds
(
List
<
ResourceFiledVo
>
resourceFileds
,
String
tableName
)
{
public
void
dealResourceFileds
(
List
<
ResourceFiledVo
>
resourceFileds
,
List
<
ResourceFiledVo
>
dbFiledVoList
,
String
tableName
)
{
if
(
resourceFileds
.
isEmpty
())
{
if
(
resourceFileds
.
isEmpty
())
{
//添加新增的所有字段(id除外)
//添加新增的所有字段(id除外)
resourceFiledService
.
updateTableAddColumn
(
resourceFileds
,
tableName
);
resourceFiledService
.
updateTableAddColumn
(
resourceFileds
,
tableName
);
...
@@ -109,6 +110,11 @@ public class ResourceTypeServiceImpl extends ServiceImpl<ResourceTypeMapper, Res
...
@@ -109,6 +110,11 @@ public class ResourceTypeServiceImpl extends ServiceImpl<ResourceTypeMapper, Res
String
pinYinHeadChar
=
PinyinHelperUtil
.
getPinYinHeadChar
(
resourceFiledVo
.
getResourceFiledTitle
());
String
pinYinHeadChar
=
PinyinHelperUtil
.
getPinYinHeadChar
(
resourceFiledVo
.
getResourceFiledTitle
());
resourceFiledVo
.
setResourceFieldName
(
pinYinHeadChar
);
resourceFiledVo
.
setResourceFieldName
(
pinYinHeadChar
);
if
(
resourceFiledVo
.
getResourceFieldId
()
!=
null
)
{
//如果id不为空,更新字段
if
(
resourceFiledVo
.
getResourceFieldId
()
!=
null
)
{
//如果id不为空,更新字段
for
(
ResourceFiledVo
dbFiledVo
:
dbFiledVoList
)
{
if
(
resourceFiledVo
.
getResourceFieldId
().
equals
(
dbFiledVo
.
getResourceFieldId
())){
resourceFiledVo
.
setDbResourceFieldName
(
dbFiledVo
.
getResourceFieldName
());
}
}
resourceFiledChangeSet
.
add
(
resourceFiledVo
);
resourceFiledChangeSet
.
add
(
resourceFiledVo
);
}
else
{
}
else
{
resourceFiledSet
.
add
(
resourceFiledVo
);
//id 为null则是新增的字段,添加
resourceFiledSet
.
add
(
resourceFiledVo
);
//id 为null则是新增的字段,添加
...
@@ -191,24 +197,25 @@ public class ResourceTypeServiceImpl extends ServiceImpl<ResourceTypeMapper, Res
...
@@ -191,24 +197,25 @@ public class ResourceTypeServiceImpl extends ServiceImpl<ResourceTypeMapper, Res
}
}
@Override
@Override
public
ResourceTypeVo
findParentResourceTypeAndFields
(
String
tableName
)
{
public
ResourceTypeVo
initResourceTypeVo
(
String
tableName
)
{
ResourceTypeVo
resourceTypeVo
=
new
ResourceTypeVo
();
ResourceTypeVo
resourceTypeVo
=
new
ResourceTypeVo
();
ResourceTypeVo
parentResourceType
=
this
.
findByTableName
(
tableName
);
ResourceTypeVo
parentResourceType
=
this
.
findByTableName
(
tableName
);
resourceTypeVo
.
setParentTableName
(
parentResourceType
.
getResourceTableName
());
resourceTypeVo
.
setParentTableName
(
parentResourceType
.
getResourceTableName
());
resourceTypeVo
.
setParentTableTitle
(
parentResourceType
.
getResourceTableTitle
());
resourceTypeVo
.
setParentTableTitle
(
parentResourceType
.
getResourceTableTitle
());
resourceTypeVo
.
setSuperTableName
(
parentResourceType
.
getParentTableName
());
resourceTypeVo
.
setSuperTableName
(
parentResourceType
.
getParentTableName
());
resourceTypeVo
.
setSuperTableTitle
(
parentResourceType
.
getParentTableTitle
());
resourceTypeVo
.
setSuperTableTitle
(
parentResourceType
.
getParentTableTitle
());
List
<
ResourceFiledVo
>
parentResourceFileds
=
this
.
findParentResourceFileds
(
tableName
);
resourceTypeVo
.
setResourceFileds
(
parentResourceFileds
);
return
resourceTypeVo
;
return
resourceTypeVo
;
}
}
@Override
@Override
public
ResourceTypeVo
findResourceTypeAndFields
(
String
tableName
)
{
public
List
<
ResourceFiledVo
>
findResourceTypeFields
(
String
tableName
)
{
ResourceTypeVo
resourceTypeVo
=
this
.
findByTableName
(
tableName
);
List
<
ResourceFiledVo
>
resourceFileds
=
this
.
findParentResourceFileds
(
tableName
);
List
<
ResourceFiledVo
>
parentResourceFileds
=
this
.
findParentResourceFileds
(
tableName
);
return
resourceFileds
;
resourceTypeVo
.
setResourceFileds
(
parentResourceFileds
);
}
return
resourceTypeVo
;
@Override
public
List
<
ResourceTypeTreeVo
>
queryResourceTypes
(
String
parentTableName
)
{
return
resourceTypeMapper
.
queryResourceTypes
(
parentTableName
);
}
}
}
}
...
...
topsun/src/main/java/com/huigou/topsun/resource/vo/ResourceFiledVo.java
View file @
3099a277
...
@@ -3,6 +3,7 @@ package com.huigou.topsun.resource.vo;
...
@@ -3,6 +3,7 @@ package com.huigou.topsun.resource.vo;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.baomidou.mybatisplus.annotation.TableLogic
;
import
com.baomidou.mybatisplus.annotation.TableLogic
;
import
com.huigou.topsun.resource.domain.ResourceFiled
;
import
com.huigou.topsun.resource.domain.ResourceFiled
;
import
com.topsunit.query.annotations.Dictionary
;
import
lombok.Data
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.io.Serializable
;
...
@@ -18,13 +19,13 @@ public class ResourceFiledVo implements Serializable {
...
@@ -18,13 +19,13 @@ public class ResourceFiledVo implements Serializable {
* 资源字段ID
* 资源字段ID
*/
*/
//@Schema(description = "资源字段ID")
//@Schema(description = "资源字段ID")
private
Lo
ng
resourceFieldId
;
private
Stri
ng
resourceFieldId
;
/**
/**
* 所属资源类型
* 所属资源类型
*/
*/
//@Schema(description = "所属资源类型ID")
//@Schema(description = "所属资源类型ID")
private
Lo
ng
resourceTypeId
;
private
Stri
ng
resourceTypeId
;
/**
/**
* 字段名
* 字段名
...
@@ -41,15 +42,20 @@ public class ResourceFiledVo implements Serializable {
...
@@ -41,15 +42,20 @@ public class ResourceFiledVo implements Serializable {
/**
/**
* 字段类型
* 字段类型
*/
*/
//@Schema(description = "字段类型,码表(resourceFieldType))")
//@Schema(description = "字段类型,码表(resourceFieldType))
@Dictionary
(
"resourceFieldType"
)
private
String
resourceFieldType
;
private
String
resourceFieldType
;
private
String
resourceFieldTypeTextView
;
/**
/**
* 是否可见
* 是否可见
*/
*/
//@Schema(description = "是否可见,码表(resourceFieldShow))")
//@Schema(description = "是否可见,码表(resourceFieldShow))")
private
String
resourceFieldShow
;
private
String
resourceFieldShow
;
private
String
resourceFieldShowTextView
;
/**
/**
* 字段大小
* 字段大小
*/
*/
...
@@ -80,10 +86,6 @@ public class ResourceFiledVo implements Serializable {
...
@@ -80,10 +86,6 @@ public class ResourceFiledVo implements Serializable {
//@Schema(description = "对应码表的编码")
//@Schema(description = "对应码表的编码")
private
String
dictCode
;
private
String
dictCode
;
//@Schema(description = "假删除标记(-1已删除,0正常)")
@TableLogic
()
//逻辑删除
private
Integer
deleted
;
private
String
dbResourceFieldName
;
private
String
dbResourceFieldName
;
public
static
ResourceFiledVo
getResourceFiledVo
(
ResourceFiled
resourceFiled
){
public
static
ResourceFiledVo
getResourceFiledVo
(
ResourceFiled
resourceFiled
){
...
...
topsun/src/main/java/com/huigou/topsun/resource/vo/ResourceTypeTreeVo.java
0 → 100644
View file @
3099a277
package
com
.
huigou
.
topsun
.
resource
.
vo
;
import
lombok.Data
;
import
java.io.Serializable
;
/**
* @Auther: xin.lu
* @Date: 2023/11/13/9:51
* @Description:
*/
@Data
public
class
ResourceTypeTreeVo
implements
Serializable
{
private
String
resourceTypeId
;
private
String
id
;
private
String
name
;
private
String
parentId
;
private
String
parentTableTitle
;
private
String
superTableName
;
private
String
superTableTitle
;
private
Integer
status
;
private
String
nodeKindId
;
private
String
orgKindId
;
private
Integer
hasChildren
;
}
topsun/src/main/resources/config/topsun/mapper/A
0 → 100644
View file @
3099a277
topsun/src/main/
java/com/huigou/topsun/resource/mapper/xml
/ResourceFiledMapper.xml
→
topsun/src/main/
resources/config/topsun/mapper/resource
/ResourceFiledMapper.xml
View file @
3099a277
...
@@ -29,10 +29,16 @@
...
@@ -29,10 +29,16 @@
<if
test=
"resourceField.resourceFieldType == 'string'"
>
<if
test=
"resourceField.resourceFieldType == 'string'"
>
varchar( ${resourceField.resourceFieldSize} )
varchar( ${resourceField.resourceFieldSize} )
</if>
</if>
<if
test=
"resourceField.resourceFieldType == '
decimal' or resourceField.resourceFieldType == 'float' or resourceField.resourceFieldType == 'double
'"
>
<if
test=
"resourceField.resourceFieldType == '
int
'"
>
decimal( ${resourceField.integerLength},${resourceField.decimalPrecision}
)
int(0
)
</if>
</if>
<if
test=
"resourceField.resourceFieldType == 'datetime'"
>
<if
test=
"resourceField.resourceFieldType == 'double'"
>
double( ${resourceField.integerLength},${resourceField.decimalPrecision} )
</if>
<if
test=
"resourceField.resourceFieldType == 'float'"
>
float( ${resourceField.integerLength},${resourceField.decimalPrecision} )
</if>
<if
test=
"resourceField.resourceFieldType == 'date'"
>
datetime(0)
datetime(0)
</if>
</if>
<if
test=
"resourceField.resourceFieldType == 'text'"
>
<if
test=
"resourceField.resourceFieldType == 'text'"
>
...
...
topsun/src/main/
java/com/huigou/topsun/resource/mapper/xml
/ResourceTypeMapper.xml
→
topsun/src/main/
resources/config/topsun/mapper/resource
/ResourceTypeMapper.xml
View file @
3099a277
...
@@ -41,4 +41,25 @@
...
@@ -41,4 +41,25 @@
from resource_type
from resource_type
where parent_table_name=#{resource_table_name}
where parent_table_name=#{resource_table_name}
</select>
</select>
<select
id=
"queryResourceTypes"
resultType=
"com.huigou.topsun.resource.vo.ResourceTypeTreeVo"
>
SELECT
resource_type_id as resourceTypeId,
resource_table_name AS id,
resource_table_title AS name,
parent_table_name as parentTableName,
parent_table_name AS parentId,
parent_table_title as parentTableTitle,
super_table_name as superTableName,
super_table_title as superTableTitle,
1 as status,
CASE
WHEN ( SELECT count(*) FROM resource_type i WHERE i.parent_table_name = t.resource_table_name ) > 0 THEN
"folder" ELSE "fun"
END AS nodeKindId,
'ogn' AS orgKindId,
( SELECT count(*) FROM resource_type i WHERE i.parent_table_name = t.resource_table_name ) hasChildren
FROM
resource_type t where t.parent_table_name = #{parentTableName}
</select>
</mapper>
</mapper>
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