Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
YeeAmosFireAutoSysRoot
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
station
YeeAmosFireAutoSysRoot
Commits
20891247
Commit
20891247
authored
May 18, 2023
by
chenzhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改新增人员可以重复问题
parent
7f59c162
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
13 deletions
+29
-13
EmergencyTaskController.java
...amos/fas/business/controller/EmergencyTaskController.java
+29
-13
No files found.
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/controller/EmergencyTaskController.java
View file @
20891247
...
...
@@ -10,6 +10,7 @@ import com.yeejoin.amos.fas.core.common.request.CommonPageable;
import
com.yeejoin.amos.fas.dao.entity.Dict
;
import
com.yeejoin.amos.fas.dao.entity.EmergencyRelation
;
import
com.yeejoin.amos.fas.dao.entity.EmergencyRelationTree
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.data.domain.Page
;
import
com.yeejoin.amos.fas.core.util.CommonResponse
;
...
...
@@ -105,20 +106,35 @@ public class EmergencyTaskController extends BaseController{
@PostMapping
(
value
=
"/savePerson"
,
produces
=
"application/json;charset=UTF-8"
)
public
CommonResponse
savePerson
(
@RequestBody
EmergencyRelationVo
vo
){
List
<
Long
>
personIds
=
vo
.
getPersonIds
();
List
<
Long
>
oldPersonIds
=
iEmergencyTaskService
.
getPersonIds
(
vo
.
getObligationId
());
String
ids
=
StringUtils
.
join
(
oldPersonIds
,
","
);
List
<
Object
>
objects
=
jcsFeign
.
listCompanyByIds
(
personIds
);
objects
.
forEach
(
e
->
{
String
json
=
JSONObject
.
toJSONString
(
e
);
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
json
);
EmergencyRelation
emergencyRelation
=
new
EmergencyRelation
();
emergencyRelation
.
setObligationId
(
vo
.
getObligationId
());
emergencyRelation
.
setPersonId
(
Long
.
valueOf
(
jsonObject
.
get
(
"sequenceNbr"
).
toString
()));
emergencyRelation
.
setPersonName
(
jsonObject
.
get
(
"bizOrgName"
).
toString
());
emergencyRelation
.
setAmosOrgId
(
Long
.
valueOf
(
jsonObject
.
get
(
"amosOrgId"
).
toString
()));
emergencyRelation
.
setCreateDate
(
new
Date
());
iEmergencyTaskService
.
save
(
emergencyRelation
);
}
);
StringBuffer
stringBuffer
=
new
StringBuffer
();
for
(
Object
e
:
objects
)
{
String
json
=
JSONObject
.
toJSONString
(
e
);
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
json
);
if
(
ids
.
contains
(
jsonObject
.
get
(
"sequenceNbr"
).
toString
())){
stringBuffer
.
append
(
jsonObject
.
get
(
"bizOrgName"
).
toString
()+
" "
);
continue
;
}
EmergencyRelation
emergencyRelation
=
new
EmergencyRelation
();
emergencyRelation
.
setObligationId
(
vo
.
getObligationId
());
emergencyRelation
.
setPersonId
(
Long
.
valueOf
(
jsonObject
.
get
(
"sequenceNbr"
).
toString
()));
emergencyRelation
.
setPersonName
(
jsonObject
.
get
(
"bizOrgName"
).
toString
());
emergencyRelation
.
setAmosOrgId
(
Long
.
valueOf
(
jsonObject
.
get
(
"amosOrgId"
).
toString
()));
emergencyRelation
.
setCreateDate
(
new
Date
());
iEmergencyTaskService
.
save
(
emergencyRelation
);
}
if
(
stringBuffer
.
length
()>
0
){
stringBuffer
.
append
(
"已存在"
);
return
CommonResponseUtil
.
failure
(
stringBuffer
.
toString
());
}
return
CommonResponseUtil
.
success
();
}
...
...
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