销售订单修订-下游校验调整和新增行汇率取值调整
This commit is contained in:
parent
57b39de9a2
commit
c5f34f9f24
|
@ -234,18 +234,6 @@ public class APISaleOrderMaitainImpl implements IAPISaleOrderMaitain {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SaleOrderVO[] update(SaleOrderVO[] vos, List<Map<String, Object>> paramList) throws BusinessException {
|
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
|
// ±àÂëתid
|
||||||
setOtherId(vos);
|
setOtherId(vos);
|
||||||
// »ñÈ¡²ÎÊývoµÄid
|
// »ñÈ¡²ÎÊývoµÄid
|
||||||
|
@ -303,15 +291,30 @@ public class APISaleOrderMaitainImpl implements IAPISaleOrderMaitain {
|
||||||
addBvo(combinBillVOs, paramList);
|
addBvo(combinBillVOs, paramList);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 联动计算
|
for (SaleOrderVO vo : combinBillVOs) {
|
||||||
// INumPriceMnyCalculator cal = new SaleOrderNPriceMnyCal<SaleOrderVO>(combinBillVOs);
|
SaleOrderBVO[] bvos = vo.getChildrenVO();
|
||||||
// cal.calculate();
|
// 判断是否存在新增的子表
|
||||||
|
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 =
|
ISaleOrderScriptMaintain maintainsrv =
|
||||||
NCLocator.getInstance().lookup(ISaleOrderScriptMaintain.class);
|
NCLocator.getInstance().lookup(ISaleOrderScriptMaintain.class);
|
||||||
SaleOrderVO[] retvos =
|
SaleOrderVO[] retvos =
|
||||||
maintainsrv.saleOrderUpdate(combinBillVOs, null, originVos);
|
maintainsrv.saleOrderUpdate(combinBillVOs, null, originVos);
|
||||||
;
|
|
||||||
return retvos;
|
return retvos;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -755,8 +758,15 @@ public class APISaleOrderMaitainImpl implements IAPISaleOrderMaitain {
|
||||||
if (!listMap.isEmpty()) {
|
if (!listMap.isEmpty()) {
|
||||||
for (SaleOrderVO oldVO : oldVOs) {
|
for (SaleOrderVO oldVO : oldVOs) {
|
||||||
String csaleorderid = oldVO.getParentVO().getCsaleorderid();
|
String csaleorderid = oldVO.getParentVO().getCsaleorderid();
|
||||||
|
SaleOrderBVO oneBvo = oldVO.getChildrenVO()[0];
|
||||||
|
// 折本汇率
|
||||||
|
UFDouble nexchangerate = oneBvo.getNexchangerate();
|
||||||
List<SaleOrderBVO> newBvoList = listMap.get(csaleorderid);
|
List<SaleOrderBVO> newBvoList = listMap.get(csaleorderid);
|
||||||
if (newBvoList != null && !newBvoList.isEmpty()) {
|
if (newBvoList != null && !newBvoList.isEmpty()) {
|
||||||
|
// 上边填充默认值的时候取了系统的默认汇率,需要用BIP传的
|
||||||
|
for (SaleOrderBVO saleOrderBVO : newBvoList) {
|
||||||
|
saleOrderBVO.setNexchangerate(nexchangerate);
|
||||||
|
}
|
||||||
SaleOrderBVO[] bvos = oldVO.getChildrenVO();
|
SaleOrderBVO[] bvos = oldVO.getChildrenVO();
|
||||||
List<SaleOrderBVO> bvoList = new ArrayList<>(Arrays.asList(bvos));
|
List<SaleOrderBVO> bvoList = new ArrayList<>(Arrays.asList(bvos));
|
||||||
bvoList.addAll(newBvoList);
|
bvoList.addAll(newBvoList);
|
||||||
|
|
Loading…
Reference in New Issue