From be9ea94944d433e8f9f3a91d7ace71a2fd2675d1 Mon Sep 17 00:00:00 2001 From: mzr Date: Thu, 18 Dec 2025 19:40:38 +0800 Subject: [PATCH] =?UTF-8?q?=E7=9C=9F=E7=A9=BAMES-=E6=B5=81=E7=A8=8B?= =?UTF-8?q?=E7=94=9F=E4=BA=A7=E8=AE=A2=E5=8D=95=E6=8E=A8=E9=80=81=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bp/rule/AfterPmoSyncZkMesRule.java | 21 ++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/mmpac/src/private/nc/bs/mmpac/pmo/pac0002/bp/rule/AfterPmoSyncZkMesRule.java b/mmpac/src/private/nc/bs/mmpac/pmo/pac0002/bp/rule/AfterPmoSyncZkMesRule.java index 141b220b..9e42e7b8 100644 --- a/mmpac/src/private/nc/bs/mmpac/pmo/pac0002/bp/rule/AfterPmoSyncZkMesRule.java +++ b/mmpac/src/private/nc/bs/mmpac/pmo/pac0002/bp/rule/AfterPmoSyncZkMesRule.java @@ -19,6 +19,7 @@ import nc.vo.mmpac.pmo.pac0002.entity.PMOHeadVO; import nc.vo.mmpac.pmo.pac0002.entity.PMOItemVO; import nc.vo.org.DeptVO; import nc.vo.org.OrgVO; +import nc.vo.pmpub.project.ProjectHeadVO; import nc.vo.pub.BusinessException; import nc.vo.pub.lang.UFDate; @@ -89,6 +90,9 @@ public class AfterPmoSyncZkMesRule implements IRule { String cpmohid = pmoHeadVO.getCpmohid(); String vbillcode = pmoHeadVO.getVbillcode(); UFDate dbilldate = pmoHeadVO.getDbilldate(); + // 判断单据类型,部分类型的生产订单推送 + String vtrantypecode = pmoHeadVO.getVtrantypecode(); + if (!checkBillType(vtrantypecode)) continue; // 组装数据 String SendDate = ""; if (dbilldate != null) { @@ -97,14 +101,16 @@ public class AfterPmoSyncZkMesRule implements IRule { for (PMOItemVO item : itemVOS) { // 物料 String cmaterialid = item.getCmaterialid(); - String materialCode = MyHelper.getStrValByCondition(MaterialVO.getDefaultTableName(), MaterialVO.CODE, - MaterialVO.PK_MATERIAL + " = '" + cmaterialid + "'"); + MaterialVO materialVO = (MaterialVO) hyPub.queryByPrimaryKey(MaterialVO.class, cmaterialid); + String materialCode = materialVO.getCode(); String cdeptid = item.getCdeptid(); - Object deptCode = hyPub.findColValue(DeptVO.getDefaultTableName(), DeptVO.CODE, - "pk_dept = '" + cdeptid + "'"); + DeptVO deptVO = (DeptVO) hyPub.queryByPrimaryKey(DeptVO.class, cdeptid); String castunitid = item.getCastunitid(); Object unitCode = hyPub.findColValue(MeasdocVO.getDefaultTableName(), MeasdocVO.CODE, "pk_measdoc = '" + castunitid + "'"); + String cprojectid = item.getCprojectid(); + Object projectName = hyPub.findColValue(ProjectHeadVO.getDefaultTableName(), ProjectHeadVO.PROJECT_NAME, + "pk_project = '" + cprojectid + "'"); JSONObject itemObj = new JSONObject(); itemObj.put("WorkOrderNo", vbillcode);// 工单号 itemObj.put("SendDate", SendDate);// 接收日期 @@ -113,7 +119,12 @@ public class AfterPmoSyncZkMesRule implements IRule { itemObj.put("OrderNum", item.getNastnum().toString());// 工单数量 itemObj.put("materialvid", materialCode);// 物料编码 itemObj.put("unitid", unitCode);// 计量单位编码 - itemObj.put("deptid", deptCode);// 部门编码 + if (deptVO != null) { + itemObj.put("deptid", deptVO.getCode());// 部门编码 + itemObj.put("DeptName", deptVO.getName());// 部门名称 + } + itemObj.put("ProjectCodeName", projectName);// 项目名称 + itemObj.put("LongRemark", materialVO.getMemo());// 物料长描述 String param = JSON.toJSONString(itemObj); pushData(param); }