质检报告删除推送qms

This commit is contained in:
lihao 2025-10-20 14:30:24 +08:00
parent cfcba80d31
commit 4df22f0b94
1 changed files with 11 additions and 6 deletions

View File

@ -29,9 +29,7 @@ import nc.vo.qc.c003.entity.ReportVO;
import nc.vo.sm.UserVO; import nc.vo.sm.UserVO;
import nccloud.baseapp.core.log.NCCForUAPLogger; import nccloud.baseapp.core.log.NCCForUAPLogger;
import java.util.HashSet; import java.util.*;
import java.util.Map;
import java.util.Set;
public class SyncDeleteQcQmsRule implements IRule<ReportVO> { public class SyncDeleteQcQmsRule implements IRule<ReportVO> {
@ -51,6 +49,7 @@ public class SyncDeleteQcQmsRule implements IRule<ReportVO> {
throw new BusinessException("箱变的QMS接口缺少配置"); throw new BusinessException("箱变的QMS接口缺少配置");
} }
Set<String> firstIds = new HashSet<>(); Set<String> firstIds = new HashSet<>();
List<String> cfirstbids =new ArrayList<>();
// 查询上游到货单的数据 // 查询上游到货单的数据
for (ReportVO vo : reportVOS) { for (ReportVO vo : reportVOS) {
ReportItemVO[] bvo = vo.getBVO(); ReportItemVO[] bvo = vo.getBVO();
@ -59,13 +58,14 @@ public class SyncDeleteQcQmsRule implements IRule<ReportVO> {
} }
for (ReportItemVO itemVO : bvo) { for (ReportItemVO itemVO : bvo) {
firstIds.add(itemVO.getCfirstid()); firstIds.add(itemVO.getCfirstid());
cfirstbids.add(itemVO.getCfirstbid());
} }
} }
if (!firstIds.isEmpty()) { if (!firstIds.isEmpty()) {
// 上游到货单 // 上游到货单
BillQuery<ArriveVO> billquery = new BillQuery(ArriveVO.class); BillQuery<ArriveVO> billquery = new BillQuery(ArriveVO.class);
ArriveVO[] arriveVOS = billquery.query(firstIds.toArray(new String[0])); ArriveVO[] arriveVOS = billquery.query(firstIds.toArray(new String[0]));
buildSyncData(arriveVOS); buildSyncData(arriveVOS,cfirstbids);
} }
} catch (Exception e) { } catch (Exception e) {
logger.error("SyncQcQmsRule-exp:" + e.getMessage(), e); logger.error("SyncQcQmsRule-exp:" + e.getMessage(), e);
@ -78,7 +78,7 @@ public class SyncDeleteQcQmsRule implements IRule<ReportVO> {
* *
* @param arriveVOS 到货单VO * @param arriveVOS 到货单VO
*/ */
private void buildSyncData(ArriveVO[] arriveVOS) throws BusinessException { private void buildSyncData(ArriveVO[] arriveVOS,List<String> cfirstbids) throws BusinessException {
for (ArriveVO arriveVO : arriveVOS) { for (ArriveVO arriveVO : arriveVOS) {
ArriveHeaderVO hvo = arriveVO.getHVO(); ArriveHeaderVO hvo = arriveVO.getHVO();
ArriveItemVO[] bvo = arriveVO.getBVO(); ArriveItemVO[] bvo = arriveVO.getBVO();
@ -131,7 +131,12 @@ public class SyncDeleteQcQmsRule implements IRule<ReportVO> {
String materialtype = skipNull(materialMap.get("materialtype")); String materialtype = skipNull(materialMap.get("materialtype"));
String materialspec = skipNull(materialMap.get("materialspec")); String materialspec = skipNull(materialMap.get("materialspec"));
itemObj.put("wlxhgg", materialtype + materialspec); // 物料型号规格 itemObj.put("wlxhgg", materialtype + materialspec); // 物料型号规格
itemObj.put("sjsl", "0"); // 送检数量设计单位按设计计量单位统计的送检数量 if(cfirstbids.contains(reportItemVO.getCfirstbid())){
itemObj.put("sjsl", "0"); // 送检数量设计单位按设计计量单位统计的送检数量
}else{
itemObj.put("sjsl", reportHeaderVO.getNapplynum().toString()); // 送检数量设计单位按设计计量单位统计的送检数量
}
itemObj.put("jldw", cunitname); // 计量单位 itemObj.put("jldw", cunitname); // 计量单位
itemObj.put("bz", reportItemVO.getVbdef1()); // 明细备注用于填写该送检物料的补充说明 itemObj.put("bz", reportItemVO.getVbdef1()); // 明细备注用于填写该送检物料的补充说明
itemObj.put("bipzyid", pkReportbill); // 质检报告ID itemObj.put("bipzyid", pkReportbill); // 质检报告ID