提交 0cb1a683 authored 作者: ljj's avatar ljj

fix(screen): 修改核查大屏地图的bug

上级 f63bcc44
...@@ -7,6 +7,7 @@ import com.tykj.dev.misc.base.BeanHelper; ...@@ -7,6 +7,7 @@ import com.tykj.dev.misc.base.BeanHelper;
import com.tykj.dev.misc.utils.TimestampUtil; import com.tykj.dev.misc.utils.TimestampUtil;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import lombok.Value; import lombok.Value;
...@@ -38,6 +39,7 @@ import java.util.stream.Collectors; ...@@ -38,6 +39,7 @@ import java.util.stream.Collectors;
@ApiModel("核查详情") @ApiModel("核查详情")
@NoArgsConstructor @NoArgsConstructor
@Table(name = "device_check_detail") @Table(name = "device_check_detail")
@AllArgsConstructor
public class DeviceCheckDetail extends BaseEntity { public class DeviceCheckDetail extends BaseEntity {
/** /**
......
...@@ -10,6 +10,8 @@ import com.tykj.dev.device.confirmcheck.repository.DeviceCheckStatDao; ...@@ -10,6 +10,8 @@ import com.tykj.dev.device.confirmcheck.repository.DeviceCheckStatDao;
import com.tykj.dev.device.confirmcheck.service.CheckScreenService; import com.tykj.dev.device.confirmcheck.service.CheckScreenService;
import com.tykj.dev.device.task.repository.TaskDao; import com.tykj.dev.device.task.repository.TaskDao;
import com.tykj.dev.device.task.subject.domin.Task; import com.tykj.dev.device.task.subject.domin.Task;
import com.tykj.dev.device.user.cache.UnitsCache;
import com.tykj.dev.device.user.subject.entity.Units;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Sort; import org.springframework.data.domain.Sort;
...@@ -37,6 +39,8 @@ public class CheckScreenServiceImpl implements CheckScreenService { ...@@ -37,6 +39,8 @@ public class CheckScreenServiceImpl implements CheckScreenService {
private TaskDao taskDao; private TaskDao taskDao;
@Autowired @Autowired
private DeviceCheckStatDao statDao; private DeviceCheckStatDao statDao;
@Autowired
private UnitsCache unitsCache;
@Override @Override
public List<CheckUnitInfo> statMapData() { public List<CheckUnitInfo> statMapData() {
...@@ -50,7 +54,7 @@ public class CheckScreenServiceImpl implements CheckScreenService { ...@@ -50,7 +54,7 @@ public class CheckScreenServiceImpl implements CheckScreenService {
List<DeviceCheckStat> statList = statDao.findAll(and.build()); List<DeviceCheckStat> statList = statDao.findAll(and.build());
// 查询task,所有的顶级任务 // 查询task,所有的顶级任务,过滤掉已结束或已终止的任务
List<Task> tasks = taskDao.findAllByBillIdInAndBusinessTypeAndBillStatusNotIn( List<Task> tasks = taskDao.findAllByBillIdInAndBusinessTypeAndBillStatusNotIn(
statList.parallelStream().map(DeviceCheckStat::getId).collect(Collectors.toList()), statList.parallelStream().map(DeviceCheckStat::getId).collect(Collectors.toList()),
7, 7,
...@@ -61,18 +65,24 @@ public class CheckScreenServiceImpl implements CheckScreenService { ...@@ -61,18 +65,24 @@ public class CheckScreenServiceImpl implements CheckScreenService {
List<CheckUnitInfo> rs = new ArrayList<>(); List<CheckUnitInfo> rs = new ArrayList<>();
for (Task task : tasks) { for (Task task : tasks) {
List<Task> secondTasks = taskDao.findAllByParentTaskId(task.getId()); // 过滤掉已完成的二级任务
List<Task> secondTasks = taskDao.findAllByParentTaskId(task.getId()).stream()
.filter(o -> o.getBillStatus() != 9999 || o.getBillStatus() != 20001)
.collect(Collectors.toList());
for (Task secondTask : secondTasks) { for (Task secondTask : secondTasks) {
if (secondTask.getBusinessType() == 8) { if (secondTask.getBusinessType() == 8) {
CheckUnitInfo c = CheckFill(initCheckUnitInfo(task,task.getBillId()), secondTask, task.getBillId()); log.error("[check] 核查地图统计发现错误数据: task id:{}", secondTask.getId());
rs.add(c);
} else { } else {
List<Task> threeTasks = taskDao.findAllByParentTaskId(secondTask.getId()); List<Task> threeTasks = taskDao.findAllByParentTaskId(secondTask.getId()).stream()
.filter(o -> o.getBillStatus() != 9999 || o.getBillStatus() != 20001)
.collect(Collectors.toList());
for (Task threeTask : threeTasks) { for (Task threeTask : threeTasks) {
if (threeTask.getBusinessType() == 8) { if (threeTask.getBusinessType() == 8 ) {
CheckUnitInfo c = CheckFill(initCheckUnitInfo(task, task.getBillId()), threeTask, task.getBillId()); CheckUnitInfo c = CheckFill(initCheckUnitInfo(task, task.getBillId()), threeTask, task.getBillId());
rs.add(c); if (c != null) {
rs.add(c);
}
} }
} }
} }
...@@ -102,30 +112,52 @@ public class CheckScreenServiceImpl implements CheckScreenService { ...@@ -102,30 +112,52 @@ public class CheckScreenServiceImpl implements CheckScreenService {
private CheckUnitInfo CheckFill(CheckUnitInfo checkUnitInfo, Task task, Integer bigBillId) { private CheckUnitInfo CheckFill(CheckUnitInfo checkUnitInfo, Task task, Integer bigBillId) {
Units byId = unitsCache.findById(task.getOwnUnit());
// detail 数据
DeviceCheckDetail detail = detailDao.findById(task.getBillId()).orElse(new DeviceCheckDetail()); DeviceCheckDetail detail = detailDao.findById(task.getBillId()).orElse(new DeviceCheckDetail());
if (detail.isReview() && (task.getBillStatus() == 9999 || task.getBillStatus() == 20001)) {
// 如果不是待核查,不统计
return null;
}
checkUnitInfo.setBillId(bigBillId); checkUnitInfo.setBillId(bigBillId);
checkUnitInfo.setUnitId(task.getOwnUnit()); checkUnitInfo.setUnitId(task.getOwnUnit());
if (task.getBillStatus() == 120 ||task.getBillStatus() == 140) { log.info("big task :{},task bill id:{}, 状态:{}", bigBillId, task.getBillId(), task.getBillStatus());
if (task.getBillStatus() == 140 ||task.getBillStatus() == 160) {
checkUnitInfo.setCheckOneInfo(0); checkUnitInfo.setCheckOneInfo(0);
checkUnitInfo.setCheckTwoInfo(0); checkUnitInfo.setCheckTwoInfo(0);
checkUnitInfo.setCheckThreeInfo(0); checkUnitInfo.setCheckThreeInfo(0);
} else if (task.getBillStatus() == 160) { } else if (task.getBillStatus() == 120) {
checkUnitInfo.setCheckOneInfo(0); checkUnitInfo.setCheckOneInfo(0);
checkUnitInfo.setCheckTwoInfo(0); checkUnitInfo.setCheckTwoInfo(0);
checkUnitInfo.setCheckThreeInfo(-1); checkUnitInfo.setCheckThreeInfo(-1);
} else if (task.getBillStatus() == 121 ||task.getBillStatus() == 141 ) { } else if (task.getBillStatus() == 141 ||task.getBillStatus() == 161 ) {
checkUnitInfo.setCheckOneInfo(1); checkUnitInfo.setCheckOneInfo(1);
checkUnitInfo.setCheckTwoInfo(0); checkUnitInfo.setCheckTwoInfo(0);
checkUnitInfo.setCheckThreeInfo(0); checkUnitInfo.setCheckThreeInfo(0);
} else if (task.getBillStatus() == 161) { } else if (task.getBillStatus() == 121) {
checkUnitInfo.setCheckOneInfo(1); checkUnitInfo.setCheckOneInfo(1);
checkUnitInfo.setCheckTwoInfo(0); checkUnitInfo.setCheckTwoInfo(0);
checkUnitInfo.setCheckThreeInfo(-1); checkUnitInfo.setCheckThreeInfo(-1);
} else if (task.getBillStatus() == 122 ||task.getBillStatus() == 142) { } else if (task.getBillStatus() == 142 ||task.getBillStatus() == 162) {
checkUnitInfo.setCheckOneInfo(1); checkUnitInfo.setCheckOneInfo(1);
checkUnitInfo.setCheckTwoInfo(1); checkUnitInfo.setCheckTwoInfo(1);
checkUnitInfo.setCheckThreeInfo(0); checkUnitInfo.setCheckThreeInfo(0);
} else if (task.getBillStatus() == 9999 && !detail.isReview()) {
checkUnitInfo.setCheckOneInfo(1);
checkUnitInfo.setCheckTwoInfo(1);
checkUnitInfo.setCheckThreeInfo(0);
Units units = unitsCache.findById(task.getOwnUnit());
if (units.getLevel() == 1 || units.getEscrow() == 1) {
checkUnitInfo.setCheckThreeInfo(-1);
}
} }
return checkUnitInfo; return checkUnitInfo;
......
...@@ -105,7 +105,7 @@ public class CheckMapTask implements CommandLineRunner { ...@@ -105,7 +105,7 @@ public class CheckMapTask implements CommandLineRunner {
.code(regionData.getCode()) .code(regionData.getCode())
.unitId(qu.getUnitId()) .unitId(qu.getUnitId())
.unitName(qu.getName()) .unitName(qu.getName())
.data(collect.get(units.getUnitId())) .data(collect.get(qu.getUnitId()))
.build(); .build();
childrenData.add(build); childrenData.add(build);
} }
......
...@@ -31,8 +31,6 @@ public class RegionUtil { ...@@ -31,8 +31,6 @@ public class RegionUtil {
List<RegionData> shis = regionDataDao.findAllByParentId(ZJ_ID); List<RegionData> shis = regionDataDao.findAllByParentId(ZJ_ID);
shis.forEach(o -> o.setRegionDatas(regionDataDao.findAllByParentId(o.getRegionId()))); shis.forEach(o -> o.setRegionDatas(regionDataDao.findAllByParentId(o.getRegionId())));
} }
} }
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
<module>dev-zxing</module> <module>dev-zxing</module>
<module>dev-readmachine</module> <module>dev-readmachine</module>
<module>dev-screen</module> <module>dev-screen</module>
</modules> </modules>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论