From 186b6eb96eefa2b4f3e0bc4b9a78a9eacec3cb8e Mon Sep 17 00:00:00 2001 From: dongdingding <207595406@qq.com> Date: Thu, 11 Jul 2024 11:25:08 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9A=E6=97=B6=E4=BB=BB=E5=8A=A1=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E7=BC=96=E5=8F=B7=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/mudu/quartz/BqbhTszyQuartz.java | 26 ++++++++++++++----- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/mudu/quartz/BqbhTszyQuartz.java b/src/main/java/com/mudu/quartz/BqbhTszyQuartz.java index 27924df..33a7e7c 100644 --- a/src/main/java/com/mudu/quartz/BqbhTszyQuartz.java +++ b/src/main/java/com/mudu/quartz/BqbhTszyQuartz.java @@ -8,11 +8,13 @@ import com.alibaba.fastjson2.JSON; import com.alibaba.fastjson2.JSONArray; import com.alibaba.fastjson2.JSONObject; import com.mudu.entity.ASafeBqbhpx; +import com.mudu.entity.ASafeQyjcxx; import com.mudu.entity.ASafeQyzypgl; import com.mudu.entity.dto.request.ASafeBqbhpxRequest; import com.mudu.entity.dto.request.ASafeQyzypglRequest; import com.mudu.entity.dto.response.XcTpResponse; import com.mudu.service.ASafeBqbhpxService; +import com.mudu.service.ASafeQyjcxxService; import com.mudu.service.ASafeQyzypglService; import com.mudu.service.impl.LoginService; import org.springframework.beans.factory.annotation.Value; @@ -46,7 +48,8 @@ public class BqbhTszyQuartz { private ASafeQyzypglService safeQyzypglService; @Resource - private LoginService loginService; + private ASafeQyjcxxService aSafeQyjcxxService; + @Value("${bqbhUrl}") private String bqbhUrl; @@ -81,9 +84,13 @@ public class BqbhTszyQuartz { } List aSafeBqbhpxes = new ArrayList<>(); List list = JSON.parseArray(dataList, ASafeBqbhpxRequest.class); - list.forEach(x -> { + for (ASafeBqbhpxRequest x : list) { ASafeBqbhpx aSafeBqbhpx = BeanUtil.copyProperties(x, ASafeBqbhpx.class); XcTpResponse xcTpResponse = new XcTpResponse(); + ASafeQyjcxx aSafeQyjcxx = aSafeQyjcxxService.findOneByqymcOrXybm(null, x.getQyxxbh()); + if (aSafeQyjcxx==null){ + continue; + } if (StrUtil.isNotEmpty(aSafeBqbhpx.getPxxctp())) { xcTpResponse.setFJDZ(api + aSafeBqbhpx.getPxxctp()); xcTpResponse.setFJHZ(aSafeBqbhpx.getPxxctp().substring(aSafeBqbhpx.getPxxctp().lastIndexOf(".") + 1)); @@ -93,9 +100,9 @@ public class BqbhTszyQuartz { JSONArray jsonArray = new JSONArray(xcTpResponse); aSafeBqbhpx.setPxxctp(String.valueOf(jsonArray)); } - aSafeBqbhpx.setQybh(x.getQyxxbh()); + aSafeBqbhpx.setQybh(aSafeQyjcxx.getXxbh()); aSafeBqbhpxes.add(aSafeBqbhpx); - }); + } if (CollectionUtil.isNotEmpty(aSafeBqbhpxes)) { safeBqbhpxService.saveBatch(aSafeBqbhpxes); } @@ -120,11 +127,16 @@ public class BqbhTszyQuartz { } List aSafeQyzypgls = new ArrayList<>(); List list = JSON.parseArray(dataList, ASafeQyzypglRequest.class); - list.forEach(x -> { + for (ASafeQyzypglRequest x : list) { + + ASafeQyjcxx aSafeQyjcxx = aSafeQyjcxxService.findOneByqymcOrXybm(null, x.getQyxxbh()); + if (aSafeQyjcxx==null){ + continue; + } ASafeQyzypgl aSafeQyzypgl = BeanUtil.copyProperties(x, ASafeQyzypgl.class); - aSafeQyzypgl.setQybh(x.getQyxxbh()); + aSafeQyzypgl.setQybh(aSafeQyjcxx.getXxbh()); aSafeQyzypgls.add(aSafeQyzypgl); - }); + } if (CollectionUtil.isNotEmpty(aSafeQyzypgls)) { safeQyzypglService.saveBatch(aSafeQyzypgls); }