Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gic-platform-enterprise
Overview
Overview
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
base_platform_enterprise
gic-platform-enterprise
Commits
d8bb0670
Commit
d8bb0670
authored
May 18, 2021
by
陶光胜
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
配置表
parent
ee9e0bd1
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
37 additions
and
10 deletions
+37
-10
TabTableSettingFieldMapper.java
...gic/enterprise/dao/mapper/TabTableSettingFieldMapper.java
+3
-0
TableSettingFieldService.java
.../com/gic/enterprise/service/TableSettingFieldService.java
+1
-1
TableSettingFieldServiceImpl.java
...enterprise/service/impl/TableSettingFieldServiceImpl.java
+14
-4
TableSettingApiServiceImpl.java
...rprise/service/outer/impl/TableSettingApiServiceImpl.java
+5
-2
TabTableSettingFieldMapper.xml
.../src/main/resources/mapper/TabTableSettingFieldMapper.xml
+8
-0
TableSettingController.java
.../gic/operation/web/controller/TableSettingController.java
+6
-3
No files found.
gic-platform-enterprise-service/src/main/java/com/gic/enterprise/dao/mapper/TabTableSettingFieldMapper.java
View file @
d8bb0670
...
...
@@ -64,4 +64,6 @@ public interface TabTableSettingFieldMapper {
* @throws
*/
List
<
TabTableSettingField
>
listField
(
@Param
(
"tableId"
)
Integer
tableId
);
TabTableSettingField
getFieldByKey
(
@Param
(
"tableId"
)
Integer
tableId
,
@Param
(
"fieldKey"
)
String
fieldKey
);
}
\ No newline at end of file
gic-platform-enterprise-service/src/main/java/com/gic/enterprise/service/TableSettingFieldService.java
View file @
d8bb0670
...
...
@@ -5,7 +5,7 @@ import com.gic.enterprise.dto.TableSettingFieldDTO;
import
java.util.List
;
public
interface
TableSettingFieldService
{
void
saveTableField
(
TableSettingFieldDTO
tableSettingFieldDTO
);
String
saveTableField
(
TableSettingFieldDTO
tableSettingFieldDTO
);
List
<
TableSettingFieldDTO
>
listTableField
(
Integer
tableId
);
...
...
gic-platform-enterprise-service/src/main/java/com/gic/enterprise/service/impl/TableSettingFieldServiceImpl.java
View file @
d8bb0670
...
...
@@ -17,16 +17,26 @@ public class TableSettingFieldServiceImpl implements TableSettingFieldService {
private
TabTableSettingFieldMapper
tabTableSettingFieldMapper
;
@Override
public
void
saveTableField
(
TableSettingFieldDTO
tableSettingFieldDTO
)
{
public
String
saveTableField
(
TableSettingFieldDTO
tableSettingFieldDTO
)
{
TabTableSettingField
tab
=
EntityUtil
.
changeEntityByJSON
(
TabTableSettingField
.
class
,
tableSettingFieldDTO
);
Date
date
=
new
Date
();
tableSettingFieldDTO
.
setUpdateTime
(
date
);
if
(
tableSettingFieldDTO
.
getFieldId
()
!=
null
){
tab
.
setUpdateTime
(
date
);
TabTableSettingField
field
=
tabTableSettingFieldMapper
.
getFieldByKey
(
tab
.
getTableId
(),
tab
.
getFieldKey
());
if
(
tab
.
getFieldId
()
!=
null
){
if
(
field
!=
null
){
if
(
field
.
getFieldId
()
!=
tab
.
getFieldId
()){
return
"该字段已经存在"
;
}
}
tabTableSettingFieldMapper
.
updateByPrimaryKeySelective
(
tab
);
}
else
{
tableSettingFieldDTO
.
setCreateTime
(
date
);
if
(
field
!=
null
){
return
"该字段已经存在"
;
}
tab
.
setCreateTime
(
date
);
tabTableSettingFieldMapper
.
insertSelective
(
tab
);
}
return
null
;
}
@Override
...
...
gic-platform-enterprise-service/src/main/java/com/gic/enterprise/service/outer/impl/TableSettingApiServiceImpl.java
View file @
d8bb0670
...
...
@@ -54,8 +54,11 @@ public class TableSettingApiServiceImpl implements TableSettingApiService {
@Override
public
ServiceResponse
<
Void
>
saveTableField
(
TableSettingFieldDTO
fieldDTO
)
{
tableSettingFieldService
.
saveTableField
(
fieldDTO
);
return
ServiceResponse
.
success
();
String
result
=
tableSettingFieldService
.
saveTableField
(
fieldDTO
);
if
(
StringUtils
.
isBlank
(
result
)){
return
ServiceResponse
.
success
();
}
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
result
);
}
@Override
...
...
gic-platform-enterprise-service/src/main/resources/mapper/TabTableSettingFieldMapper.xml
View file @
d8bb0670
...
...
@@ -133,4 +133,11 @@
from tab_table_setting_field
where table_id = #{tableId,jdbcType=INTEGER} and delete_flag = 0
</select>
<select
id=
"getFieldByKey"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from tab_table_setting_field
where table_id = #{tableId,jdbcType=INTEGER} and delete_flag = 0 and field_key = #{fieldKey}
</select>
</mapper>
\ No newline at end of file
gic-platform-operation-web/src/main/java/com/gic/operation/web/controller/TableSettingController.java
View file @
d8bb0670
...
...
@@ -39,7 +39,7 @@ public class TableSettingController {
@RequestMapping
(
"page-table-setting"
)
@ResponseBody
public
RestResponse
pageTableSetting
(
String
search
,
@RequestParam
(
defaultValue
=
1
)
Integer
pageNum
,
@RequestParam
(
defaultValue
=
20
)
Integer
pageSize
){
public
RestResponse
pageTableSetting
(
String
search
,
@RequestParam
(
defaultValue
=
"1"
)
Integer
pageNum
,
@RequestParam
(
defaultValue
=
"20"
)
Integer
pageSize
){
Page
<
TableSettingDTO
>
result
=
tableSettingApiService
.
pageTableSetting
(
search
,
pageNum
,
pageSize
).
getResult
();
return
RestResponse
.
success
(
result
);
}
...
...
@@ -62,8 +62,11 @@ public class TableSettingController {
@ResponseBody
public
RestResponse
addTableField
(
TableSettingFieldQO
qo
){
TableSettingFieldDTO
tableSettingFieldDTO
=
EntityUtil
.
changeEntityByJSON
(
TableSettingFieldDTO
.
class
,
qo
);
tableSettingApiService
.
saveTableField
(
tableSettingFieldDTO
);
return
RestResponse
.
success
();
ServiceResponse
<
Void
>
response
=
tableSettingApiService
.
saveTableField
(
tableSettingFieldDTO
);
if
(
response
.
isSuccess
()){
return
RestResponse
.
success
();
}
return
EnterpriseRestResponse
.
failure
(
response
);
}
@RequestMapping
(
"list-table-field"
)
...
...
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