update meswms_materialconsume_request接口修改,将MES调用WMS接口时传递的payMentDate字段放在WMS给SAP过账时的过账日期字段中

This commit is contained in:
18110972313 2025-05-06 18:46:19 +08:00
parent 55d841ebed
commit 80d3104698
2 changed files with 11 additions and 4 deletions

View File

@ -2550,7 +2550,7 @@ public class ToSAPServiceImpl {
}
//MES上报工单消耗数据-261工单投料
public String mesMaterialConsume( String user ) throws Exception {
public String mesMaterialConsume( String user, String payMentDate) throws Exception {
String rcode;
String undoId = "";
@ -2581,8 +2581,14 @@ public class ToSAPServiceImpl {
*/
body.put("ITEM", itemArray);
body.put("ITEMID", uniqueID);
String budatData = "";
if(StringUtils.isNotEmpty(payMentDate)){
budatData = payMentDate;
}else {
budatData = TimeStampUtil.getCurrentTime("yyyyMMdd");
}
//过账日期
body.put("BUDAT", TimeStampUtil.getCurrentTime("yyyyMMdd"));
body.put("BUDAT", budatData);
//凭证日期
body.put("BLDAT", TimeStampUtil.getCurrentTime("yyyyMMdd"));
//凭证抬头文本

View File

@ -81,7 +81,7 @@ public class MESToWMSServiceImpl implements MESToWMSService {
* 3. 过账
* 4. 更新MATERIALPACKINGMDC表库存
*/
String payMentDate = "";
for (int i = 0; i < in.size(); i++) {
JSONObject jb = in.getJSONObject(i);
String materialSpecName = jb.get("materialSpecName").toString();
@ -89,6 +89,7 @@ public class MESToWMSServiceImpl implements MESToWMSService {
String wo = jb.get("requestName") == null ? "" : jb.get("requestName").toString(); // 工单
String flag = jb.get("flag") == null ? "" : jb.get("flag").toString();
String charge = jb.get("CHARGE") == null ? "" : jb.get("CHARGE").toString();
payMentDate = jb.get("payMentDate").toString();
//判空
if (StringUtils.isBlank(materialSpecName) || StringUtils.isBlank(qty)) {
result = AjaxResult.me().setSuccess(false).setErrorCode(500).setMessage("料号或数量不能为空");
@ -135,7 +136,7 @@ public class MESToWMSServiceImpl implements MESToWMSService {
}
// 将工单的物料消耗数据传给SAP
String undoId = toSAPService.mesMaterialConsume("MES");
String undoId = toSAPService.mesMaterialConsume("MES",payMentDate);
result = AjaxResult.me().setSuccess(true).setErrorCode(200).setMessage("执行成功");
loginfo.setResultCode("0");
loginfo.setReturnMsg(JSONObject.toJSONString(result));