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
cce69247
Commit
cce69247
authored
Sep 24, 2021
by
kongfm
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
反馈保存接口
parent
7666d4d0
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
222 additions
and
1 deletion
+222
-1
WechatDispatchFeedbackDto.java
...os/boot/module/tzs/api/dto/WechatDispatchFeedbackDto.java
+36
-0
IDispatchTaskService.java
...mos/boot/module/tzs/api/service/IDispatchTaskService.java
+3
-0
DispatchTaskMapper.xml
...-tzs-api/src/main/resources/mapper/DispatchTaskMapper.xml
+1
-1
DispatchTaskController.java
...oot/module/tzs/biz/controller/DispatchTaskController.java
+14
-0
DispatchTaskServiceImpl.java
.../module/tzs/biz/service/impl/DispatchTaskServiceImpl.java
+168
-0
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/WechatDispatchFeedbackDto.java
0 → 100644
View file @
cce69247
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tzs
.
api
.
dto
;
import
com.yeejoin.amos.boot.module.common.api.dto.AttachmentDto
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.util.List
;
/**
* 微信公众号维修反馈dto 类
*/
@Data
@ApiModel
(
value
=
"DispatchSaveFeedbackDto"
,
description
=
"救援回访DTO"
)
public
class
WechatDispatchFeedbackDto
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
"任务id"
)
private
Long
taskId
;
@ApiModelProperty
(
value
=
"维修结果"
)
private
String
fixResult
;
@ApiModelProperty
(
value
=
"电梯故障原因分类"
)
private
String
errorResult
;
@ApiModelProperty
(
value
=
"备注"
)
private
String
remark
;
@ApiModelProperty
(
value
=
"现场照片"
)
private
List
<
AttachmentDto
>
imgs
;
}
amos-boot-module/amos-boot-module-api/amos-boot-module-tzs-api/src/main/java/com/yeejoin/amos/boot/module/tzs/api/service/IDispatchTaskService.java
View file @
cce69247
...
@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.tzs.api.service;
...
@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.tzs.api.service;
import
com.yeejoin.amos.boot.module.tzs.api.dto.DispatchTaskDto
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.DispatchTaskDto
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.WechatDispatchFeedbackDto
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.WechatMyTaskDto
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.WechatMyTaskDto
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.WechatMyTaskListDto
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.WechatMyTaskListDto
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
...
@@ -31,4 +32,6 @@ public interface IDispatchTaskService {
...
@@ -31,4 +32,6 @@ public interface IDispatchTaskService {
Boolean
saveFinish
(
Long
taskId
);
Boolean
saveFinish
(
Long
taskId
);
List
<
WechatMyTaskListDto
>
getTaskListByPhonePager
(
String
phone
,
String
typeCode
,
Long
current
);
List
<
WechatMyTaskListDto
>
getTaskListByPhonePager
(
String
phone
,
String
typeCode
,
Long
current
);
WechatMyTaskDto
saveWechatFeedBack
(
WechatDispatchFeedbackDto
wechatDispatchFeedbackDto
);
}
}
amos-boot-module/amos-boot-module-api/amos-boot-module-tzs-api/src/main/resources/mapper/DispatchTaskMapper.xml
View file @
cce69247
...
@@ -36,7 +36,7 @@
...
@@ -36,7 +36,7 @@
<select
id=
"getTaskInfoByTaskId"
resultType=
"com.yeejoin.amos.boot.module.tzs.api.dto.WechatMyTaskDto"
>
<select
id=
"getTaskInfoByTaskId"
resultType=
"com.yeejoin.amos.boot.module.tzs.api.dto.WechatMyTaskDto"
>
select
select
t.sequence_nbr
t.sequence_nbr
,
t.alert_id as alertId,
t.alert_id as alertId,
p.sequence_nbr as paperId,
p.sequence_nbr as paperId,
a.alert_stage as taskStatus,
a.alert_stage as taskStatus,
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/biz/controller/DispatchTaskController.java
View file @
cce69247
...
@@ -3,6 +3,8 @@ package com.yeejoin.amos.boot.module.tzs.biz.controller;
...
@@ -3,6 +3,8 @@ package com.yeejoin.amos.boot.module.tzs.biz.controller;
import
java.util.List
;
import
java.util.List
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.WechatDispatchFeedbackDto
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.WechatMyTaskDto
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.PathVariable
;
...
@@ -84,4 +86,16 @@ public class DispatchTaskController extends BaseController {
...
@@ -84,4 +86,16 @@ public class DispatchTaskController extends BaseController {
List
<
DispatchTask
>
list
=
dispatchTaskServiceImpl
.
list
(
queryWrapper
);
List
<
DispatchTask
>
list
=
dispatchTaskServiceImpl
.
list
(
queryWrapper
);
return
ResponseHelper
.
buildResponse
(
list
);
return
ResponseHelper
.
buildResponse
(
list
);
}
}
/**
* 微信公众号维修反馈接口
*
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PostMapping
(
value
=
"/saveWechatFeed"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"微信公众号维修反馈接口"
,
notes
=
"微信公众号维修反馈接口"
)
public
ResponseModel
<
WechatMyTaskDto
>
saveWechatFeedBack
(
@RequestBody
WechatDispatchFeedbackDto
model
)
{
return
ResponseHelper
.
buildResponse
(
dispatchTaskServiceImpl
.
saveWechatFeedBack
(
model
));
}
}
}
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 @
cce69247
...
@@ -4,11 +4,16 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
...
@@ -4,11 +4,16 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
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.biz.common.utils.DateUtils
;
import
com.yeejoin.amos.boot.biz.common.utils.DateUtils
;
import
com.yeejoin.amos.boot.module.common.api.dto.AttachmentDto
;
import
com.yeejoin.amos.boot.module.common.api.service.ISourceFileService
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledDto
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledDto
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.DispatchPaperFormDto
;
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.DispatchTaskDto
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.RescueProcessDto
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.RescueProcessDto
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.WechatDispatchFeedbackDto
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.WechatMyTaskDto
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.WechatMyTaskDto
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.WechatMyTaskListDto
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.WechatMyTaskListDto
;
import
com.yeejoin.amos.boot.module.tzs.api.entity.AlertCalled
;
import
com.yeejoin.amos.boot.module.tzs.api.entity.AlertCalled
;
...
@@ -31,11 +36,13 @@ import com.yeejoin.amos.boot.module.tzs.api.service.IRescueStationService;
...
@@ -31,11 +36,13 @@ import com.yeejoin.amos.boot.module.tzs.api.service.IRescueStationService;
import
com.yeejoin.amos.boot.module.tzs.api.service.IUseUnitService
;
import
com.yeejoin.amos.boot.module.tzs.api.service.IUseUnitService
;
import
com.yeejoin.amos.boot.module.tzs.biz.utils.BeanDtoVoUtils
;
import
com.yeejoin.amos.boot.module.tzs.biz.utils.BeanDtoVoUtils
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
java.text.SimpleDateFormat
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
java.util.Date
;
...
@@ -82,6 +89,13 @@ public class DispatchTaskServiceImpl extends BaseService<DispatchTaskDto,Dispatc
...
@@ -82,6 +89,13 @@ public class DispatchTaskServiceImpl extends BaseService<DispatchTaskDto,Dispatc
@Autowired
@Autowired
RescueProcessServiceImpl
rescueProcessServiceImpl
;
RescueProcessServiceImpl
rescueProcessServiceImpl
;
@Autowired
private
DataDictionaryServiceImpl
iDataDictionaryService
;
@Autowired
ISourceFileService
ISourceFileService
;
/**
/**
* 分页查询
* 分页查询
*/
*/
...
@@ -243,6 +257,160 @@ public class DispatchTaskServiceImpl extends BaseService<DispatchTaskDto,Dispatc
...
@@ -243,6 +257,160 @@ public class DispatchTaskServiceImpl extends BaseService<DispatchTaskDto,Dispatc
return
baseMapper
.
getTaskListByPhonePager
(
phone
,
typeCode
,
current
*
5
);
return
baseMapper
.
getTaskListByPhonePager
(
phone
,
typeCode
,
current
*
5
);
}
}
@Override
@Transactional
public
WechatMyTaskDto
saveWechatFeedBack
(
WechatDispatchFeedbackDto
wechatDispatchFeedbackDto
)
{
// 更新反馈信息
DispatchTask
task
=
this
.
getById
(
wechatDispatchFeedbackDto
.
getTaskId
());
DispatchPaper
dispatchPaper
=
dispatchPaperServiceImpl
.
getById
(
task
.
getPaperId
());
// 反馈方式
dispatchPaper
.
setFeedbackCode
(
"856"
);
dispatchPaper
.
setFeedbackType
(
"主动反馈"
);
// 反馈时间
dispatchPaper
.
setFeedbackFinishTime
(
new
Date
());
dispatchPaper
.
setFeedbackTime
(
new
Date
());
// 反馈人信息
dispatchPaper
.
setFeedbackUid
(
task
.
getResponseUserId
()
+
""
);
dispatchPaper
.
setFeedbackUname
(
task
.
getResponseUserName
());
dispatchPaper
.
setRepairUser
(
task
.
getResponseUserName
());
// 保存照片
Map
<
String
,
List
<
AttachmentDto
>>
attachmentMap
=
new
HashMap
<>();
attachmentMap
.
put
(
"imgs"
,
wechatDispatchFeedbackDto
.
getImgs
());
ISourceFileService
.
saveAttachments
(
task
.
getPaperId
(),
attachmentMap
);
dispatchPaperServiceImpl
.
updateById
(
dispatchPaper
);
// 动态字段
iAlertFormValueService
.
update
(
new
LambdaUpdateWrapper
<
AlertFormValue
>().
set
(
AlertFormValue:
:
getFieldValue
,
wechatDispatchFeedbackDto
.
getRemark
()).
eq
(
AlertFormValue:
:
getFieldCode
,
"fix_remark"
).
eq
(
AlertFormValue:
:
getAlertCalledId
,
task
.
getPaperId
()));
if
(
StringUtils
.
isNotBlank
(
wechatDispatchFeedbackDto
.
getFixResult
()))
{
LambdaQueryWrapper
<
DataDictionary
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
queryWrapper
.
eq
(
DataDictionary:
:
getType
,
TzsCommonParam
.
WXJG
).
eq
(
DataDictionary:
:
getCode
,
wechatDispatchFeedbackDto
.
getFixResult
());
DataDictionary
fixResult
=
iDataDictionaryService
.
getOne
(
queryWrapper
);
iAlertFormValueService
.
update
(
new
LambdaUpdateWrapper
<
AlertFormValue
>().
set
(
AlertFormValue:
:
getFieldValue
,
fixResult
.
getName
()).
set
(
AlertFormValue:
:
getFieldValueCode
,
fixResult
.
getCode
()).
eq
(
AlertFormValue:
:
getFieldCode
,
"fix_result"
).
eq
(
AlertFormValue:
:
getAlertCalledId
,
task
.
getPaperId
()));
}
if
(
StringUtils
.
isNotBlank
(
wechatDispatchFeedbackDto
.
getErrorResult
()))
{
LambdaQueryWrapper
<
DataDictionary
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
queryWrapper
.
eq
(
DataDictionary:
:
getType
,
TzsCommonParam
.
GZYY
).
eq
(
DataDictionary:
:
getCode
,
wechatDispatchFeedbackDto
.
getErrorResult
());
DataDictionary
fixResult
=
iDataDictionaryService
.
getOne
(
queryWrapper
);
iAlertFormValueService
.
update
(
new
LambdaUpdateWrapper
<
AlertFormValue
>().
set
(
AlertFormValue:
:
getFieldValue
,
fixResult
.
getName
()).
set
(
AlertFormValue:
:
getFieldValueCode
,
fixResult
.
getCode
()).
eq
(
AlertFormValue:
:
getFieldCode
,
"error_result"
).
eq
(
AlertFormValue:
:
getAlertCalledId
,
task
.
getPaperId
()));
}
repairConsultServiceImpl
.
saveRepairConsultByAlertIdType
(
task
.
getAlertId
(),
TzsCommonParam
.
WXFK
,
task
.
getSequenceNbr
(),
null
);
WechatMyTaskDto
temp
=
this
.
getTaskInfoByTaskId
(
wechatDispatchFeedbackDto
.
getTaskId
());
List
<
AlertFormValue
>
paperList
=
null
;
LambdaQueryWrapper
<
AlertFormValue
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
switch
(
temp
.
getTaskTypeCode
())
{
case
"960"
:
// 困人救援
temp
.
setHasDeadHurt
(
"无"
);
queryWrapper
.
eq
(
AlertFormValue:
:
getAlertCalledId
,
temp
.
getAlertId
());
// 警情动态表单数据
List
<
AlertFormValue
>
alertList
=
iAlertFormValueService
.
list
(
queryWrapper
);
alertList
.
stream
().
forEach
(
t
->
{
String
value
=
t
.
getFieldValue
();
if
(
"trapped_floor_num"
.
equals
(
t
.
getFieldCode
()))
{
// 被困楼层
temp
.
setTrappedFloorNum
(
value
);
}
else
if
(
"trapped_num"
.
equals
(
t
.
getFieldCode
()))
{
// 被困人数
temp
.
setTrappedNum
(
value
);
}
else
if
(
"injured_num"
.
equals
(
t
.
getFieldCode
()))
{
// 受伤人数
if
(
StringUtils
.
isNotEmpty
(
value
))
{
temp
.
setHasDeadHurt
(
"有"
);
}
}
else
if
(
"die_num"
.
equals
(
t
.
getFieldCode
()))
{
// 死亡人数
if
(
StringUtils
.
isNotEmpty
(
value
))
{
temp
.
setHasDeadHurt
(
"有"
);
}
}
});
queryWrapper
=
new
LambdaQueryWrapper
<>();
queryWrapper
.
eq
(
AlertFormValue:
:
getAlertCalledId
,
temp
.
getPaperId
());
// 派遣动态表单
paperList
=
iAlertFormValueService
.
list
(
queryWrapper
);
paperList
.
stream
().
forEach
(
t
->
{
String
value
=
t
.
getFieldValue
();
if
(
"save_time"
.
equals
(
t
.
getFieldCode
()))
{
// 救援完成时间
if
(
StringUtils
.
isNotBlank
(
value
))
{
temp
.
setSaveTime
(
DateUtils
.
longStr2Date
(
value
));
}
}
else
if
(
"error_result"
.
equals
(
t
.
getFieldCode
()))
{
// 故障原因
temp
.
setErrorResult
(
value
);
}
else
if
(
"fix_result"
.
equals
(
t
.
getFieldCode
()))
{
// 维修结果
temp
.
setFixResult
(
value
);
}
else
if
(
"fix_remark"
.
equals
(
t
.
getFieldCode
()))
{
// 维修备注
temp
.
setRemark
(
value
);
}
});
// 预留照片处理
break
;
case
"961"
:
// 故障维修
queryWrapper
=
new
LambdaQueryWrapper
<>();
queryWrapper
.
eq
(
AlertFormValue:
:
getAlertCalledId
,
temp
.
getPaperId
());
// 派遣动态表单
paperList
=
iAlertFormValueService
.
list
(
queryWrapper
);
paperList
.
stream
().
forEach
(
t
->
{
String
value
=
t
.
getFieldValue
();
if
(
"save_time"
.
equals
(
t
.
getFieldCode
()))
{
// 救援完成时间
if
(
StringUtils
.
isNotBlank
(
value
))
{
temp
.
setSaveTime
(
DateUtils
.
longStr2Date
(
value
));
}
}
else
if
(
"error_result"
.
equals
(
t
.
getFieldCode
()))
{
// 故障原因
temp
.
setErrorResult
(
value
);
}
else
if
(
"fix_result"
.
equals
(
t
.
getFieldCode
()))
{
// 维修结果
temp
.
setFixResult
(
value
);
}
else
if
(
"fix_remark"
.
equals
(
t
.
getFieldCode
()))
{
// 维修备注
temp
.
setRemark
(
value
);
}
else
if
(
"feedback_result"
.
equals
(
t
.
getFieldCode
()))
{
// 反馈结果
temp
.
setFeedbackResult
(
value
);
}
});
break
;
case
"962"
:
// 投诉建议
queryWrapper
=
new
LambdaQueryWrapper
<>();
queryWrapper
.
eq
(
AlertFormValue:
:
getAlertCalledId
,
temp
.
getPaperId
());
// 派遣动态表单
paperList
=
iAlertFormValueService
.
list
(
queryWrapper
);
paperList
.
stream
().
forEach
(
t
->
{
String
value
=
t
.
getFieldValue
();
if
(
"action_result"
.
equals
(
t
.
getFieldCode
()))
{
// 处置结果
temp
.
setActionResult
(
value
);
}
});
break
;
}
return
temp
;
}
@Transactional
@Transactional
@Override
@Override
public
Boolean
createDispatchTask
(
DispatchTaskDto
dispatchTaskDto
,
AgencyUserModel
sendUser
)
{
public
Boolean
createDispatchTask
(
DispatchTaskDto
dispatchTaskDto
,
AgencyUserModel
sendUser
)
{
...
...
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