| | |
| | | if(Objects.nonNull(args) && args.length>0) { |
| | | Long ifsInventoryId = (Long)args[0]; |
| | | IfsInventoryQuantity ifsInventoryQuantity = ifsInventoryQuantityMapper.selectById(ifsInventoryId); |
| | | //查询ifs批次属性记录,有则不执行操作 |
| | | //查询ifs批次属性记录,有则更新没有则新增 |
| | | Map<String, Object> queryMap = new HashMap<>(); |
| | | queryMap.put("LOT_BATCH_NO",ifsInventoryQuantity.getUpdateBatchNo()); |
| | | queryMap.put("PART_NO",ifsInventoryQuantity.getPartNo()); |
| | |
| | | JSONObject entries = JSONUtil.parseObj(queryPartLotResult.getData()); |
| | | JSONArray listInfo = entries.getJSONArray("LIST_INFO"); |
| | | //如果订单是KJNS域的外购订单,免检时同步ZTNS域的IFS批次属性 |
| | | if(StringUtils.equals(ContractType.KJNS.getValue(),ifsInventoryQuantity.getContract()) && StringUtils.equals(OrderType.WG.getValue(),ifsInventoryQuantity.getOrderType()) && listInfo.isEmpty()){ |
| | | if(StringUtils.equals(ContractType.KJNS.getValue(),ifsInventoryQuantity.getContract()) && StringUtils.equals(OrderType.WG.getValue(),ifsInventoryQuantity.getOrderType())){ |
| | | //查询ZTNS域的相同批次订单消息 |
| | | IfsInventoryQuantityDto ifsInventoryQuantityDto = new IfsInventoryQuantityDto(); |
| | | BeanUtil.copyProperties(ifsInventoryQuantity,ifsInventoryQuantityDto); |
| | |
| | | if(Objects.nonNull(oneByContract)){ |
| | | //更新IFS批次属性 |
| | | Map<String, Object> inAttrMap = new HashMap<>(); |
| | | String actionType = "New"; |
| | | String actionType = listInfo.isEmpty()?"New":"Modify"; |
| | | inAttrMap.put("RECORD_ID", UUID.randomUUID().toString()); |
| | | inAttrMap.put("SYSCODE", "LIMS"); |
| | | inAttrMap.put("SYSMODEL", "库存物料批次属性修改"); |
| | |
| | | if(result.getCode()!=200){ |
| | | throw new RuntimeException("库存物料批次属性更新失败:"+result.getMessage()); |
| | | } |
| | | log.info("KJNS域外购订单免检同步库存物料批次属性到IFS->{}", result); |
| | | } |
| | | oneByContract.setId(null); |
| | | oneByContract.setIfsInventoryId(ifsInventoryId); |
| | | ifsPartPropsRecordService.save(oneByContract); |
| | | } |
| | | } |