提交 07c8eab4 authored 作者: Matrix's avatar Matrix

[核查模块] 修复了Miss Z 点出的很多奇怪的问题以及奇怪的需求

上级 debb315a
......@@ -108,7 +108,7 @@ public class DeviceCheckDetail extends BaseEntity {
/**
* 核查详情(装备主键id+核对结果(0缺失1无误2新增3不在库9未检查,字符-作为状态分隔符字符,作为分隔符))
*/
@Column(name = "check_detail",columnDefinition = "TEXT")
@Column(name = "check_detail", columnDefinition = "TEXT")
@ApiModelProperty(value = "核查详情(装备主键id+核对结果(0缺失1无误2新增3不在库9未检查,字符x作为分隔符)),例如1-2,2-2,意为主键id为1的装备缺失,为2的无误,为3的新增")
private String checkDetail;
/**
......@@ -133,7 +133,7 @@ public class DeviceCheckDetail extends BaseEntity {
@ApiModelProperty(value = "区块链记录id")
private String recordId;
@Column(name = "check_files",columnDefinition = "TEXT")
@Column(name = "check_files", columnDefinition = "TEXT")
private String checkFiles;
@Transient
......@@ -222,7 +222,7 @@ public class DeviceCheckDetail extends BaseEntity {
String checkDetail = StringUtils.isEmpty(badCheckDetail) ? goodCheckDetail : goodCheckDetail + "," + badCheckDetail;
return new DeviceCheckDetail(
title + checkUnit + "核查详情单",
checkUnit + "核查详情单" + "%^&" + title,
0,
checkUserA,
checkUserB,
......
......@@ -61,7 +61,11 @@ public class CheckAreaStatVo implements Cloneable {
this.actualCount = vo.getActualCount();
this.supposeCount = vo.getSupposeCount();
this.comProgress = vo.getComProgress();
this.comSituation = vo.getComSituation();
if (this.comSituation == 1 || vo.getComSituation() == 1) {
this.comSituation = 1;
} else {
this.comSituation = 0;
}
this.areaStatId = vo.getAreaStatId();
this.areaDetailId = vo.getAreaDetailId();
}
......@@ -117,7 +121,12 @@ public class CheckAreaStatVo implements Cloneable {
reducedVo.supposeCount += other.supposeCount;
reducedVo.actualCount += other.actualCount;
reducedVo.comProgress = other.comProgress;
reducedVo.comSituation = other.comSituation;
//0 无误 1异常
if (reducedVo.comSituation == 1 || other.comSituation == 1) {
reducedVo.comSituation = 1;
} else {
reducedVo.comSituation = 0;
}
return reducedVo;
}
......@@ -159,7 +168,12 @@ public class CheckAreaStatVo implements Cloneable {
CheckAreaStatVo reducedVo = new CheckAreaStatVo(this);
reducedVo.actualCount += other.actualCount;
reducedVo.comProgress = other.comProgress;
reducedVo.comSituation = other.comSituation;
//0 无误 1异常
if (reducedVo.comSituation == 1 || other.comSituation == 1) {
reducedVo.comSituation = 1;
} else {
reducedVo.comSituation = 0;
}
return reducedVo;
}
......@@ -170,7 +184,12 @@ public class CheckAreaStatVo implements Cloneable {
this.supposeCount += other.getSupposeCount();
this.actualCount += other.getActualCount();
this.comProgress = other.getComProgress();
this.comSituation = other.getComSituation();
//0 无误 1异常
if (this.comSituation == 1 || other.comSituation == 1) {
this.comSituation = 1;
} else {
this.comSituation = 0;
}
return this;
}
......
......@@ -23,4 +23,7 @@ public class CheckTitleAndTimeVo {
@ApiModelProperty("截止时间")
private LocalDateTime createTime;
@ApiModelProperty("备注")
private String remark;
}
package com.tykj.dev.device.confirmcheck.entity.vo;
import com.tykj.dev.device.file.entity.FileRet;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.web.bind.annotation.RequestBody;
import java.util.List;
/**
* DetailVo.
*
* @author Matrix <xhyrzldf@gmail.com>
* @since 2021/5/26 at 7:06 下午
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class DetailVo {
List<FileRet> checkFiles;
DevLibVo devLibVo;
}
......@@ -30,7 +30,8 @@ public class DeviceInLibVo {
private String rfidCardId;
/**
* 0缺失1无误2新增3不在库9未检查
* 十位数 1 人工 2 自动
* 个位数 0缺失1无误2新增3不在库9未检查
*/
private int proofResult;
......
......@@ -24,6 +24,16 @@ public interface DeviceCheckDetailDao extends JpaRepository<DeviceCheckDetail, I
@Query("update DeviceCheckDetail o set o.checkDetail=?2,o.checkResult = ?3,o.userAId =?4,o.userBId=?5,o.checkedCount=?6 where o.id=?1")
void updateCheckDetail(Integer id, String checkDetail, String checkResult, int userAId, int userBId, Integer checkedCount);
/**
* 根据id更新checkDetail 用于专管员B检查
*
* @param id detail id
* @param checkDetail 要更新的检查结果
*/
@Modifying
@Query("update DeviceCheckDetail o set o.checkDetail=?2,o.checkResult = ?3,o.checkedCount=?4 where o.id=?1")
void updateCheckDetail4Check(Integer id, String checkDetail, String checkResult, Integer checkedCount);
@Modifying
@Query("update DeviceCheckDetail o set o.checkStatus=?2 where o.id=?1")
int updateCheckStatus(int id, int checkStatus);
......
......@@ -39,6 +39,8 @@ import java.io.IOException;
import java.util.*;
import java.util.stream.Collectors;
import static java.util.stream.Collectors.toList;
/**
* ObjTransUtil.
*
......@@ -130,10 +132,28 @@ public class ObjTransUtil {
TaskBto fatherTask = taskService.get(stat.getId(), BusinessEnum.CONFIRM_CHECK_STAT.id);
Integer fatherTaskId = fatherTask.getId();
List<Task> childTasks = taskDao.findAllByParentTaskId(fatherTaskId);
long total = childTasks.size();
List<Task> childTask = taskDao.findAllByParentTaskId(fatherTaskId);
boolean flag = false;
boolean confirmTaskisDone = false;
for (Task task : childTask) {
if (task.getTitle().contains("统计确认待办任务")) {
if (task.getBillStatus() != 9999) {
flag = true;
} else {
confirmTaskisDone = true;
}
}
}
// 3/3 -> 统计待确认 -> 省统计任务待完结
childTask = childTask.stream().filter(task -> !task.getTitle().contains("统计确认待办任务"))
.collect(toList());
long total = childTask.size();
long done = childTasks.stream()
long done = childTask.stream()
.filter(task -> task.getBillStatus().equals(9999))
.count();
......@@ -143,7 +163,20 @@ public class ObjTransUtil {
if (stat.getCheckType() == CheckType.CT_EXAM && !fatherTask.getBillStatus().equals(9999)) {
completion = "核查完成待办结";
} else {
completion = "核查完成";
if (flag) {
completion = "核查完成待确认";
} else {
// confirmTaskidDone 为true 代表此时等待最后的father任务 为false代表 flag = false 且isDone为false 代表整个节点里没有确认节点直接完结
if (confirmTaskisDone) {
if (fatherTask.getBillStatus() == 9999) {
completion = "核查完成";
} else {
completion = "核查完成待办结";
}
} else {
completion = "核查完成";
}
}
}
} else {
completion = done + "/" + total;
......@@ -293,8 +326,9 @@ public class ObjTransUtil {
int proofResult = Integer.parseInt(array[1]);
DeviceLibrary device = deviceRepo.findById(deviceId).orElseThrow(
() -> new ApiException(ResponseEntity.badRequest().body(String.format("检查到装备序号为%d的装备不在资料库中,请先执行入库操作!", deviceId)))).setConfigName();
//依据proofResult 判断是否是在库装备
if (proofResult == 3) {
//依据proofResult的个位数 判断是否是在库装备
int digit = proofResult % 10;
if (digit == 3) {
// 非在库装备
notInLibVoList.add(toCheckNotInLibVo(device));
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论