Commit 7269594a authored by kongfm's avatar kongfm

接口测试修正

parent 0f0285dd
...@@ -5,6 +5,8 @@ import java.util.Date; ...@@ -5,6 +5,8 @@ import java.util.Date;
import com.alibaba.excel.annotation.ExcelIgnore; import com.alibaba.excel.annotation.ExcelIgnore;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
...@@ -30,8 +32,12 @@ public class BaseDto implements Serializable{ ...@@ -30,8 +32,12 @@ public class BaseDto implements Serializable{
protected Date recDate; protected Date recDate;
@ExcelIgnore @ExcelIgnore
@ApiModelProperty(value = "更新人") @ApiModelProperty(value = "更新人id")
protected String recUserId; protected String recUserId;
@ExcelIgnore
@ApiModelProperty(value = "更新人")
protected String recUserName;
@ExcelIgnore @ExcelIgnore
@ApiModelProperty(value = "是否删除") @ApiModelProperty(value = "是否删除")
......
...@@ -34,7 +34,7 @@ public interface IDispatchPaperService { ...@@ -34,7 +34,7 @@ public interface IDispatchPaperService {
* @param alertId * @param alertId
* @return * @return
*/ */
DispatchSaveFeedbackDto getDispatchSaveFeedbackDtoByAlertId(Long alertId, AgencyUserModel feedbackUser); DispatchSaveFeedbackDto getDispatchSaveFeedbackDtoByAlertId(Long alertId);
/** /**
* 坐席填写救援回访相关信息 * 坐席填写救援回访相关信息
...@@ -48,7 +48,7 @@ public interface IDispatchPaperService { ...@@ -48,7 +48,7 @@ public interface IDispatchPaperService {
* @param alertId * @param alertId
* @return * @return
*/ */
DispatchRepairFeedbackDto getDispatchRepairFeedbackDtoByAlertId(Long alertId, AgencyUserModel feedbackUser); DispatchRepairFeedbackDto getDispatchRepairFeedbackDtoByAlertId(Long alertId);
/** /**
...@@ -63,7 +63,7 @@ public interface IDispatchPaperService { ...@@ -63,7 +63,7 @@ public interface IDispatchPaperService {
* @param alertId * @param alertId
* @return * @return
*/ */
DispatchConsultFeedbackDto getDispatchConsultFeedbackDtoByAlertId(Long alertId, AgencyUserModel feedbackUser); DispatchConsultFeedbackDto getDispatchConsultFeedbackDtoByAlertId(Long alertId);
/** /**
......
...@@ -54,10 +54,8 @@ public class DispatchPaperController extends BaseController { ...@@ -54,10 +54,8 @@ public class DispatchPaperController extends BaseController {
@GetMapping(value = "/feedback/save/{alertId}") @GetMapping(value = "/feedback/save/{alertId}")
@ApiOperation(httpMethod = "GET", value = "通过警情id 获取 救援回访相关信息", notes = "通过警情id 获取 救援回访相关信息") @ApiOperation(httpMethod = "GET", value = "通过警情id 获取 救援回访相关信息", notes = "通过警情id 获取 救援回访相关信息")
public ResponseModel<DispatchSaveFeedbackDto> getSaveFeedback(@PathVariable Long alertId) { public ResponseModel<DispatchSaveFeedbackDto> getSaveFeedback(@PathVariable Long alertId) {
ReginParams reginParams =
JSONObject.parseObject(null != redisUtils.get(buildKey(getToken())) ? DispatchSaveFeedbackDto dispatchSaveFeedbackDto = dispatchPaperServiceImpl.getDispatchSaveFeedbackDtoByAlertId(alertId);
redisUtils.get(buildKey(getToken())).toString() : null, ReginParams.class);
DispatchSaveFeedbackDto dispatchSaveFeedbackDto = dispatchPaperServiceImpl.getDispatchSaveFeedbackDtoByAlertId(alertId,reginParams.getUserModel());
return ResponseHelper.buildResponse(dispatchSaveFeedbackDto); return ResponseHelper.buildResponse(dispatchSaveFeedbackDto);
} }
...@@ -85,10 +83,8 @@ public class DispatchPaperController extends BaseController { ...@@ -85,10 +83,8 @@ public class DispatchPaperController extends BaseController {
@GetMapping(value = "/feedback/repair/{alertId}") @GetMapping(value = "/feedback/repair/{alertId}")
@ApiOperation(httpMethod = "GET", value = "通过警情id 获取 维修回访相关信息", notes = "通过警情id 获取 维修回访相关信息") @ApiOperation(httpMethod = "GET", value = "通过警情id 获取 维修回访相关信息", notes = "通过警情id 获取 维修回访相关信息")
public ResponseModel<DispatchRepairFeedbackDto> getRepairFeedBack(@PathVariable Long alertId) { public ResponseModel<DispatchRepairFeedbackDto> getRepairFeedBack(@PathVariable Long alertId) {
ReginParams reginParams =
JSONObject.parseObject(null != redisUtils.get(buildKey(getToken())) ? DispatchRepairFeedbackDto dispatchRepairFeedbackDto = dispatchPaperServiceImpl.getDispatchRepairFeedbackDtoByAlertId(alertId);
redisUtils.get(buildKey(getToken())).toString() : null, ReginParams.class);
DispatchRepairFeedbackDto dispatchRepairFeedbackDto = dispatchPaperServiceImpl.getDispatchRepairFeedbackDtoByAlertId(alertId,reginParams.getUserModel());
return ResponseHelper.buildResponse(dispatchRepairFeedbackDto); return ResponseHelper.buildResponse(dispatchRepairFeedbackDto);
} }
...@@ -116,10 +112,7 @@ public class DispatchPaperController extends BaseController { ...@@ -116,10 +112,7 @@ public class DispatchPaperController extends BaseController {
@GetMapping(value = "/feedback/consult/{alertId}") @GetMapping(value = "/feedback/consult/{alertId}")
@ApiOperation(httpMethod = "GET", value = "通过警情id 获取 投诉回访相关信息", notes = "通过警情id 获取 投诉回访相关信息") @ApiOperation(httpMethod = "GET", value = "通过警情id 获取 投诉回访相关信息", notes = "通过警情id 获取 投诉回访相关信息")
public ResponseModel<DispatchConsultFeedbackDto> getConsultFeedBack(@PathVariable Long alertId) { public ResponseModel<DispatchConsultFeedbackDto> getConsultFeedBack(@PathVariable Long alertId) {
ReginParams reginParams = DispatchConsultFeedbackDto dispatchConsultFeedbackDto = dispatchPaperServiceImpl.getDispatchConsultFeedbackDtoByAlertId(alertId);
JSONObject.parseObject(null != redisUtils.get(buildKey(getToken())) ?
redisUtils.get(buildKey(getToken())).toString() : null, ReginParams.class);
DispatchConsultFeedbackDto dispatchConsultFeedbackDto = dispatchPaperServiceImpl.getDispatchConsultFeedbackDtoByAlertId(alertId,reginParams.getUserModel());
return ResponseHelper.buildResponse(dispatchConsultFeedbackDto); return ResponseHelper.buildResponse(dispatchConsultFeedbackDto);
} }
......
...@@ -77,10 +77,10 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall ...@@ -77,10 +77,10 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
@Override @Override
public Object selectAlertCalledById(Long id) { public Object selectAlertCalledById(Long id) {
if(redisUtils.hasKey(RedisKey.ALERTCALLED_ID+id)){ /* if(redisUtils.hasKey(RedisKey.ALERTCALLED_ID+id)){
Object obj= redisUtils.get(RedisKey.ALERTCALLED_ID+id); Object obj= redisUtils.get(RedisKey.ALERTCALLED_ID+id);
return obj; return JSON.toJavaObject((JSON) obj,AlertCalledFormDto.class);
}else{ }else{*/
// 警情基本信息 // 警情基本信息
AlertCalled alertCalled = this.getById(id); AlertCalled alertCalled = this.getById(id);
QueryWrapper<AlertFormValue> queryWrapper = new QueryWrapper<>(); QueryWrapper<AlertFormValue> queryWrapper = new QueryWrapper<>();
...@@ -97,7 +97,7 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall ...@@ -97,7 +97,7 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
AlertCalledDto alertCalledDto = BeanDtoVoUtils.convert(alertCalled,AlertCalledDto.class); AlertCalledDto alertCalledDto = BeanDtoVoUtils.convert(alertCalled,AlertCalledDto.class);
AlertCalledVo alertCalledVo = AlertBeanDtoVoUtils.convertAlertCalledDtoToVo(alertCalledDto); AlertCalledVo alertCalledVo = AlertBeanDtoVoUtils.convertAlertCalledDtoToVo(alertCalledDto);
QueryWrapper<Elevator> elevatorQueryWrapper = new QueryWrapper<>(); QueryWrapper<Elevator> elevatorQueryWrapper = new QueryWrapper<>();
elevatorQueryWrapper.eq("rescue_code", Integer.parseInt(alertCalled.getDeviceId())); elevatorQueryWrapper.eq("rescue_code", alertCalled.getDeviceId());
elevatorQueryWrapper.eq("register_code", alertCalled.getRegistrationCode()); elevatorQueryWrapper.eq("register_code", alertCalled.getRegistrationCode());
Elevator elevator = iElevatorService.getOne(elevatorQueryWrapper); Elevator elevator = iElevatorService.getOne(elevatorQueryWrapper);
if(null != elevator) { if(null != elevator) {
...@@ -112,9 +112,9 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall ...@@ -112,9 +112,9 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
} }
AlertCalledFormDto alertCalledFormVo = new AlertCalledFormDto(alertCalledVo, formValue); AlertCalledFormDto alertCalledFormVo = new AlertCalledFormDto(alertCalledVo, formValue);
redisUtils.set(RedisKey.ALERTCALLED_ID+id, JSON.toJSON(alertCalledFormVo),time); //redisUtils.set(RedisKey.ALERTCALLED_ID+id, JSON.toJSON(alertCalledFormVo),time);
return alertCalledFormVo; return alertCalledFormVo;
} //}
} }
......
...@@ -11,6 +11,7 @@ import com.yeejoin.amos.boot.module.tzs.api.dto.DispatchPaperDto; ...@@ -11,6 +11,7 @@ import com.yeejoin.amos.boot.module.tzs.api.dto.DispatchPaperDto;
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.DispatchRepairFeedbackDto; import com.yeejoin.amos.boot.module.tzs.api.dto.DispatchRepairFeedbackDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.DispatchSaveFeedbackDto; import com.yeejoin.amos.boot.module.tzs.api.dto.DispatchSaveFeedbackDto;
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.AlertFormValue;
import com.yeejoin.amos.boot.module.tzs.api.entity.DispatchPaper; 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.DispatchTask;
...@@ -65,6 +66,10 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa ...@@ -65,6 +66,10 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa
@Autowired @Autowired
private DataDictionaryServiceImpl iDataDictionaryService; private DataDictionaryServiceImpl iDataDictionaryService;
@Autowired
private RescueProcessServiceImpl rescueProcessServiceImpl;
/** /**
* 分页查询 * 分页查询
*/ */
...@@ -123,9 +128,13 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa ...@@ -123,9 +128,13 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa
DispatchPaper dispatchPaper =selectDispatchPaperByAlertId(alertId); DispatchPaper dispatchPaper =selectDispatchPaperByAlertId(alertId);
// 封装dto // 封装dto
DispatchPaperFormDto dispatchPaperFormDto = new DispatchPaperFormDto(); DispatchPaperFormDto dispatchPaperFormDto = new DispatchPaperFormDto();
if(dispatchPaper == null) { //如果没有找到paper 返回空Dto
return dispatchPaperFormDto;
}
dispatchPaperFormDto.setDispatchPaper(dispatchPaper); dispatchPaperFormDto.setDispatchPaper(dispatchPaper);
QueryWrapper<AlertFormValue> queryWrapper = new QueryWrapper<>(); QueryWrapper<AlertFormValue> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("alert_called_id", dispatchPaper.getSequenceNbr()).eq("alert_type_code",dispatchPaper.getAlertCode()); queryWrapper.eq("alert_called_id", dispatchPaper.getSequenceNbr()).eq("alert_type_code", DispatchPaperEnums.getEnum(dispatchPaper.getAlertCode()).getDynamicCode());
// 派遣单动态表单数据 // 派遣单动态表单数据
List<AlertFormValue> list = iAlertFormValueService.list(queryWrapper); List<AlertFormValue> list = iAlertFormValueService.list(queryWrapper);
dispatchPaperFormDto.setDynamicFormAlert(list); dispatchPaperFormDto.setDynamicFormAlert(list);
...@@ -171,17 +180,28 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa ...@@ -171,17 +180,28 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa
alertFormInitDtoList.stream().forEach(initDto -> { alertFormInitDtoList.stream().forEach(initDto -> {
initDto.getFormItemDescr().setAlertCalledId(dispatchPaper.getSequenceNbr()); initDto.getFormItemDescr().setAlertCalledId(dispatchPaper.getSequenceNbr());
initDto.getFormItemDescr().setAlertTypeCode(DispatchPaperEnums.getEnum(dispatchPaper.getAlertCode()).getDynamicCode()); initDto.getFormItemDescr().setAlertTypeCode(DispatchPaperEnums.getEnum(dispatchPaper.getAlertCode()).getDynamicCode());
initDto.getFormItemDescr().setFieldValue(null);
paperFormValuelist.add(initDto.getFormItemDescr()); paperFormValuelist.add(initDto.getFormItemDescr());
}); });
// 保存动态表单数据 // 保存动态表单数据
iAlertFormValueService.saveBatch(paperFormValuelist); iAlertFormValueService.saveBatch(paperFormValuelist);
dispatchPaperFormDto.setDispatchPaper(dispatchPaper); dispatchPaperFormDto.setDispatchPaper(dispatchPaper);
dispatchPaperFormDto.setDynamicFormAlert(paperFormValuelist); dispatchPaperFormDto.setDynamicFormAlert(paperFormValuelist);
if("KRJY".equals(alertCode)) {
RescueProcessDto rescueProcessDto = new RescueProcessDto();
rescueProcessDto.setAlertId(alertId);
rescueProcessDto.setDispatchStatus(true);
rescueProcessDto.setDispatchTime(dispatchPaper.getDispatchTime());
rescueProcessServiceImpl.updateByAlertId(rescueProcessDto,null);
}
return dispatchPaperFormDto; return dispatchPaperFormDto;
} }
@Override @Override
public DispatchSaveFeedbackDto getDispatchSaveFeedbackDtoByAlertId(Long alertId, AgencyUserModel feedbackUser) { public DispatchSaveFeedbackDto getDispatchSaveFeedbackDtoByAlertId(Long alertId) {
DispatchSaveFeedbackDto dispatchSaveFeedbackDto = new DispatchSaveFeedbackDto(); DispatchSaveFeedbackDto dispatchSaveFeedbackDto = new DispatchSaveFeedbackDto();
dispatchSaveFeedbackDto.setAlertId(alertId); dispatchSaveFeedbackDto.setAlertId(alertId);
AlertCalledFormDto alertCalledFormVo = (AlertCalledFormDto) alertCalledServiceImpl.selectAlertCalledById(alertId); AlertCalledFormDto alertCalledFormVo = (AlertCalledFormDto) alertCalledServiceImpl.selectAlertCalledById(alertId);
...@@ -200,12 +220,12 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa ...@@ -200,12 +220,12 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa
dispatchSaveFeedbackDto.setFeedbackFinishTime(dispatchPaper.getFeedbackFinishTime()); dispatchSaveFeedbackDto.setFeedbackFinishTime(dispatchPaper.getFeedbackFinishTime());
dispatchSaveFeedbackDto.setRemark(dispatchPaper.getRemark()); dispatchSaveFeedbackDto.setRemark(dispatchPaper.getRemark());
if(StringUtils.isBlank(dispatchPaper.getFeedbackUid())) { if(StringUtils.isBlank(dispatchPaper.getFeedbackUid())) {
dispatchSaveFeedbackDto.setFeedbackUid(feedbackUser.getUserId()); dispatchSaveFeedbackDto.setFeedbackUid(null);
} else { } else {
dispatchSaveFeedbackDto.setFeedbackUid(dispatchPaper.getFeedbackUid()); dispatchSaveFeedbackDto.setFeedbackUid(dispatchPaper.getFeedbackUid());
} }
if(StringUtils.isBlank(dispatchPaper.getFeedbackUname())) { if(StringUtils.isBlank(dispatchPaper.getFeedbackUname())) {
dispatchSaveFeedbackDto.setFeedbackUname(feedbackUser.getUserName()); dispatchSaveFeedbackDto.setFeedbackUname(null);
} else { } else {
dispatchSaveFeedbackDto.setFeedbackUname(dispatchPaper.getFeedbackUname()); dispatchSaveFeedbackDto.setFeedbackUname(dispatchPaper.getFeedbackUname());
} }
...@@ -246,7 +266,7 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa ...@@ -246,7 +266,7 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa
case "save_feedback_user": case "save_feedback_user":
value = alertFormValue.getFieldValue(); value = alertFormValue.getFieldValue();
if (StringUtils.isBlank(value)) { if (StringUtils.isBlank(value)) {
dispatchSaveFeedbackDto.setSaveFeedbackUser(feedbackUser.getUserName()); dispatchSaveFeedbackDto.setSaveFeedbackUser(null);
} else { } else {
dispatchSaveFeedbackDto.setSaveFeedbackUser(value); dispatchSaveFeedbackDto.setSaveFeedbackUser(value);
} }
...@@ -254,7 +274,7 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa ...@@ -254,7 +274,7 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa
case "save_feedback_uid": case "save_feedback_uid":
value = alertFormValue.getFieldValue(); value = alertFormValue.getFieldValue();
if (StringUtils.isBlank(value)) { if (StringUtils.isBlank(value)) {
dispatchSaveFeedbackDto.setSaveFeedbackUid(feedbackUser.getUserId()); dispatchSaveFeedbackDto.setSaveFeedbackUid(null);
} else { } else {
dispatchSaveFeedbackDto.setSaveFeedbackUid(value); dispatchSaveFeedbackDto.setSaveFeedbackUid(value);
} }
...@@ -340,7 +360,7 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa ...@@ -340,7 +360,7 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa
} }
@Override @Override
public DispatchRepairFeedbackDto getDispatchRepairFeedbackDtoByAlertId(Long alertId, AgencyUserModel feedbackUser) { public DispatchRepairFeedbackDto getDispatchRepairFeedbackDtoByAlertId(Long alertId) {
DispatchRepairFeedbackDto dispatchRepairFeedbackDto = new DispatchRepairFeedbackDto(); DispatchRepairFeedbackDto dispatchRepairFeedbackDto = new DispatchRepairFeedbackDto();
dispatchRepairFeedbackDto.setAlertId(alertId); dispatchRepairFeedbackDto.setAlertId(alertId);
AlertCalledFormDto alertCalledFormVo = (AlertCalledFormDto) alertCalledServiceImpl.selectAlertCalledById(alertId); AlertCalledFormDto alertCalledFormVo = (AlertCalledFormDto) alertCalledServiceImpl.selectAlertCalledById(alertId);
...@@ -361,13 +381,13 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa ...@@ -361,13 +381,13 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa
dispatchRepairFeedbackDto.setFeedbackFinishTime(dispatchPaper.getFeedbackFinishTime()); //维修完成时间 dispatchRepairFeedbackDto.setFeedbackFinishTime(dispatchPaper.getFeedbackFinishTime()); //维修完成时间
dispatchRepairFeedbackDto.setRemark(dispatchPaper.getRemark()); // 维修反馈备注 dispatchRepairFeedbackDto.setRemark(dispatchPaper.getRemark()); // 维修反馈备注
if(StringUtils.isBlank(dispatchPaper.getFeedbackUid())) { //维修反馈人 if(StringUtils.isBlank(dispatchPaper.getFeedbackUid())) { //维修反馈人
dispatchRepairFeedbackDto.setFeedbackUid(feedbackUser.getUserId()); dispatchRepairFeedbackDto.setFeedbackUid(null);
} else { } else {
dispatchRepairFeedbackDto.setFeedbackUid(dispatchPaper.getFeedbackUid()); dispatchRepairFeedbackDto.setFeedbackUid(dispatchPaper.getFeedbackUid());
} }
if(StringUtils.isBlank(dispatchPaper.getFeedbackUname())) { //维修反馈人 if(StringUtils.isBlank(dispatchPaper.getFeedbackUname())) { //维修反馈人
dispatchRepairFeedbackDto.setFeedbackUname(feedbackUser.getUserName()); dispatchRepairFeedbackDto.setFeedbackUname(null);
} else { } else {
dispatchRepairFeedbackDto.setFeedbackUname(dispatchPaper.getFeedbackUname()); dispatchRepairFeedbackDto.setFeedbackUname(dispatchPaper.getFeedbackUname());
} }
...@@ -418,7 +438,7 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa ...@@ -418,7 +438,7 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa
case "fix_feedback_uname": case "fix_feedback_uname":
value = alertFormValue.getFieldValue(); value = alertFormValue.getFieldValue();
if (StringUtils.isBlank(value)) { if (StringUtils.isBlank(value)) {
dispatchRepairFeedbackDto.setFixFeedbackUname(feedbackUser.getUserName()); dispatchRepairFeedbackDto.setFixFeedbackUname(null);
} else { } else {
dispatchRepairFeedbackDto.setFixFeedbackUname(value); dispatchRepairFeedbackDto.setFixFeedbackUname(value);
} }
...@@ -426,7 +446,7 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa ...@@ -426,7 +446,7 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa
case "fix_feedback_uid": case "fix_feedback_uid":
value = alertFormValue.getFieldValue(); value = alertFormValue.getFieldValue();
if (StringUtils.isBlank(value)) { if (StringUtils.isBlank(value)) {
dispatchRepairFeedbackDto.setFixFeedbackUid(feedbackUser.getUserId()); dispatchRepairFeedbackDto.setFixFeedbackUid(null);
} else { } else {
dispatchRepairFeedbackDto.setFixFeedbackUid(value); dispatchRepairFeedbackDto.setFixFeedbackUid(value);
} }
...@@ -530,7 +550,7 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa ...@@ -530,7 +550,7 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa
} }
@Override @Override
public DispatchConsultFeedbackDto getDispatchConsultFeedbackDtoByAlertId(Long alertId, AgencyUserModel feedbackUser) { public DispatchConsultFeedbackDto getDispatchConsultFeedbackDtoByAlertId(Long alertId) {
DispatchConsultFeedbackDto dispatchConsultFeedbackDto = new DispatchConsultFeedbackDto(); DispatchConsultFeedbackDto dispatchConsultFeedbackDto = new DispatchConsultFeedbackDto();
dispatchConsultFeedbackDto.setAlertId(alertId); dispatchConsultFeedbackDto.setAlertId(alertId);
AlertCalledFormDto alertCalledFormVo = (AlertCalledFormDto) alertCalledServiceImpl.selectAlertCalledById(alertId); AlertCalledFormDto alertCalledFormVo = (AlertCalledFormDto) alertCalledServiceImpl.selectAlertCalledById(alertId);
...@@ -552,13 +572,13 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa ...@@ -552,13 +572,13 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa
dispatchConsultFeedbackDto.setRemark(dispatchPaper.getRemark()); // 维修反馈备注 dispatchConsultFeedbackDto.setRemark(dispatchPaper.getRemark()); // 维修反馈备注
dispatchConsultFeedbackDto.setFeedbackFinishTime(dispatchPaper.getFeedbackFinishTime()); //维保完成时间 dispatchConsultFeedbackDto.setFeedbackFinishTime(dispatchPaper.getFeedbackFinishTime()); //维保完成时间
if(StringUtils.isBlank(dispatchPaper.getFeedbackUid())) { //维修反馈人 if(StringUtils.isBlank(dispatchPaper.getFeedbackUid())) { //维修反馈人
dispatchConsultFeedbackDto.setFeedbackUid(feedbackUser.getUserId()); dispatchConsultFeedbackDto.setFeedbackUid(null);
} else { } else {
dispatchConsultFeedbackDto.setFeedbackUid(dispatchPaper.getFeedbackUid()); dispatchConsultFeedbackDto.setFeedbackUid(dispatchPaper.getFeedbackUid());
} }
if(StringUtils.isBlank(dispatchPaper.getFeedbackUname())) { //维修反馈人 if(StringUtils.isBlank(dispatchPaper.getFeedbackUname())) { //维修反馈人
dispatchConsultFeedbackDto.setFeedbackUname(feedbackUser.getUserName()); dispatchConsultFeedbackDto.setFeedbackUname(null);
} else { } else {
dispatchConsultFeedbackDto.setFeedbackUname(dispatchPaper.getFeedbackUname()); dispatchConsultFeedbackDto.setFeedbackUname(dispatchPaper.getFeedbackUname());
} }
...@@ -613,7 +633,7 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa ...@@ -613,7 +633,7 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa
case "consult_feedback_uname": case "consult_feedback_uname":
value = alertFormValue.getFieldValue(); value = alertFormValue.getFieldValue();
if (StringUtils.isBlank(value)) { if (StringUtils.isBlank(value)) {
dispatchConsultFeedbackDto.setConsultFeedbackUname(feedbackUser.getUserName()); dispatchConsultFeedbackDto.setConsultFeedbackUname(null);
} else { } else {
dispatchConsultFeedbackDto.setConsultFeedbackUname(value); dispatchConsultFeedbackDto.setConsultFeedbackUname(value);
} }
...@@ -621,7 +641,7 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa ...@@ -621,7 +641,7 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa
case "consult_feedback_uid": case "consult_feedback_uid":
value = alertFormValue.getFieldValue(); value = alertFormValue.getFieldValue();
if (StringUtils.isBlank(value)) { if (StringUtils.isBlank(value)) {
dispatchConsultFeedbackDto.setConsultFeedbackUid(feedbackUser.getUserId()); dispatchConsultFeedbackDto.setConsultFeedbackUid(null);
} else { } else {
dispatchConsultFeedbackDto.setConsultFeedbackUid(value); dispatchConsultFeedbackDto.setConsultFeedbackUid(value);
} }
......
...@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; ...@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
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.entity.AlertFormValue; 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.DispatchPaper;
import com.yeejoin.amos.boot.module.tzs.api.entity.DispatchTask; import com.yeejoin.amos.boot.module.tzs.api.entity.DispatchTask;
...@@ -93,7 +94,17 @@ public class DispatchTaskServiceImpl extends BaseService<DispatchTaskDto,Dispatc ...@@ -93,7 +94,17 @@ public class DispatchTaskServiceImpl extends BaseService<DispatchTaskDto,Dispatc
// 创建派遣单 // 创建派遣单
dispatchTaskDto.setDispatchTime(new Date()); dispatchTaskDto.setDispatchTime(new Date());
DispatchTask dispatchTask = BeanDtoVoUtils.convert(dispatchTaskDto, DispatchTask.class); DispatchTask dispatchTask = BeanDtoVoUtils.convert(dispatchTaskDto, DispatchTask.class);
dispatchTask.setPaperId(dispatchPaperDto.getSequenceNbr()); dispatchTask.setPaperId(dispatchPaperDto.getDispatchPaper().getSequenceNbr());
if(dispatchPaper.getRepairOrgTaskId() != null && (dispatchTask.getOrgTypeCode().equals("levelOneUnit") || dispatchTask.getOrgTypeCode().equals("levelTwoUnit"))) {
throw new BadRequest("已经派遣过其他力量调派");
}
if(dispatchPaper.getUseOrgTaskId() != null && dispatchTask.getOrgTypeCode().equals("useUnit")) {
throw new BadRequest("已经派遣过使用单位");
}
if(dispatchPaper.getRepairOrgTaskId() != null && dispatchTask.getOrgTypeCode().equals("repairUnit") ) {
throw new BadRequest("已经派遣过维修单位调派");
}
flag = this.save(dispatchTask); flag = this.save(dispatchTask);
if(flag) { // 创建好派遣任务单以后根据任务单类型修改派遣单信息 if(flag) { // 创建好派遣任务单以后根据任务单类型修改派遣单信息
// 社会信用代码 根据类型查找放入 // 社会信用代码 根据类型查找放入
...@@ -103,59 +114,58 @@ public class DispatchTaskServiceImpl extends BaseService<DispatchTaskDto,Dispatc ...@@ -103,59 +114,58 @@ public class DispatchTaskServiceImpl extends BaseService<DispatchTaskDto,Dispatc
UseUnit useUnit = iUseUnitService.getById(dispatchTask.getResponseOrgId()); UseUnit useUnit = iUseUnitService.getById(dispatchTask.getResponseOrgId());
dispatchPaper.setUseOrgId(useUnit.getSequenceNbr()); dispatchPaper.setUseOrgId(useUnit.getSequenceNbr());
dispatchPaper.setUseOrgTaskId(dispatchTask.getSequenceNbr()); dispatchPaper.setUseOrgTaskId(dispatchTask.getSequenceNbr());
break; if(dispatchPaper.getAlertCode().equals("KRJY")) {
case "repairUnit":
maintenanceUnit = iMaintenanceUnitService.getById(dispatchTask.getResponseOrgId());
dispatchPaper.setRepairOrgId(maintenanceUnit.getSequenceNbr());
dispatchPaper.setRepairOrgTaskId(dispatchTask.getSequenceNbr());
break;
case "levelOneUnit":
if(dispatchPaper.getRepairOrgId() != null) { // 已经派遣过调派
throw new BadRequest("已经派遣过其他力量调派");
} else {
maintenanceUnit = iMaintenanceUnitService.getById(dispatchTask.getResponseOrgId());
String socialCreditCode = maintenanceUnit.getSocialCreditCode();
dispatchPaper.setRepairOrgId(maintenanceUnit.getSequenceNbr());
dispatchPaper.setRepairOrgTaskId(dispatchTask.getSequenceNbr());
// 修改动态字段
dynamicFormAlert.stream().forEach(alertFormValue -> { dynamicFormAlert.stream().forEach(alertFormValue -> {
if(alertFormValue.getFieldCode().equals("dispatch_status")) { if(alertFormValue.getFieldCode().equals("dispatch_status")) {
alertFormValue.setFieldValue("已派遣"); alertFormValue.setFieldValue("已派遣");
alertFormValue.setFieldValueCode("hasDispatched"); alertFormValue.setFieldValueCode("hasDispatched");
} else if(alertFormValue.getFieldCode().equals("response_level")) {
alertFormValue.setFieldValue("一级响应");
alertFormValue.setFieldValueCode("levelOneUnit");
} else if(alertFormValue.getFieldCode().equals("save_credit_code")) {
alertFormValue.setFieldValue(socialCreditCode);
} }
}); });
} }
break; break;
case "repairUnit":
maintenanceUnit = iMaintenanceUnitService.getById(dispatchTask.getResponseOrgId());
dispatchPaper.setRepairOrgId(maintenanceUnit.getSequenceNbr());
dispatchPaper.setRepairOrgTaskId(dispatchTask.getSequenceNbr());
break;
case "levelOneUnit":
maintenanceUnit = iMaintenanceUnitService.getById(dispatchTask.getResponseOrgId());
String socialCreditCode = maintenanceUnit.getSocialCreditCode();
dispatchPaper.setRepairOrgId(maintenanceUnit.getSequenceNbr());
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("levelOneUnit");
} else if(alertFormValue.getFieldCode().equals("save_credit_code")) {
alertFormValue.setFieldValue(socialCreditCode);
}
});
break;
case "levelTwoUnit": case "levelTwoUnit":
if(dispatchPaper.getRepairOrgId() != null) { // 已经派遣过调派 RescueStation rescueStation = iRescueStationService.getById(dispatchTask.getResponseOrgId());
throw new BadRequest("已经派遣过其他力量调派"); dispatchPaper.setRepairOrgId(rescueStation.getSequenceNbr());
} else { dispatchPaper.setRepairOrgTaskId(dispatchTask.getSequenceNbr());
RescueStation rescueStation = iRescueStationService.getById(dispatchTask.getResponseOrgId()); // 修改动态字段
dispatchPaper.setRepairOrgId(rescueStation.getSequenceNbr()); dynamicFormAlert.stream().forEach(alertFormValue -> {
dispatchPaper.setRepairOrgTaskId(dispatchTask.getSequenceNbr()); if(alertFormValue.getFieldCode().equals("dispatch_status")) {
// 修改动态字段 alertFormValue.setFieldValue("已派遣");
dynamicFormAlert.stream().forEach(alertFormValue -> { alertFormValue.setFieldValueCode("hasDispatched");
if(alertFormValue.getFieldCode().equals("dispatch_status")) { } else if(alertFormValue.getFieldCode().equals("response_level")) {
alertFormValue.setFieldValue("已派遣"); alertFormValue.setFieldValue("二级响应");
alertFormValue.setFieldValueCode("hasDispatched"); alertFormValue.setFieldValueCode("levelTwoUnit");
} else if(alertFormValue.getFieldCode().equals("response_level")) { }
alertFormValue.setFieldValue("二级响应"); });
alertFormValue.setFieldValueCode("levelTwoUnit");
}
});
}
break; break;
} }
// 保存派遣单 // 保存派遣单
dispatchPaperServiceImpl.save(dispatchPaper); dispatchPaperServiceImpl.updateById(dispatchPaper);
// 保存动态表单数据 // 保存动态表单数据
iAlertFormValueService.saveBatch(dynamicFormAlert); iAlertFormValueService.updateBatchById(dynamicFormAlert);
} }
return flag; return flag;
} }
......
...@@ -88,7 +88,7 @@ public class RescueProcessServiceImpl extends BaseService<RescueProcessDto,Rescu ...@@ -88,7 +88,7 @@ public class RescueProcessServiceImpl extends BaseService<RescueProcessDto,Rescu
QueryWrapper<RescueProcess> templateQueryWrapper = new QueryWrapper<>(); QueryWrapper<RescueProcess> templateQueryWrapper = new QueryWrapper<>();
templateQueryWrapper.eq("alert_id", rescueProcessDto.getAlertId()); templateQueryWrapper.eq("alert_id", rescueProcessDto.getAlertId());
RescueProcess rescueProcess = this.getOne(templateQueryWrapper); RescueProcess rescueProcess = this.getOne(templateQueryWrapper);
if (rescueProcess != null) if (rescueProcess == null)
throw new BadRequest("救援过程信息未找到"); throw new BadRequest("救援过程信息未找到");
if (rescueProcessDto.getDispatchByUser()) { // 手动更新了派遣信息为三级派遣 if (rescueProcessDto.getDispatchByUser()) { // 手动更新了派遣信息为三级派遣
// 判断是否存在派遣单 不存在先创建派遣单 // 判断是否存在派遣单 不存在先创建派遣单
...@@ -136,6 +136,10 @@ public class RescueProcessServiceImpl extends BaseService<RescueProcessDto,Rescu ...@@ -136,6 +136,10 @@ public class RescueProcessServiceImpl extends BaseService<RescueProcessDto,Rescu
iAlertFormValueService.saveBatch(dynamicFormAlert); iAlertFormValueService.saveBatch(dynamicFormAlert);
} }
} }
rescueProcessDto.setSequenceNbr(rescueProcess.getSequenceNbr());
rescueProcessDto.setRecDate(rescueProcess.getRecDate());
rescueProcessDto.setRecUserId(rescueProcess.getRecUserId());
rescueProcessDto.setRecUserName(rescueProcess.getRecUserName());
rescueProcess = BeanDtoVoUtils.convert(rescueProcessDto, RescueProcess.class); rescueProcess = BeanDtoVoUtils.convert(rescueProcessDto, RescueProcess.class);
return this.updateById(rescueProcess); return this.updateById(rescueProcess);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment