wms修改18.4-报工页面的sap收货按钮,和成品入库页面的过账按钮修改

master
mengjiao 1 year ago
parent f110febe1c
commit 2ff5a8dc09

@ -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) {
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,36 +419,71 @@ public class WmsProductPutServiceImpl implements IWmsProductPutService {
wmsFpStorageNewsMapper.insertWmsFpStorageNews(wmsFpStorageNews);
}
}
List<Map<String, Object>> mapList = new ArrayList<>();
for (wmsReportWork mesReportWork:
mesReportWorks) {
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);
if(wmsReportWorkListRk.size()>0){
List<Map<String, Object>> mapList = new ArrayList<>();
for (wmsReportWork mesReportWork:
wmsReportWorkListRk) {
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:
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);
}
}
//过账
R result=remoteSapService.sapOrderReceipt(mapList);
int code= result.getCode();
String msg= result.getMsg();
for (wmsReportWork mesReportWork:
mesReportWorks) {
WmsProductPut wmsProductPut2=new WmsProductPut();
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);
if (code==200) {//过账成功
String tem= (String) result.getData();
wmsProductPut2.setSapProof(tem);
wmsProductPut2.setSapStatus("1");
}else {
wmsProductPut2.setSapStatus("2");
if (code==200) {//过账成功
String tem= (String) result.getData();
wmsProductPut2.setSapProof(tem);
wmsProductPut2.setSapStatus("1");
}else {
wmsProductPut2.setSapStatus("2");
}
wmsProductPutMapper.updateWmsProductPut(wmsProductPut2);
}
wmsProductPutMapper.updateWmsProductPut(wmsProductPut2);
}
String SUCCESS="操作完成";
return SUCCESS;

Loading…
Cancel
Save