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
68a6eb26
Commit
68a6eb26
authored
May 08, 2023
by
chenzhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加编辑 接口
parent
077d34a9
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
125 additions
and
9 deletions
+125
-9
EmergencyTaskController.java
...amos/fas/business/controller/EmergencyTaskController.java
+66
-4
EmergencyTaskMapper.java
...oin/amos/fas/business/dao/mapper/EmergencyTaskMapper.java
+2
-0
JcsFeign.java
...in/java/com/yeejoin/amos/fas/business/feign/JcsFeign.java
+6
-1
EmergencyTaskServiceImpl.java
...s/fas/business/service/impl/EmergencyTaskServiceImpl.java
+6
-0
IEmergencyTaskService.java
...mos/fas/business/service/intfc/IEmergencyTaskService.java
+2
-0
EmergencyRelationVo.java
...com/yeejoin/amos/fas/business/vo/EmergencyRelationVo.java
+16
-0
dbTemplate_emergency_task.xml
...rc/main/resources/db/mapper/dbTemplate_emergency_task.xml
+27
-4
No files found.
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/controller/EmergencyTaskController.java
View file @
68a6eb26
package
com
.
yeejoin
.
amos
.
fas
.
business
.
controller
;
package
com
.
yeejoin
.
amos
.
fas
.
business
.
controller
;
import
com.alibaba.fastjson.JSONObject
;
import
com.yeejoin.amos.fas.business.feign.JcsFeign
;
import
com.yeejoin.amos.fas.business.service.intfc.IDictService
;
import
com.yeejoin.amos.fas.business.service.intfc.IDictService
;
import
com.yeejoin.amos.fas.business.service.intfc.IEmergencyTaskService
;
import
com.yeejoin.amos.fas.business.service.intfc.IEmergencyTaskService
;
import
com.yeejoin.amos.fas.business.vo.EmergencyRelationVo
;
import
com.yeejoin.amos.fas.core.common.request.CommonPageable
;
import
com.yeejoin.amos.fas.core.common.request.CommonPageable
;
import
com.yeejoin.amos.fas.dao.entity.Dict
;
import
com.yeejoin.amos.fas.dao.entity.Dict
;
import
com.yeejoin.amos.fas.dao.entity.EmergencyRelation
;
import
com.yeejoin.amos.fas.dao.entity.EmergencyRelation
;
import
com.yeejoin.amos.fas.dao.entity.EmergencyRelationTree
;
import
com.yeejoin.amos.fas.dao.entity.EmergencyRelationTree
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.Page
;
import
com.yeejoin.amos.fas.core.util.CommonResponse
;
import
com.yeejoin.amos.fas.core.util.CommonResponse
;
import
com.yeejoin.amos.fas.core.util.CommonResponseUtil
;
import
com.yeejoin.amos.fas.core.util.CommonResponseUtil
;
...
@@ -15,6 +19,7 @@ import io.swagger.annotations.Api;
...
@@ -15,6 +19,7 @@ import io.swagger.annotations.Api;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
...
@@ -29,6 +34,8 @@ import java.util.stream.Collectors;
...
@@ -29,6 +34,8 @@ import java.util.stream.Collectors;
public
class
EmergencyTaskController
extends
BaseController
{
public
class
EmergencyTaskController
extends
BaseController
{
@Autowired
@Autowired
JcsFeign
jcsFeign
;
@Autowired
IEmergencyTaskService
iEmergencyTaskService
;
IEmergencyTaskService
iEmergencyTaskService
;
@Autowired
@Autowired
private
IDictService
dictService
;
private
IDictService
dictService
;
...
@@ -50,7 +57,13 @@ public class EmergencyTaskController extends BaseController{
...
@@ -50,7 +57,13 @@ public class EmergencyTaskController extends BaseController{
tree
.
setChildren
(
treeNodes
.
stream
().
filter
(
t
->
t
.
getObligationId
().
equals
(
e
.
getId
())).
collect
(
Collectors
.
toList
()));
tree
.
setChildren
(
treeNodes
.
stream
().
filter
(
t
->
t
.
getObligationId
().
equals
(
e
.
getId
())).
collect
(
Collectors
.
toList
()));
list
.
add
(
tree
);
list
.
add
(
tree
);
});
});
return
CommonResponseUtil
.
success
(
list
);
EmergencyRelationTree
tree
=
new
EmergencyRelationTree
();
tree
.
setId
(
0
);
tree
.
setName
(
"全部"
);
tree
.
setType
(
"3"
);
tree
.
setCode
(
"0"
);
tree
.
setChildren
(
list
);
return
CommonResponseUtil
.
success
(
tree
);
}
}
...
@@ -61,6 +74,9 @@ public class EmergencyTaskController extends BaseController{
...
@@ -61,6 +74,9 @@ public class EmergencyTaskController extends BaseController{
if
(
pageNumber
>=
1
){
if
(
pageNumber
>=
1
){
pageNumber
=
pageNumber
-
1
;
pageNumber
=
pageNumber
-
1
;
}
}
if
(
obligationId
==
0
){
obligationId
=
null
;
}
CommonPageable
commonPageable
=
new
CommonPageable
(
pageNumber
,
pageSize
);
CommonPageable
commonPageable
=
new
CommonPageable
(
pageNumber
,
pageSize
);
Page
<
EmergencyTaskContent
>
list
=
iEmergencyTaskService
.
list
(
obligationId
,
commonPageable
);
Page
<
EmergencyTaskContent
>
list
=
iEmergencyTaskService
.
list
(
obligationId
,
commonPageable
);
return
CommonResponseUtil
.
success
(
list
);
return
CommonResponseUtil
.
success
(
list
);
...
@@ -77,12 +93,58 @@ public class EmergencyTaskController extends BaseController{
...
@@ -77,12 +93,58 @@ public class EmergencyTaskController extends BaseController{
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增树人员节点"
,
notes
=
"新增树人员节点"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增树人员节点"
,
notes
=
"新增树人员节点"
)
@PostMapping
(
value
=
"/savePerson"
,
produces
=
"application/json;charset=UTF-8"
)
@PostMapping
(
value
=
"/savePerson"
,
produces
=
"application/json;charset=UTF-8"
)
public
CommonResponse
savePerson
(
@RequestBody
EmergencyRelation
emergencyRelation
){
public
CommonResponse
savePerson
(
@RequestBody
EmergencyRelationVo
vo
){
iEmergencyTaskService
.
save
(
emergencyRelation
);
List
<
Long
>
personIds
=
vo
.
getPersonIds
();
emergencyRelation
.
setCreateDate
(
new
Date
());
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
);
}
);
return
CommonResponseUtil
.
success
();
return
CommonResponseUtil
.
success
();
}
}
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"编辑树人员节点"
,
notes
=
"编辑树人员节点"
)
@PostMapping
(
value
=
"/editPerson"
,
produces
=
"application/json;charset=UTF-8"
)
public
CommonResponse
editPerson
(
@RequestBody
EmergencyRelationVo
vo
){
this
.
deleteTreeNode
(
vo
.
getObligationId
(),
null
);
List
<
Long
>
personIds
=
vo
.
getPersonIds
();
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
);
}
);
return
CommonResponseUtil
.
success
();
}
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"获取当前节点绑定人员"
,
notes
=
"获取当前节点绑定人员"
)
@RequestMapping
(
value
=
"/getPersons"
,
method
=
RequestMethod
.
GET
)
public
CommonResponse
getPersons
(
@RequestParam
Long
obligationId
){
EmergencyRelationVo
emergencyRelationVo
=
new
EmergencyRelationVo
();
emergencyRelationVo
.
setPersonIds
(
iEmergencyTaskService
.
getPersonIds
(
obligationId
));
return
CommonResponseUtil
.
success
(
emergencyRelationVo
);
}
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/dao/mapper/EmergencyTaskMapper.java
View file @
68a6eb26
...
@@ -18,4 +18,6 @@ public interface EmergencyTaskMapper extends BaseMapper {
...
@@ -18,4 +18,6 @@ public interface EmergencyTaskMapper extends BaseMapper {
List
<
String
>
roleCodes
(
String
amosOrgId
);
List
<
String
>
roleCodes
(
String
amosOrgId
);
List
<
Long
>
getPersonIds
(
Long
obligationId
);
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/feign/JcsFeign.java
View file @
68a6eb26
...
@@ -6,6 +6,8 @@ import com.yeejoin.amos.fas.core.util.ResponseModel;
...
@@ -6,6 +6,8 @@ import com.yeejoin.amos.fas.core.util.ResponseModel;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.List
;
/**
/**
* 消息推送
* 消息推送
...
@@ -34,5 +36,8 @@ public interface JcsFeign {
...
@@ -34,5 +36,8 @@ public interface JcsFeign {
*/
*/
@RequestMapping
(
value
=
"/jcs/common/duty-person/person/on_duty/list"
,
method
=
RequestMethod
.
GET
,
consumes
=
"application/json"
)
@RequestMapping
(
value
=
"/jcs/common/duty-person/person/on_duty/list"
,
method
=
RequestMethod
.
GET
,
consumes
=
"application/json"
)
ResponseModel
dutyPersonList
();
ResponseModel
dutyPersonList
();
@RequestMapping
(
value
=
"/jcs//org-person/listCompanyByIds"
,
method
=
RequestMethod
.
GET
,
consumes
=
"application/json"
)
List
<
Object
>
listCompanyByIds
(
@RequestParam
List
<
Long
>
ids
);
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/EmergencyTaskServiceImpl.java
View file @
68a6eb26
...
@@ -51,4 +51,10 @@ public class EmergencyTaskServiceImpl implements IEmergencyTaskService {
...
@@ -51,4 +51,10 @@ public class EmergencyTaskServiceImpl implements IEmergencyTaskService {
String
roleCodes
=
String
.
join
(
","
,
list
);
String
roleCodes
=
String
.
join
(
","
,
list
);
return
roleCodes
;
return
roleCodes
;
}
}
@Override
public
List
<
Long
>
getPersonIds
(
Long
obligationId
)
{
return
emergencyTaskMapper
.
getPersonIds
(
obligationId
);
}
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/intfc/IEmergencyTaskService.java
View file @
68a6eb26
...
@@ -21,4 +21,6 @@ public interface IEmergencyTaskService {
...
@@ -21,4 +21,6 @@ public interface IEmergencyTaskService {
String
getRolesByUserId
(
String
userId
);
String
getRolesByUserId
(
String
userId
);
List
<
Long
>
getPersonIds
(
Long
obligationId
);
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/vo/EmergencyRelationVo.java
0 → 100644
View file @
68a6eb26
package
com
.
yeejoin
.
amos
.
fas
.
business
.
vo
;
import
lombok.Data
;
import
java.util.List
;
@Data
public
class
EmergencyRelationVo
{
//职责id
private
Long
obligationId
;
//人员id
private
List
<
Long
>
personIds
;
}
YeeAmosFireAutoSysStart/src/main/resources/db/mapper/dbTemplate_emergency_task.xml
View file @
68a6eb26
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
FROM
FROM
c_emergency_task_content
c_emergency_task_content
<where>
<where>
<if
test=
"
_parameter
!= null "
>
<if
test=
"
obligationId
!= null "
>
obligation_id = #{obligationId}
obligation_id = #{obligationId}
</if>
</if>
</where>
</where>
...
@@ -57,16 +57,38 @@
...
@@ -57,16 +57,38 @@
cer.amos_id = #{amosOrgId}
cer.amos_id = #{amosOrgId}
</if>
</if>
</where>
</where>
</select>
<select
id=
"getPersonIds"
resultType=
"long"
>
SELECT
cer.person_id AS persons
FROM
c_emergency_relation cer
<where>
<if
test=
"_parameter != null "
>
cer.obligationId = #{obligationId}
</if>
</where>
</select>
</select>
<delete
id=
"deleteTreeNode"
>
<delete
id=
"deleteTreeNode"
>
delete from c_emergency_relation
where obligationId = #{obligationId} and person_id = #{personId}
delete from c_emergency_relation
cer
<where>
<if
test=
"obligationId != null "
>
cer.obligationId = #{obligationId}
</if>
<if
test=
"personId != null "
>
and cer.person_id = #{personId}
</if>
</where>
</delete>
</delete>
<insert
id=
"save"
parameterType=
"com.yeejoin.amos.fas.dao.entity.EmergencyRelation"
>
<insert
id=
"save"
parameterType=
"com.yeejoin.amos.fas.dao.entity.EmergencyRelation"
>
INSERT INTO `c_emergency_relation`(id, `obligationId`, `person_id`, `amos_id`, `person_name`)
INSERT INTO `c_emergency_relation`(id, `obligationId`, `person_id`, `amos_id`, `person_name`
, `create_date`
)
VALUES (#{id}, #{obligationId}, #{personId}, #{amosOrgId}, #{personName});
VALUES (#{id}, #{obligationId}, #{personId}, #{amosOrgId}, #{personName}
,#{createDate}
);
</insert>
</insert>
</mapper>
</mapper>
\ 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