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

Merge branch 'refs/heads/test' into master-20240326

wks 2 лет назад
Родитель
Сommit
cfb9b7c27e
43 измененных файлов с 706 добавлено и 436 удалено
  1. 5 1
      src/main/java/com/ydtech/modules/admin/constants/QuMarks.java
  2. 3 3
      src/main/java/com/ydtech/modules/admin/controller/SysDeptController.java
  3. 4 1
      src/main/java/com/ydtech/modules/admin/dao/SysUserMapper.java
  4. 4 0
      src/main/java/com/ydtech/modules/admin/model/SysDept.java
  5. 6 0
      src/main/java/com/ydtech/modules/admin/model/vo/SysUserBaseVO.java
  6. 7 1
      src/main/java/com/ydtech/modules/admin/service/impl/SysDeptServiceImpl.java
  7. 142 124
      src/main/java/com/ydtech/modules/admin/service/impl/SysUserServiceImpl.java
  8. 11 0
      src/main/java/com/ydtech/modules/esm/controller/EsmRetailController.java
  9. 2 0
      src/main/java/com/ydtech/modules/esm/dao/EsmRetailDao.java
  10. 7 0
      src/main/java/com/ydtech/modules/esm/dao/impl/EsmRetailDaoImpl.java
  11. 8 2
      src/main/java/com/ydtech/modules/fnc/controller/InsPlyIncomeController.java
  12. 5 1
      src/main/java/com/ydtech/modules/fnc/dao/InsPlyIncomeMapper.java
  13. 1 0
      src/main/java/com/ydtech/modules/fnc/entity/InsAreaCompany.java
  14. 7 7
      src/main/java/com/ydtech/modules/fnc/entity/InsPlyIncome.java
  15. 4 0
      src/main/java/com/ydtech/modules/fnc/entity/SettlementDocumentaryFeesEntity.java
  16. 3 1
      src/main/java/com/ydtech/modules/fnc/service/InsPlyIncomeService.java
  17. 2 1
      src/main/java/com/ydtech/modules/fnc/service/impl/InsFeeAuditServiceImpl.java
  18. 42 22
      src/main/java/com/ydtech/modules/fnc/service/impl/InsPlyIncomeServiceImpl.java
  19. 2 1
      src/main/java/com/ydtech/modules/fnc/service/impl/InsPlyMainServiceImpl.java
  20. 58 3
      src/main/java/com/ydtech/modules/fnc/vo/InsPlyIncomeVo.java
  21. 2 2
      src/main/java/com/ydtech/modules/inv/controller/InvReceivableController.java
  22. 9 7
      src/main/java/com/ydtech/modules/inv/controller/invAccountExcelController.java
  23. 2 2
      src/main/java/com/ydtech/modules/inv/dao/InvAccountExcelMapper.java
  24. 3 3
      src/main/java/com/ydtech/modules/inv/model/InvAccountOperate.java
  25. 3 3
      src/main/java/com/ydtech/modules/inv/model/excel/InvDisburseExcel.java
  26. 12 14
      src/main/java/com/ydtech/modules/inv/model/vo/InvAccountOperateVo.java
  27. 2 2
      src/main/java/com/ydtech/modules/inv/service/InvAccountExcelService.java
  28. 4 11
      src/main/java/com/ydtech/modules/inv/service/impl/InvAccountExcelServiceImpl.java
  29. 20 9
      src/main/java/com/ydtech/modules/order/aop/aspect/QuoteVerificationAspect.java
  30. 4 0
      src/main/java/com/ydtech/modules/order/entity/InsOrders.java
  31. 3 0
      src/main/java/com/ydtech/modules/order/entity/vo/BaseQuoteVo.java
  32. 18 1
      src/main/java/com/ydtech/modules/order/service/impl/InsOrdersServiceImpl.java
  33. 5 1
      src/main/java/com/ydtech/modules/protocols/dao/PtlAgreementProductCostsNewMapper.java
  34. 8 0
      src/main/java/com/ydtech/modules/protocols/entity/po/PtlAgreementProductCostsNew.java
  35. 3 0
      src/main/java/com/ydtech/modules/protocols/entity/vo/AgreementProductQueryVo.java
  36. 8 26
      src/main/java/com/ydtech/modules/protocols/service/impl/PtlAgreementProductCostsNewServiceImpl.java
  37. 60 35
      src/main/resources/mapper/modules/admin/SysUserMapper.xml
  38. 131 128
      src/main/resources/mapper/modules/fnc/InsPlyIncomeMapper.xml
  39. 33 20
      src/main/resources/mapper/modules/inv/InvAccountExcelMapper.xml
  40. 4 1
      src/main/resources/mapper/modules/order/InsAreaCompanyMapper.xml
  41. 14 1
      src/main/resources/mapper/modules/order/InsOrdersMapper.xml
  42. 2 2
      src/main/resources/mapper/modules/protocol/PtlAgreementMapper.xml
  43. 33 0
      src/main/resources/mapper/modules/protocols/PtlAgreementProductCostsNewMapper.xml

+ 5 - 1
src/main/java/com/ydtech/modules/admin/constants/QuMarks.java

@@ -15,7 +15,11 @@ import lombok.Getter;
 public enum QuMarks {
 
     COMPANY_MARK(1, "保险公司"),
-    USER_MARK(2,"用户");
+
+    USER_MARK(2,"用户"),
+
+    USER_COMPANY_MARK(3,"用户/保险公司/详情");
+
 
     private final Integer code;
 

+ 3 - 3
src/main/java/com/ydtech/modules/admin/controller/SysDeptController.java

@@ -46,13 +46,13 @@ public class SysDeptController extends BaseController {
     //@PreAuthorize("hasAuthority('sys:dept:view')")
     @ApiOperation(value = "获取树结构")
     @GetMapping(value = "/findTree")
-    public HttpResult<List<SysDept>> findTree() {
+    public HttpResult<List<SysDept>> findTree(String deptId,String managementSource) {
         BaseController baseController = new BaseController();
-        String deptId = baseController.getDeptId();
+//        String deptId = baseController.getDeptId();
         LambdaQueryWrapper<SysDept> queryWrapper = new LambdaQueryWrapper<>();
         queryWrapper.eq(SysDept::getDelFlag, 0).eq(SysDept::getId, deptId);
         SysDept one = sysDeptService.getOne(queryWrapper);
-        String managementSource = one.getManagementSource();
+//        String managementSource = one.getManagementSource();
 
         return HttpResult.ok(sysDeptService.findTree(deptId,managementSource));
     }

+ 4 - 1
src/main/java/com/ydtech/modules/admin/dao/SysUserMapper.java

@@ -168,8 +168,11 @@ public interface SysUserMapper extends BaseMapper<SysUser> {
     List<QuTeamNum> getUser(@Param("quTeamNumDto")QuTeamNumDto quTeamNumDto);
 
     List<QuUserNum> getUserNum(@Param("quUserNumDto") QuUserNumDto quUserNumDto);
+    List<QuUserNum> getMainWaitAuditSum(@Param("quUserNumDto") QuUserNumDto quUserNumDto);
+    List<QuUserNum> getMainWaitPaySum(@Param("quUserNumDto") QuUserNumDto quUserNumDto);
+    List<QuUserNum> getMainAcceptInsuranceSum(@Param("quUserNumDto") QuUserNumDto quUserNumDto);
 
-    List<QuUserNum> getMainOrderDetails(@Param("quUserNumDto") QuUserNumDto quUserNumDto);
+//    List<QuUserNum> getMainOrderDetails(@Param("quUserNumDto") QuUserNumDto quUserNumDto);
 
     List<QuUserNum> getUserByCompany(@Param("quUserNumDto") QuUserNumDto quUserNumDto);
     List<QuUserNum> getComMainWaitAuditSum(@Param("quUserNumDto") QuUserNumDto quUserNumDto);

+ 4 - 0
src/main/java/com/ydtech/modules/admin/model/SysDept.java

@@ -140,6 +140,10 @@ public class SysDept implements Serializable {
     @TableField(exist = false)
     private Integer level;
 
+    // 非数据库字段
+    @TableField(exist = false)
+    private Integer deptCount;
+
 
 }
 

+ 6 - 0
src/main/java/com/ydtech/modules/admin/model/vo/SysUserBaseVO.java

@@ -45,4 +45,10 @@ public class SysUserBaseVO {
     @ApiModelProperty(value = "是否绑定协议")
     private Boolean flag;
 
+    @ApiModelProperty(value = "渠道/个代")
+    private String managementSource;
+
+    @ApiModelProperty(value = "岗位名称")
+    private String positionName;
+
 }

+ 7 - 1
src/main/java/com/ydtech/modules/admin/service/impl/SysDeptServiceImpl.java

@@ -85,7 +85,10 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept>
             sysDeptList = result;
         } else {
             Map<String, List<SysDept>> map = sysDeptList.stream().collect(Collectors.groupingBy(SysDept::getParentId));
-            sysDeptList.forEach(i -> i.setChildren(map.getOrDefault(i.getId(), new ArrayList<>())));
+            sysDeptList.forEach(i -> {
+                i.setChildren(map.getOrDefault(i.getId(), new ArrayList<>()));
+                i.setDeptCount(i.getChildren().size());
+            });
             sysDeptList = map.get(sysDept.getParentId());
         }
         return sysDeptList;
@@ -253,6 +256,9 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept>
             }
             baseMapper.updateById(record);
         }
+        if (newOrderNum.equals(orderNum)) {
+            baseMapper.updateById(record);
+        }
         return HttpResult.ok();
     }
 

+ 142 - 124
src/main/java/com/ydtech/modules/admin/service/impl/SysUserServiceImpl.java

@@ -814,7 +814,12 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
             // 根据查询条件获取用户数量统计信息
             quUserNumDto.setUserIds(strIds);
             List<QuUserNum> userNums = sysUserMapper.getUserNum(quUserNumDto);
-            List<QuUserNum> orderDetails = sysUserMapper.getMainOrderDetails(quUserNumDto);
+            // 获取地区主订单待核保订单数量
+            List<QuUserNum> mainWaitAuditSums = sysUserMapper.getMainWaitAuditSum(quUserNumDto);
+            // 获取地区主订单已核保待缴费订单数量
+            List<QuUserNum> mainWaitPaySums = sysUserMapper.getMainWaitPaySum(quUserNumDto);
+            // 获取地区主订单已承包订单数量
+            List<QuUserNum> mainAcceptInsuranceSums = sysUserMapper.getMainAcceptInsuranceSum(quUserNumDto);
             // 根据区域名称匹配用户数量统计信息,并构造最终返回的结果列表
             for (QuUserNum quUserNum : userNums) {
                 for (SysArea sysArea : areaList) {
@@ -826,13 +831,23 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
                         }
                     }
                 }
-                for (QuUserNum orderDetail : orderDetails) {
-                    if (quUserNum.getAreaCode().equals(orderDetail.getAreaCode())) {
-                        quUserNum.setMainAcceptInsuranceSum(orderDetail.getMainAcceptInsuranceSum());
-                        quUserNum.setMainWaitAuditSum(orderDetail.getMainWaitAuditSum());
-                        quUserNum.setMainWaitPaySum(orderDetail.getMainWaitPaySum());
+
+                    for (QuUserNum mainWaitAuditSum : mainWaitAuditSums) {
+                        if (quUserNum.getAreaCode().equals(mainWaitAuditSum.getAreaCode())) {
+                            quUserNum.setMainWaitAuditSum(mainWaitAuditSum.getMainWaitAuditSum());
+                        }
                     }
-                }
+                    for (QuUserNum mainWaitPaySum : mainWaitPaySums) {
+                        if (quUserNum.getAreaCode().equals(mainWaitPaySum.getAreaCode())) {
+                            quUserNum.setMainWaitPaySum(mainWaitPaySum.getMainWaitPaySum());
+                        }
+                    }
+                    for (QuUserNum mainAcceptInsuranceSum : mainAcceptInsuranceSums) {
+                        if (quUserNum.getAreaCode().equals(mainAcceptInsuranceSum.getAreaCode())) {
+                            quUserNum.setMainAcceptInsuranceSum(mainAcceptInsuranceSum.getMainAcceptInsuranceSum());
+                        }
+                    }
+
                 quUserNums.add(quUserNum);
             }
         }
@@ -865,96 +880,40 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
     @Override
     public IPage<QuUserNum> getQuUserByCompany(QuUserNumDto quUserNumDto) {
 
-        // 获取系统中的所有用户
-        List<SysUser> users = list();
-
-        // 创建查询包装器,用于查询指定用户ID的用
-        LambdaQueryWrapper<SysUser> queryWrapper = new LambdaQueryWrapper<>();
-        queryWrapper.eq(SysUser::getId, quUserNumDto.getUserId());
-        // 查询指定用户ID的用户,即第一级下属
-        List<SysUser> usersLevel1 = list(queryWrapper);
-
-        // 用于存储所有下属的ID
-        List<String> strIds = new ArrayList<>();
-        // 递归获取第一级下属及其所有下属的ID
-        findChildren(usersLevel1, users, strIds);
-
-        // 如果未指定区域码,返回空分页对
-        if (Objects.isNull(quUserNumDto.getAreaCode())) {
-            return new Page<>();
-        }
-
-        // 根据区域码筛选有效的下属ID
-        strIds.removeIf(id -> !id.contains("99" + quUserNumDto.getAreaCode()));
-
-        // 如果筛选后没有有效的下属ID,返回空分页对象
-        if (strIds.size() == 0) {
-            return new Page<>();
-        }
-
-        // 设置查询条件中的用户ID列表
-        quUserNumDto.setUserIds(strIds);
-
-        List<QuUserNum> deptByCompany = new ArrayList<>();
-
-        if (quUserNumDto.getQuMarks().equals(QuMarks.COMPANY_MARK.getCode())) {
-            // 根据公司和用户ID列表查询用户数量统计信息
-            deptByCompany = sysUserMapper.getUserByCompany(quUserNumDto);
-            // 获取公司主订单待核保订单数量
-            List<QuUserNum> mainWaitAuditSums = sysUserMapper.getComMainWaitAuditSum(quUserNumDto);
-            // 获取公司主订单已核保待缴费订单数量
-            List<QuUserNum> mainWaitPaySums = sysUserMapper.getComMainWaitPaySum(quUserNumDto);
-            // 获取公司主订单已承包订单数量
-            List<QuUserNum> mainAcceptInsuranceSums = sysUserMapper.getComMainAcceptInsuranceSum(quUserNumDto);
-
-            for (QuUserNum quUserNum : deptByCompany) {
-                for (QuUserNum mainWaitAuditSum : mainWaitAuditSums) {
-                    if (quUserNum.getCompanyId().equals(mainWaitAuditSum.getCompanyId())) {
-                        quUserNum.setMainWaitAuditSum(mainWaitAuditSum.getMainWaitAuditSum());
-                    }
-                }
-                for (QuUserNum mainWaitPaySum : mainWaitPaySums) {
-                    if (quUserNum.getCompanyId().equals(mainWaitPaySum.getCompanyId())) {
-                        quUserNum.setMainWaitPaySum(mainWaitPaySum.getMainWaitPaySum());
-                    }
-                }
-                for (QuUserNum mainAcceptInsuranceSum : mainAcceptInsuranceSums) {
-                    if (quUserNum.getCompanyId().equals(mainAcceptInsuranceSum.getCompanyId())) {
-                        quUserNum.setMainAcceptInsuranceSum(mainAcceptInsuranceSum.getMainAcceptInsuranceSum());
-                    }
-                }
+        //查询单个用户的详情时不需要区域code
+        if (!quUserNumDto.getQuMarks().equals(QuMarks.USER_COMPANY_MARK.getCode())) {
+            // 获取系统中的所有用户
+            List<SysUser> users = list();
+
+            // 创建查询包装器,用于查询指定用户ID的用
+            LambdaQueryWrapper<SysUser> queryWrapper = new LambdaQueryWrapper<>();
+            queryWrapper.eq(SysUser::getId, quUserNumDto.getUserId());
+            // 查询指定用户ID的用户,即第一级下属
+            List<SysUser> usersLevel1 = list(queryWrapper);
+
+            // 用于存储所有下属的ID
+            List<String> strIds = new ArrayList<>();
+            // 递归获取第一级下属及其所有下属的ID
+            findChildren(usersLevel1, users, strIds);
+            // 如果未指定区域码,返回空分页对
+            if (Objects.isNull(quUserNumDto.getAreaCode())) {
+                return new Page<>();
             }
-
-        } else if (quUserNumDto.getQuMarks().equals(QuMarks.USER_MARK.getCode())) {
-            // 根据公司和用户ID列表查询用户数量统计信息
-            deptByCompany = sysUserMapper.getUserDetail(quUserNumDto);
-
-            // 获取用户主订单待核保订单数量
-            List<QuUserNum> mainWaitAuditSums = sysUserMapper.getUserMainWaitAuditSum(quUserNumDto);
-            // 获取用户主订单已核保待缴费订单数量
-            List<QuUserNum> mainWaitPaySums = sysUserMapper.getUserMainWaitPaySum(quUserNumDto);
-            // 获取用户主订单已承包订单数量
-            List<QuUserNum> mainAcceptInsuranceSums = sysUserMapper.getUserMainAcceptInsuranceSum(quUserNumDto);
-
-            for (QuUserNum quUserNum : deptByCompany) {
-                for (QuUserNum mainWaitAuditSum : mainWaitAuditSums) {
-                    if (quUserNum.getUserId().equals(mainWaitAuditSum.getUserId()) && quUserNum.getCompanyId().equals(mainWaitAuditSum.getCompanyId())) {
-                        quUserNum.setMainWaitAuditSum(mainWaitAuditSum.getMainWaitAuditSum());
-                    }
-                }
-                for (QuUserNum mainWaitPaySum : mainWaitPaySums) {
-                    if (quUserNum.getUserId().equals(mainWaitPaySum.getUserId()) && quUserNum.getCompanyId().equals(mainWaitPaySum.getCompanyId())) {
-                        quUserNum.setMainWaitPaySum(mainWaitPaySum.getMainWaitPaySum());
-                    }
-                }
-                for (QuUserNum mainAcceptInsuranceSum : mainAcceptInsuranceSums) {
-                    if (quUserNum.getUserId().equals(mainAcceptInsuranceSum.getUserId()) && quUserNum.getCompanyId().equals(mainAcceptInsuranceSum.getCompanyId())) {
-                        quUserNum.setMainAcceptInsuranceSum(mainAcceptInsuranceSum.getMainAcceptInsuranceSum());
-                    }
-                }
+            // 根据区域码筛选有效的下属ID
+            strIds.removeIf(id -> !id.contains("99" + quUserNumDto.getAreaCode()));
+            // 如果筛选后没有有效的下属ID,返回空分页对象
+            if (strIds.size() == 0) {
+                return new Page<>();
             }
+            // 设置查询条件中的用户ID列表
+            quUserNumDto.setUserIds(strIds);
+        }else {
+            // 设置查询条件中的用户ID列表
+            quUserNumDto.setUserIds(Collections.singletonList(quUserNumDto.getUserId()));
         }
 
+        List<QuUserNum> deptByCompany = agentOrChannelByMark(quUserNumDto);
+
         List<QuUserNum> paginate = paginate(deptByCompany, quUserNumDto.getPageNum(), quUserNumDto.getPageSize());
 
         // 创建并设置分页信息
@@ -1002,6 +961,8 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
         }
     }
 
+
+
     private boolean exists(List<QuUserNum> quUserNums, SysArea sysArea) {
         boolean exist = true;
         for (QuUserNum quUserNum1 : quUserNums) {
@@ -1124,7 +1085,12 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
             quUserNumDto.setUserIds(strIds);
             List<QuUserNum> userNums = sysUserMapper.getUserNum(quUserNumDto);
 
-            List<QuUserNum> orderDetails = sysUserMapper.getMainOrderDetails(quUserNumDto);
+            // 获取地区主订单待核保订单数量
+            List<QuUserNum> mainWaitAuditSums = sysUserMapper.getMainWaitAuditSum(quUserNumDto);
+            // 获取地区主订单已核保待缴费订单数量
+            List<QuUserNum> mainWaitPaySums = sysUserMapper.getMainWaitPaySum(quUserNumDto);
+            // 获取地区主订单已承包订单数量
+            List<QuUserNum> mainAcceptInsuranceSums = sysUserMapper.getMainAcceptInsuranceSum(quUserNumDto);
             // 根据区域名称匹配用户数量统计信息,并构造最终返回的结果列表
             for (QuUserNum quUserNum : userNums) {
                 for (SysArea sysArea : areaList) {
@@ -1136,11 +1102,19 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
                         }
                     }
                 }
-                for (QuUserNum orderDetail : orderDetails) {
-                    if (quUserNum.getAreaCode().equals(orderDetail.getAreaCode())) {
-                        quUserNum.setMainAcceptInsuranceSum(orderDetail.getMainAcceptInsuranceSum());
-                        quUserNum.setMainWaitAuditSum(orderDetail.getMainWaitAuditSum());
-                        quUserNum.setMainWaitPaySum(orderDetail.getMainWaitPaySum());
+                for (QuUserNum mainWaitAuditSum : mainWaitAuditSums) {
+                    if (quUserNum.getAreaCode().equals(mainWaitAuditSum.getAreaCode())) {
+                        quUserNum.setMainWaitAuditSum(mainWaitAuditSum.getMainWaitAuditSum());
+                    }
+                }
+                for (QuUserNum mainWaitPaySum : mainWaitPaySums) {
+                    if (quUserNum.getAreaCode().equals(mainWaitPaySum.getAreaCode())) {
+                        quUserNum.setMainWaitPaySum(mainWaitPaySum.getMainWaitPaySum());
+                    }
+                }
+                for (QuUserNum mainAcceptInsuranceSum : mainAcceptInsuranceSums) {
+                    if (quUserNum.getAreaCode().equals(mainAcceptInsuranceSum.getAreaCode())) {
+                        quUserNum.setMainAcceptInsuranceSum(mainAcceptInsuranceSum.getMainAcceptInsuranceSum());
                     }
                 }
                 quUserNums.add(quUserNum);
@@ -1168,30 +1142,47 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
     @Override
     public IPage<QuUserNum> quAgentAreaAdminDetail(QuUserNumDto quUserNumDto) {
 
-        //获取所有代理人用户
-        List<SysUserBaseVO> agentUsers = baseMapper.getAgentUserIdsByAreaIds();
+        //查询单个用户的详情时不需要区域code
+        if (!quUserNumDto.getQuMarks().equals(QuMarks.USER_COMPANY_MARK.getCode())) {
+            //获取所有代理人用户
+            List<SysUserBaseVO> agentUsers = baseMapper.getAgentUserIdsByAreaIds();
 
-        List<String> strIds = agentUsers.stream().map(SysUserBaseVO::getUserId).collect(Collectors.toList());
+            List<String> strIds = agentUsers.stream().map(SysUserBaseVO::getUserId).collect(Collectors.toList());
 
+            // 如果未指定区域码,返回空分页对
+            if (Objects.isNull(quUserNumDto.getAreaCode())) {
+                return new Page<>();
+            }
 
-        // 如果未指定区域码,返回空分页对
-        if (Objects.isNull(quUserNumDto.getAreaCode())) {
-            return new Page<>();
+            // 根据区域码筛选有效的下属ID
+            strIds.removeIf(id -> !id.contains("99" + quUserNumDto.getAreaCode()));
+
+            // 如果筛选后没有有效的下属ID,返回空分页对象
+            if (strIds.size() == 0) {
+                return new Page<>();
+            }
+            // 设置查询条件中的用户ID列表
+            quUserNumDto.setUserIds(strIds);
+        }else {
+            // 设置查询条件中的用户ID列表
+            quUserNumDto.setUserIds(Collections.singletonList(quUserNumDto.getUserId()));
         }
 
-        // 根据区域码筛选有效的下属ID
-        strIds.removeIf(id -> !id.contains("99" + quUserNumDto.getAreaCode()));
+        List<QuUserNum> deptByCompany = agentOrChannelByMark(quUserNumDto);
 
-        // 如果筛选后没有有效的下属ID,返回空分页对象
-        if (strIds.size() == 0) {
-            return new Page<>();
-        }
+        List<QuUserNum> paginate = paginate(deptByCompany, quUserNumDto.getPageNum(), quUserNumDto.getPageSize());
 
-        // 设置查询条件中的用户ID列表
-        quUserNumDto.setUserIds(strIds);
+        // 创建并设置分页信息
+        IPage<QuUserNum> page = new Page<>(quUserNumDto.getPageNum(), quUserNumDto.getPageSize());
+        page.setRecords(paginate);
+        page.setTotal(deptByCompany.size());
+        return page;
+    }
 
-        List<QuUserNum> deptByCompany = new ArrayList<>();
 
+    public List<QuUserNum> agentOrChannelByMark(QuUserNumDto quUserNumDto) {
+
+        List<QuUserNum> deptByCompany = new ArrayList<>();
         if (quUserNumDto.getQuMarks().equals(QuMarks.COMPANY_MARK.getCode())) {
             // 根据公司和用户ID列表查询用户数量统计信息
             deptByCompany = sysUserMapper.getUserByCompany(quUserNumDto);
@@ -1233,31 +1224,58 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
 
             for (QuUserNum quUserNum : deptByCompany) {
                 for (QuUserNum mainWaitAuditSum : mainWaitAuditSums) {
-                    if (quUserNum.getUserId().equals(mainWaitAuditSum.getUserId()) && quUserNum.getCompanyId().equals(mainWaitAuditSum.getCompanyId())) {
+                    if (quUserNum.getUserId().equals(mainWaitAuditSum.getUserId()) ) {
                         quUserNum.setMainWaitAuditSum(mainWaitAuditSum.getMainWaitAuditSum());
                     }
                 }
                 for (QuUserNum mainWaitPaySum : mainWaitPaySums) {
-                    if (quUserNum.getUserId().equals(mainWaitPaySum.getUserId()) && quUserNum.getCompanyId().equals(mainWaitPaySum.getCompanyId())) {
+                    if (quUserNum.getUserId().equals(mainWaitPaySum.getUserId())) {
                         quUserNum.setMainWaitPaySum(mainWaitPaySum.getMainWaitPaySum());
                     }
                 }
                 for (QuUserNum mainAcceptInsuranceSum : mainAcceptInsuranceSums) {
-                    if (quUserNum.getUserId().equals(mainAcceptInsuranceSum.getUserId()) && quUserNum.getCompanyId().equals(mainAcceptInsuranceSum.getCompanyId())) {
+                    if (quUserNum.getUserId().equals(mainAcceptInsuranceSum.getUserId())) {
+                        quUserNum.setMainAcceptInsuranceSum(mainAcceptInsuranceSum.getMainAcceptInsuranceSum());
+                    }
+                }
+            }
+        } else if (quUserNumDto.getQuMarks().equals(QuMarks.USER_COMPANY_MARK.getCode())) {
+            // 根据公司和用户ID列表查询用户数量统计信息
+            deptByCompany = sysUserMapper.getUserByCompany(quUserNumDto);
+            // 获取公司主订单待核保订单数量
+            List<QuUserNum> mainWaitAuditSums = sysUserMapper.getComMainWaitAuditSum(quUserNumDto);
+            // 获取公司主订单已核保待缴费订单数量
+            List<QuUserNum> mainWaitPaySums = sysUserMapper.getComMainWaitPaySum(quUserNumDto);
+            // 获取公司主订单已承包订单数量
+            List<QuUserNum> mainAcceptInsuranceSums = sysUserMapper.getComMainAcceptInsuranceSum(quUserNumDto);
+
+            for (QuUserNum quUserNum : deptByCompany) {
+                for (QuUserNum mainWaitAuditSum : mainWaitAuditSums) {
+                    if (quUserNum.getCompanyId().equals(mainWaitAuditSum.getCompanyId())) {
+                        quUserNum.setMainWaitAuditSum(mainWaitAuditSum.getMainWaitAuditSum());
+                    }
+                }
+                for (QuUserNum mainWaitPaySum : mainWaitPaySums) {
+                    if (quUserNum.getCompanyId().equals(mainWaitPaySum.getCompanyId())) {
+                        quUserNum.setMainWaitPaySum(mainWaitPaySum.getMainWaitPaySum());
+                    }
+                }
+                for (QuUserNum mainAcceptInsuranceSum : mainAcceptInsuranceSums) {
+                    if (quUserNum.getCompanyId().equals(mainAcceptInsuranceSum.getCompanyId())) {
                         quUserNum.setMainAcceptInsuranceSum(mainAcceptInsuranceSum.getMainAcceptInsuranceSum());
                     }
                 }
             }
         }
+        return deptByCompany;
+    }
+
+
+
+
+
 
-        List<QuUserNum> paginate = paginate(deptByCompany, quUserNumDto.getPageNum(), quUserNumDto.getPageSize());
 
-        // 创建并设置分页信息
-        IPage<QuUserNum> page = new Page<>(quUserNumDto.getPageNum(), quUserNumDto.getPageSize());
-        page.setRecords(paginate);
-        page.setTotal(deptByCompany.size());
-        return page;
-    }
 
     /**
      *  @version

+ 11 - 0
src/main/java/com/ydtech/modules/esm/controller/EsmRetailController.java

@@ -23,6 +23,17 @@ public class EsmRetailController extends BaseController {
     @Autowired
     EsmRetailService esmRetailService;
 
+    /**
+     * 删除信息
+     *
+     * @param id
+     * @return
+     */
+    @GetMapping(value = "/deleteRetail")
+    public HttpResult delete(String id){
+        Integer insert = esmRetailService.delete(id);
+        return insert > 0 ? HttpResult.ok("删除成功", insert) : HttpResult.error("删除失败");
+    }
 
     /**
      * 保存信息

+ 2 - 0
src/main/java/com/ydtech/modules/esm/dao/EsmRetailDao.java

@@ -25,6 +25,8 @@ public interface EsmRetailDao {
 
     public Integer update(EsmRetail model);
 
+    public Integer delete(String id);
+
 //    public Integer updateSelective(EsmRetail model);
 }
 

+ 7 - 0
src/main/java/com/ydtech/modules/esm/dao/impl/EsmRetailDaoImpl.java

@@ -131,6 +131,13 @@ public class EsmRetailDaoImpl implements EsmRetailDao {
         return jdbcTemplate.update(sql, params);
     }
 
+    @Override
+    public Integer delete(String id){
+        String sql = "delete from esm_retail where id=?";
+        JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource);
+        return jdbcTemplate.update(sql, new Object[]{id});
+    }
+
 
 }
 

+ 8 - 2
src/main/java/com/ydtech/modules/fnc/controller/InsPlyIncomeController.java

@@ -91,6 +91,12 @@ public class InsPlyIncomeController extends BaseController {
         List<InsPlyIncome>  result = insPlyIncomeService.totalPinAmount(insPlyIncomeVo);
         return  HttpResult.ok(result);
     }
+    @PostMapping("/bxTotalAmount")
+    @ApiModelProperty(value = "保险手续费合计")
+    public HttpResult<InsPlyIncome>bxTotalPinAmount(@RequestBody @Valid InsPlyIncomeVo insPlyIncomeVo){
+        InsPlyIncome  result = insPlyIncomeService.bxTotalAmount(insPlyIncomeVo);
+        return  HttpResult.ok(result);
+    }
     @PutMapping("/balance")
     @ApiModelProperty(value = "结算手续费")
     public HttpResult<Object> balance(@RequestBody InsPlyIncomeVo insPlyIncomeVo) {
@@ -140,9 +146,9 @@ public class InsPlyIncomeController extends BaseController {
     @ApiImplicitParams({
             @ApiImplicitParam(name = "file", value = "excel文件", required = true, dataType = "__file")
     })
-    public HttpResult importData(@RequestPart MultipartFile file , @RequestBody InsPlyIncomeVo  insPlyIncomeVo ) {
+    public HttpResult importData(@RequestParam MultipartFile MultipartFile) {
 
-        insPlyIncomeService.importData(file,insPlyIncomeVo);
+        insPlyIncomeService.importData(MultipartFile);
 
         return HttpResult.ok("导入成功");
     }

+ 5 - 1
src/main/java/com/ydtech/modules/fnc/dao/InsPlyIncomeMapper.java

@@ -96,5 +96,9 @@ public interface InsPlyIncomeMapper extends BaseMapper<InsPlyIncome> {
     List<InsPlyIncome> allOtherAmount(HashMap<String, Object> params);
 
 
-    InsPlyIncome findByLicenseno(@Param ("licenseno")String licenseno, @Param ("policyno") String policyno, @Param ("syPolicyno") String syPolicyno,@Param ("noPolicyno")   String noPolicyno);
+    List<InsPlyIncome> findByLicenseno(HashMap<String, Object> params);
+
+    InsPlyIncome bxTotalAmount(HashMap<String, Object> params);
+
+
 }

+ 1 - 0
src/main/java/com/ydtech/modules/fnc/entity/InsAreaCompany.java

@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
 import java.io.Serializable;
 import java.math.BigDecimal;
+import java.time.LocalDate;
 import java.time.LocalDateTime;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;

+ 7 - 7
src/main/java/com/ydtech/modules/fnc/entity/InsPlyIncome.java

@@ -128,7 +128,7 @@ public class InsPlyIncome implements Serializable {
 
     @ApiModelProperty("记录插入时间")
     @TableField("create_time")
-    private LocalDateTime createTime;
+    private LocalDate createTime;
 
     @ApiModelProperty("开票时间")
     @TableField("invoic_time")
@@ -136,11 +136,11 @@ public class InsPlyIncome implements Serializable {
 
     @ApiModelProperty("结算日期")
     @TableField("settlement_time")
-    private LocalDateTime settlementTime;
+    private LocalDate settlementTime;
 
     @ApiModelProperty("修改日期")
     @TableField("update_time")
-    private LocalDateTime updateTime;
+    private LocalDate updateTime;
 
     @ApiModelProperty("结算人")
     @TableField("settlement_user_id")
@@ -329,7 +329,7 @@ public class InsPlyIncome implements Serializable {
 
     @ApiModelProperty("跟单费结算金额")
     @TableField(exist = false)
-    private BigDecimal settlementAmount;
+    private BigDecimal settleMentAmount;
 
     @ApiModelProperty("跟单费未结算金额")
     @TableField(exist = false)
@@ -353,7 +353,7 @@ public class InsPlyIncome implements Serializable {
     private String monthSigdate;
 
 
-    @ApiModelProperty("结算手续费")
+    @ApiModelProperty("已开票已结算手续费")
     @TableField(exist = false)
     private BigDecimal readyCommissionFeevalue;
     @ApiModelProperty("未结算跟单费")
@@ -374,7 +374,7 @@ public class InsPlyIncome implements Serializable {
     private String incomeIds;
 
 
-    public InsPlyIncome(String orderno, String policyno, String syPolicyno, String noPolicyno, String settleno, String deptId, String deptName, String riskcode, LocalDateTime payDate, LocalDateTime signDate, String companyId, String companyName, String agreementId, String licenseno, BigDecimal taxamount, BigDecimal noTaxPremium, BigDecimal commissionFeerate, BigDecimal otherFeerate, BigDecimal commissionFeevalue, BigDecimal otherFeevalue, BigDecimal allFeeValue, BigDecimal finalFeeValue, BigDecimal doingFeeValue, LocalDateTime createTime, String voucherNumber, String contractId, String contractFileId, String handlingFeesStatus, String documentaryFeesStatus, String isNotCar, String isNotDocumentary) {
+    public InsPlyIncome(String orderno, String policyno, String syPolicyno, String noPolicyno, String settleno, String deptId, String deptName, String riskcode, LocalDateTime payDate, LocalDateTime signDate, String companyId, String companyName, String agreementId, String licenseno, BigDecimal taxamount, BigDecimal noTaxPremium, BigDecimal commissionFeerate, BigDecimal otherFeerate, BigDecimal commissionFeevalue, BigDecimal otherFeevalue, BigDecimal allFeeValue, BigDecimal finalFeeValue, BigDecimal doingFeeValue, LocalDate createTime, String voucherNumber, String contractId, String contractFileId, String handlingFeesStatus, String documentaryFeesStatus, String isNotCar, String isNotDocumentary) {
         this.orderno = orderno;
         this.policyno = policyno;
         this.syPolicyno = syPolicyno;
@@ -408,6 +408,6 @@ public class InsPlyIncome implements Serializable {
         this.isNotDocumentary = isNotDocumentary;
     }
 
-    public InsPlyIncome(String id, String jqpolicyno, String sypolicyno, Object o, Object o1, String deptId, Object o2, String productid, LocalDateTime payDate, LocalDateTime signingTime, String companyId, Object o3, String agreementId, String licenseno, BigDecimal taxamount, BigDecimal allNoTaxPremium, BigDecimal handlingProportion, Object o4, BigDecimal handlingAmount, BigDecimal handlingAmount1, Object o5, Object o6, LocalDateTime now, Object o7, Object o8, Object o9, String number, String number1, String number2, String number3) {
+    public InsPlyIncome(String id, String jqpolicyno, String sypolicyno, Object o, Object o1, String deptId, Object o2, String productid, LocalDate payDate, LocalDate signingTime, String companyId, Object o3, String agreementId, String licenseno, BigDecimal taxamount, BigDecimal allNoTaxPremium, BigDecimal handlingProportion, Object o4, BigDecimal handlingAmount, BigDecimal handlingAmount1, Object o5, Object o6, LocalDate now, Object o7, Object o8, Object o9, String number, String number1, String number2, String number3) {
     }
 }

+ 4 - 0
src/main/java/com/ydtech/modules/fnc/entity/SettlementDocumentaryFeesEntity.java

@@ -81,6 +81,10 @@ public class SettlementDocumentaryFeesEntity implements Serializable {
     @TableField("ids")
     private String ids;
 
+    @ApiModelProperty("是否是开票 结算")
+    @TableField("settlement_status")
+    private String settlementStatus;
+
 
 
 

+ 3 - 1
src/main/java/com/ydtech/modules/fnc/service/InsPlyIncomeService.java

@@ -45,7 +45,7 @@ public interface InsPlyIncomeService extends IService<InsPlyIncome> {
     HttpResult<List<InsPlyIncome>> nonSettldetail(InsPlyIncomeVo insPlyIncomeVo);
 
 
-    void importData(MultipartFile file, InsPlyIncomeVo insPlyIncomeVo);
+    void importData(MultipartFile MultipartFile);
 
     void updateByEntity(InsPlyIncomeVo insPlyIncomeVo);
 
@@ -79,4 +79,6 @@ public interface InsPlyIncomeService extends IService<InsPlyIncome> {
     HttpResult bxHandlingexcel(InsPlyIncomeVo insPlyIncomeVo, HttpServletRequest request, HttpServletResponse response);
 
     HttpResult bxOtherExcel(InsPlyIncomeVo insPlyIncomeVo, HttpServletRequest request, HttpServletResponse response);
+
+    InsPlyIncome bxTotalAmount(InsPlyIncomeVo insPlyIncomeVo);
 }

+ 2 - 1
src/main/java/com/ydtech/modules/fnc/service/impl/InsFeeAuditServiceImpl.java

@@ -41,6 +41,7 @@ import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
 import java.math.BigDecimal;
+import java.time.LocalDate;
 import java.time.LocalDateTime;
 import java.util.ArrayList;
 import java.util.Date;
@@ -691,7 +692,7 @@ public class InsFeeAuditServiceImpl extends ServiceImpl<InsFeeAuditMapper, InsFe
         insPlyIncome.setLicenseno(order.getLicenseno());
         insPlyIncome.setPayDate(StringUtils.isNullOrEmpty(plyDto.getPayDate())?plyDto.getCreatetime():plyDto.getPayDate());
         insPlyIncome.setSignDate(StringUtils.isNullOrEmpty(plyDto.getInsidePayTime())?plyDto.getPayDate():plyDto.getInsidePayTime());
-        insPlyIncome.setCreateTime(LocalDateTime.now() );
+        insPlyIncome.setCreateTime(LocalDate.now() );
         if(StringUtils.isNotEmpty(plyDto.getJqpolicyno())){
             insPlyIncome.setPolicyno(plyDto.getJqpolicyno());
             insPlyIncome.setRiskcode("交强");

+ 42 - 22
src/main/java/com/ydtech/modules/fnc/service/impl/InsPlyIncomeServiceImpl.java

@@ -174,7 +174,7 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
         insPlyIncome.setAgreementId(insFeeOrderNew.getAgreementId());
         insPlyIncome.setLicenseno(order.getLicenseno());
         insPlyIncome.setTaxamount(insAreaCompany.getTaxamount());
-        insPlyIncome.setCreateTime(LocalDateTime.now());
+        insPlyIncome.setCreateTime(LocalDate.now());
         insPlyIncome.setDocumentaryFeesStatus("0");
         insPlyIncome.setHandlingFeesStatus("0");
         insPlyIncome.setNoNoTaxPremium(insPlyIncome.getNoNoTaxPremium());
@@ -203,7 +203,7 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
         insPlyIncome.setAgreementId(insFeeOrderNew.getAgreementId());
         insPlyIncome.setLicenseno(order.getLicenseno());
         insPlyIncome.setTaxamount(insAreaCompany.getTaxamount());
-        insPlyIncome.setCreateTime(LocalDateTime.now());
+        insPlyIncome.setCreateTime(LocalDate.now());
         insPlyIncome.setDocumentaryFeesStatus("0");
         insPlyIncome.setHandlingFeesStatus("0");
         insPlyIncome.setIsNotCar("1");
@@ -225,7 +225,7 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
 
 
         InsPlyIncome insPlyIncome = new InsPlyIncome(insFeeOrderNew.getId(),insAreaCompany.getJqpolicyno(),insAreaCompany.getSypolicyno(),null,null,insFeeOrderNew.getDeptId(),null,order.getProductid(),insAreaCompany.getPayDate(),insAreaCompany.getSigningTime(),insAreaCompany.getCompanyId(),null,insFeeOrderNew.getAgreementId(),order.getLicenseno(),insAreaCompany.getTaxamount(),
-                allNoTaxPremium,null,otherProportion,null,otherAmount,otherAmount,null,null,LocalDateTime.now(),null,null,null,"0","0","0","1");
+                allNoTaxPremium,null,otherProportion,null,otherAmount,otherAmount,null,null,LocalDate.now(),null,null,null,"0","0","0","1");
 
         insPlyIncome.setTaxPremium(allPremium);
         insPlyIncome.setJqPremium(insFeeOrderNew.getJqPremium());
@@ -248,7 +248,7 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
         BigDecimal handlingProportion = this.calculateTotal(insFeeOrderNew.getJqSuperviseCostsProportion(), insFeeOrderNew.getSySuperviseCostsProportion(),null);
         BigDecimal allNoTaxPremium = this.calculateTotal(insFeeOrderNew.getJqNoTaxPremium(), insFeeOrderNew.getSyNoTaxPremium(), null);//不含税保费
         InsPlyIncome insPlyIncome = new InsPlyIncome(insFeeOrderNew.getId(),insAreaCompany.getJqpolicyno(),insAreaCompany.getSypolicyno(),null,null,insFeeOrderNew.getDeptId(),null,order.getProductid(),insAreaCompany.getPayDate(),insAreaCompany.getSigningTime(),insAreaCompany.getCompanyId(),null,insFeeOrderNew.getAgreementId(),order.getLicenseno(),insAreaCompany.getTaxamount()
-        ,allNoTaxPremium,handlingProportion,null,handlingAmount,null,handlingAmount,null,null,LocalDateTime.now(),null,null,null,"0","0","0","0");
+        ,allNoTaxPremium,handlingProportion,null,handlingAmount,null,handlingAmount,null,null,LocalDate.now(),null,null,null,"0","0","0","0");
         BigDecimal allTaxPremium = this.calculateTotal(insFeeOrderNew.getJqPremium(), insFeeOrderNew.getSyPremium(), null);
         insPlyIncome.setJqPremium(insFeeOrderNew.getJqPremium());
         insPlyIncome.setSyPremium(insFeeOrderNew.getSyPremium());
@@ -309,7 +309,7 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
         InsPlyIncome insPlyIncome = new InsPlyIncome(insFeeOrderNew.getId(),insAreaCompany.getJqpolicyno(),insAreaCompany.getSypolicyno(),
                 noPolicyno,null,insFeeOrderNew.getDeptId(), null,order.getProductid(),insAreaCompany.getPayDate(),insAreaCompany.getSigningTime(),insAreaCompany.getCompanyId(),
                 null,insFeeOrderNew.getAgreementId(),order.getLicenseno(),insAreaCompany.getTaxamount(),allNoTaxPremium,handlingProportion,
-                otherProportion,handlingAmount,otherAmount,allAmount,null,null,LocalDateTime.now(),null,null,null,"0","0","0","0");
+                otherProportion,handlingAmount,otherAmount,allAmount,null,null,LocalDate.now(),null,null,null,"0","0","0","0");
         insPlyIncome.setJqReceivableProportion(jqReceivableProportion);
         insPlyIncome.setSyReceivableProportion(syReceivableProportion);
         insPlyIncome.setNoReceivableProportion(noReceivableProportion);
@@ -411,11 +411,12 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
         InsPlyIncome noTotalAmount =baseMapper.totalAmount(params);
         if(ObjectUtils.isNotEmpty(totalledAmount) && ObjectUtils.isNotEmpty(noTotalAmount)){
             totalledAmount.setReadyTotalFeevalue(noTotalAmount.getTotalFeevalue());
-            totalledAmount.setReadyCommissionFeevalue(noTotalAmount.getReadyCommissionFeevalue());
+            totalledAmount.setReadyCommissionFeevalue(noTotalAmount.getCommissionFeevalue());
             totalledAmount.setReadyOtherFeevalue(noTotalAmount.getOtherFeevalue());
             return totalledAmount;
         }
-        return totalledAmount;
+
+        return  new InsPlyIncome();
     }
 
     @Override
@@ -426,7 +427,7 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
             List<InsPlyIncome> list= this.baseMapper.queryNew(params);
             for (InsPlyIncome item : list) {
                 item.setHandlingFeesStatus("1");
-                item.setSettlementTime(LocalDateTime.now());
+                item.setSettlementTime(LocalDate.now());
                 baseMapper.updateById(item);
             }
             SettlementDocumentaryLogEntity settlementDocumentaryLogEntity = new SettlementDocumentaryLogEntity();
@@ -489,9 +490,6 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
         if(StringUtils.isNotEmpty(insPlyIncomeVo.getNoPolicyno())){
             params.put("noPolicyno",insPlyIncomeVo.getNoPolicyno().split(","));
         }
-        if(insPlyIncomeVo.getSigndate()!=null){
-            params.put("signdate",insPlyIncomeVo.getSigndate());
-        }
         if(insPlyIncomeVo.getCreateTime()!=null){
             params.put("createTime",insPlyIncomeVo.getCreateTime());
         }
@@ -513,6 +511,12 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
         if(StringUtils.isNotEmpty(insPlyIncomeVo.getDay())){
             params.put("day",insPlyIncomeVo.getDay());
         }
+        if(StringUtils.isNotEmpty(insPlyIncomeVo.getSignDateEnd())){
+            params.put("signDateEnd",insPlyIncomeVo.getSignDateEnd());
+        }
+        if(StringUtils.isNotEmpty(insPlyIncomeVo.getSignDateStart())){
+            params.put("signDateStart",insPlyIncomeVo.getSignDateStart());
+        }
         return params;
     }
 
@@ -569,21 +573,28 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
     }
 
     @Override
-    public void importData(MultipartFile file, InsPlyIncomeVo insPlyIncomeVo) {
+    public void importData(MultipartFile MultipartFile) {
         List<InsPlyIncome> list = null;
+        HashMap<String, Object> params = new HashMap<>();
         try {
-            List<InsPlyIncomeExcelDto> dtoList = ExcelEasypoiUtils.importExcel(file, InsPlyIncomeExcelDto.class, 0, 1, 1);
+            List<InsPlyIncomeExcelDto> dtoList = ExcelEasypoiUtils.importExcel(MultipartFile, InsPlyIncomeExcelDto.class, 0, 1, 1);
             for (InsPlyIncomeExcelDto excelItem : dtoList) {
+                params.clear();
                 String licenseno = excelItem.getLicenseno();//车牌号
+                params.put("licenseno",licenseno);
                 String policyno = excelItem.getPolicyno(); //交强保单号
+                params.put("policyno",policyno);
                 String syPolicyno = excelItem.getSyPolicyno(); //商业保单号
+                params.put("syPolicyno",syPolicyno);
                 String noPolicyno = excelItem.getNoPolicyno(); //非车保单号
-
+                params.put("noPolicyno",noPolicyno);
                 if(ObjectUtils.isNotEmpty(licenseno)){
-                    InsPlyIncome insPlyIncome=baseMapper.findByLicenseno(licenseno,policyno,syPolicyno,noPolicyno);
-                    if(ObjectUtils.isNotEmpty(insPlyIncome)){
-                        insPlyIncome.setHandlingFeesStatus("1"); //已结算
-                        baseMapper.updateById(insPlyIncome);
+                    List<InsPlyIncome> insPlyIncome=baseMapper.findByLicenseno(params);
+                    for (InsPlyIncome item : insPlyIncome) {
+                        if(ObjectUtils.isNotEmpty(item)){
+                            item.setHandlingFeesStatus("1"); //已结算
+                            baseMapper.updateById(item);
+                        }
                     }
                 }
             }
@@ -758,7 +769,7 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
                 String id = split[i];
                 InsPlyIncome insPlyIncome = baseMapper.selectById(id);
                 insPlyIncome.setDocumentaryFeesStatus("1"); //1  为跟单费已经结算
-                insPlyIncome.setSettlementTime(LocalDateTime.now());
+                insPlyIncome.setSettlementTime(LocalDate.now());
                 baseMapper.updateById(insPlyIncome);
             }
         }
@@ -781,6 +792,7 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
     public List<InsPlyIncome> totalBxAmount(InsPlyIncomeVo insPlyIncomeVo) {
         HashMap<String, Object> params = new HashMap<>();
         params=this.saveParams(insPlyIncomeVo,params);
+        params.remove("handlingFeesStatus");
         List<InsPlyIncome>  resultList  =  baseMapper.totalBxAmount(params);
         return resultList;
     }
@@ -820,8 +832,8 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
             String[] split = insPlyIncomeVo.getIds().split(",");
             for(String  id : split){
                 insPlyIncome.setId(id);
-                insPlyIncome.setHandlingFeesStatus("2");
-                insPlyIncome.setSettlementTime(LocalDateTime.now());
+                insPlyIncome.setHandlingFeesStatus("1");
+                insPlyIncome.setSettlementTime(LocalDate.now());
                 baseMapper.updateById(insPlyIncome);
             }
 
@@ -865,7 +877,7 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
                 insPlyIncome.setContractId(insPlyIncomeVo.getContractId()); // 合同id
                 insPlyIncome.setContractFileId(insPlyIncomeVo.getContractFileId());
                 insPlyIncome.setVoucherNumber(insPlyIncomeVo.getVoucherNumber());
-                insPlyIncome.setSettlementTime(LocalDateTime.now());
+                insPlyIncome.setSettlementTime(LocalDate.now());
                 baseMapper.updateById(insPlyIncome);
             }
         }
@@ -967,5 +979,13 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
         return HttpResult.ok("",uploadUrl + "excel/" + fileName);
     }
 
+    @Override
+    public InsPlyIncome bxTotalAmount(InsPlyIncomeVo insPlyIncomeVo) {
+        HashMap<String, Object> params = new HashMap<>();
+        params = this.saveParams(insPlyIncomeVo, params);
+        InsPlyIncome totalledAmount =baseMapper.bxTotalAmount(params);  //总金额
+        return totalledAmount;
+    }
+
 
 }

+ 2 - 1
src/main/java/com/ydtech/modules/fnc/service/impl/InsPlyMainServiceImpl.java

@@ -55,6 +55,7 @@ import org.springframework.web.multipart.MultipartFile;
 import javax.servlet.http.HttpServletRequest;
 import java.io.IOException;
 import java.math.BigDecimal;
+import java.time.LocalDate;
 import java.time.LocalDateTime;
 import java.util.ArrayList;
 import java.util.Date;
@@ -188,7 +189,7 @@ public class InsPlyMainServiceImpl extends ServiceImpl<InsPlyMainMapper, InsPlyM
         insPlyIncome.setAgreementId(excelVo.getAgreementId());
         insPlyIncome.setLicenseno(excelVo.getLicenseno());
         insPlyIncome.setPayDate(StringUtils.isNullOrEmpty(excelVo.getPayDate())?excelVo.getCreatetime():excelVo.getPayDate());
-        insPlyIncome.setCreateTime(LocalDateTime.now() );
+        insPlyIncome.setCreateTime(LocalDate.now() );
         insPlyIncome.setPolicyno(excelVo.getPolicyno());
         insPlyIncome.setRiskcode(excelVo.getRiskcode());
         insPlyIncome.setTaxamount(excelVo.getTaxamount());

+ 58 - 3
src/main/java/com/ydtech/modules/fnc/vo/InsPlyIncomeVo.java

@@ -49,9 +49,9 @@ public class InsPlyIncomeVo implements Serializable {
     private LocalDate endDate;
 
 
-    @ApiModelProperty(value = "签单日期")
-    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
-    private LocalDate signdate;
+//    @ApiModelProperty(value = "签单日期")
+//    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+//    private LocalDate signdate;
 
     @ApiModelProperty(value = "创建日期")
     @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@@ -183,4 +183,59 @@ public class InsPlyIncomeVo implements Serializable {
 
     @ApiModelProperty("开票ids")
     private String incomeIds;
+
+    @ApiModelProperty("手续费比例")
+    private BigDecimal commissionFeerate;
+
+    @ApiModelProperty("交强手续费比例")
+    private BigDecimal jqSuperviseCostsProportion;
+
+    @ApiModelProperty("商业手续费比例")
+    private BigDecimal sySuperviseCostsProportion;
+
+    @ApiModelProperty("应收金额")
+    private BigDecimal receivableAmount;
+
+    @ApiModelProperty("应收金额")
+    private BigDecimal allFeeValue;
+
+    @ApiModelProperty(value = "签单结束日期")
+    private String signDateEnd;
+    @ApiModelProperty(value = "签单开始日期")
+    private String signDateStart;
+
+    @ApiModelProperty("交强险含税保费")
+    private BigDecimal jqPremium;
+
+
+
+    @ApiModelProperty("商业险含保费")
+    private BigDecimal syPremium;
+
+
+    @ApiModelProperty("非车险含保费")
+    private BigDecimal noPremium;
+
+    @ApiModelProperty("交强险不含税保费")
+    private BigDecimal jqNoTaxPremium;
+
+    @ApiModelProperty("商业险不含税保费")
+    private BigDecimal syNoTaxPremium;
+
+
+    @ApiModelProperty("非车险不含税保费")
+    private BigDecimal noNoTaxPremium;
+
+    @ApiModelProperty("交强跟单比例")
+    private BigDecimal jqOtherCostsProportion;
+
+    @ApiModelProperty("商业跟单比例")
+    private BigDecimal syOtherCostsProportion;
+
+    @ApiModelProperty("交强跟单金额")
+    private BigDecimal jqOtherCostsPremium;
+
+    @ApiModelProperty("商业跟单金额")
+    private BigDecimal syOtherCostsPremium;
+
 }

+ 2 - 2
src/main/java/com/ydtech/modules/inv/controller/InvReceivableController.java

@@ -241,11 +241,11 @@ public class InvReceivableController extends BaseController {
 
     @GetMapping("getAccountsReceivable")
     public HttpResult getAccountsReceivable(){
-        return HttpResult.ok("下载成功","template/finance/accountsReceivable.xlsx");
+        return HttpResult.ok("下载成功","/template/finance/accountsReceivable.xlsx");
     }
 
     @GetMapping("/getSettlement")
     public HttpResult getSettlement(){
-       return HttpResult.ok("下载成功","template/finance/settlement.xlsx");
+       return HttpResult.ok("下载成功","/template/finance/settlement.xlsx");
     }
 }

+ 9 - 7
src/main/java/com/ydtech/modules/inv/controller/invAccountExcelController.java

@@ -3,15 +3,14 @@ package com.ydtech.modules.inv.controller;
 import com.alibaba.fastjson.JSONObject;
 import com.ydtech.constants.enums.inv.InvPayMethodEnum;
 import com.ydtech.core.page.HttpResult;
-import com.ydtech.core.page.PageResult;
 import com.ydtech.exception.SystemException;
 import com.ydtech.modules.base.controller.BaseController;
 import com.ydtech.modules.inv.dao.InvAccountExcelMapper;
+import com.ydtech.modules.inv.dao.InvAccountOperateMapper;
 import com.ydtech.modules.inv.model.InvAccountExcel;
+import com.ydtech.modules.inv.model.InvAccountOperate;
 import com.ydtech.modules.inv.model.excel.InvDisburseExcel;
-import com.ydtech.modules.inv.model.po.InvSettlementSource;
-import com.ydtech.modules.inv.model.vo.InvAccountExcelVo;
-import com.ydtech.modules.inv.model.vo.InvSettlementSourceQueryVo;
+import com.ydtech.modules.inv.model.vo.InvAccountOperateVo;
 import com.ydtech.modules.inv.service.InvAccountExcelService;
 import com.ydtech.modules.inv.utils.EasyExcelUtils;
 import io.swagger.annotations.Api;
@@ -44,6 +43,9 @@ public class invAccountExcelController {
     @Resource
     private InvAccountExcelMapper invAccountExcelMapper;
 
+    @Resource
+    private InvAccountOperateMapper invAccountOperateMapper;
+
     @Value("${upload.file.path}")
     private String uploadPath;
 
@@ -59,7 +61,7 @@ public class invAccountExcelController {
     @PostMapping("deriveReport")
     @ApiOperation("导出支出报表")
     public HttpResult deriveReport(@RequestBody List<String> idList) throws IOException {
-        List<InvAccountExcel> insAccountExcels = invAccountExcelMapper.selectBatchIds(idList);
+        List<InvAccountOperate> insAccountExcels = invAccountOperateMapper.selectBatchIds(idList);
         String uploadPath = this.uploadPath + "/excel/";
         Path path = Paths.get(uploadPath);
         if (!Files.exists(path)) {
@@ -151,8 +153,8 @@ public class invAccountExcelController {
 
     @ApiOperation("支出报表查看")
     @PostMapping("getDisburse")
-    public HttpResult getDisburse(@RequestBody InvAccountExcelVo invAccountExcelVo) {
-        return invAccountExcelService.selectDisburse(invAccountExcelVo);
+    public HttpResult getDisburse(@RequestBody InvAccountOperateVo invAccountOperateVo) {
+        return invAccountExcelService.selectDisburse(invAccountOperateVo);
     }
 
 

+ 2 - 2
src/main/java/com/ydtech/modules/inv/dao/InvAccountExcelMapper.java

@@ -5,7 +5,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.ydtech.modules.inv.model.InvAccountExcel;
-import com.ydtech.modules.inv.model.vo.InvAccountExcelVo;
+import com.ydtech.modules.inv.model.vo.InvAccountOperateVo;
 import org.apache.ibatis.annotations.Param;
 
 /**
@@ -17,7 +17,7 @@ import org.apache.ibatis.annotations.Param;
 public interface InvAccountExcelMapper extends BaseMapper<InvAccountExcel> {
     IPage<InvAccountExcel> selectExcelAccount(Page page, @Param("insAccountExcel") InvAccountExcel insAccountExcel);
 
-    IPage<InvAccountExcelVo> selectDisburse(Page page, @Param("insAccountExcel") InvAccountExcelVo insAccountExcelVo);
+    IPage<InvAccountOperateVo> selectDisburse(Page page, @Param("inAccountOperateVo") InvAccountOperateVo invAccountOperateVo);
 }
 
 

+ 3 - 3
src/main/java/com/ydtech/modules/inv/model/InvAccountOperate.java

@@ -60,7 +60,7 @@ public class InvAccountOperate implements Serializable {
 
 
     @ApiModelProperty("无需传递")
-    @ExcelProperty("板块")
+//    @ExcelProperty("板块")
     @TableField(exist = false)
     private String plate;
 
@@ -81,7 +81,7 @@ public class InvAccountOperate implements Serializable {
      * 资金流向
      */
     @ApiModelProperty(value = "资金流向")
-    @ExcelProperty("资金流向")
+//    @ExcelProperty("资金流向")
     private String fundFlow;
 
     /**
@@ -102,7 +102,7 @@ public class InvAccountOperate implements Serializable {
     private String fundUse;
 
     @ApiModelProperty("资金用途分项")
-    @ExcelProperty("分项")
+//    @ExcelProperty("分项")
     private String fundFen;
 
     /**

+ 3 - 3
src/main/java/com/ydtech/modules/inv/model/excel/InvDisburseExcel.java

@@ -10,10 +10,10 @@ import java.util.Date;
 
 @Data
 public class InvDisburseExcel implements Serializable {
-    @ExcelProperty("日期")
-    @ApiModelProperty(value = "申请时间")
+    @ExcelProperty("转账日期")
+    @ApiModelProperty(value = "转账日期")
     @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
-    private Date applyTime;
+    private String createTime;
 
     @ExcelProperty("费用类型")
     @ApiModelProperty(value = "资金用途")

+ 12 - 14
src/main/java/com/ydtech/modules/inv/model/vo/InvAccountExcelVo.java → src/main/java/com/ydtech/modules/inv/model/vo/InvAccountOperateVo.java

@@ -6,21 +6,18 @@ import com.fasterxml.jackson.annotation.JsonFormat;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
-import javax.validation.constraints.NotBlank;
 import java.io.Serializable;
 import java.util.Date;
 
 @Data
-public class InvAccountExcelVo implements Serializable {
+public class InvAccountOperateVo implements Serializable {
+    @ApiModelProperty(value = "转账记录id")
+    private String accountOperateId;
 
-    @ApiModelProperty(value = "资金申请表id")
-    private String excelAccountOperateId;
-
-    @ExcelProperty("日期")
-    @ApiModelProperty(value = "申请时间")
+    @ExcelProperty("转账日期")
+    @ApiModelProperty(value = "转账时间")
     @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
-    @NotBlank
-    private Date applyTime;
+    private Date createTime;
 
     @ExcelProperty("费用类型")
     @ApiModelProperty(value = "资金用途")
@@ -49,18 +46,19 @@ public class InvAccountExcelVo implements Serializable {
     @ApiModelProperty(value = "收款单位信息")
     private String collectionMessage;
 
+    /**
+     * 转账时间开始
+     */
     @ApiModelProperty(value = "申请时间起")
-    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
     @TableField(exist = false)
-    private Date applyTimeStart;
+    private String createTimeStart;
 
     /**
-     * 申请时间止
+     * 转账时间结束
      */
     @ApiModelProperty(value = "申请时间止")
-    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
     @TableField(exist = false)
-    private Date applyTimeEnd;
+    private String createTimeEnd;
 
     private int pageNum;
 

+ 2 - 2
src/main/java/com/ydtech/modules/inv/service/InvAccountExcelService.java

@@ -4,7 +4,7 @@ package com.ydtech.modules.inv.service;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.ydtech.core.page.HttpResult;
 import com.ydtech.modules.inv.model.InvAccountExcel;
-import com.ydtech.modules.inv.model.vo.InvAccountExcelVo;
+import com.ydtech.modules.inv.model.vo.InvAccountOperateVo;
 
 import java.util.List;
 
@@ -18,7 +18,7 @@ public interface InvAccountExcelService extends IService<InvAccountExcel> {
 
     HttpResult selectAccountExcel(InvAccountExcel invAccountExcel);
 
-    HttpResult selectDisburse(InvAccountExcelVo InvAccountExcelVo);
+    HttpResult selectDisburse(InvAccountOperateVo invAccountOperateVo);
 
     HttpResult updateTransferFlag(String excelAccountOperateId);
 

+ 4 - 11
src/main/java/com/ydtech/modules/inv/service/impl/InvAccountExcelServiceImpl.java

@@ -1,7 +1,6 @@
 package com.ydtech.modules.inv.service.impl;
 
 
-import com.alibaba.excel.util.WorkBookUtil;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -10,16 +9,11 @@ import com.ydtech.constants.enums.inv.InvPayMethodEnum;
 import com.ydtech.core.page.HttpResult;
 import com.ydtech.core.page.PageRequest;
 import com.ydtech.exception.SystemException;
-import com.ydtech.modules.base.controller.BaseController;
 import com.ydtech.modules.inv.dao.InvAccountExcelMapper;
 import com.ydtech.modules.inv.model.*;
-import com.ydtech.modules.inv.model.vo.InvAccountExcelVo;
+import com.ydtech.modules.inv.model.vo.InvAccountOperateVo;
 import com.ydtech.modules.inv.service.*;
 import com.ydtech.modules.inv.utils.EasyExcelUtils;
-import org.apache.poi.ss.usermodel.Row;
-import org.apache.poi.ss.usermodel.Sheet;
-import org.apache.poi.ss.usermodel.Workbook;
-import org.apache.poi.xssf.usermodel.XSSFWorkbook;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
@@ -107,10 +101,9 @@ public class InvAccountExcelServiceImpl extends ServiceImpl<InvAccountExcelMappe
     }
 
     //支出报表查看
-    @Override
-    public HttpResult selectDisburse(InvAccountExcelVo invAccountExcelVo){
-        Page<InvAccountExcelVo> page = new Page<>(invAccountExcelVo.getPageNum(), invAccountExcelVo.getPageSize());
-        IPage<InvAccountExcelVo> invAccountExcelIPage = insAccountExcelMapper.selectDisburse(page, invAccountExcelVo);
+    public HttpResult selectDisburse(InvAccountOperateVo invAccountOperateVo){
+        Page<InvAccountOperateVo> page = new Page<>(invAccountOperateVo.getPageNum(), invAccountOperateVo.getPageSize());
+        IPage<InvAccountOperateVo> invAccountExcelIPage = insAccountExcelMapper.selectDisburse(page, invAccountOperateVo);
         return HttpResult.ok("", invAccountExcelIPage);
     }
 

+ 20 - 9
src/main/java/com/ydtech/modules/order/aop/aspect/QuoteVerificationAspect.java

@@ -6,13 +6,15 @@ import com.ydtech.constants.enums.dict.InsOrderStatusEnum;
 import com.ydtech.constants.enums.dict.agreement.ProductsType;
 import com.ydtech.constants.sys.SystemConstant;
 import com.ydtech.core.page.HttpResult;
+import com.ydtech.modules.admin.model.SysUser;
 import com.ydtech.modules.admin.model.SysUserRole;
 import com.ydtech.modules.admin.service.SysUserRoleService;
+import com.ydtech.modules.admin.service.SysUserService;
 import com.ydtech.modules.base.controller.BaseController;
-import com.ydtech.modules.fee.service.CostsCalcService;
-import com.ydtech.modules.fee.service.FeeRuleSchemeNewService;
 import com.ydtech.modules.esm.model.EsmInsCompany;
 import com.ydtech.modules.esm.service.EsmInsCompanyService;
+import com.ydtech.modules.fee.service.CostsCalcService;
+import com.ydtech.modules.fee.service.FeeRuleSchemeNewService;
 import com.ydtech.modules.ins.model.vo.KindInfoVo;
 import com.ydtech.modules.ins.model.vo.QuoteRespVo;
 import com.ydtech.modules.ins.model.vo.RiskInfoVo;
@@ -22,9 +24,9 @@ import com.ydtech.modules.order.entity.InsAreaCompanyAccidentalDriving;
 import com.ydtech.modules.order.entity.InsOrders;
 import com.ydtech.modules.order.entity.vo.BaseQuoteInfoVo;
 import com.ydtech.modules.order.entity.vo.BaseQuoteVo;
-import com.ydtech.modules.order.service.InsAreaCompanyService;
 import com.ydtech.modules.order.entity.vo.SubOrderExportFeeVo;
 import com.ydtech.modules.order.service.InsAreaCompanyAccidentalDrivingService;
+import com.ydtech.modules.order.service.InsAreaCompanyService;
 import com.ydtech.modules.order.service.InsOrdersService;
 import com.ydtech.modules.protocol.service.PtlAgreementDeptService;
 import com.ydtech.modules.protocol.service.impl.TaxSourceServiceImpl;
@@ -71,6 +73,9 @@ public class QuoteVerificationAspect {
 
     private final InsFeeOrderNewService insFeeOrderNewService;
 
+
+    private final SysUserService sysUserService;
+
     @AfterReturning(pointcut = "@annotation(com.ydtech.modules.order.aop.QuoteVerification)", returning = "result")
     public void doAfter(HttpResult<QuoteRespVo> result){
         //计算费用因子
@@ -112,13 +117,19 @@ public class QuoteVerificationAspect {
                 String agreementId = ((BaseQuoteVo<?>) arg).getAgreementId();
                 String orderno = ((BaseQuoteVo<?>) arg).getOrderNo();
                 String deptId = ((BaseQuoteVo<?>) arg).getDeptId();
-
-                // 判断协议是否可以报价(代客录单时,机构需要传过来 没传为空时,为车险录单进来的 直接取登录用户机构即可)
-                if (StringUtils.isEmpty(deptId)) {
-                    deptId = new BaseController().getDeptId();
+                String userId = ((BaseQuoteVo<?>) arg).getUserId();
+                //待客录单传入userId
+                if(StringUtils.isNotEmpty(userId)){
+                     //通过用户id查询所在的机构
+                    SysUser user = sysUserService.getById(userId);
+                    deptId=user.getDeptId();
+                }else{
+                    // 判断协议是否可以报价(代客录单时,机构需要传过来 没传为空时,为车险录单进来的 直接取登录用户机构即可)
+                    //if (StringUtils.isEmpty(deptId)) {
+                        deptId = new BaseController().getDeptId();
+                    //}
+                    userId = new BaseController().getUserId();
                 }
-                String userId = new BaseController().getUserId();
-
                 //税源查询
                 BaseQuoteInfoVo quoteInfo = insOrdersComponents.getQuoteInfo(orderno, agreementId);
                 String productid ;

+ 4 - 0
src/main/java/com/ydtech/modules/order/entity/InsOrders.java

@@ -239,6 +239,10 @@ public class InsOrders implements Serializable {
     private String agreementCode;   //协议code
     @TableField(exist = false)
     private String agreementName;   //协议名称
+
+    @TableField(exist = false)
+    private String partnerCompaniesName;   //合作公司简称
+
     public InsOrders(SysUser user, SysDept dept, BaseQuoteInfoVo quoteInfoVo) {
         // 2. 组装订单
         this.setQuoteno(String.valueOf(quoteInfoVo.getQuoteno()));

+ 3 - 0
src/main/java/com/ydtech/modules/order/entity/vo/BaseQuoteVo.java

@@ -46,4 +46,7 @@ public class BaseQuoteVo<T> {
     @ApiModelProperty("上一次订单号")
     private String lastCompanyId;
 
+    @ApiModelProperty("用户id")
+    private String  userId;
+
 }

+ 18 - 1
src/main/java/com/ydtech/modules/order/service/impl/InsOrdersServiceImpl.java

@@ -748,9 +748,26 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
         if (null == orderAndAreaCompany.getFeeStatus()) orderAndAreaCompany.setFeeStatus("0");
 
         //获取出单员地区信息
-
+        //add by  hxl  添加手机号只显示最后四位
+        orderAndAreaCompany.setOwnerinfo(setNewPhone(orderAndAreaCompany.getOwnerinfo()));
+        orderAndAreaCompany.setApplyinfo(setNewPhone(orderAndAreaCompany.getApplyinfo()));
+        orderAndAreaCompany.setInsureinfo(setNewPhone(orderAndAreaCompany.getInsureinfo()));
         return HttpResult.ok("success", orderAndAreaCompany);
     }
+    /**
+     *  @version
+     *  @author: hxl
+     *  @Date: 2024/5/6 11:55
+     *  @Description: 只显示手机号后4位
+     */
+    private static JSONObject setNewPhone(JSONObject ownerinfo) {
+        if(ownerinfo !=null ){
+            String phone = ownerinfo.getString("mobile")==null?"": ownerinfo.getString("mobile");
+            phone = phone.replaceAll("\\d{7}(\\d{4})", "*******$1");
+            ownerinfo.put("mobile",phone);
+        }
+        return ownerinfo;
+    }
 
     @Override
     public InsOrdersEditingVo revise(String orderNo) {

+ 5 - 1
src/main/java/com/ydtech/modules/protocols/dao/PtlAgreementProductCostsNewMapper.java

@@ -1,8 +1,12 @@
 package com.ydtech.modules.protocols.dao;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.ydtech.modules.protocols.entity.po.PtlAgreementProductCostsNew;
 import com.ydtech.modules.protocols.entity.po.PtlAgreementUndwrtRulesAttr;
+import com.ydtech.modules.protocols.entity.vo.AgreementProductCosts;
+import com.ydtech.modules.protocols.entity.vo.AgreementProductQueryVo;
+import org.apache.ibatis.annotations.Param;
 
 
 /**
@@ -11,7 +15,7 @@ import com.ydtech.modules.protocols.entity.po.PtlAgreementUndwrtRulesAttr;
  * @createDate 2024-2-22 15:44:29
  */
 public interface PtlAgreementProductCostsNewMapper extends BaseMapper<PtlAgreementProductCostsNew> {
-
+    Page<PtlAgreementProductCostsNew> getCostsPage(Page page,@Param("params") AgreementProductQueryVo agreementProductQueryVo);
 }
 
 

+ 8 - 0
src/main/java/com/ydtech/modules/protocols/entity/po/PtlAgreementProductCostsNew.java

@@ -26,6 +26,14 @@ public class PtlAgreementProductCostsNew {
     @TableId(value = "id",type= IdType.AUTO)
     private String id;
 
+    @ApiModelProperty(value = "保险公司名称")
+    @TableField(exist = false)
+    private String insuranceCompany;
+
+    @ApiModelProperty(value = "协议名称")
+    @TableField(exist = false)
+    private String agreementName;
+
     @ApiModelProperty(value = "协议id")
     @TableField(value = "agreement_id")
     private String agreementId;

+ 3 - 0
src/main/java/com/ydtech/modules/protocols/entity/vo/AgreementProductQueryVo.java

@@ -11,6 +11,9 @@ public class AgreementProductQueryVo extends PageRequest {
     @ApiModelProperty(value = "保险公司id")
     private String companyId;
 
+    @ApiModelProperty(value = "协议ids")
+    private String agreementIds;
+
     @ApiModelProperty(value = "协议id")
     private String agreementId;
 

+ 8 - 26
src/main/java/com/ydtech/modules/protocols/service/impl/PtlAgreementProductCostsNewServiceImpl.java

@@ -78,6 +78,9 @@ public class PtlAgreementProductCostsNewServiceImpl extends ServiceImpl<PtlAgree
     @Autowired
     PtlAgreementProductCostsTrajectoryService ptlAgreementProductCostsTrajectoryService;
 
+    @Autowired
+    PtlAgreementProductCostsNewService ptlAgreementProductCostsNewService;
+
     @Override
     public Page<PtlAgreementProductCostsNew> getByAgreementId(Page page, AgreementProductQueryVo agreementProductQueryVo) {
         LambdaQueryWrapper<PtlAgreementProductCostsNew> ptlAgreementProductCostsNewLambdaQueryWrapper = new LambdaQueryWrapper<>();
@@ -1206,40 +1209,19 @@ public class PtlAgreementProductCostsNewServiceImpl extends ServiceImpl<PtlAgree
     public Page<PtlAgreementProductCostsNew> getCostsAuditList(Page page, AgreementProductQueryVo agreementProductQueryVo){
         LambdaQueryWrapper<PtlAgreementProductCostsNew> ptlAgreementProductCostsNewLambdaQueryWrapper = new LambdaQueryWrapper<>();
 //        ptlAgreementProductCostsNewLambdaQueryWrapper.eq(PtlAgreementProductCostsNew::getAgreementId, agreementProductQueryVo.getAgreementId());
+
+
         //保险公司id
         if(agreementProductQueryVo.getCompanyId() != null){
-            LambdaQueryWrapper<PtlAgreement> eq = new LambdaQueryWrapper<PtlAgreement>().eq(PtlAgreement::getPartnerCompaniesId, agreementProductQueryVo.getCompanyId());
+            LambdaQueryWrapper<PtlAgreement> eq = new LambdaQueryWrapper<PtlAgreement>().eq(PtlAgreement::getInsuranceCompanyId, agreementProductQueryVo.getCompanyId());
             List<PtlAgreement> list = ptlAgreementService.list(eq);
             List<String> agreementIds = list.stream().map(PtlAgreement::getId).collect(Collectors.toList());
             ptlAgreementProductCostsNewLambdaQueryWrapper.in(PtlAgreementProductCostsNew::getAgreementId, agreementIds);
+            agreementProductQueryVo.setAgreementIds(String.join(",",agreementIds));
         }
 
-        //协议id
-        if(agreementProductQueryVo.getAgreementId() != null){
-            ptlAgreementProductCostsNewLambdaQueryWrapper.eq(PtlAgreementProductCostsNew::getAgreementId,agreementProductQueryVo.getAgreementId());
-        }
-        //审核条件
-        if(agreementProductQueryVo.getIsAudit() != null){
-            ptlAgreementProductCostsNewLambdaQueryWrapper.eq(PtlAgreementProductCostsNew::getIsAudit, Integer.parseInt(agreementProductQueryVo.getIsAudit()));
-        }else{
-            ptlAgreementProductCostsNewLambdaQueryWrapper.eq(PtlAgreementProductCostsNew::getIsAudit,"0");
-        }
-
-        //产品code
-        if(agreementProductQueryVo.getProductCode() != null){
-            ptlAgreementProductCostsNewLambdaQueryWrapper.eq(PtlAgreementProductCostsNew::getProductId, agreementProductQueryVo.getProductCode());
-        }
-
-        //创建时间
-        if(agreementProductQueryVo.getCreateStartTime() != null)
-        {
-            ptlAgreementProductCostsNewLambdaQueryWrapper.between(PtlAgreementProductCostsNew::getCreateTime,agreementProductQueryVo.getCreateStartTime(),agreementProductQueryVo.getCreateEndTime());
-        }
-
-        Page<PtlAgreementProductCostsNew> pages = baseMapper.selectPage(page, ptlAgreementProductCostsNewLambdaQueryWrapper);
+        Page<PtlAgreementProductCostsNew> pages = baseMapper.getCostsPage(page, agreementProductQueryVo);
 
-//                .lt(PtlAgreementProductCostsNew::getCostsStartDate, formattedDateTime)
-//                .gt(PtlAgreementProductCostsNew::getCostsEndDate, formattedDateTime));
         //遍历费用列表
         List<String> ids = new ArrayList<>();
         pages.getRecords().forEach(x -> {

+ 60 - 35
src/main/resources/mapper/modules/admin/SysUserMapper.xml

@@ -179,6 +179,7 @@
         SELECT
         su.id as userId,
         su.name,
+        su.position_name,
         info.sex,
         su.mobile,
         su.status,
@@ -413,16 +414,37 @@
         SUBSTRING(io.userid, 3, #{quUserNumDto.grouping})
     </select>
 
-    <select id="getMainOrderDetails" resultType="com.ydtech.modules.admin.model.QuUserNum">
+    <select id="getMainWaitAuditSum" resultType="com.ydtech.modules.admin.model.QuUserNum">
         SELECT
-            SUBSTRING(io.userid, 3, #{quUserNumDto.grouping}) AS areacode,
-            SUM(CASE WHEN io.orderstatus = 1 THEN 1 ELSE 0 END) AS mainWaitAuditSum,
-            SUM(CASE WHEN io.orderstatus = 2 THEN 1 ELSE 0 END) AS mainWaitPaySum,
-            SUM(CASE WHEN io.orderstatus = 3 THEN 1 ELSE 0 END) AS mainAcceptInsuranceSum
+        SUBSTRING(io.userid, 3, #{quUserNumDto.grouping}) AS areacode,
+        SUM(CASE WHEN io.orderstatus = 1 THEN 1 ELSE 0 END) AS mainWaitAuditSum
+        FROM
+        ins_orders io
+        RIGHT JOIN ins_area_company iac ON iac.orderno = io.orderno
+        WHERE
+        iac.orderstatus IN (1)
+        <if test="quUserNumDto.createTimeStart != null and quUserNumDto.createTimeEnd != null">
+            and io.createtime BETWEEN #{quUserNumDto.createTimeStart} AND #{quUserNumDto.createTimeEnd}
+        </if>
+        <if test="quUserNumDto.userIds != null">
+            and io.userid IN
+            <foreach collection="quUserNumDto.userIds" item="id" index="index" open="(" close=")" separator=",">
+                #{id}
+            </foreach>
+        </if>
+        GROUP BY
+        SUBSTRING(io.userid, 3, #{quUserNumDto.grouping})
+    </select>
+
+    <select id="getMainWaitPaySum" resultType="com.ydtech.modules.admin.model.QuUserNum">
+        SELECT
+        SUBSTRING(io.userid, 3, #{quUserNumDto.grouping}) AS areacode,
+        SUM(CASE WHEN io.orderstatus = 2 THEN 1 ELSE 0 END) AS mainWaitPaySum
         FROM
-            ins_orders io
+        ins_orders io
+        RIGHT JOIN ins_area_company iac ON iac.orderno = io.orderno
         WHERE
-            io.orderstatus IN (1,2,3)
+        iac.orderstatus IN (2)
         <if test="quUserNumDto.createTimeStart != null and quUserNumDto.createTimeEnd != null">
             and io.createtime BETWEEN #{quUserNumDto.createTimeStart} AND #{quUserNumDto.createTimeEnd}
         </if>
@@ -433,7 +455,29 @@
             </foreach>
         </if>
         GROUP BY
-            SUBSTRING(io.userid, 3, #{quUserNumDto.grouping})
+        SUBSTRING(io.userid, 3, #{quUserNumDto.grouping})
+    </select>
+
+    <select id="getMainAcceptInsuranceSum" resultType="com.ydtech.modules.admin.model.QuUserNum">
+        SELECT
+        SUBSTRING(io.userid, 3, #{quUserNumDto.grouping}) AS areacode,
+        SUM(CASE WHEN io.orderstatus = 3 THEN 1 ELSE 0 END) AS mainAcceptInsuranceSum
+        FROM
+        ins_orders io
+        RIGHT JOIN ins_area_company iac ON iac.orderno = io.orderno
+        WHERE
+        iac.orderstatus IN (3)
+        <if test="quUserNumDto.createTimeStart != null and quUserNumDto.createTimeEnd != null">
+            and io.createtime BETWEEN #{quUserNumDto.createTimeStart} AND #{quUserNumDto.createTimeEnd}
+        </if>
+        <if test="quUserNumDto.userIds != null">
+            and io.userid IN
+            <foreach collection="quUserNumDto.userIds" item="id" index="index" open="(" close=")" separator=",">
+                #{id}
+            </foreach>
+        </if>
+        GROUP BY
+        SUBSTRING(io.userid, 3, #{quUserNumDto.grouping})
     </select>
 
     <select id="getUserByCompany" resultType="com.ydtech.modules.admin.model.QuUserNum">
@@ -452,7 +496,7 @@
         SUM(CASE WHEN iac.orderstatus = 3 THEN iac.jqpremium ELSE 0 END + CASE WHEN iac.orderstatus = 3 THEN iac.sypremium ELSE 0 END) AS totalSumpremium
         FROM
         ins_orders io
-        LEFT JOIN ins_area_company iac ON iac.orderno = io.orderno
+        RIGHT JOIN ins_area_company iac ON iac.orderno = io.orderno
         WHERE
         iac.orderstatus IN ( 0, 1, 2, 3, 4 )
         <if test="quUserNumDto.createTimeStart != null and quUserNumDto.createTimeEnd != null">
@@ -476,7 +520,7 @@
         SUM(CASE WHEN io.orderstatus = 1 THEN 1 ELSE 0 END) AS mainWaitAuditSum
         FROM
         ins_orders io
-        LEFT JOIN ins_area_company iac ON iac.orderno = io.orderno
+        RIGHT JOIN ins_area_company iac ON iac.orderno = io.orderno
         WHERE
         iac.orderstatus IN (1)
         <if test="quUserNumDto.createTimeStart != null and quUserNumDto.createTimeEnd != null">
@@ -500,7 +544,7 @@
         SUM(CASE WHEN io.orderstatus = 2 THEN 1 ELSE 0 END) AS mainWaitPaySum
         FROM
         ins_orders io
-        LEFT JOIN ins_area_company iac ON iac.orderno = io.orderno
+        RIGHT JOIN ins_area_company iac ON iac.orderno = io.orderno
         WHERE
         iac.orderstatus IN (2)
         <if test="quUserNumDto.createTimeStart != null and quUserNumDto.createTimeEnd != null">
@@ -525,7 +569,7 @@
         SUM(CASE WHEN io.orderstatus = 3 THEN 1 ELSE 0 END) AS mainAcceptInsuranceSum
         FROM
         ins_orders io
-        LEFT JOIN ins_area_company iac ON iac.orderno = io.orderno
+        RIGHT JOIN ins_area_company iac ON iac.orderno = io.orderno
         WHERE
         iac.orderstatus IN (3)
         <if test="quUserNumDto.createTimeStart != null and quUserNumDto.createTimeEnd != null">
@@ -546,8 +590,6 @@
         SELECT
         io.userid,
         io.username,
-        iac.company_id as companyId,
-        iac.inscompany as insCompany,
         COUNT(*) AS quoteNum,
         SUM(CASE WHEN iac.orderstatus = 2 THEN 1 ELSE 0 END + CASE WHEN iac.orderstatus = 1 THEN 1 ELSE 0 END) AS submitNum,
         SUM(CASE WHEN iac.orderstatus = 3 THEN 1 ELSE 0 END) AS hasInsuredNum,
@@ -574,18 +616,13 @@
         </if>
         GROUP BY
         io.userid,
-        io.username,
-        iac.company_id,
-        iac.inscompany
+        io.username
     </select>
 
     <select id="getUserMainWaitAuditSum" resultType="com.ydtech.modules.admin.model.QuUserNum">
         SELECT
         io.userid,
         io.username,
-        iac.company_id as companyId,
-        iac.inscompany as insCompany,
-        COUNT(*) AS quoteNum,
         SUM(CASE WHEN io.orderstatus = 1 THEN 1 ELSE 0 END) AS mainWaitAuditSum
         FROM
         ins_orders io
@@ -603,18 +640,13 @@
         </if>
         GROUP BY
         io.userid,
-        io.username,
-        iac.company_id,
-        iac.inscompany
+        io.username
     </select>
 
     <select id="getUserMainWaitPaySum" resultType="com.ydtech.modules.admin.model.QuUserNum">
         SELECT
         io.userid,
         io.username,
-        iac.company_id as companyId,
-        iac.inscompany as insCompany,
-        COUNT(*) AS quoteNum,
         SUM(CASE WHEN io.orderstatus = 2 THEN 1 ELSE 0 END) AS mainWaitPaySum
         FROM
         ins_orders io
@@ -632,9 +664,7 @@
         </if>
         GROUP BY
         io.userid,
-        io.username,
-        iac.company_id,
-        iac.inscompany
+        io.username
     </select>
 
 
@@ -642,9 +672,6 @@
         SELECT
         io.userid,
         io.username,
-        iac.company_id as companyId,
-        iac.inscompany as insCompany,
-        COUNT(*) AS quoteNum,
         SUM(CASE WHEN io.orderstatus = 3 THEN 1 ELSE 0 END) AS mainAcceptInsuranceSum
         FROM
         ins_orders io
@@ -662,9 +689,7 @@
         </if>
         GROUP BY
         io.userid,
-        io.username,
-        iac.company_id,
-        iac.inscompany
+        io.username
     </select>
 
     <select id="getAllUsersByHospitality" resultType="com.ydtech.modules.admin.model.vo.SysUserBaseVO">

+ 131 - 128
src/main/resources/mapper/modules/fnc/InsPlyIncomeMapper.xml

@@ -144,6 +144,10 @@
                     and pa.agreement_type =#{agreementType}
                 </if>
 
+                <if test="signDateEnd !=null  and  signDateEnd!='' and  signDateStart !=null and signDateStart !=''">
+                    and a.signdate   between #{signDateStart} and #{signDateEnd}
+                </if>
+
                 <if test="handlingFeesStatus !=null  and  handlingFeesStatus  !=''">
                     and a.handling_fees_status =#{handlingFeesStatus}
                 </if>
@@ -331,17 +335,18 @@
         <include refid="income_com"/>
         from  ins_ply_income a
         <where>
+            1=1
             <if test="licenseno !=null  and  licenseno !=''">
-                a.licenseno=#{licenseno}
+                AND  a.licenseno=#{licenseno}
             </if>
             <if test="policyno !=null  and  policyno !=''">
-                a.policyno=#{policyno}
+              AND  a.policyno=#{policyno}
             </if>
             <if test="syPolicyno !=null  and  syPolicyno !=''">
-                a.sy_policyno=#{syPolicyno}
+                AND a.sy_policyno=#{syPolicyno}
             </if>
             <if test="noPolicyno !=null  and  noPolicyno !=''">
-                a.no_policyno=#{noPolicyno}
+               AND a.no_policyno=#{noPolicyno}
             </if>
         </where>
     </select>
@@ -361,7 +366,9 @@
                 <if test="agreementType !=null  and  agreementType  !=''">
                     and pa.agreement_type =#{agreementType}
                 </if>
-
+                <if test="signDateEnd !=null  and  signDateEnd!='' and  signDateStart !=null and signDateStart !=''">
+                    and a.signdate   between #{signDateStart} and #{signDateEnd}
+                </if>
                 <if test="handlingFeesStatus !=null  and  handlingFeesStatus  !=''">
                     and a.handling_fees_status =#{handlingFeesStatus}
                 </if>
@@ -447,6 +454,113 @@
     </select>
 
 
+    <select id="bxTotalAmount" resultType="com.ydtech.modules.fnc.entity.InsPlyIncome">
+            SELECT
+            SUM(a.commission_feevalue) AS commissionFeevalue,
+            SUM(CASE WHEN handling_fees_status = '0' THEN a.commission_feevalue ELSE 0 END) AS noInvoicCommissionFeevalue,
+            SUM(CASE WHEN handling_fees_status = '1' THEN a.commission_feevalue ELSE 0 END) AS readyCommissionFeevalue,
+            SUM(CASE WHEN handling_fees_status = '2' THEN a.commission_feevalue ELSE 0 END) AS invoicCommissionFeevalue
+            FROM
+            ins_ply_income a
+            LEFT JOIN
+            ptl_agreement pa ON pa.id = a.agreement_id
+            <where>
+                1=1
+                <if test="startDate !=null  and  startDate!='' and  endDate !=null and endDate !=''">
+                    and DATE_FORMAT( a.signdate, '%Y-%m-%d')  between DATE_FORMAT(#{startDate}, '%Y-%m-%d') and DATE_FORMAT(#{endDate}, '%Y-%m-%d')
+                </if>
+                <if test="agreementType !=null  and  agreementType  !=''">
+                    and pa.agreement_type =#{agreementType}
+                </if>
+                <if test="orderno !=null  and  orderno  !=''">
+                    and a.orderno =#{orderno}
+                </if>
+
+                <if test="signDateEnd !=null  and  signDateEnd!='' and  signDateStart !=null and signDateStart !=''">
+                    and a.signdate   between #{signDateStart} and #{signDateEnd}
+                </if>
+                <if test="policyno !=null  and  policyno  !=''">
+                    and a.policyno =#{policyno}
+                </if>
+
+                <if test="handlingFeesStatus !=null  and  handlingFeesStatus  !=''">
+                    and a.handling_fees_status =#{handlingFeesStatus}
+                </if>
+
+                <if test="documentaryFeesStatus !=null  and  documentaryFeesStatus  !=''">
+                    and a.documentary_fees_status =#{documentaryFeesStatus}
+                </if>
+
+                <if test="isNotCar !=null  and  isNotCar  !=''">
+                    and a.is_not_car =#{isNotCar}
+                </if>
+
+                <if test="isOther !=null  and  isOther  !=''">
+                    and a.is_not_documentary   =#{isOther}
+                </if>
+                <if test="licenseno != null and licenseno != ''  and licenseno.length > 0">
+                    and a.licenseno in
+                    <foreach collection="licenseno" item="item" open="(" separator="," close=")">
+                        #{item}
+                    </foreach>
+                </if>
+
+                <if test="policyno != null and policyno != ''  and policyno.length > 0">
+                    and a.policyno in
+                    <foreach collection="policyno" item="item" open="(" separator="," close=")">
+                        #{item}
+                    </foreach>
+                </if>
+
+                <if test="syPolicyno != null and syPolicyno != ''  and syPolicyno.length > 0">
+                    and a.sy_policyno in
+                    <foreach collection="syPolicyno" item="item" open="(" separator="," close=")">
+                        #{item}
+                    </foreach>
+                </if>
+
+                <if test="noPolicyno != null and noPolicyno != ''  and noPolicyno.length > 0">
+                    and a.no_policyno in
+                    <foreach collection="syPolicyno" item="item" open="(" separator="," close=")">
+                        #{item}
+                    </foreach>
+                </if>
+                <if test="signdate !=null  and  signdate  !=''">
+                    a.signdate =#{signdate}
+                </if>
+                <if test="partnerCompaniesId !=null  and  partnerCompaniesId  !=''">
+                    a.partner_companies_id =#{partnerCompaniesId}
+                </if>
+
+                <if test="createTime !=null  and  createTime  !=''">
+                    a.create_time =#{createTime}
+                </if>
+                <if test="settlementTime !=null  and  settlementTime  !=''">
+                    a.settlement_time =#{settlementTime}
+                </if>
+
+                <if test="userId !=null  and  userId  !=''">
+                    and a.userId   =#{userId}
+                </if>
+                <if test="companyId !=null  and  companyId  !=''">
+                    and a.company_id   =#{companyId}
+                </if>
+                <if test="riskcode !=null  and  riskcode  !=''">
+                    and a.riskcode   =#{riskcode}
+                </if>
+                <if test="year !=null  and  year  !=''">
+                    AND YEAR(a.signdate) =#{year}
+                </if>
+                <if test="month !=null  and  month !=''">
+                    AND month(a.signdate) =#{month}
+                </if>
+                <if test="day !=null  and  day !=''">
+                    AND day(a.signdate) =#{day}
+                </if>
+            </where>
+    </select>
+
+
     <select id="totalPinAmount" resultType="com.ydtech.modules.fnc.entity.InsPlyIncome">
                 select
                 MAX( a.company_name ) AS "companyName",
@@ -584,144 +698,32 @@
 
     <select id="totalBxAmount" resultType="com.ydtech.modules.fnc.entity.InsPlyIncome">
         select
-        MAX( a.company_name ) AS "companyName",
-        sum( a.commission_feevalue ) AS "commissionFeevalue",
-        MAX( a.partner_companies_name) as "partnerCompaniesName",
-        SUM(b.readyCommissionFeevalue)  as "readyCommissionFeevalue",
-        SUM(c.invoicCommissionFeevalue) as "invoicCommissionFeevalue",
-        SUM(d.noInvoicCommissionFeevalue) as "noInvoicCommissionFeevalue",
-        MAX(b.ids) as "ids",
-        a.agreement_id AS "agreementId"
-        from  ins_ply_income a
-        LEFT JOIN   ptl_agreement  pa  on pa.id= a.agreement_id
-        LEFT JOIN   (
-            select
-            MAX( a.company_name ) AS "companyName",
-            sum( a.commission_feevalue ) AS "readyCommissionFeevalue",
-            MAX( a.partner_companies_name) as "partnerCompaniesName",
-            GROUP_CONCAT(a.id) as  "ids",
-            a.agreement_id AS "agreementId"
-        from  ins_ply_income a
-        LEFT JOIN   ptl_agreement  pa  on pa.id= a.agreement_id
-        <where>
-            1=1
-            AND   a.handling_fees_status = '1'
-            <if test="agreementType !=null  and agreementType!='' ">
-                AND pa.agreement_type =#{agreementType}
-            </if>
-            <if test="documentaryFeesStatus != null  and documentaryFeesStatus != '' ">
-                AND   a.documentary_fees_status = #{documentaryFeesStatus}
-            </if>
-            <if test="isOther !=null  and  isOther  !=''">
-                and a.is_not_documentary   =#{isOther}
-            </if>
-
-            <if test="isNotCar !=null  and  isNotCar  !=''">
-                and a.is_not_car =#{isNotCar}
-            </if>
-            <if test="year !=null  and  year  !=''">
-                AND YEAR(a.signdate) =#{year}
-            </if>
-            <if test="month !=null  and  month !=''">
-                AND month(a.signdate) =#{month}
-            </if>
-            <if test="day !=null  and  day !=''">
-                AND day(a.signdate) =#{day}
-            </if>
-        </where>
-        GROUP BY  a.agreement_id
-        )  b  on  a.agreement_id =b.agreementId
-        LEFT JOIN   (
-            select
-            MAX( a.company_name ) AS "companyName",
-            sum( a.commission_feevalue ) AS "invoicCommissionFeevalue",
-            MAX( a.partner_companies_name) as "partnerCompaniesName",
-            GROUP_CONCAT(a.id) as  "ids",
-            a.agreement_id AS "agreementId"
+        a.agreement_id AS "agreementId",
+        MAX(a.partner_companies_name) AS "partnerCompaniesName",
+        MAX(a.company_name) AS "companyName",
+        SUM(a.commission_feevalue) AS "commissionFeevalue",
+        SUM(CASE WHEN a.handling_fees_status = '2' THEN a.commission_feevalue ELSE 0 END) AS "invoicCommissionFeevalue",
+        SUM( CASE WHEN a.handling_fees_status = '0' THEN a.commission_feevalue ELSE 0 END ) AS "noInvoicCommissionFeevalue",
+        SUM(CASE WHEN a.handling_fees_status = '1' THEN a.commission_feevalue ELSE 0 END) AS "readyCommissionFeevalue",
+        GROUP_CONCAT(a.id) AS "ids"
         from  ins_ply_income a
         LEFT JOIN   ptl_agreement  pa  on pa.id= a.agreement_id
         <where>
             1=1
-            AND   a.handling_fees_status = '2'
             <if test="agreementType !=null  and agreementType!='' ">
                 AND pa.agreement_type =#{agreementType}
             </if>
-            <if test="isOther !=null  and  isOther  !=''">
-                and a.is_not_documentary   =#{isOther}
-            </if>
-
-            <if test="documentaryFeesStatus != null  and documentaryFeesStatus != '' ">
-                AND   a.documentary_fees_status = #{documentaryFeesStatus}
-            </if>
-            <if test="isNotCar !=null  and  isNotCar  !=''">
-                and a.is_not_car =#{isNotCar}
-            </if>
-
             <if test="year !=null  and  year  !=''">
                 AND YEAR(a.signdate) =#{year}
             </if>
-            <if test="month !=null  and  month !=''">
-                AND month(a.signdate) =#{month}
-            </if>
-            <if test="day !=null  and  day !=''">
-                AND day(a.signdate) =#{day}
-            </if>
-        </where>
-        GROUP BY  a.agreement_id
-        )  c  on  a.agreement_id =c.agreementId
-        LEFT JOIN   (
-        select
-        MAX( a.company_name ) AS "companyName",
-        sum( a.commission_feevalue ) AS "noInvoicCommissionFeevalue",
-        MAX( a.partner_companies_name) as "partnerCompaniesName",
-        GROUP_CONCAT(a.id) as  "ids",
-        a.agreement_id AS "agreementId"
-        from  ins_ply_income a
-        LEFT JOIN   ptl_agreement  pa  on pa.id= a.agreement_id
-        <where>
-            1=1
-
-            AND   a.handling_fees_status = '0'
-            <if test="agreementType !=null  and agreementType!='' ">
-                AND pa.agreement_type =#{agreementType}
-            </if>
             <if test="isOther !=null  and  isOther  !=''">
                 and a.is_not_documentary   =#{isOther}
             </if>
-
-            <if test="documentaryFeesStatus != null  and documentaryFeesStatus != '' ">
-                AND   a.documentary_fees_status = #{documentaryFeesStatus}
-            </if>
             <if test="isNotCar !=null  and  isNotCar  !=''">
                 and a.is_not_car =#{isNotCar}
             </if>
-
-            <if test="year !=null  and  year  !=''">
-                AND YEAR(a.signdate) =#{year}
-            </if>
-            <if test="month !=null  and  month !=''">
-                AND month(a.signdate) =#{month}
-            </if>
-            <if test="day !=null  and  day !=''">
-                AND day(a.signdate) =#{day}
-            </if>
-        </where>
-        GROUP BY  a.agreement_id
-        )  d  on  a.agreement_id =d.agreementId
-        <where>
-            1=1
-
-            <if test="agreementType !=null  and agreementType!='' ">
-                AND pa.agreement_type =#{agreementType}
-            </if>
-            <if test="year !=null  and  year  !=''">
-                AND YEAR(a.signdate) =#{year}
-            </if>
-            <if test="isOther !=null  and  isOther  !=''">
-                and a.is_not_documentary   =#{isOther}
-            </if>
-            <if test="isNotCar !=null  and  isNotCar  !=''">
-                and a.is_not_car =#{isNotCar}
+            <if test="handlingFeesStatus !=null  and  handlingFeesStatus  !=''">
+                and a.handling_fees_status =#{handlingFeesStatus}
             </if>
             <if test="month !=null  and  month !=''">
                 AND month(a.signdate) =#{month}
@@ -732,12 +734,13 @@
         </where>
         GROUP BY  a.agreement_id
     </select>
+
     <select id="allOtherAmount" resultType="com.ydtech.modules.fnc.entity.InsPlyIncome">
         SELECT
             a.company_id AS "companyId",
             MAX( a.company_name ) AS "companyName",
             MAX( a.partner_companies_name) as "partnerCompaniesName",
-            IF(SUM( c.unsettledAmount ) IS NULL , sum( a.other_feevalue ),  SUM( c.unsettledAmount )  ) AS "noInvoicCommissionFeevalue",
+            IF(MAX( c.unsettledAmount ) IS NULL , sum( a.other_feevalue ),  sum( a.other_feevalue ) - MAX(d.settleMentAmount) ) AS "noInvoicCommissionFeevalue",
             GROUP_CONCAT(a.id) as  "incomeIds",
             MAX(d.settleMentAmount) as "invoicCommissionFeevalue",
             MAX(e.settleMentAmount) as "settleMentAmount",

+ 33 - 20
src/main/resources/mapper/modules/inv/InvAccountExcelMapper.xml

@@ -120,44 +120,57 @@
         desc
     </select>
 
+    <resultMap id="InvAccountOperateVoResultMap" type="com.ydtech.modules.inv.model.vo.InvAccountOperateVo">
+        <id property="accountOperateId" column="account_operate_id" jdbcType="VARCHAR"/>
+        <result property="company" column="company" jdbcType="VARCHAR"/>
+        <result property="applySector" column="apply_sector" jdbcType="VARCHAR"/>
+        <result property="collectionMessage" column="collection_message" jdbcType="VARCHAR"/>
+        <result property="fundUse" column="fund_use" jdbcType="VARCHAR"/>
+        <result property="applyAmount" column="apply_amount" jdbcType="VARCHAR"/>
+        <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
+        <result property="remark" column="remark" jdbcType="VARCHAR"/>
+    </resultMap>
+
 
-    <select id="selectDisburse" resultMap="BaseResultMap">
+    <select id="selectDisburse" resultMap="InvAccountOperateVoResultMap">
         SELECT DISTINCT
-            a.excel_account_operate_id,
-            a.apply_time,
+            a.account_operate_id,
+            DATE_FORMAT(a.create_time, '%Y-%m-%d') as create_date,
             a.fund_use,
             a.remark,
             a.apply_amount,
             a.apply_sector,
             a.company,
-            a.collection_message
-        from inv_account_excel a
+            a.collection_message,
+            a.create_time
+        from inv_account_operate a
             LEFT JOIN inv_account_expenses b ON a.fund_fen = b.category
         WHERE
             a.fund_use != '往来款'
 	    AND collection_message LIKE '外部用户%'
+        and a.revenue_outlay = '1'
         AND a.del_flag = '0'
-        <if test="insAccountExcel.applyTimeStart!= null">
-            and apply_time &gt;= #{insAccountExcel.applyTimeStart}
+        <if test="inAccountOperateVo.createTimeStart!= null">
+            and a.create_time &gt;= #{inAccountOperateVo.createTimeStart}
         </if>
-        <if test="insAccountExcel.applyTimeEnd!= null">
-            and apply_time &lt;= #{insAccountExcel.applyTimeEnd}
+        <if test="inAccountOperateVo.createTimeEnd!= null">
+            and a.create_time &lt;= #{inAccountOperateVo.createTimeEnd}
         </if>
-        <if test="insAccountExcel.applySector!= null and insAccountExcel.applySector!= ''">
-            and apply_sector = #{insAccountExcel.applySector}
+        <if test="inAccountOperateVo.applySector!= null and inAccountOperateVo.applySector!= ''">
+            and a.apply_sector = #{inAccountOperateVo.applySector}
         </if>
-        <if test="insAccountExcel.collectionMessage!= null and insAccountExcel.collectionMessage!= ''">
-            and collection_message like concat('%',#{insAccountExcel.collectionMessage},'%')
+        <if test="inAccountOperateVo.collectionMessage!= null and inAccountOperateVo.collectionMessage!= ''">
+            and a.collection_message like concat('%',#{inAccountOperateVo.collectionMessage},'%')
         </if>
-        <if test="insAccountExcel.company!= null and insAccountExcel.company!= ''">
-            and company like concat('%',#{insAccountExcel.company},'%')
+        <if test="inAccountOperateVo.company!= null and inAccountOperateVo.company!= ''">
+            and a.company like concat('%',#{inAccountOperateVo.company},'%')
         </if>
-        <if test="insAccountExcel.fundUse!= null and insAccountExcel.fundUse!= ''">
-            and fund_use = #{insAccountExcel.fundUse}
+        <if test="inAccountOperateVo.fundUse!= null and inAccountOperateVo.fundUse!= ''">
+            and a.fund_use = #{inAccountOperateVo.fundUse}
         </if>
-        <if test="insAccountExcel.applyAmount!= null and insAccountExcel.applyAmount!= ''">
-            and apply_amount = #{insAccountExcel.applyAmount}
+        <if test="inAccountOperateVo.applyAmount!= null and inAccountOperateVo.applyAmount!= ''">
+            and a.apply_amount = #{inAccountOperateVo.applyAmount}
         </if>
-        order by apply_time desc
+        order by a.create_time desc
     </select>
 </mapper>

+ 4 - 1
src/main/resources/mapper/modules/order/InsAreaCompanyMapper.xml

@@ -136,7 +136,8 @@
         sd.management_source,
         su2.name AS auditUser,
         ifa.audittime as auditTime,
-        ifa.auditstatus as auditStatus
+        ifa.auditstatus as auditStatus,
+        eic.namesimple as partnerCompaniesName
         FROM
         ins_orders io
         LEFT JOIN ins_fee_audit ifa ON ifa.orderno = io.orderno
@@ -144,6 +145,8 @@
         LEFT JOIN sys_dept sd ON sd.id = su.dept_id
         LEFT JOIN sys_user su2 ON ifa.audituser = su2.id
         LEFT JOIN ins_area_company iac ON iac.orderno = io.orderno and iac.orderstatus = 3
+        LEFT JOIN ptl_agreement pa ON pa.id = iac.agreement_id
+        LEFT JOIN esm_ins_company eic on eic.id = pa.partner_companies_id
         WHERE
         io.orderno IN ( SELECT orderno FROM ins_area_company WHERE id IN (
         SELECT ins_order_no FROM ins_fee_order_new

+ 14 - 1
src/main/resources/mapper/modules/order/InsOrdersMapper.xml

@@ -44,6 +44,8 @@
         <result property="subOrderId" column="subOrderId" jdbcType="VARCHAR"/>
         <result property="agreementCode" column="agreementCode" jdbcType="VARCHAR"/>
         <result property="agreementName" column="agreementName" jdbcType="VARCHAR"/>
+        <result property="partnerCompaniesName" column="partnerCompaniesName" jdbcType="VARCHAR"/>
+        <result property="managementSource" column="managementSource" jdbcType="VARCHAR"/>
 
     </resultMap>
     <resultMap id="OrderResultMap" type="com.ydtech.modules.order.entity.vo.OrderVo">
@@ -811,13 +813,24 @@
         iac.company_id as company_id,
         iac.inscompany as ins_company,
         agree.agreement_code as agreementCode,
-        agree.agreement_name as agreementName
+        agree.agreement_name as agreementName,
+        company.namesimple as partnerCompaniesName,
+        CASE dept.management_source
+        WHEN '1' THEN '渠道'
+        WHEN '2' THEN '个代'
+        WHEN '3' THEN '电销'
+        ELSE '' END
+        AS managementSource
         from
             ins_area_company iac
         left JOIN
              ins_orders io  on iac.orderno = io.orderno
         left join
             ptl_agreement   agree  on  iac.agreement_id= agree.id
+        left join
+           esm_ins_company   company  on  agree.partner_companies_id= company.id
+        LEFT JOIN
+                sys_dept dept ON dept.id = io.deptid
         <where>
             <if test="agentUserIds != null and agentUserIds.size>0" >
                 AND (

+ 2 - 2
src/main/resources/mapper/modules/protocol/PtlAgreementMapper.xml

@@ -105,9 +105,9 @@
     </select>
     <select id="getByAgreementIdNew" resultType="com.ydtech.modules.protocol.entity.po.PtlAgreement">
         select
-            partner_companies_id  as  "partnercompaniesId"
+            partner_companies_id  as  "partnercompaniesId",
             association_companies_id  as  "associationCompaniesId"
-        from  ptl_agreement_dept
+        from  ptl_agreement
         <where>
             <if test="agreementId!=null  and  agreementId !=''">
                 id=#{agreementId}

+ 33 - 0
src/main/resources/mapper/modules/protocols/PtlAgreementProductCostsNewMapper.xml

@@ -0,0 +1,33 @@
+<?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.ydtech.modules.protocols.dao.PtlAgreementProductCostsNewMapper">
+
+    <select id="getCostsPage" resultType="com.ydtech.modules.protocols.entity.po.PtlAgreementProductCostsNew">
+        SELECT
+        pa.insurance_company,
+        pa.agreement_name,
+        papcn.*
+        FROM
+        ptl_agreement_product_costs_new papcn
+        LEFT JOIN ptl_agreement pa ON papcn.agreement_id = pa.id
+        where 1=1
+        <if test="params.agreementIds != null and params.agreementIds != ''">
+            AND pa.id in (#{params.agreementIds})
+        </if>
+        <if test="params.agreementId != null and params.agreementId != ''">
+            AND pa.id in (#{params.agreementId})
+        </if>
+        <if test="params.isAudit != null and params.isAudit != ''">
+            AND papcn.is_audit = #{params.isAudit}
+        </if>
+        <if test="params.productCode != null and params.productCode != ''">
+            AND papcn.product_id = #{params.productCode}
+        </if>
+        <if test="params.createStartTime != null and params.createStartTime != ''">
+            and papcn.create_time BETWEEN #{params.createStartTime} and #{params.createEndTime}
+        </if>
+
+    </select>
+</mapper>