提交 dd798345 authored 作者: Matrix's avatar Matrix

fix(核查模块): 修复了省自查任务的一系列BUG

- 省本级自查任务状态号的错误(由140->修改为160) - 省自查任务的父ID为null的问题
上级 747cf277
......@@ -135,23 +135,23 @@ public class DeviceCheckController {
@GetMapping("/judge/{taskId}")
@ApiOperation(value = "根据taskId判断该task任务是由核查发起的还是由检查发起的")
public ResponseEntity judgeExamDetail(@PathVariable Integer taskId){
public ResponseEntity judgeExamDetail(@PathVariable Integer taskId) {
Task task = taskRepo.findById(taskId).orElseThrow(() -> new ApiException("没有找到该Task任务,你提供的taskId = " + taskId));
Task finalTaks;
if (task.getParentTaskId()!=null && task.getParentTaskId() !=0){
if (task.getParentTaskId() != null && task.getParentTaskId() != 0) {
Integer pId = task.getParentTaskId();
Task parentTask = taskRepo.findById(pId).get();
// 存在父任务,找到父任务,二次判断
if (parentTask.getParentTaskId()!=null && parentTask.getParentTaskId() !=0){
if (parentTask.getParentTaskId() != null && parentTask.getParentTaskId() != 0) {
Integer ppId = parentTask.getParentTaskId();
Task doubleParentTask = taskRepo.findById(pId).get();
Task doubleParentTask = taskRepo.findById(ppId).get();
finalTaks = doubleParentTask;
}else {
} else {
// 不存在二级父任务,那么头节点就是父任务
finalTaks = parentTask;
}
}else {
} else {
// 不存在父任务,那么头节点就是自己
finalTaks = task;
}
......@@ -280,7 +280,10 @@ public class DeviceCheckController {
.in("businessType", 7, 8)
.build();
List<Task> cacheTask = taskRepo.findAll(pred);
List<Task> cacheTask = taskRepo.findAll(pred)
.stream()
.filter(task -> Objects.nonNull(task.getParentTaskId()))
.collect(toList());
//key = parentId , value childList
Map<Integer, List<Task>> parentTaskMap = cacheTask.stream()
.collect(groupingBy(Task::getParentTaskId));
......@@ -610,36 +613,39 @@ public class DeviceCheckController {
String checkResult = "";
String remark = task.getRemark();
// 核查结果
// 核查结果 - 如果省的自查任务,核查情况是完成了之后,核查结果就是无误
String unitName = detailRepo.findById(task.getBillId()).get().getCheckUnit();
Integer areaType = auService.findOne(AuExample.UnitName, unitName).getType();
if (!situation.contains("完成")) {
checkResult = "无";
} else {
if (comSituation == 10) {
// 再判断一下 是2级结构还是3级结构
Integer rootId = taskService.findByTaskId(task.getParentTaskId()).getParentTaskId();
boolean isTwoLevel = rootId == null || rootId == 0;
// 2级结构 - 发起人单位是省单位 则不变, 发起人市市单位则变为无
if (isTwoLevel) {
Integer startUnitId = userService.findById(task.getCreateUserId()).getUnitsId();
if (startUnitId != 1) {
checkResult = "无";
} else {
checkResult = "等待省审核";
}
} else if (areaType == 1) {
checkResult = "无误";
} else if (comSituation == 10) {
// 再判断一下 是2级结构(检查统计)还是3级结构(核查统计)
Integer rootId = taskService.findByTaskId(task.getParentTaskId()).getParentTaskId();
boolean isTwoLevel = rootId == null || rootId == 0;
// 2级结构 - 检查统计 发起人单位是省,结果为等待省审核,发起人是市则是无
if (isTwoLevel) {
Integer startUnitId = userService.findById(task.getCreateUserId()).getUnitsId();
if (startUnitId != 1) {
checkResult = "无";
} else {
checkResult = "等待省审核";
}
} else if (comSituation == 12) {
checkResult = "无误";
} else if (comSituation == 13) {
int redoTime = 1;
if (Objects.nonNull(remark) && remark.contains("ROLLBACK")) {
redoTime = Integer.valueOf(remark.split("-")[1]);
}
checkResult = redoTime + "次未通过";
} else {
checkResult = "状态异常";
checkResult = "等待省审核";
}
} else if (comSituation == 12) {
checkResult = "无误";
} else if (comSituation == 13) {
int redoTime = 1;
if (Objects.nonNull(remark) && remark.contains("ROLLBACK")) {
redoTime = Integer.valueOf(remark.split("-")[1]);
}
checkResult = redoTime + "次未通过";
} else {
checkResult = "状态异常";
}
led.setCheckResult(checkResult);
......@@ -843,10 +849,13 @@ public class DeviceCheckController {
Integer fatherId = 0;
Integer initStatusId = 0;
// level = 2 市级 否则 区级 ,市级的自查初始状态160,区级的自查初始状态140
if (unit.getLevel() == 2) {
// level = 1 或者2 市省级 否则 区级 ,市省级的自查初始状态160,区级的自查初始状态140
if (unit.getLevel() == 1 || unit.getLevel() == 2) {
fatherId = cityExamIdMap.get(unit.getUnitId());
initStatusId = CHECK_DETAIL_CITY_0.id;
if (fatherId == null){
fatherId = provStatTask.getId();
}
} else {
fatherId = provStatTask.getId();
initStatusId = CHECK_DETAIL_REGION_0.id;
......@@ -1102,6 +1111,7 @@ public class DeviceCheckController {
public ResponseEntity<ResultObj> checkUserA(@PathVariable Integer id,
@RequestParam int assignUserId,
@RequestParam String checkResult,
@RequestParam String terminalInfo,
@RequestBody DevLibVo devLibVo) {
//1. 更新checkDetail
log.info("[核查模块] 专管员A正在进行详情账单核查,且指定下一个审核人B id 为 {}", assignUserId);
......@@ -1110,7 +1120,7 @@ public class DeviceCheckController {
long count = devLibVo.getDevInLibrary().stream()
.filter(deviceInLibVo -> deviceInLibVo.getProofResult() % 10 != 9)
.count();
detailRepo.updateCheckDetail(id, detailString, checkResult, currentUser.getUserId(), assignUserId, (int) count);
detailRepo.updateCheckDetailWithT(id, detailString, checkResult, currentUser.getUserId(), assignUserId, (int) count,terminalInfo);
//2. 推进TASK 状态
TaskBto currentTask = taskService.get(id, CONFIRM_CHECK_DETAIL.id);
currentTask.getInvolveUserIdList().set(0, authenticationUtils.getAuthentication().getCurrentUserInfo().getUserId());
......
......@@ -139,6 +139,12 @@ public class DeviceCheckDetail extends BaseEntity {
@Column(name = "check_files", columnDefinition = "TEXT")
private String checkFiles;
/**
* 手持终端信息字段
*/
@ApiModelProperty(value = "手持终端信息字段")
private String terminalInfo;
@Transient
private List<FileRet> checkFileList = new ArrayList<>();
......
......@@ -108,6 +108,12 @@ public class CheckDetailVo {
@ApiModelProperty(value = "核查结果")
private String checkResult;
/**
* 手持终端信息字段
*/
@ApiModelProperty(value = "终端信息")
private String terminalInfo;
@ApiModelProperty(value = "在库装备列表")
private List<DeviceInLibVo> devInLibrary;
......
......@@ -24,6 +24,10 @@ 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);
@Modifying
@Query("update DeviceCheckDetail o set o.checkDetail=?2,o.checkResult = ?3,o.userAId =?4,o.userBId=?5,o.checkedCount=?6,o.terminalInfo=?7 where o.id=?1")
void updateCheckDetailWithT(Integer id, String checkDetail, String checkResult, int userAId, int userBId, Integer checkedCount,String terminalInfo);
/**
* 根据id更新checkDetail 用于专管员B检查
*
......
......@@ -464,6 +464,13 @@
<artifactId>spring-boot-admin-starter-client</artifactId>
<version>2.1.0</version>
</dependency>
<!--Java方法链路追踪-->
<dependency>
<groupId>cn.langpy</groupId>
<artifactId>ko-time</artifactId>
<version>2.0.0</version>
</dependency>
</dependencies>
<build>
......
......@@ -15,4 +15,7 @@ spring.jackson.time-zone=GMT+8
file.path=/Users/zjm/code/test-tu/
preview.path=http://192.168.102.169:8087/file/
useBlockcha=true
spring.jpa.hibernate.use-new-id-generator-mappings=false
\ No newline at end of file
spring.jpa.hibernate.use-new-id-generator-mappings=false
# 方法性能链路追踪配置
ko-time.pointcut=execution(* com.tykj.dev.device.confirmcheck..*(..))
\ No newline at end of file
......@@ -2,6 +2,25 @@
## 流程说明
![核查流程](images/confirmcheck/核查流程.jpg)
## 涉及到的任务状态与术语说明
**任务状态号**
| 状态号 | 说明 | 备注 |
| ----------- | -------------------------- | ---------------------------- |
| 140-141-142 | 区自查用到的状态号 | 代表等待区A-等待区B-等待市审 |
| 160-161 | 市/省自查用到的状态号 | 代表等待市/省A - 等待市/省B |
| 130-131 | 检查统计任务会用到的状态号 | |
| 110-111 | 核查统计任务会用到的状态号 | |
**术语**
| 术语名 | 说明 |
| -------- | ------------------------------------ |
| 自查 | 某省/市/区自己检查自己库房任务的统称 |
| 核查情况 | 发起检查的单位对下级单位的进度说明 |
| 核查结果 | 省对下级单位的审核进度说明 |
## 市与区的检查页面
......@@ -139,7 +158,7 @@
- 区自查 专管员A - 专管员B - 市审核 - 结束
- 市本级自查 专管员A - 专管员B - 结束
## 已经发起的老数据的维护
## 性能优化与监控
......
......@@ -292,7 +292,6 @@
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论