销售订单-折本汇率取值调整
This commit is contained in:
parent
2f6a9901be
commit
1dbfd7f699
|
@ -11,15 +11,18 @@ import nc.itf.scmpub.reference.uap.bd.customer.CustomerPubService;
|
||||||
import nc.itf.scmpub.reference.uap.pf.PfServiceScmUtil;
|
import nc.itf.scmpub.reference.uap.pf.PfServiceScmUtil;
|
||||||
import nc.itf.so.m30.self.ISaleOrderMaintain;
|
import nc.itf.so.m30.self.ISaleOrderMaintain;
|
||||||
import nc.itf.so.m30.self.ISaleOrderScriptMaintain;
|
import nc.itf.so.m30.self.ISaleOrderScriptMaintain;
|
||||||
|
import nc.itf.uap.pf.IPFBusiAction;
|
||||||
import nc.jdbc.framework.processor.ColumnProcessor;
|
import nc.jdbc.framework.processor.ColumnProcessor;
|
||||||
import nc.jdbc.framework.processor.MapProcessor;
|
import nc.jdbc.framework.processor.MapProcessor;
|
||||||
import nc.pubimpl.so.m30.pub.SaleOrderSaveUtil;
|
import nc.pubimpl.so.m30.pub.SaleOrderSaveUtil;
|
||||||
import nc.pubitf.so.m30.api.ISaleOrderQueryAPI;
|
import nc.pubitf.so.m30.api.ISaleOrderQueryAPI;
|
||||||
import nc.vo.bd.defdoc.DefdocVO;
|
import nc.vo.bd.defdoc.DefdocVO;
|
||||||
|
import nc.vo.ml.NCLangRes4VoTransl;
|
||||||
import nc.vo.pub.BusinessException;
|
import nc.vo.pub.BusinessException;
|
||||||
import nc.vo.pub.VOStatus;
|
import nc.vo.pub.VOStatus;
|
||||||
import nc.vo.pub.billtype.BilltypeVO;
|
import nc.vo.pub.billtype.BilltypeVO;
|
||||||
import nc.vo.pub.lang.UFBoolean;
|
import nc.vo.pub.lang.UFBoolean;
|
||||||
|
import nc.vo.pub.lang.UFDate;
|
||||||
import nc.vo.pub.lang.UFDouble;
|
import nc.vo.pub.lang.UFDouble;
|
||||||
import nc.vo.pubapp.AppContext;
|
import nc.vo.pubapp.AppContext;
|
||||||
import nc.vo.pubapp.pattern.exception.ExceptionUtils;
|
import nc.vo.pubapp.pattern.exception.ExceptionUtils;
|
||||||
|
@ -31,25 +34,20 @@ import nc.vo.scmpub.util.StringUtil;
|
||||||
import nc.vo.so.m30.entity.SaleOrderBVO;
|
import nc.vo.so.m30.entity.SaleOrderBVO;
|
||||||
import nc.vo.so.m30.entity.SaleOrderHVO;
|
import nc.vo.so.m30.entity.SaleOrderHVO;
|
||||||
import nc.vo.so.m30.entity.SaleOrderVO;
|
import nc.vo.so.m30.entity.SaleOrderVO;
|
||||||
|
import nc.vo.so.pub.SOConstant;
|
||||||
import nc.vo.so.pub.enumeration.BillStatus;
|
import nc.vo.so.pub.enumeration.BillStatus;
|
||||||
|
import nc.vo.so.pub.keyvalue.IKeyValue;
|
||||||
|
import nc.vo.so.pub.keyvalue.VOKeyValue;
|
||||||
import nc.vo.so.pub.util.AggVOUtil;
|
import nc.vo.so.pub.util.AggVOUtil;
|
||||||
import nccloud.api.impl.so.m30.check.SaleOrderValidator;
|
import nccloud.api.impl.so.m30.check.SaleOrderValidator;
|
||||||
import nccloud.api.impl.so.m30.fill.SaleOrderNPriceMnyCal;
|
import nccloud.api.impl.so.m30.fill.SaleOrderNPriceMnyCal;
|
||||||
import nccloud.api.impl.so.m30.fill.SaleOrderSaveFillValue;
|
import nccloud.api.impl.so.m30.fill.SaleOrderSaveFillValue;
|
||||||
import nccloud.api.impl.so.m30.fill.SetUpdateData;
|
|
||||||
import nccloud.api.so.m30.IAPISaleOrderMaitain;
|
import nccloud.api.so.m30.IAPISaleOrderMaitain;
|
||||||
import nccloud.baseapp.core.log.NCCForUAPLogger;
|
import nccloud.baseapp.core.log.NCCForUAPLogger;
|
||||||
import nccloud.openapi.scmpub.pub.TransferCodeToPKTool;
|
import nccloud.openapi.scmpub.pub.TransferCodeToPKTool;
|
||||||
import nccloud.openapi.scmpub.pub.TransferMapToVOTool;
|
import nccloud.openapi.scmpub.pub.TransferMapToVOTool;
|
||||||
import nccloud.putitf.riart.billtype.IBilltypeService;
|
import nccloud.putitf.riart.billtype.IBilltypeService;
|
||||||
import org.apache.commons.lang3.ArrayUtils;
|
import org.apache.commons.lang3.ArrayUtils;
|
||||||
import nc.itf.uap.pf.IPFBusiAction;
|
|
||||||
import nc.vo.ml.NCLangRes4VoTransl;
|
|
||||||
import nc.vo.pub.lang.UFDate;
|
|
||||||
import nc.vo.so.pub.SOConstant;
|
|
||||||
import nc.vo.so.pub.util.SOCurrencyUtil;
|
|
||||||
import nc.vo.so.pub.keyvalue.IKeyValue;
|
|
||||||
import nc.vo.so.pub.keyvalue.VOKeyValue;
|
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
@ -87,20 +85,22 @@ public class APISaleOrderMaitainImpl implements IAPISaleOrderMaitain {
|
||||||
if (o1 == null) {
|
if (o1 == null) {
|
||||||
throw new BusinessException("表体币种不能为空或币种不存在");
|
throw new BusinessException("表体币种不能为空或币种不存在");
|
||||||
}
|
}
|
||||||
String csettleorgid = bvos[0].getCsettleorgid();
|
// String csettleorgid = bvos[0].getCsettleorgid();
|
||||||
String ccurrencyorgid = o1.toString();
|
String ccurrencyorgid = o1.toString();
|
||||||
UFDouble exchangerate = SOCurrencyUtil.getInCurrencyRateByOrg(csettleorgid,
|
// UFDouble exchangerate = SOCurrencyUtil.getInCurrencyRateByOrg(csettleorgid, BFPubTools.getString_TrimAsNull(o), ccurrencyorgid, dbilldate);
|
||||||
BFPubTools.getString_TrimAsNull(o), ccurrencyorgid, dbilldate);
|
|
||||||
for (SaleOrderBVO bvo : bvos) {
|
for (SaleOrderBVO bvo : bvos) {
|
||||||
bvo.setCcurrencyid(BFPubTools.getString_TrimAsNull(o1));
|
bvo.setCcurrencyid(BFPubTools.getString_TrimAsNull(o1));
|
||||||
if (!BFPubTools.getString_TrimAsNull(o).equals(ccurrencyorgid)) {
|
if (!BFPubTools.getString_TrimAsNull(o).equals(ccurrencyorgid)) {
|
||||||
bvo.setNexchangerate(exchangerate);
|
// bvo.setNexchangerate(exchangerate);
|
||||||
} else {
|
} else {
|
||||||
bvo.setNexchangerate(UFDouble.ONE_DBL);
|
// bvo.setNexchangerate(UFDouble.ONE_DBL);
|
||||||
|
}
|
||||||
|
// 折本汇率判空及保留小数位数
|
||||||
|
UFDouble exchangerate1 = getUFDouble_NullAsOne(bvo.getNexchangerate()).setScale(2, UFDouble.ROUND_HALF_UP);
|
||||||
|
bvo.setNexchangerate(exchangerate1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
BillVOsCheckRule checker = new BillVOsCheckRule(new SaleOrderValidator());
|
BillVOsCheckRule checker = new BillVOsCheckRule(new SaleOrderValidator());
|
||||||
checker.check(vos);
|
checker.check(vos);
|
||||||
|
@ -117,7 +117,7 @@ public class APISaleOrderMaitainImpl implements IAPISaleOrderMaitain {
|
||||||
SOBillType.Order.getCode(), combinBillVOs, null, null);
|
SOBillType.Order.getCode(), combinBillVOs, null, null);
|
||||||
|
|
||||||
SaleOrderVO[] billvos = ((ISaleOrderQueryAPI) NCLocator.getInstance().lookup(ISaleOrderQueryAPI.class))
|
SaleOrderVO[] billvos = ((ISaleOrderQueryAPI) NCLocator.getInstance().lookup(ISaleOrderQueryAPI.class))
|
||||||
.queryVOByIDs(new String[] { retvos[0].getParentVO().getPrimaryKey() });
|
.queryVOByIDs(new String[]{retvos[0].getParentVO().getPrimaryKey()});
|
||||||
if (billvos != null) {
|
if (billvos != null) {
|
||||||
((IPFBusiAction) NCLocator.getInstance().lookup(IPFBusiAction.class)).processAction("APPROVE",
|
((IPFBusiAction) NCLocator.getInstance().lookup(IPFBusiAction.class)).processAction("APPROVE",
|
||||||
billvos[0].getParentVO().getVtrantypecode(), null, billvos[0], null, null);
|
billvos[0].getParentVO().getVtrantypecode(), null, billvos[0], null, null);
|
||||||
|
@ -151,6 +151,7 @@ public class APISaleOrderMaitainImpl implements IAPISaleOrderMaitain {
|
||||||
|
|
||||||
// 折本汇率
|
// 折本汇率
|
||||||
UFDouble nexchangerate = childrenVO.getNexchangerate();
|
UFDouble nexchangerate = childrenVO.getNexchangerate();
|
||||||
|
nexchangerate = getUFDouble_NullAsOne(nexchangerate);
|
||||||
// 含税单价
|
// 含税单价
|
||||||
UFDouble nqtorigtaxprice = childrenVO.getNqtorigtaxprice();
|
UFDouble nqtorigtaxprice = childrenVO.getNqtorigtaxprice();
|
||||||
// 无税单价
|
// 无税单价
|
||||||
|
|
Loading…
Reference in New Issue