|
|
|
@ -306,12 +306,59 @@ public class WmsProductPutServiceImpl implements IWmsProductPutService {
|
|
|
|
|
Date date = new Date();
|
|
|
|
|
String formattedDate = dateFormat.format(date);//批次
|
|
|
|
|
//List<WmsProductPut> wmsProductPutList= new ArrayList<>();
|
|
|
|
|
List<wmsReportWork> wmsReportWorkList=new ArrayList<>();
|
|
|
|
|
List<wmsReportWork> wmsReportWorkListRk=new ArrayList<>();
|
|
|
|
|
List<wmsReportWork> wmsReportWorkListagain=new ArrayList<>();
|
|
|
|
|
for (wmsReportWork mesReportWork:
|
|
|
|
|
mesReportWorks) {
|
|
|
|
|
WmsProductPut wmsProductPutk=new WmsProductPut();
|
|
|
|
|
wmsProductPutk.setWorkOrder(mesReportWork.getReportCode());
|
|
|
|
|
wmsProductPutk.setFactoryCode(mesReportWork.getFactoryCode());
|
|
|
|
|
wmsProductPutk.setWhCode(mesReportWork.getWhCode());//仓库编码
|
|
|
|
|
wmsProductPutk.setProductName(mesReportWork.getProductName());
|
|
|
|
|
wmsProductPutk.setProductCode(mesReportWork.getProductCode());
|
|
|
|
|
wmsProductPutk.setProductOrder(mesReportWork.getWorkorderCodeSap());
|
|
|
|
|
wmsProductPutk.setPlanQuantity(mesReportWork.getQuantityFeedback());
|
|
|
|
|
wmsProductPutk.setPutQuantity(mesReportWork.getQuantityQualified());
|
|
|
|
|
wmsProductPutk.setStatus("1");
|
|
|
|
|
wmsProductPutk.setUnitOfMeasure(mesReportWork.getUnit());
|
|
|
|
|
wmsProductPutk.setBatchNumber(mesReportWork.getBatch());//
|
|
|
|
|
//wmsProductPutk.setSapStatus("2");
|
|
|
|
|
List<WmsProductPut> wmsProductPutList= wmsProductPutMapper.selectWmsProductPutList(wmsProductPutk);
|
|
|
|
|
if (wmsProductPutList.size()>0){
|
|
|
|
|
String id= wmsProductPutList.get(0).getId();
|
|
|
|
|
mesReportWork.setId(id);
|
|
|
|
|
wmsReportWorkList.add(mesReportWork);
|
|
|
|
|
}else {
|
|
|
|
|
wmsReportWorkListRk.add(mesReportWork);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
for (wmsReportWork mesReportWork:
|
|
|
|
|
wmsReportWorkList) {
|
|
|
|
|
WmsProductPut wmsProductPutk=new WmsProductPut();
|
|
|
|
|
wmsProductPutk.setWorkOrder(mesReportWork.getReportCode());
|
|
|
|
|
wmsProductPutk.setFactoryCode(mesReportWork.getFactoryCode());
|
|
|
|
|
wmsProductPutk.setWhCode(mesReportWork.getWhCode());//仓库编码
|
|
|
|
|
wmsProductPutk.setProductName(mesReportWork.getProductName());
|
|
|
|
|
wmsProductPutk.setProductCode(mesReportWork.getProductCode());
|
|
|
|
|
wmsProductPutk.setProductOrder(mesReportWork.getWorkorderCodeSap());
|
|
|
|
|
wmsProductPutk.setPlanQuantity(mesReportWork.getQuantityFeedback());
|
|
|
|
|
wmsProductPutk.setPutQuantity(mesReportWork.getQuantityQualified());
|
|
|
|
|
wmsProductPutk.setStatus("1");
|
|
|
|
|
wmsProductPutk.setUnitOfMeasure(mesReportWork.getUnit());
|
|
|
|
|
wmsProductPutk.setBatchNumber(mesReportWork.getBatch());//
|
|
|
|
|
wmsProductPutk.setSapStatus("2");
|
|
|
|
|
List<WmsProductPut> wmsProductPutList= wmsProductPutMapper.selectWmsProductPutList(wmsProductPutk);
|
|
|
|
|
if (wmsProductPutList.size()>0){
|
|
|
|
|
wmsReportWorkListagain.add(mesReportWork);//再次过账
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
for (wmsReportWork mesReportWork:
|
|
|
|
|
wmsReportWorkListRk) {
|
|
|
|
|
WmsProductPut wmsProductPutk=new WmsProductPut();
|
|
|
|
|
//wms_product_put
|
|
|
|
|
mesReportWork.setId(IdUtils.fastSimpleUUID());
|
|
|
|
|
wmsProductPutk.setId(mesReportWork.getId());
|
|
|
|
|
|
|
|
|
|
wmsProductPutk.setWorkOrder(mesReportWork.getReportCode());
|
|
|
|
|
wmsProductPutk.setFactoryCode(mesReportWork.getFactoryCode());
|
|
|
|
|
wmsProductPutk.setWhCode(mesReportWork.getWhCode());//仓库编码
|
|
|
|
@ -321,13 +368,17 @@ public class WmsProductPutServiceImpl implements IWmsProductPutService {
|
|
|
|
|
wmsProductPutk.setPlanQuantity(mesReportWork.getQuantityFeedback());
|
|
|
|
|
wmsProductPutk.setPutQuantity(mesReportWork.getQuantityQualified());
|
|
|
|
|
wmsProductPutk.setStatus("1");
|
|
|
|
|
wmsProductPutk.setSapStatus("0");
|
|
|
|
|
wmsProductPutk.setUnitOfMeasure(mesReportWork.getUnit());
|
|
|
|
|
wmsProductPutk.setBatchNumber(mesReportWork.getBatch());//
|
|
|
|
|
//List<WmsProductPut> wmsProductPutList= wmsProductPutMapper.selectWmsProductPutList(wmsProductPutk);
|
|
|
|
|
|
|
|
|
|
wmsProductPutk.setAttr3(formattedDate);//
|
|
|
|
|
wmsProductPutk.setCreateBy(mesReportWork.getCreateBy());
|
|
|
|
|
wmsProductPutk.setCreateTime(new Date());
|
|
|
|
|
wmsProductPutk.setUnitOfMeasure(mesReportWork.getUnit());
|
|
|
|
|
|
|
|
|
|
wmsProductPutk.setProductDate(mesReportWork.getProductDate());
|
|
|
|
|
wmsProductPutk.setId(mesReportWork.getId());
|
|
|
|
|
wmsProductPutk.setSapStatus("0");
|
|
|
|
|
wmsProductPutMapper.insertWmsProductPut(wmsProductPutk);
|
|
|
|
|
//入库记录
|
|
|
|
|
WmsProductPutRecords wmsProductPutRecords=new WmsProductPutRecords();
|
|
|
|
@ -368,9 +419,10 @@ public class WmsProductPutServiceImpl implements IWmsProductPutService {
|
|
|
|
|
wmsFpStorageNewsMapper.insertWmsFpStorageNews(wmsFpStorageNews);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if(wmsReportWorkListRk.size()>0){
|
|
|
|
|
List<Map<String, Object>> mapList = new ArrayList<>();
|
|
|
|
|
for (wmsReportWork mesReportWork:
|
|
|
|
|
mesReportWorks) {
|
|
|
|
|
wmsReportWorkListRk) {
|
|
|
|
|
Map<String, Object> map = new HashMap<>();
|
|
|
|
|
map.put("AUFNR",mesReportWork.getWorkorderCodeSap());
|
|
|
|
|
map.put("WERKS",mesReportWork.getFactoryCode());
|
|
|
|
@ -386,7 +438,40 @@ public class WmsProductPutServiceImpl implements IWmsProductPutService {
|
|
|
|
|
int code= result.getCode();
|
|
|
|
|
String msg= result.getMsg();
|
|
|
|
|
for (wmsReportWork mesReportWork:
|
|
|
|
|
mesReportWorks) {
|
|
|
|
|
wmsReportWorkListRk) {
|
|
|
|
|
WmsProductPut wmsProductPut2=new WmsProductPut();
|
|
|
|
|
wmsProductPut2.setId(mesReportWork.getId());
|
|
|
|
|
wmsProductPut2.setSapMessage(msg);
|
|
|
|
|
if (code==200) {//过账成功
|
|
|
|
|
String tem= (String) result.getData();
|
|
|
|
|
wmsProductPut2.setSapProof(tem);
|
|
|
|
|
wmsProductPut2.setSapStatus("1");
|
|
|
|
|
}else {
|
|
|
|
|
wmsProductPut2.setSapStatus("2");
|
|
|
|
|
}
|
|
|
|
|
wmsProductPutMapper.updateWmsProductPut(wmsProductPut2);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (wmsReportWorkListagain.size()>0){
|
|
|
|
|
List<Map<String, Object>> mapList = new ArrayList<>();
|
|
|
|
|
for (wmsReportWork mesReportWork:
|
|
|
|
|
wmsReportWorkListagain) {
|
|
|
|
|
Map<String, Object> map = new HashMap<>();
|
|
|
|
|
map.put("AUFNR",mesReportWork.getWorkorderCodeSap());
|
|
|
|
|
map.put("WERKS",mesReportWork.getFactoryCode());
|
|
|
|
|
map.put("LGORT",mesReportWork.getWhCode());
|
|
|
|
|
map.put("QUANTITY",mesReportWork.getQuantityQualified());
|
|
|
|
|
map.put("ERFME",mesReportWork.getUnit());
|
|
|
|
|
map.put("BATCH",mesReportWork.getBatch());
|
|
|
|
|
map.put("HSDAT",mesReportWork.getProductDate());
|
|
|
|
|
mapList.add(map);
|
|
|
|
|
}
|
|
|
|
|
//过账
|
|
|
|
|
R result=remoteSapService.sapOrderReceipt(mapList);
|
|
|
|
|
int code= result.getCode();
|
|
|
|
|
String msg= result.getMsg();
|
|
|
|
|
for (wmsReportWork mesReportWork:
|
|
|
|
|
wmsReportWorkListagain) {
|
|
|
|
|
WmsProductPut wmsProductPut2=new WmsProductPut();
|
|
|
|
|
wmsProductPut2.setId(mesReportWork.getId());
|
|
|
|
|
wmsProductPut2.setSapMessage(msg);
|
|
|
|
@ -399,6 +484,7 @@ public class WmsProductPutServiceImpl implements IWmsProductPutService {
|
|
|
|
|
}
|
|
|
|
|
wmsProductPutMapper.updateWmsProductPut(wmsProductPut2);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
String SUCCESS="操作完成";
|
|
|
|
|
return SUCCESS;
|
|
|
|
|
}
|
|
|
|
|