生产报告代码同步

This commit is contained in:
mzr 2025-11-01 17:33:32 +08:00
parent 627619119f
commit 05b0a218fd
1 changed files with 32 additions and 37 deletions

View File

@ -5,21 +5,17 @@ import nc.bs.framework.common.InvocationInfoProxy;
import nc.bs.framework.common.NCLocator;
import nc.bs.logging.Log;
import nc.bs.uif2.validation.ValidationFailure;
import nc.itf.mmpac.wr.IWrBusinessService;
import nc.jdbc.framework.SQLParameter;
import nc.jdbc.framework.processor.ColumnProcessor;
import nc.util.mmf.framework.base.MMArrayUtil;
import nc.util.mmf.framework.base.MMCollectionUtil;
import nc.util.mmf.framework.base.MMNumberUtil;
import nc.util.mmf.framework.base.MMValueCheck;
import nc.vo.bd.bom.bom0202.enumeration.OutputTypeEnum;
import nc.vo.mmpac.wr.consts.WrptLangConst;
import nc.vo.mmpac.wr.entity.*;
import nc.vo.mmpac.wr.enumeration.WrBillStatusEnum;
import nc.vo.pub.BusinessException;
import nc.vo.pub.VOStatus;
import nc.vo.pub.billtype.BilltypeVO;
import nc.vo.pub.lang.UFBoolean;
import nc.vo.pub.lang.UFDate;
import nc.vo.pubapp.AppContext;
import nc.vo.pubapp.pattern.exception.ExceptionUtils;
@ -27,7 +23,6 @@ import nc.ws.opm.pub.utils.result.APIErrCodeEnum;
import nccloud.api.mmpac.wr.IAPIWrMaintain;
import nccloud.api.rest.utils.NCCRestUtils;
import nccloud.api.rest.utils.ResultMessageUtil;
import nccloud.framework.service.ServiceLocator;
import nccloud.openapi.scmpub.pub.TransferCodeToPKTool;
import nccloud.ws.rest.resource.AbstractNCCRestResource;
import org.json.JSONString;
@ -390,38 +385,38 @@ public class WrResource extends AbstractNCCRestResource {
* 考虑标品接口扩展性 表头增加校验参数 isdonecheck:Y/N
*/
AggWrVO[] wrVOS = voList.toArray(new AggWrVO[0]);
if (headInfo.containsKey("isdonecheck") && "Y".equals(headInfo.get("isdonecheck").toString())) {
IWrBusinessService service = (IWrBusinessService) ServiceLocator.find(IWrBusinessService.class);
AggWrVO[] resultvos = service.setCheck(wrVOS);
if (!MMValueCheck.isEmpty(resultvos)) {
StringBuilder errorMessagesSB = new StringBuilder();
for (AggWrVO aggWrVO : resultvos) {
if (!WrBillStatusEnum.FREEDOM.equalsValue(aggWrVO.getParentVO().getFbillstatus())) {
StringBuilder notThroughSB = new StringBuilder();
String billCode = aggWrVO.getParentVO().getVbillcode();
WrItemVO[] itemVOs = (WrItemVO[]) aggWrVO.getChildren(WrItemVO.class);
if (!MMValueCheck.isEmpty(itemVOs)) {
for (WrItemVO itemVO : itemVOs) {
if (!MMValueCheck.isEmpty(itemVO.getCbmoid()) && OutputTypeEnum.MAIN_PRODUCT.equalsValue(itemVO.getFbproducttype()) && !UFBoolean.TRUE.equals(itemVO.getBbsetmark())) {
notThroughSB.append(itemVO.getVbrowno());
notThroughSB.append(",");
}
}
if (!MMValueCheck.isEmpty(notThroughSB)) {
notThroughSB.setLength(notThroughSB.length() - 1);
String message = WrptLangConst.getSetCheckError_Msg(new String[]{billCode, notThroughSB.toString()});
errorMessagesSB.append(message);
errorMessagesSB.append("\n");
}
}
}
}
if (!MMValueCheck.isEmpty(errorMessagesSB)) {
ExceptionUtils.wrappBusinessException(errorMessagesSB.toString());
}
}
}
// if(headInfo.containsKey("isdonecheck") && "Y".equals(headInfo.get("isdonecheck").toString())){
// IWrBusinessService service = (IWrBusinessService) NCLocator.getInstance().lookup(IWrBusinessService.class);
// AggWrVO[] resultvos = service.setCheck(wrVOS);
// if (!MMValueCheck.isEmpty(resultvos)) {
// StringBuilder errorMessagesSB = new StringBuilder();
//
// for (AggWrVO aggWrVO :resultvos) {
// if (!WrBillStatusEnum.FREEDOM.equalsValue(aggWrVO.getParentVO().getFbillstatus())) {
// StringBuilder notThroughSB = new StringBuilder();
// String billCode = aggWrVO.getParentVO().getVbillcode();
// WrItemVO[] itemVOs = (WrItemVO[]) aggWrVO.getChildren(WrItemVO.class);
// if (!MMValueCheck.isEmpty(itemVOs)) {
// for (WrItemVO itemVO:itemVOs) {
// if (!MMValueCheck.isEmpty(itemVO.getCbmoid()) && OutputTypeEnum.MAIN_PRODUCT.equalsValue(itemVO.getFbproducttype()) && !UFBoolean.TRUE.equals(itemVO.getBbsetmark())) {
// notThroughSB.append(itemVO.getVbrowno());
// notThroughSB.append(",");
// }
// }
// if (!MMValueCheck.isEmpty(notThroughSB)) {
// notThroughSB.setLength(notThroughSB.length() - 1);
// String message = WrptLangConst.getSetCheckError_Msg(new String[]{billCode, notThroughSB.toString()});
// errorMessagesSB.append(message);
// errorMessagesSB.append("\n");
// }
// }
// }
// }
// if (!MMValueCheck.isEmpty(errorMessagesSB)) {
// ExceptionUtils.wrappBusinessException(errorMessagesSB.toString());
// }
// }
// }
/*
* end 齐套检查
* edit by xc 2025-10-22