生成不合格检验单调整、不合格审核通过之后回写调整

This commit is contained in:
mzr 2024-10-23 17:02:40 +08:00
parent 6f03c68383
commit 3b77a9a1f9
3 changed files with 37 additions and 41 deletions

View File

@ -664,10 +664,10 @@ public class DhjydMasterVOServiceImpl extends ServiceSupport implements IDhjydMa
testResMap.put(map.getOrDefault("code", "") + "", map.getOrDefault("pk_defdoc", "") + ""); testResMap.put(map.getOrDefault("code", "") + "", map.getOrDefault("pk_defdoc", "") + "");
} }
} }
// UFDouble qualifiednum = oldVo.getQualifiednum(); String def2 = oldVo.getDef2();// ÊýÁ¿
// UFDouble nunqualifiednum = oldVo.getNunqualifiednum(); // UFDouble nunqualifiednum = oldVo.getNunqualifiednum();
String vbatch = (oldVo.getVbatch() != null) ? oldVo.getVbatch() : "";// 批次号 String vbatch = (oldVo.getVbatch() != null) ? oldVo.getVbatch() : "";// 批次号
// oldVo.setQualifiednum(UFDouble.ZERO_DBL); oldVo.setDef2("0");
// oldVo.setNunqualifiednum(UFDouble.ZERO_DBL); // oldVo.setNunqualifiednum(UFDouble.ZERO_DBL);
DhjydSlave0VO vo0 = new DhjydSlave0VO(); DhjydSlave0VO vo0 = new DhjydSlave0VO();
DhjydSlave0VO vo1 = new DhjydSlave0VO(); DhjydSlave0VO vo1 = new DhjydSlave0VO();
@ -680,6 +680,7 @@ public class DhjydMasterVOServiceImpl extends ServiceSupport implements IDhjydMa
if ("01".equals(def1Code)) { if ("01".equals(def1Code)) {
// 合格 // 合格
// vo0.setQualifiednum(qualifiednum); // vo0.setQualifiednum(qualifiednum);
vo0.setDef2(def2);
vo0.setVbatch(vbatch + vbatchStr[0]); vo0.setVbatch(vbatch + vbatchStr[0]);
newVOs[0] = vo0; newVOs[0] = vo0;
@ -697,6 +698,7 @@ public class DhjydMasterVOServiceImpl extends ServiceSupport implements IDhjydMa
// mainVO.setNnum(qualifiednum); // mainVO.setNnum(qualifiednum);
} else if ("02".equals(def1Code)) { } else if ("02".equals(def1Code)) {
// 合格 // 合格
vo0.setDef2(def2);
vo0.setAttributeValue("def1", testResMap.get("01")); vo0.setAttributeValue("def1", testResMap.get("01"));
vo0.setVbatch(vbatch + vbatchStr[0]); vo0.setVbatch(vbatch + vbatchStr[0]);
newVOs[0] = vo0; newVOs[0] = vo0;
@ -713,6 +715,7 @@ public class DhjydMasterVOServiceImpl extends ServiceSupport implements IDhjydMa
// mainVO.setNnum(qualifiednum); // mainVO.setNnum(qualifiednum);
} else if ("03".equals(def1Code)) { } else if ("03".equals(def1Code)) {
// 合格 // 合格
vo0.setDef2(def2);
// 设置检验结果的值 // 设置检验结果的值
vo0.setAttributeValue("def1", testResMap.get("01")); vo0.setAttributeValue("def1", testResMap.get("01"));
vo0.setVbatch(vbatch + vbatchStr[0]); vo0.setVbatch(vbatch + vbatchStr[0]);
@ -772,13 +775,11 @@ public class DhjydMasterVOServiceImpl extends ServiceSupport implements IDhjydMa
} }
// 添加新的 // 添加新的
for (int j = 0; j < unPassVOs.length; j++) { for (int j = 0; j < unPassVOs.length; j++) {
DhjydSlave0VO vo0 = new DhjydSlave0VO();
DhjydSlave0VO dhjydSlave0VO = unPassVOs[j]; DhjydSlave0VO dhjydSlave0VO = unPassVOs[j];
BeanUtil.copyProperties(dhjydSlave0VO, vo0); dhjydSlave0VO.setStatus(VOStatus.NEW);
vo0.setStatus(VOStatus.NEW); dhjydSlave0VO.setPrimaryKey(null);
vo0.setPrimaryKey(null); dhjydSlave0VO.setAttributeValue("pk_chekbill_b", null);
vo0.setAttributeValue("pk_chekbill_b", null); newVOs[j + 1] = dhjydSlave0VO;
newVOs[j + 1] = vo0;
} }
masterVO.setChildren(DhjydSlave0VO.class, newVOs); masterVO.setChildren(DhjydSlave0VO.class, newVOs);
AggDhjydMasterVO[] saveVOs = dao.update(masterVO); AggDhjydMasterVO[] saveVOs = dao.update(masterVO);

View File

@ -53,9 +53,8 @@ public class N_DHJY_APPROVE extends AbstractPfScriptAction<AggDhjydMasterVO> {
for (int i = 0; i < vos.length; i++) { for (int i = 0; i < vos.length; i++) {
service.writeBackQc(vos[i]); service.writeBackQc(vos[i]);
} }
// IDhjydMasterVOService dhjydMasterVOService = IDhjydMasterVOService dhjydMasterVOService = NCLocator.getInstance().lookup(IDhjydMasterVOService.class);
// NCLocator.getInstance().lookup(IDhjydMasterVOService.class); dhjydMasterVOService.afterAuditUnPass(vos);
// dhjydMasterVOService.afterAuditUnPass(vos);
} }
} }

View File

@ -3,57 +3,53 @@ package nc.bs.pub.action;
import java.util.Arrays; import java.util.Arrays;
import nc.bs.framework.common.NCLocator; import nc.bs.framework.common.NCLocator;
import nc.bs.pub.compiler.IWorkFlowRet;
import nc.vo.pub.BusinessException;
import nc.vo.pub.compiler.PfParameterVO;
import nc.vo.pub.VOStatus;
import nc.vo.uap.pf.PFBusinessException;
import nc.vo.pubapp.pattern.model.entity.bill.AbstractBill;
import nc.vo.pubapp.pattern.model.meta.entity.bill.IBillMeta;
import nc.vo.pub.CircularlyAccessibleValueObject;
import nccloud.commons.lang.StringUtils;
import nc.codeplatform.framework.service.AbstractPfScriptAction; import nc.codeplatform.framework.service.AbstractPfScriptAction;
import nc.vo.pu.dhjyd.AggDhjydMasterVO;
import nc.itf.pu.dhjyd.dhjydmaster.IArriveToDhjyd; import nc.itf.pu.dhjyd.dhjydmaster.IArriveToDhjyd;
import nc.itf.pu.dhjyd.dhjydmaster.IDhjydMasterVOService; import nc.itf.pu.dhjyd.dhjydmaster.IDhjydMasterVOService;
import nc.vo.pu.dhjyd.AggDhjydMasterVO;
import nc.vo.pub.BusinessException;
import nc.vo.pub.VOStatus;
import nc.vo.pub.compiler.PfParameterVO;
import nc.vo.uap.pf.PFBusinessException;
import nccloud.commons.lang.StringUtils;
public class N_DHJY_UNAPPROVE extends AbstractPfScriptAction<AggDhjydMasterVO>{ public class N_DHJY_UNAPPROVE extends AbstractPfScriptAction<AggDhjydMasterVO> {
public N_DHJY_UNAPPROVE(){ public N_DHJY_UNAPPROVE() {
super(); super();
} }
@Override @Override
protected Object process(PfParameterVO paraVO) throws BusinessException { protected Object process(PfParameterVO paraVO) throws BusinessException {
try { try {
IDhjydMasterVOService service = NCLocator.getInstance().lookup(IDhjydMasterVOService.class); IDhjydMasterVOService service = NCLocator.getInstance().lookup(IDhjydMasterVOService.class);
AggDhjydMasterVO[] vos = (AggDhjydMasterVO[])this.getVos(); AggDhjydMasterVO[] vos = (AggDhjydMasterVO[]) this.getVos();
Arrays.stream(vos).forEach(v-> v.getParent().setStatus(VOStatus.UPDATED)); Arrays.stream(vos).forEach(v -> v.getParent().setStatus(VOStatus.UPDATED));
this.procUnApproveFlow(paraVO); this.procUnApproveFlow(paraVO);
vos = service.callbackUNAPPROVE(vos); vos = service.callbackUNAPPROVE(vos);
return vos; return vos;
}catch(Exception ex) { } catch (Exception ex) {
if (ex instanceof BusinessException) { if (ex instanceof BusinessException) {
throw (BusinessException) ex; throw (BusinessException) ex;
} }
throw new PFBusinessException(ex.getMessage(), ex); throw new PFBusinessException(ex.getMessage(), ex);
} }
} }
protected void before(PfParameterVO paraVO) throws BusinessException{ protected void before(PfParameterVO paraVO) throws BusinessException {
AggDhjydMasterVO vo = (AggDhjydMasterVO)this.getVo(); AggDhjydMasterVO vo = (AggDhjydMasterVO) this.getVo();
if(StringUtils.isEmpty(vo.getPrimaryKey())){ if (StringUtils.isEmpty(vo.getPrimaryKey())) {
throw new BusinessException("当前单据未执行保存动作脚本,如果配置了业务流程定义,请检查动作驱动配置!"); throw new BusinessException("当前单据未执行保存动作脚本,如果配置了业务流程定义,请检查动作驱动配置!");
} }
} }
protected void after(PfParameterVO paraVO) throws BusinessException { protected void after(PfParameterVO paraVO) throws BusinessException {
AggDhjydMasterVO[] vos = (AggDhjydMasterVO[])this.getVos(); AggDhjydMasterVO[] vos = (AggDhjydMasterVO[]) this.getVos();
IArriveToDhjyd service = NCLocator.getInstance().lookup(IArriveToDhjyd.class); IArriveToDhjyd service = NCLocator.getInstance().lookup(IArriveToDhjyd.class);
for(int i = 0; i < vos.length; i++) { for (int i = 0; i < vos.length; i++) {
service.deleteQc(vos[i]); service.deleteQc(vos[i]);
} }
} }