推送请购时候部分部门特殊处理进入流程中状态

This commit is contained in:
lihao 2025-10-20 20:39:15 +08:00
parent d0754dfa77
commit 9aba447f08
2 changed files with 48 additions and 4 deletions

View File

@ -1,14 +1,18 @@
package nccloud.web.mmpac.pickm.action; package nccloud.web.mmpac.pickm.action;
import nc.bs.dao.BaseDAO; import nc.bs.dao.BaseDAO;
import nc.bs.dao.DAOException; import nc.bs.dao.DAOException;
import nc.bs.framework.common.InvocationInfoProxy; import nc.bs.framework.common.InvocationInfoProxy;
import nc.bs.framework.common.NCLocator;
import nc.bs.uapbd.util.MyHelper; import nc.bs.uapbd.util.MyHelper;
import nc.itf.ic.m4a.IGeneralInMaintain; import nc.itf.ic.m4a.IGeneralInMaintain;
import nc.itf.mmpac.pickm.IPickmQueryService; import nc.itf.mmpac.pickm.IPickmQueryService;
import nc.itf.pu.m20.IPraybillApprove; import nc.itf.pu.m20.IPraybillApprove;
import nc.itf.pu.m20.IPraybillMaintain; import nc.itf.pu.m20.IPraybillMaintain;
import nc.itf.scctpub.reference.uap.pf.PfServiceScmUtil; import nc.itf.scctpub.reference.uap.pf.PfServiceScmUtil;
import nc.itf.uap.pf.IPFBusiAction;
import nc.itf.uap.pf.IWorkflowMachine;
import nc.itf.uap.pf.busiflow.PfButtonClickContext; import nc.itf.uap.pf.busiflow.PfButtonClickContext;
import nc.jdbc.framework.processor.ColumnProcessor; import nc.jdbc.framework.processor.ColumnProcessor;
import nc.jdbc.framework.processor.MapListProcessor; import nc.jdbc.framework.processor.MapListProcessor;
@ -29,6 +33,8 @@ import nc.vo.pub.ISuperVO;
import nc.vo.pub.compiler.PfParameterVO; import nc.vo.pub.compiler.PfParameterVO;
import nc.vo.pub.lang.UFDate; import nc.vo.pub.lang.UFDate;
import nc.vo.pub.lang.UFDouble; import nc.vo.pub.lang.UFDouble;
import nc.vo.pub.pf.workflow.IPFActionName;
import nc.vo.pub.workflownote.WorkflownoteVO;
import nccloud.api.rest.utils.ResultMessageUtil; import nccloud.api.rest.utils.ResultMessageUtil;
import nccloud.dto.mmpac.pickm.pub.entity.PickmQueryInfoDTO; import nccloud.dto.mmpac.pickm.pub.entity.PickmQueryInfoDTO;
import nccloud.framework.core.exception.ExceptionUtils; import nccloud.framework.core.exception.ExceptionUtils;
@ -37,6 +43,7 @@ import nccloud.framework.service.ServiceLocator;
import nccloud.framework.web.action.itf.ICommonAction; import nccloud.framework.web.action.itf.ICommonAction;
import nccloud.framework.web.container.IRequest; import nccloud.framework.web.container.IRequest;
import nccloud.framework.web.json.JsonFactory; import nccloud.framework.web.json.JsonFactory;
import nccloud.pubitf.riart.approve.IApproveService;
import java.util.*; import java.util.*;
@ -106,7 +113,31 @@ public class PickmToBuyingreqAction implements ICommonAction {
updetaPmoNum(updateList); updetaPmoNum(updateList);
} }
IPraybillApprove approve= ServiceLocator.find(IPraybillApprove.class); IPraybillApprove approve= ServiceLocator.find(IPraybillApprove.class);
Object res= PfServiceScmUtil.processBatch("APPROVE", "20", insertVos, null, null); List<PraybillVO> approveVos=new ArrayList<>();
Map<String, String> configParams = MyHelper.getConfigParams("zdh-config", null);
for (PraybillVO prayVO : insertVos) {
String orgCode = MyHelper.transferField(OrgVO.getDefaultTableName(), OrgVO.CODE, OrgVO.PK_ORG, prayVO.getHVO().getPk_org());
if (!checkIfOrg(orgCode, configParams)) {
IApproveService appService = NCLocator.getInstance().lookup(IApproveService.class);
boolean flag=appService.hasApproveFlow(prayVO.getHVO().getVtrantypecode(), prayVO.getHVO().getPk_praybill());
if(flag){
Object res1= PfServiceScmUtil.processBatch("SAVE", "20", new PraybillVO[]{prayVO}, null, null);
}else{
approveVos.add(prayVO);
}
}else{
approveVos.add(prayVO);
}
}
if(approveVos.isEmpty()){
Map<String, Object> returnMap = new HashMap<>();
returnMap.put("data", insertVos);
returnMap.put("success", true);
return returnMap;
}
Object res= PfServiceScmUtil.processBatch("APPROVE", "20", approveVos.toArray(new PraybillVO[0]), null, null);
Map<String, Object> returnMap = new HashMap<>(); Map<String, Object> returnMap = new HashMap<>();
returnMap.put("data", res); returnMap.put("data", res);
@ -122,6 +153,19 @@ public class PickmToBuyingreqAction implements ICommonAction {
} }
} }
private boolean checkIfOrg(String code, Map<String, String> configParams) throws BusinessException {
String targetCode = configParams.get("org");
if (targetCode == null || nc.vo.am.common.util.StringUtils.isEmpty(targetCode)) {
throw new BusinessException("δÅäÖÃ×éÖ¯²ÎÊý");
}
String[] orgItem = targetCode.split(",");
for (String orgCode : orgItem) {
if (!orgCode.isEmpty() && orgCode.equals(code)) {
return false;
}
}
return true;
}
private void updetaPmoNum(List<Map<String, Object>> updateList) throws DAOException { private void updetaPmoNum(List<Map<String, Object>> updateList) throws DAOException {
BaseDAO dao = new BaseDAO(); BaseDAO dao = new BaseDAO();
for (Map<String, Object> updateMap : updateList) { for (Map<String, Object> updateMap : updateList) {

View File

@ -84,8 +84,8 @@ public class QCRptDataPushtoQmsAction implements ICommonAction {
if (bvos != null && bvos.length > 0) { if (bvos != null && bvos.length > 0) {
for (ArriveItemVO itemVO : bvos) { for (ArriveItemVO itemVO : bvos) {
// 获取vbdef23字段值处理null情况 // 获取vbdef23字段值处理null情况
String vbdef23 = (String) itemVO.getAttributeValue("vbdef23"); String vbdef32 = (String) itemVO.getAttributeValue("vbdef32");
if (vbdef23 != null && "Y".equalsIgnoreCase(vbdef23)) { if (vbdef32 != null && "Y".equalsIgnoreCase(vbdef32)) {
needSkip = true; needSkip = true;
break; // 只要有一个明细符合直接跳出明细循环 break; // 只要有一个明细符合直接跳出明细循环
} }
@ -181,7 +181,7 @@ public class QCRptDataPushtoQmsAction implements ICommonAction {
private void updateArrveOrder(String pkArriveorder) throws DAOException { private void updateArrveOrder(String pkArriveorder) throws DAOException {
BaseDAO dao = new BaseDAO(); BaseDAO dao = new BaseDAO();
String sql = "update po_arriveorder_b set vbdef23='Y' where pk_arriveorder='" String sql = "update po_arriveorder_b set vbdef32='Y' where pk_arriveorder='"
+ pkArriveorder + "'"; + pkArriveorder + "'";
dao.executeUpdate(sql); dao.executeUpdate(sql);
} }