|
|
|
|
@ -5,6 +5,7 @@ import com.github.pagehelper.PageInfo; |
|
|
|
|
import com.hisense.hiatmp.model.common.*; |
|
|
|
|
import com.hisense.hiatmp.model.common.DTO.HiddenDangerVO; |
|
|
|
|
import com.hisense.hiatmp.model.common.DTO.SectionDTO; |
|
|
|
|
import com.hisense.hiatmp.model.common.DTO.ThtTimeLineDTO; |
|
|
|
|
import com.hisense.hiatmp.model.common.VO.BasicInfoVO; |
|
|
|
|
import com.hisense.hiatmp.model.common.VO.SectionVO; |
|
|
|
|
import com.hisense.hiatmp.server_api.mapper.ConfigureMapper; |
|
|
|
|
@ -27,6 +28,7 @@ import org.springframework.web.bind.annotation.*; |
|
|
|
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest; |
|
|
|
|
import java.math.BigDecimal; |
|
|
|
|
import java.text.SimpleDateFormat; |
|
|
|
|
import java.util.*; |
|
|
|
|
|
|
|
|
|
@Slf4j |
|
|
|
|
@ -450,8 +452,8 @@ public class HighDangerController { |
|
|
|
|
// 获取最近道路
|
|
|
|
|
@PostMapping("/getNearRoadInfo") |
|
|
|
|
public ServerResponse<?> getNearRoad(@RequestBody Point point, |
|
|
|
|
@RequestParam(defaultValue = "1") Long pageNum, |
|
|
|
|
@RequestParam(defaultValue = "10") Long pageSize, |
|
|
|
|
@RequestParam(defaultValue = "1") Integer pageNum, |
|
|
|
|
@RequestParam(defaultValue = "10") Integer pageSize, |
|
|
|
|
HttpServletRequest request |
|
|
|
|
) { |
|
|
|
|
log.info("/getNearRoadInfo(获取最近道路)接口被调用,调用ip: {}, 入参:{},{},{}", request.getRemoteAddr(), point, pageNum, pageSize); |
|
|
|
|
@ -611,13 +613,20 @@ public class HighDangerController { |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
int startIdx = (pageNum - 1) * pageSize; |
|
|
|
|
int endIdx = Math.min(startIdx + pageSize, combinedMap.size()); |
|
|
|
|
|
|
|
|
|
List<HashMap<String, Object>> pageData = combinedMap.subList(startIdx, endIdx); |
|
|
|
|
|
|
|
|
|
// PageHelper.startPage(pageNum, pageSize);
|
|
|
|
|
// hashMap.put("businessId",combinedMap);
|
|
|
|
|
hashMap.put("params", combinedMap); |
|
|
|
|
|
|
|
|
|
log.info("/getNearRoadInfo(获取最近道路)接口返回, 客户端ip: {}, 返回数据:{}", request.getRemoteAddr(), combinedMap); |
|
|
|
|
|
|
|
|
|
// PageInfo<HashMap<String, Object>> pageInfo = new PageInfo<>(combinedMap);
|
|
|
|
|
|
|
|
|
|
return ServerResponse.ok(combinedMap); |
|
|
|
|
return ServerResponse.ok(pageData); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/* |
|
|
|
|
@ -633,14 +642,26 @@ public class HighDangerController { |
|
|
|
|
|
|
|
|
|
// 查询当前排查所在路段
|
|
|
|
|
@GetMapping("/getDangerRoad") |
|
|
|
|
public ServerResponse<?> getDangerRoad(@RequestParam String businessId, HttpServletRequest request) { |
|
|
|
|
public ServerResponse<?> getDangerRoad(@RequestParam String businessId, |
|
|
|
|
@RequestParam String ifCross, |
|
|
|
|
HttpServletRequest request) { |
|
|
|
|
|
|
|
|
|
SectionDTO sectionByCode; |
|
|
|
|
log.info("/getDangerRoad(查询当前排查所在路段)接口被调用,调用ip: {}, 入参:{}", request.getRemoteAddr(), businessId); |
|
|
|
|
|
|
|
|
|
HighDangerRoad roadInfo = highDangerMapper.getRoadInfo(businessId); |
|
|
|
|
roadInfo.setDeptId(operatorMapper.getOperatorById(roadInfo.getOperator()).getCdepartmentid()); |
|
|
|
|
|
|
|
|
|
SectionDTO sectionByCode = highDangerMapper.getSectionByCode(roadInfo.getSectionCode()); |
|
|
|
|
// 路段
|
|
|
|
|
if("1".equals(ifCross)){ |
|
|
|
|
sectionByCode = highDangerMapper.getSectionByCode(roadInfo.getSectionCode()); |
|
|
|
|
} |
|
|
|
|
// 路口
|
|
|
|
|
else if("2".equals(ifCross)){ |
|
|
|
|
sectionByCode = highDangerMapper.getCrossingByCode(roadInfo.getSectionCode()); |
|
|
|
|
}else{ |
|
|
|
|
return ServerResponse.error("无路口和路段信息"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (sectionByCode.getPosition() == null) { |
|
|
|
|
return ServerResponse.ok("路段点位为空", null); |
|
|
|
|
@ -979,6 +1000,11 @@ public class HighDangerController { |
|
|
|
|
@Transactional |
|
|
|
|
@PostMapping("/saveManualInvestigation") |
|
|
|
|
public ServerResponse<?> saveManualInvestigation(@RequestBody ManualInvestigation manualInvestigation, HttpServletRequest request) { |
|
|
|
|
|
|
|
|
|
UUID uuid = UUID.fromString(UUID.randomUUID().toString()); |
|
|
|
|
String nid = uuid.toString().replaceAll("-", ""); |
|
|
|
|
Date date = new Date(); |
|
|
|
|
|
|
|
|
|
String ftpUrl = "ftp://" + userName + ":" + passWord + "@" + ip + ":" + port + CURRENT_DIR; |
|
|
|
|
log.info("/saveManualInvestigation(保存 & 暂存人工排查)接口被调用,调用ip: {}, 入参:{}", request.getRemoteAddr(), manualInvestigation); |
|
|
|
|
Date lastModDate = new Date(); |
|
|
|
|
@ -986,13 +1012,21 @@ public class HighDangerController { |
|
|
|
|
|
|
|
|
|
String hidden_businessId = manualInvestigation.getBusinessId(); |
|
|
|
|
|
|
|
|
|
String cdepartmentid = ""; |
|
|
|
|
|
|
|
|
|
Operator operatorById = operatorMapper.getOperatorById(manualInvestigation.getOperator()); |
|
|
|
|
if (operatorById != null) { |
|
|
|
|
cdepartmentid = operatorById.getCdepartmentid(); |
|
|
|
|
} else { |
|
|
|
|
return ServerResponse.error("未找到当前用户"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 新增排查
|
|
|
|
|
if(manualInvestigation.getTemporary() == 2){ |
|
|
|
|
HighDangerBase highDangerBase = new HighDangerBase(); |
|
|
|
|
HighDangerRoad highDangerRoad = new HighDangerRoad(); |
|
|
|
|
|
|
|
|
|
UUID uuid = UUID.fromString(UUID.randomUUID().toString()); |
|
|
|
|
String nid = uuid.toString().replaceAll("-", ""); |
|
|
|
|
|
|
|
|
|
hidden_businessId = "ZZ" + highDangerService.random12(); |
|
|
|
|
|
|
|
|
|
// base主键
|
|
|
|
|
@ -1003,6 +1037,8 @@ public class HighDangerController { |
|
|
|
|
highDangerBase.setName(manualInvestigation.getName()); |
|
|
|
|
// 操作用户
|
|
|
|
|
highDangerBase.setOperator(manualInvestigation.getOperator()); |
|
|
|
|
highDangerBase.setPcCount("0"); |
|
|
|
|
highDangerBase.setApproveStatus("0"); |
|
|
|
|
|
|
|
|
|
// 道路NID
|
|
|
|
|
highDangerRoad.setNid(nid); |
|
|
|
|
@ -1010,6 +1046,9 @@ public class HighDangerController { |
|
|
|
|
highDangerRoad.setBusinessId(hidden_businessId); |
|
|
|
|
// 绑定路段
|
|
|
|
|
highDangerRoad.setSectionCode(manualInvestigation.getSectionCode()); |
|
|
|
|
highDangerRoad.setIfCross(manualInvestigation.getIfCross()); |
|
|
|
|
highDangerRoad.setBelongXq(cdepartmentid); |
|
|
|
|
highDangerRoad.setPcCount("0"); |
|
|
|
|
|
|
|
|
|
// 分别插入两张表
|
|
|
|
|
highDangerService.insertDanger(highDangerBase); |
|
|
|
|
@ -1061,13 +1100,11 @@ public class HighDangerController { |
|
|
|
|
extra.setBusinessId(hidden_businessId); |
|
|
|
|
highDangerMapper.saveThtHiddenDataCollectConfigExtra(extra); |
|
|
|
|
} |
|
|
|
|
Date date = new Date(); |
|
|
|
|
// 隐患排查表--如果存在该记录则更新
|
|
|
|
|
highDangerMapper.deleteRoadInfo(hidden_businessId); |
|
|
|
|
for (HiddenDangerDTO details : manualInvestigation.getDescribe()) { |
|
|
|
|
// 随机生成UUID
|
|
|
|
|
UUID uuid = UUID.randomUUID(); |
|
|
|
|
String uuidString = uuid.toString().replace("-", ""); |
|
|
|
|
String uuidString = UUID.randomUUID().toString().replace("-", ""); |
|
|
|
|
details.setNid(uuidString); |
|
|
|
|
details.setBusinessId(hidden_businessId); |
|
|
|
|
details.setPcCount(manualInvestigation.getPcCount()); |
|
|
|
|
@ -1086,11 +1123,11 @@ public class HighDangerController { |
|
|
|
|
&& StringUtils.isNotEmpty(details.getHdPic())) { |
|
|
|
|
String hdPicArr[] = details.getHdPic().split(","); |
|
|
|
|
for (String s : hdPicArr) { |
|
|
|
|
uuid = UUID.randomUUID(); |
|
|
|
|
uuidString = uuid.toString().replace("-", ""); |
|
|
|
|
nid = UUID.randomUUID().toString().replace("-", ""); |
|
|
|
|
// nid = uuid.toString().replace("-", "");
|
|
|
|
|
ThtAttachs thtAttachs = new ThtAttachs(); |
|
|
|
|
String accachName = s.substring(s.lastIndexOf("/") + 1); |
|
|
|
|
thtAttachs.setId(uuidString); |
|
|
|
|
thtAttachs.setId(nid); |
|
|
|
|
thtAttachs.setAttachUrl(ftpUrl + accachName); |
|
|
|
|
thtAttachs.setAttachType("3"); |
|
|
|
|
thtAttachs.setUploadTime(date); |
|
|
|
|
@ -1103,6 +1140,18 @@ public class HighDangerController { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 新增时间线表
|
|
|
|
|
ThtTimeLineDTO thtTimeLineDTO = new ThtTimeLineDTO(); |
|
|
|
|
thtTimeLineDTO.setNid(String.valueOf(uuid)); |
|
|
|
|
thtTimeLineDTO.setInsertTime(date); |
|
|
|
|
thtTimeLineDTO.setBusinessId(hidden_businessId); |
|
|
|
|
thtTimeLineDTO.setStatus("10"); |
|
|
|
|
thtTimeLineDTO.setTitle("隐患排查"); |
|
|
|
|
thtTimeLineDTO.setLastModDate(date); |
|
|
|
|
thtTimeLineDTO.setOperator(manualInvestigation.getOperator()); |
|
|
|
|
//
|
|
|
|
|
// highDangerService.insertTimeLine(thtTimeLineDTO);
|
|
|
|
|
/*if(!highDangerMapper.isExtraExistence(manualInvestigation.getBusinessId()).isEmpty()){ |
|
|
|
|
}else{ |
|
|
|
|
}*/ |
|
|
|
|
@ -1163,9 +1212,8 @@ public class HighDangerController { |
|
|
|
|
} |
|
|
|
|
highDangerMapper.updateDangerRoad(hdFlag, hidden_businessId, pcCount, manualInvestigation.getOperator()); |
|
|
|
|
ThtApprove thtAApprove = new ThtApprove(); |
|
|
|
|
UUID uuid = UUID.randomUUID(); |
|
|
|
|
String uuidString = uuid.toString().replace("-", ""); |
|
|
|
|
thtAApprove.setNid(uuidString); |
|
|
|
|
// String uuidString = uuid.toString().replace("-", "");
|
|
|
|
|
thtAApprove.setNid(nid); |
|
|
|
|
thtAApprove.setBusinessId(hidden_businessId); |
|
|
|
|
thtAApprove.setOperator(manualInvestigation.getLastModeUser()); |
|
|
|
|
thtAApprove.setStatus("10"); |
|
|
|
|
@ -1211,6 +1259,129 @@ public class HighDangerController { |
|
|
|
|
return ServerResponse.ok(roadTypes); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 审批列表
|
|
|
|
|
@GetMapping("/getHigDangerApproval") |
|
|
|
|
public ServerResponse<?> getHigDangerApproval(@RequestParam String nuserid, |
|
|
|
|
@RequestParam(defaultValue = "1") Integer pageNum, |
|
|
|
|
@RequestParam(defaultValue = "10") Integer pageSize, |
|
|
|
|
@RequestParam(defaultValue = "") String search |
|
|
|
|
){ |
|
|
|
|
String cdepartmentid = ""; |
|
|
|
|
|
|
|
|
|
Operator operatorById = operatorMapper.getOperatorById(nuserid); |
|
|
|
|
if (operatorById != null) { |
|
|
|
|
cdepartmentid = operatorById.getCdepartmentid(); |
|
|
|
|
} else { |
|
|
|
|
return ServerResponse.error("未找到当前用户"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
List<HighDangerBase> approvalList = highDangerService.getHigDangerApproval(cdepartmentid,search); |
|
|
|
|
|
|
|
|
|
PageHelper.startPage(pageNum, pageSize); |
|
|
|
|
PageInfo<HighDangerBase> pageInfo = new PageInfo<>(approvalList); |
|
|
|
|
|
|
|
|
|
return ServerResponse.ok(pageInfo); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@GetMapping("/getProcessRecord") |
|
|
|
|
public ServerResponse<?> getProcessRecord(@RequestParam String businessId){ |
|
|
|
|
Integer flag = 1; |
|
|
|
|
List<ThtApprove> processRecord = highDangerService.getProcessRecord(businessId); |
|
|
|
|
LinkedHashMap<String, Object> processMap = new LinkedHashMap<>(); |
|
|
|
|
|
|
|
|
|
HighDangerBase hiddenDangerBaseById = highDangerMapper.getHiddenDangerBaseById(businessId); |
|
|
|
|
Operator operatorById1 = operatorMapper.getOperatorById(hiddenDangerBaseById.getOperator()); |
|
|
|
|
// String username = operatorById.getCusername();
|
|
|
|
|
ThtApprove thtApprove1 = new ThtApprove(); |
|
|
|
|
thtApprove1.setApprovalInfo( operatorById1.getCusername() + "创建排查"); |
|
|
|
|
thtApprove1.setOperateTime(hiddenDangerBaseById.getFindTime()); |
|
|
|
|
thtApprove1.setBusinessId(businessId); |
|
|
|
|
processMap.put("0",thtApprove1); |
|
|
|
|
|
|
|
|
|
for (ThtApprove thtApprove : processRecord){ |
|
|
|
|
// 获取操作用户
|
|
|
|
|
Operator operatorById = operatorMapper.getOperatorById(thtApprove.getOperator()); |
|
|
|
|
String username = operatorById.getCusername(); |
|
|
|
|
|
|
|
|
|
if("10".equals(thtApprove.getStatus())){ |
|
|
|
|
if("0".equals(thtApprove.getOperateContent())){ |
|
|
|
|
thtApprove.setApprovalInfo(username + "排查完成"); |
|
|
|
|
processMap.put(flag.toString(), thtApprove); |
|
|
|
|
flag++; |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
if ("1".equals(thtApprove.getOperateContent())) { |
|
|
|
|
if("-1".equals(thtApprove.getApproveResult())){ |
|
|
|
|
thtApprove.setApprovalInfo(username + "一级审批驳回"); |
|
|
|
|
processMap.put(flag.toString(), thtApprove); |
|
|
|
|
flag++; |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
if("1".equals(thtApprove.getApproveResult())){ |
|
|
|
|
thtApprove.setApprovalInfo(username + "一级审批通过"); |
|
|
|
|
processMap.put(flag.toString(), thtApprove); |
|
|
|
|
flag++; |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if ("2".equals(thtApprove.getOperateContent())) { |
|
|
|
|
if("-1".equals(thtApprove.getApproveResult())){ |
|
|
|
|
thtApprove.setApprovalInfo(username + "二级审批驳回"); |
|
|
|
|
processMap.put(flag.toString(), thtApprove); |
|
|
|
|
flag++; |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
if("1".equals(thtApprove.getApproveResult())){ |
|
|
|
|
thtApprove.setApprovalInfo(username + "二级审批通过"); |
|
|
|
|
processMap.put(flag.toString(), thtApprove); |
|
|
|
|
flag++; |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if("20".equals(thtApprove.getStatus())){ |
|
|
|
|
if("0".equals(thtApprove.getOperateContent())){ |
|
|
|
|
thtApprove.setApprovalInfo(username + "治理完成"); |
|
|
|
|
processMap.put(flag.toString(), thtApprove); |
|
|
|
|
flag++; |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
if ("1".equals(thtApprove.getOperateContent())) { |
|
|
|
|
if("-1".equals(thtApprove.getApproveResult())){ |
|
|
|
|
thtApprove.setApprovalInfo(username + "一级审批驳回"); |
|
|
|
|
processMap.put(flag.toString(), thtApprove); |
|
|
|
|
flag++; |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
if("1".equals(thtApprove.getOperateContent())){ |
|
|
|
|
thtApprove.setApprovalInfo(username + "一级审批通过"); |
|
|
|
|
processMap.put(flag.toString(), thtApprove); |
|
|
|
|
flag++; |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if ("2".equals(thtApprove.getOperateContent())) { |
|
|
|
|
if("-1".equals(thtApprove.getApproveResult())){ |
|
|
|
|
thtApprove.setApprovalInfo(username + "二级审批驳回"); |
|
|
|
|
processMap.put(flag.toString(), thtApprove); |
|
|
|
|
flag++; |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
if("1".equals(thtApprove.getApproveResult())){ |
|
|
|
|
thtApprove.setApprovalInfo(username + "二级审批通过"); |
|
|
|
|
processMap.put(flag.toString(), thtApprove); |
|
|
|
|
flag++; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return ServerResponse.ok(processMap); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 图片上传接口
|
|
|
|
|
/*@PostMapping("/uploadImage") |
|
|
|
|
|