fix:修改成品入库创建标签

This commit is contained in:
郭飞 2025-05-10 16:57:01 +08:00
parent 73cd81d64d
commit 8e29bdb184
6 changed files with 60 additions and 21 deletions

View File

@ -590,7 +590,7 @@ public class MESServiceImpl implements MESService{
jsonObject.put("expiringDate", list.get(i).get("EXPIRINGDATE"));
jsonObject.put("productName", list.get(i).get("DESCRIPTION"));
jsonObject.put("productStage", list.get(i).get("PHASE"));
jsonObject.put("practicalSpec", list.get(i).get("TRUEGG"));
jsonObject.put("practicalSpec", list.get(i).get("TRUEGG") == null ? "" : list.get(i).get("TRUEGG").toString());
jsonObject.put("productQuantity", list.get(i).get("MATERIALQUANTITY"));
jsonObject.put("productQuantityUnit", list.get(i).get("MATERIALUNIT"));
jsonObject.put("auxiliaryUnit", list.get(i).get("FUNIT"));

View File

@ -4935,7 +4935,7 @@ public class ToSAPServiceImpl {
//将log写到表里
UUID uuid = UUID.randomUUID();
ErpMessageLog erplog = new ErpMessageLog();
erplog.setEventUser("");
erplog.setEventUser(user);
erplog.setServerName("WmsToErp");
erplog.setEventName("无来源转库-311");
erplog.setId(uuid.toString());

View File

@ -13,6 +13,8 @@ import com.cim.idm.utils.AjaxResult;
import com.cim.idm.utils.Constant;
import com.cim.idm.utils.SessionManager;
import com.cim.idm.utils.TokenManager;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import io.swagger.annotations.*;
import lombok.extern.slf4j.Slf4j;
import org.json.JSONArray;
@ -111,8 +113,13 @@ public class LoginController {
apiResponse.setStatus(Constant.RESPONSE_STATUS_SUCCESS);
// 获取字符串中userInfo 里的USERNAME
ObjectMapper objectMapper = new ObjectMapper();
JsonNode objectUserInfo = objectMapper.readTree(userInfo);
String userCnName = objectUserInfo.get("USERNAME").asText();
//添加session到返回报文
apiResponse.setData(String.format("{\"SITENAME\":\"%s\",\"USERNAME\":\"%s\",\"token\":\"%s\",\"session\":\"%s\",\"menuList\":\"%s\"}", siteName, username, token,session,menuList));
apiResponse.setData(String.format("{\"SITENAME\":\"%s\",\"USERNAME\":\"%s\",\"USERCNNAME\":\"%s\",\"token\":\"%s\",\"session\":\"%s\",\"menuList\":\"%s\"}", siteName, username, userCnName, token,session,menuList));
apiResponse.setMessage("登录成功");
return ResponseEntity.ok(apiResponse);

View File

@ -376,7 +376,7 @@ public class InvoiceServiceImpl implements InvoiceService {
String ERPLOCATION = receiveList.get(0).get("ERPLOCATION") == null ? "" : receiveList.get(0).get("ERPLOCATION").toString();
String ERPRECEIVEFACTORY = receiveList.get(0).get("ERPRECEIVEFACTORY") == null ? "" : receiveList.get(0).get("ERPRECEIVEFACTORY").toString();
//判断是否为MES需要接收的物料
//判断是否为MES需要二次接收的物料
String sqlc=" SELECT e.ENUMVALUE FROM MES_ENUMDEFVALUE e \r\n" +
" WHERE e.ENUMNAME ='ConfirmReceiveArea'\r\n" +
" AND e.ENUMVALUE in(\r\n" +
@ -598,10 +598,10 @@ public class InvoiceServiceImpl implements InvoiceService {
billCode=saleStockOut_NEW(shipRequestName, "SDK", eventUser,materialPackingKeyList,commitDate);
untils.SaveUnDoInfo_ForSap(materialPackingKeyList, billCode, makeEventInfo);
break;
case "OEM":
case "08": // 委外
case "OEM": // 委外
// billCode=toSAPService.oemStockOut_NEW(shipRequestName, "SDK", eventUser,materialPackingKeyList);
billCode=oemStockOut_NEW(shipRequestName, "SDK", eventUser,materialPackingKeyList);
billCode=oemStockOut_NEW(shipRequestName, "SDK", eventUser,materialPackingKeyList, commitDate);
untils.SaveUnDoInfo_ForSap(materialPackingKeyList, billCode, makeEventInfo);
break;
default :
@ -2573,7 +2573,7 @@ public class InvoiceServiceImpl implements InvoiceService {
}
//重写委外发料zd.2024.8.17
public String oemStockOut_NEW(String shipRequestName, String siteName, String user,List<String> boxList) throws Exception
public String oemStockOut_NEW(String shipRequestName, String siteName, String user,List<String> boxList, String commitDate) throws Exception
{
String rcode;
@ -2659,10 +2659,15 @@ public class InvoiceServiceImpl implements InvoiceService {
*/
body.put("ITEM", itemArray);
body.put("ITEMID", uniqueID);
SimpleDateFormat inputFormat = new SimpleDateFormat("yyyy-MM-dd");
SimpleDateFormat outputFormat = new SimpleDateFormat("yyyyMMdd");
Date date = inputFormat.parse(commitDate);
String outputDate = outputFormat.format(date);
//过账日期
body.put("BUDAT", TimeStampUtil.getCurrentTime("yyyyMMdd"));
body.put("BUDAT", outputDate);
//凭证日期
body.put("BLDAT", TimeStampUtil.getCurrentTime("yyyyMMdd"));
body.put("BLDAT", outputDate);
//凭证抬头文本
body.put("BKTXT", uniqueID);
//用户名

View File

@ -395,20 +395,39 @@ public class MESToWMSServiceImpl implements MESToWMSService {
boxIdList.add(charge);
barCodeList.add(jb.get("lotName").toString());
}
String sqld = "SELECT b.charge FROM BS_MES_SHIPPED b WHERE b.CHARGE in(:BOXIDLIST) ";
String sqld = "SELECT b.charge,b.RECEIVE_FLAG,b.LOTNAME FROM BS_MES_SHIPPED b WHERE b.CHARGE in(:BOXIDLIST) ";
Map<String, Object> hashMap = new HashMap<>();
hashMap.put("BOXIDLIST", boxIdList);
List<Map<String, Object>> existShips = sqlTemplate.queryForList(sqld, hashMap);
if (existShips != null && existShips.size() > 0) {
List<String> lots = new ArrayList<>();
for (Map<String, Object> existShip : existShips) {
String receiveFlag = (String) existShip.get("RECEIVE_FLAG");
String lot = (String) existShip.get("charge");
String lotName = (String) existShip.get("LOTNAME");
if(!"N".equals(receiveFlag)) {
lots.add(lot);
}
result = AjaxResult.me().setSuccess(false).setErrorCode(500).setMessage("执行失败:" + lots + " 已经SHIP,请不要重复SHIP");
else {
String querypacksql = "SELECT * FROM MATERIALPACKING m WHERE MATERIALPACKINGNAME =:MATERIALPACKINGNAME";
Map<String, Object> hashMap2 = new HashMap<>();
hashMap2.put("MATERIALPACKINGNAME", lotName);
List<Map<String, Object>> queryPackForList = IDMFrameServiceProxy.getSqlTemplate().queryForList(querypacksql, hashMap2);
if(queryPackForList.size() > 0) {
String deletePackSql="DELETE FROM MATERIALPACKING WHERE MATERIALPACKINGNAME=?";
Object[] obj=new Object[] {lotName};
IDMFrameServiceProxy.getSqlTemplate().update(deletePackSql, obj);
}
String deleteSql="DELETE FROM BS_MES_SHIPPED WHERE CHARGE=?";
Object[] obj=new Object[] {lot};
IDMFrameServiceProxy.getSqlTemplate().update(deleteSql, obj);
}
}
if(lots.size() > 0) {
result = AjaxResult.me().setSuccess(false).setErrorCode(500).setMessage("执行失败:" + lots + " 已经SHIP并且使用,请不要重复SHIP");
return result;
}
}
String needIqcSql = SystemPropHelper.CR + "SELECT IQCFLAG "
+ " FROM BS_MATERIALFACTORY bm "
+ " WHERE bm.MATERIALSPECNAME = :MATERIALSPECNAME "

View File

@ -28,11 +28,20 @@
T.QTY MaterialCreateQuantity,
T.RECEIVE_FLAG mesReceiveFlag,
'SDK' siteName,
'Released' PackingState,
CASE
WHEN T.PACKINGGRADE IS NULL THEN 'PREOQA'
ELSE 'END'
END AS oqaResultState,
CASE
WHEN T.PACKINGGRADE IS NOT NULL THEN T.PACKINGGRADE
ELSE NULL
END AS oqaResult,
T.PACKINGGRADE packingGrade,
'Released' packingState,
'Created' stockState,
'Created' OldStockState,
'N' HoldState,
'Box' MATERIALPACKINGTYPE,
'Created' oldStockState,
'N' holdState,
'Box' materialPackingType,
T.DURABLETYPE durableType,
#{erpFactory} ERPFactory,
#{erpLocation} ERPLOCATION,
@ -54,14 +63,13 @@
T.SDK_ID ,
T.AREA ,
T.SHIPUSER ,
T.PACKINGGRADE ,
T.PACKINGGRADEDETAIL ,
T.SHIPTIME ,
M3.MATERIALTYPE ,
T.PHASE,
T.GXID,
T.CHARGE,
T.TRUEGG,
T.SDK_ID truegg,
T.MJPC,
T.MATERIALSPECTYPE
FROM