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
da186756
Commit
da186756
authored
Nov 15, 2023
by
鲁鑫
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
资源值的增删改查
parent
3099a277
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
164 additions
and
146 deletions
+164
-146
fieldTreeDetail.js
...xt/src/main/webapp/biz/topsun/resource/fieldTreeDetail.js
+3
-3
fieldValueDetail.js
...t/src/main/webapp/biz/topsun/resource/fieldValueDetail.js
+7
-20
fieldValueDetail.jsp
.../src/main/webapp/biz/topsun/resource/fieldValueDetail.jsp
+2
-3
resourceList.js
...un-xt/src/main/webapp/biz/topsun/resource/resourceList.js
+25
-33
ResourceController.java
...huigou/topsun/resource/controller/ResourceController.java
+1
-1
ResourceFieldController.java
...u/topsun/resource/controller/ResourceFieldController.java
+37
-9
ResourceFiled.java
...java/com/huigou/topsun/resource/domain/ResourceFiled.java
+2
-2
ResourceType.java
.../java/com/huigou/topsun/resource/domain/ResourceType.java
+1
-1
ResourceFiledMapper.java
...om/huigou/topsun/resource/mapper/ResourceFiledMapper.java
+6
-4
ResourceFiledService.java
.../huigou/topsun/resource/service/ResourceFiledService.java
+9
-7
ResourceTypeService.java
...m/huigou/topsun/resource/service/ResourceTypeService.java
+2
-2
ResourceFiledServiceImpl.java
...opsun/resource/service/impl/ResourceFiledServiceImpl.java
+36
-23
ResourceTypeServiceImpl.java
...topsun/resource/service/impl/ResourceTypeServiceImpl.java
+5
-5
IdGenerator.java
...ain/java/com/huigou/topsun/resource/util/IdGenerator.java
+0
-29
ResourceFiledVo.java
...n/java/com/huigou/topsun/resource/vo/ResourceFiledVo.java
+5
-0
ResourceTypeVo.java
...in/java/com/huigou/topsun/resource/vo/ResourceTypeVo.java
+1
-1
CommonUtil.java
topsun/src/main/java/com/huigou/topsun/util/CommonUtil.java
+16
-0
PinyinHelperUtil.java
...rc/main/java/com/huigou/topsun/util/PinyinHelperUtil.java
+2
-2
ResourceFiledMapper.xml
...ces/config/topsun/mapper/resource/ResourceFiledMapper.xml
+4
-1
No files found.
topsun-xt/src/main/webapp/biz/topsun/resource/fieldTreeDetail.js
View file @
da186756
...
@@ -2,7 +2,7 @@ $(document).ready(function () {
...
@@ -2,7 +2,7 @@ $(document).ready(function () {
initResourceFieldGrid
();
initResourceFieldGrid
();
});
});
//初始化
研制人员
//初始化
资源
function
initResourceFieldGrid
(){
function
initResourceFieldGrid
(){
var
toolbarOptions
=
UICtrl
.
getDefaultToolbarOptions
({
var
toolbarOptions
=
UICtrl
.
getDefaultToolbarOptions
({
addHandler
:
function
(){
addHandler
:
function
(){
...
@@ -15,7 +15,7 @@ function initResourceFieldGrid(){
...
@@ -15,7 +15,7 @@ function initResourceFieldGrid(){
param
:
{},
param
:
{},
gridManager
:
_grid
,
gridManager
:
_grid
,
onSuccess
:
function
()
{
onSuccess
:
function
()
{
reloadGrid
();
reload
Field
Grid
();
}
}
});
});
}
}
...
@@ -92,7 +92,7 @@ function getGridColumns(){
...
@@ -92,7 +92,7 @@ function getGridColumns(){
return
columns
;
return
columns
;
}
}
function
reloadGrid
()
{
function
reload
Field
Grid
()
{
var
param
=
{
tableName
:
$
(
"#tableName"
).
val
()};
var
param
=
{
tableName
:
$
(
"#tableName"
).
val
()};
$
(
'#resourceFieldGrid'
).
ligerGetGridManager
().
options
.
url
=
web_app
.
name
+
'/resource/findParentResourceTypeAndFields.ajax'
;
$
(
'#resourceFieldGrid'
).
ligerGetGridManager
().
options
.
url
=
web_app
.
name
+
'/resource/findParentResourceTypeAndFields.ajax'
;
_grid
=
UICtrl
.
getGridManager
(
'#resourceFieldGrid'
);
_grid
=
UICtrl
.
getGridManager
(
'#resourceFieldGrid'
);
...
...
topsun-xt/src/main/webapp/biz/topsun/resource/fieldValueDetail.js
View file @
da186756
...
@@ -3,34 +3,21 @@ $(document).ready(function () {
...
@@ -3,34 +3,21 @@ $(document).ready(function () {
});
});
function
initResourceFields
()
{
function
initResourceFields
()
{
Public
.
ajax
(
web_app
.
name
+
"/resourceField/getResourceField.ajax"
,
{
Public
.
ajax
(
web_app
.
name
+
"/resourceField/getResourceField
Value
.ajax"
,
{
resourceTypeId
:
$
(
"#resourceTypeId"
).
val
()
resourceTypeId
:
$
(
"#resourceTypeId"
).
val
()
,
id
:
$
(
"#id"
).
val
()
},
function
(
data
)
{
},
function
(
data
)
{
debugger
;
var
$d
=
$
(
'#submitForm .hg-form-row'
);
var
$d
=
$
(
'#rowDiv'
);
for
(
var
i
=
0
;
i
<
data
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
data
.
length
;
i
++
)
{
var
field
=
data
[
i
];
var
field
=
data
[
i
];
//var s = $(`<input name="${field.resourceFieldName}" label="${field.resourceFiledTitle}" labelCol="2" fieldCol="4"/>`);
var
ss
=
$
(
`<div class="col-xs-4 col-sm-2">
//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
}
">
<label class="hg-form-label" id="
${
field
.
resourceFiledTitle
}
_label" title="
${
field
.
resourceFiledTitle
}
">
${
field
.
resourceFiledTitle
}
:
${
field
.
resourceFiledTitle
}
:
</label>
</label>
</div>
</div>
<div class="col-xs-8 col-sm-4 col-warp col-white-bg">
<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}">
<input type="text" name="
${
field
.
resourceFieldName
}
" id="
${
field
.
resourceFieldName
}
" value="
${
field
.
resourceFieldValue
}
" label="
${
field
.
resourceFiledTitle
}
">
</div>`)*/
</div>`
)
$d
.
append
(
ss
);
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]);
//input1.attr('value', data[i]);
}
}
}
}
...
...
topsun-xt/src/main/webapp/biz/topsun/resource/fieldValueDetail.jsp
View file @
da186756
...
@@ -5,11 +5,10 @@
...
@@ -5,11 +5,10 @@
<x:script
src=
'/biz/topsun/resource/fieldValueDetail.js'
/>
<x:script
src=
'/biz/topsun/resource/fieldValueDetail.js'
/>
</head>
</head>
<form
class=
"hg-form"
method=
"post"
action=
""
id=
"submitForm"
>
<form
class=
"hg-form"
method=
"post"
action=
""
id=
"submitForm"
>
<x:hidden
name=
"
tableName
"
/>
<x:hidden
name=
"
id
"
/>
<x:hidden
name=
"resourceTypeId"
/>
<x:hidden
name=
"resourceTypeId"
/>
<div
class=
"hg-form-cols"
>
<div
class=
"hg-form-cols"
>
<div
class=
"hg-form-row"
id=
"rowDiv>
<div
class=
"hg-form-row"
>
<x:inputC
name=
"resourceTableTitle"
required=
"true"
label=
"资源名称"
labelCol=
"2"
fieldCol=
"4"
/>
</div>
</div>
</div>
</div>
</form>
</form>
\ No newline at end of file
topsun-xt/src/main/webapp/biz/topsun/resource/resourceList.js
View file @
da186756
...
@@ -43,7 +43,7 @@ function initializeGrid() {
...
@@ -43,7 +43,7 @@ function initializeGrid() {
gridManager
=
UICtrl
.
grid
(
'#maingrid'
,
{
gridManager
=
UICtrl
.
grid
(
'#maingrid'
,
{
//columns: columnData,
//columns: columnData,
dataAction
:
'server'
,
dataAction
:
'server'
,
url
:
web_app
.
name
+
'/resourceField/getResourceFieldValue.ajax'
,
url
:
web_app
.
name
+
'/resourceField/getResourceFieldValue
List
.ajax'
,
parms
:
{
resourceTypeId
:
$
(
"#resourceTypeId"
).
val
()},
parms
:
{
resourceTypeId
:
$
(
"#resourceTypeId"
).
val
()},
checkbox
:
true
,
checkbox
:
true
,
width
:
'100%'
,
width
:
'100%'
,
...
@@ -114,11 +114,14 @@ function addHandler() {
...
@@ -114,11 +114,14 @@ function addHandler() {
//新增保存
//新增保存
function
insert
()
{
function
insert
()
{
var
_self
=
this
,
systemId
=
$
(
'#treeSystemId'
).
val
()
;
var
_self
=
this
;
$
(
'#submitForm'
).
ajaxSubmit
({
$
(
'#submitForm'
).
ajaxSubmit
({
url
:
web_app
.
name
+
'/
ssrfPurchaseBudget/insertSsrfBudgetRecord
.ajax'
,
url
:
web_app
.
name
+
'/
resourceField/saveResourceFiledValue
.ajax'
,
param
:{
systemId
:
systemId
},
param
:{},
success
:
function
(
data
)
{
success
:
function
(
data
)
{
if
(
data
==
"1"
){
Public
.
successTip
(
"保存成功!"
);
}
_self
.
close
();
_self
.
close
();
reloadGrid
();
reloadGrid
();
}
}
...
@@ -134,11 +137,10 @@ function updateHandler(id) {
...
@@ -134,11 +137,10 @@ function updateHandler(id) {
}
}
}
}
UICtrl
.
showAjaxDialog
({
UICtrl
.
showAjaxDialog
({
title
:
$
.
i18nProp
(
'
common.field.modif.title'
,
'预算
'
),
title
:
$
.
i18nProp
(
'
资源值
'
),
width
:
600
,
width
:
600
,
url
:
web_app
.
name
+
'/ssrfPurchaseBudget/showLoadSsrfBudgetRecord.load'
,
url
:
web_app
.
name
+
'/resourceField/forwardUpdateResourceFieldValue.load'
,
init
:
initDetailDialog
,
param
:
{
id
:
id
,
resourceTypeId
:
$
(
'#resourceTypeId'
).
val
()},
param
:
{
id
:
id
},
ok
:
update
,
ok
:
update
,
close
:
dialogClose
close
:
dialogClose
});
});
...
@@ -148,10 +150,14 @@ function updateHandler(id) {
...
@@ -148,10 +150,14 @@ function updateHandler(id) {
function
update
()
{
function
update
()
{
var
_self
=
this
;
var
_self
=
this
;
$
(
'#submitForm'
).
ajaxSubmit
({
$
(
'#submitForm'
).
ajaxSubmit
({
url
:
web_app
.
name
+
'/ssrfPurchaseBudget/updateSsrfBudgetRecord.ajax'
,
url
:
web_app
.
name
+
'/resourceField/updateResourceFiledValue.ajax'
,
success
:
function
()
{
success
:
function
(
data
)
{
if
(
data
==
"1"
){
Public
.
successTip
(
"修改成功!"
);
}
refreshFlag
=
true
;
refreshFlag
=
true
;
_self
.
close
();
_self
.
close
();
reloadGrid
();
}
}
});
});
}
}
...
@@ -159,30 +165,16 @@ function update() {
...
@@ -159,30 +165,16 @@ function update() {
//删除按钮
//删除按钮
function
deleteHandler
()
{
function
deleteHandler
()
{
DataUtil
.
del
({
DataUtil
.
del
({
action
:
'ssrfPurchaseBudget/deleteSsrfBudgetRecord.ajax'
,
action
:
'resourceField/deleteResourceFiledValue.ajax'
,
param
:{
id
:
DataUtil
.
getUpdateRowId
(
gridManager
),
resourceTypeId
:
$
(
'#resourceTypeId'
).
val
()
},
gridManager
:
gridManager
,
idFieldName
:
'id'
,
gridManager
:
gridManager
,
idFieldName
:
'id'
,
onSuccess
:
function
()
{
onSuccess
:
function
(
data
)
{
reloadGrid
();
if
(
data
==
"1"
){
}
Public
.
successTip
(
"删除成功!"
);
});
}
}
//启用
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
();
reloadGrid
();
}
}
});
});
...
...
topsun/src/main/java/com/huigou/topsun/resource/controller/ResourceController.java
View file @
da186756
...
@@ -97,7 +97,7 @@ public class ResourceController extends CommonController {
...
@@ -97,7 +97,7 @@ public class ResourceController extends CommonController {
//@Operation(summary = "根据id查询资源")
//@Operation(summary = "根据id查询资源")
public
String
findById
(){
public
String
findById
(){
SDO
sdo
=
this
.
getSDO
();
SDO
sdo
=
this
.
getSDO
();
Long
id
=
sdo
.
getLo
ng
(
"id"
);
String
id
=
sdo
.
getStri
ng
(
"id"
);
ResourceTypeVo
resourceTypeVo
=
resourceTypeService
.
findById
(
id
);
ResourceTypeVo
resourceTypeVo
=
resourceTypeService
.
findById
(
id
);
return
toResult
(
resourceTypeVo
);
return
toResult
(
resourceTypeVo
);
}
}
...
...
topsun/src/main/java/com/huigou/topsun/resource/controller/ResourceFieldController.java
View file @
da186756
package
com
.
huigou
.
topsun
.
resource
.
controller
;
package
com
.
huigou
.
topsun
.
resource
.
controller
;
import
com.huigou.topsun.resource.service.ResourceFiledService
;
import
com.huigou.topsun.resource.service.ResourceFiledService
;
import
com.huigou.topsun.resource.vo.ResourceFiledVo
;
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
com.huigou.util.SDO
;
import
com.huigou.util.StringUtil
;
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.ArrayList
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -34,40 +37,65 @@ public class ResourceFieldController extends CommonController {
...
@@ -34,40 +37,65 @@ public class ResourceFieldController extends CommonController {
return
forward
(
"fieldValueDetail"
);
return
forward
(
"fieldValueDetail"
);
}
}
public
String
forwardUpdateResourceFieldValue
(){
return
forward
(
"fieldValueDetail"
);
}
//@Operation(summary = "根据资源类型id,查询资源字段")
//@Operation(summary = "根据资源类型id,查询资源字段")
public
String
getResourceField
(){
public
String
getResourceField
(){
SDO
sdo
=
this
.
getSDO
();
SDO
sdo
=
this
.
getSDO
();
Long
resourceTypeId
=
sdo
.
getLo
ng
(
"resourceTypeId"
);
String
resourceTypeId
=
sdo
.
getStri
ng
(
"resourceTypeId"
);
return
toResult
(
resourceFiledService
.
findByResourceTypeId
(
resourceTypeId
));
return
toResult
(
resourceFiledService
.
findByResourceTypeId
(
resourceTypeId
));
}
}
public
String
getResourceFieldValue
(){
SDO
sdo
=
this
.
getSDO
();
String
id
=
sdo
.
getString
(
"id"
);
String
resourceTypeId
=
sdo
.
getString
(
"resourceTypeId"
);
List
<
ResourceFiledVo
>
resourceFiledVos
=
resourceFiledService
.
findFieldValueByResourceTypeIdAndId
(
resourceTypeId
,
id
);
return
toResult
(
resourceFiledVos
);
}
//@Operation(summary = "保存资源字段值")
//@Operation(summary = "保存资源字段值")
public
String
saveResourceFiledValue
(
@RequestBody
HashMap
<
String
,
Object
>
map
){
public
String
saveResourceFiledValue
(){
SDO
sdo
=
this
.
getSDO
();
Map
<
String
,
Object
>
map
=
sdo
.
getProperties
();
return
toResult
(
resourceFiledService
.
saveResourceFiledValue
(
map
));
return
toResult
(
resourceFiledService
.
saveResourceFiledValue
(
map
));
}
}
//@Operation(summary = "修改资源字段值")
//@Operation(summary = "修改资源字段值")
public
String
updateResourceFiledValue
(
@RequestBody
HashMap
<
String
,
Object
>
map
){
public
String
updateResourceFiledValue
(){
SDO
sdo
=
this
.
getSDO
();
Map
<
String
,
Object
>
map
=
sdo
.
getProperties
();
return
toResult
(
resourceFiledService
.
saveResourceFiledValue
(
map
));
return
toResult
(
resourceFiledService
.
saveResourceFiledValue
(
map
));
}
}
//@Operation(summary = "根据资源类型id,获取资源值")
//@Operation(summary = "根据资源类型id,获取资源值")
public
String
getResourceFieldValue
(){
public
String
getResourceFieldValue
List
(){
SDO
sdo
=
this
.
getSDO
();
SDO
sdo
=
this
.
getSDO
();
Long
resourceTypeId
=
sdo
.
getLong
(
"resourceTypeId"
);
String
resourceTypeId
=
sdo
.
getString
(
"resourceTypeId"
);
List
<
Map
<
String
,
Object
>>
resourceFieldValue
=
resourceFiledService
.
getResourceFieldValue
(
resourceTypeId
);
List
<
Map
<
String
,
Object
>>
resourceFieldValue
=
null
;
if
(
StringUtil
.
isBlank
(
resourceTypeId
)){
resourceFieldValue
=
new
ArrayList
<>();
}
else
{
resourceFieldValue
=
resourceFiledService
.
getResourceFieldValueList
(
resourceTypeId
);
}
HashMap
<
Object
,
Object
>
map
=
new
HashMap
<>();
HashMap
<
Object
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"Rows"
,
resourceFieldValue
);
map
.
put
(
"Rows"
,
resourceFieldValue
);
return
toResult
(
map
);
return
toResult
(
map
);
//return success();
}
}
//@Operation(summary = "根据资源类型id和数据id删除资源值")
//@Operation(summary = "根据资源类型id和数据id删除资源值")
public
String
deleteResourceFiledValue
(
@RequestParam
(
"resourceTypeId"
)
Long
resourceTypeId
,
@RequestParam
(
"id"
)
Long
id
){
public
String
deleteResourceFiledValue
(){
SDO
sdo
=
this
.
getSDO
();
String
id
=
sdo
.
getString
(
"id"
);
String
resourceTypeId
=
sdo
.
getString
(
"resourceTypeId"
);
return
toResult
(
resourceFiledService
.
deleteResourceFieldValue
(
resourceTypeId
,
id
));
return
toResult
(
resourceFiledService
.
deleteResourceFieldValue
(
resourceTypeId
,
id
));
}
}
public
String
getResourceFieldType
(
@RequestParam
(
"id"
)
Long
id
){
public
String
getResourceFieldType
(){
SDO
sdo
=
this
.
getSDO
();
String
id
=
sdo
.
getString
(
"id"
);
return
toResult
(
resourceFiledService
.
findById
(
id
));
return
toResult
(
resourceFiledService
.
findById
(
id
));
}
}
}
}
topsun/src/main/java/com/huigou/topsun/resource/domain/ResourceFiled.java
View file @
da186756
...
@@ -19,14 +19,14 @@ public class ResourceFiled implements Serializable {
...
@@ -19,14 +19,14 @@ public class ResourceFiled implements Serializable {
*/
*/
//@Schema(description = "资源字段ID")
//@Schema(description = "资源字段ID")
@TableId
(
value
=
"resource_field_id"
)
@TableId
(
value
=
"resource_field_id"
)
private
Lo
ng
resourceFieldId
;
private
Stri
ng
resourceFieldId
;
/**
/**
* 所属资源类型
* 所属资源类型
*/
*/
//@Schema(description = "所属资源类型ID")
//@Schema(description = "所属资源类型ID")
@TableField
(
value
=
"resource_type_id"
)
@TableField
(
value
=
"resource_type_id"
)
private
Lo
ng
resourceTypeId
;
private
Stri
ng
resourceTypeId
;
/**
/**
* 字段名
* 字段名
...
...
topsun/src/main/java/com/huigou/topsun/resource/domain/ResourceType.java
View file @
da186756
...
@@ -21,7 +21,7 @@ public class ResourceType implements Serializable {
...
@@ -21,7 +21,7 @@ public class ResourceType implements Serializable {
*/
*/
//@Schema(description = "资源库类型ID")
//@Schema(description = "资源库类型ID")
@TableId
(
value
=
"resource_type_id"
)
@TableId
(
value
=
"resource_type_id"
)
private
Lo
ng
resourceTypeId
;
private
Stri
ng
resourceTypeId
;
/**
/**
* 资源库类型表名
* 资源库类型表名
...
...
topsun/src/main/java/com/huigou/topsun/resource/mapper/ResourceFiledMapper.java
View file @
da186756
...
@@ -18,9 +18,9 @@ import java.util.Map;
...
@@ -18,9 +18,9 @@ import java.util.Map;
*/
*/
public
interface
ResourceFiledMapper
extends
BaseMapper
<
ResourceFiled
>
{
public
interface
ResourceFiledMapper
extends
BaseMapper
<
ResourceFiled
>
{
void
deleteByResourceTypeId
(
@Param
(
"resourceTypeId"
)
Lo
ng
resourceTypeId
);
void
deleteByResourceTypeId
(
@Param
(
"resourceTypeId"
)
Stri
ng
resourceTypeId
);
List
<
ResourceFiled
>
findByResourceTypeId
(
@Param
(
"resourceTypeId"
)
Lo
ng
resourceTypeId
);
List
<
ResourceFiled
>
findByResourceTypeId
(
@Param
(
"resourceTypeId"
)
Stri
ng
resourceTypeId
);
void
createTable
(
@Param
(
"tableName"
)
String
tableName
,
@Param
(
"tableTile"
)
String
tableTile
,
@Param
(
"resourceFields"
)
List
<
ResourceFiledVo
>
resourceFields
);
void
createTable
(
@Param
(
"tableName"
)
String
tableName
,
@Param
(
"tableTile"
)
String
tableTile
,
@Param
(
"resourceFields"
)
List
<
ResourceFiledVo
>
resourceFields
);
...
@@ -30,13 +30,15 @@ public interface ResourceFiledMapper extends BaseMapper<ResourceFiled> {
...
@@ -30,13 +30,15 @@ public interface ResourceFiledMapper extends BaseMapper<ResourceFiled> {
int
insertData
(
@Param
(
"tableName"
)
String
tableName
,
@Param
(
"resourceFieldValues"
)
List
<
ResourceFieldValue
>
resourceFieldValues
);
int
insertData
(
@Param
(
"tableName"
)
String
tableName
,
@Param
(
"resourceFieldValues"
)
List
<
ResourceFieldValue
>
resourceFieldValues
);
int
updateData
(
@Param
(
"id"
)
Lo
ng
id
,
@Param
(
"tableName"
)
String
tableName
,
@Param
(
"resourceFieldValues"
)
List
<
ResourceFieldValue
>
resourceFieldValues
);
int
updateData
(
@Param
(
"id"
)
Stri
ng
id
,
@Param
(
"tableName"
)
String
tableName
,
@Param
(
"resourceFieldValues"
)
List
<
ResourceFieldValue
>
resourceFieldValues
);
List
<
Map
<
String
,
Object
>>
selectDataList
(
@Param
(
"tableName"
)
String
tableName
);
List
<
Map
<
String
,
Object
>>
selectDataList
(
@Param
(
"tableName"
)
String
tableName
);
int
deleteDataById
(
@Param
(
"tableName"
)
String
tableName
,
@Param
(
"id"
)
Lo
ng
id
);
int
deleteDataById
(
@Param
(
"tableName"
)
String
tableName
,
@Param
(
"id"
)
Stri
ng
id
);
void
dropTableByResourceTableName
(
@Param
(
"tableName"
)
String
tableName
);
void
dropTableByResourceTableName
(
@Param
(
"tableName"
)
String
tableName
);
Map
<
String
,
Object
>
findFieldValueByResourceTypeIdAndId
(
@Param
(
"tableName"
)
String
tableName
,
@Param
(
"id"
)
String
id
);
}
}
...
...
topsun/src/main/java/com/huigou/topsun/resource/service/ResourceFiledService.java
View file @
da186756
...
@@ -28,21 +28,23 @@ public interface ResourceFiledService extends IService<ResourceFiled> {
...
@@ -28,21 +28,23 @@ public interface ResourceFiledService extends IService<ResourceFiled> {
ResourceFiledVo
updateResourceFiled
(
ResourceFiledVo
resourceFiled
);
ResourceFiledVo
updateResourceFiled
(
ResourceFiledVo
resourceFiled
);
void
deleteById
(
Lo
ng
id
);
void
deleteById
(
Stri
ng
id
);
void
deleteByResourceTypeId
(
Lo
ng
resourceFieldId
);
void
deleteByResourceTypeId
(
Stri
ng
resourceFieldId
);
ResourceFiledVo
findById
(
Lo
ng
id
);
ResourceFiledVo
findById
(
Stri
ng
id
);
List
<
ResourceFiledVo
>
findList
();
List
<
ResourceFiledVo
>
findList
();
List
<
ResourceFiledVo
>
findByResourceTypeId
(
Lo
ng
resourceTypeId
);
List
<
ResourceFiledVo
>
findByResourceTypeId
(
Stri
ng
resourceTypeId
);
int
saveResourceFiledValue
(
HashMap
<
String
,
Object
>
obj
);
int
saveResourceFiledValue
(
Map
<
String
,
Object
>
map
);
List
<
Map
<
String
,
Object
>>
getResourceFieldValue
(
Lo
ng
resourceTypeId
);
List
<
Map
<
String
,
Object
>>
getResourceFieldValue
List
(
Stri
ng
resourceTypeId
);
int
deleteResourceFieldValue
(
Long
resourceTypeId
,
Long
id
);
int
deleteResourceFieldValue
(
String
resourceTypeId
,
String
id
);
List
<
ResourceFiledVo
>
findFieldValueByResourceTypeIdAndId
(
String
resourceTypeId
,
String
id
);
void
dropTableByResourceName
(
String
tableName
);
void
dropTableByResourceName
(
String
tableName
);
}
}
topsun/src/main/java/com/huigou/topsun/resource/service/ResourceTypeService.java
View file @
da186756
...
@@ -22,9 +22,9 @@ public interface ResourceTypeService extends IService<ResourceType> {
...
@@ -22,9 +22,9 @@ public interface ResourceTypeService extends IService<ResourceType> {
ResourceTypeVo
updateResourceTypeMain
(
ResourceTypeVo
resourceType
);
ResourceTypeVo
updateResourceTypeMain
(
ResourceTypeVo
resourceType
);
void
deleteById
(
Lo
ng
id
);
void
deleteById
(
Stri
ng
id
);
ResourceTypeVo
findById
(
Lo
ng
id
);
ResourceTypeVo
findById
(
Stri
ng
id
);
List
<
ResourceTypeVo
>
findList
();
List
<
ResourceTypeVo
>
findList
();
...
...
topsun/src/main/java/com/huigou/topsun/resource/service/impl/ResourceFiledServiceImpl.java
View file @
da186756
...
@@ -11,8 +11,8 @@ import com.huigou.topsun.resource.domain.ResourceType;
...
@@ -11,8 +11,8 @@ import com.huigou.topsun.resource.domain.ResourceType;
import
com.huigou.topsun.resource.mapper.ResourceFiledMapper
;
import
com.huigou.topsun.resource.mapper.ResourceFiledMapper
;
import
com.huigou.topsun.resource.mapper.ResourceTypeMapper
;
import
com.huigou.topsun.resource.mapper.ResourceTypeMapper
;
import
com.huigou.topsun.resource.service.ResourceFiledService
;
import
com.huigou.topsun.resource.service.ResourceFiledService
;
//import com.huigou.topsun.resource.util.IdGenerator;
import
com.huigou.topsun.resource.vo.ResourceFiledVo
;
import
com.huigou.topsun.resource.vo.ResourceFiledVo
;
import
com.huigou.topsun.util.CommonUtil
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
...
@@ -31,9 +31,6 @@ public class ResourceFiledServiceImpl extends ServiceImpl<ResourceFiledMapper, R
...
@@ -31,9 +31,6 @@ public class ResourceFiledServiceImpl extends ServiceImpl<ResourceFiledMapper, R
private
ResourceFiledMapper
resourceFiledMapper
;
private
ResourceFiledMapper
resourceFiledMapper
;
@Resource
@Resource
private
ResourceTypeMapper
resourceTypeMapper
;
private
ResourceTypeMapper
resourceTypeMapper
;
//@Resource
//private IdGenerator idGenerator;
@Override
@Override
public
ResourceFiledVo
saveResourceFiled
(
ResourceFiledVo
resourceFiledVo
)
{
public
ResourceFiledVo
saveResourceFiled
(
ResourceFiledVo
resourceFiledVo
)
{
ResourceFiled
resourceFiled
=
ResourceFiledVo
.
getResourceFiled
(
resourceFiledVo
);
ResourceFiled
resourceFiled
=
ResourceFiledVo
.
getResourceFiled
(
resourceFiledVo
);
...
@@ -87,19 +84,19 @@ public class ResourceFiledServiceImpl extends ServiceImpl<ResourceFiledMapper, R
...
@@ -87,19 +84,19 @@ public class ResourceFiledServiceImpl extends ServiceImpl<ResourceFiledMapper, R
}
}
@Override
@Override
public
void
deleteById
(
Lo
ng
id
)
{
public
void
deleteById
(
Stri
ng
id
)
{
this
.
removeById
(
id
);
this
.
removeById
(
id
);
}
}
@Override
@Override
public
void
deleteByResourceTypeId
(
Lo
ng
resourceTypeId
)
{
public
void
deleteByResourceTypeId
(
Stri
ng
resourceTypeId
)
{
LambdaQueryWrapper
<
ResourceFiled
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
LambdaQueryWrapper
<
ResourceFiled
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
queryWrapper
.
eq
(
ResourceFiled:
:
getResourceTypeId
,
resourceTypeId
);
queryWrapper
.
eq
(
ResourceFiled:
:
getResourceTypeId
,
resourceTypeId
);
this
.
remove
(
queryWrapper
);
this
.
remove
(
queryWrapper
);
}
}
@Override
@Override
public
ResourceFiledVo
findById
(
Lo
ng
id
)
{
public
ResourceFiledVo
findById
(
Stri
ng
id
)
{
ResourceFiled
resourceFiled
=
this
.
getById
(
id
);
ResourceFiled
resourceFiled
=
this
.
getById
(
id
);
return
ResourceFiledVo
.
getResourceFiledVo
(
resourceFiled
);
return
ResourceFiledVo
.
getResourceFiledVo
(
resourceFiled
);
}
}
...
@@ -111,7 +108,7 @@ public class ResourceFiledServiceImpl extends ServiceImpl<ResourceFiledMapper, R
...
@@ -111,7 +108,7 @@ public class ResourceFiledServiceImpl extends ServiceImpl<ResourceFiledMapper, R
}
}
@Override
@Override
public
List
<
ResourceFiledVo
>
findByResourceTypeId
(
Lo
ng
resourceTypeId
)
{
public
List
<
ResourceFiledVo
>
findByResourceTypeId
(
Stri
ng
resourceTypeId
)
{
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
);
...
@@ -128,20 +125,20 @@ public class ResourceFiledServiceImpl extends ServiceImpl<ResourceFiledMapper, R
...
@@ -128,20 +125,20 @@ public class ResourceFiledServiceImpl extends ServiceImpl<ResourceFiledMapper, R
}
}
@Override
@Override
public
int
saveResourceFiledValue
(
Hash
Map
<
String
,
Object
>
map
)
{
public
int
saveResourceFiledValue
(
Map
<
String
,
Object
>
map
)
{
Long
resourceTypeId
=
(
Lo
ng
)
map
.
get
(
"resourceTypeId"
);
String
resourceTypeId
=
(
Stri
ng
)
map
.
get
(
"resourceTypeId"
);
ResourceType
resourceType
=
resourceTypeMapper
.
selectById
(
resourceTypeId
);
ResourceType
resourceType
=
resourceTypeMapper
.
selectById
(
resourceTypeId
);
//获取表名
//获取表名
String
tableName
=
resourceType
.
getResourceTableName
();
String
tableName
=
resourceType
.
getResourceTableName
();
//获取字段
//获取字段
List
<
ResourceFiledVo
>
resourceFiledList
=
this
.
findByResourceTypeId
(
resourceTypeId
);
List
<
ResourceFiledVo
>
resourceFiledList
=
this
.
findByResourceTypeId
(
resourceTypeId
);
//自动生成
长整型
id值
//自动生成
uu
id值
List
<
ResourceFieldValue
>
resourceFieldValues
=
this
.
dealFieldAndValue
(
resourceFiledList
,
map
);
List
<
ResourceFieldValue
>
resourceFieldValues
=
this
.
dealFieldAndValue
(
resourceFiledList
,
map
);
Long
id
=
(
Long
)
map
.
get
(
"id"
);
Object
idObj
=
map
.
get
(
"id"
);
if
(
id
==
null
){
if
(
id
Obj
==
null
||
idObj
==
""
){
return
resourceFiledMapper
.
insertData
(
tableName
,
resourceFieldValues
);
return
resourceFiledMapper
.
insertData
(
tableName
,
resourceFieldValues
);
}
else
{
}
else
{
return
resourceFiledMapper
.
updateData
(
(
Long
)
map
.
get
(
"id"
),
tableName
,
resourceFieldValues
);
return
resourceFiledMapper
.
updateData
(
idObj
.
toString
(
),
tableName
,
resourceFieldValues
);
}
}
}
}
...
@@ -151,7 +148,7 @@ public class ResourceFiledServiceImpl extends ServiceImpl<ResourceFiledMapper, R
...
@@ -151,7 +148,7 @@ public class ResourceFiledServiceImpl extends ServiceImpl<ResourceFiledMapper, R
* @param map
* @param map
* @return
* @return
*/
*/
public
List
<
ResourceFieldValue
>
dealFieldAndValue
(
List
<
ResourceFiledVo
>
resourceFiledList
,
Hash
Map
<
String
,
Object
>
map
){
public
List
<
ResourceFieldValue
>
dealFieldAndValue
(
List
<
ResourceFiledVo
>
resourceFiledList
,
Map
<
String
,
Object
>
map
){
Set
<
String
>
keySet
=
map
.
keySet
();
Set
<
String
>
keySet
=
map
.
keySet
();
List
<
ResourceFieldValue
>
resourceFieldValues
=
new
ArrayList
<>();
List
<
ResourceFieldValue
>
resourceFieldValues
=
new
ArrayList
<>();
resourceFiledList
resourceFiledList
...
@@ -163,7 +160,7 @@ public class ResourceFiledServiceImpl extends ServiceImpl<ResourceFiledMapper, R
...
@@ -163,7 +160,7 @@ public class ResourceFiledServiceImpl extends ServiceImpl<ResourceFiledMapper, R
resourceFieldValue
.
setField
(
key
);
resourceFieldValue
.
setField
(
key
);
//如果值是字符串,文本,日期格式的需要加英文状态下的引号: ''
//如果值是字符串,文本,日期格式的需要加英文状态下的引号: ''
if
(
"string"
.
equals
(
resourceFiled
.
getResourceFieldType
())
||
if
(
"string"
.
equals
(
resourceFiled
.
getResourceFieldType
())
||
"date
time
"
.
equals
(
resourceFiled
.
getResourceFieldType
())
||
"date"
.
equals
(
resourceFiled
.
getResourceFieldType
())
||
"text"
.
equals
(
resourceFiled
.
getResourceFieldType
())
){
"text"
.
equals
(
resourceFiled
.
getResourceFieldType
())
){
resourceFieldValue
.
setValue
(
"'"
+
map
.
get
(
key
)
+
"'"
);
resourceFieldValue
.
setValue
(
"'"
+
map
.
get
(
key
)
+
"'"
);
}
else
{
}
else
{
...
@@ -173,20 +170,19 @@ public class ResourceFiledServiceImpl extends ServiceImpl<ResourceFiledMapper, R
...
@@ -173,20 +170,19 @@ public class ResourceFiledServiceImpl extends ServiceImpl<ResourceFiledMapper, R
}
}
}
}
});
});
Object
idObj
=
map
.
get
(
"id"
);
Long
id
=
(
Long
)
map
.
get
(
"id"
);
if
(
idObj
==
null
||
idObj
==
""
){
if
(
id
==
null
){
ResourceFieldValue
resourceFieldValue
=
new
ResourceFieldValue
();
ResourceFieldValue
resourceFieldValue
=
new
ResourceFieldValue
();
resourceFieldValue
.
setField
(
"id"
);
resourceFieldValue
.
setField
(
"id"
);
//Long nextedId = idGenerator.nextId(resourceFieldValue
);
String
uuid
=
CommonUtil
.
createUuid
(
);
resourceFieldValue
.
setValue
(
null
);
resourceFieldValue
.
setValue
(
"'"
+
uuid
+
"'"
);
resourceFieldValues
.
add
(
resourceFieldValue
);
resourceFieldValues
.
add
(
resourceFieldValue
);
}
}
return
resourceFieldValues
;
return
resourceFieldValues
;
}
}
@Override
@Override
public
List
<
Map
<
String
,
Object
>>
getResourceFieldValue
(
Lo
ng
resourceTypeId
){
public
List
<
Map
<
String
,
Object
>>
getResourceFieldValue
List
(
Stri
ng
resourceTypeId
){
List
<
Map
<
String
,
Object
>>
maps
=
new
ArrayList
<>();
List
<
Map
<
String
,
Object
>>
maps
=
new
ArrayList
<>();
if
(
resourceTypeId
==
null
){
if
(
resourceTypeId
==
null
){
return
maps
;
return
maps
;
...
@@ -200,13 +196,30 @@ public class ResourceFiledServiceImpl extends ServiceImpl<ResourceFiledMapper, R
...
@@ -200,13 +196,30 @@ public class ResourceFiledServiceImpl extends ServiceImpl<ResourceFiledMapper, R
}
}
@Override
@Override
public
int
deleteResourceFieldValue
(
Long
resourceTypeId
,
Lo
ng
id
){
public
int
deleteResourceFieldValue
(
String
resourceTypeId
,
Stri
ng
id
){
ResourceType
resourceType
=
resourceTypeMapper
.
selectById
(
resourceTypeId
);
ResourceType
resourceType
=
resourceTypeMapper
.
selectById
(
resourceTypeId
);
//获取表名
//获取表名
String
tableName
=
resourceType
.
getResourceTableName
();
String
tableName
=
resourceType
.
getResourceTableName
();
return
resourceFiledMapper
.
deleteDataById
(
tableName
,
id
);
return
resourceFiledMapper
.
deleteDataById
(
tableName
,
id
);
}
}
@Override
public
List
<
ResourceFiledVo
>
findFieldValueByResourceTypeIdAndId
(
String
resourceTypeId
,
String
id
)
{
ResourceType
resourceType
=
resourceTypeMapper
.
selectById
(
resourceTypeId
);
//获取表名
String
tableName
=
resourceType
.
getResourceTableName
();
Map
<
String
,
Object
>
map
=
resourceFiledMapper
.
findFieldValueByResourceTypeIdAndId
(
tableName
,
id
);
List
<
ResourceFiledVo
>
filedVoList
=
this
.
findByResourceTypeId
(
resourceTypeId
);
if
(
map
==
null
){
return
filedVoList
;
}
for
(
ResourceFiledVo
resourceFiledVo
:
filedVoList
)
{
Object
value
=
map
.
get
(
resourceFiledVo
.
getResourceFieldName
());
resourceFiledVo
.
setResourceFieldValue
(
value
);
}
return
filedVoList
;
}
@Override
@Override
public
void
dropTableByResourceName
(
String
tableName
)
{
public
void
dropTableByResourceName
(
String
tableName
)
{
resourceFiledMapper
.
dropTableByResourceTableName
(
tableName
);
resourceFiledMapper
.
dropTableByResourceTableName
(
tableName
);
...
...
topsun/src/main/java/com/huigou/topsun/resource/service/impl/ResourceTypeServiceImpl.java
View file @
da186756
...
@@ -7,7 +7,7 @@ import com.huigou.topsun.resource.domain.ResourceType;
...
@@ -7,7 +7,7 @@ import com.huigou.topsun.resource.domain.ResourceType;
import
com.huigou.topsun.resource.mapper.ResourceTypeMapper
;
import
com.huigou.topsun.resource.mapper.ResourceTypeMapper
;
import
com.huigou.topsun.resource.service.ResourceFiledService
;
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.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.ResourceTypeTreeVo
;
import
com.huigou.topsun.resource.vo.ResourceTypeVo
;
import
com.huigou.topsun.resource.vo.ResourceTypeVo
;
...
@@ -47,7 +47,7 @@ public class ResourceTypeServiceImpl extends ServiceImpl<ResourceTypeMapper, Res
...
@@ -47,7 +47,7 @@ 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
()
.
toString
()
);
resourceFiled
.
setResourceTypeId
(
resourceType
.
getResourceTypeId
());
resourceFiled
.
setResourceFieldId
(
null
);
resourceFiled
.
setResourceFieldId
(
null
);
//字段名称首字母小写
//字段名称首字母小写
String
pinYinHeadChar
=
PinyinHelperUtil
.
getPinYinHeadChar
(
resourceFiled
.
getResourceFiledTitle
());
String
pinYinHeadChar
=
PinyinHelperUtil
.
getPinYinHeadChar
(
resourceFiled
.
getResourceFiledTitle
());
...
@@ -91,7 +91,7 @@ public class ResourceTypeServiceImpl extends ServiceImpl<ResourceTypeMapper, Res
...
@@ -91,7 +91,7 @@ public class ResourceTypeServiceImpl extends ServiceImpl<ResourceTypeMapper, Res
//字段名称首字母小写
//字段名称首字母小写
String
pinYinHeadChar
=
PinyinHelperUtil
.
getPinYinHeadChar
(
resourceFiledVo
.
getResourceFieldName
());
String
pinYinHeadChar
=
PinyinHelperUtil
.
getPinYinHeadChar
(
resourceFiledVo
.
getResourceFieldName
());
resourceFiledVo
.
setResourceFieldName
(
pinYinHeadChar
);
resourceFiledVo
.
setResourceFieldName
(
pinYinHeadChar
);
resourceFiledVo
.
setResourceTypeId
(
resourceTypeVo
.
getResourceTypeId
()
.
toString
()
);
resourceFiledVo
.
setResourceTypeId
(
resourceTypeVo
.
getResourceTypeId
());
resourceFiledService
.
saveResourceFiled
(
resourceFiledVo
);
resourceFiledService
.
saveResourceFiled
(
resourceFiledVo
);
}
}
//更新表
//更新表
...
@@ -136,7 +136,7 @@ public class ResourceTypeServiceImpl extends ServiceImpl<ResourceTypeMapper, Res
...
@@ -136,7 +136,7 @@ public class ResourceTypeServiceImpl extends ServiceImpl<ResourceTypeMapper, Res
@Override
@Override
public
void
deleteById
(
Lo
ng
id
)
{
public
void
deleteById
(
Stri
ng
id
)
{
ResourceType
resourceType
=
this
.
getById
(
id
);
ResourceType
resourceType
=
this
.
getById
(
id
);
resourceFiledService
.
deleteByResourceTypeId
(
id
);
resourceFiledService
.
deleteByResourceTypeId
(
id
);
resourceTypeMapper
.
deleteById
(
id
);
resourceTypeMapper
.
deleteById
(
id
);
...
@@ -144,7 +144,7 @@ public class ResourceTypeServiceImpl extends ServiceImpl<ResourceTypeMapper, Res
...
@@ -144,7 +144,7 @@ public class ResourceTypeServiceImpl extends ServiceImpl<ResourceTypeMapper, Res
}
}
@Override
@Override
public
ResourceTypeVo
findById
(
Lo
ng
id
)
{
public
ResourceTypeVo
findById
(
Stri
ng
id
)
{
return
ResourceTypeVo
.
getResourceTypeVo
(
this
.
getById
(
id
));
return
ResourceTypeVo
.
getResourceTypeVo
(
this
.
getById
(
id
));
}
}
...
...
topsun/src/main/java/com/huigou/topsun/resource/util/IdGenerator.java
deleted
100644 → 0
View file @
3099a277
//package com.huigou.topsun.resource.util;
//
//import cn.hutool.core.lang.Snowflake;
//import cn.hutool.core.util.IdUtil;
//import com.baomidou.mybatisplus.core.incrementer.IKeyGenerator;
//import com.baomidou.mybatisplus.core.incrementer.IdentifierGenerator;
//import org.hibernate.HibernateException;
//import org.hibernate.engine.spi.SessionImplementor;
//import org.hibernate.id.IdentifierGenerator;
//import org.springframework.stereotype.Component;
//
//import java.io.Serializable;
//
//@Component
//public class IdGenerator implements IdentifierGenerator {
// @Override
// public Long nextId(Object entity) {
// //使用 hutools 雪花算法生成分布式ID
// //参数1为终端ID
// //参数2为数据中心ID
// Snowflake snowflake = IdUtil.getSnowflake(1, 1);
// return snowflake.nextId();
// }
//
// @Override
// public Serializable generate(SessionImplementor sessionImplementor, Object o) throws HibernateException {
// return null;
// }
//}
topsun/src/main/java/com/huigou/topsun/resource/vo/ResourceFiledVo.java
View file @
da186756
...
@@ -33,6 +33,11 @@ public class ResourceFiledVo implements Serializable {
...
@@ -33,6 +33,11 @@ public class ResourceFiledVo implements Serializable {
//@Schema(description = "字段名")
//@Schema(description = "字段名")
private
String
resourceFieldName
;
private
String
resourceFieldName
;
/**
* 字段值
*/
private
Object
resourceFieldValue
=
""
;
/**
/**
* 字段显示名
* 字段显示名
*/
*/
...
...
topsun/src/main/java/com/huigou/topsun/resource/vo/ResourceTypeVo.java
View file @
da186756
...
@@ -18,7 +18,7 @@ public class ResourceTypeVo implements Serializable {
...
@@ -18,7 +18,7 @@ public class ResourceTypeVo implements Serializable {
* 资源库类型ID
* 资源库类型ID
*/
*/
//@Schema(description = "资源库类型ID")
//@Schema(description = "资源库类型ID")
private
Lo
ng
resourceTypeId
;
private
Stri
ng
resourceTypeId
;
/**
/**
* 资源库类型表名
* 资源库类型表名
...
...
topsun/src/main/java/com/huigou/topsun/util/CommonUtil.java
0 → 100644
View file @
da186756
package
com
.
huigou
.
topsun
.
util
;
import
java.util.UUID
;
public
class
CommonUtil
{
/**
* @Description TODO(自动生成uuid)
*/
public
static
String
createUuid
()
{
UUID
u
=
UUID
.
randomUUID
();
String
uuid
=
u
.
toString
().
replace
(
"-"
,
""
).
toUpperCase
();
return
uuid
;
}
}
topsun/src/main/java/com/huigou/topsun/
resource/
util/PinyinHelperUtil.java
→
topsun/src/main/java/com/huigou/topsun/util/PinyinHelperUtil.java
View file @
da186756
package
com
.
huigou
.
topsun
.
resource
.
util
;
package
com
.
huigou
.
topsun
.
util
;
import
net.sourceforge.pinyin4j.PinyinHelper
;
import
net.sourceforge.pinyin4j.PinyinHelper
;
public
class
PinyinHelperUtil
{
public
class
PinyinHelperUtil
{
/**
/**
...
...
topsun/src/main/resources/config/topsun/mapper/resource/ResourceFiledMapper.xml
View file @
da186756
...
@@ -56,7 +56,7 @@
...
@@ -56,7 +56,7 @@
<update
id=
"createTable"
>
<update
id=
"createTable"
>
create table ${tableName}
create table ${tableName}
( id
bigint(0
) COMMENT '主键ID',
( id
varchar(128
) COMMENT '主键ID',
<foreach
collection=
"resourceFields"
item=
"resourceField"
separator=
","
>
<foreach
collection=
"resourceFields"
item=
"resourceField"
separator=
","
>
<include
refid=
"matchFieldType"
/>
<include
refid=
"matchFieldType"
/>
</foreach>
</foreach>
...
@@ -108,6 +108,9 @@
...
@@ -108,6 +108,9 @@
<select
id=
"selectDataList"
resultType=
"java.util.Map"
parameterType=
"java.lang.String"
>
<select
id=
"selectDataList"
resultType=
"java.util.Map"
parameterType=
"java.lang.String"
>
select * from ${tableName}
select * from ${tableName}
</select>
</select>
<select
id=
"findFieldValueByResourceTypeIdAndId"
resultType=
"java.util.Map"
>
select * from ${tableName} where id = #{id}
</select>
<delete
id=
"deleteDataById"
>
<delete
id=
"deleteDataById"
>
delete from ${tableName} where id = #{id}
delete from ${tableName} where id = #{id}
...
...
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