箱变-质检报告收回校验启源是否已回传检验结果
This commit is contained in:
		
							parent
							
								
									91928b4a6f
								
							
						
					
					
						commit
						7c67cedd35
					
				|  | @ -0,0 +1,128 @@ | |||
| package nc.impl.qc.c003.approve.action; | ||||
| 
 | ||||
| import nc.bs.pub.compiler.AbstractCompiler2; | ||||
| import nc.bs.qc.c003.maintain.rule.DeleteReportMessageRule; | ||||
| import nc.bs.qc.c003.maintain.rule.UnApproveEventAfterRule; | ||||
| import nc.bs.qc.c003.maintain.rule.UpdateSnDocRule; | ||||
| import nc.bs.qc.c003.plugin.ReportBPPlugInPoint; | ||||
| import nc.bs.scmpub.pf.PfParameterUtil; | ||||
| import nc.bs.scmpub.rule.VOSagaFrozenValidateRule; | ||||
| import nc.impl.pubapp.pattern.data.bill.BillQuery; | ||||
| import nc.impl.pubapp.pattern.data.bill.BillUpdate; | ||||
| import nc.impl.pubapp.pattern.rule.processer.CompareAroundProcesser; | ||||
| import nc.impl.qc.c003.approve.action.rule.*; | ||||
| import nc.vo.ml.NCLangRes4VoTransl; | ||||
| import nc.vo.pub.lang.UFBoolean; | ||||
| import nc.vo.pubapp.pattern.exception.ExceptionUtils; | ||||
| import nc.vo.qc.c003.entity.ReportVO; | ||||
| import nc.vo.qc.c003.rule.Write23WhenAuditRule; | ||||
| import nc.vo.qc.c003.rule.Write4331WhenAuditRule; | ||||
| import nc.vo.qc.c003.rule.WriteMMWhenAuditRule; | ||||
| import nc.vo.qc.pub.enumeration.QCBillStatusEnum; | ||||
| import nc.vo.qc.pub.util.QCSagasUtils; | ||||
| import nc.vo.qc.pub.util.QCVOUtil; | ||||
| import nc.vo.scmpub.res.billtype.QCBillType; | ||||
| 
 | ||||
| import java.io.Serializable; | ||||
| import java.util.HashMap; | ||||
| import java.util.Map; | ||||
| 
 | ||||
| 
 | ||||
| public class ReportUnApproveAction { | ||||
|     public ReportVO[] unApproveReport(ReportVO[] voArray, AbstractCompiler2 script) { | ||||
|         PfParameterUtil<ReportVO> util = new PfParameterUtil<ReportVO>((script == null) ? null : script.getPfParameterVO(), voArray); | ||||
|         ReportVO[] originBills = (ReportVO[]) util.getOrginBills(); | ||||
|         ReportVO[] clientBills = (ReportVO[]) util.getClientFullInfoBill(); | ||||
| 
 | ||||
|         CompareAroundProcesser<ReportVO> processer = new CompareAroundProcesser<ReportVO>(ReportBPPlugInPoint.ReportUnApprove); | ||||
| 
 | ||||
| 
 | ||||
|         addBeforeRule(processer); | ||||
|         processer.before(clientBills, null); | ||||
| 
 | ||||
| 
 | ||||
|         if (null != script) { | ||||
|             try { | ||||
|                 script.procUnApproveFlow(script.getPfParameterVO()); | ||||
|             } catch (Exception e) { | ||||
|                 ExceptionUtils.wrappException(e); | ||||
|             } | ||||
|         } | ||||
| 
 | ||||
|         if (script == null || (script.getPfParameterVO()).m_preValueVos == null) { | ||||
| 
 | ||||
|             String msg = NCLangRes4VoTransl.getNCLangRes().getStrByID("c010003_0", "0c010003-0063"); | ||||
| 
 | ||||
|             ExceptionUtils.wrappBusinessException(msg); | ||||
|             return null; | ||||
|         } | ||||
| 
 | ||||
|         ReportVO[] unappovedVos = (ReportVO[]) (script.getPfParameterVO()).m_preValueVos; | ||||
| 
 | ||||
|         for (ReportVO vo : unappovedVos) { | ||||
| 
 | ||||
| 
 | ||||
|             vo.getParentVO().setStatus(1); | ||||
|         } | ||||
|         BillUpdate<ReportVO> update = new BillUpdate<ReportVO>(); | ||||
|         clientBills = (ReportVO[]) update.update(unappovedVos, originBills); | ||||
| 
 | ||||
| 
 | ||||
|         QCSagasUtils.frozenAndAddSaga(voArray, QCBillType.ReportBill.getCode(), "1", null); | ||||
|         Map<String, Serializable> paramMap = new HashMap<String, Serializable>(); | ||||
|         paramMap.put("actionname", "unapprove_C003_mmsfc"); | ||||
|         paramMap.put("hid", originBills[0].getHVO().getPrimaryKey()); | ||||
|         paramMap.put("reportapprover", originBills[0].getHVO().getApprover()); | ||||
|         paramMap.put("reporttaudittime", originBills[0].getHVO().getTaudittime()); | ||||
|         paramMap.put("reportfbillstatus", originBills[0].getHVO().getFbillstatus()); | ||||
|         QCSagasUtils.compensate(paramMap, nc.itf.qc.c003.compensate.IReportSagasCompensate.class); | ||||
| 
 | ||||
| 
 | ||||
|         addAfterRule(processer, clientBills); | ||||
|         processer.after(clientBills, null); | ||||
| 
 | ||||
| 
 | ||||
|         BillQuery<ReportVO> query = new BillQuery<ReportVO>(ReportVO.class); | ||||
|         return (ReportVO[]) query.query(QCVOUtil.getPrimaryKeys(clientBills)); | ||||
|     } | ||||
| 
 | ||||
| 
 | ||||
|     private void addAfterRule(CompareAroundProcesser<ReportVO> pc, ReportVO[] bills) { | ||||
|         Integer status = bills[0].getHVO().getFbillstatus(); | ||||
|         if (QCBillStatusEnum.FREE.value().equals(status)) { | ||||
|             pc.addAfterRule(new WriteC001WhenAuditRule(UFBoolean.FALSE)); | ||||
|         } | ||||
| 
 | ||||
|         pc.addAfterRule(new Write23WhenAuditRule(UFBoolean.FALSE)); | ||||
| 
 | ||||
|         pc.addAfterRule(new Write4331WhenAuditRule(UFBoolean.FALSE)); | ||||
| 
 | ||||
|         pc.addAfterRule(new WriteContinueBatchWhenAuditRule(UFBoolean.FALSE)); | ||||
| 
 | ||||
|         pc.addAfterRule(new WriteMMWhenAuditRule(UFBoolean.FALSE)); | ||||
| 
 | ||||
|         pc.addAfterRule(new WriteC005WhenAuditRule(UFBoolean.FALSE)); | ||||
| 
 | ||||
|         pc.addAfterRule(new WriteICBatchDocWhenAuditRule(UFBoolean.FALSE)); | ||||
| 
 | ||||
|         pc.addAfterRule(new Write55D2WhenAuditRule(UFBoolean.FALSE)); | ||||
| 
 | ||||
| 
 | ||||
|         pc.addAfterRule(new DeleteReportMessageRule()); | ||||
| 
 | ||||
|         pc.addAfterRule(new UnApproveEventAfterRule()); | ||||
| 
 | ||||
|         pc.addAfterRule(new UpdateSnDocRule(UFBoolean.FALSE)); | ||||
|     } | ||||
| 
 | ||||
| 
 | ||||
|     private void addBeforeRule(CompareAroundProcesser<ReportVO> processer) { | ||||
|         processer.addBeforeRule(new VOSagaFrozenValidateRule(true)); | ||||
| 
 | ||||
|         processer.addBeforeRule(new ChkCanUnApproveRule()); | ||||
|         processer.addBeforeRule(new DeleteStockStateChangeBill()); | ||||
| 
 | ||||
|         processer.addBeforeRule(new DeleteNCCMessageRule()); | ||||
|         processer.addBeforeRule(new CheckQMSUnApproveRule()); | ||||
|     } | ||||
| } | ||||
|  | @ -0,0 +1,26 @@ | |||
| package nc.impl.qc.c003.approve.action.rule; | ||||
| 
 | ||||
| import nc.impl.pubapp.pattern.rule.IRule; | ||||
| import nc.vo.pubapp.pattern.exception.ExceptionUtils; | ||||
| import nc.vo.qc.c003.entity.ReportHeaderVO; | ||||
| import nc.vo.qc.c003.entity.ReportVO; | ||||
| 
 | ||||
| /** | ||||
|  * 箱变-质检报告收回校验启源是否已回传检验结果 | ||||
|  * | ||||
|  * @author mzr | ||||
|  * @date 2025/08/27 | ||||
|  */ | ||||
| public class CheckQMSUnApproveRule implements IRule<ReportVO> { | ||||
|     public void process(ReportVO[] vos) { | ||||
|         if (vos == null) { | ||||
|             return; | ||||
|         } | ||||
|         for (ReportVO vo : vos) { | ||||
|             ReportHeaderVO hvo = vo.getHVO(); | ||||
|             if ("Y".equals(hvo.getVdef10())) { | ||||
|                 ExceptionUtils.wrappBusinessException("QMS已回传检验结果请勿取消"); | ||||
|             } | ||||
|         } | ||||
|     } | ||||
| } | ||||
|  | @ -39,7 +39,7 @@ import java.util.stream.Stream; | |||
|  * @date 2025/08/27 | ||||
|  */ | ||||
| public class MaterialToJmQmsListener implements IBusinessListener { | ||||
|     private static final String LOG_INFO_NAME = "qyMesLog"; | ||||
|     private static final String LOG_INFO_NAME = "jmqylog"; | ||||
|     private static final Log logger = Log.getInstance(LOG_INFO_NAME); | ||||
|     private static final String reqUrl = "/IF_QyErpApi.ashx?action=addwlxx"; | ||||
|     private Map<String, String> configParams; | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue