Compare commits
2 Commits
88a5582996
...
dfdabe510a
Author | SHA1 | Date | |
---|---|---|---|
dfdabe510a | |||
325830f571 |
@ -87,6 +87,18 @@ public class MaterialShipRequest extends FieldAccessor implements DataInfo<Mater
|
||||
private String specialFlag;
|
||||
private String specialComment;
|
||||
|
||||
private String customName;
|
||||
private String customerArea;
|
||||
private String customerOrder;
|
||||
private String bezei;
|
||||
private String shipRequestDec;
|
||||
private String deliveryAddress;
|
||||
private String deliveryRemark;
|
||||
private String carFlag;
|
||||
private String orderDateStr;
|
||||
private String planDate;
|
||||
private Timestamp orderDate;
|
||||
|
||||
public String getDestination() {
|
||||
return destination;
|
||||
}
|
||||
@ -326,4 +338,92 @@ public class MaterialShipRequest extends FieldAccessor implements DataInfo<Mater
|
||||
public void setAreaName(String areaName) {
|
||||
this.areaName = areaName;
|
||||
}
|
||||
|
||||
public String getCustomName() {
|
||||
return customName;
|
||||
}
|
||||
|
||||
public void setCustomName(String customName) {
|
||||
this.customName = customName;
|
||||
}
|
||||
|
||||
public String getCustomerArea() {
|
||||
return customerArea;
|
||||
}
|
||||
|
||||
public void setCustomerArea(String customerArea) {
|
||||
this.customerArea = customerArea;
|
||||
}
|
||||
|
||||
public String getCustomerOrder() {
|
||||
return customerOrder;
|
||||
}
|
||||
|
||||
public void setCustomerOrder(String customerOrder) {
|
||||
this.customerOrder = customerOrder;
|
||||
}
|
||||
|
||||
public String getBezei() {
|
||||
return bezei;
|
||||
}
|
||||
|
||||
public void setBezei(String bezei) {
|
||||
this.bezei = bezei;
|
||||
}
|
||||
|
||||
public String getShipRequestDec() {
|
||||
return shipRequestDec;
|
||||
}
|
||||
|
||||
public void setShipRequestDec(String shipRequestDec) {
|
||||
this.shipRequestDec = shipRequestDec;
|
||||
}
|
||||
|
||||
public String getDeliveryAddress() {
|
||||
return deliveryAddress;
|
||||
}
|
||||
|
||||
public void setDeliveryAddress(String deliveryAddress) {
|
||||
this.deliveryAddress = deliveryAddress;
|
||||
}
|
||||
|
||||
public String getDeliveryRemark() {
|
||||
return deliveryRemark;
|
||||
}
|
||||
|
||||
public void setDeliveryRemark(String deliveryRemark) {
|
||||
this.deliveryRemark = deliveryRemark;
|
||||
}
|
||||
|
||||
public String getCarFlag() {
|
||||
return carFlag;
|
||||
}
|
||||
|
||||
public void setCarFlag(String carFlag) {
|
||||
this.carFlag = carFlag;
|
||||
}
|
||||
|
||||
public String getOrderDateStr() {
|
||||
return orderDateStr;
|
||||
}
|
||||
|
||||
public void setOrderDateStr(String orderDateStr) {
|
||||
this.orderDateStr = orderDateStr;
|
||||
}
|
||||
|
||||
public String getPlanDate() {
|
||||
return planDate;
|
||||
}
|
||||
|
||||
public void setPlanDate(String planDate) {
|
||||
this.planDate = planDate;
|
||||
}
|
||||
|
||||
public Timestamp getOrderDate() {
|
||||
return orderDate;
|
||||
}
|
||||
|
||||
public void setOrderDate(Timestamp orderDate) {
|
||||
this.orderDate = orderDate;
|
||||
}
|
||||
}
|
||||
|
@ -188,6 +188,17 @@ public class MaterialShipRequestDetail extends FieldAccessor implements DataInfo
|
||||
@UserColumnMark
|
||||
private String erpFactory;
|
||||
|
||||
public String getSaleOutQuantity() {
|
||||
return saleOutQuantity;
|
||||
}
|
||||
|
||||
public void setSaleOutQuantity(String saleOutQuantity) {
|
||||
this.saleOutQuantity = saleOutQuantity;
|
||||
}
|
||||
|
||||
@UserColumnMark
|
||||
private String saleOutQuantity;
|
||||
|
||||
|
||||
public String getSupplierNO() {
|
||||
return supplierNO;
|
||||
|
@ -596,7 +596,7 @@ public class MESServiceImpl implements MESService{
|
||||
jsonObject.put("userId", list.get(i).get("LASTEVENTUSER"));
|
||||
jsonObject.put("conversionScale", list.get(i).get("CONVERSIONSCALE"));
|
||||
jsonObject.put("fdescription", list.get(i).get("REMARK"));
|
||||
jsonObject.put("shipType", list.get(i).get("SHIPREQUESTDETAILTYPE"));
|
||||
jsonObject.put("shipType", list.get(i).get("SHIPREQUESTTYPE"));
|
||||
jsonObject.put("shipRequestType", list.get(i).get("SHIPREQUESTTYPE"));
|
||||
jsonObject.put("shipRequestName", shipRequestName);
|
||||
jsonObject.put("gxId", list.get(i).get("GXID"));
|
||||
|
@ -4631,7 +4631,7 @@ public class ToSAPServiceImpl {
|
||||
public String autoTurnWareAndQms(List<MaterialPackingKey> all,
|
||||
String aimERPlocation,
|
||||
String user,
|
||||
String pqcResult) throws Exception {
|
||||
String pqcResult, String commitDate) throws Exception {
|
||||
String rcode;
|
||||
String undoId = "";
|
||||
String rmsg = null;
|
||||
@ -4665,6 +4665,26 @@ public class ToSAPServiceImpl {
|
||||
if (queryForList == null || queryForList.size() < 1) {
|
||||
return "";
|
||||
}
|
||||
|
||||
String outputDate = "";
|
||||
try {
|
||||
|
||||
if(commitDate.contains("-")) {
|
||||
SimpleDateFormat inputFormat = new SimpleDateFormat("yyyy-MM-dd");
|
||||
SimpleDateFormat outputFormat = new SimpleDateFormat("yyyyMMdd");
|
||||
Date date = inputFormat.parse(commitDate);
|
||||
outputDate = outputFormat.format(date);
|
||||
}else {
|
||||
outputDate = commitDate;
|
||||
}
|
||||
} catch (IllegalArgumentException e) {
|
||||
log.error("commitDate 参数无效: " + e.getMessage(), e);
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
log.error("日期解析失败: " + e.getMessage(), e);
|
||||
throw new RuntimeException("日期解析失败,请检查 commitDate 格式是否为 yyyy-MM-dd", e);
|
||||
}
|
||||
|
||||
try {
|
||||
|
||||
JSONObject sendData = new JSONObject(true);
|
||||
@ -4690,10 +4710,11 @@ public class ToSAPServiceImpl {
|
||||
*/
|
||||
body.put("ITEM", itemArray);
|
||||
body.put("ITEMID", uniqueID);
|
||||
|
||||
//过账日期
|
||||
body.put("BUDAT", TimeStampUtil.getCurrentTime("yyyyMMdd"));
|
||||
body.put("BUDAT", outputDate);
|
||||
//凭证日期
|
||||
body.put("BLDAT", TimeStampUtil.getCurrentTime("yyyyMMdd"));
|
||||
body.put("BLDAT", outputDate);
|
||||
//凭证抬头文本
|
||||
body.put("BKTXT", uniqueID);
|
||||
//用户名
|
||||
@ -5476,8 +5497,8 @@ public class ToSAPServiceImpl {
|
||||
itemData.add(item);
|
||||
|
||||
}
|
||||
|
||||
String sendData = ToSAPMessageUtil.mm067(user, bodyData, itemData,TimeStampUtil.getCurrentTime("yyyyMMdd"));
|
||||
// TimeStampUtil.getCurrentTime("yyyyMMdd")
|
||||
String sendData = ToSAPMessageUtil.mm067(user, bodyData, itemData,"2025-04-30");
|
||||
|
||||
String sapreturn = toSAPMessageUtil.sendHttpPost(toSAPMessageUtil.materialChangeLocationUrl,"",sendData);
|
||||
org.json.JSONObject receiveJsonObject = new org.json.JSONObject(sapreturn);
|
||||
|
@ -256,10 +256,12 @@ public class NoChargeStockIn {
|
||||
if (ReceiveTypeEnums.isPurchase(request.getReceiveRequestType())) {
|
||||
Map<String,Object> args = new HashMap<>();
|
||||
billcode = toSAPServiceImpl.PurStockIn(request.getReceiveRequestName(), siteName, user, args,commitDate);
|
||||
}else {
|
||||
|
||||
}
|
||||
// @TODO 其他类型
|
||||
if (billcode == null || "".equals(billcode)) {
|
||||
return AjaxResult.me().setErrorCode(500).setSuccess(false).setMessage("NC过账失败");
|
||||
return AjaxResult.me().setErrorCode(500).setSuccess(false).setMessage("SAP过账失败");
|
||||
}
|
||||
//8、更新物料凭证
|
||||
SDKMP.updateUndoID(receiveAct,makeEventInfo,billcode);
|
||||
|
@ -978,9 +978,9 @@ public class QMSController {
|
||||
MpKeyList.add(mpkey);
|
||||
}
|
||||
|
||||
String commitDate=TimeStampUtil.getCurrentTime("yyyy-MM-dd") + " 00:00:00";
|
||||
// String commitDate=TimeStampUtil.getCurrentTime("yyyy-MM-dd");
|
||||
UUID uuid = UUID.randomUUID();
|
||||
billCode = toSAPService.autoTurnWareAndQms(MpKeyList,ERPLOCATION,user,pqcResult);
|
||||
billCode = toSAPService.autoTurnWareAndQms(MpKeyList,ERPLOCATION,user,pqcResult,"2025-04-30");
|
||||
|
||||
// }else {
|
||||
// billCode = NCWServiceImpl.OQZkNoInvoice(LocationBoxList, sendUser);
|
||||
|
@ -567,28 +567,28 @@ public class SAPToWMSController {
|
||||
selectMap.put("receiverequestname", receiveRequestName);
|
||||
List<Map<String, Object>> isResultList = IDMFrameServiceProxy.getSqlTemplate().queryForList(sqlCheck, selectMap);
|
||||
// 检验单据是否已存在,并且未被使用过账
|
||||
String isSql = "SELECT\n" +
|
||||
"m.RECEIVEREQUESTNAME,\n" +
|
||||
"SUM(md.RECEIVEDQUANTITY)\n" +
|
||||
"FROM\n" +
|
||||
"MATERIALRECEIVEREQUEST m\n" +
|
||||
"LEFT JOIN MATERIALRECEIVEREQUESTDETAIL md ON\n" +
|
||||
"md.RECEIVEREQUESTNAME = m.RECEIVEREQUESTNAME\n" +
|
||||
"WHERE\n" +
|
||||
"m.RECEIVEREQUESTNAME =:receiverequestname\n" +
|
||||
"AND md.RECEIVEDQUANTITY > 0\n" +
|
||||
"GROUP BY m.RECEIVEREQUESTNAME";
|
||||
// String isSql = "SELECT\n" +
|
||||
// "m.RECEIVEREQUESTNAME,\n" +
|
||||
// "SUM(md.RECEIVEDQUANTITY)\n" +
|
||||
// "FROM\n" +
|
||||
// "MATERIALRECEIVEREQUEST m\n" +
|
||||
// "LEFT JOIN MATERIALRECEIVEREQUESTDETAIL md ON\n" +
|
||||
// "md.RECEIVEREQUESTNAME = m.RECEIVEREQUESTNAME\n" +
|
||||
// "WHERE\n" +
|
||||
// "m.RECEIVEREQUESTNAME =:receiverequestname\n" +
|
||||
// "AND md.RECEIVEDQUANTITY > 0\n" +
|
||||
// "GROUP BY m.RECEIVEREQUESTNAME";
|
||||
|
||||
List<Map<String, Object>> isList = IDMFrameServiceProxy.getSqlTemplate().queryForList(isSql, selectMap);
|
||||
if (isList != null && isList.size() > 0) {
|
||||
throw new CustomException("ERROR","单据已存在,并且已存在过账,不能更新或删除!");
|
||||
}else if(isResultList != null && isResultList.size() > 0) {
|
||||
String shipquestSql="DELETE FROM MATERIALRECEIVEREQUEST WHERE receiveRequestName =?";
|
||||
String shipDetailSql="DELETE FROM MATERIALRECEIVEREQUESTDETAIL WHERE receiveRequestName =?";
|
||||
Object[] obj=new Object[] {receiveRequestName};
|
||||
IDMFrameServiceProxy.getSqlTemplate().update(shipquestSql, obj);
|
||||
IDMFrameServiceProxy.getSqlTemplate().update(shipDetailSql, obj);
|
||||
}
|
||||
// List<Map<String, Object>> isList = IDMFrameServiceProxy.getSqlTemplate().queryForList(isSql, selectMap);
|
||||
// if (isList != null && isList.size() > 0) {
|
||||
// throw new CustomException("ERROR","单据已存在,并且已存在过账,不能更新或删除!");
|
||||
// }else if(isResultList != null && isResultList.size() > 0) {
|
||||
// String shipquestSql="DELETE FROM MATERIALRECEIVEREQUEST WHERE receiveRequestName =?";
|
||||
// String shipDetailSql="DELETE FROM MATERIALRECEIVEREQUESTDETAIL WHERE receiveRequestName =?";
|
||||
// Object[] obj=new Object[] {receiveRequestName};
|
||||
// IDMFrameServiceProxy.getSqlTemplate().update(shipquestSql, obj);
|
||||
// IDMFrameServiceProxy.getSqlTemplate().update(shipDetailSql, obj);
|
||||
// }
|
||||
|
||||
List<Map<String, Object>> checkResultList = IDMFrameServiceProxy.getSqlTemplate().queryForList(sqlCheck, selectMap);
|
||||
|
||||
@ -1076,10 +1076,30 @@ public class SAPToWMSController {
|
||||
String createDate = MapUtils.getString(data, "CRDAT"); // 创建日期
|
||||
String createTime = MapUtils.getString(data, "CRTIM"); // 创建时间
|
||||
String moveState = MapUtils.getString(data, "BWART"); //移动类型 BWART
|
||||
String areaName = MapUtils.getString(data, "AREANAME"); //车间
|
||||
String sqlCheck =" SELECT * FROM materialshiprequest m WHERE shiprequestname =:SHIPREQUESTNAME ";
|
||||
String areaName = MapUtils.getString(data, "FEVOR"); //车间
|
||||
|
||||
List<Map<String, Object>> checkResultList1 = new ArrayList<>();
|
||||
List<Map<String, Object>> checkResultList2 = new ArrayList<>();
|
||||
|
||||
Map<String, Object> selectMap= new HashMap<String, Object>();
|
||||
selectMap.put("SHIPREQUESTNAME", shipRequestName);
|
||||
|
||||
// 如果是成品中心退货
|
||||
if("07".equals(shipRequestType) || "03".equals(shipRequestType)) {
|
||||
String sqlCheck =" SELECT * FROM MATERIALRECEIVEREQUEST m WHERE RECEIVEREQUESTNAME =:SHIPREQUESTNAME ";
|
||||
checkResultList1 = IDMFrameServiceProxy.getSqlTemplate().queryForList(sqlCheck, selectMap);
|
||||
|
||||
if(checkResultList1 != null && checkResultList1.size() > 0) {
|
||||
String sql="DELETE FROM MATERIALRECEIVEREQUEST WHERE RECEIVEREQUESTNAME =?";
|
||||
String shipDetailSql="DELETE FROM MATERIALRECEIVEREQUESTDETAIL WHERE RECEIVEREQUESTNAME =?";
|
||||
Object[] obj=new Object[] {shipRequestName};
|
||||
IDMFrameServiceProxy.getSqlTemplate().update(sql, obj);
|
||||
IDMFrameServiceProxy.getSqlTemplate().update(shipDetailSql, obj);
|
||||
}
|
||||
checkResultList2 = IDMFrameServiceProxy.getSqlTemplate().queryForList(sqlCheck, selectMap);
|
||||
}else {
|
||||
String sqlCheck =" SELECT * FROM materialshiprequest m WHERE shiprequestname =:SHIPREQUESTNAME ";
|
||||
|
||||
List<Map<String, Object>> isResultList = IDMFrameServiceProxy.getSqlTemplate().queryForList(sqlCheck, selectMap);
|
||||
|
||||
String isSql = "SELECT\n" +
|
||||
@ -1105,9 +1125,34 @@ public class SAPToWMSController {
|
||||
IDMFrameServiceProxy.getSqlTemplate().update(shipDetailSql, obj);
|
||||
}
|
||||
|
||||
List<Map<String, Object>> checkResultList = IDMFrameServiceProxy.getSqlTemplate().queryForList(sqlCheck, selectMap);
|
||||
checkResultList2 = IDMFrameServiceProxy.getSqlTemplate().queryForList(sqlCheck, selectMap);
|
||||
}
|
||||
|
||||
if(checkResultList == null || checkResultList.size() == 0) {
|
||||
|
||||
if(checkResultList2 == null || checkResultList2.size() == 0) {
|
||||
|
||||
// 如果是成品中心退货
|
||||
if("07".equals(shipRequestType) || "03".equals(shipRequestType)) {
|
||||
CreateReceiveRequestInfo reCreateInfo = new CreateReceiveRequestInfo();
|
||||
reCreateInfo.setSiteName(sitename);
|
||||
reCreateInfo.setReceiveRequestName(shipRequestName);
|
||||
reCreateInfo.setReceiveRequestType(shipRequestType);
|
||||
reCreateInfo.setReceiveRequestState("Created");
|
||||
reCreateInfo.setSupplierNO(createUser);
|
||||
reCreateInfo.setSystemType("ERP");
|
||||
|
||||
Map<String, Object> bindMap = new HashMap<String, Object>();
|
||||
bindMap.put("createUser", createUser);
|
||||
bindMap.put("createTime", createDate+" "+createTime);
|
||||
bindMap.put("erpFactory", erpFactory);
|
||||
bindMap.put("areaName", areaName);
|
||||
reCreateInfo.setUserColumns(bindMap);
|
||||
EventInfo reEventInfo = new EventInfo();
|
||||
reEventInfo.setEventName("CreateReceiveRequest");
|
||||
reEventInfo.setEventUser(createUser);
|
||||
|
||||
MaterialReceiveRequestServiceProxy.getMaterialReceiveRequestService().create(reEventInfo, reCreateInfo);
|
||||
}else {
|
||||
CreateMaterialShipRequestInfo createInfo = new CreateMaterialShipRequestInfo();
|
||||
createInfo.setSiteName(sitename);
|
||||
createInfo.setShipRequestName(shipRequestName);
|
||||
@ -1126,8 +1171,42 @@ public class SAPToWMSController {
|
||||
EventInfo eventInfo = new EventInfo();
|
||||
eventInfo.setEventName("MaterialShipRequestSAPToWMS");
|
||||
eventInfo.setEventUser(createUser);
|
||||
|
||||
MaterialShipRequestServiceProxy.getMaterialShipRequestService().create(eventInfo, createInfo);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}else {
|
||||
//如果是成品中心退货
|
||||
if("07".equals(shipRequestType) || "03".equals(shipRequestType)) {
|
||||
SetEventInfo reInfo = new SetEventInfo();
|
||||
MaterialReceiveRequestKey key = new MaterialReceiveRequestKey();
|
||||
|
||||
key.setSiteName(sitename);
|
||||
key.setReceiveRequestName(shipRequestName);
|
||||
|
||||
MaterialReceiveRequest shipRequest = MaterialReceiveRequestServiceProxy.getMaterialReceiveRequestService().selectByKey(key);
|
||||
|
||||
if (!shipRequest.getReceiveRequestState().equalsIgnoreCase("Created")) {
|
||||
throw new CustomException("ERROR", "交货单已确认,禁止修改!");
|
||||
}
|
||||
|
||||
Map<String, Object> bindMap = new HashMap<String, Object>();
|
||||
//bindMap.put("salesGroup", saleGroup);
|
||||
bindMap.put("shipRequestType", shipRequestType);
|
||||
bindMap.put("shipRequestDetailType", moveState);
|
||||
bindMap.put("createUser", createUser);
|
||||
bindMap.put("createTime", createDate+" "+createTime);
|
||||
bindMap.put("erpFactory", erpFactory);
|
||||
bindMap.put("areaName", areaName);
|
||||
|
||||
reInfo.setUserColumns(bindMap);
|
||||
EventInfo reEventInfo = new EventInfo();
|
||||
reEventInfo.setEventName("UpDateMaterialtReceiveRequest");
|
||||
reEventInfo.setEventUser(createUser);
|
||||
|
||||
MaterialReceiveRequestServiceProxy.getMaterialReceiveRequestService().setEvent(key, reEventInfo, reInfo);
|
||||
|
||||
}else {
|
||||
MaterialShipRequestSetEventInfo info = new MaterialShipRequestSetEventInfo();
|
||||
MaterialShipRequestKey key = new MaterialShipRequestKey();
|
||||
@ -1145,7 +1224,7 @@ public class SAPToWMSController {
|
||||
bindMap.put("shipRequestType", shipRequestType);
|
||||
bindMap.put("shipRequestDetailType", moveState);
|
||||
bindMap.put("createUser", createUser);
|
||||
bindMap.put("createTime", createTime);
|
||||
bindMap.put("createTime", createDate+" "+createTime);
|
||||
bindMap.put("erpFactory", erpFactory);
|
||||
bindMap.put("areaName", areaName);
|
||||
|
||||
@ -1156,6 +1235,8 @@ public class SAPToWMSController {
|
||||
eventInfo.setEventUser(createUser);
|
||||
MaterialShipRequestServiceProxy.getMaterialShipRequestService().setEvent(key, eventInfo, info);
|
||||
}
|
||||
|
||||
}
|
||||
String bwart="";//移动类型。因领料单下发未发送移动类型,故再单独更新,当LGORT2为空时更新为261,否则更新为311。zd.2024.8.7
|
||||
if (data.containsKey("ITEM")) {
|
||||
// 详情
|
||||
@ -1204,12 +1285,31 @@ public class SAPToWMSController {
|
||||
|
||||
String xloek= MapUtils.getString(item, "xloek"); // 删除标识
|
||||
|
||||
|
||||
MaterialShipRequestDetail mrd =new MaterialShipRequestDetail();
|
||||
MaterialShipRequestDetailKey mrdk=new MaterialShipRequestDetailKey();
|
||||
|
||||
MaterialReceiveRequestDetail mrdrc = new MaterialReceiveRequestDetail();
|
||||
MaterialReceiveRequestDetailKey receiveKey = new MaterialReceiveRequestDetailKey();
|
||||
|
||||
if("07".equals(shipRequestType) || "03".equals(shipRequestType)) {
|
||||
|
||||
receiveKey.setSiteName(sitename);
|
||||
receiveKey.setReceiveRequestName(shipRequestName);
|
||||
receiveKey.setReceiveRequestDetailName(shipRequestDetailName);
|
||||
try {
|
||||
mrdrc = ReceiveRequestDetailServiceProxy.getReceiveRequestDetailService().selectByKey(receiveKey);
|
||||
if (mrdrc.getReceivedQuantity() != 0) {
|
||||
throw new CustomException("ERROR", "行项目已在拣配途中!");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
// TODO: handle exception
|
||||
}
|
||||
}else {
|
||||
|
||||
mrdk.setSiteName(sitename);
|
||||
mrdk.setShipRequestName(shipRequestName);
|
||||
mrdk.setShipRequestDetailName(shipRequestDetailName);
|
||||
|
||||
try {
|
||||
mrd=MaterialShipRequestDetailServiceProxy.getMaterialShipRequestDetailService().selectByKey(mrdk);
|
||||
if (mrd.getAssignedQuantity()!=0) {
|
||||
@ -1218,6 +1318,7 @@ public class SAPToWMSController {
|
||||
} catch (Exception e) {
|
||||
// TODO: handle exception
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if("X".equals(xloek)) {
|
||||
@ -1232,32 +1333,37 @@ public class SAPToWMSController {
|
||||
materialMap.put("MATERIALSPECNAME", materialSpecName);
|
||||
List<Map<String, Object>> phaseList = IDMFrameServiceProxy.getSqlTemplate().queryForList(materialSql, materialMap);
|
||||
String phase= "";
|
||||
try {
|
||||
if(phaseList == null || phaseList.size() == 0) {
|
||||
throw new CustomException("ERROR","料号在基础数据里没找到!");
|
||||
}else {
|
||||
phase = phaseList.get(0).get("PHASE") != null ? phaseList.get(0).get("PHASE").toString() : "";
|
||||
}
|
||||
} catch (Exception e) {
|
||||
// TODO: handle exception
|
||||
}
|
||||
|
||||
|
||||
List<Map<String, Object>> checkItemResultList = new ArrayList<Map<String, Object>>();
|
||||
if("07".equals(shipRequestType) || "03".equals(shipRequestType)) {
|
||||
String sqlItemCheck ="SELECT * FROM MATERIALRECEIVEREQUESTDETAIL " +
|
||||
"WHERE RECEIVEREQUESTNAME =:RECEIVEREQUESTNAME and RECEIVEREQUESTDETAILNAME = :RECEIVEREQUESTDETAILNAME";
|
||||
Map<String, Object> selectItemMap= new HashMap<String, Object>();
|
||||
selectItemMap.put("RECEIVEREQUESTNAME", shipRequestName);
|
||||
selectItemMap.put("RECEIVEREQUESTDETAILNAME", shipRequestDetailName);
|
||||
checkItemResultList = IDMFrameServiceProxy.getSqlTemplate().queryForList(sqlItemCheck, selectItemMap);
|
||||
} else {
|
||||
String sqlItemCheck ="SELECT * FROM materialshiprequestdetail WHERE shiprequestname =:SHIPREQUESTNAME and shiprequestdetailname = :SHIPREQUESTDETAILNAME";
|
||||
|
||||
Map<String, Object> selectItemMap= new HashMap<String, Object>();
|
||||
selectItemMap.put("SHIPREQUESTNAME", shipRequestName);
|
||||
selectItemMap.put("SHIPREQUESTDETAILNAME", shipRequestDetailName);
|
||||
|
||||
List<Map<String, Object>> checkItemResultList = IDMFrameServiceProxy.getSqlTemplate().queryForList(sqlItemCheck, selectItemMap);
|
||||
checkItemResultList = IDMFrameServiceProxy.getSqlTemplate().queryForList(sqlItemCheck, selectItemMap);
|
||||
}
|
||||
|
||||
|
||||
if (checkItemResultList == null || checkItemResultList.size() == 0) {
|
||||
CreateMaterialShipRequestDetailInfo createInfo = new CreateMaterialShipRequestDetailInfo();
|
||||
|
||||
createInfo.setSiteName(sitename);
|
||||
createInfo.setShipRequestName(shipRequestName);
|
||||
createInfo.setShipRequestDetailName(shipRequestDetailName);
|
||||
createInfo.setMaterialSpecName(materialSpecName);
|
||||
// 精度丢失处理
|
||||
BigDecimal bigRequestQuantity = new BigDecimal(requestQuantity.trim());
|
||||
createInfo.setRequestQuantity(bigRequestQuantity.doubleValue());
|
||||
createInfo.setAssignedQuantity(0);
|
||||
|
||||
|
||||
Map<String, Object> bindMapItem = new HashMap<String, Object>();
|
||||
bindMapItem.put("erpFactory", werks1); // 工厂
|
||||
@ -1287,6 +1393,40 @@ public class SAPToWMSController {
|
||||
bindMapItem.put("causeOfMovement", causeOfMovement);
|
||||
bindMapItem.put("goalMaterialSpec", ummat);
|
||||
bindMapItem.put("phase", phase);
|
||||
bindMapItem.put("saleOutQuantity", 0);
|
||||
|
||||
if("07".equals(shipRequestType) || "03".equals(shipRequestType)) {
|
||||
bindMapItem.put("receiveRequestDetailType", shipRequestType); // 原单号
|
||||
CreateReceiveRequestDetailInfo createReceiveInfo = new CreateReceiveRequestDetailInfo();
|
||||
createReceiveInfo.setSiteName(sitename);
|
||||
createReceiveInfo.setReceiveRequestName(shipRequestName);
|
||||
createReceiveInfo.setReceiveRequestDetailName(shipRequestDetailName);
|
||||
createReceiveInfo.setMaterialSpecName(materialSpecName);
|
||||
BigDecimal bigRequestQuantity2 = new BigDecimal(requestQuantity.trim());
|
||||
createReceiveInfo.setRequestQuantity(bigRequestQuantity2.doubleValue());
|
||||
createReceiveInfo.setReceivedQuantity(0);
|
||||
createReceiveInfo.setUserColumns(bindMapItem);
|
||||
EventInfo eventReciveInfo = new EventInfo();
|
||||
eventReciveInfo.setEventUser(createUser);
|
||||
eventReciveInfo.setEventName("Create");
|
||||
|
||||
MaterialReceiveRequestDetailKey key = new MaterialReceiveRequestDetailKey();
|
||||
|
||||
key.setSiteName(sitename);
|
||||
key.setReceiveRequestName(shipRequestName);
|
||||
key.setReceiveRequestDetailName(shipRequestDetailName);
|
||||
ReceiveRequestDetailServiceProxy.getReceiveRequestDetailService().create(key,eventReciveInfo, createReceiveInfo);
|
||||
}else {
|
||||
CreateMaterialShipRequestDetailInfo createInfo = new CreateMaterialShipRequestDetailInfo();
|
||||
|
||||
createInfo.setSiteName(sitename);
|
||||
createInfo.setShipRequestName(shipRequestName);
|
||||
createInfo.setShipRequestDetailName(shipRequestDetailName);
|
||||
createInfo.setMaterialSpecName(materialSpecName);
|
||||
// 精度丢失处理
|
||||
BigDecimal bigRequestQuantity = new BigDecimal(requestQuantity.trim());
|
||||
createInfo.setRequestQuantity(bigRequestQuantity.doubleValue());
|
||||
createInfo.setAssignedQuantity(0);
|
||||
|
||||
createInfo.setUserColumns(bindMapItem);
|
||||
EventInfo eventInfo = new EventInfo();
|
||||
@ -1295,6 +1435,9 @@ public class SAPToWMSController {
|
||||
eventInfo.setEventName("CreateMaterialShipRequest");
|
||||
|
||||
MaterialShipRequestDetailServiceProxy.getMaterialShipRequestDetailService().create(createInfo);
|
||||
}
|
||||
|
||||
|
||||
}else {
|
||||
|
||||
NonPrimaryKeyValueInfo nonPrimaryKeyValueInfo = new NonPrimaryKeyValueInfo();
|
||||
@ -1329,6 +1472,7 @@ public class SAPToWMSController {
|
||||
bindMapItem.put("causeOfMovement", causeOfMovement);
|
||||
bindMapItem.put("goalMaterialSpec", ummat);
|
||||
bindMapItem.put("phase", phase);
|
||||
bindMapItem.put("saleOutQuantity", 0);
|
||||
|
||||
nonPrimaryKeyValueInfo.setUserColumns(bindMapItem);
|
||||
EventInfo eventInfo = new EventInfo();
|
||||
@ -1336,7 +1480,25 @@ public class SAPToWMSController {
|
||||
eventInfo.setEventUser(createUser);
|
||||
eventInfo.setEventName("updateMaterialShipRequest");
|
||||
|
||||
|
||||
|
||||
// 如果是成本退
|
||||
if("07".equals(shipRequestType) || "03".equals(shipRequestType)) {
|
||||
com.cim.idm.wmspackage.receiverequestdetail.management.info.SetEventInfo setReciveInfo = new com.cim.idm.wmspackage.receiverequestdetail.management.info.SetEventInfo();
|
||||
MaterialReceiveRequestDetailKey receiveRequestDetailKey = new MaterialReceiveRequestDetailKey();
|
||||
MaterialReceiveRequestDetail receiveRequestDetail = new MaterialReceiveRequestDetail();
|
||||
receiveRequestDetailKey.setReceiveRequestDetailName(shipRequestDetailName);
|
||||
receiveRequestDetailKey.setReceiveRequestName(shipRequestName);
|
||||
receiveRequestDetailKey.setSiteName(sitename);
|
||||
setReciveInfo.setUserColumns(bindMapItem);
|
||||
|
||||
ReceiveRequestDetailServiceProxy.getReceiveRequestDetailService().setEvent(receiveRequestDetailKey, eventInfo, setReciveInfo);
|
||||
}else {
|
||||
MaterialShipRequestDetailServiceProxy.getMaterialShipRequestDetailService().setEvent(mrdk, nonPrimaryKeyValueInfo);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@ -1384,6 +1546,7 @@ public class SAPToWMSController {
|
||||
IDMFrameServiceProxy.getTransactionManager().rollbackTransaction();
|
||||
Map<String, Object> errorReturn = new HashMap<>();
|
||||
errorReturn.put("STATUS", "E");
|
||||
log.info(e.toString());
|
||||
errorReturn.put("MSGTXT", "预留单/领料单下发失败 " + e.getMessage());
|
||||
errorReturn.put("HEAD", request.getHEAD());
|
||||
//errorReturn.put("BODY", request.getBODY());
|
||||
@ -1524,19 +1687,36 @@ public class SAPToWMSController {
|
||||
String carFlag = MapUtils.getString(data, "Z_SSEND");//是否需要专车派送
|
||||
String factoryName = MapUtils.getString(data, "WERKS"); //工厂
|
||||
|
||||
|
||||
|
||||
List<Map<String, Object>> checkResultList = new ArrayList<>();
|
||||
List<Map<String, Object>> checkResultList2 = new ArrayList<>();
|
||||
Map<String, Object> selectMap= new HashMap<String, Object>();
|
||||
selectMap.put("SHIPREQUESTNAME", shipRequestName);
|
||||
// 如果是销售退货
|
||||
if("ZLR1".equals(shipRequestType)) {
|
||||
String sqlCheck =" SELECT * FROM MATERIALRECEIVEREQUEST m WHERE RECEIVEREQUESTNAME =:SHIPREQUESTNAME ";
|
||||
checkResultList = IDMFrameServiceProxy.getSqlTemplate().queryForList(sqlCheck, selectMap);
|
||||
|
||||
if(checkResultList != null && checkResultList.size() > 0) {
|
||||
String sql="DELETE FROM MATERIALRECEIVEREQUEST WHERE RECEIVEREQUESTNAME =?";
|
||||
Object[] obj=new Object[] {shipRequestName};
|
||||
IDMFrameServiceProxy.getSqlTemplate().update(sql, obj);
|
||||
}
|
||||
checkResultList2 = IDMFrameServiceProxy.getSqlTemplate().queryForList(sqlCheck, selectMap);
|
||||
}else {
|
||||
String sqlCheck =" SELECT * FROM materialshiprequest m WHERE shiprequestname =:SHIPREQUESTNAME ";
|
||||
checkResultList = IDMFrameServiceProxy.getSqlTemplate().queryForList(sqlCheck, selectMap);
|
||||
|
||||
if(checkResultList != null && checkResultList.size() > 0) {
|
||||
String sql="DELETE FROM materialshiprequest WHERE shiprequestname =?";
|
||||
Object[] obj=new Object[] {shipRequestName};
|
||||
IDMFrameServiceProxy.getSqlTemplate().update(sql, obj);
|
||||
}
|
||||
checkResultList2 = IDMFrameServiceProxy.getSqlTemplate().queryForList(sqlCheck, selectMap);
|
||||
}
|
||||
|
||||
if(checkResultList == null || checkResultList.size() == 0) {
|
||||
if(checkResultList2 == null || checkResultList2.size() == 0) {
|
||||
|
||||
Map<String, Object> bindMap = new HashMap<String, Object>();
|
||||
bindMap.put("shipRequestDec", shiprequestdec);
|
||||
@ -1547,6 +1727,7 @@ public class SAPToWMSController {
|
||||
bindMap.put("orderDateStr", orderDate);
|
||||
bindMap.put("erpFactory", factoryName);
|
||||
bindMap.put("planDate", planDate);//计划交货日期
|
||||
|
||||
//NEW
|
||||
bindMap.put("customerOrder", customerOrder);//客户订单号
|
||||
bindMap.put("customerArea", customerArea);//客户大区
|
||||
@ -1582,6 +1763,7 @@ public class SAPToWMSController {
|
||||
// shipRequestList.add(shipRequestName);
|
||||
|
||||
createInfo.setSystemType("ERP");
|
||||
bindMap.put("createTime", orderDate);//创建日期
|
||||
createInfo.setUserColumns(bindMap);
|
||||
|
||||
EventInfo eventInfo = new EventInfo();
|
||||
@ -1665,7 +1847,10 @@ public class SAPToWMSController {
|
||||
EventInfo eventInfo = new EventInfo();
|
||||
eventInfo.setEventName("ModifyMaterialShipRequest");
|
||||
eventInfo.setEventUser(createUser);
|
||||
|
||||
MaterialShipRequestServiceProxy.getMaterialShipRequestService().setEvent(key, eventInfo, info);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -1775,6 +1960,7 @@ public class SAPToWMSController {
|
||||
bindMapItem.put("sendSalesOrder", sendSaleOrder); // 销售订单
|
||||
bindMapItem.put("sendSalesOrderDetailNo", sendSaleOrderDetailNo); // 销售订单行号
|
||||
bindMapItem.put("sourceNo", sourceNo); // 原单号
|
||||
bindMapItem.put("saleOutQuantity", 0);
|
||||
|
||||
// 根据料号获取阶段
|
||||
String materialSql = "SELECT m.PHASE FROM MATERIALSPEC m WHERE MATERIALSPECNAME = :MATERIALSPECNAME";
|
||||
@ -1851,6 +2037,7 @@ public class SAPToWMSController {
|
||||
bindMapItem.put("sendSalesOrder", sendSaleOrder); // 销售订单
|
||||
bindMapItem.put("sendSalesOrderDetailNo", sendSaleOrderDetailNo); // 销售订单行号
|
||||
bindMapItem.put("sourceNo", sourceNo); // 原单号
|
||||
bindMapItem.put("saleOutQuantity", 0);
|
||||
|
||||
nonPrimaryKeyValueInfo.setUserColumns(bindMapItem);
|
||||
setReciveInfo.setUserColumns(bindMapItem);
|
||||
|
@ -14,7 +14,7 @@ public interface FgStockInDao {
|
||||
|
||||
//调用接口查询当前Box是否都是在库需要转库,传入List<MaterialPacking>
|
||||
public List<MaterialPacking> getBoxList(@Param("boxList") List<MaterialPacking> boxList,@Param("erpFactory") String erpFactory
|
||||
,@Param("erpLocation") String erpLocation,@Param("locationName") String locationName) throws Exception;
|
||||
,@Param("erpLocation") String erpLocation,@Param("locationName") String locationName,@Param("user") String user) throws Exception;
|
||||
|
||||
//批量更新BS_MES_SHIPPED表的ReceiveFlag和ReceiveTime
|
||||
public void updateBsMesShipped(@Param("boxList") List<MaterialPacking> boxList) throws Exception;
|
||||
|
@ -290,7 +290,7 @@ public class ProductIntoServiceImpl implements FGStockInService {
|
||||
@Transactional
|
||||
public void fgStockInByManul(List<MaterialPacking> boxList, String user, String receiveRequestActNo, String commitDate, String opCode) throws Exception {
|
||||
//调用mybatis查询当前要入库的信息是否是同一类型转库Or入库
|
||||
List<MaterialPacking> packingList = fgStockInDao.getBoxList(boxList,boxList.get(0).getErpFactory(),boxList.get(0).getErpLocation(),boxList.get(0).getLocationName());
|
||||
List<MaterialPacking> packingList = fgStockInDao.getBoxList(boxList,boxList.get(0).getErpFactory(),boxList.get(0).getErpLocation(),boxList.get(0).getLocationName(),user);
|
||||
if(packingList.size()==0){
|
||||
throw new Exception("请选择正确的入库信息");
|
||||
}
|
||||
@ -330,6 +330,10 @@ public class ProductIntoServiceImpl implements FGStockInService {
|
||||
aimErpLocation, aimLOcationName, user, commitDate);
|
||||
//更新物料凭证和库存状态
|
||||
toSapDao.updateLocationStockState(boxList, "Stocked", undoID,aimErpFactory,aimErpLocation,aimLOcationName,user);
|
||||
|
||||
//
|
||||
MESServiceImpl mesService=new MESServiceImpl() ;
|
||||
mesService.CCPRK_deleteMaterialPackingInfo(chargeList);
|
||||
}else {
|
||||
// 直接入库
|
||||
//封装为Json的字符串
|
||||
@ -353,9 +357,6 @@ public class ProductIntoServiceImpl implements FGStockInService {
|
||||
toSapDao.saveUnDoInfo( boxList, undoID, commitDate);
|
||||
//更新接口表的标记和
|
||||
fgStockInDao.updateBsMesShipped(boxList);
|
||||
|
||||
MESServiceImpl mesService=new MESServiceImpl() ;
|
||||
mesService.CCPRK_deleteMaterialPackingInfo(chargeList);
|
||||
}
|
||||
|
||||
|
||||
|
@ -167,6 +167,7 @@
|
||||
#{name}
|
||||
</foreach>
|
||||
AND m.SITENAME = #{siteName}
|
||||
AND m.DELETEDETAILFLAG !='L'
|
||||
AND m3.IS_BATCH != 'N'
|
||||
<!-- AND m2.RECEIVEREQUESTTYPE IN-->
|
||||
<!-- <foreach item="type" index="index" collection="typeList" open="(" separator="," close=")">-->
|
||||
@ -235,10 +236,10 @@
|
||||
</foreach>
|
||||
AND m.SITENAME = #{siteName}
|
||||
AND (m.REQUESTQUANTITY - m.RECEIVEDQUANTITY) > 0
|
||||
AND m2.RECEIVEREQUESTTYPE IN
|
||||
<foreach item="type" index="index" collection="typeList" open="(" separator="," close=")">
|
||||
#{type}
|
||||
</foreach>
|
||||
<!-- AND m2.RECEIVEREQUESTTYPE IN-->
|
||||
<!-- <foreach item="type" index="index" collection="typeList" open="(" separator="," close=")">-->
|
||||
<!-- #{type}-->
|
||||
<!-- </foreach>-->
|
||||
AND (m2.RETURNFLAG IS NULL OR m2.RETURNFLAG != 'Y')
|
||||
AND (m3.IS_BATCH IS NULL OR m3.IS_BATCH != 'Y')
|
||||
</select>
|
||||
|
@ -30,6 +30,8 @@
|
||||
'SDK' siteName,
|
||||
'Released' PackingState,
|
||||
'Created' stockState,
|
||||
'Created' OldStockState,
|
||||
'N' HoldState,
|
||||
T.DURABLETYPE durableType,
|
||||
#{erpFactory} ERPFactory,
|
||||
#{erpLocation} ERPLOCATION,
|
||||
@ -38,6 +40,7 @@
|
||||
NVL(T.MAKEDATE, SYSDATE ) MAKEDATE ,
|
||||
NVL(T.MAKEDATE, SYSDATE ) + NVL(M3.EXPIRATIONDAY, '9999') expiringDate,
|
||||
SYSDATE ReceiveTime,
|
||||
#{user} ReceiveUser,
|
||||
T.REQUESTNAME productOrder,
|
||||
T.CAREER_ASSISTANCE ,
|
||||
M3.MATERIALSPECTYPE ,
|
||||
@ -56,6 +59,9 @@
|
||||
M3.MATERIALTYPE ,
|
||||
T.PHASE,
|
||||
T.GXID,
|
||||
T.CHARGE,
|
||||
T.TRUEGG,
|
||||
T.MJPC,
|
||||
T.MATERIALSPECTYPE
|
||||
FROM
|
||||
BS_MES_SHIPPED T
|
||||
|
Loading…
x
Reference in New Issue
Block a user