Merge remote-tracking branch 'origin/main'

This commit is contained in:
mzr 2025-05-29 10:42:50 +08:00
commit 7eaf583270
2 changed files with 48 additions and 18 deletions

View File

@ -302,22 +302,7 @@ public class AfterApproveRuleSyncMes implements IRule<PMOAggVO> {
} }
// 通过自定义属性传 // 通过自定义属性传
JSONArray properties = new JSONArray(); JSONArray properties = buildProperties(head, item);
JSONObject SXZF16 = new JSONObject();
JSONObject SXZF17 = new JSONObject();
JSONObject SXZF18 = new JSONObject();
SXZF16.put("propertyFiled", "SXZF16");
SXZF17.put("propertyFiled", "SXZF17");
SXZF18.put("propertyFiled", "SXZF18");
SXZF16.put("propertyValue", item.getVparentbillcode());
SXZF17.put("propertyValue", item.getVparentmorowno());
SXZF18.put("propertyValue", head.getVtrantypecode());
properties.add(SXZF16);
properties.add(SXZF17);
properties.add(SXZF18);
data.put("properties", properties); data.put("properties", properties);
JSONObject requestPayload = new JSONObject(); JSONObject requestPayload = new JSONObject();
@ -334,6 +319,51 @@ public class AfterApproveRuleSyncMes implements IRule<PMOAggVO> {
obmlog.info("生产订单 " + vbillcode + "" + itemRow + " 已成功发送到MES系统或特定错误已被记录。"); obmlog.info("生产订单 " + vbillcode + "" + itemRow + " 已成功发送到MES系统或特定错误已被记录。");
} }
/**
* 构建MES同步所需的properties数组
*
* @param head 生产订单表头
* @param item 生产订单明细
* @return JSONArray properties数组
*/
private JSONArray buildProperties(PMOHeadVO head, PMOItemVO item) {
JSONArray properties = new JSONArray();
// SXZF16 - 上级生产订单号
addProperty(properties, "SXZF16", item.getVparentbillcode());
// SXZF17 - 上级生产订单行号
addProperty(properties, "SXZF17", item.getVparentmorowno());
// SXZF18 - 生产订单交易类型编码
addProperty(properties, "SXZF18", head.getVtrantypecode());
// SXZF22 - 生产订单交易类型编码
addProperty(properties, "SXZF22", head.getVtrantypecode());
// SXZF23 - 生产订单主键
addProperty(properties, "SXZF23", head.getCpmohid());
// SXZF24 - 生产订单明细主键
addProperty(properties, "SXZF24", item.getCmoid());
return properties;
}
/**
* 添加单个property到properties数组
*
* @param properties JSONArray数组
* @param propertyField 属性字段名
* @param propertyValue 属性值
*/
private void addProperty(JSONArray properties, String propertyField, String propertyValue) {
JSONObject property = new JSONObject();
property.put("propertyFiled", propertyField);
property.put("propertyValue", propertyValue);
properties.add(property);
}
/** /**
* 根据主键查询编码 * 根据主键查询编码

View File

@ -1558,7 +1558,7 @@ public class APIBomBusinessServiceImpl implements IAPIBomBusinessService {
try { try {
// ²éѯ×éÖ¯±àÂë // ²éѯ×éÖ¯±àÂë
String sql = "SELECT code FROM org_orgs WHERE pk_org = ?"; String sql = "SELECT code FROM org_orgs WHERE dr = 0 and pk_org = ?";
SQLParameter param = new SQLParameter(); SQLParameter param = new SQLParameter();
param.addParam(pk_org); param.addParam(pk_org);
String orgCode = (String) DAO.executeQuery(sql, param, new ColumnProcessor()); String orgCode = (String) DAO.executeQuery(sql, param, new ColumnProcessor());
@ -1588,7 +1588,7 @@ public class APIBomBusinessServiceImpl implements IAPIBomBusinessService {
StringBuilder sql = new StringBuilder(); StringBuilder sql = new StringBuilder();
sql.append("SELECT MAX(TO_NUMBER(hversion)) as max_version "); sql.append("SELECT MAX(TO_NUMBER(hversion)) as max_version ");
sql.append("FROM bd_bom "); sql.append("FROM bd_bom ");
sql.append("WHERE pk_org = ? "); sql.append("WHERE dr = 0 and pk_org = ? ");
SQLParameter param = new SQLParameter(); SQLParameter param = new SQLParameter();
param.addParam(pk_org); param.addParam(pk_org);