提交 0bc0f828 authored 作者: ljj234's avatar ljj234

refactor: 修改核查模块,市自动转发个区

上级 f9d3f845
...@@ -366,19 +366,19 @@ public class DeviceCheckController { ...@@ -366,19 +366,19 @@ public class DeviceCheckController {
// todo // todo
// 代管 - 如果当前自查为省本级自查,则需要将被代管的装备加入到省本级 // 代管 - 如果当前自查为省本级自查,则需要将被代管的装备加入到省本级
Units unit = unitsRepo.findByName(checkUnit); // Units unit = unitsRepo.findByName(checkUnit);
boolean isProv = unit.getLevel() == 1 && unit.getType() == 1; // boolean isProv = unit.getLevel() == 1 && unit.getType() == 1;
if (isProv) { // if (isProv) {
//获得所有的需要被代管的单位的在库与非在库装备,添加到省本级的在库与非在库中去 // //获得所有的需要被代管的单位的在库与非在库装备,添加到省本级的在库与非在库中去
List<Units> escrowUnits = unitsRepo.findByTypeAndEscrow(2, 1); // List<Units> escrowUnits = unitsRepo.findByTypeAndEscrow(2, 1);
for (Units eu : escrowUnits) { // for (Units eu : escrowUnits) {
log.info("[核查模块] 正在将 {} 单位的装备托管代理到 {} 单位", checkUnit, eu.getName()); // log.info("[核查模块] 正在将 {} 单位的装备托管代理到 {} 单位", checkUnit, eu.getName());
Map<Boolean, List<DeviceLibrary>> libMap = getDevLibMap(eu.getName(), allDevices); // Map<Boolean, List<DeviceLibrary>> libMap = getDevLibMap(eu.getName(), allDevices);
devInLib.addAll(libMap.get(true)); // devInLib.addAll(libMap.get(true));
devNotInLib.addAll(libMap.get(false)); // devNotInLib.addAll(libMap.get(false));
} // }
//
} // }
detail.updateDevice(devInLib, devNotInLib); detail.updateDevice(devInLib, devNotInLib);
...@@ -397,6 +397,8 @@ public class DeviceCheckController { ...@@ -397,6 +397,8 @@ public class DeviceCheckController {
* 1-1 省核查页面 - 市的检查以及省直属的自查任务 * 1-1 省核查页面 - 市的检查以及省直属的自查任务
* 2 - 详情跳转 * 2 - 详情跳转
* *
* type: 1_省核查 2_两级的省检查 3_核查下面的市检查 4_市检查
*
* @param type 7 统计 * @param type 7 统计
* @param billId 业务id * @param billId 业务id
* @return * @return
...@@ -513,21 +515,45 @@ public class DeviceCheckController { ...@@ -513,21 +515,45 @@ public class DeviceCheckController {
String areaName = auService.findOne(AuExample.UnitId, child.getOwnUnit()).getName(); String areaName = auService.findOne(AuExample.UnitId, child.getOwnUnit()).getName();
LinkCheckDetail lcd = cas2lcd(totalList, child, cctask, areaName); LinkCheckDetail lcd = cas2lcd(totalList, child, cctask, areaName);
lcd.setCheckUnit(unitName);
// 需修改省局单位和省直单位
lcd.setCheckUnit(areaName);
if (unitsService.isProvUnit(child.getOwnUnit())) {
String[] split = child.getTitle().split("]");
String replace = split[0].replace("[", "");
lcd.setCheckUnit(replace);
}
if (child.getTitle().contains("统计确认待办任务")) { if (child.getTitle().contains("统计确认待办任务")) {
lcd.setCheckSituation("统计确认待办任务"); lcd.setCheckSituation("统计确认待办任务");
} }
lcdList.add(lcd); LinkExamDetail led = lcd.toLed();
ledList.add(led);
finalTime = System.currentTimeMillis(); finalTime = System.currentTimeMillis();
log.info("[TEST] child-BILL id = {}的检查任务 , COST {} MS", child.getBillId(), finalTime - startTime); log.info("[TEST] child-BILL id = {}的检查任务 , COST {} MS", child.getBillId(), finalTime - startTime);
} else { } else {
// 处理detail
log.info("[处理子节点] 子节点为自查类子节点"); log.info("[处理子节点] 子节点为自查类子节点");
startTime = System.currentTimeMillis(); startTime = System.currentTimeMillis();
// 省直属 ,省本级自查 // 省直属 ,省本级自查
// 直属自查 -> detail里面找 // 直属自查 -> detail里面找
DeviceCheckDetail childDetail = detailRepo.findById(childBusId).get(); DeviceCheckDetail childDetail = detailRepo.findById(childBusId).get();
Units checkUnit = unitsRepo.findById(childDetail.getCheckUnitId()).get();
if ((checkUnit.getType() == 1 && checkUnit.getLevel() == 1)
|| (checkUnit.getLevel() == 1 && checkUnit.getType() == 2)
|| (checkUnit.getLevel() == 4 && checkUnit.getType() == 2)
) {
linkVo.setType(1);
} else {
linkVo.setType(3);
}
String unitName = unitsRepo.findById(childDetail.getCheckUnitId()).get().getName(); String unitName = unitsRepo.findById(childDetail.getCheckUnitId()).get().getName();
List<CheckDeviceStatVo> list = parseStatString2Vo(child.parse2Bto(), childDetail); List<CheckDeviceStatVo> list = parseStatString2Vo(child.parse2Bto(), childDetail);
...@@ -550,6 +576,8 @@ public class DeviceCheckController { ...@@ -550,6 +576,8 @@ public class DeviceCheckController {
LinkExamDetail led = cas2led(cas, child, endTime, updateTime); LinkExamDetail led = cas2led(cas, child, endTime, updateTime);
led.setCheckUnit(unitName); led.setCheckUnit(unitName);
led.setExamName("默认单位");
led.setExamUser("默认检查人");
ledList.add(led); ledList.add(led);
finalTime = System.currentTimeMillis(); finalTime = System.currentTimeMillis();
...@@ -567,8 +595,6 @@ public class DeviceCheckController { ...@@ -567,8 +595,6 @@ public class DeviceCheckController {
Integer ownUnit = rootTask.getOwnUnit(); Integer ownUnit = rootTask.getOwnUnit();
if (unitsService.isProvUnit(ownUnit)) { if (unitsService.isProvUnit(ownUnit)) {
linkVo.setType(2); linkVo.setType(2);
} else if (rootTask.getParentTaskId() != 0) {
linkVo.setType(3);
} else { } else {
linkVo.setType(4); linkVo.setType(4);
} }
...@@ -584,7 +610,7 @@ public class DeviceCheckController { ...@@ -584,7 +610,7 @@ public class DeviceCheckController {
// 这里只显示detail任务 // 这里只显示detail任务
if (child.getBusinessType() == CONFIRM_CHECK_STAT.id) { if (child.getBusinessType() == CONFIRM_CHECK_STAT.id) {
lcdList.add(LinkCheckDetail.builder() ledList.add(LinkExamDetail.builder()
.checkResult("无误") .checkResult("无误")
.checkUnit(unitsRepo.findById(child.getOwnUnit()).get().getName()) .checkUnit(unitsRepo.findById(child.getOwnUnit()).get().getName())
.checkSituation("211") .checkSituation("211")
......
...@@ -162,6 +162,7 @@ public class DeviceCheckDetail extends BaseEntity { ...@@ -162,6 +162,7 @@ public class DeviceCheckDetail extends BaseEntity {
private List<FileRet> checkFileList = new ArrayList<>(); private List<FileRet> checkFileList = new ArrayList<>();
@ApiModelProperty(value = "手持终端信息字段") @ApiModelProperty(value = "手持终端信息字段")
@Column(name = "checkC_name")
private String checkCName = ""; private String checkCName = "";
/** /**
......
package com.tykj.dev.device.confirmcheck.entity.vo; package com.tykj.dev.device.confirmcheck.entity.vo;
import com.tykj.dev.device.confirmcheck.entity.domain.DeviceCheckDetail;
import com.tykj.dev.misc.base.BeanHelper;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Builder; import lombok.Builder;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import org.modelmapper.ModelMapper;
/** /**
* LinkCheckDetail. * LinkCheckDetail.
...@@ -29,4 +32,12 @@ public class LinkCheckDetail { ...@@ -29,4 +32,12 @@ public class LinkCheckDetail {
private String checkResult; private String checkResult;
private int remark; private int remark;
public LinkExamDetail toLed() {
ModelMapper mapper = BeanHelper.getUserMapper();
LinkExamDetail detail = mapper.map(this, LinkExamDetail.class);
detail.setExamName("");
detail.setExamUser("");
return detail;
}
} }
package com.tykj.dev.device.confirmcheck.entity.vo; package com.tykj.dev.device.confirmcheck.entity.vo;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
...@@ -13,6 +14,7 @@ import lombok.NoArgsConstructor; ...@@ -13,6 +14,7 @@ import lombok.NoArgsConstructor;
@NoArgsConstructor @NoArgsConstructor
@AllArgsConstructor @AllArgsConstructor
@Data @Data
@Builder
public class LinkExamDetail { public class LinkExamDetail {
/** /**
......
...@@ -1265,6 +1265,11 @@ public class TaskServiceImpl implements TaskService { ...@@ -1265,6 +1265,11 @@ public class TaskServiceImpl implements TaskService {
&& (!task.getBillStatus().equals(StatusEnum.ARCHIVE.id)) && (!task.getBillStatus().equals(StatusEnum.ARCHIVE.id))
&& (!task.getBillStatus().equals(StatusEnum.REVOKEALLOTTASK.id)) && (!task.getBillStatus().equals(StatusEnum.REVOKEALLOTTASK.id))
&& (!task.getBillStatus().equals(StatusEnum.CHECK_SHUT_DOWN.id))) && (!task.getBillStatus().equals(StatusEnum.CHECK_SHUT_DOWN.id)))
.filter(o -> {
if (o.getExhibit() == null) {
return true;
} else return !o.getExhibit().equals("-1");
})
.map(Task::parse2Bto) .map(Task::parse2Bto)
.collect(Collectors.toList()); .collect(Collectors.toList());
//查询待办 //查询待办
...@@ -1279,8 +1284,7 @@ public class TaskServiceImpl implements TaskService { ...@@ -1279,8 +1284,7 @@ public class TaskServiceImpl implements TaskService {
boolean belongUnit = taskBto.getOwnUnit().equals(userUtils.getCurrentUnitId()); boolean belongUnit = taskBto.getOwnUnit().equals(userUtils.getCurrentUnitId());
boolean isCountry = taskSelectVo.getType() == null || (taskSelectVo.getType() == 1 ? (taskBto.getCustomInfo() == null || (!"country".equals(taskBto.getCustomInfo()) && !"country1".equals(taskBto.getCustomInfo()))) : (taskBto.getCustomInfo() != null && ("country".equals(taskBto.getCustomInfo()) || "country1".equals(taskBto.getCustomInfo())))); boolean isCountry = taskSelectVo.getType() == null || (taskSelectVo.getType() == 1 ? (taskBto.getCustomInfo() == null || (!"country".equals(taskBto.getCustomInfo()) && !"country1".equals(taskBto.getCustomInfo()))) : (taskBto.getCustomInfo() != null && ("country".equals(taskBto.getCustomInfo()) || "country1".equals(taskBto.getCustomInfo()))));
return involveExists && pointExists && (userConfirm || (noUserHandle && belongUnit)) && isCountry; return involveExists && pointExists && (userConfirm || (noUserHandle && belongUnit)) && isCountry;
})
}).filter(o -> !(o.getBusinessType() == 7 && "-1".equals(o.getRemark()))).filter(o -> !(o.getBusinessType() == 8 && "-1".equals(o.getRemark())))
.collect(Collectors.toList()); .collect(Collectors.toList());
//查询所有的业务 //查询所有的业务
if (bussinessType == null ||bussinessType.isEmpty()) { if (bussinessType == null ||bussinessType.isEmpty()) {
......
...@@ -81,6 +81,9 @@ public class TaskBto { ...@@ -81,6 +81,9 @@ public class TaskBto {
@ApiModelProperty(value = "备注") @ApiModelProperty(value = "备注")
private String remark; private String remark;
@ApiModelProperty(value = "是否展示")
private String exhibit;
public TaskBto(Integer billStatus, String title, Integer parentTaskId, String nodeIdDetail, Integer billId, Integer businessType, Integer ownUnit, Integer currentPoint, String customInfo, List<Integer> involveUserIdList) { public TaskBto(Integer billStatus, String title, Integer parentTaskId, String nodeIdDetail, Integer billId, Integer businessType, Integer ownUnit, Integer currentPoint, String customInfo, List<Integer> involveUserIdList) {
this.billStatus = billStatus; this.billStatus = billStatus;
this.title = title; this.title = title;
...@@ -109,6 +112,21 @@ public class TaskBto { ...@@ -109,6 +112,21 @@ public class TaskBto {
this.currentPoint = 0; this.currentPoint = 0;
} }
public TaskBto(Integer status, String title, Integer parentTaskId, String nodeIdDetail, Integer businessType, Integer billId, Integer ownUnit, int startUserId, String exhibit) {
this.billStatus = status;
this.title = title;
this.parentTaskId = parentTaskId;
this.nodeIdDetail = nodeIdDetail;
this.businessType = businessType;
this.billId = billId;
this.ownUnit = ownUnit;
List<Integer> involveUserIdList = new ArrayList<>();
involveUserIdList.add(startUserId);
this.involveUserIdList = involveUserIdList;
this.currentPoint = 0;
this.exhibit = exhibit;
}
/** /**
* bto类转化为do类 * bto类转化为do类
*/ */
......
...@@ -105,6 +105,9 @@ public class Task { ...@@ -105,6 +105,9 @@ public class Task {
@ApiModelProperty(value = "备注") @ApiModelProperty(value = "备注")
private String remark; private String remark;
@ApiModelProperty(value = "是否展示")
private String exhibit;
public Task(String title, Integer parentTaskId, String nodeIdDetail, Integer businessType, Integer billId, Integer ownUnit) { public Task(String title, Integer parentTaskId, String nodeIdDetail, Integer businessType, Integer billId, Integer ownUnit) {
this.title = title; this.title = title;
this.parentTaskId = parentTaskId; this.parentTaskId = parentTaskId;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论