三轮车功能修改,用户权限表关系改为user_role_relation

master
Zangzhipeng 2 years ago
parent b304a4c71a
commit 973f00ec7e
  1. 4
      hiatmp-hidden-danger-server/src/main/java/com/hisense/hiatmp/server_api/controller/AuthController.java
  2. 336
      hiatmp-hidden-danger-server/src/main/java/com/hisense/hiatmp/server_api/controller/HighDangerController.java
  3. 8
      hiatmp-hidden-danger-server/src/main/java/com/hisense/hiatmp/server_api/controller/TricycleController.java
  4. 1
      hiatmp-hidden-danger-server/src/main/java/com/hisense/hiatmp/server_api/mapper/HighDangerMapper.java
  5. 2
      hiatmp-hidden-danger-server/src/main/java/com/hisense/hiatmp/server_api/service/HighDangerService.java
  6. 13
      hiatmp-hidden-danger-server/src/main/java/com/hisense/hiatmp/server_api/service/impl/HighDangerBaseServiceImpl.java
  7. 4
      hiatmp-hidden-danger-server/src/main/resources/sql-mapper/ConfigMapper.xml
  8. 33
      hiatmp-hidden-danger-server/src/main/resources/sql-mapper/HighDangerMapper.xml
  9. 4
      hiatmp-hidden-danger-server/src/main/resources/sql-mapper/OperatorMapper.xml
  10. 2
      hiatmp-hidden-danger-server/src/main/resources/sql-mapper/ThtTricycleInfoBaseMapper.xml
  11. 2
      hiatmp-model/src/main/java/com/hisense/hiatmp/model/common/DTO/SectionDTO.java
  12. 28
      hiatmp-model/src/main/java/com/hisense/hiatmp/model/common/HighDangerBase.java
  13. 9
      hiatmp-model/src/main/java/com/hisense/hiatmp/model/common/enums/RoleEnum.java

@ -33,7 +33,7 @@ public class AuthController {
/** /**
* 用户登录 * 用户登录
*/ */
@PostMapping("/login") @PostMapping("/login")
public ServerResponse<?> login(@RequestBody OperatorDTO operator) { public ServerResponse<?> login(@RequestBody OperatorDTO operator) {
HashMap<String, Object> authMap = new HashMap<>(); HashMap<String, Object> authMap = new HashMap<>();
@ -42,7 +42,7 @@ public class AuthController {
Operator operatorById = operatorMapper.getOperatorById(operator.getNuserid()); Operator operatorById = operatorMapper.getOperatorById(operator.getNuserid());
if(operatorById != null){ if(operatorById != null){
// 密码加密 // 密码加密
String encrypt = authService.encrypt(operator.getCuserpwd()+ operator.getNuserid()); String encrypt = authService.encrypt(operator.getCuserpwd() + operator.getNuserid());
// LocalDate currentDate = LocalDate.now(); // LocalDate currentDate = LocalDate.now();
// long timestamp = currentDate.atStartOfDay(ZoneId.systemDefault()).toInstant().toEpochMilli(); // long timestamp = currentDate.atStartOfDay(ZoneId.systemDefault()).toInstant().toEpochMilli();

@ -139,17 +139,17 @@ public class HighDangerController {
// 获取用户权限 // 获取用户权限
List<String> roleById = operatorMapper.getRoleById(nuserid); List<String> roleById = operatorMapper.getRoleById(nuserid);
if(roleById.contains("领导")){ if (roleById.contains("领导")) {
role = 1; role = 1;
}else if(roleById.contains("排查治理人员")){ } else if (roleById.contains("排查治理人员")) {
role = 2; role = 2;
}else if (roleById.contains("治理人员")){ } else if (roleById.contains("治理人员")) {
role = 3; role = 3;
}else{ } else {
role = 4; role = 4;
} }
List<HighDangerBaseNum> statusCounts = highDangerMapper.getStatusCounts(departmentid, nuserid,role); List<HighDangerBaseNum> statusCounts = highDangerMapper.getStatusCounts(departmentid, nuserid, role);
log.info("/getHighDangerStatusNum(查询各个状态的数据情况)接口数据返回,调用ip: {}, 出参:{}", request.getRemoteAddr(), statusCounts); log.info("/getHighDangerStatusNum(查询各个状态的数据情况)接口数据返回,调用ip: {}, 出参:{}", request.getRemoteAddr(), statusCounts);
return ServerResponse.ok(statusCounts); return ServerResponse.ok(statusCounts);
@ -165,6 +165,8 @@ public class HighDangerController {
@RequestParam(defaultValue = "") String search, @RequestParam(defaultValue = "") String search,
@RequestParam(defaultValue = "") String approve, @RequestParam(defaultValue = "") String approve,
@RequestParam(defaultValue = "") String classification, // 1 已完成 2 个人上报 3 系统下发 @RequestParam(defaultValue = "") String classification, // 1 已完成 2 个人上报 3 系统下发
@RequestParam(defaultValue = "", required = false) Float longitude,
@RequestParam(defaultValue = "", required = false) Float latitude,
@RequestParam(value = "startTime", required = false) String startTime, @RequestParam(value = "startTime", required = false) String startTime,
@RequestParam(value = "endTime", required = false) String endTime, @RequestParam(value = "endTime", required = false) String endTime,
HttpServletRequest request HttpServletRequest request
@ -208,15 +210,18 @@ public class HighDangerController {
int nearDay = base.getNearDay(); int nearDay = base.getNearDay();
int nearHour = base.getNearHour(); int nearHour = base.getNearHour();
// 获取审批流程列表
List<ThtApprove> processRecord = highDangerService.getProcessRecord(base.getBusinessId()); List<ThtApprove> processRecord = highDangerService.getProcessRecord(base.getBusinessId());
// 待办状态数据
if (Objects.equals(approve, "1")) { if (Objects.equals(approve, "1")) {
if (!processRecord.isEmpty()) { if (!processRecord.isEmpty()) {
// 取审批流程最后一条流程
ThtApprove thtApprove = processRecord.get(processRecord.size() - 1); ThtApprove thtApprove = processRecord.get(processRecord.size() - 1);
// 状态不是驳回
if (!Objects.equals(thtApprove.getApproveResult(), "-1")) { if (!Objects.equals(thtApprove.getApproveResult(), "-1")) {
String approveTime = ""; String approveTime = "";
String approveStatus = ""; String approveStatus = "";
String format = dateFormat.format(thtApprove.getOperateTime()); String format = dateFormat.format(thtApprove.getOperateTime());
@ -244,7 +249,8 @@ public class HighDangerController {
// base.setEnumname(base.getEnumname() + "(" + approveTime + ") " + approveStatus + " " + format); // base.setEnumname(base.getEnumname() + "(" + approveTime + ") " + approveStatus + " " + format);
} }
} }
} else { } else { // 已完成
// 获取审批状态流程表
ThtApprove thtApprove = highDangerMapper.getProcessRecordByNid(base.getBusinessId()); ThtApprove thtApprove = highDangerMapper.getProcessRecordByNid(base.getBusinessId());
if (thtApprove != null) { if (thtApprove != null) {
String approveTime = ""; String approveTime = "";
@ -282,13 +288,14 @@ public class HighDangerController {
} }
} }
} }
if (base.getTimeStatus() == null || base.getTimeStatus().equals("9")) {
base.setDeadlineStatus("正常");
base.setDeadlineType("3");
}
// 超期 if (base.getTimeStatus() == null || base.getTimeStatus().equals("9")) {
if (Objects.equals(base.getTimeStatus(), "1")) { base.setDeadlineStatus("正常");
base.setDeadlineType("3");
}
// 超期
if (Objects.equals(base.getTimeStatus(), "1")) {
// // 获取相差的时间戳 // // 获取相差的时间戳
// double timeDiffSeconds = Double.parseDouble(base.getTimeDiffEnd()); // double timeDiffSeconds = Double.parseDouble(base.getTimeDiffEnd());
// // 计算天数 // // 计算天数
@ -298,55 +305,16 @@ public class HighDangerController {
// // 计算小时数 // // 计算小时数
// int hours = (int)Math.ceil(remainingSeconds / 3600); // int hours = (int)Math.ceil(remainingSeconds / 3600);
if (delayDay == 0) { if (delayDay == 0) {
base.setDeadlineStatus("超期" + delayHour + "小时"); base.setDeadlineStatus("超期" + delayHour + "小时");
} else if (delayHour == 0) { } else if (delayHour == 0) {
base.setDeadlineStatus("超期" + delayDay + "天"); base.setDeadlineStatus("超期" + delayDay + "天");
} else { } else {
base.setDeadlineStatus("超期" + delayDay + "天" + delayHour + "小时"); base.setDeadlineStatus("超期" + delayDay + "天" + delayHour + "小时");
} }
base.setDeadlineType("1"); base.setDeadlineType("1");
// System.out.println("时间差为 " + days + " 天 " + hours + " 小时"); }
if (Objects.equals(base.getTimeStatus(), "2")) {
// String[] split = base.getTimeDiffEnd().split(" ");
// if(split.length > 1){
// base.setDeadlineStatus("正常");
// base.setDeadlineType("3");
// }
//
// // 使用正则表达式匹配天数和小时数
// Pattern pattern = Pattern.compile("(\\d+) days (\\d+):(\\d+):(\\d+\\.\\d+)");
// Matcher matcher = pattern.matcher(base.getTimeDiffEnd());
//
// if (matcher.find()) {
// int days = Integer.parseInt(matcher.group(1));
// int hours = Integer.parseInt(matcher.group(2));
// int minutes = Integer.parseInt(matcher.group(3));
// int seconds = Integer.parseInt(matcher.group(4));
// base.setDeadlineStatus("超期" + days + " 天 " + hours + " 小时");
// base.setDeadlineType("1");
// System.out.println("时间差为: " + days + " 天 " + hours + " 小时 " + minutes + " 分钟 " + seconds + " 秒");
// } else {
// System.out.println("无法匹配时间差格式");
// }
// Duration timeDiffEnd = Duration.parse(base.getTimeDiffEnd());
// // 获取总的秒数
// long totalSeconds = timeDiffEnd.getSeconds();
//
// // 计算天数
// long days = totalSeconds / (24 * 3600);
// // 计算剩余小时数
// long hours = (totalSeconds % (24 * 3600)) / 3600;
//
// base.setDeadlineStatus("超期" + days + " 天 " + hours + " 小时");
//
//// System.out.println("时间差为: " + days + " 天 " + hours + " 小时");
// base.setDeadlineType("1");
// continue;
}
if (Objects.equals(base.getTimeStatus(), "2")) {
// // 获取相差的时间戳 // // 获取相差的时间戳
// double timeDiffSeconds = Double.parseDouble(base.getTimeDiffStart()); // double timeDiffSeconds = Double.parseDouble(base.getTimeDiffStart());
// // 计算天数 // // 计算天数
@ -356,140 +324,82 @@ public class HighDangerController {
// // 计算小时数 // // 计算小时数
// int hours = (int)Math.ceil(remainingSeconds / 3600); // int hours = (int)Math.ceil(remainingSeconds / 3600);
if (nearDay == 0) { if (nearDay == 0) {
base.setDeadlineStatus("临期" + nearHour + "小时"); base.setDeadlineStatus("临期" + nearHour + "小时");
} else if (nearHour == 0) { } else if (nearHour == 0) {
base.setDeadlineStatus("临期" + nearDay + "天"); base.setDeadlineStatus("临期" + nearDay + "天");
} else { } else {
base.setDeadlineStatus("临期" + nearDay + "天" + nearHour + "小时"); base.setDeadlineStatus("临期" + nearDay + "天" + nearHour + "小时");
} }
base.setDeadlineType("2"); base.setDeadlineType("2");
} }
// Date pcEndTime = base.getPcEndTime();
// Date pcStartTime = base.getPcStartTime(); if("1".equals(approve) && "3".equals(classification)){
// // 为列表数据添加时间
// if (pcEndTime != null) { LinkedList<Map<String, Double>> pointList = new LinkedList<>();
// long diff = nowDate.getTime() - pcEndTime.getTime();
// // 时间差,天数 SectionDTO sectionDTO = new SectionDTO();
// long diffDays = diff / (24 * 60 * 60 * 1000); // 路口
// diffDays = Math.abs(diffDays); if("1".equals(base.getIfCross())){
// sectionDTO = highDangerMapper.getCrossingByCode(base.getCrossCode());
// // 小时 }
// long remainingHours = (diff % (24 * 60 * 60 * 1000)) / (60 * 60 * 1000); // 路段
// remainingHours = Math.abs(remainingHours); if("2".equals(base.getIfCross())){
// sectionDTO = highDangerMapper.getSectionByCode(base.getSectionCode());
// // 判断不足一小时 }
// long diffHours = diff / (60 * 60 * 1000);
// diffHours = Math.abs(diffHours); if (sectionDTO.getPosition() == null) {
// continue;
// int comparison = nowDate.compareTo(pcEndTime); }
// if (comparison > 0) { // 超期逻辑 // 将单条路段的坐标点依次取出进行对比
// if (diffHours < 1) { String[] split = sectionDTO.getPosition().split(",");
// base.setDeadlineStatus("超期不足一小时"); Point Dpoint = new Point();
// base.setDeadlineType("1"); Double minDistance = 0.0;
// continue;
// } Point point = new Point();
// if(diffDays == 0){ point.setX(longitude);
// base.setDeadlineStatus("超期" + remainingHours + "小时"); point.setY(latitude);
// base.setDeadlineType("1");
// continue; for (int i = 0; i < split.length; i += 2) {
// }else if(remainingHours == 0){
// base.setDeadlineStatus("超期" + diffDays + "天");
// base.setDeadlineType("1");
// continue;
// }
// base.setDeadline(diffDays);
// base.setDeadlineStatus("超期" + diffDays + "天" + remainingHours + "小时");
// base.setDeadlineType("1");
// } else if (comparison < 0 && diffDays <= 3) { // 临期逻辑
// if (diffHours < 1) {
// base.setDeadlineStatus("临期不足一小时");
// base.setDeadlineType("2");
// continue;
// }
// base.setDeadline(diffDays);
// if(diffDays == 0){
// base.setDeadlineStatus("临期" + remainingHours + "小时");
// base.setDeadlineType("2");
// continue;
// }else if(remainingHours == 0){
// base.setDeadlineStatus("临期" + diffDays + "天");
// base.setDeadlineType("2");
// continue;
// }
// base.setDeadlineStatus("临期" + diffDays + "天" + remainingHours + "小时");
// base.setDeadlineType("2");
// } else { // 正常
// base.setDeadline(diffDays);
// base.setDeadlineStatus("正常");
// base.setDeadlineType("3");
// }
// // 排查开始时间判断
// } else if(pcStartTime != null){
// // 无排查结束时间,根据开始时间判断
// long diff = nowDate.getTime() - pcStartTime.getTime();
//
// // 时间差,天数
// long diffDays = diff / (24 * 60 * 60 * 1000);
// diffDays = Math.abs(diffDays);
//
// // 小时
// long remainingHours = (diff % (24 * 60 * 60 * 1000)) / (60 * 60 * 1000);
// remainingHours = Math.abs(remainingHours);
//
// // 判断不足一小时
// long diffHours = diff / (60 * 60 * 1000);
// diffHours = Math.abs(diffHours);
//
// int comparison = nowDate.compareTo(pcStartTime);
// if (comparison > 0) { // 超期
// if (diffHours < 1) {
// base.setDeadlineStatus("超期不足一小时");
// base.setDeadlineType("1");
// continue;
// }
// if(diffDays == 0){
// base.setDeadlineStatus("超期" + remainingHours + "小时");
// base.setDeadlineType("1");
// continue;
// }else if(remainingHours == 0){
// base.setDeadlineStatus("超期" + diffDays + "天");
// base.setDeadlineType("1");
// continue;
// }
// base.setDeadline(diffDays);
// base.setDeadlineStatus("超期" + diffDays + "天" + remainingHours + "小时");
// base.setDeadlineType("1");
// } else if (comparison < 0 && diffDays <= termTime) { // 临期
// if (diffHours < 1) {
// base.setDeadlineStatus("临期不足一小时");
// base.setDeadlineType("2");
// continue;
// }
// base.setDeadline(diffDays);
// if (diffDays == 0) {
// base.setDeadlineStatus("临期" + remainingHours + "小时");
// base.setDeadlineType("2");
// continue;
// } else if (remainingHours == 0) {
// base.setDeadlineStatus("临期" + diffDays + "天");
// base.setDeadlineType("2");
// continue;
// }
// base.setDeadlineStatus("临期" + diffDays + "天" + remainingHours + "小时");
// base.setDeadlineType("2");
// }else{
// base.setDeadlineStatus("正常");
// base.setDeadlineType("3");
// }
//// base.setDeadlineStatus("无排查结束时间");
//// base.setDeadlineType("3");
// }else{
// base.setDeadlineStatus("无排查结束和开始时间");
// base.setDeadlineType("3");
float xPoint = Float.parseFloat(split[i]);
float yPoint = Float.parseFloat(split[i + 1]);
Map<String, Double> pointMap = new LinkedHashMap<>();
CoordinateConverter.AMap aMap = CoordinateConverter.transform(longitude, latitude);
pointMap.put("longitude", aMap.getLongitude());
pointMap.put("latitude", aMap.getLatitude());
pointList.add(pointMap);
Dpoint.setX(xPoint);
Dpoint.setY(yPoint);
// 计算两点间的距离
Double pointDistance = highDangerService.getPointDistance(Dpoint, point);
if (minDistance == null || minDistance == 0) {
minDistance = pointDistance;
continue;
} else {
if (pointDistance < minDistance) {
minDistance = pointDistance;
}
}
}
// 设置距离
base.setDistance((int) Math.ceil(minDistance));
}
}
if("1".equals(approve) && "3".equals(classification)) {
// 根据距离排序
statusCounts.sort(new Comparator<HighDangerBase>() {
@Override
public int compare(HighDangerBase o1, HighDangerBase o2) {
return o1.getDistance() - o2.getDistance();
}
});
} }
PageInfo<HighDangerBase> pageInfo = new PageInfo<>(statusCounts); PageInfo<HighDangerBase> pageInfo = new PageInfo<>(statusCounts);
log.info("/getHigDangerDealt(查询各个状态的数据列表)接口数据返回,调用ip: {}, 出参:{}", request.getRemoteAddr(), statusCounts); log.info("/getHigDangerDealt(查询各个状态的数据列表)接口数据返回,调用ip: {}, 出参:{}", request.getRemoteAddr(), statusCounts);
@ -734,10 +644,10 @@ public class HighDangerController {
/* /*
根据路口查询上下游路段信息 根据路口查询上下游路段信息
*/ */
@GetMapping("/getSectionByCrossing") @GetMapping("/getSectionByCrossing")
public ServerResponse<?> getSectionByCrossing(HttpServletRequest request,@RequestParam String crossingCode) { public ServerResponse<?> getSectionByCrossing(HttpServletRequest request, @RequestParam String crossingCode) {
log.info("/getSectionByCrossing(根据路口找到上下游路段)接口被调用,调用ip: {}, 入参:{}", request.getRemoteAddr(),crossingCode); log.info("/getSectionByCrossing(根据路口找到上下游路段)接口被调用,调用ip: {}, 入参:{}", request.getRemoteAddr(), crossingCode);
List<SectionVO> sectionByCrossing = highDangerService.getSectionByCrossing(crossingCode); List<SectionVO> sectionByCrossing = highDangerService.getSectionByCrossing(crossingCode);
@ -755,7 +665,7 @@ public class HighDangerController {
SectionDTO sectionByCode = new SectionDTO(); SectionDTO sectionByCode = new SectionDTO();
log.info("/getDangerRoad(查询当前排查所在路段)接口被调用,调用ip: {}, 入参:{}", request.getRemoteAddr(), businessId); log.info("/getDangerRoad(查询当前排查所在路段)接口被调用,调用ip: {}, 入参:{}", request.getRemoteAddr(), businessId);
HighDangerRoad roadInfo = highDangerMapper.getRoadInfo(businessId,ifCross); HighDangerRoad roadInfo = highDangerMapper.getRoadInfo(businessId, ifCross);
roadInfo.setDeptId(operatorMapper.getOperatorById(roadInfo.getOperator()).getCdepartmentid()); roadInfo.setDeptId(operatorMapper.getOperatorById(roadInfo.getOperator()).getCdepartmentid());
// 路段 // 路段
@ -824,7 +734,7 @@ public class HighDangerController {
log.info("/saveSectionOrCrossing(新增路段 & 路口)接口被调用,调用ip: {}, 入参:{}", request.getRemoteAddr(), sectionOrCrossAdd); log.info("/saveSectionOrCrossing(新增路段 & 路口)接口被调用,调用ip: {}, 入参:{}", request.getRemoteAddr(), sectionOrCrossAdd);
HighDangerRoad roadInfo = highDangerMapper.getRoadInfo(sectionOrCrossAdd.getBusinessId(),"2"); HighDangerRoad roadInfo = highDangerMapper.getRoadInfo(sectionOrCrossAdd.getBusinessId(), "2");
if (roadInfo != null) { if (roadInfo != null) {
UUID uuid = UUID.randomUUID(); UUID uuid = UUID.randomUUID();
String uuidString = uuid.toString().replace("-", ""); String uuidString = uuid.toString().replace("-", "");
@ -935,11 +845,11 @@ public class HighDangerController {
// } else { // } else {
// if(!sectionInfo.isEmpty()){ // if(!sectionInfo.isEmpty()){
for (int i = 0; i < sectionInfo.size(); i++) { for (int i = 0; i < sectionInfo.size(); i++) {
if(Objects.equals(sectionInfo.get(i).getIfCross(), "2")){ if (Objects.equals(sectionInfo.get(i).getIfCross(), "2")) {
SectionDTO sectionByCode = highDangerMapper.getSectionByCode(sectionInfo.get(i).getSectionCode()); SectionDTO sectionByCode = highDangerMapper.getSectionByCode(sectionInfo.get(i).getSectionCode());
sectionInfo.get(i).setSectionName(sectionByCode.getSectionName()); sectionInfo.get(i).setSectionName(sectionByCode.getSectionName());
} }
if(Objects.equals(sectionInfo.get(i).getIfCross(), "1")){ if (Objects.equals(sectionInfo.get(i).getIfCross(), "1")) {
sectionInfo.get(i).setSectionCode(sectionInfo.get(i).getRoadCode()); sectionInfo.get(i).setSectionCode(sectionInfo.get(i).getRoadCode());
} }
// 是否该排查有绑定的辖区街道信息,有则展示 // 是否该排查有绑定的辖区街道信息,有则展示
@ -1143,7 +1053,7 @@ public class HighDangerController {
highDangerRoad.setBusinessId(hidden_businessId); highDangerRoad.setBusinessId(hidden_businessId);
// 绑定路段 // 绑定路段
highDangerRoad.setSectionCode(manualInvestigation.getSectionCode()); highDangerRoad.setSectionCode(manualInvestigation.getSectionCode());
if(Objects.equals(manualInvestigation.getIfCross(), "1")){ if (Objects.equals(manualInvestigation.getIfCross(), "1")) {
highDangerRoad.setCrossCode(manualInvestigation.getSectionCode()); highDangerRoad.setCrossCode(manualInvestigation.getSectionCode());
} }
highDangerRoad.setIfCross(manualInvestigation.getIfCross()); highDangerRoad.setIfCross(manualInvestigation.getIfCross());
@ -1187,10 +1097,11 @@ public class HighDangerController {
for (BasicInfoVO basicInfoVO : manualInvestigation.getBasicInfo()) { for (BasicInfoVO basicInfoVO : manualInvestigation.getBasicInfo()) {
basicInfoVO.setIfCross(manualInvestigation.getIfCross()); basicInfoVO.setIfCross(manualInvestigation.getIfCross());
// 路口类型,将路口code存入 bis_section_info 表中 // 路口类型,将路口code存入 bis_section_info 表中
if(manualInvestigation.getIfCross() != null && manualInvestigation.getIfCross().equals("1")){ if (manualInvestigation.getIfCross() != null && manualInvestigation.getIfCross().equals("1")) {
basicInfoVO.setRoadCode(manualInvestigation.getSectionCode()); basicInfoVO.setRoadCode(manualInvestigation.getSectionCode());
} }
basicInfoVO.setBusinessId(hidden_businessId); basicInfoVO.setBusinessId(hidden_businessId);
// 插入列表
highDangerMapper.insertSectionInfo(basicInfoVO); highDangerMapper.insertSectionInfo(basicInfoVO);
} }
} }
@ -1260,7 +1171,7 @@ public class HighDangerController {
} }
} }
if(manualInvestigation.getTemporary() != 2){ if (manualInvestigation.getTemporary() != 2) {
// 新增时间线表 // 新增时间线表
ThtTimeLineDTO thtTimeLineDTO = new ThtTimeLineDTO(); ThtTimeLineDTO thtTimeLineDTO = new ThtTimeLineDTO();
thtTimeLineDTO.setNid(String.valueOf(uuid)); thtTimeLineDTO.setNid(String.valueOf(uuid));
@ -1752,8 +1663,8 @@ public class HighDangerController {
@GetMapping("/updateCurOperator") @GetMapping("/updateCurOperator")
public ServerResponse<?> updateCurOperator(@RequestParam String nuserId, public ServerResponse<?> updateCurOperator(@RequestParam String nuserId,
@RequestParam String businessId @RequestParam String businessId
){ ) {
highDangerMapper.updateCurOperator(nuserId,businessId); highDangerMapper.updateCurOperator(nuserId, businessId);
return ServerResponse.ok(nuserId); return ServerResponse.ok(nuserId);
} }
@ -1791,25 +1702,26 @@ public class HighDangerController {
*/ */
@GetMapping("/getNewestVersion") @GetMapping("/getNewestVersion")
public ServerResponse<?> getNewestVersion( public ServerResponse<?> getNewestVersion(
){ ) {
ThtAppVersionHis newestVersion = highDangerMapper.getNewestVersion(); ThtAppVersionHis newestVersion = highDangerMapper.getNewestVersion();
return ServerResponse.ok(newestVersion); return ServerResponse.ok(newestVersion);
} }
/* /*
获取最新版本号 获取当前操作人信息
*/ */
@GetMapping("/getCurOperator") @GetMapping("/getCurOperator")
public ServerResponse<?> getCurOperator(@RequestParam String businessId){ public ServerResponse<?> getCurOperator(@RequestParam String businessId) {
HighDangerBase curOperator = highDangerMapper.getCurOperator(businessId);
HighDangerBase curOperator = highDangerService.getCurOperator(businessId);
return ServerResponse.ok(curOperator.getCurOperUser()); return ServerResponse.ok(curOperator.getCurOperUser());
} }
/* /*
获取单隐患数据 获取单隐患数据
*/ */
@GetMapping("/getHiddenDangerBaseById") @GetMapping("/getHiddenDangerBaseById")
public ServerResponse<?> getHiddenDangerBaseById(@RequestParam String businessId){ public ServerResponse<?> getHiddenDangerBaseById(@RequestParam String businessId) {
HighDangerBase highDangerBase = highDangerMapper.getHiddenDangerBaseById(businessId); HighDangerBase highDangerBase = highDangerMapper.getHiddenDangerBaseById(businessId);
return ServerResponse.ok(highDangerBase); return ServerResponse.ok(highDangerBase);
} }

@ -106,7 +106,6 @@ public class TricycleController {
){ ){
log.info("/saveTricycleInfo(【三轮车】保存登记数据)接口被调用,调用ip: {}, 入参:{}", request.getRemoteAddr(), tricycleInfo); log.info("/saveTricycleInfo(【三轮车】保存登记数据)接口被调用,调用ip: {}, 入参:{}", request.getRemoteAddr(), tricycleInfo);
int affect = tricycleService.saveTricycleInfo(tricycleInfo); int affect = tricycleService.saveTricycleInfo(tricycleInfo);
if(affect > 0 ){ if(affect > 0 ){
log.info("/saveTricycleInfo(【三轮车】保存登记数据))接口数据返回,调用ip: {}, 出参:{}", request.getRemoteAddr(), tricycleInfo); log.info("/saveTricycleInfo(【三轮车】保存登记数据))接口数据返回,调用ip: {}, 出参:{}", request.getRemoteAddr(), tricycleInfo);
@ -131,7 +130,6 @@ public class TricycleController {
return ServerResponse.ok(tricycleInfoEnumType); return ServerResponse.ok(tricycleInfoEnumType);
} }
/** /**
* 回显单条数据的详情信息 * 回显单条数据的详情信息
* @param request * @param request
@ -154,7 +152,6 @@ public class TricycleController {
return ServerResponse.ok(tricycleInfoBaseById); return ServerResponse.ok(tricycleInfoBaseById);
} }
/** /**
* 获取预警处理列表 * 获取预警处理列表
* @param request * @param request
@ -201,7 +198,6 @@ public class TricycleController {
*/ */
List<TricycleWarningListVO> tricycleWarningListList = tricycleService.getTricycleWarningList(cdepartmentid,roleFlag,status,search); List<TricycleWarningListVO> tricycleWarningListList = tricycleService.getTricycleWarningList(cdepartmentid,roleFlag,status,search);
tricycleWarningListList.forEach(item -> { tricycleWarningListList.forEach(item -> {
// 使用预留字段 ctime 接收 createtime 格式化的时间(Date->String) // 使用预留字段 ctime 接收 createtime 格式化的时间(Date->String)
item.setWarningTimeFormat(dateFormat.format(item.getWarningTime())); item.setWarningTimeFormat(dateFormat.format(item.getWarningTime()));
@ -223,7 +219,9 @@ public class TricycleController {
log.info("/getSquadronVillageList(【三轮车】获取中队绑定村庄列表)接口被调用, 调用ip: {},入参:{}", request.getRemoteAddr(),nuserId); log.info("/getSquadronVillageList(【三轮车】获取中队绑定村庄列表)接口被调用, 调用ip: {},入参:{}", request.getRemoteAddr(),nuserId);
List<StreetCommunity> streetCommunityBySquadron = configMapper.getStreetCommunityBySquadron(nuserId); Operator operatorById = operatorService.getOperatorById(nuserId);
List<StreetCommunity> streetCommunityBySquadron = configMapper.getStreetCommunityBySquadron(operatorById.getCdepartmentid());
log.info("/getSquadronVillageList(【三轮车】获取中队绑定村庄列表)接口数据返回,调用ip: {}, 出参:{}", request.getRemoteAddr(), streetCommunityBySquadron); log.info("/getSquadronVillageList(【三轮车】获取中队绑定村庄列表)接口数据返回,调用ip: {}, 出参:{}", request.getRemoteAddr(), streetCommunityBySquadron);

@ -24,7 +24,6 @@ public interface HighDangerMapper{
// 主页获取各类型数据 // 主页获取各类型数据
List<HighDangerBaseNum> getStatusCounts(@Param("cdepartmentid") String cdepartmentid, @Param("nuserid") String nuserid,@Param("role") Integer role); List<HighDangerBaseNum> getStatusCounts(@Param("cdepartmentid") String cdepartmentid, @Param("nuserid") String nuserid,@Param("role") Integer role);
//
List<HighDangerBase> getHigDangerDealt(@Param("status") String status, List<HighDangerBase> getHigDangerDealt(@Param("status") String status,
@Param("cdepartmentid") String cdepartmentid, @Param("cdepartmentid") String cdepartmentid,
@Param("search") String search, @Param("search") String search,

@ -55,4 +55,6 @@ public interface HighDangerService {
String randomNumber(int number); String randomNumber(int number);
void getCurData(); void getCurData();
HighDangerBase getCurOperator(String businessId);
} }

@ -410,6 +410,19 @@ public class HighDangerBaseServiceImpl implements HighDangerService {
} }
@Override
public HighDangerBase getCurOperator(String businessId) {
HighDangerBase curOperator = highDangerMapper.getCurOperator(businessId);
// Operator operatorById = operatorMapper.getOperatorById(curOperator.getCurOperUser());
// LinkedHashMap<String, String> operatorMap = new LinkedHashMap<>();
// operatorMap.put("nuserId", operatorById.getNuserid());
// operatorMap.put("cuserName", operatorById.getCusername());
return curOperator;
}
// public Map<String, Map<Double,String>> sortMapByValue(HashMap<String, Object> unsortedMap) { // public Map<String, Map<Double,String>> sortMapByValue(HashMap<String, Object> unsortedMap) {
// Map<String, Map<Double,String>> sortedMap = new LinkedHashMap<>(); // Map<String, Map<Double,String>> sortedMap = new LinkedHashMap<>();
// Comparator<Double> valueComparator = Comparator.naturalOrder(); // Comparator<Double> valueComparator = Comparator.naturalOrder();

@ -27,8 +27,8 @@
</select> </select>
<select id="getStreetCommunityByXq" resultType="com.hisense.hiatmp.server_api.model.StreetCommunity"> <select id="getStreetCommunityByXq" resultType="com.hisense.hiatmp.server_api.model.StreetCommunity">
select DISTINCT SELECT DISTINCT on (jdcode)
* jdname,jdcode,xqcode,xqname
from from
tlv_street_community tlv_street_community
<if test="xqcode != ''"> <if test="xqcode != ''">

@ -471,8 +471,7 @@
and ta.status in ('10','0','20','30','40','50','60') and ta.status in ('10','0','20','30','40','50','60')
</if>--> </if>-->
WHERE WHERE
1 = 1 1 = 1
<if test="status == '10' and approve == 1"> <if test="status == '10' and approve == 1">
AND hdb.status in ('0','10') AND hdb.status in ('0','10')
@ -512,7 +511,6 @@
) )
</if> </if>
AND hdr.nid is not null AND hdr.nid is not null
<if test="cdepartmentid != null and cdepartmentid != ''"> <if test="cdepartmentid != null and cdepartmentid != ''">
@ -527,10 +525,24 @@
and COALESCE(hdb.last_mod_date, hdb.insert_time) &lt;= to_date(#{endTime}, 'yyyy-MM-DD') + 1 and COALESCE(hdb.last_mod_date, hdb.insert_time) &lt;= to_date(#{endTime}, 'yyyy-MM-DD') + 1
</if> </if>
<if test="classification == 2"> <if test="status != '60' and approve == 1 and classification == 1">
-- 时间最早
Order by CASE
WHEN hdb.last_mod_date IS NULL AND hdb.insert_time IS NULL THEN 1
ELSE 0 END,
COALESCE(hdb.last_mod_date, hdb.insert_time) DESC
</if>
<if test="status != '60' and approve == 1 and classification == 2">
-- 时间最晚
Order by CASE
WHEN hdb.last_mod_date IS NULL AND hdb.insert_time IS NULL THEN 1
ELSE 0 END,
COALESCE(hdb.last_mod_date, hdb.insert_time) ASC
</if>
<if test="approve == 2 and classification == 2">
AND hdb.source = '2' AND hdb.source = '2'
</if> </if>
<if test="classification == 3"> <if test="approve == 2 and classification == 3">
AND hdb.source = '1' AND hdb.source = '1'
</if> </if>
@ -546,11 +558,12 @@
hdb.name asc hdb.name asc
</if> </if>
) t1 ) t1
<if test="status != '60'">
ORDER BY <!-- <if test="status != '60'">-->
time_status asc, <!-- ORDER BY-->
t1.planEndTime asc <!-- time_status asc,-->
</if> <!-- t1.planEndTime asc-->
<!-- </if>-->
</select> </select>

@ -28,9 +28,9 @@
</select> </select>
<select id="getRoleById" resultType="String"> <select id="getRoleById" resultType="String">
select r.rolename from role_operation_relation ror select r.rolename from user_role_relation ror
LEFT JOIN "public"."role" r on ror.roleid = r.roleid LEFT JOIN "public"."role" r on ror.roleid = r.roleid
where ror.operationid = #{nuserid} where ror.nuserid = #{nuserid}
</select> </select>
<select id="getOperatorDataSum" resultType="com.hisense.hiatmp.model.common.HighDangerBaseNum"> <select id="getOperatorDataSum" resultType="com.hisense.hiatmp.model.common.HighDangerBaseNum">

@ -43,6 +43,8 @@
<if test="search != null and search != ''"> <if test="search != null and search != ''">
AND ttib.vehicle_license like concat(concat('%',#{search}),'%') AND ttib.vehicle_license like concat(concat('%',#{search}),'%')
</if> </if>
Order by
ttib.driver_name COLLATE "zh_CN.utf8" ASC
</select> </select>
<!-- <select id="getTricycleList" resultType="com.hisense.hiatmp.model.common.VO.TricycleListVO">--> <!-- <select id="getTricycleList" resultType="com.hisense.hiatmp.model.common.VO.TricycleListVO">-->

@ -10,7 +10,7 @@ public class SectionDTO implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
private String sectionCode; private String sectionCode;
private String crossingCode; private String crossCode;
private String businessId; private String businessId;
private String roadCode; private String roadCode;
private String sectionName; private String sectionName;

@ -20,6 +20,7 @@ public class HighDangerBase implements Serializable {
*/ */
private String nid; private String nid;
@JsonIgnore
private String taNid; private String taNid;
/** /**
@ -40,16 +41,19 @@ public class HighDangerBase implements Serializable {
/** /**
* source * source
*/ */
@JsonIgnore
private String source; private String source;
/** /**
* find_way * find_way
*/ */
@JsonIgnore
private String findWay; private String findWay;
/** /**
* area * area
*/ */
@JsonIgnore
private String area; private String area;
/** /**
@ -60,6 +64,7 @@ public class HighDangerBase implements Serializable {
/** /**
* find_time * find_time
*/ */
@JsonIgnore
private Date findTime; private Date findTime;
/** /**
@ -72,53 +77,62 @@ public class HighDangerBase implements Serializable {
/** /**
* insert_time * insert_time
*/ */
@JsonIgnore
private Date insertTime; private Date insertTime;
/** /**
* pc_start_time * pc_start_time
*/ */
@JsonIgnore
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date pcStartTime; private Date pcStartTime;
/** /**
* pc_end_time * pc_end_time
*/ */
@JsonIgnore
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date pcEndTime; private Date pcEndTime;
@JsonIgnore
private Date roadPcEndTime; private Date roadPcEndTime;
/** /**
* zl_start_time * zl_start_time
*/ */
@JsonIgnore
private String zlStartTime; private String zlStartTime;
/** /**
* zl_end_time * zl_end_time
*/ */
@JsonIgnore
private String zlEndTime; private String zlEndTime;
/** /**
* gz_start_time * gz_start_time
*/ */
@JsonIgnore
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private String gzStartTime; private String gzStartTime;
/** /**
* gz_end_time * gz_end_time
*/ */
@JsonIgnore
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private String gzEndTime; private String gzEndTime;
/** /**
* report_dept * report_dept
*/ */
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonIgnore
private String reportDept; private String reportDept;
/** /**
* handle_dept * handle_dept
*/ */
@JsonIgnore
private String handleDept; private String handleDept;
/** /**
@ -143,6 +157,7 @@ public class HighDangerBase implements Serializable {
/** /**
* split_id * split_id
*/ */
@JsonIgnore
private String splitId; private String splitId;
/** /**
@ -158,11 +173,13 @@ public class HighDangerBase implements Serializable {
/** /**
* fa_start_time * fa_start_time
*/ */
@JsonIgnore
private String faStartTime; private String faStartTime;
/** /**
* fa_end_time * fa_end_time
*/ */
@JsonIgnore
private String faEndTime; private String faEndTime;
/** /**
@ -188,9 +205,11 @@ public class HighDangerBase implements Serializable {
private String coordinate; private String coordinate;
// 地址类型 // 地址类型
@JsonIgnore
private String coordinateType; private String coordinateType;
// 画圆半径 // 画圆半径
@JsonIgnore
private String radius; private String radius;
// 辖区 // 辖区
@ -204,14 +223,19 @@ public class HighDangerBase implements Serializable {
// 道路名称 // 道路名称
private String sectionName; private String sectionName;
@JsonIgnore
private String timeStatus; private String timeStatus;
@JsonIgnore
private int delayDay; private int delayDay;
@JsonIgnore
private int delayHour; private int delayHour;
@JsonIgnore
private int nearDay; private int nearDay;
@JsonIgnore
private int nearHour; private int nearHour;
private String cuserName; private String cuserName;
@ -224,4 +248,6 @@ public class HighDangerBase implements Serializable {
private String enumname; private String enumname;
private int distance;
} }

@ -1,19 +1,20 @@
package com.hisense.hiatmp.model.common.enums; package com.hisense.hiatmp.model.common.enums;
import lombok.Data;
import lombok.Getter;
@Getter
public enum RoleEnum { public enum RoleEnum {
VILLAGE_CADRE("村干部农三轮"), VILLAGE_CADRE("村干部农三轮"),
TRICYCLE_SQUADRON_POLICE_OFFICERS("中队民警农三轮") TRICYCLE_SQUADRON_POLICE_OFFICERS("中队民警农三轮")
; ;
private String name; private final String name;
RoleEnum(String roleEnum) { RoleEnum(String roleEnum) {
this.name = roleEnum; this.name = roleEnum;
} }
public String getName() {
return name;
}
} }

Loading…
Cancel
Save