备料计划转库存的其它入库
This commit is contained in:
parent
45209bd3bc
commit
06fca63a3a
|
@ -1,5 +1,6 @@
|
|||
package nccloud.web.mmpac.pickm.action;
|
||||
|
||||
import nc.bs.uapbd.util.MyHelper;
|
||||
import nc.itf.ic.m4a.IGeneralInMaintain;
|
||||
import nc.itf.mmpac.pickm.IPickmQueryService;
|
||||
import nc.itf.mmpac.pickm.IPickmTransTypeService;
|
||||
|
@ -7,13 +8,12 @@ import nc.itf.uap.pf.busiflow.PfButtonClickContext;
|
|||
import nc.pubitf.mmpac.mo.pickm.IMoPubService4Pickm;
|
||||
import nc.util.mmf.busi.service.PFPubService;
|
||||
import nc.util.mmf.framework.base.MMMapUtil;
|
||||
import nc.util.mmf.framework.base.MMNumberUtil;
|
||||
import nc.util.mmf.framework.base.MMValueCheck;
|
||||
import nc.vo.bd.material.prod.MaterialProdModeEnum;
|
||||
import nc.vo.ic.m4a.entity.GeneralInBodyVO;
|
||||
import nc.vo.ic.m4a.entity.GeneralInHeadVO;
|
||||
import nc.vo.ic.m4a.entity.GeneralInVO;
|
||||
import nc.vo.mmpac.mo.param.MoQueryParam4Pickm;
|
||||
import nc.vo.mmpac.pickm.consts.PickmLangConsts;
|
||||
import nc.vo.mmpac.pickm.entity.AggPickmVO;
|
||||
import nc.vo.mmpac.pickm.entity.PickmHeadVO;
|
||||
import nc.vo.mmpac.pickm.entity.PickmItemVO;
|
||||
|
@ -22,10 +22,13 @@ import nc.vo.mmpac.pickm.enumeration.FitemsourceEnum;
|
|||
import nc.vo.mmpac.pickm.enumeration.FsourcetypeEnum;
|
||||
import nc.vo.pub.AggregatedValueObject;
|
||||
import nc.vo.pub.BusinessException;
|
||||
import nc.vo.pub.billtype.BilltypeVO;
|
||||
import nc.vo.pub.compiler.PfParameterVO;
|
||||
import nc.vo.pub.lang.UFBoolean;
|
||||
import nc.vo.pub.lang.UFDouble;
|
||||
import nc.vo.pubapp.pattern.pub.MapList;
|
||||
import nc.vo.scmpub.res.billtype.ICBillType;
|
||||
import nccloud.baseapp.core.log.NCCForUAPLogger;
|
||||
import nccloud.dto.mmpac.pickm.pub.entity.PickmQueryInfoDTO;
|
||||
import nccloud.framework.core.exception.ExceptionUtils;
|
||||
import nccloud.framework.core.json.IJson;
|
||||
|
@ -61,22 +64,32 @@ public class PickmToGeneralInAction implements ICommonAction {
|
|||
}
|
||||
AggPickmVO[] aggVOs = null;
|
||||
IPickmQueryService service = ServiceLocator.find(IPickmQueryService.class);
|
||||
if (MMValueCheck.isNotEmpty(cpickmids)) {
|
||||
aggVOs = service.queryBillsByPks(cpickmids);
|
||||
} else if (MMValueCheck.isNotEmpty(cpickmbids)) {
|
||||
if (MMValueCheck.isNotEmpty(cpickmbids)) {
|
||||
aggVOs = service.queryAggPickmVObyBid(cpickmbids);
|
||||
} else if (MMValueCheck.isNotEmpty(cpickmids)) {
|
||||
aggVOs = service.queryBillsByPks(cpickmids);
|
||||
}
|
||||
if (MMValueCheck.isEmpty(aggVOs)) {
|
||||
/*@res "单据已被修改或删除,请刷新界面重新操作!"*/
|
||||
ExceptionUtils.wrapBusinessException(nc.vo.ml.NCLangRes4VoTransl.getNCLangRes().getStrByID("5008100_0", "05008100-0009"));
|
||||
}
|
||||
// 过滤
|
||||
// 过滤 todo
|
||||
/*AggPickmVO[] filterVOs = this.filterAggPickmVO(aggVOs);
|
||||
if (MMValueCheck.isEmpty(filterVOs)) {
|
||||
ExceptionUtils.wrapBusinessException(PickmLangConsts.getErrNoDataToReqPickm());
|
||||
}*/
|
||||
// 转换数据
|
||||
GeneralInVO[] inVOS = convertToGeneralInVO(aggVOs, null);
|
||||
for (GeneralInVO inVO : inVOS) {
|
||||
GeneralInBodyVO[] bodys = inVO.getBodys();
|
||||
for (GeneralInBodyVO body : bodys) {
|
||||
// cgeneralbid.nnum
|
||||
if (body.getNnum() == null) {
|
||||
body.setNnum(UFDouble.ZERO_DBL);
|
||||
}
|
||||
NCCForUAPLogger.debug("cgeneralbid.nnum = " + body.getNnum());
|
||||
}
|
||||
}
|
||||
// 其它入库新增
|
||||
IGeneralInMaintain generalInMaintain = ServiceLocator.find(IGeneralInMaintain.class);
|
||||
GeneralInVO[] insertVos = generalInMaintain.insert(inVOS);
|
||||
|
@ -111,17 +124,22 @@ public class PickmToGeneralInAction implements ICommonAction {
|
|||
ExceptionUtils.wrapBusinessException("备料计划转换其它入库失败");
|
||||
}
|
||||
for (GeneralInVO inVO : inVOS) {
|
||||
String pk_billtypeid = MyHelper.transferField(BilltypeVO.TABLENAME, BilltypeVO.PK_BILLTYPE_ID, BilltypeVO.PK_BILLTYPECODE, "4A-01");
|
||||
// String code = MyHelper.transferField(StordocVO.getDefaultTableName(),
|
||||
// StordocVO.CODE, StordocVO.PK_STORDOC, "");
|
||||
// 其它入库单的仓库、交易类型取自【业务参数设置】的默认值
|
||||
GeneralInHeadVO head = inVO.getHead();
|
||||
head.setCtrantypeid("0001A110000000001S1E");
|
||||
head.setVtrantypecode("4I-01");
|
||||
// head.setCwarehouseid("");
|
||||
// head.setCtrantypeid("0001A110000000001S1E");
|
||||
head.setCtrantypeid(pk_billtypeid);
|
||||
head.setVtrantypecode("4A-01");
|
||||
// 变压器公司的008借料库
|
||||
head.setCwarehouseid("1001A110000002HYPMCB");
|
||||
}
|
||||
return inVOS;
|
||||
}
|
||||
|
||||
/*
|
||||
* 过滤备料计划 审批通过=1,上游生产订单行是投放状态
|
||||
* 过滤备料计划 审批通过=1,上游生产订单行是投放状态,已生成的不能再生成
|
||||
*/
|
||||
private AggPickmVO[] filterAggPickmVO(AggPickmVO[] aggvos) throws BusinessException {
|
||||
if (aggvos == null) {
|
||||
|
|
Loading…
Reference in New Issue