销售订单修订-下游校验调整和新增行汇率取值调整
This commit is contained in:
parent
57b39de9a2
commit
c5f34f9f24
|
@ -234,18 +234,6 @@ public class APISaleOrderMaitainImpl implements IAPISaleOrderMaitain {
|
|||
|
||||
@Override
|
||||
public SaleOrderVO[] update(SaleOrderVO[] vos, List<Map<String, Object>> paramList) throws BusinessException {
|
||||
for (SaleOrderVO vo : vos) {
|
||||
String countSql = "SELECT count(1) FROM so_saleinvoice_b a" +
|
||||
" LEFT JOIN so_saleinvoice b ON a.csaleinvoiceid = b.csaleinvoiceid" +
|
||||
" WHERE b.fopposeflag = 0 AND nvl(b.dr, 0) = 0 and csrcid = '[csrcid]' ";
|
||||
countSql = countSql.replace("[csrcid]", vo.getParentVO().getCsaleorderid());
|
||||
Integer num = (Integer) new BaseDAO().executeQuery(countSql, new ColumnProcessor());
|
||||
if (num > 0) {
|
||||
// fopposeflag 对冲标记 0=正常 1=已被对冲 2=对冲生成
|
||||
ExceptionUtils.wrappBusinessException("下游存在未红冲完成的销售发票");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
// ±àÂëתid
|
||||
setOtherId(vos);
|
||||
// »ñÈ¡²ÎÊývoµÄid
|
||||
|
@ -303,15 +291,30 @@ public class APISaleOrderMaitainImpl implements IAPISaleOrderMaitain {
|
|||
addBvo(combinBillVOs, paramList);
|
||||
}
|
||||
}
|
||||
// 联动计算
|
||||
// INumPriceMnyCalculator cal = new SaleOrderNPriceMnyCal<SaleOrderVO>(combinBillVOs);
|
||||
// cal.calculate();
|
||||
for (SaleOrderVO vo : combinBillVOs) {
|
||||
SaleOrderBVO[] bvos = vo.getChildrenVO();
|
||||
// 判断是否存在新增的子表
|
||||
boolean hasNewStatus = Arrays.stream(bvos)
|
||||
.anyMatch(bvo -> bvo.getStatus() == VOStatus.NEW);
|
||||
// 新增子表的情况下不校验是否存在下游
|
||||
if (!hasNewStatus) {
|
||||
String countSql = "SELECT count(1) FROM so_saleinvoice_b a" +
|
||||
" LEFT JOIN so_saleinvoice b ON a.csaleinvoiceid = b.csaleinvoiceid" +
|
||||
" WHERE b.fopposeflag = 0 AND nvl(b.dr, 0) = 0 and csrcid = '[csrcid]' ";
|
||||
countSql = countSql.replace("[csrcid]", vo.getParentVO().getCsaleorderid());
|
||||
Integer num = (Integer) new BaseDAO().executeQuery(countSql, new ColumnProcessor());
|
||||
if (num > 0) {
|
||||
// fopposeflag 对冲标记 0=正常 1=已被对冲 2=对冲生成
|
||||
ExceptionUtils.wrappBusinessException("下游存在未红冲完成的销售发票");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
// ±£´æ
|
||||
ISaleOrderScriptMaintain maintainsrv =
|
||||
NCLocator.getInstance().lookup(ISaleOrderScriptMaintain.class);
|
||||
SaleOrderVO[] retvos =
|
||||
maintainsrv.saleOrderUpdate(combinBillVOs, null, originVos);
|
||||
;
|
||||
return retvos;
|
||||
}
|
||||
|
||||
|
@ -755,8 +758,15 @@ public class APISaleOrderMaitainImpl implements IAPISaleOrderMaitain {
|
|||
if (!listMap.isEmpty()) {
|
||||
for (SaleOrderVO oldVO : oldVOs) {
|
||||
String csaleorderid = oldVO.getParentVO().getCsaleorderid();
|
||||
SaleOrderBVO oneBvo = oldVO.getChildrenVO()[0];
|
||||
// 折本汇率
|
||||
UFDouble nexchangerate = oneBvo.getNexchangerate();
|
||||
List<SaleOrderBVO> newBvoList = listMap.get(csaleorderid);
|
||||
if (newBvoList != null && !newBvoList.isEmpty()) {
|
||||
// 上边填充默认值的时候取了系统的默认汇率,需要用BIP传的
|
||||
for (SaleOrderBVO saleOrderBVO : newBvoList) {
|
||||
saleOrderBVO.setNexchangerate(nexchangerate);
|
||||
}
|
||||
SaleOrderBVO[] bvos = oldVO.getChildrenVO();
|
||||
List<SaleOrderBVO> bvoList = new ArrayList<>(Arrays.asList(bvos));
|
||||
bvoList.addAll(newBvoList);
|
||||
|
|
Loading…
Reference in New Issue