定时任务信息编号修改

main
dongdingding 8 months ago
parent 29bb9e8167
commit 186b6eb96e

@ -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<ASafeBqbhpx> aSafeBqbhpxes = new ArrayList<>();
List<ASafeBqbhpxRequest> 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<ASafeQyzypgl> aSafeQyzypgls = new ArrayList<>();
List<ASafeQyzypglRequest> 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);
}

Loading…
Cancel
Save