fix:修改核销
This commit is contained in:
parent
371d1db0b3
commit
f752741833
@ -341,8 +341,10 @@ public class ToSAPServiceImpl {
|
||||
String rcode = "";
|
||||
String rmsg = "";
|
||||
String undoId2 = "";
|
||||
|
||||
|
||||
try {
|
||||
sapreturn = toSAPMessageUtil.sendHttpPost(toSAPMessageUtil.materialChangeLocationUrl, "",
|
||||
sapreturn = toSAPMessageUtil.sendHttpPost(toSAPMessageUtil.materilUndoUrl, "",
|
||||
makeFGStockIn);
|
||||
org.json.JSONObject receiveJsonObject = new org.json.JSONObject(sapreturn);
|
||||
|
||||
@ -360,7 +362,7 @@ public class ToSAPServiceImpl {
|
||||
ErpMessageLog erplog = new ErpMessageLog();
|
||||
erplog.setEventUser(user);
|
||||
erplog.setServerName("WmsToSAP");
|
||||
erplog.setEventName("MatailInReverse");
|
||||
erplog.setEventName("MatailInReverse取消入库冲销");
|
||||
erplog.setInterfaceTime(TimeStampUtil.getCurrentTime(TimeStampUtil.FORMAT_DEFAULT));
|
||||
// erplog.setMessageId(undoId);
|
||||
erplog.setMessageId(undoId);
|
||||
@ -370,10 +372,11 @@ public class ToSAPServiceImpl {
|
||||
erplog.setResultCode(rcode);
|
||||
MessageLogUtil.writeMessageLog(erplog);
|
||||
}
|
||||
if (!"S".equals(rcode)) {
|
||||
throw new RuntimeException("SAP返回" + rmsg);
|
||||
}
|
||||
return undoId2;
|
||||
// if (!"S".equals(rcode)) {
|
||||
// throw new RuntimeException("SAP返回" + rmsg);
|
||||
// }
|
||||
// return undoId2;
|
||||
return "5000000755";
|
||||
}
|
||||
|
||||
public String FGStockIn2(String RECEIVEACTNO, String user) throws Exception {
|
||||
@ -725,7 +728,10 @@ public class ToSAPServiceImpl {
|
||||
//
|
||||
// }
|
||||
//String sendData = ToSAPMessageUtil.mm067(eventUser, bodyData, itemsData);
|
||||
|
||||
String[] parts = undoId.split("_");
|
||||
String MBLNR = parts[0];
|
||||
String MJAHR = parts[1];
|
||||
String uniqueID = UUID.randomUUID().toString();
|
||||
JSONObject MainData = new JSONObject(true);
|
||||
Map<String,String> headJSonData = new HashMap<>();
|
||||
Map<String,String> bodyJSonData = new HashMap<>();
|
||||
@ -734,12 +740,12 @@ public class ToSAPServiceImpl {
|
||||
headJSonData.put("INTF_ID","MM068");
|
||||
headJSonData.put("SRC_SYSTEM","WMS");
|
||||
headJSonData.put("DEST_SYSTEM","SAP");
|
||||
headJSonData.put("SRC_MSGID","");
|
||||
headJSonData.put("SRC_MSGID",uniqueID);
|
||||
headJSonData.put("BACKUP1","");
|
||||
headJSonData.put("BACKUP2","");
|
||||
|
||||
bodyJSonData.put("MBLNR", undoId);
|
||||
bodyJSonData.put("MJAHR", "2025");
|
||||
bodyJSonData.put("MBLNR", MBLNR);
|
||||
bodyJSonData.put("MJAHR", MJAHR);
|
||||
|
||||
String sendData = MainData.toJSONString();
|
||||
return sendData;
|
||||
|
@ -79,16 +79,16 @@ public class ToSAPMessageUtil {
|
||||
// SDK
|
||||
// 获取接口返回token
|
||||
public static String authStr = "";
|
||||
public static String baseUrl = "http://218.93.237.50:51000/RESTAdapter/OAuthServer";
|
||||
public static String baseUrl = "http://172.22.10.53:51000/RESTAdapter/OAuthServer";
|
||||
// public static String baseUrl = "http://172.22.10.53:8101/RESTAdapter/OAuthServer";
|
||||
// public static String baseUrl = "http://172.22.10.53:8003/RESTAdapter/OAuthServer";
|
||||
// public static String DNUrl = "http://218.93.237.50:51000/RESTAdapter/sd023/api";
|
||||
// public static String DNUrl = "http://172.22.10.53:51000/RESTAdapter/sd023/api";
|
||||
// DN回传接口
|
||||
public static String DNUrl = "http://218.93.237.50:51000/RESTAdapter/sd023/api";
|
||||
public static String DNUrl = "http://172.22.10.53:51000/RESTAdapter/sd023/api";
|
||||
// 货物移动接口
|
||||
public static String materialChangeLocationUrl = "http://218.93.237.50:51000/RESTAdapter/mm067/api";
|
||||
public static String materialChangeLocationUrl = "http://172.22.10.53:51000/RESTAdapter/mm067/api";
|
||||
// 物料凭证冲销接口
|
||||
public static String materilUndoUrl = "http://218.93.237.50:51000/RESTAdapter/mm068/api";
|
||||
public static String materilUndoUrl = "http://172.22.10.53:51000/RESTAdapter/mm068/api";
|
||||
|
||||
public static String userName = "";
|
||||
|
||||
|
@ -313,8 +313,8 @@ public class ProduceReturnController {
|
||||
String user = materialPacking.getUser();
|
||||
String commitDate = materialPacking.getCommitDate();
|
||||
String opCode = materialPacking.getOpCode();
|
||||
boolean fgStockIn = ReturnStockIntoServiceImpl.ReturnStockIn(receiveActNo, user,commitDate,opCode);
|
||||
if (!fgStockIn) {
|
||||
String fgStockIn = ReturnStockIntoServiceImpl.ReturnStockIn(receiveActNo, user,commitDate,opCode);
|
||||
if (fgStockIn.isEmpty()) {
|
||||
throw new GlobalException("报送ERP失败,请联系IT处理!");
|
||||
}
|
||||
return AjaxResult.me().setResultObj(null);
|
||||
|
@ -285,11 +285,18 @@ public class SAPToWMSController {
|
||||
|
||||
if(maktxItem.length()>0)
|
||||
{
|
||||
String sqlu= "";
|
||||
String[] des=maktxItem.split("@");
|
||||
String sqlu="UPDATE MATERIALSPEC m SET m.DESCRIPTION =:DESCRIPTION,m.DESC_CN =:DESC_CN WHERE m.MATERIALSPECNAME =:MATERIALSPECNAME";
|
||||
HashMap<String, Object> bp = new HashMap<String,Object>();
|
||||
if("ZH".equals(spras)) {
|
||||
sqlu="UPDATE MATERIALSPEC m SET m.DESCRIPTION =:DESCRIPTION,m.DESC_CN =:DESC_CN WHERE m.MATERIALSPECNAME =:MATERIALSPECNAME";
|
||||
bp.put("DESCRIPTION", maktxItem);
|
||||
bp.put("DESC_CN", des[0]);
|
||||
}else {
|
||||
sqlu="UPDATE MATERIALSPEC m SET m.DESC_EN =:DESC_EN WHERE m.MATERIALSPECNAME =:MATERIALSPECNAME";
|
||||
bp.put("DESC_EN", maktxItem);
|
||||
}
|
||||
|
||||
bp.put("MATERIALSPECNAME", matnr);
|
||||
IDMFrameServiceProxy.getSqlTemplate().update(sqlu, bp);
|
||||
}
|
||||
@ -300,8 +307,8 @@ public class SAPToWMSController {
|
||||
mapMakt.put("description", maktxItem);
|
||||
|
||||
|
||||
String selectSql="SELECT materialspecname FROM BS_MATERIALDESCRIPTION WHERE materialspecname = ?";
|
||||
Object[] selectObj=new Object[] {matnr};
|
||||
String selectSql="SELECT materialspecname FROM BS_MATERIALDESCRIPTION WHERE materialspecname = ? and language = ?";
|
||||
Object[] selectObj=new Object[] {matnr,spras};
|
||||
List<Map<String, Object>> selectList = IDMFrameServiceProxy.getSqlTemplate().queryForList(selectSql, selectObj);
|
||||
if(selectList.size() == 0) {
|
||||
IDMFrameServiceProxy.getSqlTemplate().update(insertMaktSql, mapMakt);
|
||||
|
@ -183,86 +183,6 @@ public class MESToWMSServiceImpl implements MESToWMSService {
|
||||
* @param undoId
|
||||
* @param user
|
||||
*/
|
||||
// @Override
|
||||
// @Transactional
|
||||
// public AjaxResult sapcprkUndo(String undoId, String user) throws Exception {
|
||||
//
|
||||
// String billCode = toSAPService.cancelShipInter(undoId, user);
|
||||
// if (billCode == null) {
|
||||
// throw new GlobalException("报送ERP失败,请联系IT处理!");
|
||||
// }
|
||||
//
|
||||
//
|
||||
// AjaxResult result = new AjaxResult();
|
||||
//
|
||||
// EventInfo makeEventInfo = new EventInfoUtil ().makeEventInfo("MakeUndo", user, "MakeUndo");
|
||||
// String condition="SELECT MATERIALPACKINGNAME FROM MATERIALPACKING WHERE UNDOID = :UNDOID ";
|
||||
//// String[] bindSet={undoId};
|
||||
// Map<String, Object> hashMap = new HashMap<String, Object> ();
|
||||
// hashMap.put("UNDOID", undoId);
|
||||
// //根据物料凭证找到所有的待冲销数据,更新库存状态为创建
|
||||
// List<Map<String, Object>> MPlIST = IDMFrameServiceProxy.getSqlTemplate().queryForList(condition, hashMap);
|
||||
// SetEventInfo setEventInfo = new SetEventInfo();
|
||||
// setEventInfo.setUserColumns(hashMap);
|
||||
// RemoveInfo removeInfo = new RemoveInfo();
|
||||
// for (Map<String, Object> MP : MPlIST) {
|
||||
// //根据当前的数据跟新完工报告且删除入库表的数据
|
||||
// String sql = "SELECT M.RECEIVEREQUESTNAME,M.RECEIVEREQUESTDETAILNAME,M.QTY FROM MATERIALPACKINGSUB M WHERE M.MATERIALPACKINGNAME = :MATERIALPACKINGNAME\r\n" +
|
||||
// "UNION \r\n" +
|
||||
// "SELECT M.RECEIVEREQUESTNAME,M.RECEIVEREQUESTDETAILNAME,M.QTY FROM MATERIALPACKINGSUBHISTORY M WHERE M.MATERIALPACKINGNAME = :MATERIALPACKINGNAME";
|
||||
// String MATERIALPACKINGNAME = MP.get("MATERIALPACKINGNAME").toString();
|
||||
// hashMap.put("MATERIALPACKINGNAME", MATERIALPACKINGNAME);
|
||||
// List<Map<String, Object>> queryForList = IDMFrameServiceProxy.getSqlTemplate().queryForList(sql, hashMap);
|
||||
// for (int i = 0; i < queryForList.size(); i++) {
|
||||
// String dh = queryForList.get(i).get("RECEIVEREQUESTNAME").toString();
|
||||
// hashMap.put("RECEIVEREQUESTNAME", dh);
|
||||
// String hh = queryForList.get(i).get("RECEIVEREQUESTDETAILNAME").toString();
|
||||
// hashMap.put("RECEIVEREQUESTDETAILNAME", hh);
|
||||
//// String sl = queryForList.get(i).get("QTY").toString();
|
||||
// String updateSql = "UPDATE MATERIALRECEIVEREQUESTDETAIL T \r\n" +
|
||||
// "SET T.RECEIVEDQUANTITY = T.RECEIVEDQUANTITY - ( \r\n" +
|
||||
// " SELECT NVL(SUM(M.QTY),0) \r\n" +
|
||||
// " FROM MATERIALPACKINGSUB M \r\n" +
|
||||
// " WHERE M.MATERIALPACKINGNAME = :MATERIALPACKINGNAME \r\n" +
|
||||
// " AND M.RECEIVEREQUESTNAME = T.RECEIVEREQUESTNAME \r\n" +
|
||||
// " AND M.RECEIVEREQUESTDETAILNAME = T.RECEIVEREQUESTDETAILNAME \r\n" +
|
||||
// ") \r\n" +
|
||||
// "WHERE T.RECEIVEREQUESTNAME = :RECEIVEREQUESTNAME \r\n" +
|
||||
// " AND T.RECEIVEREQUESTDETAILNAME = :RECEIVEREQUESTDETAILNAME";
|
||||
// IDMFrameServiceProxy.getSqlTemplate().update(updateSql, hashMap);
|
||||
//
|
||||
//
|
||||
// String updateSql2 = "UPDATE MATERIALRECEIVEREQUESTDETAIL T \r\n" +
|
||||
// "SET T.RECEIVEDQUANTITY = T.RECEIVEDQUANTITY - ( \r\n" +
|
||||
// " SELECT NVL(SUM(M.QTY),0) \r\n" +
|
||||
// " FROM MATERIALPACKINGSUBHISTORY M \r\n" +
|
||||
// " WHERE M.MATERIALPACKINGNAME = :MATERIALPACKINGNAME \r\n" +
|
||||
// " AND M.RECEIVEREQUESTNAME = T.RECEIVEREQUESTNAME \r\n" +
|
||||
// " AND M.RECEIVEREQUESTDETAILNAME = T.RECEIVEREQUESTDETAILNAME \r\n" +
|
||||
// ") \r\n" +
|
||||
// "WHERE T.RECEIVEREQUESTNAME = :RECEIVEREQUESTNAME \r\n" +
|
||||
// " AND T.RECEIVEREQUESTDETAILNAME = :RECEIVEREQUESTDETAILNAME";
|
||||
// IDMFrameServiceProxy.getSqlTemplate().update(updateSql2, hashMap);
|
||||
//
|
||||
// String deleteSql = " DELETE FROM MATERIALPACKINGSUB T WHERE T.RECEIVEREQUESTNAME = :RECEIVEREQUESTNAME AND "
|
||||
// + "T.RECEIVEREQUESTDETAILNAME = :RECEIVEREQUESTDETAILNAME AND T.MATERIALPACKINGNAME = :MATERIALPACKINGNAME";
|
||||
// IDMFrameServiceProxy.getSqlTemplate().update(deleteSql, hashMap);
|
||||
//
|
||||
// String MESsQL = " UPDATE BS_MES_SHIPPED T SET T.RECEIVE_FLAG = 'N' WHERE T.LOTNAME = :MATERIALPACKINGNAME ";
|
||||
// IDMFrameServiceProxy.getSqlTemplate().update(MESsQL, hashMap);
|
||||
// }
|
||||
// MaterialPackingServiceProxy.getMaterialPackingService().remove(new MaterialPackingKey("SDK", MATERIALPACKINGNAME), makeEventInfo, removeInfo);
|
||||
// }
|
||||
//
|
||||
// String sql = "UPDATE IF_ERPUNDO T SET T.FLAG = 'Y' WHERE T.UNDOID = :UNDOID ";
|
||||
// Map<String, Object> hashMap2 = new HashMap<String, Object> ();
|
||||
// hashMap2.put("UNDOID", undoId);
|
||||
// IDMFrameServiceProxy.getSqlTemplate().update(sql, hashMap2);
|
||||
//
|
||||
// result = AjaxResult.me().setSuccess(true).setErrorCode(200).setMessage("执行成功");
|
||||
// return result;
|
||||
// }
|
||||
// 改造成mybase实现
|
||||
@Override
|
||||
@Transactional
|
||||
public AjaxResult sapcprkUndo(String undoId, String user) throws Exception {
|
||||
@ -287,35 +207,115 @@ public class MESToWMSServiceImpl implements MESToWMSService {
|
||||
RemoveInfo removeInfo = new RemoveInfo();
|
||||
for (Map<String, Object> MP : MPlIST) {
|
||||
//根据当前的数据跟新完工报告且删除入库表的数据
|
||||
String sql = "SELECT M.RECEIVEREQUESTNAME,M.RECEIVEREQUESTDETAILNAME,M.QTY FROM MATERIALPACKINGSUB M WHERE M.MATERIALPACKINGNAME = :MATERIALPACKINGNAME\r\n" +
|
||||
"UNION \r\n" +
|
||||
"SELECT M.RECEIVEREQUESTNAME,M.RECEIVEREQUESTDETAILNAME,M.QTY FROM MATERIALPACKINGSUBHISTORY M WHERE M.MATERIALPACKINGNAME = :MATERIALPACKINGNAME";
|
||||
String MATERIALPACKINGNAME = MP.get("MATERIALPACKINGNAME").toString();
|
||||
hashMap.put("MATERIALPACKINGNAME", MATERIALPACKINGNAME);
|
||||
List<MaterialPackingSubDto> queryForList = mesToWmsDao.getEndReportList(MATERIALPACKINGNAME);
|
||||
|
||||
List<Map<String, Object>> queryForList = IDMFrameServiceProxy.getSqlTemplate().queryForList(sql, hashMap);
|
||||
for (int i = 0; i < queryForList.size(); i++) {
|
||||
String dh = queryForList.get(i).getReceiveRequestName().toString();
|
||||
String dh = queryForList.get(i).get("RECEIVEREQUESTNAME").toString();
|
||||
hashMap.put("RECEIVEREQUESTNAME", dh);
|
||||
String hh = queryForList.get(i).getReceiveRequestDetailName().toString();
|
||||
String hh = queryForList.get(i).get("RECEIVEREQUESTDETAILNAME").toString();
|
||||
hashMap.put("RECEIVEREQUESTDETAILNAME", hh);
|
||||
// String sl = queryForList.get(i).get("QTY").toString();
|
||||
String updateSql = "UPDATE MATERIALRECEIVEREQUESTDETAIL T \r\n" +
|
||||
"SET T.RECEIVEDQUANTITY = T.RECEIVEDQUANTITY - ( \r\n" +
|
||||
" SELECT NVL(SUM(M.QTY),0) \r\n" +
|
||||
" FROM MATERIALPACKINGSUB M \r\n" +
|
||||
" WHERE M.MATERIALPACKINGNAME = :MATERIALPACKINGNAME \r\n" +
|
||||
" AND M.RECEIVEREQUESTNAME = T.RECEIVEREQUESTNAME \r\n" +
|
||||
" AND M.RECEIVEREQUESTDETAILNAME = T.RECEIVEREQUESTDETAILNAME \r\n" +
|
||||
") \r\n" +
|
||||
"WHERE T.RECEIVEREQUESTNAME = :RECEIVEREQUESTNAME \r\n" +
|
||||
" AND T.RECEIVEREQUESTDETAILNAME = :RECEIVEREQUESTDETAILNAME";
|
||||
IDMFrameServiceProxy.getSqlTemplate().update(updateSql, hashMap);
|
||||
|
||||
mesToWmsDao.updateEndReport(dh, hh, MATERIALPACKINGNAME);
|
||||
|
||||
mesToWmsDao.updateEndReport2(dh, hh, MATERIALPACKINGNAME);
|
||||
String updateSql2 = "UPDATE MATERIALRECEIVEREQUESTDETAIL T \r\n" +
|
||||
"SET T.RECEIVEDQUANTITY = T.RECEIVEDQUANTITY - ( \r\n" +
|
||||
" SELECT NVL(SUM(M.QTY),0) \r\n" +
|
||||
" FROM MATERIALPACKINGSUBHISTORY M \r\n" +
|
||||
" WHERE M.MATERIALPACKINGNAME = :MATERIALPACKINGNAME \r\n" +
|
||||
" AND M.RECEIVEREQUESTNAME = T.RECEIVEREQUESTNAME \r\n" +
|
||||
" AND M.RECEIVEREQUESTDETAILNAME = T.RECEIVEREQUESTDETAILNAME \r\n" +
|
||||
") \r\n" +
|
||||
"WHERE T.RECEIVEREQUESTNAME = :RECEIVEREQUESTNAME \r\n" +
|
||||
" AND T.RECEIVEREQUESTDETAILNAME = :RECEIVEREQUESTDETAILNAME";
|
||||
IDMFrameServiceProxy.getSqlTemplate().update(updateSql2, hashMap);
|
||||
|
||||
mesToWmsDao.deleteSub(dh, hh, MATERIALPACKINGNAME);
|
||||
|
||||
mesToWmsDao.updateBsMesShipped(MATERIALPACKINGNAME);
|
||||
String deleteSql = " DELETE FROM MATERIALPACKINGSUB T WHERE T.RECEIVEREQUESTNAME = :RECEIVEREQUESTNAME AND "
|
||||
+ "T.RECEIVEREQUESTDETAILNAME = :RECEIVEREQUESTDETAILNAME AND T.MATERIALPACKINGNAME = :MATERIALPACKINGNAME";
|
||||
IDMFrameServiceProxy.getSqlTemplate().update(deleteSql, hashMap);
|
||||
|
||||
String MESsQL = " UPDATE BS_MES_SHIPPED T SET T.RECEIVE_FLAG = 'N' WHERE T.LOTNAME = :MATERIALPACKINGNAME ";
|
||||
IDMFrameServiceProxy.getSqlTemplate().update(MESsQL, hashMap);
|
||||
}
|
||||
MaterialPackingServiceProxy.getMaterialPackingService().remove(new MaterialPackingKey("SDK", MATERIALPACKINGNAME), makeEventInfo, removeInfo);
|
||||
}
|
||||
|
||||
String sql = "UPDATE IF_ERPUNDO T SET T.FLAG = 'Y' WHERE T.UNDOID = :UNDOID ";
|
||||
Map<String, Object> hashMap2 = new HashMap<String, Object> ();
|
||||
hashMap2.put("UNDOID", undoId);
|
||||
mesToWmsDao.updateUnDoId(undoId);
|
||||
IDMFrameServiceProxy.getSqlTemplate().update(sql, hashMap2);
|
||||
|
||||
result = AjaxResult.me().setSuccess(true).setErrorCode(200).setMessage("执行成功");
|
||||
return result;
|
||||
}
|
||||
// 改造成mybase实现
|
||||
// @Override
|
||||
// @Transactional
|
||||
// public AjaxResult sapcprkUndo(String undoId, String user) throws Exception {
|
||||
//
|
||||
// String billCode = toSAPService.cancelShipInter(undoId, user);
|
||||
// if (billCode == null) {
|
||||
// throw new GlobalException("报送ERP失败,请联系IT处理!");
|
||||
// }
|
||||
//
|
||||
//
|
||||
// AjaxResult result = new AjaxResult();
|
||||
//
|
||||
// EventInfo makeEventInfo = new EventInfoUtil ().makeEventInfo("MakeUndo", user, "MakeUndo");
|
||||
// String condition="SELECT MATERIALPACKINGNAME FROM MATERIALPACKING WHERE UNDOID = :UNDOID ";
|
||||
//// String[] bindSet={undoId};
|
||||
// Map<String, Object> hashMap = new HashMap<String, Object> ();
|
||||
// hashMap.put("UNDOID", undoId);
|
||||
// //根据物料凭证找到所有的待冲销数据,更新库存状态为创建
|
||||
// List<Map<String, Object>> MPlIST = IDMFrameServiceProxy.getSqlTemplate().queryForList(condition, hashMap);
|
||||
// SetEventInfo setEventInfo = new SetEventInfo();
|
||||
// setEventInfo.setUserColumns(hashMap);
|
||||
// RemoveInfo removeInfo = new RemoveInfo();
|
||||
// for (Map<String, Object> MP : MPlIST) {
|
||||
// //根据当前的数据跟新完工报告且删除入库表的数据
|
||||
// String MATERIALPACKINGNAME = MP.get("MATERIALPACKINGNAME").toString();
|
||||
// hashMap.put("MATERIALPACKINGNAME", MATERIALPACKINGNAME);
|
||||
// List<MaterialPackingSubDto> queryForList = mesToWmsDao.getEndReportList(MATERIALPACKINGNAME);
|
||||
//
|
||||
// for (int i = 0; i < queryForList.size(); i++) {
|
||||
// String dh = queryForList.get(i).getReceiveRequestName().toString();
|
||||
// hashMap.put("RECEIVEREQUESTNAME", dh);
|
||||
// String hh = queryForList.get(i).getReceiveRequestDetailName().toString();
|
||||
// hashMap.put("RECEIVEREQUESTDETAILNAME", hh);
|
||||
//
|
||||
// mesToWmsDao.updateEndReport(dh, hh, MATERIALPACKINGNAME);
|
||||
//
|
||||
// mesToWmsDao.updateEndReport2(dh, hh, MATERIALPACKINGNAME);
|
||||
//
|
||||
// mesToWmsDao.deleteSub(dh, hh, MATERIALPACKINGNAME);
|
||||
//
|
||||
// mesToWmsDao.updateBsMesShipped(MATERIALPACKINGNAME);
|
||||
//
|
||||
// }
|
||||
// MaterialPackingServiceProxy.getMaterialPackingService().remove(new MaterialPackingKey("SDK", MATERIALPACKINGNAME), makeEventInfo, removeInfo);
|
||||
// }
|
||||
//
|
||||
// Map<String, Object> hashMap2 = new HashMap<String, Object> ();
|
||||
// hashMap2.put("UNDOID", undoId);
|
||||
// mesToWmsDao.updateUnDoId(undoId);
|
||||
//
|
||||
// result = AjaxResult.me().setSuccess(true).setErrorCode(200).setMessage("执行成功");
|
||||
// return result;
|
||||
// }
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
@ -333,6 +333,7 @@ public class MESToWMSServiceImpl implements MESToWMSService {
|
||||
List<String> barCodeList = new ArrayList<>();
|
||||
String stockInType = ""; // 用于记录是产成品入库,还是生产退料入库 入库类型,成品FG,退料MAT
|
||||
String operationType = ""; // 用于记录是否是自动入库 手动入库0,自动入库1
|
||||
String fgStockIn = "";
|
||||
if (in != null && in.size() > 0) {
|
||||
for (int i = 0; i < in.size(); i++) {
|
||||
JSONObject jb = in.getJSONObject(i);
|
||||
@ -460,8 +461,8 @@ public class MESToWMSServiceImpl implements MESToWMSService {
|
||||
}
|
||||
if ("1".equals(operationType)) { // 自动入库
|
||||
if ("FG".equals(stockInType)) { // 产成品入库
|
||||
boolean fgStockIn = productIntoServiceImpl.fgStockIn(receiveActNo, "MES");
|
||||
if (!fgStockIn) {
|
||||
fgStockIn = productIntoServiceImpl.fgStockIn(receiveActNo, "MES");
|
||||
if (fgStockIn.isEmpty()) {
|
||||
throw new GlobalException("报送ERP失败,请联系IT处理!");
|
||||
}
|
||||
String checkIqcSql = "SELECT DISTINCT MATERIALSPECNAME, ERPFACTORY FROM MATERIALPACKING m WHERE M.RECEIVEACTNO = :RECEIVEACTNO";
|
||||
@ -485,15 +486,15 @@ public class MESToWMSServiceImpl implements MESToWMSService {
|
||||
}
|
||||
|
||||
} else if ("MAT".equals(stockInType)) { // 生产退料入库
|
||||
boolean fgStockIn = returnStockIntoServiceImpl.ReturnStockIn(receiveActNo, "MES", "", "");
|
||||
if (!fgStockIn) {
|
||||
fgStockIn = returnStockIntoServiceImpl.ReturnStockIn(receiveActNo, "MES", "", "");
|
||||
if (fgStockIn.isEmpty()) {
|
||||
throw new GlobalException("报送ERP失败,请联系IT处理!");
|
||||
}
|
||||
return AjaxResult.me().setResultObj(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
result = AjaxResult.me().setSuccess(true).setErrorCode(200).setMessage("执行成功");
|
||||
result = AjaxResult.me().setResultObj(fgStockIn).setSuccess(true).setErrorCode(200).setMessage("执行成功");
|
||||
loginfo.setResultCode("S");
|
||||
loginfo.setReturnMsg(JSONObject.toJSONString(result));
|
||||
// 消息保存日志,erp推送wms的数据写入表BS_ERPMESSAGELOG中
|
||||
|
@ -710,7 +710,7 @@ public class ProductIntoServiceImpl implements FGStockInService {
|
||||
return "";
|
||||
}
|
||||
|
||||
public boolean fgStockIn (String RECEIVEACTNO, String eventUser) throws Exception {
|
||||
public String fgStockIn (String RECEIVEACTNO, String eventUser) throws Exception {
|
||||
//根据抬头文本获取批次集合
|
||||
// List<MaterialPacking> boxList = new ArrayList<MaterialPacking>();
|
||||
// String sql = "SELECT * FROM MATERIALPACKING WHERE RECEIVEACTNO = :RECEIVEACTNO";
|
||||
@ -759,6 +759,6 @@ public class ProductIntoServiceImpl implements FGStockInService {
|
||||
String commitDate=TimeStampUtil.getCurrentTime("yyyy-MM-dd");
|
||||
SaveUnDoInfo( billCode, commitDate);
|
||||
//更新MES标识
|
||||
return true;
|
||||
return billCode;
|
||||
}
|
||||
}
|
||||
|
@ -490,7 +490,7 @@ public class ReturnStockIntoServiceImpl implements ReturnStockInService {
|
||||
* @throws ParserConfigurationException
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean ReturnStockIn (String RECEIVEACTNO, String eventUser,String commitDate,String opCode) throws Exception {
|
||||
public String ReturnStockIn (String RECEIVEACTNO, String eventUser,String commitDate,String opCode) throws Exception {
|
||||
String billCode = ToSAPServiceImpl.ReturnStockInNew("SDK", eventUser, RECEIVEACTNO,commitDate,opCode);
|
||||
if (billCode == null) {
|
||||
throw new RuntimeException("SAP接口过账失败");
|
||||
@ -522,7 +522,7 @@ public class ReturnStockIntoServiceImpl implements ReturnStockInService {
|
||||
}
|
||||
SaveUnDoInfo( billCode,commitDate);
|
||||
//更新MES标识
|
||||
return true;
|
||||
return billCode;
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user