Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
smart_gov_platform
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
赵啸非
smart_gov_platform
Commits
16c6bb0c
Commit
16c6bb0c
authored
Jun 11, 2024
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
动态字段调整排序逻辑
parent
c4979560
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
63 additions
and
8 deletions
+63
-8
base-manager/src/main/java/com/mortals/xhx/module/app/service/impl/AppInfoTempleteFieldServiceImpl.java
...ule/app/service/impl/AppInfoTempleteFieldServiceImpl.java
+63
-8
No files found.
base-manager/src/main/java/com/mortals/xhx/module/app/service/impl/AppInfoTempleteFieldServiceImpl.java
View file @
16c6bb0c
package
com.mortals.xhx.module.app.service.impl
;
import
com.mortals.xhx.common.utils.BeanUtil
;
import
com.mortals.xhx.module.app.model.*
;
import
com.mortals.xhx.module.app.service.AppDatasetService
;
import
com.mortals.xhx.module.app.service.AppInfoFieldService
;
import
com.mortals.xhx.module.app.service.AppService
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
com.mortals.framework.service.impl.AbstractCRUDServiceImpl
;
import
com.mortals.framework.exception.AppException
;
import
com.mortals.framework.model.Context
;
import
com.mortals.xhx.module.app.dao.AppInfoTempleteFieldDao
;
import
com.mortals.xhx.module.app.model.AppInfoTempleteFieldEntity
;
import
com.mortals.xhx.module.app.service.AppInfoTempleteFieldService
;
import
org.springframework.util.ObjectUtils
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
* AppInfoTempleteFieldService
* 自助终端应用模板信息字段 service实现
*
* @author zxfei
* @date 2022-11-28
*/
* AppInfoTempleteFieldService
* 自助终端应用模板信息字段 service实现
*
* @author zxfei
* @date 2022-11-28
*/
@Service
(
"appInfoTempleteFieldService"
)
public
class
AppInfoTempleteFieldServiceImpl
extends
AbstractCRUDServiceImpl
<
AppInfoTempleteFieldDao
,
AppInfoTempleteFieldEntity
,
Long
>
implements
AppInfoTempleteFieldService
{
@Autowired
private
AppService
appService
;
@Autowired
private
AppDatasetService
appDatasetService
;
@Autowired
private
AppInfoFieldService
appInfoFieldService
;
/**
* @param entity
* @param context
* @throws AppException
*/
@Override
protected
void
saveAfter
(
AppInfoTempleteFieldEntity
entity
,
Context
context
)
throws
AppException
{
//同步添加已有模板数据
AppDatasetQuery
appDatasetQuery
=
new
AppDatasetQuery
();
appDatasetQuery
.
setAppId
(
entity
.
getAppId
());
List
<
AppDatasetEntity
>
appDatasetEntities
=
appDatasetService
.
find
(
appDatasetQuery
,
context
);
// 判断该数据集 是否已经存在 没存在 再添加
ArrayList
<
AppInfoFieldEntity
>
fieldSaveList
=
new
ArrayList
<>();
for
(
AppDatasetEntity
appDatasetEntity
:
appDatasetEntities
)
{
AppInfoFieldQuery
appInfoFieldQuery
=
new
AppInfoFieldQuery
();
appInfoFieldQuery
.
setDatasetId
(
appDatasetEntity
.
getId
());
appInfoFieldQuery
.
setFieldCode
(
entity
.
getFieldCode
());
appInfoFieldQuery
.
setFieldType
(
entity
.
getFieldType
());
AppInfoFieldEntity
appInfoFieldEntity
=
appInfoFieldService
.
selectOne
(
appInfoFieldQuery
,
context
);
if
(
ObjectUtils
.
isEmpty
(
appInfoFieldEntity
))
{
AppInfoFieldEntity
fieldEntity
=
new
AppInfoFieldEntity
();
fieldEntity
.
initAttrValue
();
BeanUtils
.
copyProperties
(
entity
,
fieldEntity
,
BeanUtil
.
getNullPropertyNames
(
entity
));
fieldEntity
.
setDatasetId
(
appDatasetEntity
.
getId
());
fieldEntity
.
setId
(
null
);
fieldSaveList
.
add
(
fieldEntity
);
}
if
(!
ObjectUtils
.
isEmpty
(
fieldSaveList
))
{
appInfoFieldService
.
save
(
fieldSaveList
,
context
);
}
}
super
.
saveAfter
(
entity
,
context
);
}
}
\ No newline at end of file
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