到货检验单部分字段值调整

This commit is contained in:
hefengkai 2024-10-17 18:38:56 +08:00
parent b70b874e94
commit 3be8f4d652
3 changed files with 33 additions and 4 deletions

View File

@ -8,7 +8,13 @@ import nc.bs.pub.pf.PfUtilTools;
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.pu.dhjyd.AggDhjydMasterVO;
import nc.vo.pu.dhjyd.DhjydMasterVO;
import nc.vo.pu.dhjyd.DhjydSlave0VO;
import nc.vo.pu.m23.entity.ArriveHeaderVO;
import nc.vo.pu.m23.entity.ArriveItemVO;
import nc.vo.pu.m23.entity.ArriveVO; import nc.vo.pu.m23.entity.ArriveVO;
import nc.vo.pub.BusinessException;
import nc.vo.pub.lang.UFDate;
public class ArriveToDhjydImpl implements IArriveToDhjyd { public class ArriveToDhjydImpl implements IArriveToDhjyd {
@ -18,11 +24,13 @@ public class ArriveToDhjydImpl implements IArriveToDhjyd {
* @return * @return
*/ */
@Override @Override
public Map<String, String> createDhjyd_RequiresNew(ArriveVO arriveVO) { public Map<String, String> createDhjyd_RequiresNew(ArriveVO arriveVO) throws BusinessException {
try { try {
ArriveHeaderVO arriveHeadVo = arriveVO.getHVO();//获取到货单表头信息
ArriveItemVO[] arriveItems = arriveVO.getBVO();//获取到货单表体信息
//到货单集合获取 //到货单集合获取
ArrayList<ArriveVO> arrayList = new ArrayList<ArriveVO>(); ArrayList<ArriveVO> arrayList = new ArrayList<ArriveVO>();
arrayList.add(arriveVO); arrayList.add(arriveVO);
@ -31,6 +39,21 @@ public class ArriveToDhjydImpl implements IArriveToDhjyd {
AggDhjydMasterVO[] vos = (AggDhjydMasterVO[]) PfUtilTools.runChangeDataAry("23", "DHJY", AggDhjydMasterVO[] vos = (AggDhjydMasterVO[]) PfUtilTools.runChangeDataAry("23", "DHJY",
arrayList.toArray(new ArriveVO[0])); arrayList.toArray(new ArriveVO[0]));
DhjydMasterVO masterVO = vos[0].getParentVO();//检验单表头信息获取
masterVO.setStatus(2);//新增(0:初始 1:更新 2:新增 3:删除)
masterVO.setBilltype("DHJY");//单据类型
masterVO.setSrcbillid(arriveHeadVo.getPk_arriveorder());//来源单id
masterVO.setVsourcecode(arriveHeadVo.getVbillcode());//来源单据号
masterVO.setSrcbilltype(arriveHeadVo.getCtrantypeid());//来源单据号
masterVO.setDapplydate(new UFDate());//报检日期
DhjydSlave0VO[] itemVOs = (DhjydSlave0VO[])vos[0].getChildrenVO();//检验单表体信息
if(itemVOs != null && itemVOs.length > 0) {
for (int i = 0; i < itemVOs.length; i++) {
itemVOs[0].setStatus(2);//新增(0:初始 1:更新 2:新增 3:删除)
}
}
// 到货检验单保存-生成保存态 // 到货检验单保存-生成保存态
IDhjydMasterVOService dhjydMasterVO = NCLocator.getInstance().lookup(IDhjydMasterVOService.class); IDhjydMasterVOService dhjydMasterVO = NCLocator.getInstance().lookup(IDhjydMasterVOService.class);
dhjydMasterVO.saveAggDhjydMasterVO(vos); dhjydMasterVO.saveAggDhjydMasterVO(vos);
@ -39,6 +62,7 @@ public class ArriveToDhjydImpl implements IArriveToDhjyd {
if (e.getCause() != null) { if (e.getCause() != null) {
errMsg = e.getCause().toString(); errMsg = e.getCause().toString();
} }
throw new BusinessException(errMsg);
} }
// TODO Auto-generated method stub // TODO Auto-generated method stub

View File

@ -23,7 +23,11 @@ public class ApproveAndSaveDhjyRule extends Object implements IRule<ArriveVO>
} }
try { try {
IArriveToDhjyd service = (IArriveToDhjyd)NCLocator.getInstance().lookup(IArriveToDhjyd.class); IArriveToDhjyd service = (IArriveToDhjyd)NCLocator.getInstance().lookup(IArriveToDhjyd.class);
Map<String,String> result = service.createDhjyd_RequiresNew(vos[0]); if (vos != null && vos.length > 0) {
for(int i = 0; i < vos.length; i++) {
service.createDhjyd_RequiresNew(vos[i]);
}
}
} catch (Exception e) { } catch (Exception e) {
ExceptionUtils.wrappException(e); ExceptionUtils.wrappException(e);
} }

View File

@ -3,6 +3,7 @@ package nc.itf.pu.dhjyd.dhjydmaster;
import java.util.Map; import java.util.Map;
import nc.vo.pu.m23.entity.ArriveVO; import nc.vo.pu.m23.entity.ArriveVO;
import nc.vo.pub.BusinessException;
/*** /***
* *
@ -15,6 +16,6 @@ public interface IArriveToDhjyd {
* @param ArriveVO * @param ArriveVO
* @return * @return
*/ */
public Map<String,String> createDhjyd_RequiresNew(ArriveVO arriveVO); public Map<String,String> createDhjyd_RequiresNew(ArriveVO arriveVO) throws BusinessException;
} }