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

Merge branch 'master' into wrq_dev

wangrq 3 месяцев назад
Родитель
Сommit
5997825d21
46 измененных файлов с 1512 добавлено и 895 удалено
  1. 7 0
      authentication/src/main/java/com/jzg/entity/SysRolePerms.java
  2. 2 1
      authentication/src/main/java/com/jzg/mapper/SysRolePermsMapper.java
  3. 1 1
      authentication/src/main/java/com/jzg/mapper/SysUserMapper.java
  4. 2 1
      authentication/src/main/java/com/jzg/mapper/SysUserRoleMapper.java
  5. 17 13
      authentication/src/main/resources/mapper/SysRolePermsMapper.xml
  6. 1 1
      authentication/src/main/resources/mapper/SysSystemMapper.xml
  7. 35 27
      authentication/src/main/resources/mapper/SysUserMapper.xml
  8. 8 4
      authentication/src/main/resources/mapper/SysUserRoleMapper.xml
  9. 3 0
      commons/src/main/java/com/jzg/commons/core/base/BaseModel.java
  10. 122 0
      commons/src/main/java/com/jzg/commons/entity/account/po/SysUserAccountChangeLog.java
  11. 0 36
      commons/src/main/java/com/jzg/commons/entity/account/po/SysUserAccountIncomeLog.java
  12. 31 0
      commons/src/main/java/com/jzg/commons/entity/dto/YwyIOParam.java
  13. 8 4
      commons/src/main/java/com/jzg/commons/entity/po/SysArea.java
  14. 7 0
      commons/src/main/java/com/jzg/commons/entity/po/SysOrganizationUserLink.java
  15. 3 0
      commons/src/main/java/com/jzg/commons/entity/po/SysUserJzgInfoBankCard.java
  16. 8 0
      commons/src/main/java/com/jzg/commons/entity/po/SysUserJzgInfoSalesman.java
  17. 7 0
      commons/src/main/java/com/jzg/commons/entity/report/po/ReportSearchConfiguration.java
  18. 7 0
      commons/src/main/java/com/jzg/commons/entity/report/po/ReportUploadExcelTask.java
  19. 6 0
      commons/src/main/java/com/jzg/commons/entity/system/po/SysSystemBusPerms.java
  20. 6 0
      commons/src/main/java/com/jzg/commons/entity/vo/SysUserAccountVo.java
  21. 15 0
      commons/src/main/java/com/jzg/commons/util/BigDecimalUtil.java
  22. 17 13
      consoleStatistics/src/main/resources/mapper/ReportCompanyDataManageMapper.xml
  23. 180 163
      consoleStatistics/src/main/resources/mapper/ReportSearchConfigurationMapper.xml
  24. 38 27
      consoleStatistics/src/main/resources/mapper/ReportUploadExcelTaskMapper.xml
  25. 7 0
      partner/src/main/java/com/jzg/entity/PartnerRule.java
  26. 8 0
      partner/src/main/java/com/jzg/entity/PartnerUser.java
  27. 46 9
      partner/src/main/resources/mapper/PartnerAttributeMapper.xml
  28. 532 481
      partner/src/main/resources/mapper/PartnerUserMapper.xml
  29. 5 4
      partner/src/main/resources/mapper/SysPartnerAccountMapper.xml
  30. 12 2
      tenant/insurance/quotation-commons/src/main/java/com/jzg/quotation/commons/client/OrgClient.java
  31. 44 28
      tenant/insurance/quotation-summary/src/main/java/com/jzg/quotation/summary/service/impl/InsFeeAuditServiceImpl.java
  32. 13 4
      tenant/organization/src/main/java/com/jzg/organization/controller/AmountAuditingController.java
  33. 27 2
      tenant/organization/src/main/java/com/jzg/organization/controller/UserAccountController.java
  34. 14 0
      tenant/organization/src/main/java/com/jzg/organization/mapper/InvAccountCardMapper.java
  35. 18 2
      tenant/organization/src/main/java/com/jzg/organization/mapper/SysUserAccountIncomeLogMapper.java
  36. 10 0
      tenant/organization/src/main/java/com/jzg/organization/mapper/SysUserJzgInfoBankCardMapper.java
  37. 10 0
      tenant/organization/src/main/java/com/jzg/organization/service/InvAccountCardService.java
  38. 9 4
      tenant/organization/src/main/java/com/jzg/organization/service/SysAmountAuditingService.java
  39. 13 2
      tenant/organization/src/main/java/com/jzg/organization/service/SysUserAccountIncomeLogService.java
  40. 10 0
      tenant/organization/src/main/java/com/jzg/organization/service/SysUserJzgInfoBankCardService.java
  41. 16 0
      tenant/organization/src/main/java/com/jzg/organization/service/impl/InvAccountCardServiceImpl.java
  42. 135 27
      tenant/organization/src/main/java/com/jzg/organization/service/impl/SysAmountAuditingServiceImpl.java
  43. 31 39
      tenant/organization/src/main/java/com/jzg/organization/service/impl/SysUserAccountIncomeLogServiceImpl.java
  44. 13 0
      tenant/organization/src/main/java/com/jzg/organization/service/impl/SysUserJzgInfoBankCardServiceImpl.java
  45. 4 0
      tenant/organization/src/main/resources/mapper/InvAccountCardMapper.xml
  46. 4 0
      tenant/organization/src/main/resources/mapper/SysUserJzgInfoBankCardMapper.xml

+ 7 - 0
authentication/src/main/java/com/jzg/entity/SysRolePerms.java

@@ -1,6 +1,8 @@
 package com.jzg.entity;
 
+import com.alibaba.excel.annotation.ExcelIgnore;
 import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableLogic;
 import io.swagger.v3.oas.annotations.media.Schema;
 import lombok.Data;
 
@@ -23,4 +25,9 @@ public class SysRolePerms {
 
     @TableField(exist = false)
     private String sysCode;
+
+    @ExcelIgnore
+    @Schema(description = "是否删除")
+    @TableLogic
+    private Integer isDelete;
 }

+ 2 - 1
authentication/src/main/java/com/jzg/mapper/SysRolePermsMapper.java

@@ -3,6 +3,7 @@ package com.jzg.mapper;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.jzg.entity.SysRolePerms;
 import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
 
@@ -14,5 +15,5 @@ public interface SysRolePermsMapper extends BaseMapper<SysRolePerms> {
      * @param userId    用户id
      * @param systemId  租户编码
      */
-    List<SysRolePerms> getUserPerms(String userId, String systemId);
+    List<SysRolePerms> getUserPerms(@Param("userId") String userId, @Param("systemId") String systemId);
 }

+ 1 - 1
authentication/src/main/java/com/jzg/mapper/SysUserMapper.java

@@ -14,7 +14,7 @@ public interface SysUserMapper extends BaseMapper<SysUser> {
      * @param userId 用户id
      * @param system 系统id
      */
-    public SysUserJzgVo getJzgUserInfo(String userId,String system);
+    public SysUserJzgVo getJzgUserInfo(@Param("userId") String userId,@Param("system") String system);
 
     /**
      * 获取用户信息

+ 2 - 1
authentication/src/main/java/com/jzg/mapper/SysUserRoleMapper.java

@@ -5,6 +5,7 @@ import com.jzg.entity.SysRolePerms;
 import com.jzg.entity.SysUserRole;
 import com.jzg.entity.vo.SysRoleDataPreVo;
 import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
 
@@ -16,6 +17,6 @@ public interface SysUserRoleMapper extends BaseMapper<SysUserRole> {
      * @param userId    用户id
      * @return
      */
-    List<SysRoleDataPreVo> getUserRoleDataPre(String userId);
+    List<SysRoleDataPreVo> getUserRoleDataPre(@Param("userId") String userId);
 
 }

+ 17 - 13
authentication/src/main/resources/mapper/SysRolePermsMapper.xml

@@ -2,21 +2,25 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.jzg.mapper.SysRolePermsMapper">
 
-
     <select id="getUserPerms" resultType="com.jzg.entity.SysRolePerms">
         SELECT
-            srp.*,
-            ss.sys_code
+        srp.*,
+        ss.sys_code
         FROM
-            sys_user su
-                INNER JOIN sys_user_role sur ON su.id = sur.user_id
-                INNER JOIN sys_role sr ON sr.id = sur.role_id
-                INNER JOIN sys_role_perms srp ON sur.role_id = srp.role_id
-                INNER JOIN sys_system ss ON ss.sys_code = sr.system_code
-        WHERE
-            su.id = #{userId}
-        AND ss.sys_code = #{systemId}
-
+        sys_user su
+        INNER JOIN sys_user_role sur ON su.id = sur.user_id AND sur.is_delete = 0
+        INNER JOIN sys_role sr ON sr.id = sur.role_id AND sr.is_delete = 0
+        INNER JOIN sys_role_perms srp ON sur.role_id = srp.role_id AND srp.is_delete = 0
+        INNER JOIN sys_system ss ON ss.sys_code = sr.system_code AND ss.is_delete = 0
+        <where>
+            AND su.is_delete = 0
+            <if test="userId != null">
+                AND su.id = #{userId}
+            </if>
+            <if test="systemId != null and systemId != ''">
+                AND ss.sys_code = #{systemId}
+            </if>
+        </where>
     </select>
 
-</mapper>
+</mapper>

+ 1 - 1
authentication/src/main/resources/mapper/SysSystemMapper.xml

@@ -42,6 +42,6 @@
                business_size,legal_name,create_by,
                create_time,update_by,update_time,
                is_delete
-        from sys_system
+        from sys_system where is_delete = 0
     </sql>
 </mapper>

+ 35 - 27
authentication/src/main/resources/mapper/SysUserMapper.xml

@@ -2,39 +2,47 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.jzg.mapper.SysUserMapper">
 
-
+    <!-- 获取用户信息 -->
     <select id="getJzgUserInfo" resultType="com.jzg.entity.vo.SysUserJzgVo">
         SELECT
-            su.id,
-            su.username,
-            su.`password`,
-            su.salt,
-            su.mobile,
-            su.account_status,
-            suji.dept_id,
-            suji.NAME,
-            suji.work_number,
-            suf.file_name AS head_sculpture,
-            suji.province
+        su.id,
+        su.username,
+        su.`password`,
+        su.salt,
+        su.mobile,
+        su.account_status,
+        suji.dept_id,
+        suji.NAME,
+        suji.work_number,
+        suf.file_name AS head_sculpture,
+        suji.province
         FROM
-            sys_user su
-                LEFT JOIN sys_user_jzg_info suji ON su.id = suji.user_id
-                LEFT JOIN sys_upload_files suf ON su.head_sculpture = suf.id
-        WHERE
-            su.id = #{userId}
-        AND
-            suji.system_code = #{system}
+        sys_user su
+        LEFT JOIN sys_user_jzg_info suji ON su.id = suji.user_id AND suji.is_delete = 0
+        LEFT JOIN sys_upload_files suf ON su.head_sculpture = suf.id AND suf.is_delete = 0
+        <where>
+            and su.is_delete = 0
+            <if test="userId != null">
+                AND su.id = #{userId}
+            </if>
+            <if test="system != null and system != ''">
+                AND suji.system_code = #{system}
+            </if>
+        </where>
     </select>
 
+    <!-- 根据用户名/手机号查询 -->
     <select id="selectByUserName" resultType="com.jzg.entity.SysUser">
         SELECT
-            su.*
+        su.*
         FROM
-            sys_user su
-        WHERE
-        account_status = 1 AND is_delete = 0
-        <if test="username != null and username != ''">
-           AND (su.username = #{username} or su.mobile = #{username})
-        </if>
+        sys_user su
+        <where>
+            AND su.account_status = 1 AND su.is_delete = 0
+            <if test="username != null and username != ''">
+                AND (su.username = #{username} OR su.mobile = #{username})
+            </if>
+        </where>
     </select>
-</mapper>
+
+</mapper>

+ 8 - 4
authentication/src/main/resources/mapper/SysUserRoleMapper.xml

@@ -8,9 +8,13 @@
         *
         FROM
         sys_user_role sur
-        left join sys_role_data_pre srdp on sur.role_id = srdp.role_id
-        left join sys_role_data_pre_link srdpl on srdp.role_id = srdpl.role_id
-        WHERE
-        sur.user_id = #{userId}
+        left join sys_role_data_pre srdp on sur.role_id = srdp.role_id AND srdp.is_delete = 0
+        left join sys_role_data_pre_link srdpl on srdp.role_id = srdpl.role_id AND srdpl.is_delete = 0
+        <where>
+            AND sur.is_delete = 0
+            <if test="userId != null">
+                AND sur.user_id = #{userId}
+            </if>
+        </where>
     </select>
 </mapper>

+ 3 - 0
commons/src/main/java/com/jzg/commons/core/base/BaseModel.java

@@ -8,12 +8,15 @@ import com.fasterxml.jackson.annotation.JsonFormat;
 import io.swagger.v3.oas.annotations.media.Schema;
 import lombok.Data;
 
+import java.io.Serial;
 import java.io.Serializable;
 import java.time.LocalDateTime;
 
 @Data
 public class BaseModel implements Serializable {
 
+    @Serial
+    private static final long serialVersionUID = -3245252772001957985L;
     @ExcelIgnore
     @Schema(description = "是否删除")
     @TableLogic

+ 122 - 0
commons/src/main/java/com/jzg/commons/entity/account/po/SysUserAccountChangeLog.java

@@ -0,0 +1,122 @@
+package com.jzg.commons.entity.account.po;
+
+import com.alibaba.excel.annotation.ExcelIgnore;
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.jzg.commons.core.base.BaseModel;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.io.Serial;
+import java.math.BigDecimal;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Objects;
+
+
+/**
+ * 用户收入来源记录表
+ * 业务员账户变更记录表
+ * 记录账户中金额的每一次变更
+ */
+@EqualsAndHashCode(callSuper = true)
+@Data
+public class SysUserAccountChangeLog extends BaseModel {
+
+    @Serial
+    private static final long serialVersionUID = 3689832570825862201L;
+    @ExcelProperty("序号")
+    private String id;
+
+    @ExcelProperty("租户代码")
+    @Schema(description = "租户代码")
+    private String systemCode;
+
+    @ExcelProperty("业务员姓名/手机号")
+    @Schema(description = "业务员登录手机号")
+    private String userName;
+
+
+    @ExcelIgnore
+    @Schema(description = "用户序号")
+    private String  userId;
+
+    @ExcelIgnore
+    @Schema(description = "jzg_info表的序号")
+    private String jzgInfoId;
+
+    @ExcelProperty("操作前金额")
+    @Schema(description = "操作前金额")
+    private BigDecimal amountBefore;
+
+    @ExcelProperty("金额")
+    @Schema(description = "相关金额")
+    private BigDecimal amount;
+
+
+
+//    在实际运行中,可能因为并发的问题,操作前的金额和操作后的金额,很难得到要给准确的值(如果非要得到金额,需要加锁,影响其他模块操作)
+//    @Schema(description = "操作后的金额")
+//    private BigDecimal amountAfter;
+
+    /**
+     * 操作类型 1 保单费用 2 保单提成 3. 提现
+     */
+    @ExcelIgnore
+    @Schema(description = "操作类型")
+    private int operType;
+
+    @ExcelProperty("操作类型")
+    @TableField(exist = false)
+    private String operTypeName;
+
+    @ExcelIgnore
+    private static Map<Integer,String> operTypeMap = new  HashMap<Integer,String>();
+    static {
+        operTypeMap.put(1,"保单费用");
+        operTypeMap.put(2,"保单提成");
+        operTypeMap.put(3,"提现");
+    }
+
+    public String getOperTypeName(){
+        return operTypeMap.getOrDefault(this.operType, Objects.toString(this.operType));
+    }
+
+    @ExcelProperty("关联订单ID")
+    @Schema(description = "关联订单ID")
+    private String relatedOrderId;
+
+
+    @ExcelIgnore
+    @Schema(description = "转出银行卡的序号")
+    private String bankCardIdTo;
+
+    @ExcelProperty("银行卡号")
+    @Schema(description = "转出银行卡的卡号")
+    private String bankCardNoTo;
+
+    @ExcelIgnore
+    @Schema(description = "转入银行卡的序号")
+    private String bankCardIdIn;
+
+    @ExcelIgnore
+    @Schema(description = "转入银行卡的卡号")
+    private String bankCardNoIn;
+
+    @ExcelProperty("备注")
+    @Schema(description = "备注")
+    private String remark;
+
+    public SysUserAccountChangeLog(){
+
+    }
+
+    public SysUserAccountChangeLog(String systemCode, String userId, String jzgInfoId){
+        this.systemCode = systemCode;
+        this.userId = userId;
+        this.jzgInfoId = jzgInfoId;
+    }
+
+}

+ 0 - 36
commons/src/main/java/com/jzg/commons/entity/account/po/SysUserAccountIncomeLog.java

@@ -1,36 +0,0 @@
-package com.jzg.commons.entity.account.po;
-
-import com.jzg.commons.core.base.BaseModel;
-import io.swagger.v3.oas.annotations.media.Schema;
-import lombok.Data;
-
-import java.io.Serial;
-import java.math.BigDecimal;
-
-
-/**
- * 用户收入来源记录表
- */
-@Data
-public class SysUserAccountIncomeLog extends BaseModel {
-
-    @Serial
-    private static final long serialVersionUID = 3689832570825862201L;
-    private String id;
-
-    @Schema(description = "用户id")
-    private String userId;
-
-    @Schema(description = "提现金额")
-    private BigDecimal amount;
-
-    @Schema(description = "账户余额")
-    private BigDecimal balanceAmount;
-
-    @Schema(description = "来源订单id")
-    private String orderId;
-
-    @Schema(description = "钱属性")
-    private int property;
-
-}

+ 31 - 0
commons/src/main/java/com/jzg/commons/entity/dto/YwyIOParam.java

@@ -0,0 +1,31 @@
+package com.jzg.commons.entity.dto;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+
+import java.io.Serial;
+import java.io.Serializable;
+import java.time.LocalDate;
+
+/**
+ * 业务员收支明细
+ *
+ * @author lipf
+ * @date 2026/6/8 16:58
+ */
+@Data
+public class YwyIOParam implements Serializable {
+    @Serial
+    private static final long serialVersionUID = 1903539153842283194L;
+
+    @Schema(description = "开始日期")
+    private LocalDate beginDate;
+
+    @Schema(description = "结束日期")
+    private LocalDate endDate;
+
+    @Schema(description = "业务员的用户序号")
+    private String ywyUserId;
+
+
+}

+ 8 - 4
commons/src/main/java/com/jzg/commons/entity/po/SysArea.java

@@ -1,9 +1,8 @@
 package com.jzg.commons.entity.po;
 
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableField;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableName;
+import com.alibaba.excel.annotation.ExcelIgnore;
+import com.baomidou.mybatisplus.annotation.*;
+import io.swagger.v3.oas.annotations.media.Schema;
 import lombok.Data;
 import lombok.NoArgsConstructor;
 
@@ -59,6 +58,11 @@ public class SysArea implements Serializable {
     @TableField(exist = false)
     private String allName;
 
+    @ExcelIgnore
+    @Schema(description = "是否删除")
+    @TableLogic
+    private Integer isDelete;
+
     @TableField(exist = false)
     private static final long serialVersionUID = 1L;
 

+ 7 - 0
commons/src/main/java/com/jzg/commons/entity/po/SysOrganizationUserLink.java

@@ -1,8 +1,10 @@
 package com.jzg.commons.entity.po;
 
 
+import com.alibaba.excel.annotation.ExcelIgnore;
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableLogic;
 import io.swagger.v3.oas.annotations.media.Schema;
 import lombok.Data;
 
@@ -20,4 +22,9 @@ public class SysOrganizationUserLink implements Serializable {
 
     private String organizationId;
 
+    @ExcelIgnore
+    @Schema(description = "是否删除")
+    @TableLogic
+    private Integer isDelete;
+
 }

+ 3 - 0
commons/src/main/java/com/jzg/commons/entity/po/SysUserJzgInfoBankCard.java

@@ -8,6 +8,7 @@ import com.jzg.commons.util.idgen.IdGenerate;
 import io.swagger.v3.oas.annotations.media.Schema;
 import lombok.Data;
 
+import java.io.Serial;
 import java.time.LocalDateTime;
 import java.time.format.DateTimeFormatter;
 
@@ -19,6 +20,8 @@ import java.time.format.DateTimeFormatter;
 @Data
 @TableName("sys_user_jzg_info_bank_card")
 public class SysUserJzgInfoBankCard extends BaseModel {
+    @Serial
+    private static final long serialVersionUID = 8695063005869866551L;
     @TableId
     @Schema(description = "主键")
     private String id;

+ 8 - 0
commons/src/main/java/com/jzg/commons/entity/po/SysUserJzgInfoSalesman.java

@@ -1,8 +1,11 @@
 package com.jzg.commons.entity.po;
 
+import com.alibaba.excel.annotation.ExcelIgnore;
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableLogic;
 import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.v3.oas.annotations.media.Schema;
 import lombok.Data;
 
 /**
@@ -22,6 +25,11 @@ public class SysUserJzgInfoSalesman {
 
     private int partnerStatus;
 
+    @ExcelIgnore
+    @Schema(description = "是否删除")
+    @TableLogic
+    private Integer isDelete;
+
     public SysUserJzgInfoSalesman(){
 
     }

+ 7 - 0
commons/src/main/java/com/jzg/commons/entity/report/po/ReportSearchConfiguration.java

@@ -1,7 +1,9 @@
 package com.jzg.commons.entity.report.po;
 
+import com.alibaba.excel.annotation.ExcelIgnore;
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableLogic;
 import com.baomidou.mybatisplus.annotation.TableName;
 import java.io.Serializable;
 import java.util.Date;
@@ -79,6 +81,11 @@ public class ReportSearchConfiguration implements Serializable {
     @Schema(description = "创建用户id")
     private String createUserId;
 
+    @ExcelIgnore
+    @Schema(description = "是否删除")
+    @TableLogic
+    private Integer isDelete;
+
 
     @Override
     public boolean equals(Object that) {

+ 7 - 0
commons/src/main/java/com/jzg/commons/entity/report/po/ReportUploadExcelTask.java

@@ -1,7 +1,9 @@
 package com.jzg.commons.entity.report.po;
 
+import com.alibaba.excel.annotation.ExcelIgnore;
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableLogic;
 import com.baomidou.mybatisplus.annotation.TableName;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import io.swagger.v3.oas.annotations.media.Schema;
@@ -96,6 +98,11 @@ public class ReportUploadExcelTask implements Serializable {
     @Schema(description = "导入时间")
     private Double uploadMinutes;
 
+    @ExcelIgnore
+    @Schema(description = "是否删除")
+    @TableLogic
+    private Integer isDelete;
+
 
     @Override
     public boolean equals(Object that) {

+ 6 - 0
commons/src/main/java/com/jzg/commons/entity/system/po/SysSystemBusPerms.java

@@ -1,7 +1,9 @@
 package com.jzg.commons.entity.system.po;
 
+import com.alibaba.excel.annotation.ExcelIgnore;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableLogic;
 import com.baomidou.mybatisplus.annotation.TableName;
 import com.jzg.commons.entity.system.vo.SysSystemBusPermsVo;
 import com.jzg.commons.util.idgen.IdGenerate;
@@ -60,6 +62,10 @@ public class SysSystemBusPerms implements Serializable {
     @Schema(description = "账号互通")
     private Integer accountLinking;
 
+    @ExcelIgnore
+    @Schema(description = "是否删除")
+    @TableLogic
+    private Integer isDelete;
 
 
     public SysSystemBusPerms(SysSystemBusPermsVo sysSystemBusPermsVo) {

+ 6 - 0
commons/src/main/java/com/jzg/commons/entity/vo/SysUserAccountVo.java

@@ -4,18 +4,24 @@ import com.jzg.commons.core.base.BaseModel;
 import io.swagger.v3.oas.annotations.media.Schema;
 import lombok.Data;
 
+import java.io.Serial;
 import java.math.BigDecimal;
 
 @Schema(description = "用户账户表VO")
 @Data
 public class SysUserAccountVo extends BaseModel {
 
+    @Serial
+    private static final long serialVersionUID = 8151170244337531418L;
     @Schema(description = "主键")
     private String id;
 
     @Schema(description = "业务员姓名")
     private String name;
 
+    @Schema(description = "业务员序号")
+    private String userId;
+
     @Schema(description = "业务员手机号")
     private String mobile;
 

+ 15 - 0
commons/src/main/java/com/jzg/commons/util/BigDecimalUtil.java

@@ -20,6 +20,21 @@ public class BigDecimalUtil {
     // 私有构造器,防止被实例化
     private BigDecimalUtil() {}
 
+
+    public static BigDecimal abs(BigDecimal val) {
+        if (val == null) {
+            return BigDecimal.ZERO;
+        }
+        return val.abs();
+    }
+
+    public static BigDecimal negate(BigDecimal val) {
+        if (val == null) {
+            return BigDecimal.ZERO;
+        }
+        return val.negate();
+    }
+
     /**
      * 提供精确的加法运算
      * @param v1 被加数

+ 17 - 13
consoleStatistics/src/main/resources/mapper/ReportCompanyDataManageMapper.xml

@@ -15,9 +15,9 @@
                     SUM( fee.total_premium )
                 FROM
                     ins_orders io
-                        LEFT JOIN ins_fee_orders fee ON io.id = fee.order_no
+                        LEFT JOIN ins_fee_orders fee ON io.id = fee.order_no AND fee.is_delete = 0
                 WHERE
-                    io.company_id = b.company_id
+                    io.company_id = b.company_id AND io.is_delete = 0
             ) AS sumCompanyPremium,
             SUM( fee.total_premium ) AS sumPremium,
             SUM( CASE WHEN b.product_id = '0330' AND b.parent_id IS NULL THEN fee.total_premium ELSE 0 END ) AS djPremium,
@@ -40,7 +40,8 @@
                 FROM
                     ins_orders
                 WHERE
-                    entry_status IN ( 1, 2 ) UNION ALL
+                    entry_status IN ( 1, 2 ) AND is_delete = 0
+                UNION ALL
                 SELECT
                     id,
                     agreement_id,
@@ -56,10 +57,11 @@
                 WHERE
                     entry_status = 3
                   AND audit_status = 1
+                  AND is_delete = 0
             ) b
-                LEFT JOIN ptl_agreement ptl ON b.agreement_id = ptl.id
-                LEFT JOIN esm_ins_company eic ON eic.id = ptl.partner_company_id
-                LEFT JOIN ins_fee_orders fee ON b.id = fee.order_no
+                LEFT JOIN ptl_agreement ptl ON b.agreement_id = ptl.id AND ptl.is_delete = 0
+                LEFT JOIN esm_ins_company eic ON eic.id = ptl.partner_company_id AND eic.is_delete = 0
+                LEFT JOIN ins_fee_orders fee  ON b.id = fee.order_no AND fee.is_delete = 0
         GROUP BY
             b.company_id,
             b.company_name,
@@ -83,9 +85,9 @@
                     SUM( fee.total_premium )
                 FROM
                     ins_orders io
-                        LEFT JOIN ins_fee_orders fee ON io.id = fee.order_no
+                        LEFT JOIN ins_fee_orders fee ON io.id = fee.order_no AND fee.is_delete = 0
                 WHERE
-                    io.company_id = b.company_id
+                    io.company_id = b.company_id AND io.is_delete = 0
             ) AS sumCompanyPremium,
             SUM( fee.total_premium ) AS sumPremium,
             SUM( CASE WHEN b.product_id = '0330' AND b.parent_id IS NULL THEN fee.total_premium ELSE 0 END ) AS djPremium,
@@ -108,7 +110,8 @@
                 FROM
                     ins_orders
                 WHERE
-                    entry_status IN ( 1, 2 ) UNION ALL
+                    entry_status IN ( 1, 2 )  AND is_delete = 0
+                UNION ALL
                 SELECT
                     id,
                     agreement_id,
@@ -124,10 +127,11 @@
                 WHERE
                     entry_status = 3
                   AND audit_status = 1
+                  AND is_delete = 0
             ) b
-                LEFT JOIN ptl_agreement ptl ON b.agreement_id = ptl.id
-                LEFT JOIN esm_ins_company eic ON eic.id = ptl.partner_company_id
-                LEFT JOIN ins_fee_orders fee ON b.id = fee.order_no
+                LEFT JOIN ptl_agreement ptl ON b.agreement_id = ptl.id AND ptl.is_delete = 0
+                LEFT JOIN esm_ins_company eic ON eic.id = ptl.partner_company_id AND eic.is_delete = 0
+                LEFT JOIN ins_fee_orders fee ON b.id = fee.order_no AND fee.is_delete = 0
         GROUP BY
             b.company_id,
             b.company_name,
@@ -137,4 +141,4 @@
             b.company_id,
             ptl.partner_company_id
     </select>
-</mapper>
+</mapper>

+ 180 - 163
consoleStatistics/src/main/resources/mapper/ReportSearchConfigurationMapper.xml

@@ -3,113 +3,118 @@
         PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.jzg.console.mapper.ReportSearchConfigurationMapper">
+
     <select id="getSearchConfigurationList"
             resultType="com.jzg.commons.entity.report.dto.ReportSearchConfigurationDto">
         SELECT
-            b.search_key AS 'key',
-            b.search_name AS label,
-            b.show_type AS inputType,
-            CASE
-                WHEN (SELECT select_type FROM report_page_set_search_param
-                      WHERE report_configuration_id = a.report_configuration_id
-                        AND router_path_key = #{ routerPath }) IS NOT NULL THEN
-                (SELECT select_type FROM report_page_set_search_param
-                 WHERE report_configuration_id = a.report_configuration_id
-                   AND router_path_key = #{ routerPath })
-                ELSE a.select_type
-            END AS selectType,
-            b.search_sql AS searchSql,
-            b.id AS id,
-            a.show_flag AS showFlag,
-            CASE
-            WHEN (
-            SELECT COUNT(0)
-            FROM report_page_set_search_param
-            WHERE report_configuration_id = a.report_configuration_id
-            AND router_path_key = #{ routerPath }
-            ) > 0 THEN true
-            ELSE false
-            END AS defaultFlag,
-            CASE
-            WHEN (
-            SELECT COUNT(0)
-            FROM report_page_select_disable
-            WHERE report_configuration_id = a.report_configuration_id
-            AND router_path_key = #{ routerPath }
-            ) > 0 THEN true
-            ELSE false
-            END AS selectFlag,
-            false AS isShowDelIcon
+        b.search_key AS 'key',
+        b.search_name AS label,
+        b.show_type AS inputType,
+        CASE
+        WHEN (SELECT select_type FROM report_page_set_search_param
+        WHERE report_configuration_id = a.report_configuration_id
+        AND router_path_key = #{ routerPath } AND is_delete = 0) IS NOT NULL THEN
+        (SELECT select_type FROM report_page_set_search_param
+        WHERE report_configuration_id = a.report_configuration_id
+        AND router_path_key = #{ routerPath } AND is_delete = 0)
+        ELSE a.select_type
+        END AS selectType,
+        b.search_sql AS searchSql,
+        b.id AS id,
+        a.show_flag AS showFlag,
+        CASE
+        WHEN (
+        SELECT COUNT(0)
+        FROM report_page_set_search_param
+        WHERE report_configuration_id = a.report_configuration_id
+        AND router_path_key = #{ routerPath } AND is_delete = 0 ) > 0 THEN true
+        ELSE false
+        END AS defaultFlag,
+        CASE
+        WHEN (
+        SELECT COUNT(0)
+        FROM report_page_select_disable
+        WHERE report_configuration_id = a.report_configuration_id
+        AND router_path_key = #{ routerPath } AND is_delete = 0 ) > 0 THEN true
+        ELSE false
+        END AS selectFlag,
+        false AS isShowDelIcon
         FROM
-            report_page_set_search_param a
-        LEFT JOIN report_search_configuration b ON a.report_configuration_id = b.id
-         WHERE
-             a.router_path_key = 'common'
-        ORDER BY
-            a.sort
+        report_page_set_search_param a
+        LEFT JOIN report_search_configuration b
+        ON a.report_configuration_id = b.id AND b.is_delete = 0
+        <where>
+            AND a.is_delete = 0
+            <if test="routerPath != null and routerPath != ''">
+                AND a.router_path_key = 'common'
+            </if>
+        </where>
+        ORDER BY a.sort
     </select>
 
     <select id="selectDictListByCode" resultType="com.jzg.commons.entity.report.dto.ReportDictDto">
         SELECT
-            p.VALUE AS value,
-            p.label AS label
+        p.VALUE AS value,
+        p.label AS label
         FROM
-            sys_dict p
-            LEFT JOIN sys_dict_type c ON p.type_code = c.dict_code
-        WHERE
-            c.dict_code = #{distCode}
-        ORDER BY
-            p.sort
+        sys_dict p
+        LEFT JOIN sys_dict_type c ON p.type_code = c.dict_code AND c.is_delete = 0
+        <where>
+            AND p.is_delete = 0
+            <if test="distCode != null and distCode != ''">
+                AND c.dict_code = #{distCode}
+            </if>
+        </where>
+        ORDER BY p.sort
     </select>
+
     <select id="getSecondLevelAreaList" resultType="com.jzg.commons.entity.po.SysArea">
-        SELECT
-            *
-        FROM
-            sys_area
-        WHERE
-            `level` IN (1,2)
+        SELECT *
+        FROM sys_area
+        <where>
+            AND is_delete = 0
+            AND `level` IN (1,2)
+        </where>
     </select>
+
     <select id="getDeptListByUserId" resultType="com.jzg.commons.entity.po.SysDept">
-        SELECT
-            *
-        FROM
-            sys_dept
-        WHERE
-            system_code =(
-                SELECT
-                    sys_code
-                FROM
-                    sys_system
-                WHERE
-                    user_id = #{userId}
+        SELECT *
+        FROM sys_dept
+        <where>
+            AND is_delete = 0
+            AND system_code = (
+            SELECT sys_code
+            FROM sys_system
+            WHERE user_id = #{userId}
+            AND is_delete = 0
             )
-        order by id
+        </where>
+        ORDER BY id
     </select>
+
     <select id="queryCompanyListByUserId" resultType="com.jzg.commons.entity.report.dto.ReportDictDto">
         SELECT
-            id AS VALUE,
-	        NAME AS label
-        FROM
-            esm_ins_company
-        WHERE
-            id IN (
-                SELECT
-                    bus_id
-                FROM
-                    sys_system_bus_perms_link
-                WHERE
-                    perms_id =(
-                        SELECT
-                            p.id
-                        FROM
-                            sys_system_bus_perms p
-                            LEFT JOIN sys_system ss ON p.system_code = ss.sys_code
-                        WHERE
-                            ss.user_id = #{userId}
-                    )
-                    AND bus_code = 'quoteCompany'
+        id AS VALUE,
+        NAME AS label
+        FROM esm_ins_company
+        <where>
+            AND is_delete = 0
+            AND id IN (
+            SELECT bus_id
+            FROM sys_system_bus_perms_link
+            WHERE is_delete = 0
+            AND bus_code = 'quoteCompany'
+            AND perms_id = (
+            SELECT p.id
+            FROM sys_system_bus_perms p
+            LEFT JOIN sys_system ss ON p.system_code = ss.sys_code AND ss.is_delete = 0
+            WHERE p.is_delete = 0
+            AND ss.user_id = #{userId}
+            )
             )
+        </where>
     </select>
+
     <select id="getPartnerCompanyListByCompanyId" resultType="com.jzg.commons.entity.report.dto.ReportDictDto">
         WITH RECURSIVE company_hierarchy AS (
             SELECT
@@ -117,90 +122,93 @@
                 name,
                 parent_id,
                 1 AS level
-            FROM
-               esm_ins_company
-            WHERE
-                id = #{companyId}
-                AND is_delete = 0
+            FROM esm_ins_company
+            WHERE id = #{companyId}
+              AND is_delete = 0
             UNION ALL
-                SELECT
-                    c.id,
-                    c.name,
-                    c.parent_id,
-                    ch.level + 1 AS level
-                FROM
-                   esm_ins_company c
-                   INNER JOIN  company_hierarchy ch ON c.parent_id = ch.id
-                WHERE
-                   c.is_delete = 0
-                   AND ch.level <![CDATA[< ]]>  3
+            SELECT
+                c.id,
+                c.name,
+                c.parent_id,
+                ch.level + 1 AS level
+            FROM esm_ins_company c
+                     INNER JOIN company_hierarchy ch ON c.parent_id = ch.id
+            WHERE c.is_delete = 0
+              AND ch.level <![CDATA[< ]]> 3
         )
         SELECT
-            id as value,
-            name as label,
+            id AS value,
+            name AS label,
             parent_id,
             level
-        FROM
-        company_hierarchy
-        WHERE
-        level = 3;
+        FROM company_hierarchy
+        WHERE level = 3
     </select>
+
     <select id="getSearchDefaultList"
             resultType="com.jzg.commons.entity.report.dto.ReportSearchConfigurationDto">
         SELECT
-            b.search_key AS 'key',
-            b.search_name AS label,
-            b.show_type AS inputType,
-            b.select_type AS selectType,
-            b.search_sql AS searchSql,
-            b.id AS id,
-            a.show_flag AS showFlag,
-            true  as   defaultFlag,
-            true  as  selectFlag,
-            false AS isShowDelIcon
-        FROM
-            report_page_set_search_param a
-                LEFT JOIN report_search_configuration b ON a.report_configuration_id = b.id
-        WHERE
-            a.router_path_key = #{ routerKey }
-        ORDER BY
-            a.sort
+        b.search_key AS 'key',
+        b.search_name AS label,
+        b.show_type AS inputType,
+        b.select_type AS selectType,
+        b.search_sql AS searchSql,
+        b.id AS id,
+        a.show_flag AS showFlag,
+        true AS defaultFlag,
+        true AS selectFlag,
+        false AS isShowDelIcon
+        FROM report_page_set_search_param a
+        LEFT JOIN report_search_configuration b
+        ON a.report_configuration_id = b.id
+        AND b.is_delete = 0
+        <where>
+            AND a.is_delete = 0
+            <if test="routerKey != null and routerKey != ''">
+                AND a.router_path_key = #{ routerKey }
+            </if>
+        </where>
+        ORDER BY a.sort
     </select>
 
-    <select id="getUserIdByUserName"
-            resultType="java.lang.String">
-        SELECT
-            id
-        FROM
-            sys_user
-        WHERE
-            mobile = #{ userId }
+    <select id="getUserIdByUserName" resultType="java.lang.String">
+        SELECT id
+        FROM sys_user
+        <where>
+            AND is_delete = 0
+            AND account_status = 1
+            <if test="userId != null and userId != ''">
+                AND mobile = #{ userId }
+            </if>
+        </where>
     </select>
 
     <select id="getUserByUserId" resultType="java.lang.String">
-        SELECT
-            sys_code
-        FROM
-            sys_system
-        WHERE
-            user_id = (
-                SELECT
-                    id
-                FROM
-                    sys_user
-                WHERE
-                    mobile = #{ userId }
-                )
+        SELECT sys_code
+        FROM sys_system
+        <where>
+            AND is_delete = 0
+            AND user_id = (
+            SELECT id
+            FROM sys_user
+            WHERE is_delete = 0
+            AND account_status = 1
+            AND mobile = #{ userId }
+            )
+        </where>
     </select>
 
     <select id="getUserByPhone" resultType="java.lang.String">
-        SELECT
-            sys_code
-        FROM
-            sys_system
-        WHERE
-            user_id =  #{ userId }
+        SELECT sys_code
+        FROM sys_system
+        <where>
+            AND is_delete = 0
+            <if test="userId != null">
+                AND user_id = #{userId}
+            </if>
+        </where>
     </select>
+
     <select id="getUserListBySystemCode" resultType="com.jzg.commons.entity.report.dto.UserTreeDto">
         WITH RECURSIVE org_hierarchy AS (
             SELECT
@@ -215,10 +223,12 @@
                 CAST(o.id AS CHAR) AS org_path
             FROM sys_organization o
                      LEFT JOIN sys_user_jzg_info u ON o.manager_id = u.id AND u.is_delete = 0
-            WHERE o.system_code = #{systemCode}
-              AND o.is_delete = 0
+            WHERE o.is_delete = 0
+              AND o.system_code = #{systemCode}
               AND u.id != 'admin'
+
         UNION ALL
+
         SELECT
             o.id AS org_id,
             o.name AS org_name,
@@ -232,10 +242,10 @@
         FROM sys_organization o
                  INNER JOIN org_hierarchy oh ON o.dept_id = oh.org_id
                  LEFT JOIN sys_user_jzg_info u ON o.manager_id = u.id AND u.is_delete = 0
-        WHERE o.system_code = #{systemCode}
-          AND o.is_delete = 0
+        WHERE o.is_delete = 0
+          AND o.system_code = #{systemCode}
           AND u.id != 'admin'
-       )
+        )
         SELECT DISTINCT
             p.id as id,
             p.name as name,
@@ -273,9 +283,12 @@
                      0 AS is_manager,
                      oh.org_path AS hierarchy_path
                  FROM sys_organization_user_link ul
-                          INNER JOIN sys_user_jzg_info u ON ul.user_id = u.id AND u.is_delete = 0
+                          INNER JOIN sys_user_jzg_info u
+                                     ON ul.user_id = u.id
+                                         AND u.is_delete = 0
                           INNER JOIN org_hierarchy oh ON ul.organization_id = oh.org_id
                  WHERE ul.user_id != CAST(oh.manager_id AS CHAR)
+                   AND ul.is_delete = 0
 
                  UNION ALL
                  SELECT
@@ -313,12 +326,16 @@
                      oh.org_path AS hierarchy_path,
                      oh.parent_org_id
                      FROM sys_organization_user_link ul
-                     INNER JOIN sys_user_jzg_info u ON ul.user_id = u.id AND u.is_delete = 0
+                     INNER JOIN sys_user_jzg_info u
+                     ON ul.user_id = u.id
+                     AND u.is_delete = 0
                      INNER JOIN org_hierarchy oh ON ul.organization_id = oh.org_id
-                     WHERE ul.user_id != CAST(oh.manager_id AS CHAR) AND oh.parent_org_id IS NOT NULL
+                     WHERE ul.user_id != CAST(oh.manager_id AS CHAR)
+                     AND oh.parent_org_id IS NOT NULL
+                     AND ul.is_delete = 0
                      ) sub
                      INNER JOIN org_hierarchy oh ON sub.parent_org_id = oh.org_id
              ) p
         ORDER BY p.hierarchy_path, p.is_manager DESC;
     </select>
-</mapper>
+</mapper>

+ 38 - 27
consoleStatistics/src/main/resources/mapper/ReportUploadExcelTaskMapper.xml

@@ -1,39 +1,50 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.jzg.console.mapper.ReportUploadExcelTaskMapper">
+
+    <!-- 根据用户ID更新已读状态 -->
     <update id="updateStatusByUserId">
-        update  report_upload_excel_task
-        set  read_status =1
-        where upload_user_id =#{userId}
-        and read_status=0
+        update report_upload_excel_task
+        set read_status = 1
+        <where>
+            and is_delete = 0
+            and upload_user_id = #{userId}
+            and read_status = 0
+        </where>
     </update>
 
+    <!-- 分页查询任务列表 -->
     <select id="getPageTaskList" resultType="com.jzg.commons.entity.report.dto.ReportUploadExcelTaskDto">
-         select
-             *
-         from
-             report_upload_excel_task
-         <where>
-             <if test="vo.uploadUserId !=null and vo.uploadUserId !=''">
-                 AND  upload_user_id  =#{ vo.uploadUserId }
-             </if>
-             <if test="vo.taskStatus !=null">
-                 AND   task_status  =#{ vo.taskStatus }
-             </if>
-             <if test="vo.readStatus !=null">
-                 AND  read_status  =#{ vo.readStatus }
-             </if>
-         </where>
-          order by  upload_date desc
+        select
+        *
+        from
+        report_upload_excel_task
+        <where>
+            and is_delete = 0
+            <if test="vo.uploadUserId != null and vo.uploadUserId != ''">
+                AND upload_user_id = #{vo.uploadUserId}
+            </if>
+            <if test="vo.taskStatus != null">
+                AND task_status = #{vo.taskStatus}
+            </if>
+            <if test="vo.readStatus != null">
+                AND read_status = #{vo.readStatus}
+            </if>
+        </where>
+        order by upload_date desc
     </select>
+
+    <!-- 查询未读消息数量 -->
     <select id="getTaskMessageNoReadCount" resultType="java.lang.Integer">
         select
-            count(0)
+        count(0)
         from
-            report_upload_excel_task
-        where
-            upload_user_id  =#{ userId }
-            and
-            read_status = 0
+        report_upload_excel_task
+        <where>
+            and is_delete = 0
+            AND upload_user_id = #{userId}
+            AND read_status = 0
+        </where>
     </select>
-</mapper>
+
+</mapper>

+ 7 - 0
partner/src/main/java/com/jzg/entity/PartnerRule.java

@@ -1,6 +1,8 @@
 package com.jzg.entity;
 
 
+import com.alibaba.excel.annotation.ExcelIgnore;
+import com.baomidou.mybatisplus.annotation.TableLogic;
 import com.jzg.commons.core.base.PartnerBaseModel;
 import io.swagger.v3.oas.annotations.media.Schema;
 import lombok.Data;
@@ -43,4 +45,9 @@ public class PartnerRule extends PartnerBaseModel {
     @Schema(description = "购买保级金额")
     private BigDecimal fallAmount;
 
+    @ExcelIgnore
+    @Schema(description = "是否删除")
+    @TableLogic
+    private Integer isDelete;
+
 }

+ 8 - 0
partner/src/main/java/com/jzg/entity/PartnerUser.java

@@ -1,9 +1,11 @@
 package com.jzg.entity;
 
 
+import com.alibaba.excel.annotation.ExcelIgnore;
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableLogic;
 import com.jzg.commons.core.base.PartnerBaseModel;
 import io.swagger.v3.oas.annotations.media.Schema;
 import lombok.Data;
@@ -96,4 +98,10 @@ public class PartnerUser extends PartnerBaseModel {
     private boolean first;
 
 
+    @ExcelIgnore
+    @Schema(description = "是否删除")
+    @TableLogic
+    private Integer isDelete;
+
+
 }

+ 46 - 9
partner/src/main/resources/mapper/PartnerAttributeMapper.xml

@@ -20,7 +20,6 @@
         <collection property="requirement" column="id=id" select="selectRequirement" />
     </resultMap>
 
-
     <resultMap id="partner_attribute" type="com.jzg.entity.PartnerAttribute">
         <result property="id" column="id"/>
         <result property="min" column="min"/>
@@ -36,28 +35,66 @@
         <result property="taskDays" column="task_days"/>
     </resultMap>
 
+    <!-- 查询全部规则 -->
     <select id="queryAll" resultMap="BaseMapper">
-        select id, upgrade, relegation, grade_name, grade, appraise, rel_satisfy,strategy,kh_days,fall_tick,fall_amount,system_code from partner_rule
+        select
+        id, upgrade, relegation, grade_name, grade, appraise, rel_satisfy,
+        strategy,kh_days,fall_tick,fall_amount,system_code
+        from partner_rule
+        <where>
+            AND is_delete = 0
+        </where>
     </select>
 
-
+    <!-- 根据等级查询 -->
     <select id="selectByGrade" resultMap="BaseMapper">
-        select id, upgrade, relegation, grade_name, grade, appraise, rel_satisfy,strategy,kh_days,fall_tick,fall_amount from partner_rule where grade = #{grade}
+        select
+        id, upgrade, relegation, grade_name, grade, appraise, rel_satisfy,
+        strategy,kh_days,fall_tick,fall_amount
+        from partner_rule
+        <where>
+            AND is_delete = 0
+            <if test="grade != null">
+                AND grade = #{grade}
+            </if>
+        </where>
     </select>
 
 
+    <!-- 查询周期 -->
     <select id="selectCycle" resultMap="partner_attribute">
-        select id,min,max,satisfy,rule_id,requirement,strategy,cycle,type,checked,fixed_days,task_days from partner_attribute where type = 1 and rule_id = #{id}
+        select
+        id,min,max,satisfy,rule_id,requirement,strategy,cycle,type,checked,fixed_days,task_days
+        from partner_attribute
+        <where>
+            AND is_delete = 0
+            AND type = 1
+            AND rule_id = #{id}
+        </where>
     </select>
 
-
+    <!-- 查询策略 -->
     <select id="selectStrategy" resultMap="partner_attribute">
-        select id,min,max,satisfy,rule_id,requirement,strategy,cycle,type,checked,fixed_days,task_days from partner_attribute where type = 3 and rule_id = #{id}
+        select
+        id,min,max,satisfy,rule_id,requirement,strategy,cycle,type,checked,fixed_days,task_days
+        from partner_attribute
+        <where>
+            AND is_delete = 0
+            AND type = 3
+            AND rule_id = #{id}
+        </where>
     </select>
 
+    <!-- 查询要求 -->
     <select id="selectRequirement" resultMap="partner_attribute">
-        select id,min,max,satisfy,rule_id,requirement,strategy,cycle,type,checked,fixed_days,task_days from partner_attribute where type = 2 and rule_id = #{id}
+        select
+        id,min,max,satisfy,rule_id,requirement,strategy,cycle,type,checked,fixed_days,task_days
+        from partner_attribute
+        <where>
+            AND is_delete = 0
+            AND type = 2
+            AND rule_id = #{id}
+        </where>
     </select>
 
-
 </mapper>

Разница между файлами не показана из-за своего большого размера
+ 532 - 481
partner/src/main/resources/mapper/PartnerUserMapper.xml


+ 5 - 4
partner/src/main/resources/mapper/SysPartnerAccountMapper.xml

@@ -22,8 +22,9 @@
             a.create_time as "createTime",
             a.history_fee as "historyFee",
             a.cash_fee as "cashFee"
-        from sys_partner_account a
+        from partner_partner_account a
         <where>
+            a.is_delete = 0
             <if test="userId !=null and userId !=''">
                 AND a.user_id =#{userId}
             </if>
@@ -74,10 +75,10 @@
             COALESCE(SUM(CASE WHEN 1=1 THEN history_fee END), 0) AS transferAmount,
             COALESCE(SUM(CASE WHEN 1=1 THEN expired_amount END), 0) AS expiredAmount,
             COALESCE(SUM(CASE WHEN 1=1 THEN cash_fee - expired_amount END), 0) AS unreportedAmount,
-            (SELECT COALESCE(cash_fee, 0) FROM sys_partner_account WHERE user_id = #{userId}) AS cashFee,
-            (SELECT COALESCE(history_fee, 0) FROM sys_partner_account WHERE user_id = #{userId} ) AS historyFee
+            (SELECT COALESCE(cash_fee, 0) FROM partner_partner_account WHERE user_id = #{userId} ) AS cashFee,
+            (SELECT COALESCE(history_fee, 0) FROM partner_partner_account WHERE user_id = #{userId} ) AS historyFee
         FROM partner_partner_account
-        WHERE user_id = #{userId}
+        WHERE user_id = #{userId} and is_delete = 0
     </select>
 
 </mapper>

+ 12 - 2
tenant/insurance/quotation-commons/src/main/java/com/jzg/quotation/commons/client/OrgClient.java

@@ -2,7 +2,7 @@ package com.jzg.quotation.commons.client;
 
 import com.alibaba.fastjson.JSONObject;
 import com.jzg.commons.core.page.HttpResult;
-import com.jzg.commons.entity.account.po.SysUserAccountIncomeLog;
+import com.jzg.commons.entity.account.po.SysUserAccountChangeLog;
 import com.jzg.commons.entity.agreement.dispatch.dto.PtlAgreementDispatchAfterAction;
 import com.jzg.commons.entity.agreement.dispatch.vo.PtlAgreementDispatchVo;
 import com.jzg.commons.entity.dto.CostAgreementParam;
@@ -207,5 +207,15 @@ public interface OrgClient {
      * 添加用户账户收入记录
      */
     @PostMapping(value = "/userAccount/addUserAccountIncomeLog")
-    HttpResult addUserAccountIncomeLog(@RequestBody List<SysUserAccountIncomeLog> incomeLogs);
+    HttpResult addUserAccountIncomeLog(@RequestBody List<SysUserAccountChangeLog> incomeLogs);
+
+    /**
+     * 添加用户钱包账户记录
+     *
+     * @param changeLog 用户钱包记录
+     * @author lipf
+     * @date 2026/6/8 10:17
+     */
+    @PostMapping("/userAccount/addUserAccountChangeLog")
+    HttpResult<String> addUserAccountChangeLog(@RequestBody SysUserAccountChangeLog changeLog);
 }

+ 44 - 28
tenant/insurance/quotation-summary/src/main/java/com/jzg/quotation/summary/service/impl/InsFeeAuditServiceImpl.java

@@ -10,7 +10,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.jzg.commons.core.base.BaseController;
 import com.jzg.commons.core.base.StateResult;
 import com.jzg.commons.core.page.HttpResult;
-import com.jzg.commons.entity.account.po.SysUserAccountIncomeLog;
+import com.jzg.commons.entity.account.po.SysUserAccountChangeLog;
 import com.jzg.commons.entity.dto.CostCalculateRespVO;
 import com.jzg.commons.entity.dto.FeeAuditParam;
 import com.jzg.commons.entity.dto.VerifyOrderParam;
@@ -28,6 +28,7 @@ import com.jzg.commons.entity.vo.*;
 import com.jzg.commons.exception.ServiceException;
 import com.jzg.commons.exception.SystemException;
 import com.jzg.commons.util.AssertionUtils;
+import com.jzg.commons.util.BigDecimalUtil;
 import com.jzg.commons.util.PDFUtil;
 import com.jzg.commons.util.StringUtils;
 import com.jzg.commons.util.idgen.IdGenerate;
@@ -46,6 +47,7 @@ import com.jzg.quotation.summary.mapper.InsOrderRightsPackageMapper;
 import com.jzg.quotation.summary.service.*;
 import com.jzg.quotation.summary.state.AuditState;
 import com.jzg.quotation.summary.state.listener.AuditStateListener;
+import io.seata.spring.annotation.GlobalTransactional;
 import lombok.RequiredArgsConstructor;
 import org.hibernate.validator.internal.util.stereotypes.Lazy;
 import org.redisson.api.RBucket;
@@ -385,10 +387,19 @@ public class InsFeeAuditServiceImpl extends ServiceImpl<InsFeeAuditMapper, InsFe
         insOrdersService.updateById(orders);
     }
 
+    /**
+     * 费用审核通过
+     *      费用审核通过后,会给业务员账号打钱
+     *
+     * @author lipf
+     * @date 2026/6/8 9:08
+     */
     @Override
+    @GlobalTransactional(rollbackFor = Exception.class)
     public void verifyOrder(VerifyOrderParam param) {
         String systemCode = baseController.getSystemCode();
-        log.info("审核订单.systemCode=[{}], param=[{}]",systemCode, JSONUtil.toJsonStr(param));
+        String userId = baseController.getUserId();
+        log.info("订单费用审核.systemCode=[{}], param=[{}]",systemCode, JSONUtil.toJsonStr(param));
         InsFeeAudit audit = this.getById(param.getOrderNo());
         if(audit == null){
             throw new ServiceException("要审核的订单不存在");
@@ -415,8 +426,9 @@ public class InsFeeAuditServiceImpl extends ServiceImpl<InsFeeAuditMapper, InsFe
         }
         InsFeeOrders feeOrders = null;
         SysUserAccount userAccount = null;
+        String jzgInfoId = null;
         if(param.getAuditStatus().equals(1)){
-            List<SysUserAccountIncomeLog> incomeLogs = new ArrayList<>();
+            List<SysUserAccountChangeLog> incomeLogs = new ArrayList<>();
             StateResult stateFailResult = auditStateListener.statusChange(AuditState.AuditStateEnum.SUCCESS_AUDIT,audit.getAuditStatus()+"");
             audit.setAuditStatus(stateFailResult.getCurrentState());
 
@@ -435,17 +447,22 @@ public class InsFeeAuditServiceImpl extends ServiceImpl<InsFeeAuditMapper, InsFe
                 AssertionUtils.isFail(true, "权益券下发失败");
             }
             if(Objects.isNull(userAccount)){
+                log.info("订单费用审核时,检查到租户[{}]下的账号[{}]不存在",systemCode,sysUserResult.getData().getId());
                 userAccount = new SysUserAccount();
                 // 新建账户
                 userAccount.setId(IdGenerate.nextId());
                 userAccount.setUserId(sysUserResult.getData().getId());
-                userAccount.setSumAmount(feeOrders.getTotalReceivablePremium());
-                userAccount.setSumAmountUnpaid(feeOrders.getTotalReceivablePremium());
                 userAccount.setSystemCode(systemCode);
-            }else{
-                userAccount.setSumAmount(feeOrders.getTotalReceivablePremium().add(userAccount.getSumAmount()));
-                userAccount.setSumAmountUnpaid(feeOrders.getTotalReceivablePremium().add(userAccount.getSumAmount()));
             }
+            BigDecimal sumAmount = userAccount.getSumAmount();
+            BigDecimal amount = feeOrders.getTotalReceivablePremium();
+
+            SysUserAccountChangeLog changeLog = new SysUserAccountChangeLog(systemCode, userId,jzgInfoId);
+            changeLog.setAmount(amount);
+            changeLog.setAmountBefore(sumAmount);
+
+            userAccount.setSumAmount(BigDecimalUtil.add(feeOrders.getTotalReceivablePremium(),userAccount.getSumAmount()));
+            userAccount.setSumAmountUnpaid(BigDecimalUtil.add(feeOrders.getTotalReceivablePremium(), userAccount.getSumAmount()));
             orgClient.saveOrUpdate(userAccount);
             // 进入应收表
             List<String> orderNos = new ArrayList<>();
@@ -520,7 +537,7 @@ public class InsFeeAuditServiceImpl extends ServiceImpl<InsFeeAuditMapper, InsFe
         }
         // 增加账户的金额记录
         // modify by lipf, 2026年5月20日11:31:59 审核通过后,才需要 生成收入明细日志
-        List<SysUserAccountIncomeLog>builderIncomeLog = this.builderIncomeLog(feeOrders.getOrderNo(),feeOrders,userAccount,distributor1,distributor2,distributor3);
+        List<SysUserAccountChangeLog>builderIncomeLog = this.builderIncomeLog(feeOrders.getOrderNo(),feeOrders,userAccount,distributor1,distributor2,distributor3);
         HttpResult result2 = orgClient.addUserAccountIncomeLog(builderIncomeLog);
         AssertionUtils.isFail(result2.getCode() != 200,"账户记录添加失败,审核失败");
     }
@@ -643,7 +660,7 @@ public class InsFeeAuditServiceImpl extends ServiceImpl<InsFeeAuditMapper, InsFe
      * @param distributor3  3级分销人员
      * @return
      */
-    private List<SysUserAccountIncomeLog> builderIncomeLog(String orderNo,
+    private List<SysUserAccountChangeLog> builderIncomeLog(String orderNo,
                                                            InsFeeOrders feeOrders,
                                                            SysUserAccount userAccount,
                                                            SysUserAccount distributor1,
@@ -651,47 +668,46 @@ public class InsFeeAuditServiceImpl extends ServiceImpl<InsFeeAuditMapper, InsFe
                                                            SysUserAccount distributor3){
         log.info("生成收入明细日志:feeOrders=[{}],userAccount=[{}],distributor1=[{}],distributor2=[{}],distributor3=[{}]",
                 JSONUtil.toJsonStr(feeOrders), JSONUtil.toJsonStr(userAccount), JSONUtil.toJsonStr(distributor1), JSONUtil.toJsonStr(distributor2), JSONUtil.toJsonStr(distributor3));
-        List<SysUserAccountIncomeLog> incomeLogs = new ArrayList<>();
+        List<SysUserAccountChangeLog> incomeLogs = new ArrayList<>();
         // 出口费用
-        SysUserAccountIncomeLog exportIncomeLog = new SysUserAccountIncomeLog();
-        exportIncomeLog.setOrderId(orderNo);
+        SysUserAccountChangeLog exportIncomeLog = new SysUserAccountChangeLog();
+        exportIncomeLog.setRelatedOrderId(orderNo);
         exportIncomeLog.setUserId(userAccount.getUserId());
         exportIncomeLog.setAmount(feeOrders.getJqExportPremium().add(feeOrders.getSyExportPremium()).add(feeOrders.getJyExportPremium()));
-        exportIncomeLog.setProperty(1);
-        exportIncomeLog.setBalanceAmount(userAccount.getSumAmount());
-
+        //exportIncomeLog.setProperty(1);
+        exportIncomeLog.setAmountBefore(userAccount.getSumAmount());
         incomeLogs.add(exportIncomeLog);
 
         // 1级分销费
         if (feeOrders.getFirstDistributorId() != null && feeOrders.getFirstDistributionFee().compareTo(BigDecimal.ZERO) > 0) {
-            SysUserAccountIncomeLog distributor1IncomeLog = new SysUserAccountIncomeLog();
-            distributor1IncomeLog.setOrderId(orderNo);
+            SysUserAccountChangeLog distributor1IncomeLog = new SysUserAccountChangeLog();
+            distributor1IncomeLog.setRelatedOrderId(orderNo);
             distributor1IncomeLog.setUserId(distributor1.getUserId());
             distributor1IncomeLog.setAmount(feeOrders.getFirstDistributionFee());
-            distributor1IncomeLog.setProperty(2);
-            distributor1IncomeLog.setBalanceAmount(userAccount.getSumAmount());
+            //distributor1IncomeLog.setProperty(2);
+            distributor1IncomeLog.setAmountBefore(userAccount.getSumAmount());
             incomeLogs.add(distributor1IncomeLog);
         }
 
         // 2级分销费
         if (feeOrders.getSecondDistributorId() != null && feeOrders.getSecondDistributionFee().compareTo(BigDecimal.ZERO) > 0) {
-            SysUserAccountIncomeLog distributor2IncomeLog = new SysUserAccountIncomeLog();
-            distributor2IncomeLog.setOrderId(orderNo);
+            SysUserAccountChangeLog distributor2IncomeLog = new SysUserAccountChangeLog();
+            distributor2IncomeLog.setRelatedOrderId(orderNo);
             distributor2IncomeLog.setUserId(distributor2.getUserId());
             distributor2IncomeLog.setAmount(feeOrders.getFirstDistributionFee());
-            distributor2IncomeLog.setProperty(2);
-            distributor2IncomeLog.setBalanceAmount(userAccount.getSumAmount());
+            //distributor2IncomeLog.setProperty(2);
+            distributor2IncomeLog.setAmountBefore(userAccount.getSumAmount());
             incomeLogs.add(distributor2IncomeLog);
         }
 
         // 3级分销费
         if (feeOrders.getThirdDistributorId() != null && feeOrders.getThirdDistributionFee().compareTo(BigDecimal.ZERO) > 0) {
-            SysUserAccountIncomeLog distributor3IncomeLog = new SysUserAccountIncomeLog();
-            distributor3IncomeLog.setOrderId(orderNo);
+            SysUserAccountChangeLog distributor3IncomeLog = new SysUserAccountChangeLog();
+            distributor3IncomeLog.setRelatedOrderId(orderNo);
             distributor3IncomeLog.setUserId(distributor3.getUserId());
             distributor3IncomeLog.setAmount(feeOrders.getFirstDistributionFee());
-            distributor3IncomeLog.setProperty(2);
-            distributor3IncomeLog.setBalanceAmount(userAccount.getSumAmount());
+            //distributor3IncomeLog.setProperty(2);
+            distributor3IncomeLog.setAmountBefore(userAccount.getSumAmount());
             incomeLogs.add(distributor3IncomeLog);
         }
         return incomeLogs;

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

@@ -4,10 +4,7 @@ import cn.hutool.json.JSONUtil;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.jzg.commons.core.base.BaseController;
 import com.jzg.commons.core.page.HttpResult;
-import com.jzg.commons.entity.dto.AmountAuditEditParam;
-import com.jzg.commons.entity.dto.AmountAuditParam;
-import com.jzg.commons.entity.dto.AmountAuditRejectParam;
-import com.jzg.commons.entity.dto.ApplyWithdrawParam;
+import com.jzg.commons.entity.dto.*;
 import com.jzg.commons.entity.vo.AmountAuditVo;
 import com.jzg.organization.service.SysAmountAuditingService;
 import io.swagger.v3.oas.annotations.Operation;
@@ -122,6 +119,18 @@ public class AmountAuditingController extends BaseController {
         return HttpResult.ok(amountAuditVoPage);
     }
 
+    /**
+     * 导出业务员收支明细
+     *
+     * @author lipf
+     * @date 2026/6/8 18:52
+     */
+    @PostMapping("/exportYwyIORecs")
+    @Operation(summary = "导出业务员收支明细")
+    public HttpResult<String> exportYwyIORecs(@RequestBody YwyIOParam ywyIOParam) {
+        return HttpResult.ok(sysAmountAuditingService.exportYwyIORecs(ywyIOParam));
+    }
+
     @PostMapping("/myPaymentTotalWithdrawalAmount")
     @Operation(summary = "我的付款提现金额总计")
     public HttpResult<String> myPaymentTotalWithdrawalAmount(@RequestBody AmountAuditParam param){

+ 27 - 2
tenant/organization/src/main/java/com/jzg/organization/controller/UserAccountController.java

@@ -4,7 +4,7 @@ package com.jzg.organization.controller;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.jzg.commons.core.base.BaseController;
 import com.jzg.commons.core.page.HttpResult;
-import com.jzg.commons.entity.account.po.SysUserAccountIncomeLog;
+import com.jzg.commons.entity.account.po.SysUserAccountChangeLog;
 import com.jzg.commons.entity.dto.IncomeAndExpenseParam;
 import com.jzg.commons.entity.dto.SysUserAccountPageParam;
 import com.jzg.commons.entity.dto.SysUserAccountParam;
@@ -15,11 +15,13 @@ import com.jzg.organization.service.SysUserAccountIncomeLogService;
 import com.jzg.organization.service.SysUserAccountService;
 import io.swagger.v3.oas.annotations.Operation;
 import io.swagger.v3.oas.annotations.tags.Tag;
+import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
 import java.util.List;
 
+@Slf4j
 @Tag(name="用户账户接口")
 @RestController
 @RequestMapping("/userAccount")
@@ -95,8 +97,31 @@ public class UserAccountController {
 
     @Operation(summary = "添加用户钱包账户记录")
     @PostMapping("/addUserAccountIncomeLog")
-    public HttpResult addUserAccountIncomeLog(@RequestBody List<SysUserAccountIncomeLog> incomeLogs){
+    public HttpResult addUserAccountIncomeLog(@RequestBody List<SysUserAccountChangeLog> incomeLogs){
         return HttpResult.ok(sysUserAccountIncomeLogService.saveBatch(incomeLogs));
     }
 
+
+    /**
+     * 添加用户钱包账户记录
+     *
+     * @param changeLog 用户钱包记录
+     * @author lipf
+     * @date 2026/6/8 10:17
+     */
+    @Operation(summary = "添加用户钱包账户记录")
+    @PostMapping("/addUserAccountChangeLog")
+    public HttpResult<String> addUserAccountChangeLog(@RequestBody SysUserAccountChangeLog changeLog){
+        try{
+           boolean save = sysUserAccountIncomeLogService.save(changeLog);
+            if(save){
+                return HttpResult.ok("保存业务员账号明细成功");
+            }
+            return HttpResult.error();
+        }catch (Exception e){
+            log.error("保存业务员账号明细异常", e);
+            return HttpResult.error(e.getMessage());
+        }
+    }
+
 }

+ 14 - 0
tenant/organization/src/main/java/com/jzg/organization/mapper/InvAccountCardMapper.java

@@ -7,6 +7,8 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.jzg.commons.entity.account.vo.AccountCardVo;
 import org.apache.ibatis.annotations.Param;
 
+import java.util.List;
+
 /**
 * @author dongxin
 * @description 针对表【inv_account_card(账户信息表)】的数据库操作Mapper
@@ -29,6 +31,18 @@ public interface InvAccountCardMapper extends BaseMapper<InvAccountCard> {
      * @return
      */
     AccountCardVo queryById(@Param("id") String id);
+
+    /**
+     * 查询业务员提现银行卡信息
+     *
+     * @param systemCode 租户代码
+     * @param accountId 银行卡号
+     * @author lipf
+     * @date 2026/6/8 15:14
+     */
+    List<InvAccountCard> queryByAccountId(@Param("accountId") String accountId,
+                                          @Param("systemCode") String systemCode);
+
 }
 
 

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

@@ -1,9 +1,25 @@
 package com.jzg.organization.mapper;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.jzg.commons.entity.account.po.SysUserAccountIncomeLog;
+import com.jzg.commons.entity.account.po.SysUserAccountChangeLog;
 import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Select;
+
+import java.time.LocalDate;
+import java.util.List;
 
 @Mapper
-public interface SysUserAccountIncomeLogMapper extends BaseMapper<SysUserAccountIncomeLog> {
+public interface SysUserAccountIncomeLogMapper extends BaseMapper<SysUserAccountChangeLog> {
+
+    /**
+     * 查询业务员收支明细
+     *
+     * @param ywyUserId 业务员序号
+     * @param beginDate 开始日期
+     * @param endDate 结束日期
+     * @author lipf
+     * @date 2026/6/8 17:25
+     */
+    @Select("select * from sys_user_account_change_log a where a.user_id = #{ywyUserId} and a.create_time >= #{beginDate} and a.create_time < #{endDate} and a.is_delete = 0 order by a.create_time desc")
+    List<SysUserAccountChangeLog> queryYwyIORecs(String ywyUserId, LocalDate beginDate, LocalDate endDate);
 }

+ 10 - 0
tenant/organization/src/main/java/com/jzg/organization/mapper/SysUserJzgInfoBankCardMapper.java

@@ -22,4 +22,14 @@ public interface SysUserJzgInfoBankCardMapper extends BaseMapper<SysUserJzgInfoB
      */
     Page<SysUserJzgInfoBankCardDto> getBankCardPageList (Page<SysUserJzgInfoBankCardVo> page, @Param("sysUserJzgInfoBankCardVo") SysUserJzgInfoBankCardVo sysUserJzgInfoBankCardVo);
 
+    /**
+     * 根据银行卡号查询银行卡的信息
+     *
+     * @param bankCardNum 银行卡号
+     * @param systemCode  租户代码
+     * @author lipf
+     * @date 2026/6/8 16:22
+     */
+    List<SysUserJzgInfoBankCard> queryBankCardBybankCardNum(@Param("bankCardNum") String bankCardNum,
+                                                            @Param("systemCode") String systemCode);
 }

+ 10 - 0
tenant/organization/src/main/java/com/jzg/organization/service/InvAccountCardService.java

@@ -8,6 +8,8 @@ import com.jzg.commons.entity.account.po.InvAccountCard;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.jzg.commons.entity.account.vo.AccountCardVo;
 
+import java.util.List;
+
 /**
 * @author dongxin
 * @description 针对表【inv_account_card(账户信息表)】的数据库操作Service
@@ -55,4 +57,12 @@ public interface InvAccountCardService extends IService<InvAccountCard> {
      * @param param
      */
     void cardEdit(AccountCardEditParam param);
+
+    /**
+     * 根据银行卡账号查询银行卡信息
+     *
+     * @author lipf
+     * @date 2026/6/8 15:12
+     */
+    List<InvAccountCard> queryByAccountId(String accountId, String systemCode);
 }

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

@@ -3,10 +3,7 @@ package com.jzg.organization.service;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.jzg.commons.core.page.HttpResult;
-import com.jzg.commons.entity.dto.AmountAuditEditParam;
-import com.jzg.commons.entity.dto.AmountAuditParam;
-import com.jzg.commons.entity.dto.AmountAuditRejectParam;
-import com.jzg.commons.entity.dto.ApplyWithdrawParam;
+import com.jzg.commons.entity.dto.*;
 import com.jzg.commons.entity.po.SysAmountAuditing;
 import com.jzg.commons.entity.vo.AmountAuditVo;
 
@@ -96,4 +93,12 @@ public interface SysAmountAuditingService extends IService<SysAmountAuditing> {
      * @return
      */
     String exportAuditList(AmountAuditParam param);
+
+    /**
+     * 导出业务员收入支出明显
+     * param ywyIOParam 导出条件, 包含开始日期,结束日期
+     * @return
+     */
+    String exportYwyIORecs(YwyIOParam ywyIOParam);
+
 }

+ 13 - 2
tenant/organization/src/main/java/com/jzg/organization/service/SysUserAccountIncomeLogService.java

@@ -1,7 +1,10 @@
 package com.jzg.organization.service;
 
 import com.baomidou.mybatisplus.extension.service.IService;
-import com.jzg.commons.entity.account.po.SysUserAccountIncomeLog;
+import com.jzg.commons.entity.account.po.SysUserAccountChangeLog;
+import com.jzg.commons.entity.dto.YwyIOParam;
+
+import java.util.List;
 
 
 /**
@@ -9,6 +12,14 @@ import com.jzg.commons.entity.account.po.SysUserAccountIncomeLog;
  * @description 针对表【SysUserAccountIncomeLog】的数据库操作Service
  * @createDate 2023-11-15 11:23:28
  */
-public interface SysUserAccountIncomeLogService extends IService<SysUserAccountIncomeLog> {
+public interface SysUserAccountIncomeLogService extends IService<SysUserAccountChangeLog> {
 
+    /**
+     * 查询业务员收支明细
+     *
+     * @param ywyIOParam 查询参数,包括业务员信息, 以及查询的时间范围
+     * @author lipf
+     * @date 2026/6/8 17:25
+     */
+    List<SysUserAccountChangeLog> queryYwyIORecs(YwyIOParam ywyIOParam);
 }

+ 10 - 0
tenant/organization/src/main/java/com/jzg/organization/service/SysUserJzgInfoBankCardService.java

@@ -46,4 +46,14 @@ public interface SysUserJzgInfoBankCardService extends IService<SysUserJzgInfoBa
     boolean deleteBankCard(SysUserJzgInfoBankCardVo sysUserJzgInfoBankCardVo);
 
     HttpResult audit(SysUserJzgInfoBankCardVo sysUserJzgInfoBankCardVo);
+
+    /**
+     * 根据银行卡号查询银行卡的信息
+     *
+     * @param systemCode  租户代码
+     * @param bankCardNum 银行卡号
+     * @author lipf
+     * @date 2026/6/8 16:22
+     */
+    List<SysUserJzgInfoBankCard> queryBankCardBybankCardNum(String bankCardNum, String systemCode);
 }

+ 16 - 0
tenant/organization/src/main/java/com/jzg/organization/service/impl/InvAccountCardServiceImpl.java

@@ -19,6 +19,8 @@ import org.slf4j.LoggerFactory;
 import org.springframework.beans.BeanUtils;
 import org.springframework.stereotype.Service;
 
+import java.util.List;
+
 /**
 * @author dongxin
 * @description 针对表【inv_account_card(账户信息表)】的数据库操作Service实现
@@ -74,6 +76,20 @@ public class InvAccountCardServiceImpl extends ServiceImpl<InvAccountCardMapper,
         BeanUtils.copyProperties(param,accountCard);
         updateById(accountCard);
     }
+
+    /**
+     * 根据银行卡账号查询银行卡信息
+     *
+     * @param accountId  租户银行卡的账号
+     * @param systemCode 租户代码
+     * @author lipf
+     * @date 2026/6/8 15:12
+     */
+    @Override
+    public List<InvAccountCard> queryByAccountId(String accountId, String systemCode) {
+        log.info("根据企业账号查询业务的付款账户信息。 accountId=[{}], systemCode=[{}]", accountId, systemCode);
+        return baseMapper.queryByAccountId(accountId, systemCode);
+    }
 }
 
 

+ 135 - 27
tenant/organization/src/main/java/com/jzg/organization/service/impl/SysAmountAuditingServiceImpl.java

@@ -10,6 +10,8 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.jzg.commons.core.base.BaseController;
 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.dto.*;
 import com.jzg.commons.entity.po.SysAmountAuditing;
 import com.jzg.commons.entity.po.SysUserAccount;
@@ -21,12 +23,10 @@ import com.jzg.commons.util.AssertionUtils;
 import com.jzg.commons.util.BigDecimalUtil;
 import com.jzg.commons.util.StringUtils;
 import com.jzg.organization.mapper.SysAmountAuditingMapper;
-import com.jzg.organization.service.SysAmountAuditingService;
-import com.jzg.organization.service.SysUserAccountService;
-import com.jzg.organization.service.SysUserJzgInfoBankCardService;
-import com.jzg.organization.service.SysUserJzgInfoService;
+import com.jzg.organization.service.*;
 import com.jzg.organization.state.AuditState;
 import com.jzg.organization.state.listener.AuditStateListener;
+import io.seata.spring.annotation.GlobalTransactional;
 import org.redisson.api.RBucket;
 import org.redisson.api.RedissonClient;
 import org.slf4j.Logger;
@@ -56,6 +56,9 @@ public class SysAmountAuditingServiceImpl extends ServiceImpl<SysAmountAuditingM
     @Autowired
     private BaseController baseController;
 
+    @Autowired
+    private SysUserJzgInfoService sysJzgInfoService;
+
     @Autowired
     private RedissonClient redissonClient;
 
@@ -74,6 +77,11 @@ public class SysAmountAuditingServiceImpl extends ServiceImpl<SysAmountAuditingM
     @Autowired
     private ExportBaseServiceImpl exportBaseService;
 
+    @Autowired
+    private SysUserAccountIncomeLogService sysUserAccountIncomeLogService;
+    @Autowired
+    private InvAccountCardService invAccountCardService;
+
     private static final String AMOUNT_LOCK_PREFIX = "amountLock:";
 
     @Override
@@ -176,10 +184,11 @@ public class SysAmountAuditingServiceImpl extends ServiceImpl<SysAmountAuditingM
     /**
      * 提现付款
      *
-     * @param param
+     * @param param 提现付款的付款凭证等信息
      */
     @Override
     @Transactional(rollbackFor = Exception.class)
+    @GlobalTransactional(rollbackFor = Exception.class)
     public HttpResult<String> verifyAmount(AmountAuditEditParam param) {
         String userName = baseController.getUserName();
         String userId = baseController.getUserId();
@@ -189,20 +198,7 @@ public class SysAmountAuditingServiceImpl extends ServiceImpl<SysAmountAuditingM
             return HttpResult.error("付款账户不能为空");
         }
         SysAmountAuditing audit = this.getById(param.getId());
-        if(audit.getAuditingStatus() > 0){
-            if(audit.getAuditingStatus() == 1){
-                AssertionUtils.isFail(true, "提现已付款请刷新列表");
-            }else{
-                AssertionUtils.isFail(true, "提现已驳回请刷新列表");
-            }
-        }
-        if(StringUtils.isBlank(audit.getReceiveUser())){
-            AssertionUtils.isFail(true, "请领取提现申请后再进行付款,返回待付款提现申请列表!");
-        }
-
-        if (!userName.equals(audit.getReceiveUser())) {
-            AssertionUtils.isFail(true, "申请已被"+audit.getReceiveUser()+"领取返回待付款提现申请列表!");
-        }
+        this.validateBeforePass(audit, userName);
         if(StringUtils.isNotBlank(audit.getReceiveUser())){
             if(userName.equals(audit.getReceiveUser())){
                 StateResult stateFailResult = auditStateListener.statusChange(AuditState.AuditStateEnum.SUCCESS_AUDIT,audit.getAuditingStatus()+"", userName,userId);
@@ -218,18 +214,24 @@ public class SysAmountAuditingServiceImpl extends ServiceImpl<SysAmountAuditingM
                 SysUserAccount userAccount = userAccountService.queryByUserId(audit.getUserId(),systemCode);
                 AssertionUtils.isFail(Objects.isNull(userAccount), "用户账户数据异常!");
                 AssertionUtils.isFail(audit.getAmount().compareTo(audit.getBalanceAmount()) > 0, "提现金额大于账户余额!");
-
-                if(userAccount.getSumAmount().compareTo(audit.getAmount()) < 0){
+                if(userAccount.getSumAmountUnpaid().compareTo(audit.getAmount()) < 0){
                     log.info("账户金额少于提现金额,请审核账户。 userId=[{}}], userAccount.getSumAmount()=[{}],audit.getAmount()=[{}]",userAccount.getUserId(), userAccount.getSumAmount(), audit.getAmount());
                     throw new SystemException("账户金额少于提现金额,请审核账户");
                 }
+                BigDecimal amountBefore = userAccount.getSumAmountUnpaid();
                 // 应付总计: 只添加,不减。 modify by lipf ,2026年6月3日14:30:33
-                // sumAmount = sumAmountPaid + SumAmountUnpaid
-                //userAccount.setSumAmount(userAccount.getSumAmount().subtract(audit.getAmount()));
                 userAccount.setSumAmountPaid(userAccount.getSumAmountPaid().add(audit.getAmount()));
                 userAccount.setSumAmountUnpaid(userAccount.getSumAmountUnpaid().subtract(audit.getAmount()));
-
-                userAccountService.saveOrUpdate(userAccount);
+                SysUserAccountChangeLog changeLog = this.fillSysUserAccountChangeLog(systemCode,userName,amountBefore,
+                        audit.getAmount(),userAccount.getUserId(),param);
+                try{
+                    log.info("changeLog=【{}】",JSONUtil.toJsonStr(changeLog));
+                    sysUserAccountIncomeLogService.save(changeLog);
+                    userAccountService.saveOrUpdate(userAccount);
+                }catch (Exception e){
+                    log.error("新增明细异常",e);
+                    throw new SystemException(e.getMessage());
+                }
             }else{
                 AssertionUtils.isFail(true, "提现申请已被" + audit.getReceiveUser() + "领取!");
             }
@@ -239,6 +241,89 @@ public class SysAmountAuditingServiceImpl extends ServiceImpl<SysAmountAuditingM
         return HttpResult.ok("提现审核成功");
     }
 
+    /**
+     * 提现申请通过前的校验
+     *
+     * @author lipf
+     * @date 2026/6/8 15:57
+     */
+    private void validateBeforePass(SysAmountAuditing audit, String userName) {
+        if(audit.getAuditingStatus() > 0){
+            if(audit.getAuditingStatus() == 1){
+                AssertionUtils.isFail(true, "提现已付款请刷新列表");
+            }else{
+                AssertionUtils.isFail(true, "提现已驳回请刷新列表");
+            }
+        }
+        if(StringUtils.isBlank(audit.getReceiveUser())){
+            AssertionUtils.isFail(true, "请领取提现申请后再进行付款,返回待付款提现申请列表!");
+        }
+
+        if (!userName.equals(audit.getReceiveUser())) {
+            AssertionUtils.isFail(true, "申请已被"+ audit.getReceiveUser()+"领取返回待付款提现申请列表!");
+        }
+    }
+
+    /**
+     * 填充账户变更记录信息
+     *
+     * @param systemCode  租户代码
+     * @param userName    操作用户
+     * @param amount      操作的金额
+     * @param ywyUserId      业务员账户信息
+     * @param param       里面的id表示提现申请表 sys_amount_auditing 表的序号, accountId 表示 inv_account_card 表中账号
+     * @author lipf
+     * @date 2026/6/8 15:53
+     */
+    private SysUserAccountChangeLog fillSysUserAccountChangeLog(String systemCode, String userName,
+                                                                BigDecimal amountBefore,
+                                                                BigDecimal amount, String ywyUserId,
+                                                                AmountAuditEditParam param) {
+        log.info("填充业务员收支明细: param=[{}]systemCode=[{}],userName=[{}], amount=[{}], amountBefore=[{}], ywyUserId=[{}]", JSONUtil.toJsonStr(param), systemCode, userName, amount, amountBefore, ywyUserId);
+        // modify by lipf 2026年6月8日14:38:36 提现的时候,往账户操作记录表中插入数据
+        SysUserJzgInfo sysUserJzgInfo = sysJzgInfoService.getUserByUserId(ywyUserId);
+        String jzgInfoId=null;
+        String yewUserName = null;
+        if(sysUserJzgInfo != null){
+            jzgInfoId = sysUserJzgInfo.getId();
+            yewUserName = sysUserJzgInfo.getName();
+        }
+
+        SysUserAccountChangeLog changeLog = new  SysUserAccountChangeLog(systemCode,ywyUserId,jzgInfoId);
+        changeLog.setUserName(yewUserName);
+        changeLog.setAmountBefore(amountBefore);
+        // 提现操作
+        changeLog.setOperType(3);
+        changeLog.setRemark("提现");
+        SysAmountAuditing sysAmountAuditing = baseMapper.selectById(param.getId());
+        if(sysAmountAuditing != null){
+            String bankCardNum = sysAmountAuditing.getBankCardNum();
+            List<SysUserJzgInfoBankCard> sysUserJzgInfoBankCards =  sysUserJzgInfoBankCardService.queryBankCardBybankCardNum(bankCardNum,systemCode);
+            if(CollUtil.isNotEmpty(sysUserJzgInfoBankCards)){
+                SysUserJzgInfoBankCard sysUserJzgInfoBankCard = sysUserJzgInfoBankCards.get(0);
+                changeLog.setBankCardIdTo(sysUserJzgInfoBankCard.getId());
+                 changeLog.setBankCardNoTo(sysUserJzgInfoBankCard.getBankCardNumber());
+            }
+        }
+        changeLog.setUserId(ywyUserId);
+        List<InvAccountCard> accountCardVos = invAccountCardService.queryByAccountId(param.getAccountId(), systemCode);
+        if(CollUtil.size(accountCardVos) > 1){
+            throw new SystemException(String.format("租户%s下根据账号%s找到%d条",systemCode,param.getAccountId(),accountCardVos.size()));
+        }
+        if(CollUtil.isNotEmpty(accountCardVos)){
+            InvAccountCard accountCardVo = accountCardVos.get(0);
+            changeLog.setBankCardIdIn(accountCardVo.getId());
+            changeLog.setBankCardNoIn(accountCardVo.getBankCardNum());
+        }
+        changeLog.setAmount(BigDecimalUtil.negate(BigDecimalUtil.abs(amount)));
+        changeLog.setCreateBy(userName);
+        changeLog.setCreateTime(LocalDateTime.now());
+        changeLog.setUpdateBy(userName);
+        changeLog.setUpdateTime(LocalDateTime.now());
+        changeLog.setIsDelete(0);
+        return changeLog;
+    }
+
     @Override
     public void rejectAmount(AmountAuditRejectParam param) {
         String userName = baseController.getUserName();
@@ -325,7 +410,6 @@ public class SysAmountAuditingServiceImpl extends ServiceImpl<SysAmountAuditingM
         if(sumAmount.compareTo(applyWithdrawParam.getWithdrawAmount()) < 0){
             throw new SystemException("无法提现,请检查当前账户余额");
         }
-
         // 获取用户的银行卡信息
         SysUserJzgInfo sysUserJzgInfo = sysUserJzgInfoService.getUserByUserId(baseController.getUserId());
         List<SysUserJzgInfoBankCardDto> bankCardByUserId = sysUserJzgInfoBankCardService.getBankCardByUserId(sysUserJzgInfo.getId(),baseController.getSystemCode());
@@ -334,7 +418,6 @@ public class SysAmountAuditingServiceImpl extends ServiceImpl<SysAmountAuditingM
             throw new SystemException("提供的银行卡信息错误");
         }
         SysUserJzgInfoBankCardDto sysUserJzgInfoBankCardDto = bankCardByUserId.stream().filter(x -> x.getId().equals(applyWithdrawParam.getBankCardId())).findFirst().get();
-
         // 构造提现对象
         SysAmountAuditing sysAmountAuditing = new SysAmountAuditing(applyWithdrawParam,sysUserAccount,sysUserJzgInfoBankCardDto,baseController.getUserId());
         baseMapper.insert(sysAmountAuditing);
@@ -348,6 +431,7 @@ public class SysAmountAuditingServiceImpl extends ServiceImpl<SysAmountAuditingM
      */
     @Override
     public String exportAuditList(AmountAuditParam param) {
+        log.info("导出提现申请列表:param=[{}] ",JSONUtil.toJsonStr(param));
         List<AmountAuditVo> amountAuditVos = baseMapper.queryList(param.getPage(), param);
 
         // 调用动态导出
@@ -357,6 +441,30 @@ public class SysAmountAuditingServiceImpl extends ServiceImpl<SysAmountAuditingM
                 "应付账款-提现申请-导出-" + Instant.now()
         );
     }
+
+    /**
+     * 导出业务员收入支出明显
+     *
+     * param ywyIOParam 导出条件, 包含开始日期,结束日期
+     * @return String
+     */
+    @Override
+    public String exportYwyIORecs(YwyIOParam ywyIOParam) {
+        log.info("导出业务员收支明细:ywyIOParam=[{}]", JSONUtil.toJsonStr(ywyIOParam));
+        List<SysUserAccountChangeLog> changeLogs = sysUserAccountIncomeLogService.queryYwyIORecs(ywyIOParam);
+        String userName=null;
+        if(CollUtil.isNotEmpty(changeLogs)){
+            SysUserAccountChangeLog sysUserAccountChangeLog = changeLogs.get(0);
+            userName = sysUserAccountChangeLog.getUserName();
+        }
+        String suffix = String.join("-",Objects.toString(userName,""),Objects.toString(ywyIOParam.getBeginDate(),null) , Objects.toString(ywyIOParam.getEndDate(),null));
+        // 调用动态导出
+        return exportBaseService.upLoadFile(
+                SysUserAccountChangeLog.class,
+                changeLogs,
+                "业务员收支明细-导出-"+suffix + Instant.now()
+        );
+    }
 }
 
 

+ 31 - 39
tenant/organization/src/main/java/com/jzg/organization/service/impl/SysUserAccountIncomeLogServiceImpl.java

@@ -1,54 +1,46 @@
 package com.jzg.organization.service.impl;
 
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import cn.hutool.core.collection.CollUtil;
+import cn.hutool.json.JSONUtil;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.jzg.commons.constants.RedisKeyConstants;
-import com.jzg.commons.core.base.BaseController;
-import com.jzg.commons.core.base.HistoryDataService;
-import com.jzg.commons.core.base.StateResult;
-import com.jzg.commons.core.page.HttpResult;
-import com.jzg.commons.entity.account.po.SysUserAccountIncomeLog;
-import com.jzg.commons.entity.dto.SysUserInfoParam;
-import com.jzg.commons.entity.dto.SysUserJzgInfoBankCardDto;
-import com.jzg.commons.entity.dto.SysUserJzgInfoDto;
-import com.jzg.commons.entity.enums.MessageCodeEnum;
-import com.jzg.commons.entity.po.*;
-import com.jzg.commons.entity.user.vo.SysTennatVo;
-import com.jzg.commons.entity.vo.*;
-import com.jzg.commons.exception.SystemException;
-import com.jzg.commons.exception.ValidateException;
-import com.jzg.commons.util.MinioUtils;
-import com.jzg.commons.util.PasswordUtils;
-import com.jzg.commons.util.StringUtils;
-import com.jzg.commons.util.idgen.IdGenerate;
-import com.jzg.organization.consumer.templete.UserMessageTemplate;
+import com.jzg.commons.entity.account.po.SysUserAccountChangeLog;
+import com.jzg.commons.entity.dto.YwyIOParam;
 import com.jzg.organization.mapper.*;
 import com.jzg.organization.service.*;
-import com.jzg.organization.state.UserState;
-import com.jzg.organization.state.listener.UserStateListener;
-import jakarta.annotation.Resource;
-import lombok.Setter;
-import org.redisson.api.RedissonClient;
-import org.springframework.beans.BeanUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Qualifier;
-import org.springframework.beans.factory.annotation.Value;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-import org.springframework.util.ObjectUtils;
 
-import java.util.*;
-import java.util.stream.Collectors;
+import java.time.LocalDate;
+import java.util.List;
 
 /**
- * @author Administrator
- * @description 针对表【sys_area(省市县代码)】的数据库操作Service实现
- * @createDate 2023-11-15 11:23:28
+ *
+ * @date 2023-11-15 11:23:28
  */
 @Service
-public class SysUserAccountIncomeLogServiceImpl extends ServiceImpl<SysUserAccountIncomeLogMapper, SysUserAccountIncomeLog> implements SysUserAccountIncomeLogService{
+public class SysUserAccountIncomeLogServiceImpl extends ServiceImpl<SysUserAccountIncomeLogMapper, SysUserAccountChangeLog> implements SysUserAccountIncomeLogService{
 
+    private static final Logger log = LoggerFactory.getLogger(SysUserAccountIncomeLogServiceImpl.class);
+
+    /**
+     * 查询业务员收支明细
+     *
+     * @param ywyIOParam 查询参数,包括业务员信息, 以及查询的时间范围
+     * @author lipf
+     * @date 2026/6/8 17:25
+     */
+    @Override
+    public List<SysUserAccountChangeLog> queryYwyIORecs(YwyIOParam ywyIOParam) {
+        log.info("查询业务员收支明细:ywyIOParam=[{}]", JSONUtil.toJsonStr(ywyIOParam));
+        LocalDate endDate = ywyIOParam.getEndDate();
+        if(endDate != null){
+            ywyIOParam.setEndDate(endDate.plusDays(1));
+        }
+        List<SysUserAccountChangeLog> changeLogs =  baseMapper.queryYwyIORecs(ywyIOParam.getYwyUserId(), ywyIOParam.getBeginDate(), ywyIOParam.getEndDate());
+        log.info("查询业务员收支明细:ywyIOParam=[{}]。 查询出[{}]条记录", JSONUtil.toJsonStr(ywyIOParam), CollUtil.size(changeLogs));
+        return changeLogs;
+    }
 }
 
 

+ 13 - 0
tenant/organization/src/main/java/com/jzg/organization/service/impl/SysUserJzgInfoBankCardServiceImpl.java

@@ -188,4 +188,17 @@ public class SysUserJzgInfoBankCardServiceImpl extends ServiceImpl<SysUserJzgInf
         SysUserJzgInfoBankCard sysUserJzgInfoBankCard = sysUserJzgInfoBankCardMapper.selectById(sysUserJzgInfoBankCardVo.getId());
         return sysUserJzgInfoBankCardMapper.deleteById(sysUserJzgInfoBankCard) > 0;
     }
+
+    /**
+     * 根据银行卡号查询银行卡的信息
+     *
+     * @param bankCardNum 银行卡号
+     * @param systemCode  租户代码
+     * @author lipf
+     * @date 2026/6/8 16:22
+     */
+    @Override
+    public List<SysUserJzgInfoBankCard> queryBankCardBybankCardNum(String bankCardNum, String systemCode) {
+        return sysUserJzgInfoBankCardMapper.queryBankCardBybankCardNum(bankCardNum, systemCode);
+    }
 }

+ 4 - 0
tenant/organization/src/main/resources/mapper/InvAccountCardMapper.xml

@@ -80,4 +80,8 @@
             </if>
         </where>
     </select>
+    <!-- 查询业务员提现银行卡信息 lipf 2026年6月8日15:16:59 -->
+    <select id="queryByAccountId" resultType="com.jzg.commons.entity.account.po.InvAccountCard">
+        select * from inv_account_card iac where iac.account_id = #{accountId} and iac.system_code = #{systemCode}
+    </select>
 </mapper>

+ 4 - 0
tenant/organization/src/main/resources/mapper/SysUserJzgInfoBankCardMapper.xml

@@ -79,4 +79,8 @@
         case when sujibc.is_default = 1 then 0 else 1 end,
         sujibc.create_time desc
     </select>
+    <!-- 根据银行卡号查询银行卡的信息 lipf 2026年6月8日16:24:13 -->
+    <select id="queryBankCardBybankCardNum" resultType="com.jzg.commons.entity.po.SysUserJzgInfoBankCard">
+        select * from sys_user_jzg_info_bank_card sujibc where sujibc.bank_card_number = #{bankCardNum} and sujibc.system_code = #{systemCode}
+    </select>
 </mapper>

Некоторые файлы не были показаны из-за большого количества измененных файлов