From 13717d79553c8800e18cf008da5f7ff711f49e27 Mon Sep 17 00:00:00 2001 From: pengwei Date: Wed, 30 Jul 2025 18:38:37 +0800 Subject: [PATCH] =?UTF-8?q?fit=EF=BC=9A=E7=9D=A3=E5=AF=9F=E9=97=AE?= =?UTF-8?q?=E9=A2=98=E4=B8=8B=E5=8F=91=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../InspectionController.java | 2 +- .../TestingAlcoholController.java | 43 ++++++++++++------- .../pojo/param/TaskTestingTaskDistribute.java | 2 +- .../pojo/vo/TaskInspectionProblemVo.java | 3 +- 4 files changed, 32 insertions(+), 18 deletions(-) diff --git a/src/main/java/com/biutag/supervision/controller/mobileSupervision/InspectionController.java b/src/main/java/com/biutag/supervision/controller/mobileSupervision/InspectionController.java index e58617a..160632d 100644 --- a/src/main/java/com/biutag/supervision/controller/mobileSupervision/InspectionController.java +++ b/src/main/java/com/biutag/supervision/controller/mobileSupervision/InspectionController.java @@ -92,7 +92,7 @@ public class InspectionController { vo.setPeoples(JSON.parseArray(item.getPeoples(), TaskProblemDto.People.class)); } if (StrUtil.isNotBlank(item.getFiles())) { - vo.setFiles(JSON.parseArray(item.getFiles(), FileVo.class)); + vo.setFileData(JSON.parseArray(item.getFiles(), FileVo.class)); } return vo; }).toList(); diff --git a/src/main/java/com/biutag/supervision/controller/mobileSupervision/TestingAlcoholController.java b/src/main/java/com/biutag/supervision/controller/mobileSupervision/TestingAlcoholController.java index ab52c38..557a4f3 100644 --- a/src/main/java/com/biutag/supervision/controller/mobileSupervision/TestingAlcoholController.java +++ b/src/main/java/com/biutag/supervision/controller/mobileSupervision/TestingAlcoholController.java @@ -162,27 +162,36 @@ public class TestingAlcoholController { switch (distribute.getTableKey()){ case "selfexamination": vo= distribute.getProblemVo(); + if (StrUtil.isNotBlank(distribute.getProblemVo().getFiles())) { + vo.setFileData(JSON.parseArray(distribute.getProblemVo().getFiles(), FileVo.class)); + } break; case "inspection": vo= distribute.getProblemVo(); + if (StrUtil.isNotBlank(distribute.getProblemVo().getFiles())) { + vo.setFileData(JSON.parseArray(distribute.getProblemVo().getFiles(), FileVo.class)); + } break; case "testing_alcohol": //违反六项规定 List list = supTaskProblemService.list(new LambdaQueryWrapper().eq(SupTaskProblem::getTaskId,distribute.getTaskId())); //判断 if(CollectionUtil.isNotEmpty(list)){ - list = list.stream().filter(s->StrUtil.isNotEmpty(s.getEmpNo())) - .filter(s->s.getPeoples().contains(distribute.getEmpNo())||s.getEmpNo().equals(distribute.getEmpNo())).toList(); - if(CollectionUtil.isNotEmpty(list)){ - SupTaskProblem supTaskProblem =list.get(0); - BeanUtils.copyProperties(supTaskProblem, vo); - if (StrUtil.isNotBlank(supTaskProblem.getPeoples())) { - vo.setPeoples(JSON.parseArray(supTaskProblem.getPeoples(), TaskProblemDto.People.class)); - } - if (StrUtil.isNotBlank(supTaskProblem.getFiles())) { - vo.setFiles(JSON.parseArray(supTaskProblem.getFiles(), FileVo.class)); - } - } + list = list.stream().filter(s->StrUtil.isNotEmpty(s.getEmpNo())).toList(); + if(CollectionUtil.isNotEmpty(list)){ + list = list.stream().filter(s->s.getPeoples().contains(distribute.getEmpNo())||s.getEmpNo().equals(distribute.getEmpNo())).toList(); + if(CollectionUtil.isNotEmpty(list)){ + SupTaskProblem supTaskProblem =list.get(0); + BeanUtils.copyProperties(supTaskProblem, vo); + if (StrUtil.isNotBlank(supTaskProblem.getPeoples())) { + vo.setPeoples(JSON.parseArray(supTaskProblem.getPeoples(), TaskProblemDto.People.class)); + } + if (StrUtil.isNotBlank(supTaskProblem.getFiles())) { + vo.setFileData(JSON.parseArray(supTaskProblem.getFiles(), FileVo.class)); + } + } + } + } break; case "risk_personal": @@ -194,12 +203,16 @@ public class TestingAlcoholController { vo.setPeoples(JSON.parseArray(problem.getPeoples(), TaskProblemDto.People.class)); } if (StrUtil.isNotBlank(problem.getFiles())) { - vo.setFiles(JSON.parseArray(problem.getFiles(), FileVo.class)); + vo.setFileData(JSON.parseArray(problem.getFiles(), FileVo.class)); } } break; default: vo= distribute.getProblemVo(); + if (StrUtil.isNotBlank(distribute.getProblemVo().getFiles())) { + vo.setFileData(JSON.parseArray(distribute.getProblemVo().getFiles(), FileVo.class)); + } + break; } @@ -221,8 +234,8 @@ public class TestingAlcoholController { } //主办层级 dto.setHostLevel(Objects.equals(distribute.getDistributionFlow(), DistributionFlowEnum.SECOND.getValue()) ? HostLevelEnums.SECOND.getValue() : HostLevelEnums.THREE.getValue()); - if(CollectionUtil.isNotEmpty(vo.getFiles())){ - dto.setThingFiles(vo.getFiles()); + if(CollectionUtil.isNotEmpty(vo.getFileData())){ + dto.setThingFiles(vo.getFileData()); } diff --git a/src/main/java/com/biutag/supervision/pojo/param/TaskTestingTaskDistribute.java b/src/main/java/com/biutag/supervision/pojo/param/TaskTestingTaskDistribute.java index e896fc5..f72625e 100644 --- a/src/main/java/com/biutag/supervision/pojo/param/TaskTestingTaskDistribute.java +++ b/src/main/java/com/biutag/supervision/pojo/param/TaskTestingTaskDistribute.java @@ -70,5 +70,5 @@ public class TaskTestingTaskDistribute { - private List thingFiles = new ArrayList<>(); + private List thingFiles; } diff --git a/src/main/java/com/biutag/supervision/pojo/vo/TaskInspectionProblemVo.java b/src/main/java/com/biutag/supervision/pojo/vo/TaskInspectionProblemVo.java index 837e9e9..c4e4364 100644 --- a/src/main/java/com/biutag/supervision/pojo/vo/TaskInspectionProblemVo.java +++ b/src/main/java/com/biutag/supervision/pojo/vo/TaskInspectionProblemVo.java @@ -44,8 +44,9 @@ public class TaskInspectionProblemVo { @JsonFormat(pattern = "yyyy-MM-dd HH:mm") private LocalDateTime supTime; + private String files; // 附件 - private List files = new ArrayList<>(); + private List fileData = new ArrayList<>(); private List peoples = new ArrayList<>();