Compare commits

...

2 Commits

Author SHA1 Message Date
eab3db5fdb Merge branch 'main' of http://162.14.99.253:3000/10539622/2025-03-JS-SDK-svr
# Conflicts:
#	zi-wms-pda/src/main/java/com/cim/idm/service/Impl/InvoiceServiceImpl.java
2025-05-14 13:09:06 +08:00
4a7330f5f8 fix:修改过账冲销 2025-05-14 13:08:41 +08:00
10 changed files with 57 additions and 17 deletions

View File

@ -371,7 +371,7 @@ public class ToSAPServiceImpl {
ErpMessageLog erplog = new ErpMessageLog();
erplog.setEventUser(user);
erplog.setServerName("WmsToSAP");
erplog.setEventName("MatailInReverse取消入库冲销");
erplog.setEventName("冲销");
erplog.setInterfaceTime(TimeStampUtil.getCurrentTime(TimeStampUtil.FORMAT_DEFAULT));
// erplog.setMessageId(undoId);
erplog.setMessageId(undoId);

View File

@ -1965,7 +1965,7 @@ public class InvoiceController {
// return AjaxResult.me().setSuccess(false).setMessage("只能超发一个不能出库了!");
// }
// }
else if ("OEM".equals(shipRequestType)) { //委外出库
else if ("OEM".equals(shipRequestType) || "08".equals(shipRequestType)) { //委外出库
if (dy0 < 0) {//只能超发一个
return AjaxResult.me().setSuccess(false).setMessage("只能超发一个不能出库了!");
}
@ -2149,7 +2149,7 @@ public class InvoiceController {
// return AjaxResult.me().setSuccess(false).setMessage("只能超发一个不能出库了!");
// }
// }
else if ("OEM".equals(shipRequestType)) { //委外出库
else if ("OEM".equals(shipRequestType) || "08".equals(shipRequestType)) { //委外出库
if (dy0 < 0) {//只能超发一个
return AjaxResult.me().setSuccess(false).setMessage("只能超发一个不能出库了!");
}
@ -2319,7 +2319,7 @@ public class InvoiceController {
// return AjaxResult.me().setSuccess(false).setMessage("只能超发一个不能出库了!");
// }
// }
else if ("OEM".equals(shipRequestType)) { //委外出库
else if ("OEM".equals(shipRequestType) || "08".equals(shipRequestType)) { //委外出库
if (dy0 < 0) {//只能超发一个
return AjaxResult.me().setSuccess(false).setMessage("只能超发一个不能出库了!");
}

View File

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

View File

@ -1292,7 +1292,7 @@ public class SAPToWMSController {
String xloek= MapUtils.getString(item, "xloek"); // 删除标识
String auart= MapUtils.getString(item, "AUART"); // 接收生产订单类型 返工ZP05 复卷ZP01
String lifnr= MapUtils.getString(item, "LIFNR"); //
String lifnr= MapUtils.getString(item, "LIFNR"); // 委外
MaterialShipRequestDetail mrd =new MaterialShipRequestDetail();

View File

@ -577,7 +577,7 @@ public class SaleOutController {
// return AjaxResult.me().setSuccess(false).setMessage("只能超发一个不能出库了!");
// }
// }
else if ("OEM".equals(shipRequestType)) { //委外出库
else if ("OEM".equals(shipRequestType) || "08".equals(shipRequestType)) { //委外出库
if (dy0 < 0) {//只能超发一个
return AjaxResult.me().setSuccess(false).setMessage("只能超发一个不能出库了!");
}

View File

@ -18,6 +18,9 @@ public interface ToSapDao {
//基于boxList更新物料凭证及库存状态
public void updateStockState(@Param("boxList") List<MaterialPacking> boxList,@Param("stockState") String stockState,@Param("undoId") String undoId,@Param("user") String user) throws Exception;
// 更新history
public void updateStockStateHistory(@Param("boxList") List<MaterialPacking> boxList,@Param("stockState") String stockState,@Param("undoId") String undoId,@Param("user") String user) throws Exception;
//基于boxList更新物料凭证及库存状态
public void updateLocationStockState(@Param("boxList") List<MaterialPacking> boxList,@Param("stockState") String stockState,@Param("undoId") String undoId,@Param("aimErpFactory") String aimErpFactory,@Param("aimErpLocation") String aimErpLocation,@Param("aimLOcationName") String aimLOcationName,@Param("user") String user) throws Exception;

View File

@ -883,7 +883,7 @@ public class MaterialShipServiceImpl implements IMaterialShipService {
setEventInfo.setUserColumns(hashMapPack);
MaterialPackingServiceProxy.getMaterialPackingService().setEvent(mpKeyList, eventInfo, setEventInfo);
//抛送MES数据
untils.sendMaterialInfoToMES_NEW2(shipRequestName, "", materialPackingKeyList);
untils.sendMaterialInfoToMES_NEW2(shipRequestName, "", materialPackingKeyList,billCode,user);
WlySaveUnDoInfo( billCode,commitDate);
}
@ -896,7 +896,7 @@ public class MaterialShipServiceImpl implements IMaterialShipService {
}
// billCode=toSAPService.ProductionStockOut_NEW(shipRequestName, "SDK", eventUser,materialPackingKeyList);
//抛送MES数据
untils.sendMaterialInfoToMES_NEW(shipRequestName, "", materialPackingKeyList);
untils.sendMaterialInfoToMES_NEW(shipRequestName, "", materialPackingKeyList,billCode,user);
//billCode = NCWServiceImpl.SaleOut2(shipRequestName, "SDK", eventUser,materialPackingKeyList,"");
untils.SaveUnDoInfo_ForSap(materialPackingKeyList, billCode, eventInfo);

View File

@ -351,6 +351,7 @@ public class ProductIntoServiceImpl implements FGStockInService {
// undoID = toSAPService.FGStockIn(pc, user, commitDate, opCode);
//更新物料凭证和库存状态
toSapDao.updateStockState(boxList, "Stocked", undoID, user);
toSapDao.updateStockStateHistory(boxList, "Stocked", undoID, user);
}
//更新过账流水

View File

@ -4,6 +4,7 @@ import com.cim.idm.exception.GlobalException;
import com.cim.idm.framework.IDMFrameServiceProxy;
import com.cim.idm.framework.data.EventInfo;
import com.cim.idm.service.impl.MESServiceImpl;
import com.cim.idm.service.impl.ToSAPServiceImpl;
import com.cim.idm.wmsextend.generic.GenericServiceProxy;
import com.cim.idm.wmsextend.generic.errorHandler.CustomException;
import com.cim.idm.wmspackage.materialpacking.MaterialPackingServiceProxy;
@ -11,6 +12,7 @@ import com.cim.idm.wmspackage.materialpacking.management.data.MaterialPacking;
import com.cim.idm.wmspackage.materialpacking.management.data.MaterialPackingKey;
import com.cim.idm.wmspackage.materialpacking.management.info.SetEventInfo;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@ -30,6 +32,9 @@ import java.util.Objects;
@EnableAutoConfiguration
public class CommonUtils {
@Autowired
private ToSAPServiceImpl toSAPService;
/**
* 查询库位所在的仓库
* @param loction
@ -668,7 +673,7 @@ public void SaveUnDoInfo_ForSap(List<String> list, String undoid, EventInfo mak
* @param receiveActNo 收货活动编号用于指定收货活动
* @param boxList 箱号列表包含所有需要发送的物料箱号
*/
public void sendMaterialInfoToMES_NEW(String invoiceNo,String receiveActNo,List<String> boxList){
public void sendMaterialInfoToMES_NEW(String invoiceNo,String receiveActNo,List<String> boxList,String billCode,String user){
// 定义SQL查询语句用于获取物料接收位置和接收工厂信息
String sql="SELECT m.ERPRECEIVELOCATION,m.ERPRECEIVEFACTORY FROM MATERIALSHIPREQUEST a,MATERIALSHIPREQUESTDETAIL m \r\n" +
" WHERE m.SHIPREQUESTNAME =:SHIPREQUESTNAME and m.SHIPREQUESTNAME=a.SHIPREQUESTNAME "
@ -685,17 +690,27 @@ public void SaveUnDoInfo_ForSap(List<String> list, String undoid, EventInfo mak
// 创建MESServiceImpl实例用于调用发送物料信息到MES系统的方法
MESServiceImpl mesService=new MESServiceImpl() ;
// 调用MESServiceImpl的OutMaterialInfoSend_NEW方法发送物料信息到MES系统
mesService.OutMaterialInfoSend_NEW(invoiceNo, "SDK", receiveActNo, "",
String code = mesService.OutMaterialInfoSend_NEW(invoiceNo, "SDK", receiveActNo, "",
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 );
if("1".equals(code)) {
String undo = toSAPService.cancelShipInter(billCode, user);
if (undo == null ) {
throw new GlobalException("报送ERP失败,请联系IT处理");
}
}
}
} catch (CustomException e) {
// 异常处理打印异常堆栈跟踪信息
e.printStackTrace();
} catch (Exception e) {
throw new RuntimeException(e);
}
}
public void sendMaterialInfoToMES_NEW2(String invoiceNo,String receiveActNo,List<String> boxList){
public void sendMaterialInfoToMES_NEW2(String invoiceNo,String receiveActNo,List<String> boxList, String billCode, String user){
// 定义SQL查询语句用于获取物料接收位置和接收工厂信息
String sql="SELECT m.ERPRECEIVELOCATION,m.ERPRECEIVEFACTORY FROM MATERIALSHIPREQUEST a,MATERIALSHIPREQUESTDETAIL m \r\n" +
" WHERE m.SHIPREQUESTNAME =:SHIPREQUESTNAME and m.SHIPREQUESTNAME=a.SHIPREQUESTNAME "
@ -712,13 +727,22 @@ public void SaveUnDoInfo_ForSap(List<String> list, String undoid, EventInfo mak
// 创建MESServiceImpl实例用于调用发送物料信息到MES系统的方法
MESServiceImpl mesService=new MESServiceImpl() ;
// 调用MESServiceImpl的OutMaterialInfoSend_NEW方法发送物料信息到MES系统
mesService.OutMaterialInfoSend_NEW2(invoiceNo, "SDK", receiveActNo, "",
String code = mesService.OutMaterialInfoSend_NEW2(invoiceNo, "SDK", receiveActNo, "",
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 );
if("1".equals(code)) {
String undo = toSAPService.cancelShipInter(billCode, user);
if (undo == null ) {
throw new GlobalException("报送ERP失败,请联系IT处理");
}
}
}
} catch (CustomException e) {
// 异常处理打印异常堆栈跟踪信息
e.printStackTrace();
} catch (Exception e) {
throw new RuntimeException(e);
}
}

View File

@ -55,6 +55,18 @@
#{box.materialPackingName}
</foreach>
</update>
<!-- 更新history -->
<update id="updateStockStateHistory" parameterType="map">
UPDATE MATERIALPACKINGHISTORY
SET STOCKSTATE = #{stockState},UNDOID = #{undoId}, ERPLOCATION = #{aimErpLocation}, LOCATIONNAME = #{aimLOcationName}, ERPFACTORY = #{aimErpFactory},
EVENTTIME = SYSDATE,
EVENTUSER = #{user},
EVENTNAME = '产成品入库FGStockIn'
WHERE MATERIALPACKINGNAME IN
<foreach item="box" index="index" collection="boxList" open="(" separator="," close=")">
#{box.materialPackingName}
</foreach>
</update>
<!-- 基于形态转换更新物料编码-->
<update id="updateMaterialCode" parameterType="map">
UPDATE MATERIALPACKING m