| | |
| | | inspectParams.add(params); |
| | | |
| | | }); |
| | | |
| | | CommonReponse reponse = new CommonReponse(); |
| | | if (!remotesInfoProperties.getHost().equals("http://127.0.0.1")){ |
| | | MultiValueMap<String, Object> params = new LinkedMultiValueMap<>(); |
| | | //获取上报质检接口 |
| | | String url = remotesInfoProperties.getBaseUrl() + apiInfo.getNotifyInspect(); |
| | |
| | | log.info("下发任务 返回结果:{}", exchange); |
| | | if (Objects.isNull(exchange.getBody()) || exchange.getBody() == null) { |
| | | throw new CoolException("下发任务失败!!"); |
| | | } |
| | | reponse = (CommonReponse) JSON.parse(exchange.getBody()); |
| | | } else { |
| | | CommonReponse reponse = (CommonReponse) JSON.parse(exchange.getBody()); |
| | | reponse.setCode(0); |
| | | } |
| | | |
| | | |
| | | if (reponse.getCode() == 0) { |
| | | //修改asn上报状态 |
| | | Set<String> itemSets = items.stream().map(PoItemsDto::getId).collect(Collectors.toSet()); |
| | |
| | | longSet.add(Long.parseLong(set)); |
| | | }); |
| | | |
| | | List<AsnOrderItem> asnOrderItems = asnOrderItemService.list(new LambdaQueryWrapper<AsnOrderItem>().in(AsnOrderItem::getPoDetlId, longSet)); |
| | | List<AsnOrderItem> asnOrderItems = asnOrderItemService.list(new LambdaQueryWrapper<AsnOrderItem>().in(AsnOrderItem::getNtyStatus, longSet)); |
| | | if (asnOrderItems.isEmpty()) { |
| | | throw new CoolException("ASN单据不存在!!"); |
| | | } |
| | |
| | | ids.forEach(id -> { |
| | | int count = asnOrderService.count(new LambdaQueryWrapper<AsnOrder>().in(AsnOrder::getId, id)); |
| | | if (count == asnIds.get(id).size()) { |
| | | if (!asnOrderService.update(new LambdaUpdateWrapper<AsnOrder>().eq(AsnOrder::getId, id).set(AsnOrder::getStatus, 1))) { |
| | | if (!asnOrderService.update(new LambdaUpdateWrapper<AsnOrder>().eq(AsnOrder::getId, id).set(AsnOrder::getNtyStatus, 1))) { |
| | | throw new CoolException("ASN主单状态修改失败!!"); |
| | | } |
| | | } else { |
| | | if (!asnOrderService.update(new LambdaUpdateWrapper<AsnOrder>().eq(AsnOrder::getId, id).set(AsnOrder::getStatus, 2))) { |
| | | if (!asnOrderService.update(new LambdaUpdateWrapper<AsnOrder>().eq(AsnOrder::getId, id).set(AsnOrder::getNtyStatus, 2))) { |
| | | throw new CoolException("ASN主单状态修改失败!!"); |
| | | } |
| | | } |
| | |
| | | return true; |
| | | } else { |
| | | throw new CoolException(reponse.getMsg()); |
| | | } |
| | | } |
| | | } |
| | | } |