提交 3b246d34 authored 作者: Matrix's avatar Matrix

[核查模块] bug fix

上级 b5cbc6ed
...@@ -546,7 +546,7 @@ public class DeviceCheckController { ...@@ -546,7 +546,7 @@ public class DeviceCheckController {
.collect(toList()); .collect(toList());
// 构建省的统计任务 // 构建省的统计任务
TaskBto provStatTask = new Task(CHECK_EXAM_STAT_0.id, "省" + CONFIRM_CHECK_STAT.name, 0, ".0.", CONFIRM_CHECK_STAT.id, statId, startUnitId) TaskBto provStatTask = new Task(CHECK_STAT_1.id, "省" + CONFIRM_CHECK_STAT.name, 0, ".0.", CONFIRM_CHECK_STAT.id, statId, startUnitId)
.parse2Bto(); .parse2Bto();
provStatTask.getInvolveUserIdList().add(authenticationUtils.getAuthentication().getCurrentUserInfo().getUserId()); provStatTask.getInvolveUserIdList().add(authenticationUtils.getAuthentication().getCurrentUserInfo().getUserId());
provStatTask.getInvolveUserIdList().add(-1); provStatTask.getInvolveUserIdList().add(-1);
...@@ -589,10 +589,12 @@ public class DeviceCheckController { ...@@ -589,10 +589,12 @@ public class DeviceCheckController {
// 获取所有在库装备与不在库装备 // 获取所有在库装备与不在库装备
Map<String, List<DeviceLibrary>> devInLib = deviceRepo.findAll().stream() Map<String, List<DeviceLibrary>> devInLib = deviceRepo.findAll().stream()
.filter(device -> device.getOwnUnit().equals(device.getLocationUnit())) .filter(device -> device.getOwnUnit().equals(device.getLocationUnit()))
.filter(d->d.getLifeStatus() != 2 & d.getLifeStatus() != 14)
.collect(groupingBy(DeviceLibrary::getOwnUnit)); .collect(groupingBy(DeviceLibrary::getOwnUnit));
Map<String, List<DeviceLibrary>> devNotInLib = deviceRepo.findAll().stream() Map<String, List<DeviceLibrary>> devNotInLib = deviceRepo.findAll().stream()
.filter(device -> !device.getOwnUnit().equals(device.getLocationUnit())) .filter(device -> !device.getOwnUnit().equals(device.getLocationUnit()))
.filter(d->d.getLifeStatus() != 2 & d.getLifeStatus() != 14)
.collect(groupingBy(DeviceLibrary::getOwnUnit)); .collect(groupingBy(DeviceLibrary::getOwnUnit));
...@@ -657,15 +659,13 @@ public class DeviceCheckController { ...@@ -657,15 +659,13 @@ public class DeviceCheckController {
Integer startUnitId = ceVo.getUnitId(); Integer startUnitId = ceVo.getUnitId();
Units startUnit = unitsRepo.findById(startUnitId).get(); Units startUnit = unitsRepo.findById(startUnitId).get();
List<CheckExamDetailVo> examDetailVos = ceVo.getDetail(); List<CheckExamDetailVo> examDetailVos = ceVo.getDetail();
Integer uAreaId = auService.findOne(AuExample.UnitId, startUnitId).getId();
//如果是create检查,那么不需要添加自己单位的自查,如果是update检查,那么需要添加单位的自查 //如果是create检查,那么不需要添加自己单位的自查,如果是update检查,那么需要添加单位的自查
if (ceVo.getExamStatId() != 0) { if (ceVo.getExamStatId() != 0) {
//update //update
log.info("[核查模块] update核查,自动添加id = {}市的自核查任务", startUnitId); log.info("[核查模块] update核查,自动添加id = {}市的自核查任务", startUnitId);
examDetailVos.add(examDetailVos.get(0).copy(uAreaId, "由省核查发起的自检查")); examDetailVos.add(examDetailVos.get(0).copy(startUnitId, "由省核查发起的自检查"));
} }
List<String> tmpString = new ArrayList<>(); List<String> tmpString = new ArrayList<>();
for (CheckExamDetailVo vo : examDetailVos) { for (CheckExamDetailVo vo : examDetailVos) {
tmpString.add(vo.getGroupName() + "," + vo.getUserNames().stream().collect(joining(","))); tmpString.add(vo.getGroupName() + "," + vo.getUserNames().stream().collect(joining(",")));
...@@ -703,7 +703,7 @@ public class DeviceCheckController { ...@@ -703,7 +703,7 @@ public class DeviceCheckController {
Integer currentUserId = authenticationUtils.getAuthentication().getCurrentUserInfo().getUserId(); Integer currentUserId = authenticationUtils.getAuthentication().getCurrentUserInfo().getUserId();
TaskBto cityStatTask; TaskBto cityStatTask;
if (ceVo.getExamStatId() == 0) { if (ceVo.getExamStatId() == 0) {
cityStatTask = new Task(CHECK_EXAM_STAT_0.id, CHECK_EXAM_STAT_0.name, 0, ".0.", CONFIRM_CHECK_STAT.id, statId, startUnitId) cityStatTask = new Task(CHECK_EXAM_STAT_1.id, CHECK_EXAM_STAT_0.name, 0, ".0.", CONFIRM_CHECK_STAT.id, statId, startUnitId)
.parse2Bto(); .parse2Bto();
cityStatTask.setCustomInfo("exam"); cityStatTask.setCustomInfo("exam");
cityStatTask.getInvolveUserIdList().add(currentUserId); cityStatTask.getInvolveUserIdList().add(currentUserId);
...@@ -716,16 +716,19 @@ public class DeviceCheckController { ...@@ -716,16 +716,19 @@ public class DeviceCheckController {
cityStatTask.getInvolveUserIdList().add(-1); cityStatTask.getInvolveUserIdList().add(-1);
cityStatTask.setCurrentPoint(cityStatTask.getCurrentPoint() + 1); cityStatTask.setCurrentPoint(cityStatTask.getCurrentPoint() + 1);
cityStatTask.setCreateUserId(currentUserId); cityStatTask.setCreateUserId(currentUserId);
cityStatTask.setBillStatus(CHECK_EXAM_STAT_1.id);
taskService.update(cityStatTask); taskService.update(cityStatTask);
} }
// 3 构建被查单位的 自查账单 与 自查任务 // 3 构建被查单位的 自查账单 与 自查任务
// 获取所有在库装备与不在库装备 // 获取所有在库装备与不在库装备
Map<String, List<DeviceLibrary>> devInLib = deviceRepo.findAll().stream() Map<String, List<DeviceLibrary>> devInLib = deviceRepo.findAll().stream()
.filter(d->d.getLifeStatus() != 2 & d.getLifeStatus() != 14)
.filter(device -> device.getOwnUnit().equals(device.getLocationUnit())) .filter(device -> device.getOwnUnit().equals(device.getLocationUnit()))
.collect(groupingBy(DeviceLibrary::getOwnUnit)); .collect(groupingBy(DeviceLibrary::getOwnUnit));
Map<String, List<DeviceLibrary>> devNotInLib = deviceRepo.findAll().stream() Map<String, List<DeviceLibrary>> devNotInLib = deviceRepo.findAll().stream()
.filter(d->d.getLifeStatus() != 2 & d.getLifeStatus() != 14)
.filter(device -> !device.getOwnUnit().equals(device.getLocationUnit())) .filter(device -> !device.getOwnUnit().equals(device.getLocationUnit()))
.collect(groupingBy(DeviceLibrary::getOwnUnit)); .collect(groupingBy(DeviceLibrary::getOwnUnit));
...@@ -1091,10 +1094,12 @@ public class DeviceCheckController { ...@@ -1091,10 +1094,12 @@ public class DeviceCheckController {
boolean hasParent = parentTaskId != 0; boolean hasParent = parentTaskId != 0;
if (hasParent) { if (hasParent) {
//市统计的办结 -> 开启对应市的待办任务 //市统计的办结 -> 开启对应市 数据确认任务for 省
String areaName = auService.findOne(AuExample.UnitId, currentTask.getOwnUnit()).getName(); String areaName = auService.findOne(AuExample.UnitId, currentTask.getOwnUnit()).getName();
Integer provId = areaRepo.findAreasByType(1).get(0).getId(); Integer provId = areaRepo.findAreasByType(1).get(0).getId();
TaskBto cityDoneTask = new TaskBto(CHECK_STAT_1.id, areaName + "统计确认待办任务", parentTaskId, ".", CONFIRM_CHECK_STAT.id, statId, provId, 0); TaskBto cityDoneTask = new TaskBto(CONFIRM_STAT_0.id, areaName + "统计数据确认任务", parentTaskId, ".", CONFIRM_CHECK_STAT.id, statId, provId, 0);
cityDoneTask.getInvolveUserIdList().add(0);
cityDoneTask.setCurrentPoint(cityDoneTask.getCurrentPoint() + 1);
cityDoneTask = taskService.start(cityDoneTask); cityDoneTask = taskService.start(cityDoneTask);
log.info("[核查模块] 统计确认待办任务生成成功, id为 : {}", cityDoneTask.getId()); log.info("[核查模块] 统计确认待办任务生成成功, id为 : {}", cityDoneTask.getId());
} }
...@@ -1162,12 +1167,12 @@ public class DeviceCheckController { ...@@ -1162,12 +1167,12 @@ public class DeviceCheckController {
log.info("[核查模块] 父节点 = {} 的所有子任务均已经完结,推动父节点的任务", fatherTaskId); log.info("[核查模块] 父节点 = {} 的所有子任务均已经完结,推动父节点的任务", fatherTaskId);
TaskBto fatherTask = taskService.get(fatherTaskId); TaskBto fatherTask = taskService.get(fatherTaskId);
//如果上一个id是-1 则证明是所有人的跟踪统计,即自动核查,那么下一步推进到所有人的跟踪,否则设置为-2,即维持跟踪者id //如果上一个id是-1 则证明是所有人的跟踪统计,即自动核查,那么下一步推进到所有人的跟踪,否则设置为-2,即维持跟踪者id
Integer lastUserId = fatherTask.getLastUserId() == -1 ? -1 : -2; //Integer lastUserId = fatherTask.getLastUserId() == -1 ? -1 : -2;
TaskBto newFatherTask = taskService.moveToNext(fatherTask, lastUserId); //TaskBto newFatherTask = taskService.moveToNext(fatherTask, lastUserId);
// 将父级的统计任务变为待办 // 将父级的统计任务变为待办
newFatherTask.getInvolveUserIdList().add(0); fatherTask.getInvolveUserIdList().add(0);
newFatherTask.setCurrentPoint(newFatherTask.getCurrentPoint() + 1); fatherTask.setCurrentPoint(fatherTask.getCurrentPoint() + 1);
taskService.update(newFatherTask); taskService.update(fatherTask);
} }
log.info("[核查模块] 数据汇总完毕"); log.info("[核查模块] 数据汇总完毕");
} }
...@@ -1264,6 +1269,7 @@ public class DeviceCheckController { ...@@ -1264,6 +1269,7 @@ public class DeviceCheckController {
.stream() .stream()
.filter(dev -> unitNameList.contains(dev.getOwnUnit())) .filter(dev -> unitNameList.contains(dev.getOwnUnit()))
.filter(dev -> initUnitNames.contains(dev.getOwnUnit())) .filter(dev -> initUnitNames.contains(dev.getOwnUnit()))
.filter(d->d.getLifeStatus() != 2 & d.getLifeStatus() != 14)
.map(transUtil::device2InitStatVo) .map(transUtil::device2InitStatVo)
.collect(toList()); .collect(toList());
...@@ -1313,6 +1319,7 @@ public class DeviceCheckController { ...@@ -1313,6 +1319,7 @@ public class DeviceCheckController {
List<CheckDeviceStatVo> cds = deviceRepo.findAll() List<CheckDeviceStatVo> cds = deviceRepo.findAll()
.stream() .stream()
.filter(dev -> unitNameList.contains(dev.getOwnUnit())) .filter(dev -> unitNameList.contains(dev.getOwnUnit()))
.filter(d->d.getLifeStatus() != 2 & d.getLifeStatus() != 14)
.map(transUtil::device2InitStatVo) .map(transUtil::device2InitStatVo)
.collect(toList()); .collect(toList());
......
...@@ -32,7 +32,7 @@ public class CheckExamDetailVo { ...@@ -32,7 +32,7 @@ public class CheckExamDetailVo {
@ApiModelProperty(name = "备注") @ApiModelProperty(name = "备注")
private String remark; private String remark;
public CheckExamDetailVo copy(Integer areaId,String remark) { public CheckExamDetailVo copy(Integer unitId,String remark) {
return new CheckExamDetailVo(this.groupName, this.userNames, areaId, remark); return new CheckExamDetailVo(this.groupName, this.userNames, unitId, remark);
} }
} }
...@@ -110,17 +110,17 @@ public class FinalCheckController { ...@@ -110,17 +110,17 @@ public class FinalCheckController {
for (int i = 0; i < defaultSize - listMap.size(); i++) { for (int i = 0; i < defaultSize - listMap.size(); i++) {
Map<String, String> lm = new HashMap<>(16); Map<String, String> lm = new HashMap<>(16);
lm.put("order", " "); lm.put("order", " ");
lm.put("model", ""); lm.put("model", " ");
lm.put("type", ""); lm.put("type", " ");
lm.put("vertical", ""); lm.put("vertical", " ");
lm.put("horizontal", ""); lm.put("horizontal", " ");
lm.put("commission", ""); lm.put("commission", " ");
lm.put("other", ""); lm.put("other", " ");
lm.put("total", ""); lm.put("total", " ");
lm.put("hosting", ""); lm.put("hosting", " ");
lm.put("received", ""); lm.put("received", " ");
lm.put("sending", ""); lm.put("sending", " ");
lm.put("scrapped", ""); lm.put("scrapped", " ");
listMap.add(lm); listMap.add(lm);
} }
} }
......
...@@ -41,9 +41,12 @@ public enum StatusEnum { ...@@ -41,9 +41,12 @@ public enum StatusEnum {
* 核查任务 * 核查任务
*/ */
//以下为stat状态 //以下为stat状态
CONFIRM_STAT_0(150,"市统计数据等待确认"),
CHECK_STAT_0(110, "统计数据收集中"), CHECK_STAT_0(110, "统计数据收集中"),
CHECK_STAT_1(111, "统计数据等待确认"), CHECK_STAT_1(111, "统计数据等待确认"),
//以下为detail状态 //以下为detail状态
CHECK_DETAIL_0(120, "等待专管员A处理"), CHECK_DETAIL_0(120, "等待专管员A处理"),
CHECK_DETAIL_1(121, "等待专管员B处理"), CHECK_DETAIL_1(121, "等待专管员B处理"),
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论