fix:下发取阶段

This commit is contained in:
郭飞 2025-03-12 11:41:52 +08:00
parent 6c6a8a2a73
commit 7a381c4d68
4 changed files with 27 additions and 5 deletions

View File

@ -164,6 +164,8 @@ public class MaterialShipRequestDetail extends FieldAccessor implements DataInfo
@UserColumnMark @UserColumnMark
private String charge; private String charge;
@UserColumnMark @UserColumnMark
private String phase;
@UserColumnMark
private String erpLocation; private String erpLocation;
@UserColumnMark @UserColumnMark
private String reasonCode; private String reasonCode;
@ -255,6 +257,13 @@ public class MaterialShipRequestDetail extends FieldAccessor implements DataInfo
public void setCharge(String charge) { public void setCharge(String charge) {
this.charge = charge; this.charge = charge;
} }
public String getPhase() {
return phase;
}
public void setPhase(String phase) {
this.phase = phase;
}
public String getErpLocation() { public String getErpLocation() {
return erpLocation; return erpLocation;
} }
@ -304,6 +313,6 @@ public class MaterialShipRequestDetail extends FieldAccessor implements DataInfo
public void setErpFactoryName(String erpFactoryName) { public void setErpFactoryName(String erpFactoryName) {
this.erpFactoryName = erpFactoryName; this.erpFactoryName = erpFactoryName;
} }
} }

View File

@ -3,7 +3,7 @@ rem ---------------------------------------------------------------------------
rem deploy script for the MWMS Server rem deploy script for the MWMS Server
rem --------------------------------------------------------------------------- rem ---------------------------------------------------------------------------
setlocal setlocal
set "RAR=D:\Program Files\7-Zip\7z.exe" set "RAR=C:\Program Files\7-Zip\7z.exe"
set "WMS_VERSION=1.0.0" set "WMS_VERSION=1.0.0"
rem Guess WORKSPACE_HOME if not defined rem Guess WORKSPACE_HOME if not defined

View File

@ -1087,6 +1087,13 @@ public class SAPToWMSController {
IDMFrameServiceProxy.getSqlTemplate().update(sql, obj); IDMFrameServiceProxy.getSqlTemplate().update(sql, obj);
}else { }else {
// 根据料号获取阶段
String materialSql = "SELECT m.PHASE FROM MATERIALSPEC m WHERE MATERIALSPECNAME = :MATERIALSPECNAME";
Map<String, Object> materialMap= new HashMap<String, Object>();
materialMap.put("MATERIALSPECNAME", materialSpecName);
List<Map<String, Object>> phaseList = IDMFrameServiceProxy.getSqlTemplate().queryForList(materialSql, materialMap);
String phase = phaseList.get(0).get("PHASE") != null ? phaseList.get(0).get("PHASE").toString() : "";
String sqlItemCheck ="SELECT * FROM materialshiprequestdetail WHERE shiprequestname =:SHIPREQUESTNAME and shiprequestdetailname = :SHIPREQUESTDETAILNAME"; String sqlItemCheck ="SELECT * FROM materialshiprequestdetail WHERE shiprequestname =:SHIPREQUESTNAME and shiprequestdetailname = :SHIPREQUESTDETAILNAME";
Map<String, Object> selectItemMap= new HashMap<String, Object>(); Map<String, Object> selectItemMap= new HashMap<String, Object>();
@ -1133,6 +1140,7 @@ public class SAPToWMSController {
bindMapItem.put("receiveSalesOrderDetailNo", receiveSalesOrderDetailNo); bindMapItem.put("receiveSalesOrderDetailNo", receiveSalesOrderDetailNo);
bindMapItem.put("causeOfMovement", causeOfMovement); bindMapItem.put("causeOfMovement", causeOfMovement);
bindMapItem.put("goalMaterialSpec", ummat); bindMapItem.put("goalMaterialSpec", ummat);
bindMapItem.put("phase", phase);
createInfo.setUserColumns(bindMapItem); createInfo.setUserColumns(bindMapItem);
EventInfo eventInfo = new EventInfo(); EventInfo eventInfo = new EventInfo();
@ -1172,6 +1180,7 @@ public class SAPToWMSController {
bindMapItem.put("receiveSalesOrderDetailNo", receiveSalesOrderDetailNo); bindMapItem.put("receiveSalesOrderDetailNo", receiveSalesOrderDetailNo);
bindMapItem.put("causeOfMovement", causeOfMovement); bindMapItem.put("causeOfMovement", causeOfMovement);
bindMapItem.put("goalMaterialSpec", ummat); bindMapItem.put("goalMaterialSpec", ummat);
bindMapItem.put("phase", phase);
nonPrimaryKeyValueInfo.setUserColumns(bindMapItem); nonPrimaryKeyValueInfo.setUserColumns(bindMapItem);
EventInfo eventInfo = new EventInfo(); EventInfo eventInfo = new EventInfo();

View File

@ -1094,7 +1094,9 @@ public class InvoiceServiceImpl implements InvoiceService {
// BigDecimal QTY = new BigDecimal(materialQuantity); // BigDecimal QTY = new BigDecimal(materialQuantity);
String updateSql= " UPDATE MATERIALSHIPREQUESTDETAIL m SET m.ASSIGNEDQUANTITY = m.ASSIGNEDQUANTITY + :QTY WHERE m.SITENAME = :SITENAME" String updateSql= " UPDATE MATERIALSHIPREQUESTDETAIL m SET m.ASSIGNEDQUANTITY = m.ASSIGNEDQUANTITY + :QTY WHERE m.SITENAME = :SITENAME"
+ " AND m.SHIPREQUESTNAME = :SHIPREQUESTNAME AND m.MATERIALSPECNAME = :MATERIALSPECNAME " + " AND m.SHIPREQUESTNAME = :SHIPREQUESTNAME AND m.MATERIALSPECNAME = :MATERIALSPECNAME "
+ " AND (:SDK_ID IS NULL OR SDK_ID = :SDK_ID) AND (:PHASE IS NULL OR PHASE = :PHASE) AND ROWNUM = 1 "; + " AND (:SDK_ID IS NULL OR SDK_ID = :SDK_ID) " +
// "AND (:PHASE IS NULL OR PHASE = :PHASE) " +
"AND ROWNUM = 1 ";
Map<String, Object> bindMap = new HashMap<String, Object>(); Map<String, Object> bindMap = new HashMap<String, Object>();
bindMap.put("QTY", queryForList.get(0).get("MATERIALQUANTITY").toString()); bindMap.put("QTY", queryForList.get(0).get("MATERIALQUANTITY").toString());
bindMap.put("SITENAME", siteName); bindMap.put("SITENAME", siteName);
@ -1161,7 +1163,9 @@ public class InvoiceServiceImpl implements InvoiceService {
String updateSql= " UPDATE MATERIALSHIPREQUESTDETAIL m SET m.ASSIGNEDQUANTITY = m.ASSIGNEDQUANTITY - :QTY WHERE m.SITENAME = :SITENAME" String updateSql= " UPDATE MATERIALSHIPREQUESTDETAIL m SET m.ASSIGNEDQUANTITY = m.ASSIGNEDQUANTITY - :QTY WHERE m.SITENAME = :SITENAME"
+ " AND m.SHIPREQUESTNAME = :SHIPREQUESTNAME AND m.MATERIALSPECNAME = :MATERIALSPECNAME " + " AND m.SHIPREQUESTNAME = :SHIPREQUESTNAME AND m.MATERIALSPECNAME = :MATERIALSPECNAME "
+ "AND (:SDK_ID IS NULL OR SDK_ID = :SDK_ID) AND (:PHASE IS NULL OR PHASE = :PHASE) AND ROWNUM = 1 "; + "AND (:SDK_ID IS NULL OR SDK_ID = :SDK_ID) " +
// "AND (:PHASE IS NULL OR PHASE = :PHASE)" +
" AND ROWNUM = 1 ";
Map<String, Object> bindMap = new HashMap<String, Object>(); Map<String, Object> bindMap = new HashMap<String, Object>();
//bindMap.put("QTY", materialQuantity2); //bindMap.put("QTY", materialQuantity2);
bindMap.put("QTY", queryForList.get(0).get("MATERIALQUANTITY2").toString()); bindMap.put("QTY", queryForList.get(0).get("MATERIALQUANTITY2").toString());