fix:修改超发

This commit is contained in:
郭飞 2025-04-27 10:01:05 +08:00
parent 51a4cbf46c
commit 8089a30fd1
13 changed files with 279 additions and 115 deletions

View File

@ -27,6 +27,11 @@ public class MaterialReceiveRequest extends FieldAccessor implements DataInfo<Ma
private String respPerson; private String respPerson;
private String respDepart; private String respDepart;
private Timestamp solveTime; private Timestamp solveTime;
private String stockOrgNo;
private String purOrgNo;
private Timestamp effectiveStartTime;
private Timestamp effectiveEndTime;
private Timestamp orderDate;
private String passState; private String passState;
private String shipRequestDec; private String shipRequestDec;
private String bezei; private String bezei;
@ -43,6 +48,8 @@ public class MaterialReceiveRequest extends FieldAccessor implements DataInfo<Ma
/** /**
* 2024.09.26 新增 * 2024.09.26 新增
*/ */
@ -299,4 +306,44 @@ public class MaterialReceiveRequest extends FieldAccessor implements DataInfo<Ma
public void setCarFlag(String carFlag) { public void setCarFlag(String carFlag) {
this.carFlag = carFlag; this.carFlag = carFlag;
} }
public String getStockOrgNo() {
return stockOrgNo;
}
public void setStockOrgNo(String stockOrgNo) {
this.stockOrgNo = stockOrgNo;
}
public String getPurOrgNo() {
return purOrgNo;
}
public void setPurOrgNo(String purOrgNo) {
this.purOrgNo = purOrgNo;
}
public Timestamp getEffectiveStartTime() {
return effectiveStartTime;
}
public void setEffectiveStartTime(Timestamp effectiveStartTime) {
this.effectiveStartTime = effectiveStartTime;
}
public Timestamp getEffectiveEndTime() {
return effectiveEndTime;
}
public void setEffectiveEndTime(Timestamp effectiveEndTime) {
this.effectiveEndTime = effectiveEndTime;
}
public Timestamp getOrderDate() {
return orderDate;
}
public void setOrderDate(Timestamp orderDate) {
this.orderDate = orderDate;
}
} }

View File

@ -150,7 +150,7 @@ public class MaterialShipRequestDetail extends FieldAccessor implements DataInfo
this.sobkz = sobkz; this.sobkz = sobkz;
} }
private String erpFactory;
@ -185,6 +185,8 @@ public class MaterialShipRequestDetail extends FieldAccessor implements DataInfo
private String workOrder; private String workOrder;
@UserColumnMark @UserColumnMark
private String supplierNO; private String supplierNO;
@UserColumnMark
private String erpFactory;
public String getSupplierNO() { public String getSupplierNO() {

View File

@ -70,12 +70,12 @@ public class QMSServiceImpl implements QMSService{
" S.SUPPLIERNO = T.SUPPLIERNAME \r\n" + " S.SUPPLIERNO = T.SUPPLIERNAME \r\n" +
"LEFT JOIN SDK_SPEC SS ON\r\n" + "LEFT JOIN SDK_SPEC SS ON\r\n" +
" SS.SDK_ID = T.SDK_ID\r\n" + " SS.SDK_ID = T.SDK_ID\r\n" +
" LEFT JOIN MATERIALSPEC m3 ON T.MATERIALSPECNAME = m3.MATERIALSPECNAME LEFT JOIN BS_ERPLOCATION BE ON M.ERPLOCATION = BE.ERPLOCATIONNAME \r\n" + " LEFT JOIN MATERIALSPEC m3 ON T.MATERIALSPECNAME = m3.MATERIALSPECNAME LEFT JOIN BS_MATERIALFACTORY bsy ON T.MATERIALSPECNAME = bsy.MATERIALSPECNAME AND T.ERPFACTORY = bsy.ERPFACTORY LEFT JOIN BS_ERPLOCATION BE ON M.ERPLOCATION = BE.ERPLOCATIONNAME \r\n" +
"WHERE\r\n" + "WHERE\r\n" +
" T.RECEIVEREQUESTNAME = :RECEIVEREQUESTNAME\r\n" + " T.RECEIVEREQUESTNAME = :RECEIVEREQUESTNAME\r\n" +
" AND T.SITENAME = :SITENAME\r\n" + " AND T.SITENAME = :SITENAME\r\n" +
" AND T.STOCKSTATE = 'Created' \r\n" + " AND T.STOCKSTATE = 'Created' \r\n" +
" AND m3.IQCFLAG = 'Y'\r\n" + " AND bsy.IQCFLAG = 'Y'\r\n" +
" GROUP BY T.SITENAME , BE.DESCRIPTION,\r\n" + " GROUP BY T.SITENAME , BE.DESCRIPTION,\r\n" +
" T.RECEIVEREQUESTNAME , \r\n" + " T.RECEIVEREQUESTNAME , \r\n" +
" TO_CHAR(T.RECEIVETIME ,'YYYY-MM-DD' ) ,\r\n" + " TO_CHAR(T.RECEIVETIME ,'YYYY-MM-DD' ) ,\r\n" +

View File

@ -13,8 +13,6 @@ import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients; import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils; import org.apache.http.util.EntityUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.io.BufferedReader; import java.io.BufferedReader;
@ -84,10 +82,10 @@ public class ToSAPMessageUtil {
// public static String DNUrl = "http://172.22.10.53:51000/RESTAdapter/sd023/api"; // public static String DNUrl = "http://172.22.10.53:51000/RESTAdapter/sd023/api";
// 内网地址 // 内网地址
public static String baseUrl = "http://172.22.10.53:51000/RESTAdapter/OAuthServer"; // 内网 private static String baseUrl = "http://172.22.10.53:52000/RESTAdapter/OAuthServer"; // 内网
public static String DNUrl = "http://172.22.10.53:51000/RESTAdapter/sd023/api";// 内网 // DN回传接口 public static String DNUrl = "http://172.22.10.53:52000/RESTAdapter/sd023/api";// 内网 // DN回传接口
public static String materialChangeLocationUrl = "http://172.22.10.53:51000/RESTAdapter/mm067/api"; // 货物移动接口 public static String materialChangeLocationUrl = "http://172.22.10.53:52000/RESTAdapter/mm067/api"; // 货物移动接口
public static String materilUndoUrl = "http://172.22.10.53:51000/RESTAdapter/mm068/api"; // 物料凭证冲销接口 public static String materilUndoUrl = "http://172.22.10.53:52000/RESTAdapter/mm068/api"; // 物料凭证冲销接口
// 外网地址 // 外网地址
// public static String baseUrl = "http://218.93.237.50:51000/RESTAdapter/OAuthServer"; // public static String baseUrl = "http://218.93.237.50:51000/RESTAdapter/OAuthServer";
@ -519,7 +517,7 @@ public class ToSAPMessageUtil {
log.info("*************************************************" ); log.info("*************************************************" );
log.info("******************开始发送******************" ); log.info("******************开始发送******************" );
// 调用业务接口需实时获取token // 调用业务接口需实时获取token
authStr = getAccessToken(baseUrl); authStr = getAccessToken(getBaseUrl());
CloseableHttpClient httpClient = HttpClients.createDefault(); CloseableHttpClient httpClient = HttpClients.createDefault();
HttpPost httpPost = new HttpPost(url); HttpPost httpPost = new HttpPost(url);
@ -545,7 +543,7 @@ public class ToSAPMessageUtil {
String grantType = "client_credentials"; String grantType = "client_credentials";
String clientId = "BC_WMS"; String clientId = "BC_WMS";
String clientSecret = "hkEU895glMWkZNvm0a_mFLZwHOhZ8CI-_JGbol44a7U"; String clientSecret = "vBkGIRyeuud0t8W79kGMV0lZHuBIj26duPFSR-vSLvg";
String scope = ""; String scope = "";
String clientAuth = "Send client credentials in body"; String clientAuth = "Send client credentials in body";
@ -597,4 +595,12 @@ public class ToSAPMessageUtil {
} }
return accessToken; return accessToken;
} }
public static String getBaseUrl() {
return baseUrl;
}
public static void setBaseUrl(String baseUrl) {
ToSAPMessageUtil.baseUrl = baseUrl;
}
} }

View File

@ -1867,8 +1867,8 @@ public class InvoiceController {
" AND t.MATERIALSPECNAME = :MATERIALSPECNAME\r\n" + " AND t.MATERIALSPECNAME = :MATERIALSPECNAME\r\n" +
" AND (:SDK_ID IS NULL\r\n" + " AND (:SDK_ID IS NULL\r\n" +
" OR t.SDK_ID = :SDK_ID)\r\n" + " OR t.SDK_ID = :SDK_ID)\r\n" +
" AND (:PHASE IS NULL\r\n" + // " AND (:PHASE IS NULL\r\n" +
" OR t.PHASE = :PHASE)\r\n" + // " OR t.PHASE = :PHASE)\r\n" +
" GROUP BY m.SHIPREQUESTTYPE ,\r\n" + " GROUP BY m.SHIPREQUESTTYPE ,\r\n" +
" m.SHIPREQUESTDETAILTYPE,\r\n" + " m.SHIPREQUESTDETAILTYPE,\r\n" +
" t.MATERIALSPECNAME,t.SDK_ID,t.PHASE\r\n" + " t.MATERIALSPECNAME,t.SDK_ID,t.PHASE\r\n" +
@ -1880,7 +1880,7 @@ public class InvoiceController {
hashMap.put("SHIPREQUESTNAME", shipRequestName); hashMap.put("SHIPREQUESTNAME", shipRequestName);
hashMap.put("MATERIALSPECNAME", materialSpecName); hashMap.put("MATERIALSPECNAME", materialSpecName);
hashMap.put("SDK_ID", sdk_id); hashMap.put("SDK_ID", sdk_id);
hashMap.put("PHASE", phase); // hashMap.put("PHASE", phase);
List<Map<String, Object>> queryForList = IDMFrameServiceProxy.getSqlTemplate().queryForList(sql, hashMap); List<Map<String, Object>> queryForList = IDMFrameServiceProxy.getSqlTemplate().queryForList(sql, hashMap);
if(Objects.isNull(queryForList) || queryForList.isEmpty()) { if(Objects.isNull(queryForList) || queryForList.isEmpty()) {
return AjaxResult.me().setSuccess(false).setMessage("未找到对应的数据!"); return AjaxResult.me().setSuccess(false).setMessage("未找到对应的数据!");
@ -1949,24 +1949,34 @@ public class InvoiceController {
com.cim.idm.wmspackage.materialpacking.management.data.MaterialPacking selectByKey = MaterialPackingServiceProxy.getMaterialPackingService().selectByKey(materialPackingKey); com.cim.idm.wmspackage.materialpacking.management.data.MaterialPacking selectByKey = MaterialPackingServiceProxy.getMaterialPackingService().selectByKey(materialPackingKey);
if ("Assign".equals(type)) { if ("Assign".equals(type)) {
System.out.println("4Y".equals(shipRequestType) + "*****************"); System.out.println("4Y".equals(shipRequestType) + "*****************");
if ("4Y".equals(shipRequestType)) {//调拨单 if ("NLCC".equals(shipRequestType)) {//调拨单
if ( "4Y-Cxx-03".equals(shipRequestDetailType)) { // if ( "4Y-Cxx-03".equals(shipRequestDetailType)) {
if (dy0 < 0) {//只能超发一个
return AjaxResult.me().setSuccess(false).setMessage("只能超发一个不能出库了!");
}
// }
} else if ("01".equals(shipRequestType) || "02".equals(shipRequestType)) {//领料
if (dy0 < 0) {//只能超发一个 if (dy0 < 0) {//只能超发一个
return AjaxResult.me().setSuccess(false).setMessage("只能超发一个不能出库了!"); return AjaxResult.me().setSuccess(false).setMessage("只能超发一个不能出库了!");
} }
} }
} else if ("BLSQ4K".equals(shipRequestType)) {//领料 // else if ("CKSQ4I".equals(shipRequestType)) { //其他出库
// if (dy0 < 0) {//只能超发一个
// return AjaxResult.me().setSuccess(false).setMessage("只能超发一个不能出库了!");
// }
// }
else if ("OEM".equals(shipRequestType)) { //委外出库
if (dy0 < 0) {//只能超发一个 if (dy0 < 0) {//只能超发一个
return AjaxResult.me().setSuccess(false).setMessage("只能超发一个不能出库了!"); return AjaxResult.me().setSuccess(false).setMessage("只能超发一个不能出库了!");
} }
} else if ("CKSQ4I".equals(shipRequestType)) { //其他出库 } else if (shipRequestType.contains("ZLF")) {
if (dy0 < 0) {//只能超发一个 if (dy0 < 0) {//只能超发一个
return AjaxResult.me().setSuccess(false).setMessage("只能超发一个不能出库了!");
}
} else if ("4C".equals(shipRequestType)) {
if (dy0 <= 0) {//只能超发一个
return AjaxResult.me().setSuccess(false).setMessage("销售不允许超发!"); return AjaxResult.me().setSuccess(false).setMessage("销售不允许超发!");
} }
} else if ("Z008".equals(shipRequestType)) {
if (dy0 < 0) {//只能超发一个
return AjaxResult.me().setSuccess(false).setMessage("采购退货不允许超发!");
}
}else { }else {
return AjaxResult.me().setSuccess(false).setMessage("单据类型不正确!"); return AjaxResult.me().setSuccess(false).setMessage("单据类型不正确!");
} }
@ -2292,24 +2302,35 @@ public class InvoiceController {
com.cim.idm.wmspackage.materialpacking.management.data.MaterialPacking selectByKey = MaterialPackingServiceProxy.getMaterialPackingService().selectByKey(materialPackingKey); com.cim.idm.wmspackage.materialpacking.management.data.MaterialPacking selectByKey = MaterialPackingServiceProxy.getMaterialPackingService().selectByKey(materialPackingKey);
if ("Assign".equals(type)) { if ("Assign".equals(type)) {
System.out.println("4Y".equals(shipRequestType) + "*****************"); System.out.println("4Y".equals(shipRequestType) + "*****************");
if ("4Y".equals(shipRequestType)) {//调拨单
if ( "4Y-Cxx-03".equals(shipRequestDetailType)) { if ("NLCC".equals(shipRequestType)) {//调拨单
// if ( "4Y-Cxx-03".equals(shipRequestDetailType)) {
if (dy0 < 0) {//只能超发一个
return AjaxResult.me().setSuccess(false).setMessage("只能超发一个不能出库了!");
}
// }
} else if ("01".equals(shipRequestType) || "02".equals(shipRequestType)) {//领料
if (dy0 < 0) {//只能超发一个 if (dy0 < 0) {//只能超发一个
return AjaxResult.me().setSuccess(false).setMessage("只能超发一个不能出库了!"); return AjaxResult.me().setSuccess(false).setMessage("只能超发一个不能出库了!");
} }
} }
} else if ("BLSQ4K".equals(shipRequestType)) {//领料 // else if ("CKSQ4I".equals(shipRequestType)) { //其他出库
// if (dy0 < 0) {//只能超发一个
// return AjaxResult.me().setSuccess(false).setMessage("只能超发一个不能出库了!");
// }
// }
else if ("OEM".equals(shipRequestType)) { //委外出库
if (dy0 < 0) {//只能超发一个 if (dy0 < 0) {//只能超发一个
return AjaxResult.me().setSuccess(false).setMessage("只能超发一个不能出库了!"); return AjaxResult.me().setSuccess(false).setMessage("只能超发一个不能出库了!");
} }
} else if ("CKSQ4I".equals(shipRequestType)) { //其他出库 } else if (shipRequestType.contains("ZLF")) {
if (dy0 < 0) {//只能超发一个
return AjaxResult.me().setSuccess(false).setMessage("只能超发一个不能出库了!");
}
} else if ("4C".equals(shipRequestType)) {
if (dy0 < 0) {//只能超发一个 if (dy0 < 0) {//只能超发一个
return AjaxResult.me().setSuccess(false).setMessage("销售不允许超发!"); return AjaxResult.me().setSuccess(false).setMessage("销售不允许超发!");
} }
} else if ("Z008".equals(shipRequestType)) {
if (dy0 < 0) {//只能超发一个
return AjaxResult.me().setSuccess(false).setMessage("采购退货不允许超发!");
}
}else { }else {
return AjaxResult.me().setSuccess(false).setMessage("单据类型不正确!"); return AjaxResult.me().setSuccess(false).setMessage("单据类型不正确!");
} }

View File

@ -280,7 +280,7 @@ public class PurchaseReturnController {
return AjaxResult.me().setSuccess(false).setMessage("只能超发一个不能出库了!"); return AjaxResult.me().setSuccess(false).setMessage("只能超发一个不能出库了!");
} }
// } // }
} else if ("01".equals(shipRequestType)) {//领料 } else if ("01".equals(shipRequestType) || "02".equals(shipRequestType)) {//领料
if (dy0 < 0) {//只能超发一个 if (dy0 < 0) {//只能超发一个
return AjaxResult.me().setSuccess(false).setMessage("只能超发一个不能出库了!"); return AjaxResult.me().setSuccess(false).setMessage("只能超发一个不能出库了!");
} }

View File

@ -482,15 +482,35 @@ public class QMSController {
mpList.add(new MaterialPackingKey(queryForList.get(j).get("SITENAME").toString(), mpList.add(new MaterialPackingKey(queryForList.get(j).get("SITENAME").toString(),
queryForList.get(j).get("MATERIALPACKINGNAME").toString())); queryForList.get(j).get("MATERIALPACKINGNAME").toString()));
success ++; success ++;
String qqAresults = queryForList.get(0).get("OQARESULT") == null ? "PREOQA" : queryForList.get(0).get("OQARESULT").toString();
if ("PREOQA".equals(qqAresults) && "OK".equals(pqcResult) || "PREOQA".equals(qqAresults) && "NG".equals(pqcResult)) {
sapBoxList.add( queryForList.get(0).get("MATERIALPACKINGNAME").toString());
}
} }
} else if (drkSqlList != null && drkSqlList.size() > 0) { } else if (drkSqlList != null && drkSqlList.size() > 0) {
String update = "UPDATE BS_MES_SHIPPED SET PACKINGGRADE = :PACKINGGRADE,IQCFLAG = 'Y' WHERE CHARGE = :BATCH AND PRODCUTSPECNAME = :MATERIALSPECNAME"; String update = "UPDATE BS_MES_SHIPPED SET PACKINGGRADE = :PACKINGGRADE,IQCFLAG = 'Y' WHERE CHARGE = :BATCH AND PRODCUTSPECNAME = :MATERIALSPECNAME";
hashMap.put("PACKINGGRADE", pqcResult); hashMap.put("PACKINGGRADE", pqcResult);
IDMFrameServiceProxy.getSqlTemplate().update(update, hashMap); IDMFrameServiceProxy.getSqlTemplate().update(update, hashMap);
String qqAresults = queryForList.get(0).get("OQARESULT") == null ? "PREOQA" : queryForList.get(0).get("OQARESULT").toString();
if ("PREOQA".equals(qqAresults) && "OK".equals(pqcResult) || "PREOQA".equals(qqAresults) && "NG".equals(pqcResult)) {
sapBoxList.add( queryForList.get(0).get("MATERIALPACKINGNAME").toString());
}
success ++; success ++;
} else { } else {
errorCode += commonNumber + "," + materialCode + ";"; errorCode += commonNumber + "," + materialCode + ";";
} }
// 将订单的质检结果传给SAP
if(sapBoxList.size() > 0) {
String undoId = toSAPService.iqcResultFeekback(sapBoxList,siteName,commonNumber,materialCode,pqcResult,pqcResultDate,user,
exceptionHandling,specialState);
}
if(mpList.size()>0)
{
setEventInfo2.setUserColumns(bindMap);
MaterialPackingServiceProxy.getMaterialPackingService().setEvent(mpList, eventInfo, setEventInfo2);
}
} else { } else {
result = AjaxResult.me().setResultObj(errorCode).setSuccess(false).setMessage("检验类型不存在" + tpType); result = AjaxResult.me().setResultObj(errorCode).setSuccess(false).setMessage("检验类型不存在" + tpType);
loginfo.setResultCode("E"); loginfo.setResultCode("E");

View File

@ -535,7 +535,7 @@ public class SAPToWMSController {
IDMFrameServiceProxy.getTransactionManager().beginTransaction(); IDMFrameServiceProxy.getTransactionManager().beginTransaction();
try { try {
ArrayList<Map<String,Object>> datas = request.getBODY(); ArrayList<Map<String,Object>> datas = request.getBODY();
String sitename = System.getProperty("company"); String sitename = "SDK";
for (Map<String, Object> data : datas) { for (Map<String, Object> data : datas) {
String receiveRequestName = MapUtils.getString(data, "EBELN"); // 采购订单号 String receiveRequestName = MapUtils.getString(data, "EBELN"); // 采购订单号
if(StringUtils.isEmpty(receiveRequestName)) { if(StringUtils.isEmpty(receiveRequestName)) {
@ -590,7 +590,7 @@ public class SAPToWMSController {
MaterialReceiveRequestServiceProxy.getMaterialReceiveRequestService().create(eventInfo, createInfo); MaterialReceiveRequestServiceProxy.getMaterialReceiveRequestService().create(eventInfo, createInfo);
MaterialReceiveRequestServiceImpl receiveRequestImpl = new MaterialReceiveRequestServiceImpl(); MaterialReceiveRequestServiceImpl receiveRequestImpl = new MaterialReceiveRequestServiceImpl();
receiveRequestImpl.createSupplier(supplierNo, supplierName, "", "", "", "", "", ""); // receiveRequestImpl.createSupplier(supplierNo, supplierName, "", "", "", "", "", "");
}else { }else {
SetEventInfo info = new SetEventInfo(); SetEventInfo info = new SetEventInfo();
@ -1092,8 +1092,8 @@ public class SAPToWMSController {
String shipRequestDetailName = MapUtils.getString(item, "ZITEM"); //单据行号 String shipRequestDetailName = MapUtils.getString(item, "ZITEM"); //单据行号
String reservedNumber = MapUtils.getString(item, "RSNUM"); // 预留编号 String reservedNumber = MapUtils.getString(item, "RSNUM"); // 预留编号
String reservedProjectNumb = MapUtils.getString(item, "RSPOS"); // 预留项目号 String reservedProjectNumb = MapUtils.getString(item, "RSPOS"); // 预留项目号
String receiveProductionOrderNumber =StringUtils.substring(MapUtils.getString(item, "AUFNR1"),4) ; // 接收生产订单编号 // String receiveProductionOrderNumber =StringUtils.substring(MapUtils.getString(item, "AUFNR1"),4) ; // 接收生产订单编号
String receiveProductionOrderNumber =MapUtils.getString(item, "AUFNR1"); // 接收生产订单编号
String issueProductionOrderNumber = MapUtils.getString(item, "AUFNR2"); // 发出生产订单编号 String issueProductionOrderNumber = MapUtils.getString(item, "AUFNR2"); // 发出生产订单编号
String combinationOrderNumber = MapUtils.getString(item, "AUFNR3"); // 组合订单编号 String combinationOrderNumber = MapUtils.getString(item, "AUFNR3"); // 组合订单编号
String productionSupervisor = MapUtils.getString(item, "FEVOR"); // 生产主管 String productionSupervisor = MapUtils.getString(item, "FEVOR"); // 生产主管

View File

@ -348,6 +348,40 @@ public class SaleOutController {
// return AjaxResult.me().setSuccess(false).setMessage("单据类型不正确!"); // return AjaxResult.me().setSuccess(false).setMessage("单据类型不正确!");
// } // }
if ("NLCC".equals(shipRequestType)) {//调拨单
// if ( "4Y-Cxx-03".equals(shipRequestDetailType)) {
if ((allQty.subtract(minusQty)).compareTo(minQty)>0) {//只能超发一个
return AjaxResult.me().setSuccess(false).setMessage("只能超发一个不能出库了!");
}
// }
} else if ("01".equals(shipRequestType) || "02".equals(shipRequestType)) {//领料
if ((allQty.subtract(minusQty)).compareTo(minQty)>0) {//只能超发一个
return AjaxResult.me().setSuccess(false).setMessage("只能超发一个不能出库了!");
}
}
// else if ("CKSQ4I".equals(shipRequestType)) { //其他出库
// if (dy0 < 0) {//只能超发一个
// return AjaxResult.me().setSuccess(false).setMessage("只能超发一个不能出库了!");
// }
// }
else if ("OEM".equals(shipRequestType)) { //委外出库
if ((allQty.subtract(minusQty)).compareTo(minQty)>0) {//只能超发一个
return AjaxResult.me().setSuccess(false).setMessage("只能超发一个不能出库了!");
}
} else if (shipRequestType.contains("ZLF")) {
if ((allQty.subtract(minusQty)).compareTo(minQty)>0) {//只能超发一个
return AjaxResult.me().setSuccess(false).setMessage("销售不允许超发!");
}
} else if ("Z008".equals(shipRequestType)) {
if ((allQty.subtract(minusQty)).compareTo(minQty)>0) {//只能超发一个
return AjaxResult.me().setSuccess(false).setMessage("采购退货不允许超发!");
}
}else {
return AjaxResult.me().setSuccess(false).setMessage("单据类型不正确!");
}
for(int i=0;i<boxList.size();i++) for(int i=0;i<boxList.size();i++)
{ {
@ -533,7 +567,7 @@ public class SaleOutController {
return AjaxResult.me().setSuccess(false).setMessage("只能超发一个不能出库了!"); return AjaxResult.me().setSuccess(false).setMessage("只能超发一个不能出库了!");
} }
// } // }
} else if ("01".equals(shipRequestType)) {//领料 } else if ("01".equals(shipRequestType) || "02".equals(shipRequestType)) {//领料
if (dy0 < 0) {//只能超发一个 if (dy0 < 0) {//只能超发一个
return AjaxResult.me().setSuccess(false).setMessage("只能超发一个不能出库了!"); return AjaxResult.me().setSuccess(false).setMessage("只能超发一个不能出库了!");
} }

View File

@ -96,12 +96,17 @@ public class UserController {
String userId = (String)param.get("userId"); String userId = (String)param.get("userId");
String userGroupNames = (String)param.get("userGroupNames"); String userGroupNames = (String)param.get("userGroupNames");
String sql1 = "UPDATE USERINFO SET USERGROUPNAME = ? WHERE USERID = ?"; // 获取组织
Object[] args1 = new Object[]{userGroupNames, userId}; String orgNos = (String)param.get("orgNo");
String sql1 = "UPDATE USERINFO SET USERGROUPNAME = ?, ORGNO = ? WHERE USERID = ?";
Object[] args1 = new Object[]{userGroupNames, orgNos, userId};
IDMFrameServiceProxy.getSqlTemplate().update(sql1, args1); IDMFrameServiceProxy.getSqlTemplate().update(sql1, args1);
List<String> usergroupList = Arrays.asList(userGroupNames.split(",")); List<String> usergroupList = Arrays.asList(userGroupNames.split(","));
List<String> orgNoList = Arrays.asList(orgNos.split(","));
String deleteSql = "DELETE FROM USERGROUPLINK WHERE USERID = ?"; String deleteSql = "DELETE FROM USERGROUPLINK WHERE USERID = ?";
IDMFrameServiceProxy.getSqlTemplate().update(deleteSql, userId); IDMFrameServiceProxy.getSqlTemplate().update(deleteSql, userId);
@ -111,6 +116,11 @@ public class UserController {
IDMFrameServiceProxy.getSqlTemplate().update(sql2, args2); IDMFrameServiceProxy.getSqlTemplate().update(sql2, args2);
} }
for(Object orgNo : orgNoList) {
String sql2 = "INSERT INTO USERGROUPLINK (ORGNO, USERID) " + "VALUES (?, ?)";
Object[] args2 = new Object[]{orgNo, userId};
IDMFrameServiceProxy.getSqlTemplate().update(sql2, args2);
}
BaseResponse returnOK = RespGenerator.returnOK(param); BaseResponse returnOK = RespGenerator.returnOK(param);
return returnOK; return returnOK;

View File

@ -392,64 +392,71 @@ public class InvoiceServiceImpl implements InvoiceService {
// 拆条码查询MATERIALQUANTITY MATERIALQUANTITY2是否相等如果相等则未修改了数量不相等则修改了数量 // 拆条码查询MATERIALQUANTITY MATERIALQUANTITY2是否相等如果相等则未修改了数量不相等则修改了数量
// 如果已修改数量则进行拆条码 // 如果已修改数量则进行拆条码
for (int z = 0; z < packingQueryForList.size(); z++) { // for (int z = 0; z < packingQueryForList.size(); z++) {
String MATERIALPACKINGNAME = packingQueryForList.get(z).get("MATERIALPACKINGNAME").toString(); // String MATERIALPACKINGNAME = packingQueryForList.get(z).get("MATERIALPACKINGNAME").toString();
Object[] bindSet = {MATERIALPACKINGNAME}; // Object[] bindSet = {MATERIALPACKINGNAME};
String qtysql = "WHERE MATERIALPACKINGNAME = ?"; // String qtysql = "WHERE MATERIALPACKINGNAME = ?";
List<MaterialPacking> qtyQueryForList = MaterialPackingServiceProxy.getMaterialPackingService().select(qtysql, bindSet); // List<MaterialPacking> qtyQueryForList = MaterialPackingServiceProxy.getMaterialPackingService().select(qtysql, bindSet);
//
String qty = String.valueOf(qtyQueryForList.get(z).getMaterialQuantity()); // String qty = String.valueOf(qtyQueryForList.get(z).getMaterialQuantity());
//
String qty2 = new Double(qtyQueryForList.get(z).getMaterialQuantity2()) == null ? "0" : String.valueOf(qtyQueryForList.get(z).getMaterialQuantity2()); // String qty2 = new Double(qtyQueryForList.get(z).getMaterialQuantity2()) == null ? "0" : String.valueOf(qtyQueryForList.get(z).getMaterialQuantity2());
String materialPackingName = qtyQueryForList.get(z).getMaterialPackingName(); // String materialPackingName = qtyQueryForList.get(z).getMaterialPackingName();
String charge = qtyQueryForList.get(z).getCharge(); // String charge = qtyQueryForList.get(z).getCharge();
BigDecimal bigQty = new BigDecimal(qty); // BigDecimal bigQty = new BigDecimal(qty);
// 已拆数量 // // 已拆数量
BigDecimal bigQty2 = new BigDecimal(qty2); // BigDecimal bigQty2 = new BigDecimal(qty2);
//
// 如果已拆数量不等于原数量并且已拆数量为0(未拆分数量) // // 如果已拆数量不等于原数量并且已拆数量为0(未拆分数量)
if(bigQty.compareTo(bigQty2) != 0 && !"0".equals(qty2)) { // if(bigQty.compareTo(bigQty2) != 0 && !"0".equals(qty2)) {
// 剩余数量 // // 剩余数量
BigDecimal restQty = bigQty.subtract(bigQty2); // BigDecimal restQty = bigQty.subtract(bigQty2);
//
// 生成新的拆分条码 // // 生成新的拆分条码
String stringBigQty2 = bigQty2.toString(); // String stringBigQty2 = bigQty2.toString();
String newPalletNo = CodeGenerator.packingGenerateCode(materialPackingName,stringBigQty2,charge); // String newPalletNo = CodeGenerator.packingGenerateCode(materialPackingName,stringBigQty2,charge);
//
// 写入拆分的新条码更新原数据库 // // 写入拆分的新条码更新原数据库
List<MaterialPacking> boxList = new ArrayList<MaterialPacking>(); // List<MaterialPacking> boxList = new ArrayList<MaterialPacking>();
// MaterialPackingKey materialpackingKey = new MaterialPackingKey(); //// MaterialPackingKey materialpackingKey = new MaterialPackingKey();
MaterialPacking materialpacking = new MaterialPacking(); // MaterialPacking materialpackingNew = new MaterialPacking();
// materialpackingKey.setSiteName("SDK"); //// materialpackingKey.setSiteName("SDK");
// materialpackingKey.setMaterialPackingName(newPalletNo); //// materialpackingKey.setMaterialPackingName(newPalletNo);
// materialpacking.setKey(materialpackingKey); //// materialpackingNew.setKey(materialpackingKey);
//
// 复制一个当前的原标签数据 // // 复制一个当前的原标签数据
MaterialPacking materialpackingNew = qtyQueryForList.get(z); // materialpackingNew.setKey(qtyQueryForList.get(z).getKey());
// 设置新为标签和数量 //// MaterialPacking materialpackingNew = qtyQueryForList.get(z);
materialpackingNew.setMaterialPackingName(newPalletNo); // // 设置新为标签和数量
// bigQty2 转double类型 // materialpackingNew.setMaterialPackingName(newPalletNo);
materialpackingNew.setMaterialQuantity(bigQty2.doubleValue()); // // bigQty2 转double类型
boxList.add(qtyQueryForList.get(z)); // materialpackingNew.setMaterialQuantity(bigQty2.doubleValue());
boxList.add(materialpackingNew); // boxList.add(qtyQueryForList.get(z));
boolean moveTransformOut = packingChargeSplit(boxList, eventUser); // boxList.add(materialpackingNew);
if (moveTransformOut != true) { // boolean moveTransformOut = packingChargeSplit(boxList, eventUser);
throw new RuntimeException("修改数量拆分失败"); // if (moveTransformOut != true) {
} // throw new RuntimeException("修改数量拆分失败");
// }
// 原条码扣减 //
SetEventInfo setEventInfo = new SetEventInfo(); // // 原条码扣减拆出的数量用剩余数量更新原条码条码不变数量更新
Map<String, Object> pakHashMap = new HashMap<>(); // SetEventInfo setEventInfo = new SetEventInfo();
pakHashMap.put("materialQuantity", restQty.doubleValue()); // Map<String, Object> pakHashMap = new HashMap<>();
// pakHashMap.put("materialQuantity", restQty.doubleValue());
EventInfo eventInfo = new EventInfoUtil().makeEventInfo("修改数量拆分条码", eventUser, "修改数量拆分条码"); //
setEventInfo.setUserColumns(pakHashMap); // EventInfo eventInfo = new EventInfoUtil().makeEventInfo("备货出库拆分修改数量拆分条码", eventUser, "修改数量拆分条码");
MaterialPackingServiceProxy.getMaterialPackingService().setEvent(new MaterialPackingKey( queryForList.get(z).get("SITENAME").toString(), // setEventInfo.setUserColumns(pakHashMap);
queryForList.get(z).get("MATERIALPACKINGNAME").toString()), eventInfo, setEventInfo); // MaterialPackingServiceProxy.getMaterialPackingService().setEvent(new MaterialPackingKey( queryForList.get(z).get("SITENAME").toString(),
// queryForList.get(z).get("MATERIALPACKINGNAME").toString()), eventInfo, setEventInfo);
} //
// // 删除被拆分的原条码数据用拆分出的新条码覆盖进行后面的过账现场仓过账只过账已拆分出的数量剩余数量的原条码不过账
} // boolean deletePacking = materialPackingKeyList.remove(MATERIALPACKINGNAME);
// if (deletePacking) {
// materialPackingKeyList.add(newPalletNo);
// }
//
// }
//
// }
//new MESServiceImpl().NeedReceiveMaterialInfoSend_NEW(shipRequestName, "SDK", materialPackingKeyList); //new MESServiceImpl().NeedReceiveMaterialInfoSend_NEW(shipRequestName, "SDK", materialPackingKeyList);
@ -601,14 +608,14 @@ public class InvoiceServiceImpl implements InvoiceService {
String condition=""; String condition="";
String newBoxId1 = boxList.get(1).getMaterialPackingName(); String newBoxId1 = boxList.get(1).getMaterialPackingName();
// String pc = "('" + materialpackingname + "')"; // String pc = "('" + materialpackingname + "')";
String sql = "SELECT 1 FROM MATERIALPACKING WHERE MATERIALPACKINGNAME IN (:MATERIALPACKINGNAME1, :MATERIALPACKINGNAME2)"; String sql = "SELECT 1 FROM MATERIALPACKING WHERE MATERIALPACKINGNAME IN (:MATERIALPACKINGNAME1)";
Map<String, Object> hashMap2 = new HashMap<String,Object> (); Map<String, Object> hashMap2 = new HashMap<String,Object> ();
hashMap2.put("MATERIALPACKINGNAME1", newBoxId1); hashMap2.put("MATERIALPACKINGNAME1", newBoxId1);
List<Map<String, Object>> queryForList = IDMFrameServiceProxy.getSqlTemplate().queryForList(sql, hashMap2); List<Map<String, Object>> queryForList = IDMFrameServiceProxy.getSqlTemplate().queryForList(sql, hashMap2);
List<MaterialPacking> MaterialPackingList = null; List<MaterialPacking> MaterialPackingList = null;
if (queryForList != null && queryForList.size() > 0) { if (queryForList != null && queryForList.size() > 0) {
String[] bindSet={newBoxId1}; String[] bindSet={newBoxId1};
condition="WHERE MATERIALPACKINGNAME IN (?,?)"; condition="WHERE MATERIALPACKINGNAME IN (?)";
MaterialPackingList = MaterialPackingServiceProxy.getMaterialPackingService().select(condition, bindSet); MaterialPackingList = MaterialPackingServiceProxy.getMaterialPackingService().select(condition, bindSet);
} }
//解析条码,根据远条码信息更新目标条码数量和库存状态 //解析条码,根据远条码信息更新目标条码数量和库存状态
@ -651,10 +658,12 @@ public class InvoiceServiceImpl implements InvoiceService {
String RECEIVEREQUESTNAME = ""; String RECEIVEREQUESTNAME = "";
String RECEIVEREQUESTDETAILNAME = ""; String RECEIVEREQUESTDETAILNAME = "";
String REMARK = ""; String REMARK = "";
String SHIPREQUESTNAME = "";
String SHIPREQUESTDETAILNAME = "";
String ypcSql = "SELECT M.RECEIVETIME,M.MAKEDATE,M.EXPIRINGDATE,M.HOLDSTATE,M.OQARESULTSTATE ,\r\n" + String ypcSql = "SELECT M.RECEIVETIME,M.MAKEDATE,M.EXPIRINGDATE,M.HOLDSTATE,M.OQARESULTSTATE ,\r\n" +
" M.OQARESULT ,M.PACKINGGRADE ,M.TRUEGG ,M.ERPFACTORY ,M.ERPLOCATION ,M.LOCATIONNAME ,\r\n" + " M.OQARESULT ,M.PACKINGGRADE ,M.TRUEGG ,M.ERPFACTORY ,M.ERPLOCATION ,M.LOCATIONNAME ,\r\n" +
" M.SHELFNAME ,M.AREANAME ,M.DURABLENAME ,M.CAREER_ASSISTANCE ,M.SALESPERSON ,M.CUSTOMNO,M.SDK_ID,M.PHASE,M.RECEIVEREQUESTNAME,M.RECEIVEREQUESTDETAILNAME," " M.SHELFNAME ,M.AREANAME ,M.DURABLENAME ,M.CAREER_ASSISTANCE ,M.SALESPERSON ,M.CUSTOMNO,M.SDK_ID,M.PHASE,M.SHIPREQUESTNAME,M.SHIPREQUESTDETAILNAME,M.RECEIVEREQUESTNAME,M.RECEIVEREQUESTDETAILNAME,"
+ " M.DEVIATION ,M.DIAMETER ,M.WIDTH ,M.WEIGHT ,M.PRODUCTLINE,UNIT ,MJPC,BUSINESS_UNIT,M.MATERIALSPECNAME, M.SUBPACKINGQUANTITY, M.MATERIALCREATEQUANTITY, M.MATERIALQUANTITY, M.CHARGE, M.REMARK" + + " M.DEVIATION ,M.DIAMETER ,M.WIDTH ,M.WEIGHT ,M.PRODUCTLINE,UNIT ,MJPC,BUSINESS_UNIT,M.MATERIALSPECNAME, M.SUBPACKINGQUANTITY, M.MATERIALCREATEQUANTITY, M.MATERIALQUANTITY, M.CHARGE, M.REMARK" +
" FROM MATERIALPACKING M WHERE M.MATERIALPACKINGNAME = :MATERIALPACKINGNAME AND M.CHARGE = :CHARGE "; " FROM MATERIALPACKING M WHERE M.MATERIALPACKINGNAME = :MATERIALPACKINGNAME AND M.CHARGE = :CHARGE ";
Map<String, Object> hashMap4 = new HashMap<String,Object> (); Map<String, Object> hashMap4 = new HashMap<String,Object> ();
@ -693,6 +702,8 @@ public class InvoiceServiceImpl implements InvoiceService {
SDK_ID = map.get("SDK_ID") == null ? "" : map.get("SDK_ID").toString(); SDK_ID = map.get("SDK_ID") == null ? "" : map.get("SDK_ID").toString();
PHASE = map.get("PHASE") == null ? "" : map.get("PHASE").toString(); PHASE = map.get("PHASE") == null ? "" : map.get("PHASE").toString();
REMARK = map.get("REMARK") == null ? "" : map.get("REMARK").toString(); REMARK = map.get("REMARK") == null ? "" : map.get("REMARK").toString();
SHIPREQUESTNAME = map.get("SHIPREQUESTNAME") == null ? "" : map.get("SHIPREQUESTNAME").toString();
SHIPREQUESTDETAILNAME = map.get("SHIPREQUESTDETAILNAME") == null ? "" : map.get("SHIPREQUESTDETAILNAME").toString();
} }
@ -737,6 +748,10 @@ public class InvoiceServiceImpl implements InvoiceService {
bindMap.put("SDK_ID", SDK_ID); bindMap.put("SDK_ID", SDK_ID);
bindMap.put("PHASE", PHASE); bindMap.put("PHASE", PHASE);
bindMap.put("remark", REMARK); bindMap.put("remark", REMARK);
bindMap.put("shipRequestName", SHIPREQUESTNAME);
bindMap.put("shipRequestDetailName",SHIPREQUESTDETAILNAME);
bindMap.put("ReceiveRequestName", RECEIVEREQUESTNAME); bindMap.put("ReceiveRequestName", RECEIVEREQUESTNAME);
bindMap.put("ReceiveRequestDetailName",RECEIVEREQUESTDETAILNAME); bindMap.put("ReceiveRequestDetailName",RECEIVEREQUESTDETAILNAME);

View File

@ -333,6 +333,14 @@ public class ProductIntoServiceImpl implements FGStockInService {
//封装为Json的字符串 //封装为Json的字符串
String json = JSON.toJSONString(fgStockInInfo); String json = JSON.toJSONString(fgStockInInfo);
undoID = toSAPService.FGStockInByManulIn(json, user); undoID = toSAPService.FGStockInByManulIn(json, user);
// String pc = "(";
// for (MaterialPacking materialPacking : boxList) {
// String materialPackingName = materialPacking.getMaterialPackingName();
// pc += "'" + materialPackingName + "', ";
// }
// pc += "'')";
// undoID = toSAPService.FGStockIn(pc, user, commitDate, opCode);
//更新物料凭证和库存状态 //更新物料凭证和库存状态
toSapDao.updateStockState(boxList, "Stocked", undoID, user); toSapDao.updateStockState(boxList, "Stocked", undoID, user);
} }

View File

@ -670,7 +670,8 @@ public class ReturnStockIntoServiceImpl implements ReturnStockInService {
hashMap2.put("LOTNAME", map.get("MATERIALPACKINGNAME").toString()); hashMap2.put("LOTNAME", map.get("MATERIALPACKINGNAME").toString());
IDMFrameServiceProxy.getSqlTemplate().update(sql2, hashMap2); IDMFrameServiceProxy.getSqlTemplate().update(sql2, hashMap2);
chargeList.add(map.get("CHARGE").toString()); // 二维码唯一使用二维码
chargeList.add(map.get("MATERIALPACKINGNAME").toString());
} }
SaveUnDoInfo(billCode, commitDate); SaveUnDoInfo(billCode, commitDate);
@ -679,7 +680,7 @@ public class ReturnStockIntoServiceImpl implements ReturnStockInService {
JSONObject requestBodyMap = new JSONObject(); JSONObject requestBodyMap = new JSONObject();
requestBodyMap.append("chargeList", chargeList); requestBodyMap.append("chargeList", chargeList);
String requestBody = requestBodyMap.toString(); String requestBody = requestBodyMap.toString();
// String httpPost = mesHttpUtil.httpPost(baseUrl + "/wms/wmsMaterialDelete ", requestBody); // String httpPost = mesHttpUtil.httpPost(baseUrl + "/wms/wmsMaterialDelete", requestBody);
// System.out.println(httpPost); // System.out.println(httpPost);
// org.json.JSONObject receiveJsonObject = new org.json.JSONObject(httpPost); // org.json.JSONObject receiveJsonObject = new org.json.JSONObject(httpPost);
// String code = receiveJsonObject.getString("code"); // String code = receiveJsonObject.getString("code");