|
|
@@ -327,8 +327,17 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
|
|
|
Page<InsPlyIncome> page = baseMapper.getReceivablePage(page1, receivableQueryVo);
|
|
|
List<InsPlyIncomeOrder> res = page.getRecords().stream()
|
|
|
.map(action -> new InsPlyIncomeOrder(action.getId(), action.getOrderNo())).toList();
|
|
|
- BigDecimal totalAmount = page.getRecords().stream()
|
|
|
- .map(action -> new BigDecimal(Objects.toString(action.getReceivableAmount(), "0"))).reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
+ BigDecimal totalAmount = BigDecimal.ZERO;
|
|
|
+ if ("3".equals(receivableQueryVo.getInvoiceType())){
|
|
|
+ totalAmount = page.getRecords().stream()
|
|
|
+ .map(action -> new BigDecimal(Objects.toString(action.getJySuperviseCostsPremiums(), "0"))).reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
+ } else if ("4".equals(receivableQueryVo.getInvoiceType())){
|
|
|
+ totalAmount = page.getRecords().stream()
|
|
|
+ .map(action -> new BigDecimal(Objects.toString(action.getJyOtherCostsPremiums(), "0"))).reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
+ }else{
|
|
|
+ totalAmount = page.getRecords().stream()
|
|
|
+ .map(action -> new BigDecimal(Objects.toString(action.getReceivableAmount(), "0"))).reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
+ }
|
|
|
|
|
|
InsPlyIncomeVO vo = new InsPlyIncomeVO(null, res,Objects.toString(totalAmount,"0"));
|
|
|
log.info("获取私有/平台协议手续费应收列表的id集合。receivableQueryVo=[{}]. ids.size=[{}]", JSONUtil.toJsonStr(receivableQueryVo), CollUtil.size(res));
|
|
|
@@ -4065,7 +4074,7 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
|
|
|
for (int month = 1; month <= 12; month++) {
|
|
|
InsFeeFollowOrderVo vo = buildFollowOrderVo(
|
|
|
year, month, firstItem, partnerCompanyId,
|
|
|
- monthReceivableMap, invoicedMap
|
|
|
+ monthReceivableMap, invoicedMap, followInvoicePageListVo
|
|
|
);
|
|
|
result.add(vo);
|
|
|
}
|
|
|
@@ -4195,7 +4204,7 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
|
|
|
private InsFeeFollowOrderVo buildFollowOrderVo(Integer year, int month, InsPlyIncomeDto firstItem,
|
|
|
String partnerCompanyId,
|
|
|
Map<Integer, BigDecimal> monthReceivableMap,
|
|
|
- Map<String, BigDecimal> invoicedMap) {
|
|
|
+ Map<String, BigDecimal> invoicedMap, FollowInvoicePageListVo followInvoicePageListVo) {
|
|
|
|
|
|
String systemCode = baseController.getSystemCode();
|
|
|
// 获取当月应收保费,默认为0
|
|
|
@@ -4221,6 +4230,7 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
|
|
|
.eq("month", month)
|
|
|
.eq("partner_company_id", partnerCompanyId)
|
|
|
.eq("system_code", systemCode)
|
|
|
+ .eq("invoice_type", followInvoicePageListVo.getInvoiceType())
|
|
|
.last("LIMIT 1"); // 取一条即可,或者根据业务取最新的
|
|
|
InsFeeFollowOrder dbOrder = insFeeFollowOrderMapper.selectOne(queryWrapper);
|
|
|
if (dbOrder != null) {
|
|
|
@@ -4237,6 +4247,7 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
|
|
|
.eq("month", month)
|
|
|
.eq("partner_company_id", partnerCompanyId)
|
|
|
.eq("system_code", systemCode)
|
|
|
+ .eq("invoice_type", followInvoicePageListVo.getInvoiceType())
|
|
|
.last("LIMIT 1"); // 取一条即可,或者根据业务取最新的
|
|
|
InsFeeFollowOrderReconciliation insFeeFollowOrderReconciliation = insFeeFollowOrderReconciliationMapper.selectOne(insFeeFollowOrderReconciliationQueryWrapper);
|
|
|
if (null != insFeeFollowOrderReconciliation){
|