|
|
|
@ -286,7 +286,14 @@ public class WmsProductPutServiceImpl implements IWmsProductPutService {
|
|
|
|
|
map.put("LGORT", wmsProductPut3.getWhCode());
|
|
|
|
|
map.put("QUANTITY", wmsProductPut3.getPutQuantity());
|
|
|
|
|
map.put("ERFME", wmsProductPut3.getUnitOfMeasure());
|
|
|
|
|
map.put("BATCH", wmsProductPut3.getBatchNumber());
|
|
|
|
|
//map.put("BATCH", wmsProductPut3.getBatchNumber());
|
|
|
|
|
if (wmsProductPut3.getBatchNumber().length()>12){
|
|
|
|
|
//String batch = mesReportWork.getBatch().substring(12);
|
|
|
|
|
String batch = InterceptionRules(wmsProductPut3.getBatchNumber());
|
|
|
|
|
map.put("BATCH", batch);
|
|
|
|
|
}else {
|
|
|
|
|
map.put("BATCH", wmsProductPut3.getBatchNumber());
|
|
|
|
|
}
|
|
|
|
|
map.put("HSDAT", wmsProductPut3.getProductDate());
|
|
|
|
|
mapList.add(map);
|
|
|
|
|
}
|
|
|
|
@ -1139,6 +1146,67 @@ public class WmsProductPutServiceImpl implements IWmsProductPutService {
|
|
|
|
|
return wmsRuturnPutEmbryoMapper.selectWmsRuturnPutEmbryoList(wmsRuturnPutEmbryo);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public String finishedProductSalesReturnTD(WmsRuturnPutEmbryo wmsRuturnPutEmbryo) {
|
|
|
|
|
String results="提单成功";//退货单
|
|
|
|
|
DynamicDataSourceContextHolder.push("ds_" + wmsRuturnPutEmbryo.getFactoryCode());
|
|
|
|
|
Map<String, Object> objectMap=new HashMap<>();
|
|
|
|
|
objectMap.put("S_MATNR",wmsRuturnPutEmbryo.getProductCode());//物料号,
|
|
|
|
|
objectMap.put("S_TDDAT",wmsRuturnPutEmbryo.getAttr1());//String 计划运输日期
|
|
|
|
|
objectMap.put("S_VBELN",wmsRuturnPutEmbryo.getProductOrder());//成品销售退货单
|
|
|
|
|
objectMap.put("S_AUART","ZRE");//销售退货凭证
|
|
|
|
|
R result = remoteSapService.FPinventory(objectMap);
|
|
|
|
|
int code = result.getCode();
|
|
|
|
|
String msg = result.getMsg();
|
|
|
|
|
if(code==200){
|
|
|
|
|
List<Map<String,String>> mapList= (List<Map<String, String>>) result.getData();
|
|
|
|
|
for ( Map<String,String> stringStringMap: mapList){
|
|
|
|
|
String MAKTX=stringStringMap.get("MAKTX");//物料描述
|
|
|
|
|
String MATNR=stringStringMap.get("MATNR");//物料号
|
|
|
|
|
String KUNNR=stringStringMap.get("KUNNR");//送达方
|
|
|
|
|
String VBELN=stringStringMap.get("VBELN");//交货单---一销售单对多交货单
|
|
|
|
|
String VBELN_VA=stringStringMap.get("VBELN_VA");//销售单
|
|
|
|
|
String MENGE=stringStringMap.get("MENGE");//数量
|
|
|
|
|
String MEINS=stringStringMap.get("MEINS");//单位
|
|
|
|
|
String TDDAT=stringStringMap.get("TDDAT");//计划日期
|
|
|
|
|
String KUNNR_NM=stringStringMap.get("KUNNR_NM");//送达方描述
|
|
|
|
|
String LIFNR=stringStringMap.get("LIFNR");//货运代理
|
|
|
|
|
String LIFNR_NM=stringStringMap.get("LIFNR_NM");//货运代理描述
|
|
|
|
|
String ZSAREA=stringStringMap.get("ZSAREA");//销售大区
|
|
|
|
|
String BZTXT1=stringStringMap.get("BZTXT1");//销售大区描述
|
|
|
|
|
WmsSellOutEmbryo wmsSellOutEmbryo1=new WmsSellOutEmbryo();
|
|
|
|
|
wmsSellOutEmbryo1.setId(IdUtils.fastSimpleUUID());
|
|
|
|
|
wmsSellOutEmbryo1.setDeliveryOrder(VBELN);//交货单号
|
|
|
|
|
wmsSellOutEmbryo1.setAttr1(VBELN_VA);
|
|
|
|
|
wmsSellOutEmbryo1.setProductCode(MATNR);
|
|
|
|
|
wmsSellOutEmbryo1.setProductName(MAKTX);
|
|
|
|
|
wmsSellOutEmbryo1.setFactoryCode(wmsRuturnPutEmbryo.getFactoryCode());
|
|
|
|
|
wmsSellOutEmbryo1.setOutQuantity(new BigDecimal("0"));
|
|
|
|
|
wmsSellOutEmbryo1.setAttr2(KUNNR);
|
|
|
|
|
wmsSellOutEmbryo1.setAttr3(KUNNR_NM);
|
|
|
|
|
wmsSellOutEmbryo1.setAttr4(LIFNR);
|
|
|
|
|
wmsSellOutEmbryo1.setAttr5(LIFNR_NM);
|
|
|
|
|
wmsSellOutEmbryo1.setAttr6(ZSAREA);
|
|
|
|
|
wmsSellOutEmbryo1.setAttr7(BZTXT1);
|
|
|
|
|
wmsSellOutEmbryo1.setAttr8(TDDAT);
|
|
|
|
|
wmsSellOutEmbryo1.setPlanQuantity(new BigDecimal(MENGE));
|
|
|
|
|
wmsSellOutEmbryo1.setUnitOfMeasure(MEINS);
|
|
|
|
|
wmsSellOutEmbryo1.setStatus("0");
|
|
|
|
|
wmsSellOutEmbryo1.setSapStatus("0");
|
|
|
|
|
wmsSellOutEmbryo1.setActiveFlag("1");
|
|
|
|
|
wmsSellOutEmbryo1.setCreateBy(wmsRuturnPutEmbryo.getCreateBy());
|
|
|
|
|
wmsSellOutEmbryo1.setCreateTime(new Date());
|
|
|
|
|
//判断有没有这个单子,。如果有的话,就跳过吧
|
|
|
|
|
WmsSellOutEmbryo wmsSellOutEmbryo2= wmsSellOutEmbryoMapper.selectWmsSellOutEmbryoByOrderCodeAndProductCode(VBELN,MATNR);
|
|
|
|
|
// if (wmsSellOutEmbryo2==null){
|
|
|
|
|
// wmsSellOutEmbryoMapper.insertWmsSellOutEmbryo(wmsSellOutEmbryo1);
|
|
|
|
|
// }else {
|
|
|
|
|
// results="已经存在";
|
|
|
|
|
// }
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return results;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//去除空格,截取规则,例子:20270106LJ20240107CBCD0J——》240107CBCD
|
|
|
|
|