diff --git a/qc/src/private/nc/bs/qc/c003/maintain/rule/SyncQcQmsRule.java b/qc/src/private/nc/bs/qc/c003/maintain/rule/SyncQcQmsRule.java index 774b0ebe..2892a595 100644 --- a/qc/src/private/nc/bs/qc/c003/maintain/rule/SyncQcQmsRule.java +++ b/qc/src/private/nc/bs/qc/c003/maintain/rule/SyncQcQmsRule.java @@ -73,9 +73,8 @@ public class SyncQcQmsRule implements IRule { ArriveVO[] arriveVOS = billquery.query(firstIds.toArray(new String[0])); buildSyncData(arriveVOS); } - // 组织数据 - // buildSyncData(reportVOS); } catch (Exception e) { + logger.error("SyncQcQmsRule-exp:" + e.getMessage(), e); ExceptionUtils.wrappException(e); } } @@ -108,7 +107,7 @@ public class SyncQcQmsRule implements IRule { UserVO.CUSERID + " = '" + hvo.getBillmaker() + "'"); JSONObject singleObj = new JSONObject(); // 采购合同号 - String cghth = getCghthVal(bvo); + String cghth = getCghthVal(hvo, bvo); // 启源送检单主表 long cts = System.currentTimeMillis(); singleObj.put("batchid", cts); @@ -150,8 +149,15 @@ public class SyncQcQmsRule implements IRule { } } - private String getCghthVal(ArriveItemVO[] bvo) { + private String getCghthVal(ArriveHeaderVO hvo, ArriveItemVO[] bvo) throws BusinessException { String cghth = ""; + String pkPupsndoc = hvo.getPk_pupsndoc(); + // 查询采购员名称 + String name = ""; + if (pkPupsndoc != null && !pkPupsndoc.isEmpty() && !"~".equals(pkPupsndoc)) { + name = MyHelper.getStrValByCondition(PsndocVO.getDefaultTableName(), PsndocVO.NAME, + PsndocVO.PK_PSNDOC + "'" + pkPupsndoc + "'"); + } if (bvo != null && bvo.length > 0) { StringBuilder cghthBuilder = new StringBuilder(); for (int i = 0; i < bvo.length; i++) { @@ -163,7 +169,9 @@ public class SyncQcQmsRule implements IRule { cghthBuilder.append(","); } cghthBuilder.append(vsourcecode); - // 查询采购员名称 + if (!name.isEmpty()) { + cghthBuilder.append(name); + } } cghth = cghthBuilder.toString(); }