wms冲销bug

master
mengjiao 4 months ago
parent 8d7c9c10ee
commit 8cd2b82f04

@ -142,6 +142,8 @@ public interface RemoteSapService {
public R handleUpdateSAP103(@RequestBody(required = false)List<Map> mapList);
@PostMapping("/sap/handleUpdateSAP105")
public R handleUpdateSAP105(@RequestBody(required = false)List<Map> mapList);
@PostMapping("/sap/handleUpdateSAP102")
R handleUpdateSAP102(List<Map> mapList);
}

@ -163,6 +163,11 @@ public class RemoteSapFallbackFactory implements FallbackFactory<RemoteSapServic
return R.fail("105的冲销失败" + throwable.getMessage());
}
@Override
public R handleUpdateSAP102(List<Map> mapList) {
return R.fail("102的冲销失败" + throwable.getMessage());
}
};
}
}

@ -1145,7 +1145,7 @@ public class SapItemSyncImpl implements SapItemSyncService {
MESSAGE = func2.getExportParameterList().getString("L_MSG");
MATERIALDOCUMENT = func2.getExportParameterList().getString("MATERIALDOCUMENT");
MATDOCUMENTYEAR = func2.getExportParameterList().getString("MATDOCUMENTYEAR");
log.info("103冲销结果结果-----" + RETCODE+"/" +MESSAGE+"/" +MATERIALDOCUMENT+"/" +MATDOCUMENTYEAR);
log.info("105冲销结果结果-----" + RETCODE+"/" +MESSAGE+"/" +MATERIALDOCUMENT+"/" +MATDOCUMENTYEAR);
}
if((Constants.FAIL).equals(Integer.parseInt(RETCODE))){
return R.fail(MESSAGE);

@ -116,4 +116,9 @@ public class WmsRawOrderInController extends BaseController {
String result = odsProcureOrderService.handleUpdateSAP105(odsProcureOrder);
return success(result);
}
@PostMapping("/handleUpdateSAP102")
public AjaxResult handleUpdateSAP102(@RequestBody List<OdsProcureOrder> odsProcureOrder) {
String result = odsProcureOrderService.handleUpdateSAP102(odsProcureOrder);
return success(result);
}
}

@ -143,7 +143,7 @@ public class WmsSellOutEmbryoController extends BaseController {
@PostMapping("addRE")
@PostMapping("/addRE")
public AjaxResult addRE(@RequestBody List<WmsSellOutEmbryo> wmsSellOutEmbryoList) {
return success(wmsSellOutEmbryoService.addRE(wmsSellOutEmbryoList));
}

@ -153,4 +153,6 @@ public interface IOdsProcureOrderService {
String addOrderCardXNew(OdsProcureOrder orderList);
String upbatCardXNew(OdsProcureOrder order);
String handleUpdateSAP102(List<OdsProcureOrder> odsProcureOrder);
}

@ -1566,6 +1566,72 @@ public class OdsProcureOrderServiceImpl implements IOdsProcureOrderService {
return result;
}
@Override
public String handleUpdateSAP102(List<OdsProcureOrder> odsProcureOrders) {
String result="操作成功";
for (OdsProcureOrder order: odsProcureOrders){
OdsProcureOrder odsProcureOrder = order;
WmsRawOrderIn wmsRawOrderIn= wmsRawOrderInMapper.selectWmsRawOrderInByRawOrderInIdThress(odsProcureOrder.getID());
//这个地方
Map paramMap=new HashMap<>();
List<Map> mapList = new ArrayList<>();
paramMap.put("S_MBLNR",wmsRawOrderIn.getUserDefined1());
paramMap.put("S_MJAHR",wmsRawOrderIn.getUserDefined2());
paramMap.put("S_MATNR",wmsRawOrderIn.getMaterialCode());
paramMap.put("incomeBatchNo",wmsRawOrderIn.getIncomeBatchNo()); //批次
paramMap.put("ebelp",wmsRawOrderIn.getPoLine());
paramMap.put("poNo",wmsRawOrderIn.getPoNo());
mapList.add(paramMap);
R result2 = remoteSapService.handleUpdateSAP102(mapList);
if (result2.getCode()==200){
Map map = new HashMap();
map = (Map) result2.getData();
String MATERIALDOCUMENT = (String) map.get("MATERIALDOCUMENT");
String MATDOCUMENTYEAR = (String) map.get("MATDOCUMENTYEAR");
//成功了--成功了,根据
WmsRawOrderInSn wmsRawOrderInSn=new WmsRawOrderInSn();
wmsRawOrderInSn.setUserDefined5(wmsRawOrderIn.getDnNo());
wmsRawOrderInSn.setUserDefined1("1");//暂收
wmsRawOrderInSn.setUserDefined3(wmsRawOrderIn.getKem());
List<WmsRawOrderInSn> wmsRawOrderInSnList= wmsRawOrderInSnMapper.selectWmsRawOrderInSnList(wmsRawOrderInSn);
for (WmsRawOrderInSn wmsRawOrderInSn1:
wmsRawOrderInSnList) {
WmsOdsMateStorageNewsSn wmsRawOrderInNewsSn=new WmsOdsMateStorageNewsSn();
wmsRawOrderInNewsSn.setMaterialCode(wmsRawOrderInSn1.getMaterialCode());
wmsRawOrderInNewsSn.setWaCode(wmsRawOrderInSn1.getWaCode());
wmsRawOrderInNewsSn.setWhCode(wmsRawOrderInSn1.getWhCode());
wmsRawOrderInNewsSn.setWlCode(wmsRawOrderInSn1.getWlCode());
wmsRawOrderInNewsSn.setUserDefined3("1");
wmsOdsMateStorageNewsSnMapper.updateWmsOdsMateStorageNewsSnTWM(wmsRawOrderInNewsSn);
wmsRawOrderInSn1.setUserDefined1("2");
wmsRawOrderInSnMapper.updateWmsRawOrderInSn(wmsRawOrderInSn1);
WmsOdsMateStorageNews wmsOdsMateStorageNews=new WmsOdsMateStorageNews();
wmsOdsMateStorageNews.setMaterialCode(wmsRawOrderInSn1.getMaterialCode());
wmsOdsMateStorageNews.setWaCode(wmsRawOrderInSn1.getWaCode());
wmsOdsMateStorageNews.setWlCode(wmsRawOrderInSn1.getWlCode());
wmsOdsMateStorageNews.setWhCode(wmsRawOrderInSn1.getWhCode());
wmsOdsMateStorageNews.setStorageAmount(wmsRawOrderInSn1.getAmount());
wmsOdsMateStorageNewsMapper.updateWmsOdsMateStorageNewsUpdateStorageAmount(wmsOdsMateStorageNews);
}
wmsRawOrderIn.setOrderStatus("1");
wmsRawOrderIn.setAccountingTime(new Date());
wmsRawOrderIn.setAccountingMessage(result2.getMsg());
wmsRawOrderIn.setUserDefined4(MATERIALDOCUMENT);
wmsRawOrderIn.setUserDefined5(MATDOCUMENTYEAR);
wmsRawOrderInMapper.updateWmsRawOrderIn(wmsRawOrderIn);
}else {
//失败了
wmsRawOrderIn.setAccountingTime(new Date());
wmsRawOrderIn.setAccountingMessage(result2.getMsg());
wmsRawOrderInMapper.updateWmsRawOrderIn(wmsRawOrderIn);
}
}
return result;
}
@Override
@DS("#header.poolName")
public String getIdCardListDA(OdsProcureOrder odsProcureOrder) {

Loading…
Cancel
Save