|
|
@ -202,6 +202,9 @@ public class PoServiceImpl extends ServiceImpl<PoMapper, PurchaseOrder> implemen |
|
|
huInfo.setPerQty(inData.getTransQty().setScale(2, RoundingMode.HALF_UP).doubleValue()); |
|
|
huInfo.setPerQty(inData.getTransQty().setScale(2, RoundingMode.HALF_UP).doubleValue()); |
|
|
huInfo.setPackageQty(1D); |
|
|
huInfo.setPackageQty(1D); |
|
|
inData.setHandlingUnitList(Collections.singletonList(huInfo)); |
|
|
inData.setHandlingUnitList(Collections.singletonList(huInfo)); |
|
|
|
|
|
inData.setNeedHandlingUnit("N"); |
|
|
|
|
|
} else { |
|
|
|
|
|
inData.setNeedHandlingUnit("Y"); |
|
|
} |
|
|
} |
|
|
// 创建Handling Unit相关数据 |
|
|
// 创建Handling Unit相关数据 |
|
|
for (int i = 0; i < inData.getHandlingUnitList().size(); i++) { |
|
|
for (int i = 0; i < inData.getHandlingUnitList().size(); i++) { |
|
|
@ -446,7 +449,7 @@ public class PoServiceImpl extends ServiceImpl<PoMapper, PurchaseOrder> implemen |
|
|
} else { |
|
|
} else { |
|
|
qtyToInspect = sp.compareTo(BigDecimal.ZERO)>0? |
|
|
qtyToInspect = sp.compareTo(BigDecimal.ZERO)>0? |
|
|
inData.getTransQty().multiply(new BigDecimal(inData.getSamplePercent())). |
|
|
inData.getTransQty().multiply(new BigDecimal(inData.getSamplePercent())). |
|
|
divide(BigDecimal.valueOf(100), 0, RoundingMode.HALF_UP): |
|
|
|
|
|
|
|
|
divide(BigDecimal.valueOf(100), 2, RoundingMode.HALF_UP): |
|
|
new BigDecimal(inData.getSampleQty()); |
|
|
new BigDecimal(inData.getSampleQty()); |
|
|
} |
|
|
} |
|
|
Map<String, Object> params = Map.ofEntries( |
|
|
Map<String, Object> params = Map.ofEntries( |
|
|
@ -460,13 +463,20 @@ public class PoServiceImpl extends ServiceImpl<PoMapper, PurchaseOrder> implemen |
|
|
Map.entry("qytToReceive", inData.getTransQty()), |
|
|
Map.entry("qytToReceive", inData.getTransQty()), |
|
|
Map.entry("locationNo", inData.getLocationNo()), |
|
|
Map.entry("locationNo", inData.getLocationNo()), |
|
|
// 这两个日期待定 |
|
|
// 这两个日期待定 |
|
|
Map.entry("deliveryDate", DateUtils.format(inData.getArrivalDate(), DateUtils.DATE_PATTERN)), |
|
|
|
|
|
Map.entry("arrivalDate", DateUtils.format(inData.getArrivalDate(), DateUtils.DATE_TIME_PATTERN)), |
|
|
|
|
|
Map.entry("receiptReference", inData.getSupplierBatchNo()), |
|
|
|
|
|
|
|
|
Map.entry("deliveryDate", inData.getManufactureDate()!=null? |
|
|
|
|
|
DateUtils.format(inData.getManufactureDate(), DateUtils.DATE_PATTERN): |
|
|
|
|
|
(inData.getArrivalDate()!=null?DateUtils.format(inData.getArrivalDate(), DateUtils.DATE_PATTERN): |
|
|
|
|
|
DateUtils.format(new Date(), DateUtils.DATE_PATTERN))), |
|
|
|
|
|
Map.entry("arrivalDate", inData.getArrivalDate()!=null? |
|
|
|
|
|
DateUtils.format(inData.getArrivalDate(), DateUtils.DATE_TIME_PATTERN) |
|
|
|
|
|
:DateUtils.format(new Date(), DateUtils.DATE_TIME_PATTERN)), |
|
|
|
|
|
Map.entry("receiptReference", StringUtils.isNotBlank(inData.getSupplierBatchNo())? |
|
|
|
|
|
inData.getSupplierBatchNo():"1"), |
|
|
Map.entry("lotBatchNo", inData.getBatchNo()), |
|
|
Map.entry("lotBatchNo", inData.getBatchNo()), |
|
|
Map.entry("wdrNo", inData.getWdr() != null ? inData.getWdr() : "*"), |
|
|
Map.entry("wdrNo", inData.getWdr() != null ? inData.getWdr() : "*"), |
|
|
Map.entry("qtyToInspect",qtyToInspect) |
|
|
Map.entry("qtyToInspect",qtyToInspect) |
|
|
); |
|
|
); |
|
|
|
|
|
log.info("同步接收记录到IFS,params: {}", params); |
|
|
ObjectMapper objectMapper = new ObjectMapper(); |
|
|
ObjectMapper objectMapper = new ObjectMapper(); |
|
|
String jsonBody = objectMapper.writeValueAsString(params); |
|
|
String jsonBody = objectMapper.writeValueAsString(params); |
|
|
String ifsResponse = HttpUtils.doPost(ifsUrl+"registerArrival",jsonBody,null); |
|
|
String ifsResponse = HttpUtils.doPost(ifsUrl+"registerArrival",jsonBody,null); |
|
|
|