Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
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
项目统一框架
amos-boot-biz
Commits
d16cb86a
Commit
d16cb86a
authored
Aug 09, 2021
by
kongfm
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
接口测试修正
parent
c7af4615
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
194 additions
and
58 deletions
+194
-58
RescueProcessDto.java
...eejoin/amos/boot/module/tzs/api/dto/RescueProcessDto.java
+3
-0
IRescueProcessService.java
...os/boot/module/tzs/api/service/IRescueProcessService.java
+17
-0
AlertCalledController.java
...boot/module/tzs/biz/controller/AlertCalledController.java
+1
-0
RescueProcessController.java
...ot/module/tzs/biz/controller/RescueProcessController.java
+32
-44
AlertCalledServiceImpl.java
...t/module/tzs/biz/service/impl/AlertCalledServiceImpl.java
+9
-1
DispatchTaskServiceImpl.java
.../module/tzs/biz/service/impl/DispatchTaskServiceImpl.java
+19
-10
RescueProcessServiceImpl.java
...module/tzs/biz/service/impl/RescueProcessServiceImpl.java
+113
-3
No files found.
amos-boot-module/amos-boot-module-api/amos-boot-module-tzs-api/src/main/java/com/yeejoin/amos/boot/module/tzs/api/dto/RescueProcessDto.java
View file @
d16cb86a
...
@@ -27,6 +27,9 @@ public class RescueProcessDto extends BaseDto {
...
@@ -27,6 +27,9 @@ public class RescueProcessDto extends BaseDto {
@ApiModelProperty
(
value
=
"是否派遣"
)
@ApiModelProperty
(
value
=
"是否派遣"
)
private
Boolean
dispatchStatus
;
private
Boolean
dispatchStatus
;
@ApiModelProperty
(
value
=
"是否手动派遣"
)
private
Boolean
dispatchByUser
=
false
;
@ApiModelProperty
(
value
=
"派遣时间"
)
@ApiModelProperty
(
value
=
"派遣时间"
)
private
Date
dispatchTime
;
private
Date
dispatchTime
;
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-tzs-api/src/main/java/com/yeejoin/amos/boot/module/tzs/api/service/IRescueProcessService.java
View file @
d16cb86a
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tzs
.
api
.
service
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tzs
.
api
.
service
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.RescueProcessDto
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
/**
/**
* 救援过程表接口类
* 救援过程表接口类
*
*
...
@@ -9,4 +12,18 @@ package com.yeejoin.amos.boot.module.tzs.api.service;
...
@@ -9,4 +12,18 @@ package com.yeejoin.amos.boot.module.tzs.api.service;
*/
*/
public
interface
IRescueProcessService
{
public
interface
IRescueProcessService
{
/**
* 根据警情id 创建救援过程表 或者获取 救援过程表
* @param alertId
* @return
*/
RescueProcessDto
getProcessByAlertId
(
Long
alertId
);
/**
* 根据警情id 更新救援过程表
* @param rescueProcessDto
* @return
*/
Boolean
updateByAlertId
(
RescueProcessDto
rescueProcessDto
,
AgencyUserModel
sendUser
);
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/biz/controller/AlertCalledController.java
View file @
d16cb86a
...
@@ -94,6 +94,7 @@ public class AlertCalledController extends BaseController {
...
@@ -94,6 +94,7 @@ public class AlertCalledController extends BaseController {
// AlertCalled alertCalled = alertCalledObjsDto.getAlertCalled();
// AlertCalled alertCalled = alertCalledObjsDto.getAlertCalled();
// alertCalled.setOrgCode(String.valueOf(code));
// alertCalled.setOrgCode(String.valueOf(code));
// alertCalledObjsDto.setAlertCalled(alertCalled);
// alertCalledObjsDto.setAlertCalled(alertCalled);
alertCalledObjsDto
=
iAlertCalledService
.
createAlertCalled
(
alertCalledObjsDto
);
alertCalledObjsDto
=
iAlertCalledService
.
createAlertCalled
(
alertCalledObjsDto
);
return
ResponseHelper
.
buildResponse
(
alertCalledObjsDto
.
getAlertCalledDto
());
return
ResponseHelper
.
buildResponse
(
alertCalledObjsDto
.
getAlertCalledDto
());
}
}
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/biz/controller/RescueProcessController.java
View file @
d16cb86a
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tzs
.
biz
.
controller
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tzs
.
biz
.
controller
;
import
com.alibaba.fastjson.JSONObject
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
com.yeejoin.amos.boot.module.tzs.api.entity.RescueStation
;
import
com.yeejoin.amos.boot.module.tzs.biz.utils.BeanDtoVoUtils
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
import
com.yeejoin.amos.boot.module.tzs.biz.service.impl.RescueProcessServiceImpl
;
import
com.yeejoin.amos.boot.module.tzs.biz.service.impl.RescueProcessServiceImpl
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -31,57 +39,37 @@ public class RescueProcessController extends BaseController {
...
@@ -31,57 +39,37 @@ public class RescueProcessController extends BaseController {
@Autowired
@Autowired
RescueProcessServiceImpl
rescueProcessServiceImpl
;
RescueProcessServiceImpl
rescueProcessServiceImpl
;
/**
* 新增救援过程表
@Autowired
*
RedisUtils
redisUtils
;
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PostMapping
(
value
=
"/save"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增救援过程表"
,
notes
=
"新增救援过程表"
)
public
ResponseModel
<
RescueProcessDto
>
save
(
@RequestBody
RescueProcessDto
model
)
{
model
=
rescueProcessServiceImpl
.
createWithModel
(
model
);
return
ResponseHelper
.
buildResponse
(
model
);
}
/**
/**
* 根据sequenceNbr更新
* 根据警情id 更新救援信息表
*
* @param model
* @param sequenceNbr 主键
* @return
* @return
*/
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PutMapping
(
value
=
"/{sequenceNbr}"
)
@PostMapping
(
value
=
"/updateByAlertId"
)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"根据sequenceNbr更新救援过程表"
,
notes
=
"根据sequenceNbr更新救援过程表"
)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"根据警情id 更新救援信息表"
,
notes
=
"根据警情id 更新救援信息表"
)
public
ResponseModel
<
RescueProcessDto
>
updateBySequenceNbrRescueProcess
(
@RequestBody
RescueProcessDto
model
,
@PathVariable
(
value
=
"sequenceNbr"
)
Long
sequenceNbr
)
{
public
ResponseModel
<
Boolean
>
save
(
@RequestBody
RescueProcessDto
model
)
{
model
.
setSequenceNbr
(
sequenceNbr
);
ReginParams
reginParams
=
return
ResponseHelper
.
buildResponse
(
rescueProcessServiceImpl
.
updateWithModel
(
model
));
JSONObject
.
parseObject
(
null
!=
redisUtils
.
get
(
buildKey
(
getToken
()))
?
redisUtils
.
get
(
buildKey
(
getToken
())).
toString
()
:
null
,
ReginParams
.
class
);
boolean
update
=
rescueProcessServiceImpl
.
updateByAlertId
(
model
,
reginParams
.
getUserModel
());
return
ResponseHelper
.
buildResponse
(
update
);
}
}
/**
* 根据sequenceNbr删除
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@DeleteMapping
(
value
=
"/{sequenceNbr}"
)
@ApiOperation
(
httpMethod
=
"DELETE"
,
value
=
"根据sequenceNbr删除救援过程表"
,
notes
=
"根据sequenceNbr删除救援过程表"
)
public
ResponseModel
<
Boolean
>
deleteBySequenceNbr
(
HttpServletRequest
request
,
@PathVariable
(
value
=
"sequenceNbr"
)
Long
sequenceNbr
){
return
ResponseHelper
.
buildResponse
(
rescueProcessServiceImpl
.
removeById
(
sequenceNbr
));
}
/**
/**
* 根据sequenceNbr查询
* 根据警情id 获取救援过程表
*
* @param alertId
* @param sequenceNbr 主键
* @return
* @return
*/
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/
{sequenceNbr
}"
)
@GetMapping
(
value
=
"/
alert/{alertId
}"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据
sequenceNbr查询单个救援过程表"
,
notes
=
"根据sequenceNbr查询单个
救援过程表"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据
警情id 获取救援过程表"
,
notes
=
"根据警情id 获取
救援过程表"
)
public
ResponseModel
<
RescueProcessDto
>
selectOne
(
@PathVariable
Long
sequenceNbr
)
{
public
ResponseModel
<
RescueProcessDto
>
selectOne
(
@PathVariable
Long
alertId
)
{
return
ResponseHelper
.
buildResponse
(
rescueProcessServiceImpl
.
queryBySeq
(
sequenceNbr
));
return
ResponseHelper
.
buildResponse
(
rescueProcessServiceImpl
.
getProcessByAlertId
(
alertId
));
}
}
/**
/**
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/biz/service/impl/AlertCalledServiceImpl.java
View file @
d16cb86a
...
@@ -68,6 +68,9 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
...
@@ -68,6 +68,9 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
@Autowired
@Autowired
AlertCalledMapper
alertCalledMapper
;
AlertCalledMapper
alertCalledMapper
;
@Autowired
RescueProcessServiceImpl
rescueProcessServiceImpl
;
private
final
Logger
logger
=
LogManager
.
getLogger
(
AlertCalledServiceImpl
.
class
);
private
final
Logger
logger
=
LogManager
.
getLogger
(
AlertCalledServiceImpl
.
class
);
...
@@ -134,7 +137,7 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
...
@@ -134,7 +137,7 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
alertCalled
.
setCallTime
(
new
Date
());
alertCalled
.
setCallTime
(
new
Date
());
// 判断是否归并警情
// 判断是否归并警情
if
(
alertCalled
.
getFatherAlert
()
!
=
null
)
{
if
(
alertCalled
.
getFatherAlert
()
=
=
null
)
{
// 警情归并,设置当前警情状态为结束。
// 警情归并,设置当前警情状态为结束。
alertCalled
.
setAlertStatus
(
true
);
alertCalled
.
setAlertStatus
(
true
);
alertCalled
.
setAlertStage
(
AlertStageEnums
.
JJ
.
getValue
());
alertCalled
.
setAlertStage
(
AlertStageEnums
.
JJ
.
getValue
());
...
@@ -185,6 +188,11 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
...
@@ -185,6 +188,11 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
alertFormValue
.
setAlertTypeCode
(
AlertStageEnums
.
KRJY
.
getCode
());
alertFormValue
.
setAlertTypeCode
(
AlertStageEnums
.
KRJY
.
getCode
());
}
}
});
});
if
(
AlertStageEnums
.
KRJY
.
toString
().
equals
(
alertCalled
.
getAlarmTypeCode
())
)
{
//困人救援创建警情时创建救援过程信息
rescueProcessServiceImpl
.
getProcessByAlertId
(
alertCalled
.
getSequenceNbr
());
}
// 保存动态表单数据
// 保存动态表单数据
iAlertFormValueService
.
saveBatch
(
alertFormValuelist
);
iAlertFormValueService
.
saveBatch
(
alertFormValuelist
);
alertCalledObjsDto
.
setAlertCalledDto
(
BeanDtoVoUtils
.
convert
(
alertCalled
,
AlertCalledDto
.
class
));
alertCalledObjsDto
.
setAlertCalledDto
(
BeanDtoVoUtils
.
convert
(
alertCalled
,
AlertCalledDto
.
class
));
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/biz/service/impl/DispatchTaskServiceImpl.java
View file @
d16cb86a
...
@@ -13,6 +13,7 @@ import com.yeejoin.amos.boot.module.tzs.api.entity.MaintenanceUnit;
...
@@ -13,6 +13,7 @@ import com.yeejoin.amos.boot.module.tzs.api.entity.MaintenanceUnit;
import
com.yeejoin.amos.boot.module.tzs.api.entity.RescueStation
;
import
com.yeejoin.amos.boot.module.tzs.api.entity.RescueStation
;
import
com.yeejoin.amos.boot.module.tzs.api.entity.Template
;
import
com.yeejoin.amos.boot.module.tzs.api.entity.Template
;
import
com.yeejoin.amos.boot.module.tzs.api.entity.UseUnit
;
import
com.yeejoin.amos.boot.module.tzs.api.entity.UseUnit
;
import
com.yeejoin.amos.boot.module.tzs.api.enums.AlertStageEnums
;
import
com.yeejoin.amos.boot.module.tzs.api.mapper.DispatchTaskMapper
;
import
com.yeejoin.amos.boot.module.tzs.api.mapper.DispatchTaskMapper
;
import
com.yeejoin.amos.boot.module.tzs.api.service.IDispatchTaskService
;
import
com.yeejoin.amos.boot.module.tzs.api.service.IDispatchTaskService
;
import
com.yeejoin.amos.boot.module.tzs.api.service.IMaintenanceUnitService
;
import
com.yeejoin.amos.boot.module.tzs.api.service.IMaintenanceUnitService
;
...
@@ -166,6 +167,7 @@ public class DispatchTaskServiceImpl extends BaseService<DispatchTaskDto,Dispatc
...
@@ -166,6 +167,7 @@ public class DispatchTaskServiceImpl extends BaseService<DispatchTaskDto,Dispatc
AlertCalledDto
alertCalledDto
=
alertCalledServiceImpl
.
queryBySeq
(
alertId
);
AlertCalledDto
alertCalledDto
=
alertCalledServiceImpl
.
queryBySeq
(
alertId
);
dispatchTaskDto
.
setOrgTypeCode
(
orgTypeCode
);
dispatchTaskDto
.
setOrgTypeCode
(
orgTypeCode
);
dispatchTaskDto
.
setAlertId
(
alertId
);
dispatchTaskDto
.
setAlertId
(
alertId
);
dispatchTaskDto
.
setAlertCode
(
alertCalledDto
.
getAlarmTypeCode
());
// 获取模板 拼接json
// 获取模板 拼接json
QueryWrapper
<
Template
>
templateQueryWrapper
=
new
QueryWrapper
<>();
QueryWrapper
<
Template
>
templateQueryWrapper
=
new
QueryWrapper
<>();
String
alertTypeCode
=
alertCalledDto
.
getAlarmTypeCode
();
String
alertTypeCode
=
alertCalledDto
.
getAlarmTypeCode
();
...
@@ -185,17 +187,24 @@ public class DispatchTaskServiceImpl extends BaseService<DispatchTaskDto,Dispatc
...
@@ -185,17 +187,24 @@ public class DispatchTaskServiceImpl extends BaseService<DispatchTaskDto,Dispatc
String
address
=
elevator
.
getAddress
();
String
address
=
elevator
.
getAddress
();
String
useSiteCategory
=
elevator
.
getUseSiteCategory
();
String
useSiteCategory
=
elevator
.
getUseSiteCategory
();
String
useUnit
=
elevator
.
getUseUnit
();
String
useUnit
=
elevator
.
getUseUnit
();
content
.
replace
(
"$call_time"
,
createTime
).
replace
(
"$address"
,
address
).
replace
(
"$rescue_code"
,
rescueCode
).
replace
(
"$use_site_category"
,
useSiteCategory
);
content
=
content
.
replace
(
"$call_time"
,
createTime
).
replace
(
"$address"
,
address
).
replace
(
"$rescue_code"
,
rescueCode
).
replace
(
"$use_site_category"
,
useSiteCategory
);
String
typeCode
=
""
;
if
(
AlertStageEnums
.
KRJY
.
toString
().
equals
(
alertTypeCode
))
{
typeCode
=
AlertStageEnums
.
KRJY
.
getCode
();
}
else
if
(
AlertStageEnums
.
GZWX
.
toString
().
equals
(
alertTypeCode
))
{
typeCode
=
AlertStageEnums
.
GZWX
.
getCode
();
}
else
if
(
AlertStageEnums
.
TSZX
.
toString
().
equals
(
alertTypeCode
))
{
typeCode
=
AlertStageEnums
.
TSZX
.
getCode
();
}
// 警情信息动态数据
// 警情信息动态数据
QueryWrapper
<
AlertFormValue
>
queryWrapper
=
new
QueryWrapper
<>();
QueryWrapper
<
AlertFormValue
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
eq
(
"alert_called_id"
,
alertId
).
eq
(
"alert_type_code"
,
alertT
ypeCode
);
queryWrapper
.
eq
(
"alert_called_id"
,
alertId
).
eq
(
"alert_type_code"
,
t
ypeCode
);
// 派遣单动态表单数据
// 派遣单动态表单数据
List
<
AlertFormValue
>
list
=
iAlertFormValueService
.
list
(
queryWrapper
);
List
<
AlertFormValue
>
list
=
iAlertFormValueService
.
list
(
queryWrapper
);
// map 存取数据
// map 存取数据
Map
<
String
,
String
>
dynamicParms
=
new
HashMap
<
String
,
String
>
();
Map
<
String
,
String
>
dynamicParms
=
new
HashMap
<
String
,
String
>
();
list
.
stream
().
forEach
(
paperFormValue
->
{
list
.
stream
().
forEach
(
paperFormValue
->
{
dynamicParms
.
put
(
"field_code"
,
"field_value"
);
dynamicParms
.
put
(
paperFormValue
.
getFieldCode
(),
paperFormValue
.
getFieldValue
()
);
});
});
String
desc
=
""
;
String
desc
=
""
;
switch
(
alertTypeCode
)
{
switch
(
alertTypeCode
)
{
...
@@ -204,18 +213,18 @@ public class DispatchTaskServiceImpl extends BaseService<DispatchTaskDto,Dispatc
...
@@ -204,18 +213,18 @@ public class DispatchTaskServiceImpl extends BaseService<DispatchTaskDto,Dispatc
String
trappedFloorNum
=
dynamicParms
.
get
(
"trapped_floor_num"
);
String
trappedFloorNum
=
dynamicParms
.
get
(
"trapped_floor_num"
);
String
isLight
=
dynamicParms
.
get
(
"is_light"
);
String
isLight
=
dynamicParms
.
get
(
"is_light"
);
String
trappedTime
=
dynamicParms
.
get
(
"trapped_time"
);
String
trappedTime
=
dynamicParms
.
get
(
"trapped_time"
);
content
.
replace
(
"$trapped_num"
,
trappedNum
).
replace
(
"$trapped_floor_num"
,
trappedFloorNum
);
content
=
content
.
replace
(
"$trapped_num"
,
trappedNum
).
replace
(
"$trapped_floor_num"
,
trappedFloorNum
);
content
.
replace
(
"$emergency_call"
,
emergencyCall
).
replace
(
"$contact_phone"
,
contactPhone
);
content
=
content
.
replace
(
"$emergency_call"
,
emergencyCall
).
replace
(
"$contact_phone"
,
contactPhone
);
content
.
replace
(
"$is_light"
,
isLight
).
replace
(
"$trapped_time"
,
trappedTime
);
content
=
content
.
replace
(
"$is_light"
,
isLight
).
replace
(
"$trapped_time"
,
trappedTime
);
break
;
break
;
case
"GZWX"
:
// 故障维修
case
"GZWX"
:
// 故障维修
desc
=
dynamicParms
.
get
(
"desc"
);
desc
=
dynamicParms
.
get
(
"desc"
);
content
.
replace
(
"$use_unit"
,
useUnit
).
replace
(
"$desc"
,
desc
);
content
=
content
.
replace
(
"$use_unit"
,
useUnit
).
replace
(
"$desc"
,
desc
);
break
;
break
;
case
"TSZX"
:
// 投诉咨询
case
"TSZX"
:
// 投诉咨询
desc
=
dynamicParms
.
get
(
"desc"
);
desc
=
dynamicParms
.
get
(
"desc"
);
content
.
replace
(
"$emergency_call"
,
emergencyCall
).
replace
(
"$contact_phone"
,
contactPhone
);
content
=
content
.
replace
(
"$emergency_call"
,
emergencyCall
).
replace
(
"$contact_phone"
,
contactPhone
);
content
.
replace
(
"$use_unit"
,
useUnit
).
replace
(
"$desc"
,
desc
);
content
=
content
.
replace
(
"$use_unit"
,
useUnit
).
replace
(
"$desc"
,
desc
);
break
;
break
;
}
}
dispatchTaskDto
.
setDispatchContext
(
content
);
dispatchTaskDto
.
setDispatchContext
(
content
);
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/biz/service/impl/RescueProcessServiceImpl.java
View file @
d16cb86a
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tzs
.
biz
.
service
.
impl
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tzs
.
biz
.
service
.
impl
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.biz.common.entity.DataDictionary
;
import
com.yeejoin.amos.boot.biz.common.service.impl.DataDictionaryServiceImpl
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.DispatchPaperFormDto
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.DispatchTaskDto
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.RescueProcessDto
;
import
com.yeejoin.amos.boot.module.tzs.api.entity.AlertFormValue
;
import
com.yeejoin.amos.boot.module.tzs.api.entity.DispatchPaper
;
import
com.yeejoin.amos.boot.module.tzs.api.entity.DispatchTask
;
import
com.yeejoin.amos.boot.module.tzs.api.entity.MaintenanceUnit
;
import
com.yeejoin.amos.boot.module.tzs.api.entity.RescueProcess
;
import
com.yeejoin.amos.boot.module.tzs.api.entity.RescueProcess
;
import
com.yeejoin.amos.boot.module.tzs.api.entity.RescueStation
;
import
com.yeejoin.amos.boot.module.tzs.api.entity.UseUnit
;
import
com.yeejoin.amos.boot.module.tzs.api.enums.DispatchPaperEnums
;
import
com.yeejoin.amos.boot.module.tzs.api.mapper.RescueProcessMapper
;
import
com.yeejoin.amos.boot.module.tzs.api.mapper.RescueProcessMapper
;
import
com.yeejoin.amos.boot.module.tzs.api.service.IRescueProcessService
;
import
com.yeejoin.amos.boot.module.tzs.api.service.IRescueProcessService
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.RescueProcessDto
;
import
com.yeejoin.amos.boot.module.tzs.biz.utils.BeanDtoVoUtils
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
org.typroject.tyboot.core.foundation.utils.Bean
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
/**
/**
...
@@ -17,6 +38,20 @@ import java.util.List;
...
@@ -17,6 +38,20 @@ import java.util.List;
*/
*/
@Service
@Service
public
class
RescueProcessServiceImpl
extends
BaseService
<
RescueProcessDto
,
RescueProcess
,
RescueProcessMapper
>
implements
IRescueProcessService
{
public
class
RescueProcessServiceImpl
extends
BaseService
<
RescueProcessDto
,
RescueProcess
,
RescueProcessMapper
>
implements
IRescueProcessService
{
@Autowired
DispatchPaperServiceImpl
dispatchPaperServiceImpl
;
@Autowired
private
DataDictionaryServiceImpl
iDataDictionaryService
;
@Autowired
DispatchTaskServiceImpl
dispatchTaskServiceImpl
;
@Autowired
private
AlertFormValueServiceImpl
iAlertFormValueService
;
/**
/**
* 分页查询
* 分页查询
*/
*/
...
@@ -30,4 +65,78 @@ public class RescueProcessServiceImpl extends BaseService<RescueProcessDto,Rescu
...
@@ -30,4 +65,78 @@ public class RescueProcessServiceImpl extends BaseService<RescueProcessDto,Rescu
public
List
<
RescueProcessDto
>
queryForRescueProcessList
()
{
public
List
<
RescueProcessDto
>
queryForRescueProcessList
()
{
return
this
.
queryForList
(
""
,
false
);
return
this
.
queryForList
(
""
,
false
);
}
}
@Override
public
RescueProcessDto
getProcessByAlertId
(
Long
alertId
)
{
// 先通过id 查找过程表
RescueProcessDto
rescueProcessDto
=
new
RescueProcessDto
();
QueryWrapper
<
RescueProcess
>
templateQueryWrapper
=
new
QueryWrapper
<>();
templateQueryWrapper
.
eq
(
"alert_id"
,
alertId
);
RescueProcess
rescueProcess
=
this
.
getOne
(
templateQueryWrapper
);
if
(
rescueProcess
!=
null
)
{
return
Bean
.
toModel
(
rescueProcess
,
rescueProcessDto
);
}
else
{
rescueProcess
=
new
RescueProcess
();
rescueProcess
.
setAlertId
(
alertId
);
this
.
save
(
rescueProcess
);
return
Bean
.
toModel
(
rescueProcess
,
rescueProcessDto
);
}
}
@Override
public
Boolean
updateByAlertId
(
RescueProcessDto
rescueProcessDto
,
AgencyUserModel
sendUser
)
{
QueryWrapper
<
RescueProcess
>
templateQueryWrapper
=
new
QueryWrapper
<>();
templateQueryWrapper
.
eq
(
"alert_id"
,
rescueProcessDto
.
getAlertId
());
RescueProcess
rescueProcess
=
this
.
getOne
(
templateQueryWrapper
);
if
(
rescueProcess
!=
null
)
throw
new
BadRequest
(
"救援过程信息未找到"
);
if
(
rescueProcessDto
.
getDispatchByUser
())
{
// 手动更新了派遣信息为三级派遣
// 判断是否存在派遣单 不存在先创建派遣单
DispatchPaperFormDto
dispatchPaperDto
=
dispatchPaperServiceImpl
.
selectDispatchPaperDtoByAlertId
(
rescueProcessDto
.
getAlertId
());
if
(
dispatchPaperDto
==
null
||
dispatchPaperDto
.
getDispatchPaper
()
==
null
)
{
QueryWrapper
<
DataDictionary
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
eq
(
"type"
,
"JQLX"
).
eq
(
"name"
,
"困人救援"
);
DataDictionary
alertCode
=
iDataDictionaryService
.
getOne
(
queryWrapper
);
dispatchPaperDto
=
dispatchPaperServiceImpl
.
createDispatchPaper
(
rescueProcessDto
.
getAlertId
(),
alertCode
.
getCode
(),
sendUser
);
}
DispatchPaper
dispatchPaper
=
dispatchPaperDto
.
getDispatchPaper
();
List
<
AlertFormValue
>
dynamicFormAlert
=
dispatchPaperDto
.
getDynamicFormAlert
();
// 创建派遣单
DispatchTaskDto
dispatchTaskDto
=
new
DispatchTaskDto
();
dispatchTaskDto
.
setDispatchTime
(
rescueProcessDto
.
getDispatchTime
());
dispatchTaskDto
.
setOrgTypeCode
(
DispatchPaperEnums
.
getEnum
(
"levelThreeUnit"
).
getCode
());
dispatchTaskDto
.
setAlertId
(
rescueProcessDto
.
getAlertId
());
dispatchTaskDto
.
setResponseOrgName
(
"119"
);
dispatchTaskDto
.
setResponseUserName
(
"119"
);
DispatchTask
dispatchTask
=
BeanDtoVoUtils
.
convert
(
dispatchTaskDto
,
DispatchTask
.
class
);
dispatchTask
.
setPaperId
(
dispatchPaperDto
.
getSequenceNbr
());
Boolean
flag
=
dispatchTaskServiceImpl
.
save
(
dispatchTask
);
if
(
flag
)
{
// 创建好派遣任务单以后根据任务单类型修改派遣单信息
if
(
dispatchPaper
.
getRepairOrgId
()
!=
null
)
{
// 已经派遣过调派
throw
new
BadRequest
(
"已经派遣过其他力量调派"
);
}
else
{
dispatchPaper
.
setRepairOrgId
(-
1
l
);
dispatchPaper
.
setRepairOrgCreditCode
(
"119"
);
dispatchPaper
.
setRepairOrgTaskId
(
dispatchTask
.
getSequenceNbr
());
// 修改动态字段
dynamicFormAlert
.
stream
().
forEach
(
alertFormValue
->
{
if
(
alertFormValue
.
getFieldCode
().
equals
(
"dispatch_status"
))
{
alertFormValue
.
setFieldValue
(
"已派遣"
);
alertFormValue
.
setFieldValueCode
(
"hasDispatched"
);
}
else
if
(
alertFormValue
.
getFieldCode
().
equals
(
"response_level"
))
{
alertFormValue
.
setFieldValue
(
"三级响应"
);
alertFormValue
.
setFieldValueCode
(
"levelThreeUnit"
);
}
});
}
// 保存派遣单
dispatchPaperServiceImpl
.
save
(
dispatchPaper
);
// 保存动态表单数据
iAlertFormValueService
.
saveBatch
(
dynamicFormAlert
);
}
}
rescueProcess
=
BeanDtoVoUtils
.
convert
(
rescueProcessDto
,
RescueProcess
.
class
);
return
this
.
updateById
(
rescueProcess
);
}
}
}
\ 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