Commit afa2d7a4 authored by suhuiguang's avatar suhuiguang

Merge branch 'developer' of http://172.16.10.76/moa/amos-boot-biz into developer

parents 8c13a0c3 8a246fbf
package com.yeejoin.amos.boot.biz.common.constants;
/**
* @Description: 业务通用常量类
* @Author: DELL
* @Date: 2021/5/26
*/
public interface BizConstant {
/**
* 经度
*/
public final static String LONGITUDE = "longitude";
/**
* 纬度
*/
public final static String LATITUDE = "latitude";
/**
* 地址
*/
public final static String ADDRESS = "address";
}
...@@ -11,11 +11,11 @@ import org.springframework.web.bind.annotation.RequestParam; ...@@ -11,11 +11,11 @@ import org.springframework.web.bind.annotation.RequestParam;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
@FeignClient(name = "AMOS-API-WORKFLOW", path = "workflow", configuration = { CommonMultipartSupportConfig.class }) @FeignClient(name = "AMOS-API-WORKFLOW-CJHENHAO", path = "workflow", configuration = { CommonMultipartSupportConfig.class })
public interface WorkflowFeignService { public interface WorkflowFeignService {
/** /**
* 发起流程 * 发起流程
* *
* @param params * @param params
* @return * @return
*/ */
...@@ -24,7 +24,7 @@ public interface WorkflowFeignService { ...@@ -24,7 +24,7 @@ public interface WorkflowFeignService {
/** /**
* 完成任务 * 完成任务
* *
* @param taskID * @param taskID
* @param variable * @param variable
* @return * @return
...@@ -36,7 +36,7 @@ public interface WorkflowFeignService { ...@@ -36,7 +36,7 @@ public interface WorkflowFeignService {
/** /**
* 查询当前流程下所有的可执行任务 * 查询当前流程下所有的可执行任务
* *
* @param processInstanceId * @param processInstanceId
* @return * @return
*/ */
...@@ -45,13 +45,13 @@ public interface WorkflowFeignService { ...@@ -45,13 +45,13 @@ public interface WorkflowFeignService {
/** /**
* 查询当前任务的执行用户组 * 查询当前任务的执行用户组
* *
* @param processInstanceId * @param processInstanceId
* @return * @return
*/ */
@RequestMapping(value = "/task/getTaskGroupName/{taskId}", method = RequestMethod.GET) @RequestMapping(value = "/task/getTaskGroupName/{taskId}", method = RequestMethod.GET)
JSONObject getTaskGroupName(@PathVariable("taskId") String taskId); JSONObject getTaskGroupName(@PathVariable("taskId") String taskId);
/** /**
* 我的待办 * 我的待办
* @param processDefinitionKey * @param processDefinitionKey
...@@ -74,7 +74,7 @@ public interface WorkflowFeignService { ...@@ -74,7 +74,7 @@ public interface WorkflowFeignService {
* @param processInstanceId * @param processInstanceId
* @return * @return
*/ */
@RequestMapping(value = "/activitiHistory/tasks/{processInstanceId}", method = RequestMethod.GET) @RequestMapping(value = "/activitiHistory/historyTask/{processInstanceId}", method = RequestMethod.GET)
JSONObject queryTasksByProcessInstanceId(@PathVariable("processInstanceId") String processInstanceId); JSONObject queryHistoryTasksByProcessInstanceId(@PathVariable("processInstanceId") String processInstanceId);
} }
...@@ -72,6 +72,9 @@ public class DispatchSaveFeedbackDto extends BaseDto { ...@@ -72,6 +72,9 @@ public class DispatchSaveFeedbackDto extends BaseDto {
@ApiModelProperty(value = "回访时间") @ApiModelProperty(value = "回访时间")
private Date feedbackTime; private Date feedbackTime;
@ApiModelProperty(value = "维修备注")
private String fixRemark;
public DispatchSaveFeedbackDto() { public DispatchSaveFeedbackDto() {
......
package com.yeejoin.amos.boot.module.tzs.api.enums;
/**
* @author kongfm
* @date 2021/8/16.
*/
public class TzsCommonParam {
public static final String SAVE_FEEDBACK_TIME = "save_feedback_time";
public static final String SAVE_FEEDBACK_USER = "save_feedback_user";
public static final String SAVE_FEEDBACK_UID = "save_feedback_uid";
public static final String SAVE_FEEDBACK_RESULT = "save_feedback_result";
public static final String FIX_RESULT = "fix_result";
public static final String ERROR_RESULT = "error_result";
public static final String FIX_REMARK = "fix_remark";
public static final String FIX_FEEDBACK_TIME = "fix_feedback_time";
public static final String FEEDBACK_RESULT = "feedback_result";
public static final String FIX_FEEDBACK_TYPE = "fix_feedback_type";
public static final String FIX_FEEDBACK_UNAME = "fix_feedback_uname";
public static final String FIX_FEEDBACK_UID = "fix_feedback_uid";
public static final String CONSULT_FEEDBACK_TIME = "consult_feedback_time";
public static final String ACTION_RESULT = "action_result";
public static final String CONSULT_FEEDBACK_TYPE = "consult_feedback_type";
public static final String CONSULT_FEEDBACK_UNAME = "consult_feedback_uname";
public static final String CONSULT_FEEDBACK_UID = "consult_feedback_uid";
public static final String MAIN_FEEDBACK_RESULT = "main_feedback_result";
public static final String PQ = "PQ";
public static final String JYHF = "JYHF";
public static final String WXJG = "WXJG";
public static final String GZYY = "GZYY";
public static final String WXFK = "WXFK";
public static final String BXFK = "BXFK";
public static final String FKFS = "FKFS";
public static final String TSRFK = "TSRFK";
public static final String CZJG = "CZJG";
public static final String FKJG = "FKJG";
public static final String WXFK_TS = "WXFK_TS";
public static final String DD = "DD";
public static final String JC = "JC";
}
...@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONArray; ...@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.constants.BizConstant;
import com.yeejoin.amos.boot.biz.common.controller.BaseController; import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.biz.common.utils.EnumsUtils; import com.yeejoin.amos.boot.biz.common.utils.EnumsUtils;
import com.yeejoin.amos.boot.module.common.api.dto.WaterResourceCraneDto; import com.yeejoin.amos.boot.module.common.api.dto.WaterResourceCraneDto;
...@@ -91,19 +92,11 @@ public class WaterResourceController extends BaseController { ...@@ -91,19 +92,11 @@ public class WaterResourceController extends BaseController {
model.setRealityImg(JSONArray.toJSONString(model.getRealityImgList())); model.setRealityImg(JSONArray.toJSONString(model.getRealityImgList()));
model.setOrientationImg(JSONArray.toJSONString(model.getOrientationImgList())); model.setOrientationImg(JSONArray.toJSONString(model.getOrientationImgList()));
if(model.getAddress()!=null){ if(model.getAddress()!=null){
String[] data= model.getAddress().split("@address@"); JSONObject address = WaterResourceServiceImpl.getLongLatFromAddress(model.getAddress());
model.setAddress(data[0]); model.setAddress(address.getString(BizConstant.ADDRESS));
if(data[1]!=null&&!"".equals(data[1])){ model.setLongitude(Double.valueOf(address.getString(BizConstant.LONGITUDE)));
JSONObject jSONObject = JSON.parseObject(data[1]); model.setLatitude(Double.valueOf(address.getString(BizConstant.LATITUDE)));
if(jSONObject.getString("longitude")!=null&&!"".equals(jSONObject.getString("longitude"))) {
model.setLongitude(Double.valueOf(jSONObject.getString("longitude")));
}
if(jSONObject.getString("longitude")!=null&&!"".equals(jSONObject.getString("longitude"))) {
model.setLatitude(Double.valueOf(jSONObject.getString("latitude")));
}
}
} }
if (!StringUtils.isEmpty(resourceType)) { if (!StringUtils.isEmpty(resourceType)) {
...@@ -174,21 +167,13 @@ public class WaterResourceController extends BaseController { ...@@ -174,21 +167,13 @@ public class WaterResourceController extends BaseController {
@ApiOperation(httpMethod = "PUT", value = "根据sequenceNbr更新", notes = "根据sequenceNbr更新") @ApiOperation(httpMethod = "PUT", value = "根据sequenceNbr更新", notes = "根据sequenceNbr更新")
public ResponseModel<WaterResourceDto> updateBySequenceNbrWaterResource(@RequestBody WaterResourceDto model, public ResponseModel<WaterResourceDto> updateBySequenceNbrWaterResource(@RequestBody WaterResourceDto model,
@PathVariable(value = "sequenceNbr") Long sequenceNbr) { @PathVariable(value = "sequenceNbr") Long sequenceNbr) {
if (StringUtils.isNotEmpty(model.getAddress())) {
JSONObject address = WaterResourceServiceImpl.getLongLatFromAddress(model.getAddress());
if(model.getAddress()!=null){ model.setAddress(address.getString(BizConstant.ADDRESS));
String[] data= model.getAddress().split("@address@"); model.setLongitude(Double.valueOf(address.getString(BizConstant.LONGITUDE)));
model.setAddress(data[0]); model.setLatitude(Double.valueOf(address.getString(BizConstant.LATITUDE)));
if(data[1]!=null&&!"".equals(data[1])){ }
JSONObject jSONObject = JSON.parseObject(data[1]);
if(jSONObject.getString("longitude")!=null&&!"".equals(jSONObject.getString("longitude"))) {
model.setLongitude(Double.valueOf(jSONObject.getString("longitude")));
}
if(jSONObject.getString("longitude")!=null&&!"".equals(jSONObject.getString("longitude"))) {
model.setLatitude(Double.valueOf(jSONObject.getString("latitude")));
}
}
}
// 更新基本信息 // 更新基本信息
model.setSequenceNbr(sequenceNbr); model.setSequenceNbr(sequenceNbr);
model.setRealityImg(JSONArray.toJSONString(model.getRealityImgList())); model.setRealityImg(JSONArray.toJSONString(model.getRealityImgList()));
......
...@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; ...@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.yeejoin.amos.boot.biz.common.constants.BizConstant;
import com.yeejoin.amos.boot.biz.common.entity.DataDictionary; 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.service.impl.DataDictionaryServiceImpl;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils; import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
...@@ -26,6 +27,7 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -26,6 +27,7 @@ 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.foundation.utils.Bean; import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.annotation.Condition; import org.typroject.tyboot.core.rdbms.annotation.Condition;
import org.typroject.tyboot.core.rdbms.annotation.Operator; import org.typroject.tyboot.core.rdbms.annotation.Operator;
import org.typroject.tyboot.core.rdbms.service.BaseService; import org.typroject.tyboot.core.rdbms.service.BaseService;
...@@ -124,17 +126,10 @@ public class LinkageUnitServiceImpl extends BaseService<LinkageUnitDto, LinkageU ...@@ -124,17 +126,10 @@ public class LinkageUnitServiceImpl extends BaseService<LinkageUnitDto, LinkageU
public LinkageUnitDto saveModel(LinkageUnitDto linkageUnitDto) { public LinkageUnitDto saveModel(LinkageUnitDto linkageUnitDto) {
if (linkageUnitDto.getAddress() != null) { if (linkageUnitDto.getAddress() != null) {
String[] data = linkageUnitDto.getAddress().split("@address@"); JSONObject address = WaterResourceServiceImpl.getLongLatFromAddress(linkageUnitDto.getAddress());
linkageUnitDto.setAddress(data[0]); linkageUnitDto.setAddress(address.getString(BizConstant.ADDRESS));
if (data[1] != null && !"".equals(data[1])) { linkageUnitDto.setLongitude(Double.valueOf(address.getString(BizConstant.LONGITUDE)));
JSONObject jSONObject = JSON.parseObject(data[1]); linkageUnitDto.setLatitude(Double.valueOf(address.getString(BizConstant.LATITUDE)));
if (jSONObject.getString("longitude") != null && !"".equals(jSONObject.getString("longitude"))) {
linkageUnitDto.setLongitude(Double.valueOf(jSONObject.getString("longitude")));
}
if (jSONObject.getString("longitude") != null && !"".equals(jSONObject.getString("longitude"))) {
linkageUnitDto.setLatitude(Double.valueOf(jSONObject.getString("latitude")));
}
}
} }
// 1.保存行数据 // 1.保存行数据
String groupCode = this.getGroupCode(); String groupCode = this.getGroupCode();
...@@ -178,8 +173,10 @@ public class LinkageUnitServiceImpl extends BaseService<LinkageUnitDto, LinkageU ...@@ -178,8 +173,10 @@ public class LinkageUnitServiceImpl extends BaseService<LinkageUnitDto, LinkageU
.list(new LambdaQueryWrapper<DynamicFormColumn>().eq(DynamicFormColumn::getGroupCode, groupCode)); .list(new LambdaQueryWrapper<DynamicFormColumn>().eq(DynamicFormColumn::getGroupCode, groupCode));
Map<String, Object> fieldCodes = Bean.listToMap(columns, "fieldCode", "queryStrategy", DynamicFormColumn.class); Map<String, Object> fieldCodes = Bean.listToMap(columns, "fieldCode", "queryStrategy", DynamicFormColumn.class);
LinkageUnitDto linkageUnitDto = linkageUnitMapper.selectOne(false, fieldCodes, groupCode, sequenceNbr); LinkageUnitDto linkageUnitDto = linkageUnitMapper.selectOne(false, fieldCodes, groupCode, sequenceNbr);
List<SourceFile> sourceFiles = sourceFileServiceImpl.findBySourceId(linkageUnitDto.getSequenceNbr()); if (!ValidationUtil.isEmpty(linkageUnitDto)) {
linkageUnitDto.setImage(sourceFiles); List<SourceFile> sourceFiles = sourceFileServiceImpl.findBySourceId(linkageUnitDto.getSequenceNbr());
linkageUnitDto.setImage(sourceFiles);
}
return linkageUnitDto; return linkageUnitDto;
} }
...@@ -204,17 +201,10 @@ public class LinkageUnitServiceImpl extends BaseService<LinkageUnitDto, LinkageU ...@@ -204,17 +201,10 @@ public class LinkageUnitServiceImpl extends BaseService<LinkageUnitDto, LinkageU
public LinkageUnitDto updateById(LinkageUnitDto linkageUnitDto) { public LinkageUnitDto updateById(LinkageUnitDto linkageUnitDto) {
if (linkageUnitDto.getAddress() != null) { if (linkageUnitDto.getAddress() != null) {
String[] data = linkageUnitDto.getAddress().split("@address@"); JSONObject address = WaterResourceServiceImpl.getLongLatFromAddress(linkageUnitDto.getAddress());
linkageUnitDto.setAddress(data[0]); linkageUnitDto.setAddress(address.getString(BizConstant.ADDRESS));
if (data[1] != null && !"".equals(data[1])) { linkageUnitDto.setLongitude(Double.valueOf(address.getString(BizConstant.LONGITUDE)));
JSONObject jSONObject = JSON.parseObject(data[1]); linkageUnitDto.setLatitude(Double.valueOf(address.getString(BizConstant.LATITUDE)));
if (jSONObject.getString("longitude") != null && !"".equals(jSONObject.getString("longitude"))) {
linkageUnitDto.setLongitude(Double.valueOf(jSONObject.getString("longitude")));
}
if (jSONObject.getString("longitude") != null && !"".equals(jSONObject.getString("longitude"))) {
linkageUnitDto.setLatitude(Double.valueOf(jSONObject.getString("latitude")));
}
}
} }
// 修改基本信息 // 修改基本信息
updateWithModel(linkageUnitDto); updateWithModel(linkageUnitDto);
......
...@@ -6,7 +6,10 @@ import java.util.Optional; ...@@ -6,7 +6,10 @@ import java.util.Optional;
import javax.annotation.Resource; import javax.annotation.Resource;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.yeejoin.amos.boot.biz.common.constants.BizConstant;
import com.yeejoin.amos.boot.biz.common.utils.MenuFrom; import com.yeejoin.amos.boot.biz.common.utils.MenuFrom;
import com.yeejoin.amos.boot.module.common.api.dto.*; import com.yeejoin.amos.boot.module.common.api.dto.*;
import com.yeejoin.amos.boot.module.common.api.entity.*; import com.yeejoin.amos.boot.module.common.api.entity.*;
...@@ -235,4 +238,31 @@ public class WaterResourceServiceImpl extends BaseService<WaterResourceDto, Wate ...@@ -235,4 +238,31 @@ public class WaterResourceServiceImpl extends BaseService<WaterResourceDto, Wate
public List<WaterResourceTypeDto> getWaterResourceTypeList(Boolean isDelete) { public List<WaterResourceTypeDto> getWaterResourceTypeList(Boolean isDelete) {
return waterResourceMapper.getWaterResourceTypeList(isDelete); return waterResourceMapper.getWaterResourceTypeList(isDelete);
} }
public static JSONObject getLongLatFromAddress(String address) {
JSONObject result = new JSONObject();
result.put(BizConstant.ADDRESS, "");
result.put(BizConstant.LONGITUDE, "0");
result.put(BizConstant.LATITUDE, "0");
if (StringUtils.isNotEmpty(address)) {
String[] addressData = address.split("@address@");
if (addressData.length > 1) {
result.put(BizConstant.ADDRESS, addressData[0]);
JSONObject langLatObj = JSON.parseObject(addressData[1]);
if (StringUtils.isNotEmpty(langLatObj.getString(BizConstant.LONGITUDE))) {
result.put(BizConstant.LONGITUDE, langLatObj.getString(BizConstant.LONGITUDE));
} else {
result.put(BizConstant.LONGITUDE, "0");
}
if (StringUtils.isNotEmpty(langLatObj.getString(BizConstant.LATITUDE))) {
result.put(BizConstant.LATITUDE, langLatObj.getString(BizConstant.LATITUDE));
} else {
result.put(BizConstant.LATITUDE, "0");
}
} else {
result.put(BizConstant.ADDRESS, addressData[0]);
}
}
return result;
}
} }
...@@ -8,12 +8,20 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; ...@@ -8,12 +8,20 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.google.common.collect.Maps; import com.google.common.collect.Maps;
import com.yeejoin.amos.boot.biz.common.constants.BizConstant;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils; import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey; import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils; import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.common.api.dto.FormValue; import com.yeejoin.amos.boot.module.common.api.dto.FormValue;
import com.yeejoin.amos.boot.module.common.api.dto.RequestData; import com.yeejoin.amos.boot.module.common.api.dto.RequestData;
import com.yeejoin.amos.boot.module.jcs.api.dto.*; import com.yeejoin.amos.boot.module.common.biz.service.impl.WaterResourceServiceImpl;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledFormDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledObjsDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledTodyDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledZhDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.KeyValueLabel;
import com.yeejoin.amos.boot.module.jcs.api.dto.PowerData;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertCalled; import com.yeejoin.amos.boot.module.jcs.api.entity.AlertCalled;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertFormValue; import com.yeejoin.amos.boot.module.jcs.api.entity.AlertFormValue;
import com.yeejoin.amos.boot.module.jcs.api.entity.Template; import com.yeejoin.amos.boot.module.jcs.api.entity.Template;
...@@ -32,415 +40,393 @@ import org.springframework.stereotype.Service; ...@@ -32,415 +40,393 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.typroject.tyboot.component.emq.EmqKeeper; import org.typroject.tyboot.component.emq.EmqKeeper;
import org.typroject.tyboot.core.foundation.utils.Bean; import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.foundation.utils.StringUtil;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil; import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.service.BaseService; import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import javax.annotation.Resource; import java.util.ArrayList;
import java.util.*; import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.function.Function; import java.util.function.Function;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
* 警情接警记录 服务实现类 * 警情接警记录 服务实现类
* *
* @author tb * @author tb
* @date 2021-06-17 * @date 2021-06-17
*/ */
@Service @Service
public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCalled,AlertCalledMapper> implements IAlertCalledService { public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCalled, AlertCalledMapper> implements IAlertCalledService {
@Autowired
RedisUtils redisUtils;
@Autowired
AlertCalledMapper alertCalledMapper;
@Autowired
private AlertFormValueServiceImpl iAlertFormValueService;
@Autowired @Autowired
private ESAlertCalledService eSAlertCalledService; RedisUtils redisUtils;
@Autowired
AlertCalledMapper alertCalledMapper;
@Autowired @Autowired
RuleAlertCalledService ruleAlertCalledService; RuleAlertCalledService ruleAlertCalledService;
@Autowired
@Autowired TemplateMapper templateMapper;
private EmqKeeper emqKeeper; @Autowired
PowerTransferMapper powerTransferMapper;
@Value("${mqtt.topic.command.alert.notice}") @Autowired
private String topic; AlertSubmittedMapper alertSubmittedMapper;
@Autowired
@Value("${redis.cache.failure.time}") private AlertFormValueServiceImpl iAlertFormValueService;
private long time; @Autowired
private ESAlertCalledService eSAlertCalledService;
@Autowired @Autowired
TemplateMapper templateMapper; private EmqKeeper emqKeeper;
@Autowired @Value("${mqtt.topic.command.alert.notice}")
PowerTransferMapper powerTransferMapper; private String topic;
@Autowired @Value("${redis.cache.failure.time}")
AlertSubmittedMapper alertSubmittedMapper; private long time;
/**
* private static int comparingByGroupVal(Map<String, Object> map, Map<String, Object> map2, String key) {
* 指挥系统 未结束的警情列表 int result = 0;
* if (map.get(key) instanceof Date) {
* **/ long r1 = ((Date) map.get(key)).getTime();
@Override long r2 = ((Date) map2.get(key)).getTime();
public List<AlertCalledZhDto> alertCalledListByAlertStatus( Integer pageNum, Integer pageSize,RequestData par) { result = Long.compare(r1, r2);
}
List<AlertCalledZhDto> list = alertCalledMapper.alertCalledListByAlertStatus( pageNum, pageSize,par); return result;
return list; }
} /**
* 指挥系统 未结束的警情列表
@Override **/
public int alertCalledListByAlertStatusCount(RequestData par) { @Override
return alertCalledMapper.alertCalledListByAlertStatusCount(par); public List<AlertCalledZhDto> alertCalledListByAlertStatus(Integer pageNum, Integer pageSize, RequestData par) {
}
List<AlertCalledZhDto> list = alertCalledMapper.alertCalledListByAlertStatus(pageNum, pageSize, par);
/** return list;
*
* 根据灾情id 查询灾情详情 }
*
* **/ @Override
@Override public int alertCalledListByAlertStatusCount(RequestData par) {
public Object selectAlertCalledById(Long id) { return alertCalledMapper.alertCalledListByAlertStatusCount(par);
if(redisUtils.hasKey(RedisKey.ALERTCALLED_ID+id)){ }
Object obj= redisUtils.get(RedisKey.ALERTCALLED_ID+id);
return obj; /**
}else{ * 根据灾情id 查询灾情详情
// 警情基本信息 **/
AlertCalled alertCalled = this.getById(id); @Override
QueryWrapper<AlertFormValue> queryWrapper = new QueryWrapper<>(); public Object selectAlertCalledById(Long id) {
queryWrapper.eq("alert_called_id", id); if (redisUtils.hasKey(RedisKey.ALERTCALLED_ID + id)) {
// 警情动态表单数据 Object obj = redisUtils.get(RedisKey.ALERTCALLED_ID + id);
List<AlertFormValue> list = iAlertFormValueService.list(queryWrapper); return obj;
List<FormValue> formValue = new ArrayList<FormValue>(); } else {
if(list!=null&&list.size()>0) { // 警情基本信息
for (AlertFormValue alertFormValue : list) { AlertCalled alertCalled = this.getById(id);
FormValue value = new FormValue(alertFormValue.getFieldCode(), alertFormValue.getFieldName(), "text", alertFormValue.getFieldValue(),alertFormValue.getBlock()); QueryWrapper<AlertFormValue> queryWrapper = new QueryWrapper<>();
formValue.add(value); queryWrapper.eq("alert_called_id", id);
} // 警情动态表单数据
} List<AlertFormValue> list = iAlertFormValueService.list(queryWrapper);
AlertCalledFormDto alertCalledFormVo = new AlertCalledFormDto(alertCalled, formValue); List<FormValue> formValue = new ArrayList<FormValue>();
if (list != null && list.size() > 0) {
redisUtils.set(RedisKey.ALERTCALLED_ID+id, JSON.toJSON(alertCalledFormVo),time); for (AlertFormValue alertFormValue : list) {
return alertCalledFormVo; FormValue value = new FormValue(alertFormValue.getFieldCode(), alertFormValue.getFieldName(), "text", alertFormValue.getFieldValue(), alertFormValue.getBlock());
} formValue.add(value);
} }
}
/** AlertCalledFormDto alertCalledFormVo = new AlertCalledFormDto(alertCalled, formValue);
*
* <pre> redisUtils.set(RedisKey.ALERTCALLED_ID + id, JSON.toJSON(alertCalledFormVo), time);
* 保存警情信息 return alertCalledFormVo;
* </pre> }
* }
* @param alertCalledObjsDto
* @return /**
*/ * <pre>
@Transactional(rollbackFor = RuntimeException.class) * 保存警情信息
public AlertCalledObjsDto createAlertCalled(AlertCalledObjsDto alertCalledObjsDto) { * </pre>
try { *
// 警情基本信息 * @param alertCalledObjsDto
* @return
*/
AlertCalled alertCalled = alertCalledObjsDto.getAlertCalled(); @Transactional(rollbackFor = RuntimeException.class)
if(alertCalled.getAddress()!=null){ public AlertCalledObjsDto createAlertCalled(AlertCalledObjsDto alertCalledObjsDto) {
try {
String[] data= alertCalled.getAddress().split("@address@"); // 警情基本信息
alertCalled.setAddress(data[0]); AlertCalled alertCalled = alertCalledObjsDto.getAlertCalled();
if(data[1]!=null&&!"".equals(data[1])){ if (alertCalled.getAddress() != null) {
JSONObject jSONObject = JSON.parseObject(data[1]); JSONObject address = WaterResourceServiceImpl.getLongLatFromAddress(alertCalled.getAddress());
if(jSONObject.getString("longitude")!=null&&!"".equals(jSONObject.getString("longitude"))) { alertCalled.setAddress(address.getString(BizConstant.ADDRESS));
alertCalled.setCoordinateX(Double.valueOf(jSONObject.getString("longitude"))); alertCalled.setCoordinateX(Double.valueOf(address.getString(BizConstant.LONGITUDE)));
} alertCalled.setCoordinateY(Double.valueOf(address.getString(BizConstant.LATITUDE)));
if(jSONObject.getString("longitude")!=null&&!"".equals(jSONObject.getString("longitude"))) { }
alertCalled.setCoordinateY(Double.valueOf(jSONObject.getString("latitude"))); alertCalled.setCallTime(new Date());
} if (AlertStageEnums.RG.getValue().equals(alertCalled.getAlertSourceCode()) ||
AlertStageEnums.RG.getValue().equals(alertCalled.getAlertSourceCode())) {
alertCalled.setType("0");
} } else {
} alertCalled.setType("1");
alertCalled.setCallTime(new Date()); }
if(AlertStageEnums.RG.getValue().equals(alertCalled.getAlertSourceCode())||
AlertStageEnums.RG.getValue().equals(alertCalled.getAlertSourceCode())){ // 判断是否归并警情
alertCalled.setType("0"); if (alertCalled.getFatherAlert() != null) {
}else { // 警情归并,设置当前警情状态为结束。
alertCalled.setType("1"); alertCalled.setAlertStatus(true);
} alertCalled.setAlertStage(AlertStageEnums.JQJB.getValue());
alertCalled.setAlarmType(AlertStageEnums.JQGB.getValue());
// 判断是否归并警情 alertCalled.setAlarmTypeCode(AlertStageEnums.JQGB.getCode());
if (alertCalled.getFatherAlert() != null) { this.save(alertCalled);
// 警情归并,设置当前警情状态为结束。 // 动态表单
alertCalled.setAlertStatus(true); List<AlertFormValue> alertFormValuelist = alertCalledObjsDto.getAlertFormValue();
alertCalled.setAlertStage(AlertStageEnums.JQJB.getValue()); // 填充警情主键
alertCalled.setAlarmType(AlertStageEnums.JQGB.getValue()); alertFormValuelist.stream().forEach(alertFormValue -> {
alertCalled.setAlarmTypeCode(AlertStageEnums.JQGB.getCode()); alertFormValue.setAlertCalledId(alertCalled.getSequenceNbr());
this.save(alertCalled); alertFormValue.setAlertTypeCode(alertCalled.getAlertTypeCode());
// 动态表单 });
List<AlertFormValue> alertFormValuelist = alertCalledObjsDto.getAlertFormValue(); // 保存动态表单数据
// 填充警情主键 iAlertFormValueService.saveBatch(alertFormValuelist);
alertFormValuelist.stream().forEach(alertFormValue -> { } else {
alertFormValue.setAlertCalledId(alertCalled.getSequenceNbr()); // 警情报送
alertFormValue.setAlertTypeCode(alertCalled.getAlertTypeCode()); // ****************************************************待确认开发
}); alertCalled.setAlertStatus(false);
// 保存动态表单数据 alertCalled.setIsDelete(false);
iAlertFormValueService.saveBatch(alertFormValuelist); alertCalled.setAlertStage(AlertStageEnums.LLDP.getValue());
} else { alertCalled.setAlarmType(AlertStageEnums.JQCB.getValue());
// 警情报送 alertCalled.setAlarmTypeCode(AlertStageEnums.JQCB.getCode());
// ****************************************************待确认开发 this.save(alertCalled);
alertCalled.setAlertStatus(false);
alertCalled.setIsDelete(false); // 动态表单
alertCalled.setAlertStage(AlertStageEnums.LLDP.getValue()); List<AlertFormValue> alertFormValuelist = alertCalledObjsDto.getAlertFormValue();
alertCalled.setAlarmType(AlertStageEnums.JQCB.getValue()); // 填充警情主键
alertCalled.setAlarmTypeCode(AlertStageEnums.JQCB.getCode()); alertFormValuelist.stream().forEach(alertFormValue -> {
this.save(alertCalled); alertFormValue.setAlertCalledId(alertCalled.getSequenceNbr());
alertFormValue.setAlertTypeCode(alertCalled.getAlertTypeCode());
// 动态表单 });
List<AlertFormValue> alertFormValuelist = alertCalledObjsDto.getAlertFormValue(); // 保存动态表单数据
// 填充警情主键 iAlertFormValueService.saveBatch(alertFormValuelist);
alertFormValuelist.stream().forEach(alertFormValue -> { alertCalledObjsDto.setAlertCalled(alertCalled);
alertFormValue.setAlertCalledId(alertCalled.getSequenceNbr()); alertCalledObjsDto.setAlertFormValue(alertFormValuelist);
alertFormValue.setAlertTypeCode(alertCalled.getAlertTypeCode()); //调用规则
}); ruleAlertCalledService.fireAlertCalledRule(alertCalledObjsDto);
// 保存动态表单数据 //通知实战指挥页面发送mqtt 默认发送 String 类型 0, 新警情 1 警情状态变化
iAlertFormValueService.saveBatch(alertFormValuelist); emqKeeper.getMqttClient().publish(topic, "0".getBytes(), RuleConfig.DEFAULT_QOS, true);
alertCalledObjsDto.setAlertCalled(alertCalled);
alertCalledObjsDto.setAlertFormValue(alertFormValuelist); }
//调用规则
ruleAlertCalledService.fireAlertCalledRule(alertCalledObjsDto);
//通知实战指挥页面发送mqtt 默认发送 String 类型 0, 新警情 1 警情状态变化 /**
emqKeeper.getMqttClient().publish(topic, "0".getBytes(), RuleConfig.DEFAULT_QOS, true); * 同步保存ES
*/
} eSAlertCalledService.saveAlertCalledToES(alertCalled);
return alertCalledObjsDto;
/** } catch (Exception e) {
* 同步保存ES e.printStackTrace();
*/ throw new RuntimeException("报送失败,系统异常!");
eSAlertCalledService.saveAlertCalledToES(alertCalled); }
}
return alertCalledObjsDto;
} catch (Exception e) { /**
e.printStackTrace(); * 根据id 修改警情
throw new RuntimeException("报送失败,系统异常!"); * type:警情相关 操作类型 0警情续报 1非警情确认 2 警情结案
} */
} @Override
@Transactional(rollbackFor = RuntimeException.class)
public boolean updateAlertCalled(Long id, String code) {
/** // TODO Auto-generated method stub
* 根据id 修改警情 try {
* type:警情相关 操作类型 0警情续报 1非警情确认 2 警情结案 switch (code) {
* case "314":
*/ alertCalledMapper.update(null, new UpdateWrapper<AlertCalled>().eq("sequence_nbr", id)
@Override .set("alert_status", 1).set("alert_stage", AlertStageEnums.ZBQJ.getValue()).set("alarm_type", AlertStageEnums.FJQ.getValue()).set("alarm_type_code", AlertStageEnums.FJQ.getCode()));
@Transactional(rollbackFor = RuntimeException.class) break;
public boolean updateAlertCalled(Long id, String code) { case "315":
// TODO Auto-generated method stub alertCalledMapper.update(null, new UpdateWrapper<AlertCalled>().eq("sequence_nbr", id)
try { .set("alert_status", 1).set("alert_stage", AlertStageEnums.CZJS.getValue()));
switch (code) { break;
case "314": default:
alertCalledMapper.update(null, new UpdateWrapper<AlertCalled>().eq("sequence_nbr", id) alertCalledMapper.update(null, new UpdateWrapper<AlertCalled>().eq("sequence_nbr", id)
.set("alert_status", 1).set("alert_stage", AlertStageEnums.ZBQJ.getValue()).set("alarm_type", AlertStageEnums.FJQ.getValue()).set("alarm_type_code", AlertStageEnums.FJQ.getCode())); .set("alert_stage", AlertStageEnums.CZGZ.getValue()));
break;
case "315": break;
alertCalledMapper.update(null, new UpdateWrapper<AlertCalled>().eq("sequence_nbr", id) }
.set("alert_status", 1).set("alert_stage", AlertStageEnums.CZJS.getValue()));
break; AlertCalled alertCalled = this.getById(id);
default: //删除缓存
alertCalledMapper.update(null, new UpdateWrapper<AlertCalled>().eq("sequence_nbr", id) redisUtils.del(RedisKey.ALERTCALLED_ID + id);
.set("alert_stage", AlertStageEnums.CZGZ.getValue())); /**
* 同步更新存ES
break; */
} eSAlertCalledService.saveAlertCalledToES(alertCalled);
AlertCalled alertCalled = this.getById(id); //通知实战指挥页面发送mqtt 默认发送 String 类型 0新警情, 1警情状态变化
//删除缓存 emqKeeper.getMqttClient().publish(topic, "1".getBytes(), RuleConfig.DEFAULT_QOS, true);
redisUtils.del(RedisKey.ALERTCALLED_ID + id);
/** return true;
* 同步更新存ES } catch (Exception e) {
*/ throw new RuntimeException("系统异常!");
eSAlertCalledService.saveAlertCalledToES(alertCalled); }
}
//通知实战指挥页面发送mqtt 默认发送 String 类型 0新警情, 1警情状态变化
emqKeeper.getMqttClient().publish(topic, "1".getBytes(), RuleConfig.DEFAULT_QOS, true); /**
* 根据时间区间查询警情列表信息
return true; *
} catch (Exception e) { * @param beginDate 开始时间
throw new RuntimeException("系统异常!"); * @param endDate 结束时间
} */
} public List<Map<String, Object>> listByDateRange(String beginDate, String endDate) {
// 查询指定日期内的警情列表
private static int comparingByGroupVal(Map<String, Object> map, Map<String, Object> map2, String key) {
int result = 0; List<AlertCalled> alertCalledList =
if (map.get(key) instanceof Date) {
long r1 = ((Date) map.get(key)).getTime();
long r2 = ((Date) map2.get(key)).getTime();
result = Long.compare(r1, r2);
}
return result;
}
/**
* 根据时间区间查询警情列表信息
*
* @param beginDate 开始时间
* @param endDate 结束时间
*/
public List<Map<String, Object>> listByDateRange(String beginDate, String endDate) {
// 查询指定日期内的警情列表
List<AlertCalled> alertCalledList =
this.list(new LambdaQueryWrapper<AlertCalled>().apply(!ValidationUtil.isEmpty(beginDate), this.list(new LambdaQueryWrapper<AlertCalled>().apply(!ValidationUtil.isEmpty(beginDate),
"call_time >= '" + beginDate + "'").le(true, AlertCalled::getCallTime, endDate)); "call_time >= '" + beginDate + "'").le(true, AlertCalled::getCallTime, endDate));
Map<String, String> queryParams = Maps.newHashMap(); Map<String, String> queryParams = Maps.newHashMap();
queryParams.put("beginDate", beginDate); queryParams.put("beginDate", beginDate);
queryParams.put("endDate", endDate); queryParams.put("endDate", endDate);
List<Map<String, Object>> allList = Lists.newArrayList(); List<Map<String, Object>> allList = Lists.newArrayList();
if (!ValidationUtil.isEmpty(alertCalledList)) { if (!ValidationUtil.isEmpty(alertCalledList)) {
Map<String, List<AlertCalled>> alertCalledMap = Map<String, List<AlertCalled>> alertCalledMap =
alertCalledList.stream().collect(Collectors.groupingBy(AlertCalled::getAlertTypeCode)); alertCalledList.stream().collect(Collectors.groupingBy(AlertCalled::getAlertTypeCode));
Map<Long, AlertCalled> calledMap = Map<Long, AlertCalled> calledMap =
alertCalledList.stream().collect(Collectors.toMap(AlertCalled::getSequenceNbr, Function.identity())); alertCalledList.stream().collect(Collectors.toMap(AlertCalled::getSequenceNbr, Function.identity()));
alertCalledMap.forEach((alertTypeCode, list) -> { alertCalledMap.forEach((alertTypeCode, list) -> {
allList.addAll(iAlertFormValueService.listAll(alertTypeCode, queryParams)); allList.addAll(iAlertFormValueService.listAll(alertTypeCode, queryParams));
}); });
allList.forEach(i -> { allList.forEach(i -> {
AlertCalled alertCalled = calledMap.get(Long.parseLong(i.get("instanceId").toString())); AlertCalled alertCalled = calledMap.get(Long.parseLong(i.get("instanceId").toString()));
i.putAll(Bean.BeantoMap(alertCalled)); i.putAll(Bean.BeantoMap(alertCalled));
}); });
} }
// 按接警时间正序排序 // 按接警时间正序排序
allList.sort((e, o) -> comparingByGroupVal(e, o, "callTime")); allList.sort((e, o) -> comparingByGroupVal(e, o, "callTime"));
return allList; return allList;
} }
public Map<String, Object> getAlertInfoList(String beginDate, String endDate) { public Map<String, Object> getAlertInfoList(String beginDate, String endDate) {
Map<String, Object> result = Maps.newHashMap(); Map<String, Object> result = Maps.newHashMap();
List<Map<String, Object>> list = listByDateRange(beginDate, endDate); List<Map<String, Object>> list = listByDateRange(beginDate, endDate);
// 获取接警情况模板 // 获取接警情况模板
List<Template> templateList = List<Template> templateList =
templateMapper.selectList(new LambdaQueryWrapper<Template>().eq(Template::getFormat, false).like(Template::getTypeCode, templateMapper.selectList(new LambdaQueryWrapper<Template>().eq(Template::getFormat, false).like(Template::getTypeCode,
DutyInfoEnum.接警情况.getKey() + "-")); DutyInfoEnum.接警情况.getKey() + "-"));
Map<String, Template> templateMap = templateList.stream().collect(Collectors.toMap(Template::getTypeCode, Map<String, Template> templateMap = templateList.stream().collect(Collectors.toMap(Template::getTypeCode,
Function.identity())); Function.identity()));
List<String> contentList = Lists.newArrayList(); List<String> contentList = Lists.newArrayList();
list.forEach(i -> { list.forEach(i -> {
String tempContent = String tempContent =
templateMap.get(DutyInfoEnum.接警情况.getKey() + "-" + i.get("alertTypeCode")).getContent(); templateMap.get(DutyInfoEnum.接警情况.getKey() + "-" + i.get("alertTypeCode")).getContent();
contentList.add(replaceTemplate(tempContent, i)); contentList.add(replaceTemplate(tempContent, i));
}); });
Map<String, Integer> statusCountMap = alertCalledMapper.queryAlertStatusCount(beginDate, endDate); Map<String, Integer> statusCountMap = alertCalledMapper.queryAlertStatusCount(beginDate, endDate);
Integer unFinishedCount = Integer unFinishedCount =
this.count(new LambdaQueryWrapper<AlertCalled>().eq(AlertCalled::getAlertStatus, "0")); this.count(new LambdaQueryWrapper<AlertCalled>().eq(AlertCalled::getAlertStatus, "0"));
result.put("alertInfoList", contentList); result.put("alertInfoList", contentList);
result.putAll(statusCountMap); result.putAll(statusCountMap);
result.put("unFinishedCount", unFinishedCount); result.put("unFinishedCount", unFinishedCount);
return result; return result;
} }
/** /**
* 替换模板 * 替换模板
* *
* @param tempContent 模板 * @param tempContent 模板
* @param objMap 对象map * @param objMap 对象map
* @return * @return
*/ */
private String replaceTemplate(String tempContent, Map<String, Object> objMap) { private String replaceTemplate(String tempContent, Map<String, Object> objMap) {
int size = objMap.size(); int size = objMap.size();
String[] keys = objMap.keySet().toArray(new String[size]); String[] keys = objMap.keySet().toArray(new String[size]);
Object[] values = objMap.values().toArray(new Object[size]); Object[] values = objMap.values().toArray(new Object[size]);
List<String> strList = Lists.newArrayList(); List<String> strList = Lists.newArrayList();
for (Object obj : values) { for (Object obj : values) {
if (!ValidationUtil.isEmpty(obj)) { if (!ValidationUtil.isEmpty(obj)) {
if (obj instanceof Date) { if (obj instanceof Date) {
obj = DateUtils.date2LongStr((Date) obj); obj = DateUtils.date2LongStr((Date) obj);
} }
strList.add(obj.toString()); strList.add(obj.toString());
} else { } else {
strList.add(""); strList.add("");
} }
} }
return StringUtils.replaceEach(tempContent, keys, strList.toArray(new String[strList.size()])); return StringUtils.replaceEach(tempContent, keys, strList.toArray(new String[strList.size()]));
} }
@Override
public Map<String,Object> selectAlertCalledKeyValueLabelById(Long id) { @Override
public Map<String, Object> selectAlertCalledKeyValueLabelById(Long id) {
// 警情基本信息
AlertCalled alertCalled = this.getById(id); // 警情基本信息
QueryWrapper<AlertFormValue> queryWrapper = new QueryWrapper<>(); AlertCalled alertCalled = this.getById(id);
Map<String,Object> map=new HashMap(); QueryWrapper<AlertFormValue> queryWrapper = new QueryWrapper<>();
map.put("title","【"+alertCalled.getAlertType()+"】"+alertCalled.getAddress()); Map<String, Object> map = new HashMap();
queryWrapper.eq("alert_called_id", id); map.put("title", "【" + alertCalled.getAlertType() + "】" + alertCalled.getAddress());
// 警情动态表单数据 queryWrapper.eq("alert_called_id", id);
List<KeyValueLabel> listdate =new ArrayList<>(); // 警情动态表单数据
List<AlertFormValue> list = iAlertFormValueService.list(queryWrapper); List<KeyValueLabel> listdate = new ArrayList<>();
listdate.add(new KeyValueLabel("接警时间","callTime",alertCalled.getCallTime())); List<AlertFormValue> list = iAlertFormValueService.list(queryWrapper);
listdate.add(new KeyValueLabel("警情地点","address",alertCalled.getAddress())); listdate.add(new KeyValueLabel("接警时间", "callTime", alertCalled.getCallTime()));
listdate.add(new KeyValueLabel("警情类型","alertType",alertCalled.getAlertType())); listdate.add(new KeyValueLabel("警情地点", "address", alertCalled.getAddress()));
listdate.add(new KeyValueLabel("警情阶段","alertStage",alertCalled.getAlertStage())); listdate.add(new KeyValueLabel("警情类型", "alertType", alertCalled.getAlertType()));
listdate.add(new KeyValueLabel("警情等级","responseLevel","无")); listdate.add(new KeyValueLabel("警情阶段", "alertStage", alertCalled.getAlertStage()));
listdate.add(new KeyValueLabel("被困人数","trappedNum",alertCalled.getTrappedNum())); listdate.add(new KeyValueLabel("警情等级", "responseLevel", "无"));
listdate.add(new KeyValueLabel("伤亡人数","casualtiesNum",alertCalled.getCasualtiesNum())); listdate.add(new KeyValueLabel("被困人数", "trappedNum", alertCalled.getTrappedNum()));
listdate.add(new KeyValueLabel("联系人","contactUser",alertCalled.getContactUser())); listdate.add(new KeyValueLabel("伤亡人数", "casualtiesNum", alertCalled.getCasualtiesNum()));
listdate.add(new KeyValueLabel("联系电话","contactPhone",alertCalled.getContactPhone())); listdate.add(new KeyValueLabel("联系人", "contactUser", alertCalled.getContactUser()));
listdate.add(new KeyValueLabel("联系人电话","contactPhone",alertCalled.getContactPhone())); listdate.add(new KeyValueLabel("联系电话", "contactPhone", alertCalled.getContactPhone()));
list.stream().forEach(AlertFormValue->{ listdate.add(new KeyValueLabel("联系人电话", "contactPhone", alertCalled.getContactPhone()));
listdate.add(new KeyValueLabel(AlertFormValue.getFieldName(),AlertFormValue.getFieldCode(), AlertFormValue.getFieldValue())); list.stream().forEach(AlertFormValue -> {
}); listdate.add(new KeyValueLabel(AlertFormValue.getFieldName(), AlertFormValue.getFieldCode(), AlertFormValue.getFieldValue()));
map.put("data",listdate); });
return map; map.put("data", listdate);
return map;
}
@Override }
public List<KeyValueLabel> selectAlertCalledcount(Long id) {
// 警情基本信息 @Override
AlertCalled alertCalled = this.getById(id); public List<KeyValueLabel> selectAlertCalledcount(Long id) {
// 警情基本信息
List<KeyValueLabel> listdate =new ArrayList<>(); AlertCalled alertCalled = this.getById(id);
listdate.add(new KeyValueLabel("被困人数","trappedNum",alertCalled.getTrappedNum()));
listdate.add(new KeyValueLabel("伤亡人数","casualtiesNum",alertCalled.getCasualtiesNum())); List<KeyValueLabel> listdate = new ArrayList<>();
return listdate; listdate.add(new KeyValueLabel("被困人数", "trappedNum", alertCalled.getTrappedNum()));
} listdate.add(new KeyValueLabel("伤亡人数", "casualtiesNum", alertCalled.getCasualtiesNum()));
return listdate;
@Override }
public List<KeyValueLabel> powercount(Long id) {
Map<String,Integer> map=powerTransferMapper.getCarNum(id); @Override
public List<KeyValueLabel> powercount(Long id) {
Map<String, Integer> map = powerTransferMapper.getCarNum(id);
// Map<String,Integer> mapc=powerTransferMapper.getCompanyNum(id); // Map<String,Integer> mapc=powerTransferMapper.getCompanyNum(id);
// Map<String,Integer> mapu= alertSubmittedMapper.getUseNum(id); // Map<String,Integer> mapu= alertSubmittedMapper.getUseNum(id);
//统计参与人员 //统计参与人员
List<KeyValueLabel> listdate =new ArrayList<>(); List<KeyValueLabel> listdate = new ArrayList<>();
listdate.add(new KeyValueLabel("调动人力","useNum","0","人")); listdate.add(new KeyValueLabel("调动人力", "useNum", "0", "人"));
//统计参与车辆 //统计参与车辆
listdate.add(new KeyValueLabel("调动人力","carNum",map.get("carNum"),"辆")); listdate.add(new KeyValueLabel("调动人力", "carNum", map.get("carNum"), "辆"));
//统计参与队伍 //统计参与队伍
listdate.add(new KeyValueLabel("调动单位","companyNum",map.get("companyNum"),"个")); listdate.add(new KeyValueLabel("调动单位", "companyNum", map.get("companyNum"), "个"));
return listdate; return listdate;
} }
@Override @Override
public List<PowerData> getPowerDataList(Long id) { public List<PowerData> getPowerDataList(Long id) {
List<PowerData> list=powerTransferMapper.getPowerDataList(id); List<PowerData> list = powerTransferMapper.getPowerDataList(id);
return list; return list;
} }
@Override @Override
public AlertCalled getAlertCalledById(Long id) { public AlertCalled getAlertCalledById(Long id) {
return this.getById(id); return this.getById(id);
} }
@Override @Override
public Integer AlertCalledcountTime(int type) { public Integer AlertCalledcountTime(int type) {
return alertCalledMapper.AlertCalledcountTime(type); return alertCalledMapper.AlertCalledcountTime(type);
} }
@Override @Override
public List<AlertCalledTodyDto> getTodayAlertCalled() { public List<AlertCalledTodyDto> getTodayAlertCalled() {
return alertCalledMapper.getTodayAlertCalled(); return alertCalledMapper.getTodayAlertCalled();
} }
} }
...@@ -1052,7 +1052,14 @@ public class CheckServiceImpl implements ICheckService { ...@@ -1052,7 +1052,14 @@ public class CheckServiceImpl implements ICheckService {
@Override @Override
public Map<String, Object> getCheckDetail(String id) { public Map<String, Object> getCheckDetail(String id) {
return checkMapper.getCheckDetail(id); Map<String, Object> map = checkMapper.getCheckDetail(id);
if (map.containsKey("isOk")) {
map.put("status", CheckStatusEnum.getEnum(String.valueOf(map.get("isOk"))).getName());
}
if (map.containsKey("picture")) {
map.put("picture", fileUrl + map.get("picture"));
}
return map;
} }
@Override @Override
......
...@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; ...@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
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.entity.DataDictionary;
import com.yeejoin.amos.boot.biz.common.service.impl.DataDictionaryServiceImpl; import com.yeejoin.amos.boot.biz.common.service.impl.DataDictionaryServiceImpl;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
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.AlertCalledFormDto; import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledFormDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertFormInitDto; import com.yeejoin.amos.boot.module.tzs.api.dto.AlertFormInitDto;
...@@ -20,6 +21,7 @@ import com.yeejoin.amos.boot.module.tzs.api.entity.Elevator; ...@@ -20,6 +21,7 @@ import com.yeejoin.amos.boot.module.tzs.api.entity.Elevator;
import com.yeejoin.amos.boot.module.tzs.api.entity.MaintenanceUnit; import com.yeejoin.amos.boot.module.tzs.api.entity.MaintenanceUnit;
import com.yeejoin.amos.boot.module.tzs.api.enums.AlertStageEnums; import com.yeejoin.amos.boot.module.tzs.api.enums.AlertStageEnums;
import com.yeejoin.amos.boot.module.tzs.api.enums.DispatchPaperEnums; import com.yeejoin.amos.boot.module.tzs.api.enums.DispatchPaperEnums;
import com.yeejoin.amos.boot.module.tzs.api.enums.TzsCommonParam;
import com.yeejoin.amos.boot.module.tzs.api.mapper.DispatchPaperMapper; import com.yeejoin.amos.boot.module.tzs.api.mapper.DispatchPaperMapper;
import com.yeejoin.amos.boot.module.tzs.api.service.IDispatchPaperService; import com.yeejoin.amos.boot.module.tzs.api.service.IDispatchPaperService;
import com.yeejoin.amos.boot.module.tzs.api.service.IMaintenanceUnitService; import com.yeejoin.amos.boot.module.tzs.api.service.IMaintenanceUnitService;
...@@ -31,11 +33,11 @@ import org.springframework.transaction.annotation.Transactional; ...@@ -31,11 +33,11 @@ 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 java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* 派遣单服务实现类 * 派遣单服务实现类
...@@ -199,7 +201,7 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa ...@@ -199,7 +201,7 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa
rescueProcessServiceImpl.updateByAlertId(rescueProcessDto,null); rescueProcessServiceImpl.updateByAlertId(rescueProcessDto,null);
} }
// 修改警情到派遣阶段 // 修改警情到派遣阶段
alertCalledServiceImpl.updateAlertStageByAlertId(alertId,"PQ"); alertCalledServiceImpl.updateAlertStageByAlertId(alertId,TzsCommonParam.PQ);
return dispatchPaperFormDto; return dispatchPaperFormDto;
} }
...@@ -222,7 +224,6 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa ...@@ -222,7 +224,6 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa
dispatchSaveFeedbackDto.setFeedbackCode(dispatchPaper.getFeedbackCode()); dispatchSaveFeedbackDto.setFeedbackCode(dispatchPaper.getFeedbackCode());
dispatchSaveFeedbackDto.setFeedbackType(dispatchPaper.getFeedbackType()); dispatchSaveFeedbackDto.setFeedbackType(dispatchPaper.getFeedbackType());
dispatchSaveFeedbackDto.setFeedbackFinishTime(dispatchPaper.getFeedbackFinishTime()); dispatchSaveFeedbackDto.setFeedbackFinishTime(dispatchPaper.getFeedbackFinishTime());
dispatchSaveFeedbackDto.setRemark(dispatchPaper.getRemark());
if(StringUtils.isBlank(dispatchPaper.getFeedbackUid())) { if(StringUtils.isBlank(dispatchPaper.getFeedbackUid())) {
dispatchSaveFeedbackDto.setFeedbackUid(null); dispatchSaveFeedbackDto.setFeedbackUid(null);
} else { } else {
...@@ -251,23 +252,22 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa ...@@ -251,23 +252,22 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa
} }
// 动态字段 // 动态字段
List<AlertFormValue> dynamicFormAlert = dispatchPaperFormDto.getDynamicFormAlert(); List<AlertFormValue> dynamicFormAlert = dispatchPaperFormDto.getDynamicFormAlert();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
dynamicFormAlert.stream().forEach(alertFormValue -> { dynamicFormAlert.stream().forEach(alertFormValue -> {
String value = null; String value = null;
switch (alertFormValue.getFieldCode()) { switch (alertFormValue.getFieldCode()) {
case "save_feedback_time": case TzsCommonParam.SAVE_FEEDBACK_TIME:
value = alertFormValue.getFieldValue(); value = alertFormValue.getFieldValue();
if (StringUtils.isBlank(value)) { if (StringUtils.isBlank(value)) {
dispatchSaveFeedbackDto.setSaveFeedbackTime(null); dispatchSaveFeedbackDto.setSaveFeedbackTime(null);
} else { } else {
try { try {
dispatchSaveFeedbackDto.setSaveFeedbackTime(sdf.parse(value)); dispatchSaveFeedbackDto.setSaveFeedbackTime(DateUtils.longStr2Date(value));
} catch (ParseException e) { } catch (Exception e) {
throw new BadRequest("救援时间格式错误"); throw new BadRequest("救援时间格式错误");
} }
} }
break; break;
case "save_feedback_user": case TzsCommonParam.SAVE_FEEDBACK_USER:
value = alertFormValue.getFieldValue(); value = alertFormValue.getFieldValue();
if (StringUtils.isBlank(value)) { if (StringUtils.isBlank(value)) {
dispatchSaveFeedbackDto.setSaveFeedbackUser(null); dispatchSaveFeedbackDto.setSaveFeedbackUser(null);
...@@ -275,7 +275,7 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa ...@@ -275,7 +275,7 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa
dispatchSaveFeedbackDto.setSaveFeedbackUser(value); dispatchSaveFeedbackDto.setSaveFeedbackUser(value);
} }
break; break;
case "save_feedback_uid": case TzsCommonParam.SAVE_FEEDBACK_UID:
value = alertFormValue.getFieldValue(); value = alertFormValue.getFieldValue();
if (StringUtils.isBlank(value)) { if (StringUtils.isBlank(value)) {
dispatchSaveFeedbackDto.setSaveFeedbackUid(null); dispatchSaveFeedbackDto.setSaveFeedbackUid(null);
...@@ -283,18 +283,22 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa ...@@ -283,18 +283,22 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa
dispatchSaveFeedbackDto.setSaveFeedbackUid(value); dispatchSaveFeedbackDto.setSaveFeedbackUid(value);
} }
break; break;
case "save_feedback_result": case TzsCommonParam.SAVE_FEEDBACK_RESULT:
value = alertFormValue.getFieldValue(); value = alertFormValue.getFieldValue();
dispatchSaveFeedbackDto.setSaveFeedbackResult(value); dispatchSaveFeedbackDto.setSaveFeedbackResult(value);
break; break;
case "fix_result": case TzsCommonParam.FIX_RESULT:
value = alertFormValue.getFieldValueCode(); value = alertFormValue.getFieldValueCode();
dispatchSaveFeedbackDto.setFixResult(value); dispatchSaveFeedbackDto.setFixResult(value);
break; break;
case "error_result": case TzsCommonParam.ERROR_RESULT:
value = alertFormValue.getFieldValueCode(); value = alertFormValue.getFieldValueCode();
dispatchSaveFeedbackDto.setErrorResult(value); dispatchSaveFeedbackDto.setErrorResult(value);
break; break;
case TzsCommonParam.FIX_REMARK:
value = alertFormValue.getFieldValueCode();
dispatchSaveFeedbackDto.setFixRemark(value);
break;
} }
}); });
...@@ -311,45 +315,48 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa ...@@ -311,45 +315,48 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa
DispatchPaper dispatchPaper = dispatchPaperFormDto.getDispatchPaper(); DispatchPaper dispatchPaper = dispatchPaperFormDto.getDispatchPaper();
// 动态字段 // 动态字段
List<AlertFormValue> dynamicFormAlert = dispatchPaperFormDto.getDynamicFormAlert(); List<AlertFormValue> dynamicFormAlert = dispatchPaperFormDto.getDynamicFormAlert();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
dynamicFormAlert.stream().forEach(alertFormValue -> { dynamicFormAlert.stream().forEach(alertFormValue -> {
switch (alertFormValue.getFieldCode()) { switch (alertFormValue.getFieldCode()) {
case "save_feedback_time": case TzsCommonParam.SAVE_FEEDBACK_TIME:
if (dispatchSaveFeedbackDto.getSaveFeedbackTime() != null) { if (dispatchSaveFeedbackDto.getSaveFeedbackTime() != null) {
if(alertFormValue.getFieldValue() == null ) { if(alertFormValue.getFieldValue() == null ) {
// 坐席回访 // 坐席回访
repairConsultServiceImpl.saveRepairConsultByAlertIdType(dispatchSaveFeedbackDto.getAlertId(),"JYHF",null,user); repairConsultServiceImpl.saveRepairConsultByAlertIdType(dispatchSaveFeedbackDto.getAlertId(),TzsCommonParam.JYHF,null,user);
// 修改警情到救援反馈 // 修改警情到救援反馈
alertCalledServiceImpl.updateAlertStageByAlertId(dispatchSaveFeedbackDto.getAlertId(),"JYHF"); alertCalledServiceImpl.updateAlertStageByAlertId(dispatchSaveFeedbackDto.getAlertId(),TzsCommonParam.JYHF);
} }
alertFormValue.setFieldValue(sdf.format(dispatchSaveFeedbackDto.getSaveFeedbackTime())); alertFormValue.setFieldValue(DateUtils.date2LongStr(dispatchSaveFeedbackDto.getSaveFeedbackTime()));
} }
break; break;
case "save_feedback_user": case TzsCommonParam.SAVE_FEEDBACK_USER:
if (StringUtils.isNotBlank(dispatchSaveFeedbackDto.getSaveFeedbackUser())) if (StringUtils.isNotBlank(dispatchSaveFeedbackDto.getSaveFeedbackUser()))
alertFormValue.setFieldValue(dispatchSaveFeedbackDto.getSaveFeedbackUser()); alertFormValue.setFieldValue(dispatchSaveFeedbackDto.getSaveFeedbackUser());
break; break;
case "save_feedback_uid": case TzsCommonParam.SAVE_FEEDBACK_UID:
if (StringUtils.isNotBlank(dispatchSaveFeedbackDto.getSaveFeedbackUid())) if (StringUtils.isNotBlank(dispatchSaveFeedbackDto.getSaveFeedbackUid()))
alertFormValue.setFieldValue(dispatchSaveFeedbackDto.getSaveFeedbackUid()); alertFormValue.setFieldValue(dispatchSaveFeedbackDto.getSaveFeedbackUid());
break; break;
case "save_feedback_result": case TzsCommonParam.SAVE_FEEDBACK_RESULT:
if (StringUtils.isNotBlank(dispatchSaveFeedbackDto.getSaveFeedbackResult())) if (StringUtils.isNotBlank(dispatchSaveFeedbackDto.getSaveFeedbackResult()))
alertFormValue.setFieldValue(dispatchSaveFeedbackDto.getSaveFeedbackResult()); alertFormValue.setFieldValue(dispatchSaveFeedbackDto.getSaveFeedbackResult());
break; break;
case "fix_result": case TzsCommonParam.FIX_REMARK:
if (StringUtils.isNotBlank(dispatchSaveFeedbackDto.getFixRemark()))
alertFormValue.setFieldValue(dispatchSaveFeedbackDto.getFixRemark());
break;
case TzsCommonParam.FIX_RESULT:
if (StringUtils.isNotBlank(dispatchSaveFeedbackDto.getFixResult())) { if (StringUtils.isNotBlank(dispatchSaveFeedbackDto.getFixResult())) {
QueryWrapper<DataDictionary> queryWrapper = new QueryWrapper<>(); QueryWrapper<DataDictionary> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("type", "WXJG").eq("code", dispatchSaveFeedbackDto.getFixResult()); queryWrapper.eq("type", TzsCommonParam.WXJG).eq("code", dispatchSaveFeedbackDto.getFixResult());
DataDictionary fixResult = iDataDictionaryService.getOne(queryWrapper); DataDictionary fixResult = iDataDictionaryService.getOne(queryWrapper);
alertFormValue.setFieldValue(fixResult.getName()); alertFormValue.setFieldValue(fixResult.getName());
alertFormValue.setFieldValueCode(fixResult.getCode()); alertFormValue.setFieldValueCode(fixResult.getCode());
} }
break; break;
case "error_result": case TzsCommonParam.ERROR_RESULT:
if (StringUtils.isNotBlank(dispatchSaveFeedbackDto.getErrorResult())) { if (StringUtils.isNotBlank(dispatchSaveFeedbackDto.getErrorResult())) {
QueryWrapper<DataDictionary> queryWrapper = new QueryWrapper<>(); QueryWrapper<DataDictionary> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("type", "GZYY").eq("code", dispatchSaveFeedbackDto.getErrorResult()); queryWrapper.eq("type", TzsCommonParam.GZYY).eq("code", dispatchSaveFeedbackDto.getErrorResult());
DataDictionary errorResult = iDataDictionaryService.getOne(queryWrapper); DataDictionary errorResult = iDataDictionaryService.getOne(queryWrapper);
alertFormValue.setFieldValue(errorResult.getName()); alertFormValue.setFieldValue(errorResult.getName());
alertFormValue.setFieldValueCode(errorResult.getCode()); alertFormValue.setFieldValueCode(errorResult.getCode());
...@@ -362,16 +369,15 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa ...@@ -362,16 +369,15 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa
dispatchPaper.setFeedbackFinishTime(dispatchSaveFeedbackDto.getFeedbackFinishTime()); dispatchPaper.setFeedbackFinishTime(dispatchSaveFeedbackDto.getFeedbackFinishTime());
dispatchPaper.setFeedbackUid(dispatchSaveFeedbackDto.getFeedbackUid()); dispatchPaper.setFeedbackUid(dispatchSaveFeedbackDto.getFeedbackUid());
dispatchPaper.setFeedbackUname(dispatchSaveFeedbackDto.getFeedbackUname()); dispatchPaper.setFeedbackUname(dispatchSaveFeedbackDto.getFeedbackUname());
dispatchPaper.setRemark(dispatchSaveFeedbackDto.getRemark());
if(dispatchPaper.getFeedbackTime() == null && dispatchSaveFeedbackDto.getFeedbackTime() != null) { if(dispatchPaper.getFeedbackTime() == null && dispatchSaveFeedbackDto.getFeedbackTime() != null) {
// 维修反馈 // 维修反馈
Long taskId = dispatchPaper.getRepairOrgTaskId() != null ? dispatchPaper.getRepairOrgTaskId() : dispatchPaper.getUseOrgTaskId(); Long taskId = dispatchPaper.getRepairOrgTaskId() != null ? dispatchPaper.getRepairOrgTaskId() : dispatchPaper.getUseOrgTaskId();
if(taskId == null) { if(taskId == null) {
throw new BadRequest("未找到反馈任务单"); throw new BadRequest("未找到反馈任务单");
} }
repairConsultServiceImpl.saveRepairConsultByAlertIdType(dispatchSaveFeedbackDto.getAlertId(),"WXFK",taskId,user); repairConsultServiceImpl.saveRepairConsultByAlertIdType(dispatchSaveFeedbackDto.getAlertId(),TzsCommonParam.WXFK,taskId,user);
// 修改警情到维修反馈 // 修改警情到维修反馈
alertCalledServiceImpl.updateAlertStageByAlertId(dispatchSaveFeedbackDto.getAlertId(),"WXFK"); alertCalledServiceImpl.updateAlertStageByAlertId(dispatchSaveFeedbackDto.getAlertId(),TzsCommonParam.WXFK);
} }
dispatchPaper.setFeedbackTime(dispatchSaveFeedbackDto.getFeedbackTime()); dispatchPaper.setFeedbackTime(dispatchSaveFeedbackDto.getFeedbackTime());
// 保存动态表单数据 // 保存动态表单数据
...@@ -433,31 +439,30 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa ...@@ -433,31 +439,30 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa
// 动态字段 // 动态字段
List<AlertFormValue> dynamicFormAlert = dispatchPaperFormDto.getDynamicFormAlert(); List<AlertFormValue> dynamicFormAlert = dispatchPaperFormDto.getDynamicFormAlert();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
dynamicFormAlert.stream().forEach(alertFormValue -> { dynamicFormAlert.stream().forEach(alertFormValue -> {
String value = null; String value = null;
switch (alertFormValue.getFieldCode()) { switch (alertFormValue.getFieldCode()) {
case "fix_feedback_time": //报修反馈时间 case TzsCommonParam.FIX_FEEDBACK_TIME: //报修反馈时间
value = alertFormValue.getFieldValue(); value = alertFormValue.getFieldValue();
if (StringUtils.isBlank(value)) { if (StringUtils.isBlank(value)) {
dispatchRepairFeedbackDto.setFixFeedbackTime(null); dispatchRepairFeedbackDto.setFixFeedbackTime(null);
} else { } else {
try { try {
dispatchRepairFeedbackDto.setFixFeedbackTime(sdf.parse(value)); dispatchRepairFeedbackDto.setFixFeedbackTime(DateUtils.longStr2Date(value));
} catch (ParseException e) { } catch (Exception e) {
throw new BadRequest("维修反馈时间格式错误"); throw new BadRequest("维修反馈时间格式错误");
} }
} }
break; break;
case "feedback_result"://报修结果 case TzsCommonParam.FEEDBACK_RESULT://报修结果
value = alertFormValue.getFieldValue(); value = alertFormValue.getFieldValueCode();
dispatchRepairFeedbackDto.setFeedbackResult(value); dispatchRepairFeedbackDto.setFeedbackResult(value);
break; break;
case "fix_feedback_type":// 保修反馈方式 case TzsCommonParam.FIX_FEEDBACK_TYPE:// 保修反馈方式
value = alertFormValue.getFieldValueCode(); value = alertFormValue.getFieldValueCode();
dispatchRepairFeedbackDto.setFixFeedbackType(value); dispatchRepairFeedbackDto.setFixFeedbackType(value);
break; break;
case "fix_feedback_uname": case TzsCommonParam.FIX_FEEDBACK_UNAME:
value = alertFormValue.getFieldValue(); value = alertFormValue.getFieldValue();
if (StringUtils.isBlank(value)) { if (StringUtils.isBlank(value)) {
dispatchRepairFeedbackDto.setFixFeedbackUname(null); dispatchRepairFeedbackDto.setFixFeedbackUname(null);
...@@ -465,7 +470,7 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa ...@@ -465,7 +470,7 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa
dispatchRepairFeedbackDto.setFixFeedbackUname(value); dispatchRepairFeedbackDto.setFixFeedbackUname(value);
} }
break; break;
case "fix_feedback_uid": case TzsCommonParam.FIX_FEEDBACK_UID:
value = alertFormValue.getFieldValue(); value = alertFormValue.getFieldValue();
if (StringUtils.isBlank(value)) { if (StringUtils.isBlank(value)) {
dispatchRepairFeedbackDto.setFixFeedbackUid(null); dispatchRepairFeedbackDto.setFixFeedbackUid(null);
...@@ -473,15 +478,15 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa ...@@ -473,15 +478,15 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa
dispatchRepairFeedbackDto.setFixFeedbackUid(value); dispatchRepairFeedbackDto.setFixFeedbackUid(value);
} }
break; break;
case "fix_result": case TzsCommonParam.FIX_RESULT:
value = alertFormValue.getFieldValueCode(); value = alertFormValue.getFieldValueCode();
dispatchRepairFeedbackDto.setFixResult(value); dispatchRepairFeedbackDto.setFixResult(value);
break; break;
case "error_result": case TzsCommonParam.ERROR_RESULT:
value = alertFormValue.getFieldValueCode(); value = alertFormValue.getFieldValueCode();
dispatchRepairFeedbackDto.setErrorResult(value); dispatchRepairFeedbackDto.setErrorResult(value);
break; break;
case "fix_remark": case TzsCommonParam.FIX_REMARK:
value = alertFormValue.getFieldValue(); value = alertFormValue.getFieldValue();
dispatchRepairFeedbackDto.setFixRemark(value); dispatchRepairFeedbackDto.setFixRemark(value);
break; break;
...@@ -501,69 +506,62 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa ...@@ -501,69 +506,62 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa
DispatchPaper dispatchPaper = dispatchPaperFormDto.getDispatchPaper(); DispatchPaper dispatchPaper = dispatchPaperFormDto.getDispatchPaper();
// 动态字段 // 动态字段
List<AlertFormValue> dynamicFormAlert = dispatchPaperFormDto.getDynamicFormAlert(); List<AlertFormValue> dynamicFormAlert = dispatchPaperFormDto.getDynamicFormAlert();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); Map<String,Boolean> tempMap = new HashMap<String,Boolean>();
dynamicFormAlert.stream().forEach(alertFormValue -> { dynamicFormAlert.stream().forEach(alertFormValue -> {
switch (alertFormValue.getFieldCode()) { switch (alertFormValue.getFieldCode()) {
case "fix_feedback_time": case TzsCommonParam.FIX_FEEDBACK_TIME:
if (dispatchRepairFeedbackDto.getFixFeedbackTime() != null) { if (dispatchRepairFeedbackDto.getFixFeedbackTime() != null) {
if(alertFormValue.getFieldValue() == null) { if(alertFormValue.getFieldValue() == null) {
// 报修反馈 tempMap.put(TzsCommonParam.BXFK,true);
Long taskId = dispatchPaper.getRepairOrgTaskId() != null ? dispatchPaper.getRepairOrgTaskId() : dispatchPaper.getUseOrgTaskId();
if(taskId == null) {
throw new BadRequest("未找到反馈任务单");
}
// 修改警情到报修反馈
alertCalledServiceImpl.updateAlertStageByAlertId(dispatchRepairFeedbackDto.getAlertId(),"BXFK");
repairConsultServiceImpl.saveRepairConsultByAlertIdType(dispatchRepairFeedbackDto.getAlertId(),"BXFK",taskId,user);
} }
alertFormValue.setFieldValue(sdf.format(dispatchRepairFeedbackDto.getFixFeedbackTime())); alertFormValue.setFieldValue(DateUtils.date2LongStr(dispatchRepairFeedbackDto.getFixFeedbackTime()));
} }
break; break;
case "feedback_result": case TzsCommonParam.FEEDBACK_RESULT:
if (StringUtils.isNotBlank(dispatchRepairFeedbackDto.getFeedbackResult())) { if (StringUtils.isNotBlank(dispatchRepairFeedbackDto.getFeedbackResult())) {
QueryWrapper<DataDictionary> queryWrapper = new QueryWrapper<>(); QueryWrapper<DataDictionary> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("type", "FKJG").eq("code", dispatchRepairFeedbackDto.getFeedbackResult()); queryWrapper.eq("type", TzsCommonParam.WXJG).eq("code", dispatchRepairFeedbackDto.getFeedbackResult());
DataDictionary feedbackType = iDataDictionaryService.getOne(queryWrapper); DataDictionary feedbackType = iDataDictionaryService.getOne(queryWrapper);
alertFormValue.setFieldValue(feedbackType.getName()); alertFormValue.setFieldValue(feedbackType.getName());
alertFormValue.setFieldValueCode(feedbackType.getCode()); alertFormValue.setFieldValueCode(feedbackType.getCode());
} }
break; break;
case "fix_feedback_type": case TzsCommonParam.FIX_FEEDBACK_TYPE:
if (StringUtils.isNotBlank(dispatchRepairFeedbackDto.getFixFeedbackType())) { if (StringUtils.isNotBlank(dispatchRepairFeedbackDto.getFixFeedbackType())) {
QueryWrapper<DataDictionary> queryWrapper = new QueryWrapper<>(); QueryWrapper<DataDictionary> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("type", "FKFS").eq("code", dispatchRepairFeedbackDto.getFixFeedbackType()); queryWrapper.eq("type", TzsCommonParam.FKFS).eq("code", dispatchRepairFeedbackDto.getFixFeedbackType());
DataDictionary feedbackType = iDataDictionaryService.getOne(queryWrapper); DataDictionary feedbackType = iDataDictionaryService.getOne(queryWrapper);
alertFormValue.setFieldValue(feedbackType.getName()); alertFormValue.setFieldValue(feedbackType.getName());
alertFormValue.setFieldValueCode(feedbackType.getCode()); alertFormValue.setFieldValueCode(feedbackType.getCode());
} }
break; break;
case "fix_feedback_uname": case TzsCommonParam.FIX_FEEDBACK_UNAME:
if (StringUtils.isNotBlank(dispatchRepairFeedbackDto.getFixFeedbackUname())) if (StringUtils.isNotBlank(dispatchRepairFeedbackDto.getFixFeedbackUname()))
alertFormValue.setFieldValue(dispatchRepairFeedbackDto.getFixFeedbackUname()); alertFormValue.setFieldValue(dispatchRepairFeedbackDto.getFixFeedbackUname());
break; break;
case "fix_feedback_uid": case TzsCommonParam.FIX_FEEDBACK_UID:
if (StringUtils.isNotBlank(dispatchRepairFeedbackDto.getFixFeedbackUid())) if (StringUtils.isNotBlank(dispatchRepairFeedbackDto.getFixFeedbackUid()))
alertFormValue.setFieldValue(dispatchRepairFeedbackDto.getFixFeedbackUid()); alertFormValue.setFieldValue(dispatchRepairFeedbackDto.getFixFeedbackUid());
break; break;
case "fix_result": case TzsCommonParam.FIX_RESULT:
if (StringUtils.isNotBlank(dispatchRepairFeedbackDto.getFixResult())) { if (StringUtils.isNotBlank(dispatchRepairFeedbackDto.getFixResult())) {
QueryWrapper<DataDictionary> queryWrapper = new QueryWrapper<>(); QueryWrapper<DataDictionary> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("type", "WXJG").eq("code", dispatchRepairFeedbackDto.getFixResult()); queryWrapper.eq("type", TzsCommonParam.WXJG).eq("code", dispatchRepairFeedbackDto.getFixResult());
DataDictionary fixResult = iDataDictionaryService.getOne(queryWrapper); DataDictionary fixResult = iDataDictionaryService.getOne(queryWrapper);
alertFormValue.setFieldValue(fixResult.getName()); alertFormValue.setFieldValue(fixResult.getName());
alertFormValue.setFieldValueCode(fixResult.getCode()); alertFormValue.setFieldValueCode(fixResult.getCode());
} }
break; break;
case "error_result": case TzsCommonParam.ERROR_RESULT:
if (StringUtils.isNotBlank(dispatchRepairFeedbackDto.getErrorResult())) { if (StringUtils.isNotBlank(dispatchRepairFeedbackDto.getErrorResult())) {
QueryWrapper<DataDictionary> queryWrapper = new QueryWrapper<>(); QueryWrapper<DataDictionary> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("type", "GZYY").eq("code", dispatchRepairFeedbackDto.getErrorResult()); queryWrapper.eq("type", TzsCommonParam.GZYY).eq("code", dispatchRepairFeedbackDto.getErrorResult());
DataDictionary errorResult = iDataDictionaryService.getOne(queryWrapper); DataDictionary errorResult = iDataDictionaryService.getOne(queryWrapper);
alertFormValue.setFieldValue(errorResult.getName()); alertFormValue.setFieldValue(errorResult.getName());
alertFormValue.setFieldValueCode(errorResult.getCode()); alertFormValue.setFieldValueCode(errorResult.getCode());
} }
break; break;
case "fix_remark": case TzsCommonParam.FIX_REMARK:
if (StringUtils.isNotBlank(dispatchRepairFeedbackDto.getFixRemark())) if (StringUtils.isNotBlank(dispatchRepairFeedbackDto.getFixRemark()))
alertFormValue.setFieldValue(dispatchRepairFeedbackDto.getFixRemark()); alertFormValue.setFieldValue(dispatchRepairFeedbackDto.getFixRemark());
break; break;
...@@ -576,6 +574,14 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa ...@@ -576,6 +574,14 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa
dispatchPaper.setFeedbackUname(dispatchRepairFeedbackDto.getFeedbackUname()); dispatchPaper.setFeedbackUname(dispatchRepairFeedbackDto.getFeedbackUname());
dispatchPaper.setRemark(dispatchRepairFeedbackDto.getRemark()); dispatchPaper.setRemark(dispatchRepairFeedbackDto.getRemark());
if(dispatchPaper.getFeedbackTime() == null && dispatchRepairFeedbackDto.getFeedbackTime() != null) { if(dispatchPaper.getFeedbackTime() == null && dispatchRepairFeedbackDto.getFeedbackTime() != null) {
tempMap.put("FEEDBACK",true);
}
dispatchPaper.setFeedbackTime(dispatchRepairFeedbackDto.getFeedbackTime());
// 保存动态表单数据
iAlertFormValueService.updateBatchById(dynamicFormAlert);
// 保存派遣表
flag = this.updateById(dispatchPaper);
if(tempMap.get("FEEDBACK") != null) {
// 维修反馈 // 维修反馈
Long taskId = dispatchPaper.getRepairOrgTaskId() != null ? dispatchPaper.getRepairOrgTaskId() : dispatchPaper.getUseOrgTaskId(); Long taskId = dispatchPaper.getRepairOrgTaskId() != null ? dispatchPaper.getRepairOrgTaskId() : dispatchPaper.getUseOrgTaskId();
if(taskId == null) { if(taskId == null) {
...@@ -585,11 +591,16 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa ...@@ -585,11 +591,16 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa
alertCalledServiceImpl.updateAlertStageByAlertId(dispatchRepairFeedbackDto.getAlertId(),"WXFK"); alertCalledServiceImpl.updateAlertStageByAlertId(dispatchRepairFeedbackDto.getAlertId(),"WXFK");
repairConsultServiceImpl.saveRepairConsultByAlertIdType(dispatchRepairFeedbackDto.getAlertId(),"WXFK",taskId,user); repairConsultServiceImpl.saveRepairConsultByAlertIdType(dispatchRepairFeedbackDto.getAlertId(),"WXFK",taskId,user);
} }
dispatchPaper.setFeedbackTime(dispatchRepairFeedbackDto.getFeedbackTime()); if(tempMap.get("BXFK") != null) {
// 保存动态表单数据 // 报修反馈
iAlertFormValueService.updateBatchById(dynamicFormAlert); Long taskId = dispatchPaper.getRepairOrgTaskId() != null ? dispatchPaper.getRepairOrgTaskId() : dispatchPaper.getUseOrgTaskId();
// 保存派遣表 if(taskId == null) {
flag = this.updateById(dispatchPaper); throw new BadRequest("未找到反馈任务单");
}
repairConsultServiceImpl.saveRepairConsultByAlertIdType(dispatchRepairFeedbackDto.getAlertId(),"BXFK",taskId,user);
// 修改警情到报修反馈
alertCalledServiceImpl.updateAlertStageByAlertId(dispatchRepairFeedbackDto.getAlertId(),"BXFK");
}
return flag; return flag;
} }
...@@ -646,35 +657,34 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa ...@@ -646,35 +657,34 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa
// 动态字段 // 动态字段
List<AlertFormValue> dynamicFormAlert = dispatchPaperFormDto.getDynamicFormAlert(); List<AlertFormValue> dynamicFormAlert = dispatchPaperFormDto.getDynamicFormAlert();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
dynamicFormAlert.stream().forEach(alertFormValue -> { dynamicFormAlert.stream().forEach(alertFormValue -> {
String value = null; String value = null;
switch (alertFormValue.getFieldCode()) { switch (alertFormValue.getFieldCode()) {
case "consult_feedback_time": //咨询反馈时间 case TzsCommonParam.CONSULT_FEEDBACK_TIME: //咨询反馈时间
value = alertFormValue.getFieldValue(); value = alertFormValue.getFieldValue();
if (StringUtils.isBlank(value)) { if (StringUtils.isBlank(value)) {
dispatchConsultFeedbackDto.setConsultFeedbackTime(null); dispatchConsultFeedbackDto.setConsultFeedbackTime(null);
} else { } else {
try { try {
dispatchConsultFeedbackDto.setConsultFeedbackTime(sdf.parse(value)); dispatchConsultFeedbackDto.setConsultFeedbackTime(DateUtils.longStr2Date(value));
} catch (ParseException e) { } catch (Exception e) {
throw new BadRequest("咨询反馈时间格式错误"); throw new BadRequest("咨询反馈时间格式错误");
} }
} }
break; break;
case "action_result"://处置结果 case TzsCommonParam.ACTION_RESULT://处置结果
value = alertFormValue.getFieldValue(); value = alertFormValue.getFieldValueCode();
dispatchConsultFeedbackDto.setActionResult(value); dispatchConsultFeedbackDto.setActionResult(value);
break; break;
case "feedback_result"://咨询反馈结果 case TzsCommonParam.FEEDBACK_RESULT://咨询反馈结果
value = alertFormValue.getFieldValue(); value = alertFormValue.getFieldValueCode();
dispatchConsultFeedbackDto.setFeedbackResult(value); dispatchConsultFeedbackDto.setFeedbackResult(value);
break; break;
case "consult_feedback_type":// 咨询反馈方式 case TzsCommonParam.CONSULT_FEEDBACK_TYPE:// 咨询反馈方式
value = alertFormValue.getFieldValueCode(); value = alertFormValue.getFieldValueCode();
dispatchConsultFeedbackDto.setConsultFeedbackType(value); dispatchConsultFeedbackDto.setConsultFeedbackType(value);
break; break;
case "consult_feedback_uname": case TzsCommonParam.CONSULT_FEEDBACK_UNAME:
value = alertFormValue.getFieldValue(); value = alertFormValue.getFieldValue();
if (StringUtils.isBlank(value)) { if (StringUtils.isBlank(value)) {
dispatchConsultFeedbackDto.setConsultFeedbackUname(null); dispatchConsultFeedbackDto.setConsultFeedbackUname(null);
...@@ -682,7 +692,7 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa ...@@ -682,7 +692,7 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa
dispatchConsultFeedbackDto.setConsultFeedbackUname(value); dispatchConsultFeedbackDto.setConsultFeedbackUname(value);
} }
break; break;
case "consult_feedback_uid": case TzsCommonParam.CONSULT_FEEDBACK_UID:
value = alertFormValue.getFieldValue(); value = alertFormValue.getFieldValue();
if (StringUtils.isBlank(value)) { if (StringUtils.isBlank(value)) {
dispatchConsultFeedbackDto.setConsultFeedbackUid(null); dispatchConsultFeedbackDto.setConsultFeedbackUid(null);
...@@ -690,7 +700,7 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa ...@@ -690,7 +700,7 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa
dispatchConsultFeedbackDto.setConsultFeedbackUid(value); dispatchConsultFeedbackDto.setConsultFeedbackUid(value);
} }
break; break;
case "main_feedback_result": case TzsCommonParam.MAIN_FEEDBACK_RESULT:
value = alertFormValue.getFieldValue(); value = alertFormValue.getFieldValue();
dispatchConsultFeedbackDto.setMainFeedbackResult(value); dispatchConsultFeedbackDto.setMainFeedbackResult(value);
break; break;
...@@ -709,58 +719,51 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa ...@@ -709,58 +719,51 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa
DispatchPaper dispatchPaper = dispatchPaperFormDto.getDispatchPaper(); DispatchPaper dispatchPaper = dispatchPaperFormDto.getDispatchPaper();
// 动态字段 // 动态字段
List<AlertFormValue> dynamicFormAlert = dispatchPaperFormDto.getDynamicFormAlert(); List<AlertFormValue> dynamicFormAlert = dispatchPaperFormDto.getDynamicFormAlert();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); Map<String,Boolean> tempMap = new HashMap<String,Boolean>();
dynamicFormAlert.stream().forEach(alertFormValue -> { dynamicFormAlert.stream().forEach(alertFormValue -> {
switch (alertFormValue.getFieldCode()) { switch (alertFormValue.getFieldCode()) {
case "consult_feedback_time": case TzsCommonParam.CONSULT_FEEDBACK_TIME:
if (dispatchConsultFeedbackDto.getConsultFeedbackTime() != null) { if (dispatchConsultFeedbackDto.getConsultFeedbackTime() != null) {
if(alertFormValue.getFieldValue() == null ) { if(alertFormValue.getFieldValue() == null ) {
// 投诉人反馈 tempMap.put(TzsCommonParam.TSRFK,true);
Long taskId = dispatchPaper.getRepairOrgTaskId() != null ? dispatchPaper.getRepairOrgTaskId() : dispatchPaper.getUseOrgTaskId();
if(taskId == null) {
throw new BadRequest("未找到反馈任务单");
}
// 修改警情到投诉人反馈
alertCalledServiceImpl.updateAlertStageByAlertId(dispatchConsultFeedbackDto.getAlertId(),"TSRFK");
repairConsultServiceImpl.saveRepairConsultByAlertIdType(dispatchConsultFeedbackDto.getAlertId(),"TSRFK",taskId,user);
} }
alertFormValue.setFieldValue(sdf.format(dispatchConsultFeedbackDto.getConsultFeedbackTime())); alertFormValue.setFieldValue(DateUtils.date2LongStr(dispatchConsultFeedbackDto.getConsultFeedbackTime()));
} }
break; break;
case "action_result": case TzsCommonParam.ACTION_RESULT:
if (StringUtils.isNotBlank(dispatchConsultFeedbackDto.getActionResult())) { if (StringUtils.isNotBlank(dispatchConsultFeedbackDto.getActionResult())) {
QueryWrapper<DataDictionary> queryWrapper = new QueryWrapper<>(); QueryWrapper<DataDictionary> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("type", "CZJG").eq("code", dispatchConsultFeedbackDto.getActionResult()); queryWrapper.eq("type", TzsCommonParam.CZJG).eq("code", dispatchConsultFeedbackDto.getActionResult());
DataDictionary feedbackType = iDataDictionaryService.getOne(queryWrapper); DataDictionary feedbackType = iDataDictionaryService.getOne(queryWrapper);
alertFormValue.setFieldValue(feedbackType.getName()); alertFormValue.setFieldValue(feedbackType.getName());
alertFormValue.setFieldValueCode(feedbackType.getCode()); alertFormValue.setFieldValueCode(feedbackType.getCode());
} }
break; break;
case "consult_feedback_type": case TzsCommonParam.CONSULT_FEEDBACK_TYPE:
if (StringUtils.isNotBlank(dispatchConsultFeedbackDto.getConsultFeedbackType())) { if (StringUtils.isNotBlank(dispatchConsultFeedbackDto.getConsultFeedbackType())) {
QueryWrapper<DataDictionary> queryWrapper = new QueryWrapper<>(); QueryWrapper<DataDictionary> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("type", "FKFS").eq("code", dispatchConsultFeedbackDto.getConsultFeedbackType()); queryWrapper.eq("type", TzsCommonParam.FKFS).eq("code", dispatchConsultFeedbackDto.getConsultFeedbackType());
DataDictionary feedbackType = iDataDictionaryService.getOne(queryWrapper); DataDictionary feedbackType = iDataDictionaryService.getOne(queryWrapper);
alertFormValue.setFieldValue(feedbackType.getName()); alertFormValue.setFieldValue(feedbackType.getName());
alertFormValue.setFieldValueCode(feedbackType.getCode()); alertFormValue.setFieldValueCode(feedbackType.getCode());
} }
break; break;
case "consult_feedback_uname": case TzsCommonParam.CONSULT_FEEDBACK_UNAME:
if (StringUtils.isNotBlank(dispatchConsultFeedbackDto.getConsultFeedbackUname())) if (StringUtils.isNotBlank(dispatchConsultFeedbackDto.getConsultFeedbackUname()))
alertFormValue.setFieldValue(dispatchConsultFeedbackDto.getConsultFeedbackUname()); alertFormValue.setFieldValue(dispatchConsultFeedbackDto.getConsultFeedbackUname());
break; break;
case "consult_feedback_uid": case TzsCommonParam.CONSULT_FEEDBACK_UID:
if (StringUtils.isNotBlank(dispatchConsultFeedbackDto.getConsultFeedbackUid())) if (StringUtils.isNotBlank(dispatchConsultFeedbackDto.getConsultFeedbackUid()))
alertFormValue.setFieldValue(dispatchConsultFeedbackDto.getConsultFeedbackUid()); alertFormValue.setFieldValue(dispatchConsultFeedbackDto.getConsultFeedbackUid());
break; break;
case "main_feedback_result": case TzsCommonParam.MAIN_FEEDBACK_RESULT:
if (StringUtils.isNotBlank(dispatchConsultFeedbackDto.getMainFeedbackResult())) if (StringUtils.isNotBlank(dispatchConsultFeedbackDto.getMainFeedbackResult()))
alertFormValue.setFieldValue(dispatchConsultFeedbackDto.getMainFeedbackResult()); alertFormValue.setFieldValue(dispatchConsultFeedbackDto.getMainFeedbackResult());
break; break;
case "feedback_result": case TzsCommonParam.FEEDBACK_RESULT:
if (StringUtils.isNotBlank(dispatchConsultFeedbackDto.getFeedbackResult())) { if (StringUtils.isNotBlank(dispatchConsultFeedbackDto.getFeedbackResult())) {
QueryWrapper<DataDictionary> queryWrapper = new QueryWrapper<>(); QueryWrapper<DataDictionary> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("type", "FKJG").eq("code", dispatchConsultFeedbackDto.getFeedbackResult()); queryWrapper.eq("type", TzsCommonParam.FKJG).eq("code", dispatchConsultFeedbackDto.getFeedbackResult());
DataDictionary feedbackType = iDataDictionaryService.getOne(queryWrapper); DataDictionary feedbackType = iDataDictionaryService.getOne(queryWrapper);
alertFormValue.setFieldValue(feedbackType.getName()); alertFormValue.setFieldValue(feedbackType.getName());
alertFormValue.setFieldValueCode(feedbackType.getCode()); alertFormValue.setFieldValueCode(feedbackType.getCode());
...@@ -771,14 +774,7 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa ...@@ -771,14 +774,7 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa
dispatchPaper.setFeedbackCode(dispatchConsultFeedbackDto.getFeedbackCode()); dispatchPaper.setFeedbackCode(dispatchConsultFeedbackDto.getFeedbackCode());
dispatchPaper.setFeedbackType(dispatchConsultFeedbackDto.getFeedbackType()); dispatchPaper.setFeedbackType(dispatchConsultFeedbackDto.getFeedbackType());
if(dispatchPaper.getFeedbackTime() == null && dispatchConsultFeedbackDto.getFeedbackTime() != null) { if(dispatchPaper.getFeedbackTime() == null && dispatchConsultFeedbackDto.getFeedbackTime() != null) {
// 维修反馈 tempMap.put("FEEDBACK",true);
Long taskId = dispatchPaper.getRepairOrgTaskId() != null ? dispatchPaper.getRepairOrgTaskId() : dispatchPaper.getUseOrgTaskId();
if(taskId == null) {
throw new BadRequest("未找到反馈任务单");
}
// 修改警情到维修反馈
alertCalledServiceImpl.updateAlertStageByAlertId(dispatchConsultFeedbackDto.getAlertId(),"WXFK");
repairConsultServiceImpl.saveRepairConsultByAlertIdType(dispatchConsultFeedbackDto.getAlertId(),"WXFK-TS",taskId,user);
} }
dispatchPaper.setFeedbackTime(dispatchConsultFeedbackDto.getFeedbackTime()); dispatchPaper.setFeedbackTime(dispatchConsultFeedbackDto.getFeedbackTime());
dispatchPaper.setFeedbackFinishTime(dispatchConsultFeedbackDto.getFeedbackFinishTime()); dispatchPaper.setFeedbackFinishTime(dispatchConsultFeedbackDto.getFeedbackFinishTime());
...@@ -789,7 +785,26 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa ...@@ -789,7 +785,26 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa
iAlertFormValueService.updateBatchById(dynamicFormAlert); iAlertFormValueService.updateBatchById(dynamicFormAlert);
// 保存派遣表 // 保存派遣表
flag = this.updateById(dispatchPaper); flag = this.updateById(dispatchPaper);
if(tempMap.get("FEEDBACK") != null) {
// 维修反馈
Long taskId = dispatchPaper.getRepairOrgTaskId() != null ? dispatchPaper.getRepairOrgTaskId() : dispatchPaper.getUseOrgTaskId();
if(taskId == null) {
throw new BadRequest("未找到反馈任务单");
}
// 修改警情到维修反馈
alertCalledServiceImpl.updateAlertStageByAlertId(dispatchConsultFeedbackDto.getAlertId(),TzsCommonParam.WXFK);
repairConsultServiceImpl.saveRepairConsultByAlertIdType(dispatchConsultFeedbackDto.getAlertId(),TzsCommonParam.WXFK_TS,taskId,user);
}
if(tempMap.get("TSRFK") != null) {
// 修改警情到投诉人反馈
// 投诉人反馈
Long taskId = dispatchPaper.getRepairOrgTaskId() != null ? dispatchPaper.getRepairOrgTaskId() : dispatchPaper.getUseOrgTaskId();
if(taskId == null) {
throw new BadRequest("未找到反馈任务单");
}
repairConsultServiceImpl.saveRepairConsultByAlertIdType(dispatchConsultFeedbackDto.getAlertId(),TzsCommonParam.TSRFK,taskId,user);
alertCalledServiceImpl.updateAlertStageByAlertId(dispatchConsultFeedbackDto.getAlertId(),TzsCommonParam.TSRFK);
}
return flag; return flag;
} }
......
...@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.tzs.biz.service.impl; ...@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.tzs.biz.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
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;
...@@ -105,8 +106,7 @@ public class DispatchTaskServiceImpl extends BaseService<DispatchTaskDto,Dispatc ...@@ -105,8 +106,7 @@ public class DispatchTaskServiceImpl extends BaseService<DispatchTaskDto,Dispatc
String content = template.getContent(); String content = template.getContent();
// 替换模板内容 // 替换模板内容
// 通用替换字段 报修时间 地址 电梯识别码 使用单位分类 // 通用替换字段 报修时间 地址 电梯识别码 使用单位分类
SimpleDateFormat sdf = new SimpleDateFormat("YYYY-MM-dd HH:mm:ss"); String createTime = DateUtils.date2LongStr(alertCalledDto.getCallTime());
String createTime = sdf.format(alertCalledDto.getCallTime());
String rescueCode = alertCalledDto.getDeviceId(); String rescueCode = alertCalledDto.getDeviceId();
String emergencyCall = alertCalledDto.getEmergencyCall() == null ? "" : alertCalledDto.getEmergencyCall(); String emergencyCall = alertCalledDto.getEmergencyCall() == null ? "" : alertCalledDto.getEmergencyCall();
......
...@@ -16,6 +16,7 @@ import com.yeejoin.amos.boot.module.tzs.api.entity.DispatchTask; ...@@ -16,6 +16,7 @@ import com.yeejoin.amos.boot.module.tzs.api.entity.DispatchTask;
import com.yeejoin.amos.boot.module.tzs.api.entity.RepairConsult; import com.yeejoin.amos.boot.module.tzs.api.entity.RepairConsult;
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.enums.AlertStageEnums; import com.yeejoin.amos.boot.module.tzs.api.enums.AlertStageEnums;
import com.yeejoin.amos.boot.module.tzs.api.enums.TzsCommonParam;
import com.yeejoin.amos.boot.module.tzs.api.mapper.RepairConsultMapper; import com.yeejoin.amos.boot.module.tzs.api.mapper.RepairConsultMapper;
import com.yeejoin.amos.boot.module.tzs.api.service.IRepairConsultService; import com.yeejoin.amos.boot.module.tzs.api.service.IRepairConsultService;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel; import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
...@@ -83,7 +84,11 @@ public class RepairConsultServiceImpl extends BaseService<RepairConsultDto,Repai ...@@ -83,7 +84,11 @@ public class RepairConsultServiceImpl extends BaseService<RepairConsultDto,Repai
AlertCalledDto alertCalledVo = alertCallFrom.getAlertCalledDto(); AlertCalledDto alertCalledVo = alertCallFrom.getAlertCalledDto();
// 获取模板 拼接json // 获取模板 拼接json
QueryWrapper<Template> templateQueryWrapper = new QueryWrapper<>(); QueryWrapper<Template> templateQueryWrapper = new QueryWrapper<>();
templateQueryWrapper.eq("type_code","RECORD-" + type); if(TzsCommonParam.WXFK_TS.equals(type)) {
templateQueryWrapper.eq("type_code","RECORD-WXFK");
} else {
templateQueryWrapper.eq("type_code","RECORD-" + type);
}
Template template = templateServiceImpl.getOne(templateQueryWrapper); Template template = templateServiceImpl.getOne(templateQueryWrapper);
String content = template.getContent(); String content = template.getContent();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
...@@ -103,7 +108,7 @@ public class RepairConsultServiceImpl extends BaseService<RepairConsultDto,Repai ...@@ -103,7 +108,7 @@ public class RepairConsultServiceImpl extends BaseService<RepairConsultDto,Repai
throw new BadRequest("警情类型缺失"); throw new BadRequest("警情类型缺失");
content = content.replace("$createTime",createTime).replace("$createUser",createUser).replace("$call",emergency_call); content = content.replace("$createTime",createTime).replace("$createUser",createUser).replace("$call",emergency_call);
content = content.replace("$area",area).replace("$alertType",alertType); content = content.replace("$area",area).replace("$alertType",alertType);
} else if("PQ".equals(type)) { } else if(TzsCommonParam.PQ.equals(type)) {
String createUser = user.getUserName(); String createUser = user.getUserName();
DispatchTask dispatchTask = dispatchTaskServiceImpl.getById(taskId); DispatchTask dispatchTask = dispatchTaskServiceImpl.getById(taskId);
String unit = dispatchTask.getResponseOrgName(); String unit = dispatchTask.getResponseOrgName();
...@@ -125,25 +130,25 @@ public class RepairConsultServiceImpl extends BaseService<RepairConsultDto,Repai ...@@ -125,25 +130,25 @@ public class RepairConsultServiceImpl extends BaseService<RepairConsultDto,Repai
} }
content = content.replace("$createTime",createTime).replace("$createUser",createUser).replace("$unit",unit); content = content.replace("$createTime",createTime).replace("$createUser",createUser).replace("$unit",unit);
content = content.replace("$person",person).replace("$phone",phone).replace("$taskType",taskType); content = content.replace("$person",person).replace("$phone",phone).replace("$taskType",taskType);
} else if("DD".equals(type)) { } else if(TzsCommonParam.DD.equals(type)) {
DispatchTask dispatchTask = dispatchTaskServiceImpl.getById(taskId); DispatchTask dispatchTask = dispatchTaskServiceImpl.getById(taskId);
String person = dispatchTask.getResponseUserName(); String person = dispatchTask.getResponseUserName();
content = content.replace("$createTime",createTime).replace("$person",person); content = content.replace("$createTime",createTime).replace("$person",person);
RescueProcessDto rescueProcessDto = rescueProcessServiceImpl.getProcessByAlertId(alertId); RescueProcessDto rescueProcessDto = rescueProcessServiceImpl.getProcessByAlertId(alertId);
String FKFS = rescueProcessDto.getArriveFeedbackType(); String FKFS = rescueProcessDto.getArriveFeedbackType();
content = content.replace("$FKFS",FKFS); content = content.replace("$FKFS",FKFS);
} else if("JC".equals(type)) { } else if(TzsCommonParam.JC.equals(type)) {
DispatchTask dispatchTask = dispatchTaskServiceImpl.getById(taskId); DispatchTask dispatchTask = dispatchTaskServiceImpl.getById(taskId);
String person = dispatchTask.getResponseUserName(); String person = dispatchTask.getResponseUserName();
content = content.replace("$createTime",createTime).replace("$person",person); content = content.replace("$createTime",createTime).replace("$person",person);
RescueProcessDto rescueProcessDto = rescueProcessServiceImpl.getProcessByAlertId(alertId); RescueProcessDto rescueProcessDto = rescueProcessServiceImpl.getProcessByAlertId(alertId);
String FKFS = rescueProcessDto.getArriveFeedbackType(); String FKFS = rescueProcessDto.getArriveFeedbackType();
content = content.replace("$FKFS",FKFS); content = content.replace("$FKFS",FKFS);
} else if("JYHF".equals(type)) { } else if(TzsCommonParam.JYHF.equals(type)) {
String createUser = user.getUserName(); String createUser = user.getUserName();
String create = alertCalledVo.getEmergencyPerson(); String create = alertCalledVo.getEmergencyPerson();
content = content.replace("$createTime",createTime).replace("$createUser",createUser).replace("$create",create); content = content.replace("$createTime",createTime).replace("$createUser",createUser).replace("$create",create);
} else if("WXFK".equals(type)) { //从派遣单获取数据 } else if(TzsCommonParam.WXFK.equals(type)) { //从派遣单获取数据
DispatchTask dispatchTask = dispatchTaskServiceImpl.getById(taskId); DispatchTask dispatchTask = dispatchTaskServiceImpl.getById(taskId);
String person = dispatchTask.getResponseUserName(); String person = dispatchTask.getResponseUserName();
content = content.replace("$createTime",createTime).replace("$person",person); content = content.replace("$createTime",createTime).replace("$person",person);
...@@ -152,12 +157,12 @@ public class RepairConsultServiceImpl extends BaseService<RepairConsultDto,Repai ...@@ -152,12 +157,12 @@ public class RepairConsultServiceImpl extends BaseService<RepairConsultDto,Repai
List<AlertFormValue> dynamicForm = dispatchPaperFormDto.getDynamicFormAlert(); List<AlertFormValue> dynamicForm = dispatchPaperFormDto.getDynamicFormAlert();
Map<String,String> tempMap = new HashMap<String,String>(); Map<String,String> tempMap = new HashMap<String,String>();
dynamicForm.stream().forEach(alertFormValue -> { dynamicForm.stream().forEach(alertFormValue -> {
if("fix_result".equals(alertFormValue.getFieldCode())) { if(TzsCommonParam.FIX_RESULT.equals(alertFormValue.getFieldCode())) {
tempMap.put("fixResult",alertFormValue.getFieldValue()); tempMap.put("fixResult",alertFormValue.getFieldValue());
} }
}); });
content = content.replace("$FKFS",dispatchPaper.getFeedbackType()).replace("$fixResult",tempMap.get("fixResult")); content = content.replace("$FKFS",dispatchPaper.getFeedbackType()).replace("$fixResult",tempMap.get("fixResult"));
} else if("WXFK-TS".equals(type)) { //从派遣单获取数据 } else if(TzsCommonParam.WXFK_TS.equals(type)) { //从派遣单获取数据
DispatchTask dispatchTask = dispatchTaskServiceImpl.getById(taskId); DispatchTask dispatchTask = dispatchTaskServiceImpl.getById(taskId);
String person = dispatchTask.getResponseUserName(); String person = dispatchTask.getResponseUserName();
content = content.replace("$createTime",createTime).replace("$person",person); content = content.replace("$createTime",createTime).replace("$person",person);
...@@ -166,13 +171,13 @@ public class RepairConsultServiceImpl extends BaseService<RepairConsultDto,Repai ...@@ -166,13 +171,13 @@ public class RepairConsultServiceImpl extends BaseService<RepairConsultDto,Repai
List<AlertFormValue> dynamicForm = dispatchPaperFormDto.getDynamicFormAlert(); List<AlertFormValue> dynamicForm = dispatchPaperFormDto.getDynamicFormAlert();
Map<String,String> tempMap = new HashMap<String,String>(); Map<String,String> tempMap = new HashMap<String,String>();
dynamicForm.stream().forEach(alertFormValue -> { dynamicForm.stream().forEach(alertFormValue -> {
if("action_result".equals(alertFormValue.getFieldCode())) { if(TzsCommonParam.ACTION_RESULT.equals(alertFormValue.getFieldCode())) {
tempMap.put("fixResult",alertFormValue.getFieldValue()); tempMap.put("fixResult",alertFormValue.getFieldValue());
} }
}); });
content = content.replace("$FKFS",dispatchPaper.getFeedbackType()).replace("$fixResult",tempMap.get("fixResult")); content = content.replace("$FKFS",dispatchPaper.getFeedbackType()).replace("$fixResult",tempMap.get("fixResult"));
type = "WXFK"; type = TzsCommonParam.WXFK;
} else if("BXFK".equals(type)) { } else if(TzsCommonParam.BXFK.equals(type)) {
DispatchTask dispatchTask = dispatchTaskServiceImpl.getById(taskId); DispatchTask dispatchTask = dispatchTaskServiceImpl.getById(taskId);
String person = dispatchTask.getResponseUserName(); String person = dispatchTask.getResponseUserName();
content = content.replace("$createTime",createTime).replace("$person",person); content = content.replace("$createTime",createTime).replace("$person",person);
...@@ -180,14 +185,14 @@ public class RepairConsultServiceImpl extends BaseService<RepairConsultDto,Repai ...@@ -180,14 +185,14 @@ public class RepairConsultServiceImpl extends BaseService<RepairConsultDto,Repai
List<AlertFormValue> dynamicForm = dispatchPaperFormDto.getDynamicFormAlert(); List<AlertFormValue> dynamicForm = dispatchPaperFormDto.getDynamicFormAlert();
Map<String,String> tempMap = new HashMap<String,String>(); Map<String,String> tempMap = new HashMap<String,String>();
dynamicForm.stream().forEach(alertFormValue -> { dynamicForm.stream().forEach(alertFormValue -> {
if("fix_feedback_type".equals(alertFormValue.getFieldCode())) { if(TzsCommonParam.FIX_FEEDBACK_TYPE.equals(alertFormValue.getFieldCode())) {
tempMap.put("FKFS",alertFormValue.getFieldValue()); tempMap.put(TzsCommonParam.FKFS,alertFormValue.getFieldValue());
} else if("fix_result".equals(alertFormValue.getFieldCode())) { } else if(TzsCommonParam.FIX_RESULT.equals(alertFormValue.getFieldCode())) {
tempMap.put("fixResult",alertFormValue.getFieldValue()); tempMap.put("fixResult",alertFormValue.getFieldValue());
} }
}); });
content = content.replace("$FKFS",tempMap.get("FKFS")).replace("$feedbackResult",tempMap.get("fixResult")); content = content.replace("$FKFS",tempMap.get(TzsCommonParam.FKFS)).replace("$feedbackResult",tempMap.get("fixResult"));
} else if("TSRFK".equals(type)) { } else if(TzsCommonParam.TSRFK.equals(type)) {
DispatchTask dispatchTask = dispatchTaskServiceImpl.getById(taskId); DispatchTask dispatchTask = dispatchTaskServiceImpl.getById(taskId);
String person = dispatchTask.getResponseUserName(); String person = dispatchTask.getResponseUserName();
content = content.replace("$createTime",createTime).replace("$person",person); content = content.replace("$createTime",createTime).replace("$person",person);
...@@ -195,13 +200,13 @@ public class RepairConsultServiceImpl extends BaseService<RepairConsultDto,Repai ...@@ -195,13 +200,13 @@ public class RepairConsultServiceImpl extends BaseService<RepairConsultDto,Repai
List<AlertFormValue> dynamicForm = dispatchPaperFormDto.getDynamicFormAlert(); List<AlertFormValue> dynamicForm = dispatchPaperFormDto.getDynamicFormAlert();
Map<String,String> tempMap = new HashMap<String,String>(); Map<String,String> tempMap = new HashMap<String,String>();
dynamicForm.stream().forEach(alertFormValue -> { dynamicForm.stream().forEach(alertFormValue -> {
if("consult_feedback_type".equals(alertFormValue.getFieldCode())) { if(TzsCommonParam.CONSULT_FEEDBACK_TYPE.equals(alertFormValue.getFieldCode())) {
tempMap.put("FKFS",alertFormValue.getFieldValue()); tempMap.put(TzsCommonParam.FKFS,alertFormValue.getFieldValue());
} else if("action_result".equals(alertFormValue.getFieldCode())) { } else if(TzsCommonParam.ACTION_RESULT.equals(alertFormValue.getFieldCode())) {
tempMap.put("action_result",alertFormValue.getFieldValue()); tempMap.put("action_result",alertFormValue.getFieldValue());
} }
}); });
content = content.replace("$FKFS",tempMap.get("FKFS")).replace("$feedbackResult",tempMap.get("action_result")); content = content.replace("$FKFS",tempMap.get(TzsCommonParam.FKFS)).replace("$feedbackResult",tempMap.get("action_result"));
} }
repairConsult.setType(AlertStageEnums.getEnumByCode(type).getId()); repairConsult.setType(AlertStageEnums.getEnumByCode(type).getId());
repairConsult.setAlertStageCode(AlertStageEnums.getEnumByCode(type).getId()); repairConsult.setAlertStageCode(AlertStageEnums.getEnumByCode(type).getId());
......
...@@ -96,7 +96,6 @@ public class RescueProcessServiceImpl extends BaseService<RescueProcessDto,Rescu ...@@ -96,7 +96,6 @@ public class RescueProcessServiceImpl extends BaseService<RescueProcessDto,Rescu
if(arriveTime != null && dispatchTime != null) { if(arriveTime != null && dispatchTime != null) {
Long arriveTimes = arriveTime.getTime() - dispatchTime.getTime(); // 相差毫秒数 Long arriveTimes = arriveTime.getTime() - dispatchTime.getTime(); // 相差毫秒数
SimpleDateFormat formatter = new SimpleDateFormat("HH:mm:ss");//这里想要只保留分秒可以写成"mm:ss" SimpleDateFormat formatter = new SimpleDateFormat("HH:mm:ss");//这里想要只保留分秒可以写成"mm:ss"
formatter.setTimeZone(TimeZone.getTimeZone("GMT+00:00"));
String hms = formatter.format(arriveTimes); String hms = formatter.format(arriveTimes);
rescueProcessDto.setIsTimeout(arriveTimes < 1800000 ? false : true); rescueProcessDto.setIsTimeout(arriveTimes < 1800000 ? false : true);
rescueProcessDto.setArriveUseTime(hms); rescueProcessDto.setArriveUseTime(hms);
......
...@@ -2016,13 +2016,14 @@ ...@@ -2016,13 +2016,14 @@
<select id="getCheckDetail" resultType="Map"> <select id="getCheckDetail" resultType="Map">
SELECT SELECT
pc.id checkId, pc.id checkId,
pc.is_ok isOk, pci.is_ok isOk,
date_format( date_format(
pc.check_time, pc.check_time,
'%Y-%m-%d %H:%i:%s' '%Y-%m-%d %H:%i:%s'
) maintenanceDate, ) maintenanceDate,
pp.id pointId, pp.id pointId,
pp.equipment_id equipmentId, pp.equipment_id equipmentId,
pp.remark remark,
pp.owner_name ownerName, pp.owner_name ownerName,
pp.equipment_name equipmentName, pp.equipment_name equipmentName,
pp.belong_system_id systemId, pp.belong_system_id systemId,
...@@ -2038,12 +2039,17 @@ ...@@ -2038,12 +2039,17 @@
ppl.name planName, ppl.name planName,
pp.plan_type planType, pp.plan_type planType,
ppt.user_name planUser, ppt.user_name planUser,
pii.name itemName pci.input_name itemName,
pii.maintenance_content itemContent,
pcs.photo_data picture,
pcs.point_name pointName,
pcs.shot_type shotType
FROM p_check pc FROM p_check pc
LEFT JOIN p_point pp ON pp.id = pc.point_id LEFT JOIN p_point pp ON pp.id = pc.point_id
LEFT JOIN p_plan ppl ON ppl.id = pc.plan_id LEFT JOIN p_plan ppl ON ppl.id = pc.plan_id
LEFT JOIN p_check_input pci ON pci.check_id = pc.id LEFT JOIN p_check_input pci ON pci.check_id = pc.id
LEFT JOIN p_input_item pii ON pii.id = pci.input_id LEFT JOIN p_input_item pii ON pii.id = pci.input_id
LEFT JOIN p_check_shot pcs ON pcs.check_id = pc.id
LEFT JOIN p_plan_task ppt ON ppt.id = pc.plan_task_id LEFT JOIN p_plan_task ppt ON ppt.id = pc.plan_task_id
WHERE WHERE
pc.id = #{id} pc.id = #{id}
......
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