From d522c72631dc8bd63e564b7740922f6a3a69cde7 Mon Sep 17 00:00:00 2001 From: ty <1577900710@qq.com> Date: Fri, 8 Mar 2024 15:44:08 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E9=9A=90=E6=82=A3=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E8=BF=81=E7=A7=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../safeproduct/feign/SafeInnerDangerClient.java | 25 ++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/feign/SafeInnerDangerClient.java diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/feign/SafeInnerDangerClient.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/feign/SafeInnerDangerClient.java new file mode 100644 index 0000000..7d4edb1 --- /dev/null +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/feign/SafeInnerDangerClient.java @@ -0,0 +1,25 @@ +package com.hnac.hzims.safeproduct.feign; + + +import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse; +import com.hnac.hzims.safeproduct.flow.service.IInnerDangerFlowService; +import lombok.AllArgsConstructor; +import org.springblade.core.tool.api.R; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RestController; + + +@RestController +@AllArgsConstructor +public class SafeInnerDangerClient implements ISafeInnerDangerClient { + + private IInnerDangerFlowService service; + + + @PostMapping(SAVE_HIDDENDANGER) + @Override + public R saveDefect(@RequestBody ProcessWorkFlowResponse processWorkFlowResponse) { + return service.listenAndUpdateDefect(processWorkFlowResponse); + } +} From 21b049de0532b0a4e42b949c39bc539f2b7b2dd5 Mon Sep 17 00:00:00 2001 From: yang_shj <1069818635@QQ.com> Date: Fri, 8 Mar 2024 15:59:12 +0800 Subject: [PATCH 2/2] =?UTF-8?q?#=E6=BC=94=E7=BB=83=E8=AE=B0=E5=BD=95?= =?UTF-8?q?=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/TrainRecordServiceImpl.java | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TrainRecordServiceImpl.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TrainRecordServiceImpl.java index a5dbbc8..c51b5b2 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TrainRecordServiceImpl.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TrainRecordServiceImpl.java @@ -28,10 +28,7 @@ import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; import javax.servlet.http.HttpServletResponse; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; -import java.util.Map; +import java.util.*; import java.util.stream.Collectors; /** @@ -141,7 +138,7 @@ public class TrainRecordServiceImpl extends ServiceImpl list = new ArrayList<>(); if (StringUtils.isNotEmpty(trainRecordDetailVO.getImgPath())) { - String[] imgArr = trainRecordDetailVO.getImgPath().split(","); - for (String img : imgArr) { - ImageEntity imageEntity = new ImageEntity(BaseUtil.imgToByte(savePath + - BaseUtil.downloadFileByUrl(img, savePath)), 180, 150); - list.add(imageEntity); - } + trainRecordDetailVO.setImages(Arrays.stream(trainRecordDetailVO.getImgPath().split(",")).map(img-> + new ImageEntity(BaseUtil.imgToByte(savePath + BaseUtil.downloadFileByUrl(img, savePath)), 180, 150) + ).collect(Collectors.toList())); } else { // 添加空的ImageEntity,防止数据填入时显示"{{" - list.add(new ImageEntity()); + trainRecordDetailVO.setImages(Collections.singletonList(new ImageEntity())); } - trainRecordDetailVO.setImages(list); // 表头年月 String code = trainRecordDetailVO.getCode(); trainRecordDetailVO.setYear(code.substring(4, 8));