| | |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * Created by Monkey D. Luffy on 2025.11.10 |
| | |
| | | |
| | | } |
| | | } |
| | | OrderInspectionRollParam orderInspectionRollParam = new OrderInspectionRollParam(orderDetl.getModel()); |
| | | // OrderInspectionRollParam orderInspectionRollParam = new OrderInspectionRollParam(orderDetl.getModel()); |
| | | String response = ""; |
| | | boolean success = false; |
| | | Map<String, Object> params = JSON.parseObject(JSON.toJSONString(orderInspectionRollParam), Map.class); |
| | | // Map<String, Object> params = JSON.parseObject(JSON.toJSONString(orderInspectionRollParam), Map.class); |
| | | |
| | | Map<String, Object> params = new HashMap<>(); |
| | | params.put("batchNo", orderDetl.getModel()); |
| | | try { |
| | | response = new HttpHandler.Builder() |
| | | .setUri(qualityFinishedCheckoutUrl) |
| | |
| | | .build() |
| | | .doPost(); |
| | | JSONObject jsonObject = JSON.parseObject(response); |
| | | if (jsonObject.getInteger("code").equals(200)) { |
| | | if (jsonObject.getBoolean("state")) { |
| | | String value = jsonObject.getString("value"); |
| | | if (value.equals("合格")){ |
| | | orderDetl.setDanger(1); |
| | | orderDetlPakoutService.updateById(orderDetl); |
| | | } else if (!Cools.isEmpty(orderDetl.getDanger$()) && value.equals(orderDetl.getDanger$())){ |
| | | if (Cools.isEmpty(memo)){ |
| | | memo = "卷号"+ orderDetl.getModel()+"查询结果:"+jsonObject.getString("message"); |
| | | }else { |
| | | memo = memo+";卷号"+ orderDetl.getModel()+"查询结果:"+jsonObject.getString("message"); |
| | | } |
| | | continue; |
| | | } else { |
| | | if (Cools.isEmpty(memo)){ |
| | | memo = "卷号"+ orderDetl.getModel()+"查询结果:"+jsonObject.getString("message"); |
| | | }else { |
| | | memo = memo+";卷号"+ orderDetl.getModel()+"查询结果:"+jsonObject.getString("message"); |
| | | } |
| | | if (value.equals("不合格")){ |
| | | orderDetl.setDanger(2); |
| | | orderDetlPakoutService.updateById(orderDetl); |
| | | } |
| | | continue; |
| | | if (jsonObject.getBoolean("state")) { |
| | | String value = jsonObject.getString("value"); |
| | | if (value.equals("合格")){ |
| | | orderDetl.setDanger(1); |
| | | orderDetlPakoutService.updateById(orderDetl); |
| | | } else if (!Cools.isEmpty(orderDetl.getDanger$()) && value.equals(orderDetl.getDanger$())){ |
| | | if (Cools.isEmpty(memo)){ |
| | | memo = "卷号"+ orderDetl.getModel()+"查询结果:"+jsonObject.getString("message"); |
| | | }else { |
| | | memo = memo+";卷号"+ orderDetl.getModel()+"查询结果:"+jsonObject.getString("message"); |
| | | } |
| | | continue; |
| | | } else { |
| | | if (Cools.isEmpty(memo)){ |
| | | memo = "卷号"+ orderDetl.getModel()+"查询结果:"+jsonObject.getString("message"); |
| | | }else { |
| | | memo = memo+";卷号"+ orderDetl.getModel()+"查询结果:"+jsonObject.getString("message"); |
| | | } |
| | | if (value.equals("不合格")){ |
| | | orderDetl.setDanger(2); |
| | | orderDetlPakoutService.updateById(orderDetl); |
| | | } |
| | | continue; |
| | | } |
| | | success = true; |
| | | } else { |
| | |
| | | }else { |
| | | memo = memo+";卷号"+ orderDetl.getModel()+"查询结果:"+jsonObject.getString("message"); |
| | | } |
| | | log.error("请求接口失败!!!url:{};request:{};response:{}", qualityFinishedCheckoutUrl+"/"+qualityFinishedCheckout, JSON.toJSONString(orderInspectionRollParam), response); |
| | | log.error("请求接口失败!!!url:{};request:{};response:{}", qualityFinishedCheckoutUrl+"/"+qualityFinishedCheckout, JSON.toJSONString(params), response); |
| | | // throw new CoolException("查询卷号是否合格失败"); |
| | | } |
| | | } catch (Exception e) { |
| | |
| | | qualityFinishedCheckoutUrl+"/"+qualityFinishedCheckout, |
| | | null, |
| | | "127.0.0.1", |
| | | JSON.toJSONString(orderInspectionRollParam), |
| | | JSON.toJSONString(params), |
| | | response, |
| | | success |
| | | ); |