diff --git a/mmpac/src/private/nc/bs/mmpac/pmo/pac0002/bp/rule/AfterApproveSyncHighpressureMesRule.java b/mmpac/src/private/nc/bs/mmpac/pmo/pac0002/bp/rule/AfterApproveSyncHighpressureMesRule.java index fdad176e..f33b97c0 100644 --- a/mmpac/src/private/nc/bs/mmpac/pmo/pac0002/bp/rule/AfterApproveSyncHighpressureMesRule.java +++ b/mmpac/src/private/nc/bs/mmpac/pmo/pac0002/bp/rule/AfterApproveSyncHighpressureMesRule.java @@ -108,12 +108,12 @@ public class AfterApproveSyncHighpressureMesRule implements IRule { JSONObject itemObj = new JSONObject(); // 填充子项基础信息 - String sql = " select pk_defdoclist from bd_defdoclist where code='zdy-001' and dr=0 "; - String o = (String) baseDAO.executeQuery(sql, new ColumnProcessor()); +// String sql = " select pk_defdoclist from bd_defdoclist where code='zdy-001' and dr=0 "; +// String o = (String) baseDAO.executeQuery(sql, new ColumnProcessor()); - Object contractNum = hybo.findColValue("bd_defdoc", "code", " (pk_defdoclist = '" + o + "' and pk_defdoc='" + item.getVdef1() + "') "); + Object contractNum = hybo.findColValue("bd_defdoc", "code", " (pk_defdoc='" +item.getVdef2() + "') "); - itemObj.put("contractNum", item.getVdef2()); // 销售订单号 + itemObj.put("contractNum",contractNum ); // 销售订单号 Object cwarehouseid = hybo.findColValue("bd_stordoc", "code", " (pk_stordoc = '" + item.getAttributeValue("vbdef35") + "') "); @@ -132,10 +132,14 @@ public class AfterApproveSyncHighpressureMesRule implements IRule { // 日期信息 itemObj.put("requiredDate", item.getTrequiredate().toString()); // 需用日期 - itemObj.put("bipParentProcessProductionOrderId", item.getVparentbillcode()); - itemObj.put("bipParentProcessProductionOrderRowNum", item.getVparentmorowno()); - itemObj.put("bipOriginProcessProductionOrderId", item.getVsrccode()); - itemObj.put("bipOriginProcessProductionOrderRowNum", item.getVsrcrowno()); + if("55A2".equals(item.getVsrctype())){ + itemObj.put("bipParentProcessProductionOrderId", item.getVparentbillcode()); + itemObj.put("bipParentProcessProductionOrderRowNum", item.getVparentmorowno()); + } + if("55A2".equals(item.getVfirsttype())){ + itemObj.put("bipOriginProcessProductionOrderId", item.getVfirstcode()); + itemObj.put("bipOriginProcessProductionOrderRowNum", item.getVfirstrowno()); + } // 物料信息 String mrlsql = "select code,name,graphid,pk_measdoc,materialtype from bd_material where pk_material = '" + cmaterialvid + "' "; @@ -170,13 +174,13 @@ public class AfterApproveSyncHighpressureMesRule implements IRule { JSONObject itemObj = new JSONObject(); // 填充子项基础信息 +// +// String sql = " select pk_defdoclist from bd_defdoclist where code='zdy-001' and dr=0 "; +// String o = (String) baseDAO.executeQuery(sql, new ColumnProcessor()); - String sql = " select pk_defdoclist from bd_defdoclist where code='zdy-001' and dr=0 "; - String o = (String) baseDAO.executeQuery(sql, new ColumnProcessor()); + Object contractNum = hybo.findColValue("bd_defdoc", "code", " (pk_defdoc='" + item.getVdef2() + "') "); - // Object contractNum = hybo.findColValue("bd_defdoc", "code", " (pk_defdoclist = '" + o + "' and pk_defdoc='" + item.getVdef1() + "') "); - - itemObj.put("contractNum", item.getVdef2()); // 合同编号 + itemObj.put("contractNum", contractNum); // 合同编号 // itemObj.put("cwarehouseid", item.getAttributeValue("vbdef35")); // 仓库编号 Object pk_project = hybo.findColValue("bd_project", "project_name", " pk_project = '" + item.getCprojectid() + "' "); @@ -233,6 +237,7 @@ public class AfterApproveSyncHighpressureMesRule implements IRule { itemObj.put("customerMaterialCode", item.getCcustmaterialid()); // 客户物料编码 itemObj.put("productionBatch", item.getCbatchid()); // 生产批次(按BIP格式) itemObj.put("productionBatchNumber", item.getVbatchcode()); // 生产批次号(按BIP格式) + itemObj.put("orderQuantity", item.getNastnum().doubleValue()); contentArray.add(itemObj); // 将子项添加到数组