|
|
|
@ -340,6 +340,7 @@ public class WmsProductPutServiceImpl implements IWmsProductPutService {
|
|
|
|
|
String formattedDate = dateFormat.format(date);//批次
|
|
|
|
|
//List<WmsProductPut> wmsProductPutList= new ArrayList<>();
|
|
|
|
|
List<wmsReportWork> wmsReportWorkList = new ArrayList<>();
|
|
|
|
|
List<wmsReportWork> wmsReportWorkListTWO = new ArrayList<>();
|
|
|
|
|
List<wmsReportWork> wmsReportWorkListRk = new ArrayList<>();
|
|
|
|
|
List<wmsReportWork> wmsReportWorkListagain = new ArrayList<>();
|
|
|
|
|
//获取当前所选工厂
|
|
|
|
@ -362,12 +363,12 @@ public class WmsProductPutServiceImpl implements IWmsProductPutService {
|
|
|
|
|
wmsProductPutk.setStatus("1");
|
|
|
|
|
wmsProductPutk.setUnitOfMeasure(mesReportWork.getUnit());
|
|
|
|
|
wmsProductPutk.setBatchNumber(mesReportWork.getBatch());//
|
|
|
|
|
wmsProductPutk.setSapStatus("2");//过账失败的
|
|
|
|
|
// 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);//已经插入过并且过账失败的
|
|
|
|
|
wmsReportWorkList.add(mesReportWork);//已经插入
|
|
|
|
|
} else {
|
|
|
|
|
wmsReportWorkListRk.add(mesReportWork);//第一次的
|
|
|
|
|
}
|
|
|
|
@ -388,10 +389,32 @@ public class WmsProductPutServiceImpl implements IWmsProductPutService {
|
|
|
|
|
// wmsProductPutk.setBatchNumber(mesReportWork.getBatch());//
|
|
|
|
|
// wmsProductPutk.setSapStatus("2");
|
|
|
|
|
// List<WmsProductPut> wmsProductPutList = wmsProductPutMapper.selectWmsProductPutList(wmsProductPutk);
|
|
|
|
|
// if (wmsProductPutList.size() > 0) {
|
|
|
|
|
// if (wmsProductPutList.size() > 0) {//已经插入
|
|
|
|
|
wmsReportWorkListagain.add(mesReportWork);//
|
|
|
|
|
// }
|
|
|
|
|
}
|
|
|
|
|
for (wmsReportWork mesReportWork :
|
|
|
|
|
wmsReportWorkList) {
|
|
|
|
|
WmsProductPut wmsProductPutk = new WmsProductPut();
|
|
|
|
|
wmsProductPutk.setWorkOrder(mesReportWork.getReportCode());
|
|
|
|
|
wmsProductPutk.setFactoryCode(factoryCode);
|
|
|
|
|
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) {//已经插入且失败的
|
|
|
|
|
wmsReportWorkListTWO.add(mesReportWork);//
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//先屏蔽起来
|
|
|
|
|
for (wmsReportWork mesReportWork :
|
|
|
|
|
wmsReportWorkListRk) {
|
|
|
|
@ -494,10 +517,10 @@ public class WmsProductPutServiceImpl implements IWmsProductPutService {
|
|
|
|
|
wmsProductPutMapper.updateWmsProductPut(wmsProductPut2);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (wmsReportWorkList.size() > 0) {
|
|
|
|
|
if (wmsReportWorkListTWO.size() > 0) {
|
|
|
|
|
List<Map<String, Object>> mapList = new ArrayList<>();
|
|
|
|
|
for (wmsReportWork mesReportWork :
|
|
|
|
|
wmsReportWorkList) {
|
|
|
|
|
wmsReportWorkListTWO) {
|
|
|
|
|
Map<String, Object> map = new HashMap<>();
|
|
|
|
|
map.put("AUFNR", mesReportWork.getWorkorderCodeSap());
|
|
|
|
|
map.put("WERKS", factoryCode);
|
|
|
|
@ -515,7 +538,7 @@ public class WmsProductPutServiceImpl implements IWmsProductPutService {
|
|
|
|
|
int code = result.getCode();
|
|
|
|
|
String msg = result.getMsg();
|
|
|
|
|
for (wmsReportWork mesReportWork :
|
|
|
|
|
wmsReportWorkList) {
|
|
|
|
|
wmsReportWorkListTWO) {
|
|
|
|
|
WmsProductPut wmsProductPut2 = new WmsProductPut();
|
|
|
|
|
wmsProductPut2.setId(mesReportWork.getId());
|
|
|
|
|
wmsProductPut2.setSapMessage(msg);
|
|
|
|
|