提交 09a3b44c authored 作者: Matrix's avatar Matrix

[核查模块] 修复BUG

上级 ab2d5952
...@@ -16,11 +16,11 @@ public enum CheckType { ...@@ -16,11 +16,11 @@ public enum CheckType {
/** /**
* 自动核查 * 自动核查
*/ */
AUTO_CHECK(1, "自动核查"), CT_CHECK(1, "核查"),
/** /**
* 手动核查 * 手动核查
*/ */
MANUAL_CHECK(2, "手动核查"); CT_EXAM(2, "检查");
private final Integer id; private final Integer id;
private final String name; private final String name;
......
...@@ -9,9 +9,7 @@ import lombok.EqualsAndHashCode; ...@@ -9,9 +9,7 @@ import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import org.hibernate.annotations.SQLDelete; import org.hibernate.annotations.SQLDelete;
import javax.persistence.Column; import javax.persistence.*;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.time.LocalDateTime; import java.time.LocalDateTime;
/** /**
...@@ -57,10 +55,11 @@ public class DeviceCheckStat extends BaseEntity { ...@@ -57,10 +55,11 @@ public class DeviceCheckStat extends BaseEntity {
private String statInfo; private String statInfo;
/** /**
* 检查类型,数据库里的数据结构是int类型,其中1为自动,2为手动 * 检查类型,数据库里的数据结构是int类型,其中1为核查,2为检查
* *
* @see com.tykj.dev.device.confirmcheck.common.CheckTypeConvert * @see com.tykj.dev.device.confirmcheck.common.CheckTypeConvert
*/ */
@Enumerated(EnumType.ORDINAL)
private CheckType checkType; private CheckType checkType;
/** /**
......
...@@ -70,7 +70,9 @@ public class CheckAreaStatVo implements Cloneable { ...@@ -70,7 +70,9 @@ public class CheckAreaStatVo implements Cloneable {
} }
public void start() { public void start() {
if (this.comProgress !=2){
this.comProgress = 1; this.comProgress = 1;
}
} }
public void end() { public void end() {
...@@ -120,12 +122,13 @@ public class CheckAreaStatVo implements Cloneable { ...@@ -120,12 +122,13 @@ public class CheckAreaStatVo implements Cloneable {
if (!this.areaName.equals(other.areaName) || this.areaStatId != other.areaStatId) { if (!this.areaName.equals(other.areaName) || this.areaStatId != other.areaStatId) {
//初始化账单的话则不用抛出异常,将other的detailId赋予即可 //初始化账单的话则不用抛出异常,将other的detailId赋予即可
if (this.areaDetailId == 0) { if (this.areaDetailId == 0) {
this.areaDetailId = other.areaStatId; this.areaDetailId = other.areaDetailId;
// this.areaStatId = other.areaStatId;
} else { } else {
throw new IllegalArgumentException(String.format( throw new IllegalArgumentException(String.format(
"要合并的两个地区统计数据的areaName与areaDetailId必须保持一致," + "要合并的两个地区统计数据的areaName与areaDetailId必须保持一致," +
"你提供的分别是areaName = %s 与 %s , areaDetailId = %d 与 %d %n", "你提供的分别是areaName = %s 与 %s , areaDetailId = %d 与 %d %n",
this.areaName, other.areaName, this.areaStatId, other.areaStatId)); this.areaName, other.areaName, this.areaDetailId, other.areaDetailId));
} }
} }
......
...@@ -134,7 +134,7 @@ public class CheckDeviceStatVo implements Cloneable { ...@@ -134,7 +134,7 @@ public class CheckDeviceStatVo implements Cloneable {
* @return 合并后的装备统计信息对相关,基于深拷贝 * @return 合并后的装备统计信息对相关,基于深拷贝
* @throws IllegalArgumentException 累加的统计信息对象必须是相同型号与名字的装备 * @throws IllegalArgumentException 累加的统计信息对象必须是相同型号与名字的装备
*/ */
public CheckDeviceStatVo cleanReduce(CheckDeviceStatVo other) { public CheckDeviceStatVo cleanReduce(CheckDeviceStatVo other) {
boolean flag = deviceModel.equals(other.getDeviceModel()) && deviceName.equals(other.getDeviceName()); boolean flag = deviceModel.equals(other.getDeviceModel()) && deviceName.equals(other.getDeviceName());
if (!flag) { if (!flag) {
throw new IllegalArgumentException("累加的统计信息对象必须是相同型号且名称相同的装备"); throw new IllegalArgumentException("累加的统计信息对象必须是相同型号且名称相同的装备");
......
...@@ -2,7 +2,9 @@ package com.tykj.dev.device.confirmcheck.entity.vo; ...@@ -2,7 +2,9 @@ package com.tykj.dev.device.confirmcheck.entity.vo;
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 java.util.List; import java.util.List;
...@@ -14,6 +16,8 @@ import java.util.List; ...@@ -14,6 +16,8 @@ import java.util.List;
*/ */
@Data @Data
@ApiModel("核查发起细节") @ApiModel("核查发起细节")
@AllArgsConstructor
@NoArgsConstructor
public class CheckExamDetailVo { public class CheckExamDetailVo {
@ApiModelProperty(name = "核查组名称") @ApiModelProperty(name = "核查组名称")
...@@ -27,4 +31,8 @@ public class CheckExamDetailVo { ...@@ -27,4 +31,8 @@ public class CheckExamDetailVo {
@ApiModelProperty(name = "备注") @ApiModelProperty(name = "备注")
private String remark; private String remark;
public CheckExamDetailVo copy(Integer areaId,String remark) {
return new CheckExamDetailVo(this.groupName, this.userNames, areaId, remark);
}
} }
...@@ -42,5 +42,8 @@ public class CheckStatTableVo { ...@@ -42,5 +42,8 @@ public class CheckStatTableVo {
@ApiModelProperty("完成情况") @ApiModelProperty("完成情况")
private String completion; private String completion;
@ApiModelProperty("检查类型,0-核查,1-检查")
private Integer checkType;
private String queryField; private String queryField;
} }
...@@ -20,6 +20,7 @@ import com.tykj.dev.device.confirmcheck.service.ConfirmCheckService; ...@@ -20,6 +20,7 @@ import com.tykj.dev.device.confirmcheck.service.ConfirmCheckService;
import com.tykj.dev.device.confirmcheck.utils.ObjTransUtil; import com.tykj.dev.device.confirmcheck.utils.ObjTransUtil;
import com.tykj.dev.device.library.repository.DeviceLibraryDao; import com.tykj.dev.device.library.repository.DeviceLibraryDao;
import com.tykj.dev.device.library.subject.domin.DeviceLibrary; import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
import com.tykj.dev.device.task.repository.TaskDao;
import com.tykj.dev.device.task.service.TaskService; import com.tykj.dev.device.task.service.TaskService;
import com.tykj.dev.device.task.subject.bto.TaskBto; import com.tykj.dev.device.task.subject.bto.TaskBto;
import com.tykj.dev.device.task.subject.domin.Task; import com.tykj.dev.device.task.subject.domin.Task;
...@@ -135,7 +136,7 @@ public class ConfirmCheckServiceImpl implements ConfirmCheckService, CommandLine ...@@ -135,7 +136,7 @@ public class ConfirmCheckServiceImpl implements ConfirmCheckService, CommandLine
// 构建省的统计账单 // 构建省的统计账单
DeviceCheckStat provStatDo = new DeviceCheckStat( DeviceCheckStat provStatDo = new DeviceCheckStat(
CheckType.AUTO_CHECK, CheckType.CT_CHECK,
baseTitle + provUnit.getName() + "核查统计单", baseTitle + provUnit.getName() + "核查统计单",
"核查统计单", "核查统计单",
"系统发起的统计|" + provUnit.getName() + "|" + provUnit.getAreaId()); "系统发起的统计|" + provUnit.getName() + "|" + provUnit.getAreaId());
...@@ -169,7 +170,7 @@ public class ConfirmCheckServiceImpl implements ConfirmCheckService, CommandLine ...@@ -169,7 +170,7 @@ public class ConfirmCheckServiceImpl implements ConfirmCheckService, CommandLine
// 构建市统账单 // 构建市统账单
DeviceCheckStat cityStatDo = new DeviceCheckStat( DeviceCheckStat cityStatDo = new DeviceCheckStat(
CheckType.AUTO_CHECK, CheckType.CT_CHECK,
baseTitle + cityUnit.getName() + "核查统计单", baseTitle + cityUnit.getName() + "核查统计单",
"核查统计单", "核查统计单",
"系统发起的统计|" + cityUnit.getName() + "|" + cityUnit.getAreaId() "系统发起的统计|" + cityUnit.getName() + "|" + cityUnit.getAreaId()
...@@ -304,10 +305,21 @@ public class ConfirmCheckServiceImpl implements ConfirmCheckService, CommandLine ...@@ -304,10 +305,21 @@ public class ConfirmCheckServiceImpl implements ConfirmCheckService, CommandLine
*/ */
@Override @Override
public Page<CheckStatTableVo> findAllStatTable(CheckBillSelectVo checkBillSelectVo) { public Page<CheckStatTableVo> findAllStatTable(CheckBillSelectVo checkBillSelectVo) {
//过滤出顶级节点
List<TaskBto> topStatList = taskService.findBillType(7);
List<TaskBto> topDetailList = taskService.findBillType(8);
topStatList.addAll(topDetailList);
List<Integer> topIdList = topStatList.stream()
.filter(taskBto -> taskBto.getParentTaskId().equals(0) || taskBto.getParentTaskId() == null)
.map(TaskBto::getBillId)
.collect(toList());
List<CheckStatTableVo> tableVos = statDao.findAll(checkBillSelectVo.getPageable().getSort()).stream() List<CheckStatTableVo> tableVos = statDao.findAll(checkBillSelectVo.getPageable().getSort()).stream()
.filter(deviceCheckStat -> !"[]".equals(deviceCheckStat.getStatInfo())) .filter(deviceCheckStat -> !"[]".equals(deviceCheckStat.getStatInfo()))
.map(objTransUtil::stat2TableVo) .map(objTransUtil::stat2TableVo)
.filter(vo -> keywordFilter(vo, checkBillSelectVo.getKeyword())) .filter(vo -> keywordFilter(vo, checkBillSelectVo.getKeyword()))
.filter(v->topIdList.contains(v.getId()))
.collect(Collectors.toList()); .collect(Collectors.toList());
return PageUtil.getPerPage(checkBillSelectVo.getPage(),checkBillSelectVo.getSize(),tableVos,checkBillSelectVo.getPageable()); return PageUtil.getPerPage(checkBillSelectVo.getPage(),checkBillSelectVo.getSize(),tableVos,checkBillSelectVo.getPageable());
......
...@@ -155,6 +155,7 @@ public class ObjTransUtil { ...@@ -155,6 +155,7 @@ public class ObjTransUtil {
checkUserNames, checkUserNames,
stat.getCreateTime(), stat.getCreateTime(),
completion, completion,
stat.getCheckType().CT_CHECK.getId(),
joiner.toString() joiner.toString()
); );
......
...@@ -18,6 +18,8 @@ public interface UnitsDao extends JpaRepository<Units, Integer>, JpaSpecificatio ...@@ -18,6 +18,8 @@ public interface UnitsDao extends JpaRepository<Units, Integer>, JpaSpecificatio
List<Units> findAllByLevelGreaterThanEqual(Integer level); List<Units> findAllByLevelGreaterThanEqual(Integer level);
List<Units> findAllByTypeNotIn(List<Integer> ids);
List<Units> findByAreaIdIn(List<Integer> areaIds); List<Units> findByAreaIdIn(List<Integer> areaIds);
List<Units> findAllByAreaIdIn(List<Integer> ids); List<Units> findAllByAreaIdIn(List<Integer> ids);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论