Просмотр исходного кода

Merge branch 'dev_jzg_lipf_v20260622'

lipf 1 месяц назад
Родитель
Сommit
138727e7fb
16 измененных файлов с 336 добавлено и 109 удалено
  1. 3 1
      .gitignore
  2. 4 0
      commons/src/main/java/com/jzg/commons/entity/dto/FeeAuditParam.java
  3. 14 0
      commons/src/main/java/com/jzg/commons/entity/dto/UpdatePayAccountParam.java
  4. 46 23
      commons/src/main/java/com/jzg/commons/entity/orders/vo/FeeAuditVo.java
  5. 3 0
      tenant/insurance/quotation-summary/src/main/resources/mapper/InsFeeAuditMapper.xml
  6. 13 0
      tenant/organization/src/main/java/com/jzg/organization/controller/AmountAuditingController.java
  7. 8 0
      tenant/organization/src/main/java/com/jzg/organization/mapper/SysAmountAuditingMapper.java
  8. 1 1
      tenant/organization/src/main/java/com/jzg/organization/mapper/SysUserAccountIncomeLogMapper.java
  9. 9 0
      tenant/organization/src/main/java/com/jzg/organization/service/SysAmountAuditingService.java
  10. 9 0
      tenant/organization/src/main/java/com/jzg/organization/service/SysUserAccountIncomeLogService.java
  11. 1 1
      tenant/organization/src/main/java/com/jzg/organization/service/impl/ReceivableServiceImpl.java
  12. 44 0
      tenant/organization/src/main/java/com/jzg/organization/service/impl/SysAmountAuditingServiceImpl.java
  13. 28 0
      tenant/organization/src/main/java/com/jzg/organization/service/impl/SysUserAccountIncomeLogServiceImpl.java
  14. 141 75
      tenant/organization/src/main/java/com/jzg/organization/service/impl/SysUserAccountServiceImpl.java
  15. 2 2
      tenant/organization/src/main/resources/mapper/ReceivableMapper.xml
  16. 10 6
      tenant/organization/src/main/resources/mapper/SysAmountAuditingMapper.xml

+ 3 - 1
.gitignore

@@ -83,4 +83,6 @@ tenant/insurance/quotation-yongcheng/outPath/
 tenant/insurance/quotation-zhongan/outPath/
 tenant/insurance/quotation-zhongmei/outPath/
 tenant/insurance/quotation-zijin/outPath/
-tenant/organization/outPath/
+tenant/organization/outPath/
+
+.reasonix

+ 4 - 0
commons/src/main/java/com/jzg/commons/entity/dto/FeeAuditParam.java

@@ -67,6 +67,10 @@ public class FeeAuditParam extends PageRequest {
     @JsonFormat(pattern = "yyyy-MM-dd")
     private LocalDate signingTimeEnd;
 
+    @Schema(description = "签单时间")
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    private List<String> signingTime;
+
     @Schema(description = "订单号")
     private String orderNo;
 

+ 14 - 0
commons/src/main/java/com/jzg/commons/entity/dto/UpdatePayAccountParam.java

@@ -0,0 +1,14 @@
+package com.jzg.commons.entity.dto;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+
+@Data
+public class UpdatePayAccountParam {
+
+    @Schema(name = "提现申请表的序号")
+    private String amountAuditingId;
+
+    @Schema(name = "付款账号Id")
+    private String payAccountId;
+}

+ 46 - 23
commons/src/main/java/com/jzg/commons/entity/orders/vo/FeeAuditVo.java

@@ -18,6 +18,7 @@ public class FeeAuditVo extends BaseModel {
 
     @Serial
     private static final long serialVersionUID = 4631117388822444574L;
+
     @ExcelProperty("订单号")
     @Schema(description = "订单号")
     private String orderNo;
@@ -29,9 +30,7 @@ public class FeeAuditVo extends BaseModel {
     @ExcelIgnore
     @Schema(description = "保险公司ID")
     private String companyId;
-    /**
-     * 保险公司名称及父级的名称,例如
-     */
+
     @ExcelIgnore
     @Schema(description = "保险公司名称及父级的名称")
     private String companyALlName;
@@ -116,8 +115,8 @@ public class FeeAuditVo extends BaseModel {
     @Schema(description = "驾意险保费")
     private BigDecimal jyPremium;
 
-    @ExcelProperty("总保费")
-    @Schema(description = "总保费")
+    @ExcelProperty("险种总保费")
+    @Schema(description = "险种合计总保费")
     private BigDecimal sumPremium;
 
     @ExcelProperty("审核时间")
@@ -133,11 +132,11 @@ public class FeeAuditVo extends BaseModel {
     @Schema(description = "驳回原因")
     private String refuse;
 
-    @ExcelProperty("是否疑问订单 0.否 1.是")
+    @ExcelProperty("是否疑问订单")
     @Schema(description = "是否是疑问订单 0.否 1.是")
     private String isProblem;
 
-    @ExcelProperty("订单来源 0 pc  1 app")
+    @ExcelProperty("订单来源")
     @Schema(description = "订单来源 0 pc  1 app")
     private String orderSource;
 
@@ -149,17 +148,16 @@ public class FeeAuditVo extends BaseModel {
     @Schema(description = "是否是疑问单")
     private int problem;
 
-    @ExcelProperty("设置为疑问单的原因")
+    @ExcelProperty("疑问单设置原因")
     @Schema(description = "设置为疑问单的原因")
     private String problemReason;
 
-    @ExcelProperty("设为疑问单的时间")
-    @Schema(description = "设为疑问单的时间")
+    @ExcelProperty("疑问单设置时间")
+    @Schema(description = "设为疑问单的时间")
     private String problemTime;
 
-
-    @ExcelProperty("总保费")
-    @Schema(description = "总保费")
+    @ExcelProperty("订单总保费")
+    @Schema(description = "订单最终总保费")
     private BigDecimal totalPremium;
 
     @ExcelProperty("交强险应收费用")
@@ -194,14 +192,10 @@ public class FeeAuditVo extends BaseModel {
     @Schema(description = "总应付费用(含分销)")
     private BigDecimal totalPayablePremium;
 
-    /**
-     * 表示不含分销费用的金额
-     */
     @ExcelProperty("总应付费用")
-    @Schema(description = "总应付费用")
+    @Schema(description = "不含分销费用的总应付金额")
     private BigDecimal totalExportPremium;
 
-
     @ExcelProperty("交强险手续费费用")
     @Schema(description = "交强险手续费费用")
     private BigDecimal jqCommissionPremium;
@@ -358,11 +352,10 @@ public class FeeAuditVo extends BaseModel {
     @Schema(description = "驾意出口留点费用")
     private BigDecimal jyExportKeepPointPremium;
 
-    @ExcelProperty("权益相关:可用金额<可用金额=出口费用➖出口人留点费用>")
-    @Schema(description = "权益相关:可用金额<可用金额=出口费用➖出口人留点费用>")
+    @ExcelProperty("可用金额")
+    @Schema(description = "可用金额=出口费用➖出口人留点费用")
     private BigDecimal availableAmount;
 
-
     @Schema(description = "一级分销费")
     @ExcelProperty("一级分销费")
     @TableField(exist = false)
@@ -424,33 +417,63 @@ public class FeeAuditVo extends BaseModel {
     @TableField(exist = false)
     private BigDecimal thirdDistributionRatio;
 
+    @ExcelIgnore
+    @Schema(description = "支付时间")
     private String payingTime;
 
+    @ExcelIgnore
+    @Schema(description = "合作保险公司ID")
     private String partnerCompanyId;
 
+    @ExcelIgnore
     @Schema(description = "保险机构名称")
     private String partnerCompanyName;
-    @Schema(description = "保险机构名称")
+
+    @ExcelIgnore
+    @Schema(description = "保险机构简称")
     private String partnerCompanySimplyName;
 
+    @ExcelIgnore
     @Schema(description = "对接人姓名")
     private String contact;
 
+    @ExcelIgnore
     @Schema(description = "交强保单号")
     private String jqPolicyNo;
+
+    @ExcelIgnore
     @Schema(description = "非车保单号")
     private String jyPolicyNo;
+
+    @ExcelIgnore
     @Schema(description = "商业保单号")
     private String syPolicyNo;
 
-    @Schema(description = "起保时间")
+    @ExcelIgnore
+    @Schema(description = "交强险起保时间")
     private String jqRiskStartDate;
+
+    @ExcelIgnore
+    @Schema(description = "交强险终保时间")
     private String jqRiskEndDate;
+
+    @ExcelIgnore
+    @Schema(description = "商业险起保时间")
     private String syRiskStartDate;
+
+    @ExcelIgnore
+    @Schema(description = "商业险终保时间")
     private String syRiskEndDate;
+
+    @ExcelIgnore
+    @Schema(description = "驾意险起保时间")
     private String jyRiskStartDate;
+
+    @ExcelIgnore
+    @Schema(description = "驾意险终保时间")
     private String jyRiskEndDate;
 
+    @ExcelIgnore
     @Schema(description = "投保人")
     private String policyholder;
 }

+ 3 - 0
tenant/insurance/quotation-summary/src/main/resources/mapper/InsFeeAuditMapper.xml

@@ -188,6 +188,9 @@
             <if test="param.signingTimeStart != null and param.signingTimeEnd != null">
                 and DATE_FORMAT(io.signing_time, '%Y-%m-%d') between #{param.signingTimeStart} AND #{param.signingTimeEnd}
             </if>
+            <if test="param.signingTime != null and param.signingTime.size() > 0">
+                and DATE_FORMAT(io.signing_time,'%Y-%m-%d') between #{param.signingTime[0]} AND #{param.signingTime[1]}
+            </if>
             <if test="param.orderNo != null and param.orderNo != ''">
                 and ifa.order_no = #{param.orderNo}
             </if>

+ 13 - 0
tenant/organization/src/main/java/com/jzg/organization/controller/AmountAuditingController.java

@@ -150,6 +150,19 @@ public class AmountAuditingController extends BaseController {
         return HttpResult.ok(b.toString());
     }
 
+    /**
+     * 修改付款账号
+     *
+     * @param param 参数
+     * @author lipf
+     * @date 2026/8/11 15:13
+     */
+    @Operation(summary = "修改付款账号")
+    @PostMapping("/updatePayAccountInfo")
+    public HttpResult<String> updatePayAccountInfo(@RequestBody UpdatePayAccountParam param){
+        return sysAmountAuditingService.updatePayAccountInfo(param);
+    }
+
     /**
      * 业务员提交提现申请
      *

+ 8 - 0
tenant/organization/src/main/java/com/jzg/organization/mapper/SysAmountAuditingMapper.java

@@ -78,6 +78,14 @@ public interface SysAmountAuditingMapper extends BaseMapper<SysAmountAuditing> {
      * @date 2026/7/20 15:46
      */
     List<IncomeAndExpenseList> getIncomeAndExpense(IncomeAndExpenseParam param);
+
+    /**
+     *
+     * @author lipf
+     * @date 2026/8/11 15:24
+     */
+    void updatePayAccountInfo(@Param("amountAuditingId") String amountAuditingId,
+                              @Param("payAccountId") String payAccountId);
 }
 
 

+ 1 - 1
tenant/organization/src/main/java/com/jzg/organization/mapper/SysUserAccountIncomeLogMapper.java

@@ -35,7 +35,7 @@ public interface SysUserAccountIncomeLogMapper extends BaseMapper<SysUserAccount
         left join sys_amount_auditing saa
             on saa.id = a.related_amount_auditing_id
         where
-            a.user_id = #{ywyUserId} and a.create_time >= #{beginDate} and a.create_time < #{endDate} and a.is_delete = 0 and a.status = 10 order by a.create_time desc
+            a.user_id = #{ywyUserId} and a.create_time >= #{beginDate} and a.create_time < #{endDate}  order by a.create_time desc
         """)
     List<SysUserAccountChangeLog> queryYwyIORecs(String ywyUserId, LocalDate beginDate, LocalDate endDate);
 }

+ 9 - 0
tenant/organization/src/main/java/com/jzg/organization/service/SysAmountAuditingService.java

@@ -119,4 +119,13 @@ public interface SysAmountAuditingService extends IService<SysAmountAuditing> {
      * @date 2026/7/20 15:40
      */
     List<IncomeAndExpenseList> getIncomeAndExpense(IncomeAndExpenseParam param);
+
+    /**
+     * 修改付款账号
+     *
+     * @param param 付款账号的序号
+     * @author lipf
+     * @date 2026/8/11 15:17
+     */
+    HttpResult<String> updatePayAccountInfo(UpdatePayAccountParam param);
 }

+ 9 - 0
tenant/organization/src/main/java/com/jzg/organization/service/SysUserAccountIncomeLogService.java

@@ -1,6 +1,7 @@
 package com.jzg.organization.service;
 
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.jzg.commons.core.page.HttpResult;
 import com.jzg.commons.entity.account.po.SysUserAccountChangeLog;
 import com.jzg.commons.entity.dto.YwyIOParam;
 
@@ -22,4 +23,12 @@ public interface SysUserAccountIncomeLogService extends IService<SysUserAccountC
      * @date 2026/6/8 17:25
      */
     List<SysUserAccountChangeLog> queryYwyIORecs(YwyIOParam ywyIOParam);
+
+    /**
+     * 更新记录的付款账号
+     *
+     * @author lipf
+     * @date 2026/8/11 15:37
+     */
+    HttpResult<String> updatePayAccountInfo(SysUserAccountChangeLog changeLog);
 }

+ 1 - 1
tenant/organization/src/main/java/com/jzg/organization/service/impl/ReceivableServiceImpl.java

@@ -861,7 +861,7 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
                             || invoiceType.equals(income.getInvoiceType()))
                     .collect(Collectors.toCollection(ArrayList::new));
             List<InsPlyIncomeDto> copyList = CollUtil.newArrayList();
-            if (CollUtil.isNotEmpty(incomeDtoList)){
+            if (CollUtil.isNotEmpty(incomeDtoList) && InvoiceTypeEnum.FEE_2.getCode().equals(invoiceType)){
                 // 如果有发票类型为4的,则复制一条4的数据,完全一致,但发票类型为2
                 incomeDtoList.stream().filter(item -> InvoiceTypeEnum.FEE_4.getCode().equals(item.getInvoiceType())).forEach(item -> {
                     InsPlyIncomeDto incomeDto = new InsPlyIncomeDto();

+ 44 - 0
tenant/organization/src/main/java/com/jzg/organization/service/impl/SysAmountAuditingServiceImpl.java

@@ -12,6 +12,7 @@ import com.jzg.commons.core.base.StateResult;
 import com.jzg.commons.core.page.HttpResult;
 import com.jzg.commons.entity.account.po.InvAccountCard;
 import com.jzg.commons.entity.account.po.SysUserAccountChangeLog;
+import com.jzg.commons.entity.account.vo.AccountCardVo;
 import com.jzg.commons.entity.dto.*;
 import com.jzg.commons.entity.po.SysAmountAuditing;
 import com.jzg.commons.entity.po.SysUserAccount;
@@ -536,6 +537,49 @@ public class SysAmountAuditingServiceImpl extends ServiceImpl<SysAmountAuditingM
         log.info("查询收支明细queryIncomeANdExpense:param=[{}],incomeAndExpenseLists.size()=[{}]",JSONUtil.toJsonStr(param), CollUtil.size(incomeAndExpenseLists));
         return incomeAndExpenseLists;
     }
+
+    /**
+     * 修改付款账号
+     *
+     * @param param 付款账号的序号
+     * @author lipf
+     * @date 2026/8/11 15:17
+     */
+    @Override
+    public HttpResult<String> updatePayAccountInfo(UpdatePayAccountParam param) {
+        log.info("修改付款账号。 param=[{}]", JSONUtil.toJsonStr(param));
+        HttpResult<String> validateRes = this.validatePayAccountParam(param);
+        if(validateRes.isFail()){
+            log.info("修改付款账号异常。 validateRes=[{}]", JSONUtil.toJsonStr(validateRes));
+            return validateRes;
+        }
+        baseMapper.updatePayAccountInfo(param.getAmountAuditingId(), param.getPayAccountId());
+        SysUserAccountChangeLog changeLog = new SysUserAccountChangeLog();
+        AccountCardVo accountCardVo = invAccountCardService.queryById(param.getPayAccountId());
+        changeLog.setRelatedAmountAuditingId(param.getAmountAuditingId());
+        changeLog.setBankCardNoTo(accountCardVo.getBankCardNum());
+        changeLog.setBankCardIdTo(param.getPayAccountId());
+        sysUserAccountIncomeLogService.updatePayAccountInfo(changeLog);
+        return HttpResult.ok("更新完成");
+    }
+
+    /**
+     * 校验参数
+     *
+     * @author lipf
+     * @date 2026/8/11 15:51
+     */
+    private HttpResult<String> validatePayAccountParam(UpdatePayAccountParam param) {
+        SysAmountAuditing sysAmountAuditing = baseMapper.selectById(param.getAmountAuditingId());
+        if(sysAmountAuditing == null){
+            return HttpResult.error("要修改的记录不存在");
+        }
+        AccountCardVo accountCardVo = invAccountCardService.queryById(param.getPayAccountId());
+        if(accountCardVo == null){
+            return HttpResult.error("付款账号不存在");
+        }
+        return HttpResult.ok();
+    }
 }
 
 

+ 28 - 0
tenant/organization/src/main/java/com/jzg/organization/service/impl/SysUserAccountIncomeLogServiceImpl.java

@@ -2,7 +2,9 @@ package com.jzg.organization.service.impl;
 
 import cn.hutool.core.collection.CollUtil;
 import cn.hutool.json.JSONUtil;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.jzg.commons.core.page.HttpResult;
 import com.jzg.commons.entity.account.po.SysUserAccountChangeLog;
 import com.jzg.commons.entity.dto.YwyIOParam;
 import com.jzg.organization.mapper.*;
@@ -41,6 +43,32 @@ public class SysUserAccountIncomeLogServiceImpl extends ServiceImpl<SysUserAccou
         log.info("查询业务员收支明细:ywyIOParam=[{}]。 查询出[{}]条记录", JSONUtil.toJsonStr(ywyIOParam), CollUtil.size(changeLogs));
         return changeLogs;
     }
+
+    /**
+     * 更新记录的付款账号
+     *
+     * @param changeLog
+     * @author lipf
+     * @date 2026/8/11 15:37
+     */
+    @Override
+    public HttpResult<String> updatePayAccountInfo(SysUserAccountChangeLog changeLog) {
+        LambdaQueryWrapper<SysUserAccountChangeLog> queryWrapper = new LambdaQueryWrapper<>();
+        queryWrapper.eq(SysUserAccountChangeLog::getRelatedAmountAuditingId, changeLog.getRelatedAmountAuditingId());
+        List<SysUserAccountChangeLog> changeLogs = baseMapper.selectList(queryWrapper);
+        if(CollUtil.isEmpty(changeLogs)){
+            String errMsg = String.format("未找到关联费用审核序号为[%s]的记录", changeLog.getRelatedAmountAuditingId());
+            log.error(errMsg);
+            return HttpResult.error(errMsg);
+        }
+        SysUserAccountChangeLog res = new  SysUserAccountChangeLog();
+        res.setBankCardIdTo(changeLog.getBankCardIdTo());
+        res.setBankCardNoTo(changeLog.getBankCardNoTo());
+        res.setId(changeLogs.get(0).getId());
+        res.setOperType(changeLog.getOperType());
+        baseMapper.updateById(res);
+        return HttpResult.ok();
+    }
 }
 
 

+ 141 - 75
tenant/organization/src/main/java/com/jzg/organization/service/impl/SysUserAccountServiceImpl.java

@@ -18,6 +18,7 @@ import com.jzg.organization.mapper.SysAmountAuditingMapper;
 import com.jzg.organization.mapper.SysUserAccountIncomeLogMapper;
 import com.jzg.organization.mapper.SysUserAccountMapper;
 import com.jzg.organization.service.*;
+import org.jetbrains.annotations.NotNull;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.BeanUtils;
@@ -279,84 +280,17 @@ public class SysUserAccountServiceImpl extends ServiceImpl<SysUserAccountMapper,
      */
     @Override
     public List<IncomeAndExpenseVo> getIncomeAndExpense(IncomeAndExpenseParam param){
-
         log.info("查询收支明细记录:param=[{}]", JSONUtil.toJsonStr(param));
         String key = this.populateParam(param);
-        //List<IncomeAndExpenseList> recordsWithOutParam = sysAmountAuditingService.getIncomeAndExpense(new IncomeAndExpenseParam(param.getUserId(),param.getSystemCode()));
         List<IncomeAndExpenseList> allRecords = sysAmountAuditingService.getIncomeAndExpense(param);
-        allRecords = allRecords.stream().peek(action->{
-            if("0".equals(action.getStatus())){
-                action.setRemark("提现审核中");
-            }
-            List<ChangeLogDetail> stepList = new ArrayList<>();
-            if("0".equals(action.getAuditingStatus())){
-                stepList.add(new ChangeLogDetail("提交提现申请",action.getCreateTime(),true, null));
-                stepList.add(new ChangeLogDetail("财务人员审核",null, null,null));
-                stepList.add(new ChangeLogDetail("财务人员打款", null, null, null));
-            }else if(StrUtil.isEmpty(action.getAuditingStatus())){
-                if("1".equals(action.getStatus())){
-                    if("1".equals(action.getIncomeAndExpense())){
-                        stepList.add(new ChangeLogDetail("提交提现申请",action.getCreateTime(),true, null));
-                        stepList.add(new ChangeLogDetail("财务人员审核",action.getPaymentTime(), true,null));
-                        stepList.add(new ChangeLogDetail("财务人员打款", action.getPaymentTime(), true, null));
-                    }
-                    if("0".equals(action.getIncomeAndExpense())){
-                        // 保费收入
-                        stepList.add(new ChangeLogDetail("费用审核通过",action.getCreateTime(),true, null));
-                        stepList.add(new ChangeLogDetail());
-                        stepList.add(new ChangeLogDetail());
-                    }
-                }else if("2".equals(action.getStatus())){
-                    stepList.add(new ChangeLogDetail("提交提现申请",action.getCreateTime(),true, null));
-                    stepList.add(new ChangeLogDetail("财务人员审核",action.getPaymentTime(), true,null));
-                    stepList.add(new ChangeLogDetail("财务审核不通过", action.getRejectTime(), false, null));
-                }
-            }
-            action.setStepList(stepList);
-
-        }).toList();
-        allRecords= new ArrayList<>(allRecords);
+        allRecords= new ArrayList<>(fillProcessDtls(allRecords));
         // 排序
         allRecords.sort((a, b) -> {
             if (a.getCreateTime() == null) return 1;
             if (b.getCreateTime() == null) return -1;
             return b.getCreateTime().compareTo(a.getCreateTime());
         });
-        // 按月份分组统计
-        Map<String, IncomeAndExpenseVo.IncomeAndExpense> monthSummaryMap = new TreeMap<>(Collections.reverseOrder());
-        if(CollUtil.isEmpty(allRecords)){
-            IncomeAndExpenseVo.IncomeAndExpense summary = monthSummaryMap.get(key);
-            summary = new IncomeAndExpenseVo.IncomeAndExpense();
-            summary.setMonth(key);
-            summary.setIncome(BigDecimal.ZERO);
-            summary.setExpense(BigDecimal.ZERO);
-            summary.setBalance(BigDecimal.ZERO);
-            monthSummaryMap.put(key, summary);
-        }
-        for (IncomeAndExpenseList record : allRecords) {
-            if (record.getCreateTime() == null) continue;
-            // 获取或创建月度汇总对象
-            IncomeAndExpenseVo.IncomeAndExpense summary = monthSummaryMap.get(key);
-            if (summary == null) {
-                summary = new IncomeAndExpenseVo.IncomeAndExpense();
-                summary.setMonth(key);
-                summary.setIncome(BigDecimal.ZERO);
-                summary.setExpense(BigDecimal.ZERO);
-                summary.setBalance(BigDecimal.ZERO);
-                monthSummaryMap.put(key, summary);
-            }
-            // 更新收入或支出
-            if ("0".equals(record.getIncomeAndExpense())) {
-                // 收入
-                summary.setIncome(BigDecimalUtil.add(summary.getIncome(),record.getAmount()));
-            } else if("1".equals(record.getIncomeAndExpense()) && !"2".equals(record.getStatus())){
-                // 支出, 并且不是审核驳回的数据
-                summary.setExpense(BigDecimalUtil.add(summary.getExpense(),record.getAmount()));
-            }
-            // 计算余额(收入 - 支出)
-            summary.setBalance(summary.getIncome().subtract(summary.getExpense()));
-        }
-
+        Map<String, IncomeAndExpenseVo.IncomeAndExpense> monthSummaryMap = this.calSummaryData(allRecords, key);
         // 如果指定了月份筛选,只返回该月的数据
         if (param.getMonth() != null && !param.getMonth().isEmpty()) {
             List<IncomeAndExpenseVo> result = new ArrayList<>();
@@ -364,11 +298,20 @@ public class SysUserAccountServiceImpl extends ServiceImpl<SysUserAccountMapper,
             IncomeAndExpenseVo.IncomeAndExpense summary = monthSummaryMap.get(param.getMonth());
             if (summary != null) {
                 vo.setIncomeAndExpense(summary);
-
                 // 筛选当前月份的明细记录
                 List<IncomeAndExpenseVo.IncomeAndExpenseList> monthRecords = allRecords.stream()
                         .filter(record -> param.getMonth().equals(record.getCreateTime().format(DateTimeFormatter.ofPattern("yyyy-MM"))))
-                        .map(action->{
+                        .filter(action->{
+                            if(StrUtil.isNotEmpty(param.getStatus())){
+                                return param.getStatus().equals(action.getStatus());
+                            }
+                            return true;}
+                        ).filter(action->{
+                            if(StrUtil.isNotEmpty(param.getIncomeAndExpense())){
+                                return param.getIncomeAndExpense().equals(action.getIncomeAndExpense());
+                            }
+                            return true;
+                        }).map(action->{
                             IncomeAndExpenseVo.IncomeAndExpenseList a = new IncomeAndExpenseVo.IncomeAndExpenseList();
                             BeanUtils.copyProperties(action,a);
                             return a;
@@ -385,7 +328,6 @@ public class SysUserAccountServiceImpl extends ServiceImpl<SysUserAccountMapper,
         for (Map.Entry<String, IncomeAndExpenseVo.IncomeAndExpense> entry : monthSummaryMap.entrySet()) {
             IncomeAndExpenseVo vo = new IncomeAndExpenseVo();
             vo.setIncomeAndExpense(entry.getValue());
-
             // 筛选当前月份的明细记录
             List<IncomeAndExpenseVo.IncomeAndExpenseList> monthRecords = allRecords.stream()
                     .filter(record -> {
@@ -394,7 +336,17 @@ public class SysUserAccountServiceImpl extends ServiceImpl<SysUserAccountMapper,
                         }
                         return entry.getKey().equals(record.getCreateTime().format(DateTimeFormatter.ofPattern("yyyy-MM")));
                     })
-                    .map(action->{
+                    .filter(action->{
+                        if(StrUtil.isNotEmpty(param.getStatus())){
+                            return param.getStatus().equals(action.getStatus());
+                        }
+                        return true;}
+                    ).filter(action->{
+                        if(StrUtil.isNotEmpty(param.getIncomeAndExpense())){
+                            return param.getIncomeAndExpense().equals(action.getIncomeAndExpense());
+                        }
+                        return true;
+                    }).map(action->{
                         IncomeAndExpenseVo.IncomeAndExpenseList a = new IncomeAndExpenseVo.IncomeAndExpenseList();
                         BeanUtils.copyProperties(action,a);
                         return a;
@@ -406,6 +358,100 @@ public class SysUserAccountServiceImpl extends ServiceImpl<SysUserAccountMapper,
         return result;
     }
 
+    /**
+     * 计算汇总数据
+     *
+     * @author lipf
+     * @date 2026/8/11 14:43
+     */
+    @NotNull
+    private Map<String, IncomeAndExpenseVo.IncomeAndExpense> calSummaryData(List<IncomeAndExpenseList> allRecords, String key) {
+        // 按月份分组统计
+        Map<String, IncomeAndExpenseVo.IncomeAndExpense> monthSummaryMap = new TreeMap<>(Collections.reverseOrder());
+        if(CollUtil.isEmpty(allRecords)){
+            IncomeAndExpenseVo.IncomeAndExpense summary = this.initSummary(key);
+            monthSummaryMap.put(key, summary);
+        }
+        for (IncomeAndExpenseList record : allRecords) {
+            if (record.getCreateTime() == null) continue;
+            // 获取或创建月度汇总对象
+            IncomeAndExpenseVo.IncomeAndExpense summary = monthSummaryMap.get(key);
+            if (summary == null) {
+                summary = this.initSummary(key);
+                monthSummaryMap.put(key, summary);
+            }
+            // 更新收入或支出
+            if ("0".equals(record.getIncomeAndExpense())) {
+                // 收入
+                summary.setIncome(BigDecimalUtil.add(summary.getIncome(),record.getAmount()));
+            } else if("1".equals(record.getIncomeAndExpense()) && !"2".equals(record.getStatus())){
+                // 支出, 并且不是审核驳回的数据
+                summary.setExpense(BigDecimalUtil.add(summary.getExpense(),record.getAmount()));
+            }
+            // 计算余额(收入 - 支出)
+            summary.setBalance(summary.getIncome().subtract(summary.getExpense()));
+        }
+        return monthSummaryMap;
+    }
+
+    /**
+     * 初始化汇总数据
+     *
+     * @param key 月份
+     * @author lipf
+     * @date 2026/8/11 14:41
+     */
+    private  IncomeAndExpenseVo.IncomeAndExpense initSummary(String key) {
+        IncomeAndExpenseVo.IncomeAndExpense summary = new IncomeAndExpenseVo.IncomeAndExpense();
+        summary.setMonth(key);
+        summary.setIncome(BigDecimal.ZERO);
+        summary.setExpense(BigDecimal.ZERO);
+        summary.setBalance(BigDecimal.ZERO);
+        return summary;
+    }
+
+    /**
+     * 填充处理进度
+     *
+     * @param allRecords 要处理的数据
+     * @author lipf
+     * @date 2026/8/11 14:37
+     */
+    @NotNull
+    private static List<IncomeAndExpenseList> fillProcessDtls(List<IncomeAndExpenseList> allRecords) {
+        allRecords = allRecords.stream().peek(action->{
+            if("0".equals(action.getStatus())){
+                action.setRemark("提现审核中");
+            }
+            List<ChangeLogDetail> stepList = new ArrayList<>();
+            if("0".equals(action.getAuditingStatus())){
+                stepList.add(new ChangeLogDetail("提交提现申请",action.getCreateTime(),true, null));
+                stepList.add(new ChangeLogDetail("财务人员审核",null, null,null));
+                stepList.add(new ChangeLogDetail("财务人员打款", null, null, null));
+            }else if(StrUtil.isEmpty(action.getAuditingStatus())){
+                if("1".equals(action.getStatus())){
+                    if("1".equals(action.getIncomeAndExpense())){
+                        stepList.add(new ChangeLogDetail("提交提现申请",action.getCreateTime(),true, null));
+                        stepList.add(new ChangeLogDetail("财务人员审核",action.getPaymentTime(), true,null));
+                        stepList.add(new ChangeLogDetail("财务人员打款", action.getPaymentTime(), true, null));
+                    }
+                    if("0".equals(action.getIncomeAndExpense())){
+                        // 保费收入
+                        stepList.add(new ChangeLogDetail("费用审核通过",action.getCreateTime(),true, null));
+                        stepList.add(new ChangeLogDetail());
+                        stepList.add(new ChangeLogDetail());
+                    }
+                }else if("2".equals(action.getStatus())){
+                    stepList.add(new ChangeLogDetail("提交提现申请",action.getCreateTime(),true, null));
+                    stepList.add(new ChangeLogDetail("财务人员审核",action.getPaymentTime(), true,null));
+                    stepList.add(new ChangeLogDetail("财务审核不通过", action.getRejectTime(), false, null));
+                }
+            }
+            action.setStepList(stepList);
+        }).toList();
+        return allRecords;
+    }
+
     /**
      * 对查询参数进行预处理
      *
@@ -653,7 +699,17 @@ public class SysUserAccountServiceImpl extends ServiceImpl<SysUserAccountMapper,
                 
                 // 筛选当前月份的明细记录
                 List<IncomeAndExpenseVo.IncomeAndExpenseList> monthRecords = allRecords.stream()
-                        .filter(record -> param.getMonth().equals(record.getCreateTime().format(DateTimeFormatter.ofPattern("yyyy-MM"))))
+                        .filter(action->{
+                            if(StrUtil.isNotEmpty(param.getStatus())){
+                                return param.getStatus().equals(action.getStatus());
+                            }
+                            return true;}
+                        ).filter(action->{
+                            if(StrUtil.isNotEmpty(param.getIncomeAndExpense())){
+                                return param.getIncomeAndExpense().equals(action.getIncomeAndExpense());
+                            }
+                            return true;
+                        }).filter(record -> param.getMonth().equals(record.getCreateTime().format(DateTimeFormatter.ofPattern("yyyy-MM"))))
                         .collect(Collectors.toList());
                 vo.setIncomeAndExpenseList(monthRecords);
                 result.add(vo);
@@ -669,7 +725,17 @@ public class SysUserAccountServiceImpl extends ServiceImpl<SysUserAccountMapper,
 
             // 筛选当前月份的明细记录
             List<IncomeAndExpenseVo.IncomeAndExpenseList> monthRecords = allRecords.stream()
-                    .filter(record -> entry.getKey().equals(record.getCreateTime().format(DateTimeFormatter.ofPattern("yyyy-MM"))))
+                    .filter(action->{
+                        if(StrUtil.isNotEmpty(param.getStatus())){
+                            return param.getStatus().equals(action.getStatus());
+                        }
+                        return true;}
+                    ).filter(action->{
+                        if(StrUtil.isNotEmpty(param.getIncomeAndExpense())){
+                            return param.getIncomeAndExpense().equals(action.getIncomeAndExpense());
+                        }
+                        return true;
+                    }).filter(record -> entry.getKey().equals(record.getCreateTime().format(DateTimeFormatter.ofPattern("yyyy-MM"))))
                     .collect(Collectors.toList());
             vo.setIncomeAndExpenseList(monthRecords);
             result.add(vo);

+ 2 - 2
tenant/organization/src/main/resources/mapper/ReceivableMapper.xml

@@ -346,7 +346,7 @@
         </if>
         <if test="receivableQueryVo.invoiceSettlementStatus != null and receivableQueryVo.invoiceSettlementStatus != ''">
             <!-- 当状态为1时,查询已开票的数据 -->
-            <if test="receivableQueryVo.invoiceSettlementStatus != '2'">
+            <if test="receivableQueryVo.invoiceSettlementStatus != 2">
                 AND ipi.id in (
                 select ipil.income_id from ins_ply_income_invoice_link ipil
                 LEFT JOIN ins_ply_income_invoice ipii ON ipil.invoice_id = ipii.id AND ipii.is_delete = 0
@@ -354,7 +354,7 @@
                 )
             </if>
             <!-- 当状态为2时,查询未开票的数据 -->
-            <if test="receivableQueryVo.invoiceSettlementStatus == '2'">
+            <if test="receivableQueryVo.invoiceSettlementStatus == 2">
                 AND NOT EXISTS (
                 SELECT 1 FROM ins_ply_income_invoice_link link
                 LEFT JOIN ins_ply_income_invoice inv ON link.invoice_id = inv.id AND inv.is_delete = 0

+ 10 - 6
tenant/organization/src/main/resources/mapper/SysAmountAuditingMapper.xml

@@ -40,6 +40,10 @@
         is_delete,create_time,create_by,
         update_time,update_by,system_code
     </sql>
+    <!-- 更新付款账号 lipf 2026年8月11日15:25:58  -->
+    <update id="updatePayAccountInfo">
+        update sys_amount_auditing a set a.account_id = #{payAccountId}  where a.id = #{amountAuditingId}
+    </update>
 
     <select id="queryPage" resultType="com.jzg.commons.entity.vo.AmountAuditVo">
         SELECT
@@ -264,6 +268,12 @@
         select sum(COALESCE(saa.amount, 0)) as payingAmountSum from sys_amount_auditing saa where saa.auditing_status = 0
     </select>
     <!-- 查询收支明细 2026年7月20日15:47:35 -->
+    <!--            <if test="status != null and status != ''">-->
+    <!--                and a.status= #{status}-->
+    <!--            </if>-->
+    <!--            <if test="incomeAndExpense != null and incomeAndExpense != ''">-->
+    <!--                and a.incomeAndExpense = #{incomeAndExpense}-->
+    <!--            </if>-->
     <select id="getIncomeAndExpense"
             resultType="com.jzg.commons.entity.vo.IncomeAndExpenseList">
         select
@@ -336,12 +346,6 @@
         and saa.auditing_status = 0  ) as a
         <where>
             a.user_id = #{userId}
-            <if test="status != null and status != ''">
-                and a.status= #{status}
-            </if>
-            <if test="incomeAndExpense != null and incomeAndExpense != ''">
-                and a.incomeAndExpense = #{incomeAndExpense}
-            </if>
             <if test="createTimeStart != null and createTimeStart != ''">
                 and a.create_time &gt;= #{createTimeStart}
             </if>