真空MES-流程生产订单推送调整
This commit is contained in:
parent
b28194ae8c
commit
be9ea94944
|
|
@ -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<PMOAggVO> {
|
|||
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<PMOAggVO> {
|
|||
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<PMOAggVO> {
|
|||
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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue