Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
sample-form-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
赵啸非
sample-form-platform
Commits
2c21cd50
Commit
2c21cd50
authored
Apr 17, 2024
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加材料分类字段
parent
5ce2b0ae
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
0 deletions
+25
-0
sample-form-manager/src/main/java/com/mortals/xhx/module/datum/service/impl/DatumCategoryServiceImpl.java
...x/module/datum/service/impl/DatumCategoryServiceImpl.java
+8
-0
sample-form-manager/src/main/java/com/mortals/xhx/module/datum/web/DatumCategoryController.java
...mortals/xhx/module/datum/web/DatumCategoryController.java
+17
-0
No files found.
sample-form-manager/src/main/java/com/mortals/xhx/module/datum/service/impl/DatumCategoryServiceImpl.java
View file @
2c21cd50
...
...
@@ -2,6 +2,7 @@ package com.mortals.xhx.module.datum.service.impl;
import
com.alibaba.fastjson.JSONObject
;
import
com.fasterxml.jackson.annotation.JsonAnySetter
;
import
com.mortals.xhx.module.datum.model.DatumCategoryQuery
;
import
com.mortals.xhx.module.matter.model.MatterCategoryEntity
;
import
com.mortals.xhx.module.matter.service.MatterCategoryService
;
import
org.checkerframework.checker.units.qual.A
;
...
...
@@ -37,6 +38,13 @@ public class DatumCategoryServiceImpl extends AbstractCRUDServiceImpl<DatumCateg
log
.
info
(
"validData:{}"
,
JSONObject
.
toJSONString
(
entity
));
}
@Override
protected
void
saveBefore
(
DatumCategoryEntity
entity
,
Context
context
)
throws
AppException
{
//判读添加的材料 是否已经存在
super
.
saveBefore
(
entity
,
context
);
}
private
void
updateCategoryName
(
DatumCategoryEntity
entity
)
{
if
(!
ObjectUtils
.
isEmpty
(
entity
.
getCategoryId
()))
{
MatterCategoryEntity
matterCategoryEntity
=
matterCategoryService
.
get
(
entity
.
getCategoryId
());
...
...
sample-form-manager/src/main/java/com/mortals/xhx/module/datum/web/DatumCategoryController.java
View file @
2c21cd50
package
com.mortals.xhx.module.datum.web
;
import
com.mortals.framework.exception.AppException
;
import
com.mortals.framework.web.BaseCRUDJsonBodyMappingController
;
import
com.mortals.xhx.base.system.param.service.ParamService
;
import
com.mortals.xhx.module.datum.model.DatumCategoryQuery
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.*
;
...
...
@@ -46,4 +49,18 @@ public class DatumCategoryController extends BaseCRUDJsonBodyMappingController<D
}
@Override
protected
void
batchSaveBefore
(
List
<
DatumCategoryEntity
>
list
,
Map
<
String
,
Object
>
model
,
Context
context
)
throws
AppException
{
super
.
batchSaveBefore
(
list
,
model
,
context
);
for
(
DatumCategoryEntity
entity
:
list
)
{
DatumCategoryQuery
datumCategoryQuery
=
new
DatumCategoryQuery
();
datumCategoryQuery
.
setMaterialId
(
entity
.
getMaterialId
());
datumCategoryQuery
.
setCategoryId
(
entity
.
getCategoryId
());
DatumCategoryEntity
datumCategoryEntity
=
this
.
service
.
selectOne
(
datumCategoryQuery
,
context
);
if
(!
ObjectUtils
.
isEmpty
(
datumCategoryEntity
)){
entity
.
setId
(
datumCategoryEntity
.
getId
());
}
}
}
}
\ 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