Compare commits

..

2 Commits

9 changed files with 136 additions and 36 deletions

View File

@ -4980,7 +4980,7 @@ public class ToSAPServiceImpl {
erplog.setServerName("WmsToErp"); erplog.setServerName("WmsToErp");
erplog.setEventName("ReturnStockIn生产退料"); erplog.setEventName("ReturnStockIn生产退料");
erplog.setInterfaceTime(TimeStampUtil.getCurrentTime(TimeStampUtil.FORMAT_DEFAULT)); erplog.setInterfaceTime(TimeStampUtil.getCurrentTime(TimeStampUtil.FORMAT_DEFAULT));
erplog.setMessageId(shipRequestName); erplog.setMessageId(opCode);
erplog.setSendMsg(makeReturnStockIn); erplog.setSendMsg(makeReturnStockIn);
erplog.setSendMsg2(makeReturnStockIn); erplog.setSendMsg2(makeReturnStockIn);
erplog.setSendMsg(makeReturnStockIn); erplog.setSendMsg(makeReturnStockIn);

View File

@ -213,14 +213,17 @@ public class ProduceReturnController {
} else if(list2.isEmpty()) { } else if(list2.isEmpty()) {
throw new GlobalException("未打印退库标签!"); throw new GlobalException("未打印退库标签!");
} else { } else {
for (Map<String, Object> map : list2) { // for (Map<String, Object> map : list2) {
if (!"StockOut".equals(map.get("STOCKSTATE").toString())) { // if (!"StockOut".equals(map.get("STOCKSTATE").toString())) {
throw new GlobalException("条码已存在且不为出库状态!"); // throw new GlobalException("条码已存在且不为出库状态!");
} // }
} // }
} }
// 查看单号 // 查看单号
List<Map<String, Object>> list4 = produceReturnService.getMesShip(materialPackingName); List<Map<String, Object>> list4 = produceReturnService.getMesShip(materialPackingName);
if(list4.isEmpty()){
throw new GlobalException("未打印退库标签!");
}
Map<String, Object> mapAll = new HashMap<>(); Map<String, Object> mapAll = new HashMap<>();
mapAll.put("list2",list2); mapAll.put("list2",list2);
mapAll.put("list4",list4); mapAll.put("list4",list4);

View File

@ -18,6 +18,8 @@ public interface ToSapDao {
//基于boxList更新物料凭证及库存状态 //基于boxList更新物料凭证及库存状态
public void updateStockState(@Param("boxList") List<MaterialPacking> boxList,@Param("stockState") String stockState,@Param("undoId") String undoId) throws Exception; public void updateStockState(@Param("boxList") List<MaterialPacking> boxList,@Param("stockState") String stockState,@Param("undoId") String undoId) 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) throws Exception;
//基于boxList写入过账流水表 //基于boxList写入过账流水表
public void saveUnDoInfo(@Param("boxList") List<MaterialPacking> boxList, @Param("unDoID") String unDoID, @Param("commitDate") String commitDate) throws Exception; public void saveUnDoInfo(@Param("boxList") List<MaterialPacking> boxList, @Param("unDoID") String unDoID, @Param("commitDate") String commitDate) throws Exception;

View File

@ -7,7 +7,7 @@ public class RespGenerator {
* 接口返回数据 * 接口返回数据
*/ */
public static BaseResponse returnOK(Object data) { public static BaseResponse returnOK(Object data) {
return new BaseResponse("200", "SUCCESS!", data); return new BaseResponse("200", "操作成功!", data);
} }
/** /**

View File

@ -430,6 +430,8 @@ public class MESToWMSServiceImpl implements MESToWMSService {
String gxId = jo.getString("gxId"); // 增加管芯字段 String gxId = jo.getString("gxId"); // 增加管芯字段
// String makeDate = jo.getString("makeDate"); // String makeDate = jo.getString("makeDate");
erpFactory = jo.getString("erpFactory"); erpFactory = jo.getString("erpFactory");
String materialPackingName = jo.getString("materialPackingName"); // 生成退料原条码二维码
if (i == 0) { if (i == 0) {
stockInType = jo.getString("stockInType"); stockInType = jo.getString("stockInType");
operationType = jo.getString("operationType"); operationType = jo.getString("operationType");
@ -469,6 +471,7 @@ public class MESToWMSServiceImpl implements MESToWMSService {
bindMap.put("MATERIALSPECTYPE", stockInType); bindMap.put("MATERIALSPECTYPE", stockInType);
bindMap.put("CHARGE", charge); bindMap.put("CHARGE", charge);
bindMap.put("GXID", gxId); bindMap.put("GXID", gxId);
bindMap.put("MATERIALPACKINGNAME", materialPackingName);
// bindMap.put("makeDate", makeDate); // bindMap.put("makeDate", makeDate);
if ("1".equals(operationType)) { // 自动入库 if ("1".equals(operationType)) { // 自动入库

View File

@ -326,19 +326,17 @@ public class ProductIntoServiceImpl implements FGStockInService {
String aimLOcationName = boxList.get(0).getLocationName(); String aimLOcationName = boxList.get(0).getLocationName();
undoID = toSAPService.NoSourceChangeLocation(arrayList,aimErpFactory, undoID = toSAPService.NoSourceChangeLocation(arrayList,aimErpFactory,
aimErpLocation, aimLOcationName, user ); aimErpLocation, aimLOcationName, user );
//更新物料凭证和库存状态
toSapDao.updateLocationStockState(boxList, "Stocked", undoID,aimErpFactory,aimErpLocation,aimLOcationName);
}else { }else {
// 直接入库 // 直接入库
//封装为Json的字符串 //封装为Json的字符串
String json = JSON.toJSONString(fgStockInInfo); String json = JSON.toJSONString(fgStockInInfo);
undoID = toSAPService.FGStockInByManulIn(json, user); undoID = toSAPService.FGStockInByManulIn(json, user);
}
//更新物料凭证和库存状态 //更新物料凭证和库存状态
toSapDao.updateStockState(boxList, "Stocked", undoID); toSapDao.updateStockState(boxList, "Stocked", undoID);
}
//更新过账流水 //更新过账流水
toSapDao.saveUnDoInfo( boxList, undoID, commitDate); toSapDao.saveUnDoInfo( boxList, undoID, commitDate);
//更新接口表的标记和 //更新接口表的标记和

View File

@ -290,7 +290,7 @@ public class ReturnStockIntoServiceImpl implements ReturnStockInService {
} }
pc += "'')"; pc += "'')";
try { try {
boolean refundStockIn = ReturnStockInNew(pc, user, commitDate,opCode); boolean refundStockIn = ReturnStockInNew(pc, user, commitDate,opCode,boxList);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
throw new GlobalException(e.toString()); throw new GlobalException(e.toString());
@ -323,7 +323,7 @@ public class ReturnStockIntoServiceImpl implements ReturnStockInService {
sql.append(" SELECT "); sql.append(" SELECT ");
sql.append(" T.LOTNAME MATERIALPACKINGNAME, "); sql.append(" T.LOTNAME MATERIALPACKINGNAME, ");
sql.append(" T.QTY MATERIALQUANTITY, "); sql.append(" T.QTY MATERIALQUANTITY, ");
sql.append(" T.UNIT , T.CHARGE, "); sql.append(" T.UNIT ,T.RECEIVE_FLAG, T.MATERIALPACKINGNAME PREMATERIALPACKINGNAME,T.CHARGE, ");
sql.append(" M2. SHIPREQUESTDETAILNAME,"); sql.append(" M2. SHIPREQUESTDETAILNAME,");
sql.append(" T.REQUESTNAME SHIPREQUESTNAME,"); sql.append(" T.REQUESTNAME SHIPREQUESTNAME,");
sql.append(" T.PRODUCTSPECNAME MATERIALSPECNAME, "); sql.append(" T.PRODUCTSPECNAME MATERIALSPECNAME, ");
@ -358,6 +358,19 @@ public class ReturnStockIntoServiceImpl implements ReturnStockInService {
} }
// 查出是否存在原标签
String receive_flag = queryForList.get(0).get("RECEIVE_FLAG") == null ? "" : queryForList.get(0).get("RECEIVE_FLAG").toString();
String PREMATERIALPACKINGNAME = queryForList.get(0).get("PREMATERIALPACKINGNAME") == null ? "" : queryForList.get(0).get("PREMATERIALPACKINGNAME").toString();
List<Map<String, Object>> xcqueryForList = new ArrayList<Map<String, Object>> ();
Map<String, Object> xcHashMap = new HashMap<String,Object> ();
xcHashMap.put("CHARGE", queryForList.get(0).get("CHARGE"));
xcHashMap.put("MATERIALPACKINGNAME", PREMATERIALPACKINGNAME);
String xcSql = "SELECT * FROM MATERIALPACKING m WHERE m.CHARGE = :CHARGE AND m.MATERIALPACKINGNAME = :MATERIALPACKINGNAME";
xcqueryForList = IDMFrameServiceProxy.getSqlTemplate().queryForList(xcSql, xcHashMap);
//判断标签是否存在存在就更新不存在就创建新的入库 //判断标签是否存在存在就更新不存在就创建新的入库
String judgeSql = "SELECT * FROM MATERIALPACKING m WHERE m.MATERIALPACKINGNAME = :MATERIALPACKINGNAME"; String judgeSql = "SELECT * FROM MATERIALPACKING m WHERE m.MATERIALPACKINGNAME = :MATERIALPACKINGNAME";
List<Map<String, Object>> queryForList2 = IDMFrameServiceProxy.getSqlTemplate().queryForList(judgeSql, hashMap); List<Map<String, Object>> queryForList2 = IDMFrameServiceProxy.getSqlTemplate().queryForList(judgeSql, hashMap);
@ -426,6 +439,17 @@ public class ReturnStockIntoServiceImpl implements ReturnStockInService {
bindMap.put("RETURNPC",queryForList.get(0).get("RETURNPC")); bindMap.put("RETURNPC",queryForList.get(0).get("RETURNPC"));
bindMap.put("ShipUser",queryForList.get(0).get("SHIPUSER")); bindMap.put("ShipUser",queryForList.get(0).get("SHIPUSER"));
// 如果是现场仓更新标签需根据批次才能找到对应的原标签
if("T".equals(receive_flag)) {
// 如果存在对应的原标签MATERIALPACKINGNAME相等组织 仓库 货位 用原标签拥于后面过账
if(xcqueryForList != null && xcqueryForList.size() > 0) {
erpFactory = xcqueryForList.get(0).get("ErpFactory") == null ? "" : xcqueryForList.get(0).get("ErpFactory").toString();
erpLocation = xcqueryForList.get(0).get("ErpLocation") == null ? "" : xcqueryForList.get(0).get("ErpLocation").toString();
locationName = xcqueryForList.get(0).get("LocationName") == null ? "" : xcqueryForList.get(0).get("LocationName").toString();
}
}
bindMap.put("ErpLocation", erpLocation); bindMap.put("ErpLocation", erpLocation);
bindMap.put("ErpFactory", erpFactory); bindMap.put("ErpFactory", erpFactory);
bindMap.put("receiveActNo", SHIPActNo); bindMap.put("receiveActNo", SHIPActNo);
@ -443,6 +467,16 @@ public class ReturnStockIntoServiceImpl implements ReturnStockInService {
MaterialPackingKey materialPackingKey = new MaterialPackingKey(siteName,materialPackingName); MaterialPackingKey materialPackingKey = new MaterialPackingKey(siteName,materialPackingName);
MaterialPackingServiceProxy.getMaterialPackingService().create( MaterialPackingServiceProxy.getMaterialPackingService().create(
eventInfo, createInfo); eventInfo, createInfo);
// 如果是现场仓更新标签需根据批次才能找到对应的原标签
if("T".equals(receive_flag)) {
// 如果存在对应的原标签MATERIALPACKINGNAME相等就删除原标签
if(xcqueryForList != null && xcqueryForList.size() > 0) {
String delsql = "DELETE FROM MATERIALPACKING m WHERE m.CHARGE = :CHARGE AND m.MATERIALPACKINGNAME = :MATERIALPACKINGNAME";
IDMFrameServiceProxy.getSqlTemplate().update(delsql, xcHashMap);
}
}
} else { } else {
SetEventInfo setEventInfo = new SetEventInfo(); SetEventInfo setEventInfo = new SetEventInfo();
Map<String, Object> bindMap = new HashMap<String, Object>(); Map<String, Object> bindMap = new HashMap<String, Object>();
@ -477,6 +511,7 @@ public class ReturnStockIntoServiceImpl implements ReturnStockInService {
bindMap.put("SALESPERSON", queryForList.get(0).get("SALESPERSON"));//事业部 bindMap.put("SALESPERSON", queryForList.get(0).get("SALESPERSON"));//事业部
bindMap.put("CUSTOMNO", queryForList.get(0).get("CUSTOMNO"));//客户 bindMap.put("CUSTOMNO", queryForList.get(0).get("CUSTOMNO"));//客户
bindMap.put("charge",palletName.split("\\|")[4]); bindMap.put("charge",palletName.split("\\|")[4]);
setEventInfo.setUserColumns(bindMap); setEventInfo.setUserColumns(bindMap);
MaterialPackingKey materialPackingKey = new MaterialPackingKey("SDK",materialPackingName); MaterialPackingKey materialPackingKey = new MaterialPackingKey("SDK",materialPackingName);
MaterialPackingServiceProxy.getMaterialPackingService().setEvent(materialPackingKey, eventInfo, setEventInfo); MaterialPackingServiceProxy.getMaterialPackingService().setEvent(materialPackingKey, eventInfo, setEventInfo);
@ -535,9 +570,11 @@ public class ReturnStockIntoServiceImpl implements ReturnStockInService {
//重写退料入库过账同组织使用转库单BLSQ4K过账接口跨组织使用调拨4E入库接口zd.2024.9.2 //重写退料入库过账同组织使用转库单BLSQ4K过账接口跨组织使用调拨4E入库接口zd.2024.9.2
@Transactional @Transactional
public boolean ReturnStockInNew(String pc, String eventUser, String commitDate, String opCode) throws Exception { public boolean ReturnStockInNew(String pc, String eventUser, String commitDate, String opCode,List<MaterialPacking> boxList) throws Exception {
String siteName="SDK"; String siteName="SDK";
// gf现在sap退料MATERIALSHIPREQUEST无单据,不用单据过账
// 根据退库Box查询有多少退库单据分开过账 // 根据退库Box查询有多少退库单据分开过账
String wgs="SELECT DISTINCT m.RECEIVEREQUESTNAME,m.ERPLOCATION,(SELECT m2.SHIPREQUESTTYPE FROM MATERIALSHIPREQUEST m2 \r\n" + String wgs="SELECT DISTINCT m.RECEIVEREQUESTNAME,m.ERPLOCATION,(SELECT m2.SHIPREQUESTTYPE FROM MATERIALSHIPREQUEST m2 \r\n" +
" WHERE m2.SHIPREQUESTNAME=m.RECEIVEREQUESTNAME) AS SHIPREQUESTTYPE \r\n" + " WHERE m2.SHIPREQUESTNAME=m.RECEIVEREQUESTNAME) AS SHIPREQUESTTYPE \r\n" +
@ -548,24 +585,64 @@ public class ReturnStockIntoServiceImpl implements ReturnStockInService {
hashMap3.put("SITENAME", siteName); hashMap3.put("SITENAME", siteName);
List<Map<String, Object>> queryForList2 = IDMFrameServiceProxy.getSqlTemplate().queryForList(wgs, hashMap3); List<Map<String, Object>> queryForList2 = IDMFrameServiceProxy.getSqlTemplate().queryForList(wgs, hashMap3);
//判断批次是否数量是否满足单据需求 String flagList="SELECT bs.RECEIVE_FLAG FROM BS_MES_SHIPPED bs WHERE bs.SITENAME =:SITENAME AND bs.LOTNAME IN" +pc;
for (int i = 0; i < queryForList2.size(); i++) { List<Map<String, Object>> flgQueryForList = IDMFrameServiceProxy.getSqlTemplate().queryForList(flagList, hashMap3);
String receiveRequestName = queryForList2.get(i).get("RECEIVEREQUESTNAME").toString(); String receive_flag = flgQueryForList.get(0).get("RECEIVE_FLAG") == null ? "" : flgQueryForList.get(0).get("RECEIVE_FLAG").toString();
// String erpLocation = queryForList2.get(i).get("ERPLOCATION").toString();
// String shipRequestType=queryForList2.get(i).get("SHIPREQUESTTYPE").toString();
String billCode=""; String billCode="";
billCode = ToSAPServiceImpl.ReturnStockInNew("SDK", eventUser, receiveRequestName, commitDate,opCode); String aimErpFactory = "";
String aimErpLocation = "";
String aimLOcationName = "";
// 如果是T为现场仓退料N无现场仓
if (receive_flag.equals("T")) {
List<MaterialPackingKey> arrayList = new ArrayList<MaterialPackingKey> ();
for (int i = 0; i < boxList.size(); i++) {
MaterialPackingKey materialPackingKey = new MaterialPackingKey(siteName, boxList.get(i).getMaterialPackingName());
arrayList.add(materialPackingKey);
}
//先入到线边仓从线边再转库
aimErpFactory = boxList.get(0).getErpFactory();
aimErpLocation = boxList.get(0).getErpLocation();
aimLOcationName = boxList.get(0).getLocationName();
billCode = ToSAPServiceImpl.NoSourceChangeLocation(arrayList,aimErpFactory,
aimErpLocation, aimLOcationName, eventUser );
if (billCode.length() == 0) { if (billCode.length() == 0) {
throw new GlobalException("报送ERP失败,请联系IT处理"); throw new GlobalException("报送ERP失败,请联系IT处理");
} }
}else {
billCode = ToSAPServiceImpl.ReturnStockInNew("SDK", eventUser, "", commitDate,opCode);
if (billCode.length() == 0) {
throw new GlobalException("报送ERP失败,请联系IT处理");
}
}
// gf 现在退料无单据不用单据过账
//判断批次是否数量是否满足单据需求
// for (int i = 0; i < queryForList2.size(); i++) {
// String receiveRequestName = queryForList2.get(i).get("RECEIVEREQUESTNAME").toString();
String receiveRequestName = "";
// String erpLocation = queryForList2.get(i).get("ERPLOCATION").toString();
// String shipRequestType=queryForList2.get(i).get("SHIPREQUESTTYPE").toString();
// 如果不是T现场仓
// if (!receive_flag.equals("T")) {
// billCode = ToSAPServiceImpl.ReturnStockInNew("SDK", eventUser, receiveRequestName, commitDate,opCode);
//
// if (billCode.length() == 0) {
// throw new GlobalException("报送ERP失败,请联系IT处理");
// }
// }
EventInfo makeEventInfo = new EventInfoUtil().makeEventInfo("ReturnStockIn", eventUser, "ReturnStockIn"); EventInfo makeEventInfo = new EventInfoUtil().makeEventInfo("ReturnStockIn", eventUser, "ReturnStockIn");
// 更新抬头文本状态和Box状态 // 更新抬头文本状态和Box状态
/*String sql = "SELECT M.SITENAME ,M.MATERIALPACKINGNAME FROM MATERIALPACKING M WHERE M.RECEIVEREQUESTNAME = :RECEIVEREQUESTNAME AND ERPLOCATION = :ERPLOCATION AND m.MATERIALPACKINGNAME IN " /*String sql = "SELECT M.SITENAME ,M.MATERIALPACKINGNAME FROM MATERIALPACKING M WHERE M.RECEIVEREQUESTNAME = :RECEIVEREQUESTNAME AND ERPLOCATION = :ERPLOCATION AND m.MATERIALPACKINGNAME IN "
+ pc;*/ + pc;*/
String sql = "SELECT M.SITENAME ,M.MATERIALPACKINGNAME,M.CHARGE FROM MATERIALPACKING M WHERE M.RECEIVEREQUESTNAME = :RECEIVEREQUESTNAME AND m.MATERIALPACKINGNAME IN " // String sql = "SELECT M.SITENAME ,M.MATERIALPACKINGNAME,M.CHARGE FROM MATERIALPACKING M WHERE M.RECEIVEREQUESTNAME = :RECEIVEREQUESTNAME AND m.MATERIALPACKINGNAME IN "
+ pc; // + pc;
String sql = "SELECT M.SITENAME ,M.MATERIALPACKINGNAME,M.CHARGE FROM MATERIALPACKING M WHERE m.MATERIALPACKINGNAME IN " + pc;
Map<String, Object> hashMap = new HashMap<String, Object>(); Map<String, Object> hashMap = new HashMap<String, Object>();
hashMap.put("RECEIVEREQUESTNAME", receiveRequestName); // hashMap.put("RECEIVEREQUESTNAME", receiveRequestName);
// hashMap.put("ERPLOCATION", erpLocation); // hashMap.put("ERPLOCATION", erpLocation);
List<String> chargeList = new ArrayList<> (); List<String> chargeList = new ArrayList<> ();
List<Map<String, Object>> queryForList = IDMFrameServiceProxy.getSqlTemplate().queryForList(sql, hashMap); List<Map<String, Object>> queryForList = IDMFrameServiceProxy.getSqlTemplate().queryForList(sql, hashMap);
@ -576,6 +653,14 @@ public class ReturnStockIntoServiceImpl implements ReturnStockInService {
Map<String, Object> bindMap = new HashMap<String, Object>(); Map<String, Object> bindMap = new HashMap<String, Object>();
bindMap.put("unDoID", billCode); bindMap.put("unDoID", billCode);
bindMap.put("stockState", "Stocked"); bindMap.put("stockState", "Stocked");
// 如果是现场仓 把原标签更新为目标组织仓库货位
if("T".equals(receive_flag)) {
bindMap.put("erpFactory", aimErpFactory);
bindMap.put("erpLocation", aimErpLocation);
bindMap.put("locationName", aimLOcationName);
}
setEventInfo.setUserColumns(bindMap); setEventInfo.setUserColumns(bindMap);
MaterialPackingServiceProxy.getMaterialPackingService().setEvent(materialPackingKey, makeEventInfo, MaterialPackingServiceProxy.getMaterialPackingService().setEvent(materialPackingKey, makeEventInfo,
setEventInfo); setEventInfo);
@ -603,7 +688,7 @@ public class ReturnStockIntoServiceImpl implements ReturnStockInService {
// throw new GlobalException("MES返回报错:" + msg); // throw new GlobalException("MES返回报错:" + msg);
// } // }
} // }
return true; return true;

View File

@ -4,20 +4,20 @@
<mapper namespace="com.cim.idm.dao.ProduceReturnDao"> <mapper namespace="com.cim.idm.dao.ProduceReturnDao">
<select id="getMaterialPacking" resultType="map"> <select id="getMaterialPacking" resultType="map">
SELECT mp.MATERIALPACKINGNAME, mp.MATERIALSPECNAME, mp.PHASE, mp.PACKINGGRADE, SELECT mp.LOTNAME MATERIALPACKINGNAME, mp.PRODUCTSPECNAME MATERIALSPECNAME, mp.PHASE, mp.PACKINGGRADE,
mp.STOCKSTATE, mp.RECEIVEACTNO, mp.CHARGE, m.DESC_CN, #{erpFactory} AS ERPFACTORY, mp.CHARGE, m.DESC_CN, #{erpFactory} AS ERPFACTORY,
#{erpLocation} AS ERPLOCATION, #{locationName} AS LOCATIONNAME, #{erpLocation} AS ERPLOCATION, #{locationName} AS LOCATIONNAME,
mp.materialquantity MATERIALQUANTITY, mp.UNIT mp.QTY MATERIALQUANTITY, mp.UNIT
FROM MATERIALPACKING mp FROM BS_MES_SHIPPED mp
LEFT JOIN MATERIALSPEC m ON m.MATERIALSPECNAME = mp.MATERIALSPECNAME LEFT JOIN MATERIALSPEC m ON m.MATERIALSPECNAME = mp.PRODUCTSPECNAME
WHERE mp.MATERIALPACKINGNAME = #{name} WHERE mp.LOTNAME = #{name}
</select> </select>
<select id="getMesShip" resultType="map"> <select id="getMesShip" resultType="map">
select bms.PRODUCTSPECNAME as MATERIALSPECNAME, bms.REQUESTNAME as RECEIVEREQUESTNAME, select bms.PRODUCTSPECNAME as MATERIALSPECNAME, bms.REQUESTNAME as RECEIVEREQUESTNAME,
0 as HAVEQUANTITY, sum(bms.QTY) as TOTALQTY, bms.UNIT 0 as HAVEQUANTITY, sum(bms.QTY) as TOTALQTY, bms.UNIT
FROM BS_MES_SHIPPED bms FROM BS_MES_SHIPPED bms
where LOTNAME = #{name} where bms.LOTNAME = #{name}
GROUP BY bms.REQUESTNAME, bms.PRODUCTSPECNAME, bms.UNIT GROUP BY bms.REQUESTNAME, bms.PRODUCTSPECNAME, bms.UNIT
</select> </select>
</mapper> </mapper>

View File

@ -43,6 +43,15 @@
#{box.materialPackingName} #{box.materialPackingName}
</foreach> </foreach>
</update> </update>
<!-- 更新库存状态 -->
<update id="updateLocationStockState" parameterType="map">
UPDATE MATERIALPACKING
SET STOCKSTATE = #{stockState},UNDOID = #{undoId}, ERPLOCATION = #{aimErpLocation}, LOCATIONNAME = #{aimLOcationName}, ERPFACTORY = #{aimErpFactory}
WHERE MATERIALPACKINGNAME IN
<foreach item="box" index="index" collection="boxList" open="(" separator="," close=")">
#{box.materialPackingName}
</foreach>
</update>
<!-- 基于形态转换更新物料编码--> <!-- 基于形态转换更新物料编码-->
<update id="updateMaterialCode" parameterType="map"> <update id="updateMaterialCode" parameterType="map">
UPDATE MATERIALPACKING m UPDATE MATERIALPACKING m