|
|
@ -168,31 +168,32 @@ public class SupplierApbalanceMainServiceImpl implements SupplierApbalanceMainSe |
|
|
|
|
|
|
|
private SupplierApbalanceMainDO supplierApbalanceMainDetail(SupplierApbalanceMainDO supplierApbalanceMainDO) { |
|
|
|
// 查询明细
|
|
|
|
List<SupplierApbalanceDetailDO> detailDOS = supplierApbalanceDetailMapper.selectList("master_id", supplierApbalanceMainDO.getId()); |
|
|
|
BigDecimal ttAccountAp = new BigDecimal(0); |
|
|
|
BigDecimal ttAccountOthap = new BigDecimal(0); |
|
|
|
BigDecimal ttAccountPrepay = new BigDecimal(0); |
|
|
|
if (!CollectionUtil.isEmpty(detailDOS)) { |
|
|
|
for (SupplierApbalanceDetailDO loop1 : detailDOS) { |
|
|
|
if ("AP".equals(loop1.getTtGltype())) { |
|
|
|
BigDecimal ttBcbal = loop1.getTtBcbal(); |
|
|
|
ttAccountAp = ttAccountAp.add(ttBcbal); |
|
|
|
} else if ("OTHAP".equals(loop1.getTtGltype())) { |
|
|
|
BigDecimal ttBcbal = loop1.getTtBcbal(); |
|
|
|
ttAccountOthap = ttAccountOthap.add(ttBcbal); |
|
|
|
} else if ("PREPAY".equals(loop1.getTtGltype())) { |
|
|
|
BigDecimal ttBcbal = loop1.getTtBcbal(); |
|
|
|
ttAccountPrepay = ttAccountPrepay.add(ttBcbal); |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
// throw exception(SUPPLIER_APBALANCE_MAIN_NOT_EXISTS);
|
|
|
|
} |
|
|
|
// List<SupplierApbalanceDetailDO> detailDOS = supplierApbalanceDetailMapper.selectList("master_id", supplierApbalanceMainDO.getId());
|
|
|
|
// BigDecimal ttAccountAp = new BigDecimal(0);
|
|
|
|
// BigDecimal ttAccountOthap = new BigDecimal(0);
|
|
|
|
// BigDecimal ttAccountPrepay = new BigDecimal(0);
|
|
|
|
// if (!CollectionUtil.isEmpty(detailDOS)) {
|
|
|
|
// for (SupplierApbalanceDetailDO loop1 : detailDOS) {
|
|
|
|
// if ("AP".equals(loop1.getTtGltype())) {
|
|
|
|
// BigDecimal ttBcbal = loop1.getTtBcbal();
|
|
|
|
// ttAccountAp = ttAccountAp.add(ttBcbal);
|
|
|
|
// } else if ("OTHAP".equals(loop1.getTtGltype())) {
|
|
|
|
// BigDecimal ttBcbal = loop1.getTtBcbal();
|
|
|
|
// ttAccountOthap = ttAccountOthap.add(ttBcbal);
|
|
|
|
// } else if ("PREPAY".equals(loop1.getTtGltype())) {
|
|
|
|
// BigDecimal ttBcbal = loop1.getTtBcbal();
|
|
|
|
// ttAccountPrepay = ttAccountPrepay.add(ttBcbal);
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// } else {
|
|
|
|
// // throw exception(SUPPLIER_APBALANCE_MAIN_NOT_EXISTS);
|
|
|
|
// }
|
|
|
|
BigDecimal zero = new BigDecimal(0.00); |
|
|
|
SupplierDO supplierDO = supplierMapper.selectOne("code", supplierApbalanceMainDO.getTtSupplier()); |
|
|
|
supplierApbalanceMainDO.setTtSupplierName(supplierDO == null ? "" : supplierDO.getName()); |
|
|
|
supplierApbalanceMainDO.setTtAccountAp(ttAccountAp.abs().setScale(2, RoundingMode.HALF_UP)); |
|
|
|
supplierApbalanceMainDO.setTtAccountOthap(ttAccountOthap.abs().setScale(2, RoundingMode.HALF_UP)); |
|
|
|
supplierApbalanceMainDO.setTtAccountPrepay(ttAccountPrepay.abs().setScale(2, RoundingMode.HALF_UP)); |
|
|
|
supplierApbalanceMainDO.setTtAccountAp(supplierApbalanceMainDO.getTtAccountAp() == null ? zero : supplierApbalanceMainDO.getTtAccountAp().setScale(2, RoundingMode.HALF_UP)); |
|
|
|
supplierApbalanceMainDO.setTtAccountOthap(supplierApbalanceMainDO.getTtAccountOthap() == null ? zero: supplierApbalanceMainDO.getTtAccountOthap().setScale(2, RoundingMode.HALF_UP)); |
|
|
|
supplierApbalanceMainDO.setTtAccountPrepay(supplierApbalanceMainDO.getTtAccountPrepay() == null ? zero: supplierApbalanceMainDO.getTtAccountPrepay().setScale(2, RoundingMode.HALF_UP)); |
|
|
|
Long id = SecurityFrameworkUtils.getLoginUser().getId(); |
|
|
|
AdminUserDO adminUserDO = userMapper.selectById(id); |
|
|
|
TenantDO tenantDO = tenantMapper.selectOne("id", adminUserDO.getTenantId()); |
|
|
|