Compare commits

...

2 Commits

7 changed files with 67 additions and 29 deletions

View File

@ -237,7 +237,7 @@ public class MESServiceImpl implements MESService{
} }
public Boolean OutMaterialInfoSend_NEW2(String shipRequestName, String siteName, String receiveActNo, String wo, public Boolean OutMaterialInfoSend_NEW2(String shipRequestName, String siteName, String receiveActNo, String wo,
String erpReceiveLocation,String erpReceiveFactory,List<String> boxList) throws CustomException{ String erpReceiveLocation,String erpReceiveFactory,List<String> boxList,String user) throws CustomException{
//根据单据获取要发送MES的信息 //根据单据获取要发送MES的信息
String sql="SELECT * from(\r\n" + String sql="SELECT * from(\r\n" +
@ -287,7 +287,7 @@ public class MESServiceImpl implements MESService{
// 写log // 写log
ErpMessageLog erplog = new ErpMessageLog(); ErpMessageLog erplog = new ErpMessageLog();
erplog.setEventUser(""); erplog.setEventUser(user);
erplog.setServerName("WmsToMES"); erplog.setServerName("WmsToMES");
erplog.setEventName("OutMaterialInfoSend"); erplog.setEventName("OutMaterialInfoSend");
erplog.setInterfaceTime(TimeStampUtil.getCurrentTime(TimeStampUtil.FORMAT_DEFAULT)); erplog.setInterfaceTime(TimeStampUtil.getCurrentTime(TimeStampUtil.FORMAT_DEFAULT));

View File

@ -4660,6 +4660,7 @@ public class ToSAPServiceImpl {
.append(" :AIMERPLOCATION AS UMLGO_RECIEVEERPLOCATION, ").append(SystemPropHelper.CR) .append(" :AIMERPLOCATION AS UMLGO_RECIEVEERPLOCATION, ").append(SystemPropHelper.CR)
.append(" MP.MATERIALQUANTITY , ").append(SystemPropHelper.CR) .append(" MP.MATERIALQUANTITY , ").append(SystemPropHelper.CR)
.append(" MP.UNIT, ").append(SystemPropHelper.CR) .append(" MP.UNIT, ").append(SystemPropHelper.CR)
.append(" MP.POCATEGORY, ").append(SystemPropHelper.CR)
.append(" MP.PACKINGGRADE, ").append(SystemPropHelper.CR) .append(" MP.PACKINGGRADE, ").append(SystemPropHelper.CR)
.append(" MP.LOCATIONNAME AS NULL_RECIVELOCAITONNAME ").append(SystemPropHelper.CR) .append(" MP.LOCATIONNAME AS NULL_RECIVELOCAITONNAME ").append(SystemPropHelper.CR)
.append(" FROM ").append(SystemPropHelper.CR) .append(" FROM ").append(SystemPropHelper.CR)
@ -4769,6 +4770,11 @@ public class ToSAPServiceImpl {
// //ZLLITEM 自定义领料单行号 // //ZLLITEM 自定义领料单行号
// item.put("ZLLITEM", mm.get("SHIPREQUESTDETAILNAME")); // item.put("ZLLITEM", mm.get("SHIPREQUESTDETAILNAME"));
// 如果是E库存的批次需要设置SOBKZ为E
if("4".equals(mm.get("POCATEGORY"))) {
item.put("SOBKZ", "E");
}
itemArray.add(item); itemArray.add(item);
} }

View File

@ -8,10 +8,7 @@ import com.cim.idm.framework.data.EventInfo;
import com.cim.idm.model.*; import com.cim.idm.model.*;
import com.cim.idm.model.po.MaterialReceiveRequest; import com.cim.idm.model.po.MaterialReceiveRequest;
import com.cim.idm.service.QueryService; import com.cim.idm.service.QueryService;
import com.cim.idm.utils.AjaxResult; import com.cim.idm.utils.*;
import com.cim.idm.utils.EventInfoUtil;
import com.cim.idm.utils.PageResult;
import com.cim.idm.utils.ToUpperUtils;
import com.cim.idm.wmsextend.generic.errorHandler.CustomException; import com.cim.idm.wmsextend.generic.errorHandler.CustomException;
import com.cim.idm.wmspackage.materialpacking.MaterialPackingServiceProxy; import com.cim.idm.wmspackage.materialpacking.MaterialPackingServiceProxy;
import com.cim.idm.wmspackage.materialpacking.management.data.MaterialPackingKey; import com.cim.idm.wmspackage.materialpacking.management.data.MaterialPackingKey;
@ -48,7 +45,7 @@ public class InvoiceController {
@Autowired @Autowired
private QueryService queryService; private QueryService queryService;
CommonUtils untils=new CommonUtils();
/******************************************************************************************************************************/ /******************************************************************************************************************************/
/*****************************************调拨入库单********************************************************************************/ /*****************************************调拨入库单********************************************************************************/
@ -1834,18 +1831,8 @@ public class InvoiceController {
List<Map<String, Object>> queryForList = IDMFrameServiceProxy.getSqlTemplate().queryForList(ressSql, hashMap); List<Map<String, Object>> queryForList = IDMFrameServiceProxy.getSqlTemplate().queryForList(ressSql, hashMap);
// 如果是需要判定E库存的话则进行判定 // 如果是需要判定E库存的话则进行判定
String EStockSql = "SELECT ENUMVALUE FROM ENUMDEFVALUE WHERE ENUMNAME = 'EStockType'"; queryForList = untils.checkEStore(queryForList, shipRequestName);
List<Map<String, Object>> EnumList = IDMFrameServiceProxy.getSqlTemplate().queryForList(EStockSql);
String enumvalue = EnumList.get(0).get("ENUMVALUE").toString();
if("Y".equals(enumvalue)) {
for (int i = 0; i < queryForList.size(); i++) {
String saleshiprequestname = queryForList.get(i).get("SALESHIPREQUESTNAME") == null ? "" : queryForList.get(i).get("SALESHIPREQUESTNAME").toString();
if(!saleshiprequestname.isEmpty() && !saleshiprequestname.equals(shipRequestName)) {
queryForList.remove(i);
}
}
}
return AjaxResult.me().setResultObj(queryForList); return AjaxResult.me().setResultObj(queryForList);
} }

View File

@ -159,7 +159,10 @@ public class PalletStockInAndOutController {
//List<com.cim.idm.wmspackage.materialpacking.management.data.MaterialPacking> selectByKey = MaterialPackingServiceProxy.getMaterialPackingService().selectByKey(mpkeyList); //List<com.cim.idm.wmspackage.materialpacking.management.data.MaterialPacking> selectByKey = MaterialPackingServiceProxy.getMaterialPackingService().selectByKey(mpkeyList);
// List<com.cim.idm.wmspackage.materialpacking.management.data.MaterialPacking> detail = palletDto.getDetail(); // List<com.cim.idm.wmspackage.materialpacking.management.data.MaterialPacking> detail = palletDto.getDetail();
ProductIntoServiceImpl.fgStockInNew(mpkeyList, user, ReceiveRequestActNo, commitDate, opCode);
// ProductIntoServiceImpl.fgStockInNew(mpkeyList, user, ReceiveRequestActNo, commitDate, opCode);
ProductIntoServiceImpl.fgStockInByManul(mpkeyList, user, ReceiveRequestActNo, commitDate, opCode);
// java.util.Calendar c = java.util.Calendar.getInstance(); // java.util.Calendar c = java.util.Calendar.getInstance();
// java.text.SimpleDateFormat f = new java.text.SimpleDateFormat( // java.text.SimpleDateFormat f = new java.text.SimpleDateFormat(

View File

@ -767,6 +767,7 @@ public class InvoiceServiceImpl implements InvoiceService {
bindMap.put("expiringDate", queryForList3.get(0).get("EXPIRINGDATE")); bindMap.put("expiringDate", queryForList3.get(0).get("EXPIRINGDATE"));
bindMap.put("ReceiveTime", queryForList3.get(0).get("RECEIVETIME")); bindMap.put("ReceiveTime", queryForList3.get(0).get("RECEIVETIME"));
bindMap.put("unit", queryForList3.get(0).get("UNIT")); bindMap.put("unit", queryForList3.get(0).get("UNIT"));
bindMap.put("CUSTOMNO", queryForList3.get(0).get("CUSTOMNO"));
bindMap.put("ReceiveUser", makeEventInfo.getEventUser()); bindMap.put("ReceiveUser", makeEventInfo.getEventUser());
bindMap.put("ErpLocation", erpLocation); bindMap.put("ErpLocation", erpLocation);
@ -2101,6 +2102,10 @@ public class InvoiceServiceImpl implements InvoiceService {
hashMap.put("SITENAME", "SDK"); hashMap.put("SITENAME", "SDK");
hashMap.put("SHIPREQUESTNAME", shiprequestname); hashMap.put("SHIPREQUESTNAME", shiprequestname);
List<Map<String, Object>> queryForList = IDMFrameServiceProxy.getSqlTemplate().queryForList(sql, hashMap); List<Map<String, Object>> queryForList = IDMFrameServiceProxy.getSqlTemplate().queryForList(sql, hashMap);
//如果是需要判定E库存的话则进行判定
queryForList = untils.checkEStore(queryForList, shiprequestname);
return queryForList; return queryForList;
}catch(Throwable e) { }catch(Throwable e) {
throw e; throw e;
@ -3258,8 +3263,15 @@ public class InvoiceServiceImpl implements InvoiceService {
} }
//记录到拆分表 //记录到拆分表
String subsql = "SELECT RECEIVEREQUESTDETAILNAME FROM MATERIALPACKINGSUB WHERE RECEIVEREQUESTNAME = :RECEIVEREQUESTNAME AND MATERIALPACKINGNAME = :MATERIALPACKINGNAME\n";
Map<String, Object> subHashMap = new HashMap<String, Object>();
subHashMap.put("RECEIVEREQUESTNAME", shipRequestName);
subHashMap.put("MATERIALPACKINGNAME", MATERIALPACKINGNAME);
List<Map<String, Object>> ZKqueryForList = IDMFrameServiceProxy.getSqlTemplate().queryForList(subsql, subHashMap);
String preReceiverequestdetailname = ZKqueryForList.get(0).get("RECEIVEREQUESTDETAILNAME").toString();
String shipRequestDetailName = qtyQueryForList.get(z).getShipRequestDetailName() == null ? "" : qtyQueryForList.get(z).getShipRequestDetailName().toString(); String shipRequestDetailName = qtyQueryForList.get(z).getShipRequestDetailName() == null ? "" : qtyQueryForList.get(z).getShipRequestDetailName().toString();
untils.fahuoSplit(newPalletNo, shipRequestName, shipRequestDetailName, bigQty2); untils.fahuoSplit(newPalletNo, shipRequestName, preReceiverequestdetailname, bigQty2);
// 原条码扣减拆出的数量用剩余数量更新原条码条码不变数量更新 // 原条码扣减拆出的数量用剩余数量更新原条码条码不变数量更新
SetEventInfo setEventInfo = new SetEventInfo(); SetEventInfo setEventInfo = new SetEventInfo();
@ -3347,15 +3359,15 @@ public class InvoiceServiceImpl implements InvoiceService {
hashMapZK.put("SHIPREQUESTNAME", shipRequestName); hashMapZK.put("SHIPREQUESTNAME", shipRequestName);
hashMapZK.put("SITENAME", siteName); hashMapZK.put("SITENAME", siteName);
List<Map<String, Object>> ZKqueryForList = IDMFrameServiceProxy.getSqlTemplate().queryForList(sqlZK.toString(), hashMapZK); List<Map<String, Object>> ZKqueryForList = IDMFrameServiceProxy.getSqlTemplate().queryForList(sqlZK.toString(), hashMapZK);
List<String> SUBList = new ArrayList<> ();
for (int z = 0; z < ZKqueryForList.size(); z++) { for (int z = 0; z < ZKqueryForList.size(); z++) {
String materialPackingName = ZKqueryForList.get(z).get("MATERIALPACKINGNAME").toString(); String materialPackingName = ZKqueryForList.get(z).get("MATERIALPACKINGNAME").toString();
materialPackingKeyList.add(materialPackingName); SUBList.add(materialPackingName);
MaterialPackingKey materialPackingKey = new MaterialPackingKey("SDK",materialPackingName); MaterialPackingKey materialPackingKey = new MaterialPackingKey("SDK",materialPackingName);
arrayList.add(materialPackingKey); arrayList.add(materialPackingKey);
} }
// billCode = UnSourcedChangeLocation(arrayList,ERPRECEIVEFACTORY, billCode = UnSourcedChangeLocation(arrayList,ERPRECEIVEFACTORY,
// ERPRECEIVELOCATION, "", eventUser, commitDate ); ERPRECEIVELOCATION, "", eventUser, commitDate );
List<MaterialPackingKey> mpKeyList = new ArrayList<MaterialPackingKey> (); List<MaterialPackingKey> mpKeyList = new ArrayList<MaterialPackingKey> ();
SetEventInfo setEventInfo = new SetEventInfo(); SetEventInfo setEventInfo = new SetEventInfo();
@ -3373,7 +3385,7 @@ public class InvoiceServiceImpl implements InvoiceService {
setEventInfo.setUserColumns(hashMapPack); setEventInfo.setUserColumns(hashMapPack);
MaterialPackingServiceProxy.getMaterialPackingService().setEvent(mpKeyList, makeEventInfo, setEventInfo); MaterialPackingServiceProxy.getMaterialPackingService().setEvent(mpKeyList, makeEventInfo, setEventInfo);
//抛送MES数据 //抛送MES数据
Boolean success = untils.sendMaterialInfoToMES_NEW2(shipRequestName, "", materialPackingKeyList,billCode,eventUser); Boolean success = untils.sendMaterialInfoToMES_NEW2(shipRequestName, "", SUBList,billCode,eventUser);
if (!success) { if (!success) {
String undo = cancelShipInter(billCode, eventUser); String undo = cancelShipInter(billCode, eventUser);

View File

@ -1030,6 +1030,7 @@ public class MaterialShipServiceImpl implements IMaterialShipService {
public String TransferStockOut_NLCC(String shipRequestName, String siteName, String user,List<String> boxList,String commitDate) throws Exception { public String TransferStockOut_NLCC(String shipRequestName, String siteName, String user,List<String> boxList,String commitDate) throws Exception {
String rcode; String rcode;
String undoId = ""; String undoId = "";
String key01 = "";
String rmsg = null; String rmsg = null;
String sql=" SELECT \r\n" + String sql=" SELECT \r\n" +
" count(*) AS ZROL, \r\n" + " count(*) AS ZROL, \r\n" +
@ -1140,15 +1141,21 @@ public class MaterialShipServiceImpl implements IMaterialShipService {
org.json.JSONObject returnJsonObject = (org.json.JSONObject) receiveJsonObject.get("RETURN"); org.json.JSONObject returnJsonObject = (org.json.JSONObject) receiveJsonObject.get("RETURN");
rcode = returnJsonObject.get("STATUS").toString(); rcode = returnJsonObject.get("STATUS").toString();
rmsg = returnJsonObject.get("MSGTXT").toString(); rmsg = returnJsonObject.get("MSGTXT").toString();
key01 = returnJsonObject.get("KEY01") == null ? "" : returnJsonObject.get("KEY01").toString(); // 返回单号后面用单号冲销
if ("S".equals(rcode)) { if ("S".equals(rcode)) {
if(key01.isEmpty()) {
undoId = "S"; undoId = "S";
}else {
undoId = key01;
}
} }
//将log写到表里 //将log写到表里
ErpMessageLog erplog = new ErpMessageLog(); ErpMessageLog erplog = new ErpMessageLog();
erplog.setEventUser(""); erplog.setEventUser("");
erplog.setServerName("WmsToErp"); erplog.setServerName("WmsToErp");
erplog.setEventName("调拨出库(NLCC)"); erplog.setEventName("辅材出库-调拨出库(NLCC)");
erplog.setInterfaceTime(TimeStampUtil.getCurrentTime(TimeStampUtil.FORMAT_DEFAULT)); erplog.setInterfaceTime(TimeStampUtil.getCurrentTime(TimeStampUtil.FORMAT_DEFAULT));
erplog.setMessageId(UUID.randomUUID().toString()); erplog.setMessageId(UUID.randomUUID().toString());
erplog.setSendMsg(sendData.toJSONString()); erplog.setSendMsg(sendData.toJSONString());

View File

@ -246,6 +246,29 @@ public class CommonUtils {
} }
} }
/**
* 检验是否是E库存,如果是E库存不显示并把过滤的数据返回
* @param queryForList
* @param shipRequestName
* @return
*/
public List<Map<String, Object>> checkEStore(List<Map<String, Object>> queryForList,String shipRequestName)
{
String EStockSql = "SELECT ENUMVALUE FROM ENUMDEFVALUE WHERE ENUMNAME = 'EStockType'";
List<Map<String, Object>> EnumList = IDMFrameServiceProxy.getSqlTemplate().queryForList(EStockSql);
String enumvalue = EnumList.get(0).get("ENUMVALUE").toString();
if("Y".equals(enumvalue)) {
for (int i = 0; i < queryForList.size(); i++) {
String saleshiprequestname = queryForList.get(i).get("SALESHIPREQUESTNAME") == null ? "" : queryForList.get(i).get("SALESHIPREQUESTNAME").toString();
if(!saleshiprequestname.isEmpty() && !saleshiprequestname.equals(shipRequestName)) {
queryForList.remove(i);
}
}
}
return queryForList;
}
/** /**
* 检验是否是否有组织权限 * 检验是否是否有组织权限
* @param password * @param password
@ -809,7 +832,7 @@ public void SaveUnDoInfo_ForSap(List<String> list, String undoid, EventInfo mak
// 调用MESServiceImpl的OutMaterialInfoSend_NEW方法发送物料信息到MES系统 // 调用MESServiceImpl的OutMaterialInfoSend_NEW方法发送物料信息到MES系统
success = mesService.OutMaterialInfoSend_NEW2(invoiceNo, "SDK", receiveActNo, "", success = mesService.OutMaterialInfoSend_NEW2(invoiceNo, "SDK", receiveActNo, "",
sr.get(0).get("ERPRECEIVELOCATION")==null?"":sr.get(0).get("ERPRECEIVELOCATION").toString() sr.get(0).get("ERPRECEIVELOCATION")==null?"":sr.get(0).get("ERPRECEIVELOCATION").toString()
,sr.get(0).get("ERPRECEIVEFACTORY")==null?"":sr.get(0).get("ERPRECEIVEFACTORY").toString(),boxList ); ,sr.get(0).get("ERPRECEIVEFACTORY")==null?"":sr.get(0).get("ERPRECEIVEFACTORY").toString(),boxList,user );
} }
} catch (CustomException e) { } catch (CustomException e) {