备料计划下达请购优化

This commit is contained in:
lihao 2025-09-30 17:25:09 +08:00
parent c4a151c7e6
commit b8e62a6b17
1 changed files with 31 additions and 10 deletions

View File

@ -3,6 +3,7 @@ package nccloud.web.mmpac.pickm.action;
import nc.bs.dao.BaseDAO;
import nc.bs.dao.DAOException;
import nc.bs.framework.common.InvocationInfoProxy;
import nc.bs.uapbd.util.MyHelper;
import nc.itf.ic.m4a.IGeneralInMaintain;
import nc.itf.mmpac.pickm.IPickmQueryService;
import nc.itf.pu.m20.IPraybillApprove;
@ -17,6 +18,7 @@ import nc.vo.ic.m4a.entity.GeneralInVO;
import nc.vo.mmpac.pickm.entity.AggPickmVO;
import nc.vo.mmpac.pickm.entity.PickmHeadVO;
import nc.vo.mmpac.pickm.entity.PickmItemVO;
import nc.vo.org.OrgVO;
import nc.vo.pu.m20.entity.PraybillHeaderVO;
import nc.vo.pu.m20.entity.PraybillItemVO;
import nc.vo.pu.m20.entity.PraybillVO;
@ -25,6 +27,7 @@ import nc.vo.pub.BusinessException;
import nc.vo.pub.CircularlyAccessibleValueObject;
import nc.vo.pub.ISuperVO;
import nc.vo.pub.compiler.PfParameterVO;
import nc.vo.pub.lang.UFDate;
import nc.vo.pub.lang.UFDouble;
import nccloud.api.rest.utils.ResultMessageUtil;
import nccloud.dto.mmpac.pickm.pub.entity.PickmQueryInfoDTO;
@ -35,10 +38,7 @@ import nccloud.framework.web.action.itf.ICommonAction;
import nccloud.framework.web.container.IRequest;
import nccloud.framework.web.json.JsonFactory;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
/**
* 备料计划转请购单
@ -144,6 +144,27 @@ public class PickmToBuyingreqAction implements ICommonAction {
String ctrantypeid = getValueByCondtion("bd_billtype", " pk_billtypeid ", " istransaction = 'Y' and nvl ( islock, 'N' ) = 'N' and parentbilltype = '20' and pk_group = '"
+ InvocationInfoProxy.getInstance().getGroupId() + "' and pk_billtypecode = '" + "20-01" + "' ");
head.setCtrantypeid(ctrantypeid);
// 自动化 建议供应商和招标项目号能从供应商价目表上取到
String pkOrg= head.getPk_org();
String orgCode = MyHelper.transferField(OrgVO.getDefaultTableName(), OrgVO.CODE, OrgVO.PK_ORG, pkOrg);
if(!orgCode.equals("C028")){
continue;
}
for (int i=0;i<inVO.getBVO().length;i++) {
StringBuffer sb = new StringBuffer();
// 建议供供应商和招标项目号 dvaliddate价格生效时间 dinvaliddate价格失效日期
UFDate now = new UFDate(new Date());
sb.append(" SELECT pk_supplier,vbdef14 FROM purp_supplierprice ");
sb.append(" WHERE nvl(purp_supplierprice.dr,0)= 0 ");
sb.append(" and dvaliddate <= '" + now.toString() + "' and dinvaliddate >= '" + now.toString() + "' "+" and pk_org = '" +head.getPk_org() + "' and pk_material = '" + inVO.getBVO()[i].getPk_material()+ "' ");
BaseDAO dao = new BaseDAO();
List<Map<String,Object>> list=(List<Map<String,Object>>) dao.executeQuery(sb.toString(), new MapListProcessor());
if (!list.isEmpty()) {
inVO.getBVO()[i].setPk_suggestsupplier(list.get(0).get("pk_supplier").toString());
inVO.getBVO()[i].setVbdef19(list.get(0).get("vbdef14").toString());
}
}
}
List<PraybillVO> resultList = new ArrayList<>();
@ -223,12 +244,12 @@ public class PickmToBuyingreqAction implements ICommonAction {
}
// 是否转为通用件若为Y不下达请购单
BaseDAO dao = new BaseDAO();
String mrlsql = " select def29 from bd_material where pk_material='" + child.getCbmaterialvid() + "' and dr=0";
String isCommon = (String) dao.executeQuery(mrlsql, new ColumnProcessor());
if(null != isCommon && isCommon.equals("Y") ){
continue;
}
// String mrlsql = " select def29 from bd_material where pk_material='" + child.getCbmaterialvid() + "' and dr=0";
//
// String isCommon = (String) dao.executeQuery(mrlsql, new ColumnProcessor());
// if(null != isCommon && isCommon.equals("Y") ){
// continue;
// }
String mrlstocksql = " select def18 from bd_materialstock where pk_material='" + child.getCbmaterialvid() + "' and pk_org='"+child.getPk_org()+"' and dr=0";