Przeglądaj źródła

Merge branch 'refs/heads/test' into test-20240815

wks 2 lat temu
rodzic
commit
844f426b27
50 zmienionych plików z 1241 dodań i 141 usunięć
  1. 44 0
      sql/Online.sql
  2. 2 1
      src/main/java/com/ydtech/modules/admin/controller/InsuranceHandlingSettlementMonthController.java
  3. 99 0
      src/main/java/com/ydtech/modules/admin/controller/kzt/KZTPermissionController.java
  4. 19 0
      src/main/java/com/ydtech/modules/admin/dao/KztDataPermissionMapper.java
  5. 7 1
      src/main/java/com/ydtech/modules/admin/dao/SysDeptMapper.java
  6. 10 1
      src/main/java/com/ydtech/modules/admin/dao/SysMenuMapper.java
  7. 3 1
      src/main/java/com/ydtech/modules/admin/dao/SysRoleMenuMapper.java
  8. 4 0
      src/main/java/com/ydtech/modules/admin/model/SysMenu.java
  9. 126 0
      src/main/java/com/ydtech/modules/admin/model/po/KztDataPermission.java
  10. 14 0
      src/main/java/com/ydtech/modules/admin/service/KztDataPermissionService.java
  11. 22 0
      src/main/java/com/ydtech/modules/admin/service/impl/KztDataPermissionServiceImpl.java
  12. 50 40
      src/main/java/com/ydtech/modules/admin/service/impl/SysDeptServiceImpl.java
  13. 8 4
      src/main/java/com/ydtech/modules/admin/service/impl/SysMenuServiceImpl.java
  14. 6 0
      src/main/java/com/ydtech/modules/fnc/dao/InsPlyIncomeMapper.java
  15. 1 0
      src/main/java/com/ydtech/modules/fnc/dao/InsuranceHandlingSettlementMonthMapper.java
  16. 6 0
      src/main/java/com/ydtech/modules/fnc/dto/InsuranceHandlingSettlementMonthDto.java
  17. 5 0
      src/main/java/com/ydtech/modules/fnc/entity/InsuranceHandlingSettlementMonthEntity.java
  18. 4 0
      src/main/java/com/ydtech/modules/fnc/service/InsPlyIncomeService.java
  19. 1 1
      src/main/java/com/ydtech/modules/fnc/service/InsuranceHandlingSettlementMonthService.java
  20. 43 1
      src/main/java/com/ydtech/modules/fnc/service/impl/InsPlyIncomeServiceImpl.java
  21. 41 20
      src/main/java/com/ydtech/modules/fnc/service/impl/InsuranceHandlingSettlementMonthServiceImpl.java
  22. 7 0
      src/main/java/com/ydtech/modules/fnc/vo/InsPlyIncomeVo.java
  23. 7 0
      src/main/java/com/ydtech/modules/fnc/vo/InsuranceHandlingSettlementMonthVo.java
  24. 13 1
      src/main/java/com/ydtech/modules/ins/model/pingan/respose/PingAnQuoteRespVo.java
  25. 1 0
      src/main/java/com/ydtech/modules/inv/controller/InvAccountExpensesController.java
  26. 8 0
      src/main/java/com/ydtech/modules/inv/model/InvAccountExpenses.java
  27. 9 0
      src/main/java/com/ydtech/modules/order/controller/PingAnOrderApiController.java
  28. 1 1
      src/main/java/com/ydtech/modules/order/dao/InsTaskImagesMapper.java
  29. 18 0
      src/main/java/com/ydtech/modules/order/dao/PinganRecordMapper.java
  30. 5 0
      src/main/java/com/ydtech/modules/order/entity/api/pingan/response/QuoteResponse.java
  31. 4 0
      src/main/java/com/ydtech/modules/order/entity/dto/InsAreaCompanyQueryDto.java
  32. 19 0
      src/main/java/com/ydtech/modules/order/entity/po/InsTaskImages.java
  33. 131 0
      src/main/java/com/ydtech/modules/order/entity/po/PinganRecord.java
  34. 2 1
      src/main/java/com/ydtech/modules/order/entity/vo/pingan/AdditionalInformation.java
  35. 3 2
      src/main/java/com/ydtech/modules/order/service/InsUploadFilesService.java
  36. 7 0
      src/main/java/com/ydtech/modules/order/service/PingAnOrderApiService.java
  37. 13 0
      src/main/java/com/ydtech/modules/order/service/PinganRecordService.java
  38. 1 1
      src/main/java/com/ydtech/modules/order/service/impl/InsUploadFilesServiceImpl.java
  39. 134 33
      src/main/java/com/ydtech/modules/order/service/impl/PingAnOrderApiServiceImpl.java
  40. 22 0
      src/main/java/com/ydtech/modules/order/service/impl/PinganRecordServiceImpl.java
  41. 6 9
      src/main/java/com/ydtech/modules/protocols/controller/PtlNewAgreementController.java
  42. 21 0
      src/main/resources/mapper/modules/admin/KztDataPermissionMapper.xml
  43. 4 1
      src/main/resources/mapper/modules/admin/SysDeptMapper.xml
  44. 27 0
      src/main/resources/mapper/modules/admin/SysMenuMapper.xml
  45. 208 0
      src/main/resources/mapper/modules/fnc/InsPlyIncomeMapper.xml
  46. 1 1
      src/main/resources/mapper/modules/ins/InsTaskImagesMapper.xml
  47. 24 18
      src/main/resources/mapper/modules/insuranceHandlingSettlementMonth/InsuranceHandlingSettlementMonthMapper.xml
  48. 2 1
      src/main/resources/mapper/modules/inv/InvAccountExpensesMapper.xml
  49. 5 2
      src/main/resources/mapper/modules/order/InsAreaCompanyMapper.xml
  50. 23 0
      src/main/resources/mapper/modules/order/PinganRecordMapper.xml

+ 44 - 0
sql/Online.sql

@@ -186,3 +186,47 @@ CREATE TABLE `sys_insurance_handling_settlement_month`  (
                                                             `creater_id` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '创建人',
                                                             `creater_id` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '创建人',
                                                             PRIMARY KEY (`id`) USING BTREE
                                                             PRIMARY KEY (`id`) USING BTREE
 ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '保险手续费结算关联表' ROW_FORMAT = Dynamic;
 ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '保险手续费结算关联表' ROW_FORMAT = Dynamic;
+
+
+-- 添加平安记录表  add by  hxl
+DROP TABLE IF EXISTS `pingan_record`;
+CREATE TABLE `pingan_record`  (
+                                  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
+                                  `sub_order_no` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '子订单号',
+                                  `ahs_upc_total_premium` decimal(10, 2) NULL DEFAULT NULL COMMENT '财意险总保费',
+                                  `ahs_premium` decimal(10, 2) NULL DEFAULT NULL COMMENT '意外险保费',
+                                  `upc_premium` decimal(10, 2) NULL DEFAULT NULL COMMENT '财产险保费',
+                                  `xw_premium` decimal(10, 2) NULL DEFAULT NULL COMMENT '小微险保费',
+                                  `com_premium` decimal(10, 2) NULL DEFAULT NULL COMMENT '组合产品保费',
+                                  `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
+                                  PRIMARY KEY (`id`) USING BTREE
+) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
+
+-- 添加控制台数据权限表   add by  hxl
+DROP TABLE IF EXISTS `kzt_data_permission`;
+CREATE TABLE `kzt_data_permission`  (
+                                        `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
+                                        `menu_id` bigint NULL DEFAULT NULL COMMENT '菜单id',
+                                        `custom_script_flag` tinyint(1) NULL DEFAULT NULL COMMENT '是否自定义脚本',
+                                        `data_permission_id` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '数据权限字典id',
+                                        `script_content` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '自定义脚本内容',
+                                        `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
+                                        `url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '数据访问url',
+                                        PRIMARY KEY (`id`) USING BTREE
+) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '控制台数据权限表' ROW_FORMAT = Dynamic;
+
+-- 平安事后文件上传资料   add by  hxl
+DROP TABLE IF EXISTS `pingan_sh_uploafile`;
+CREATE TABLE `pingan_sh_uploafile`  (
+                                        `id` bigint NOT NULL COMMENT '主键',
+                                        `sub_order_no` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '子订单id',
+                                        `document_class` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '文件大类编码',
+                                        `document_class_name` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '文件大类名称',
+                                        `is_any_one` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '是否以上之一均可【1-是,0-否】\r\n 1表示当前大类,只需要上传其中一种小类 0表示全部上传',
+                                        `document_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '文件小类编码',
+                                        `document_type_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '文件小类名称',
+                                        `is_need_during_audit` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '是否需要事中审核【1-需要,0-不需要】',
+                                        `status` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '是否上传',
+                                        `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
+                                        PRIMARY KEY (`id`) USING BTREE
+) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '平安事后文件上传资料' ROW_FORMAT = Dynamic;

+ 2 - 1
src/main/java/com/ydtech/modules/admin/controller/InsuranceHandlingSettlementMonthController.java

@@ -4,6 +4,7 @@ package com.ydtech.modules.admin.controller;
 import com.ydtech.core.page.HttpResult;
 import com.ydtech.core.page.HttpResult;
 import com.ydtech.modules.fnc.dto.InsuranceHandlingSettlementMonthDto;
 import com.ydtech.modules.fnc.dto.InsuranceHandlingSettlementMonthDto;
 import com.ydtech.modules.fnc.entity.InsPlyIncome;
 import com.ydtech.modules.fnc.entity.InsPlyIncome;
+import com.ydtech.modules.fnc.entity.InsuranceHandlingSettlementMonthEntity;
 import com.ydtech.modules.fnc.service.InsuranceHandlingSettlementMonthService;
 import com.ydtech.modules.fnc.service.InsuranceHandlingSettlementMonthService;
 import com.ydtech.modules.fnc.vo.InsPlyIncomeVo;
 import com.ydtech.modules.fnc.vo.InsPlyIncomeVo;
 import com.ydtech.modules.fnc.vo.InsuranceHandlingSettlementMonthVo;
 import com.ydtech.modules.fnc.vo.InsuranceHandlingSettlementMonthVo;
@@ -53,7 +54,7 @@ public class InsuranceHandlingSettlementMonthController {
      */
      */
     @PostMapping("/insert")
     @PostMapping("/insert")
     @ApiModelProperty(value = "新增")
     @ApiModelProperty(value = "新增")
-    public HttpResult<InsuranceHandlingSettlementMonthDto> insertByEntity(@RequestBody InsuranceHandlingSettlementMonthVo insuranceHandlingSettlementMonthVo) {
+    public HttpResult<InsuranceHandlingSettlementMonthDto> insertByEntity(@RequestBody InsuranceHandlingSettlementMonthEntity insuranceHandlingSettlementMonthVo) {
         return insuranceHandlingSettlementMonthService.insertByEntity(insuranceHandlingSettlementMonthVo);
         return insuranceHandlingSettlementMonthService.insertByEntity(insuranceHandlingSettlementMonthVo);
     }
     }
 
 

+ 99 - 0
src/main/java/com/ydtech/modules/admin/controller/kzt/KZTPermissionController.java

@@ -0,0 +1,99 @@
+package com.ydtech.modules.admin.controller.kzt;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.ydtech.core.page.HttpResult;
+import com.ydtech.exception.SystemException;
+import com.ydtech.modules.admin.model.po.KztDataPermission;
+import com.ydtech.modules.admin.service.KztDataPermissionService;
+import com.ydtech.modules.base.controller.BaseController;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.bind.annotation.*;
+
+import javax.validation.Valid;
+
+/**
+ *  @version
+ *  @author: hxl
+ *  @Date: 2024/8/20 14:41
+ *  @Description: 控制台数据权限表
+ */
+@RestController
+@RequestMapping("kztDataPermission")
+@Api(tags = "控制台数据权限")
+public class KZTPermissionController extends BaseController {
+
+
+    @Autowired
+    private KztDataPermissionService kztDataPermissionService;
+
+
+
+    /**
+     *  @version
+     *  @author: hxl
+     *  @Date: 2024/8/14 18:13
+     *  @Description: 控制台角色新增和修改
+     */
+    @ApiOperation(value = "控制台角色新增和修改")
+    @PostMapping(value = "/saveOrUpdate")
+    public HttpResult saveOrUpdate(@Valid @RequestBody KztDataPermission kztDataPermission) {
+        try{
+            if(kztDataPermission!=null && kztDataPermission.getId()!=null){
+                //更新
+                KztDataPermission update = kztDataPermissionService.getById(kztDataPermission.getId());
+                update.setCustomScriptFlag(kztDataPermission.getCustomScriptFlag());
+                update.setDataPermissionId(kztDataPermission.getDataPermissionId());
+                update.setScriptContent(kztDataPermission.getScriptContent());
+                kztDataPermissionService.updateById(update);
+            }else{
+                kztDataPermissionService.save(kztDataPermission);
+            }
+        }catch(Exception e){
+            return HttpResult.error("操作失败");
+        }
+        return HttpResult.ok("操作成功");
+    }
+    /**
+     *  @version
+     *  @author: hxl
+     *  @Date: 2024/8/14 18:54
+     *  @Description: 控制台角色刪除
+     */
+    @ApiOperation(value = "控制台数据权限通过菜单id查询数据")
+    @PostMapping(value = "/findByMenuId")
+    @Transactional
+    public HttpResult findByMenuId(Long menuId) {
+        if(menuId==null){
+            throw  new SystemException("菜单id不能为空");
+        }
+        LambdaQueryWrapper<KztDataPermission> lqw = new LambdaQueryWrapper<>();
+        lqw.eq(KztDataPermission::getMenuId, menuId);
+        KztDataPermission kztDataPermission = kztDataPermissionService.getOne(lqw);
+        return HttpResult.ok(kztDataPermission);
+    }
+
+    /**
+     *  @version
+     *  @author: hxl
+     *  @Date: 2024/8/14 18:54
+     *  @Description: 控制台角色刪除
+     */
+    @ApiOperation(value = "控制台权限清空")
+    @GetMapping(value = "/delete")
+    @Transactional
+    public HttpResult delete(Long menuId) {
+        if(menuId==null){
+            throw  new SystemException("菜单id不能为空");
+        }
+        try{
+
+        }catch(Exception e){
+            return HttpResult.error("删除失败");
+        }
+        return HttpResult.ok("删除成功");
+    }
+
+}

+ 19 - 0
src/main/java/com/ydtech/modules/admin/dao/KztDataPermissionMapper.java

@@ -0,0 +1,19 @@
+package com.ydtech.modules.admin.dao;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.ydtech.modules.admin.model.po.KztDataPermission;
+
+
+/**
+* @author Administrator
+* @description 针对表【kzt_data_permission】的数据库操作Mapper
+* @createDate 2024-08-20 11:56:29
+* @Entity generator.domain.KztDataPermission
+*/
+public interface KztDataPermissionMapper extends BaseMapper<KztDataPermission> {
+
+}
+
+
+
+

+ 7 - 1
src/main/java/com/ydtech/modules/admin/dao/SysDeptMapper.java

@@ -9,7 +9,13 @@ import java.util.List;
 public interface SysDeptMapper extends BaseMapper<SysDept> {
 public interface SysDeptMapper extends BaseMapper<SysDept> {
 
 
 
 
-    String getMaxId(@Param(value = "deptId") String deptId);
+    /**
+     * 查询Id 值
+     * @param deptId 部门
+     * @param deptType 类型
+     * @return
+     */
+    String getMaxId(@Param(value = "deptId") String deptId, @Param(value = "deptType")String deptType);
     /**
     /**
      *  @version
      *  @version
      *  @author: hxl
      *  @author: hxl

+ 10 - 1
src/main/java/com/ydtech/modules/admin/dao/SysMenuMapper.java

@@ -3,9 +3,18 @@ package com.ydtech.modules.admin.dao;
 
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.ydtech.modules.admin.model.SysMenu;
 import com.ydtech.modules.admin.model.SysMenu;
+import org.apache.ibatis.annotations.Param;
 
 
-public interface SysMenuMapper extends BaseMapper<SysMenu> {
+import java.util.List;
 
 
+public interface SysMenuMapper extends BaseMapper<SysMenu> {
+    /**
+     *  @version
+     *  @author: hxl
+     *  @Date: 2024/8/19 21:05
+     *  @Description: 查询数据
+     */
+    List<SysMenu> findBySysTypeList(@Param("sysType") String sysType, @Param("delFlag") String delFlag);
 }
 }
 
 
 
 

+ 3 - 1
src/main/java/com/ydtech/modules/admin/dao/SysRoleMenuMapper.java

@@ -22,7 +22,9 @@ public interface SysRoleMenuMapper extends BaseMapper<SysRoleMenu> {
     List<SysMenu> gainSysMenuIds(@Param("userId") String userId);
     List<SysMenu> gainSysMenuIds(@Param("userId") String userId);
 
 
 
 
-    String SysMenuSql_kzt = "select t.id, t.name, t.parent_id, t.url, t.perms, t.type, t.icon, t.order_num, t.create_by, t.create_time, t.last_update_by, t.last_update_time, t.del_flag from sys_menu t ";
+    String SysMenuSql_kzt = "select t.id, t.name, t.parent_id, t.url, t.perms, t.type, t.icon, t.order_num, t.create_by, t.create_time, t.last_update_by, t.last_update_time, t.del_flag,p.parent_id as parentId," +
+            " pp.NAME AS parentName," +
+            " pp.url AS parentUrl  from sys_menu t  left join sys_menu pp ON t.parent_id = pp.id ";
     String sysRoleMenuIdSql_kzt = " where t.id in (select menu_id from sys_role_menu t1 left join sys_user_role t2 on t1.role_id=t2.role_id where t2.user_id='${userId}') and del_flag=0  and  t.sys_type='${sysType}'";
     String sysRoleMenuIdSql_kzt = " where t.id in (select menu_id from sys_role_menu t1 left join sys_user_role t2 on t1.role_id=t2.role_id where t2.user_id='${userId}') and del_flag=0  and  t.sys_type='${sysType}'";
     String SysMenuSqlT1_kzt = SysMenuSql + sysRoleMenuIdSql;
     String SysMenuSqlT1_kzt = SysMenuSql + sysRoleMenuIdSql;
 
 

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

@@ -50,6 +50,10 @@ public class SysMenu implements Serializable {
     // 非数据库字段
     // 非数据库字段
     @TableField(exist = false)
     @TableField(exist = false)
     private String parentName;
     private String parentName;
+
+    // 非数据库字段
+    @TableField(exist = false)
+    private String parentUrl;
     // 非数据库字段
     // 非数据库字段
     @TableField(exist = false)
     @TableField(exist = false)
     private Integer level;
     private Integer level;

+ 126 - 0
src/main/java/com/ydtech/modules/admin/model/po/KztDataPermission.java

@@ -0,0 +1,126 @@
+package com.ydtech.modules.admin.model.po;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * 
+ * @TableName kzt_data_permission
+ */
+@TableName(value ="kzt_data_permission")
+@Data
+@ApiModel(value = "数据权限")
+public class KztDataPermission implements Serializable {
+    /**
+     * 主键
+     */
+    @TableId(type = IdType.AUTO)
+    @ApiModelProperty(value = "id")
+    private Long id;
+
+    /**
+     * 菜单id
+     */
+    @ApiModelProperty(value = "菜单id")
+    @NotNull(message = "菜单id不能为空")
+    private Long menuId;
+
+    /**
+     * 是否自定义脚本
+     */
+    @ApiModelProperty(value = "是否自定义脚本")
+    @NotNull(message = "是否自定义脚本不能为空")
+    private Integer customScriptFlag;
+
+    /**
+     * 数据权限字典id
+     */
+    @ApiModelProperty(value = "数据权限字典id")
+    private String dataPermissionId;
+
+    /**
+     * 自定义脚本内容
+     */
+    @ApiModelProperty(value = "自定义脚本内容")
+    private String scriptContent;
+
+    /**
+     * 创建时间
+     */
+    @ApiModelProperty(value = "不用传后台生成")
+    private Date createTime;
+
+    /**
+     * 访问的url
+     */
+    @NotBlank(message = "访问的url不能为空")
+    @ApiModelProperty(value = "访问的url")
+    private String url;
+
+
+    @TableField(exist = false)
+    private static final long serialVersionUID = 1L;
+
+    @Override
+    public boolean equals(Object that) {
+        if (this == that) {
+            return true;
+        }
+        if (that == null) {
+            return false;
+        }
+        if (getClass() != that.getClass()) {
+            return false;
+        }
+        KztDataPermission other = (KztDataPermission) that;
+        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
+            && (this.getMenuId() == null ? other.getMenuId() == null : this.getMenuId().equals(other.getMenuId()))
+            && (this.getCustomScriptFlag() == null ? other.getCustomScriptFlag() == null : this.getCustomScriptFlag().equals(other.getCustomScriptFlag()))
+            && (this.getDataPermissionId() == null ? other.getDataPermissionId() == null : this.getDataPermissionId().equals(other.getDataPermissionId()))
+            && (this.getScriptContent() == null ? other.getScriptContent() == null : this.getScriptContent().equals(other.getScriptContent()))
+             && (this.getUrl() == null ? other.getUrl() == null : this.getUrl().equals(other.getUrl()))
+             && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()));
+    }
+
+    @Override
+    public int hashCode() {
+        final int prime = 31;
+        int result = 1;
+        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
+        result = prime * result + ((getMenuId() == null) ? 0 : getMenuId().hashCode());
+        result = prime * result + ((getCustomScriptFlag() == null) ? 0 : getCustomScriptFlag().hashCode());
+        result = prime * result + ((getDataPermissionId() == null) ? 0 : getDataPermissionId().hashCode());
+        result = prime * result + ((getScriptContent() == null) ? 0 : getScriptContent().hashCode());
+        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
+        result = prime * result + ((getUrl() == null) ? 0 : getUrl().hashCode());
+        return result;
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder sb = new StringBuilder();
+        sb.append(getClass().getSimpleName());
+        sb.append(" [");
+        sb.append("Hash = ").append(hashCode());
+        sb.append(", id=").append(id);
+        sb.append(", menuId=").append(menuId);
+        sb.append(", customScriptFlag=").append(customScriptFlag);
+        sb.append(", dataPermissionId=").append(dataPermissionId);
+        sb.append(", scriptContent=").append(scriptContent);
+        sb.append(", createTime=").append(createTime);
+        sb.append(", url=").append(url);
+        sb.append(", serialVersionUID=").append(serialVersionUID);
+        sb.append("]");
+        return sb.toString();
+    }
+}

+ 14 - 0
src/main/java/com/ydtech/modules/admin/service/KztDataPermissionService.java

@@ -0,0 +1,14 @@
+package com.ydtech.modules.admin.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.ydtech.modules.admin.model.po.KztDataPermission;
+
+
+/**
+* @author Administrator
+* @description 针对表【kzt_data_permission】的数据库操作Service
+* @createDate 2024-08-20 11:56:29
+*/
+public interface KztDataPermissionService extends IService<KztDataPermission> {
+
+}

+ 22 - 0
src/main/java/com/ydtech/modules/admin/service/impl/KztDataPermissionServiceImpl.java

@@ -0,0 +1,22 @@
+package com.ydtech.modules.admin.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.ydtech.modules.admin.dao.KztDataPermissionMapper;
+import com.ydtech.modules.admin.model.po.KztDataPermission;
+import com.ydtech.modules.admin.service.KztDataPermissionService;
+import org.springframework.stereotype.Service;
+
+/**
+* @author Administrator
+* @description 针对表【kzt_data_permission】的数据库操作Service实现
+* @createDate 2024-08-20 11:56:29
+*/
+@Service
+public class KztDataPermissionServiceImpl extends ServiceImpl<KztDataPermissionMapper, KztDataPermission>
+    implements KztDataPermissionService {
+
+}
+
+
+
+

+ 50 - 40
src/main/java/com/ydtech/modules/admin/service/impl/SysDeptServiceImpl.java

@@ -51,11 +51,10 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept>
     private SysUserTreeShowLevelService sysUserTreeShowLevelService;
     private SysUserTreeShowLevelService sysUserTreeShowLevelService;
 
 
 
 
-
     /**
     /**
      * 根据用户权限和指定部门ID,查询并构建部门树。
      * 根据用户权限和指定部门ID,查询并构建部门树。
      *
      *
-     * @param deptId 部门ID,用于查询特定部门及其子部门,如果为空或特定值,则查询用户所在部门及其子部门。
+     * @param deptId           部门ID,用于查询特定部门及其子部门,如果为空或特定值,则查询用户所在部门及其子部门。
      * @param managementSource 管理范围来源标识,用于不同场景下的部门树构建。
      * @param managementSource 管理范围来源标识,用于不同场景下的部门树构建。
      * @return 返回符合用户权限和管理范围的部门树列表。
      * @return 返回符合用户权限和管理范围的部门树列表。
      */
      */
@@ -78,9 +77,9 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept>
         }
         }
         // 如果指定的部门ID为空或特定值,则使用当前用户所在部门ID
         // 如果指定的部门ID为空或特定值,则使用当前用户所在部门ID
         if (null == deptId || "".equals(deptId) || "undefined".equals(deptId)) {
         if (null == deptId || "".equals(deptId) || "undefined".equals(deptId)) {
-            if(!treeShowLevel.getShowLevel().equals("all")) {
+            if (!treeShowLevel.getShowLevel().equals("all")) {
                 deptId = user.getDeptId();
                 deptId = user.getDeptId();
-            }else{
+            } else {
                 deptId = "9";
                 deptId = "9";
             }
             }
         }
         }
@@ -127,7 +126,7 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept>
                     break;
                     break;
                 } else {
                 } else {
                     int finalLevel = level;
                     int finalLevel = level;
-                    resultTmp = resultTmp.stream().filter(x->x.getComlevel().equals(String.valueOf(finalLevel))).collect(Collectors.toList());
+                    resultTmp = resultTmp.stream().filter(x -> x.getComlevel().equals(String.valueOf(finalLevel))).collect(Collectors.toList());
                     result.clear();
                     result.clear();
                     result.addAll(resultTmp);
                     result.addAll(resultTmp);
                 }
                 }
@@ -146,13 +145,13 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept>
 
 
         if (showLevel.equals("same")) {
         if (showLevel.equals("same")) {
             if (null != managementSource && !"undefined".equals(managementSource) && !"".equals(managementSource)) {
             if (null != managementSource && !"undefined".equals(managementSource) && !"".equals(managementSource)) {
-                if (sysDept.getManagementSource().equals(managementSource)){
+                if (sysDept.getManagementSource().equals(managementSource)) {
                     sysDeptList.clear();
                     sysDeptList.clear();
                     sysDeptList.add(sysDept);
                     sysDeptList.add(sysDept);
-                }else {
+                } else {
                     return new ArrayList<>();
                     return new ArrayList<>();
                 }
                 }
-            }else {
+            } else {
                 sysDeptList.clear();
                 sysDeptList.clear();
                 sysDeptList.add(sysDept);
                 sysDeptList.add(sysDept);
             }
             }
@@ -171,7 +170,7 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept>
                         }
                         }
                         i.getChildren().addAll(value);
                         i.getChildren().addAll(value);
                         //处理总部的排序为空造成的空指针报错处理  add by   hxl
                         //处理总部的排序为空造成的空指针报错处理  add by   hxl
-                        i.setOrderNum(i.getOrderNum()==null?0:i.getOrderNum());
+                        i.setOrderNum(i.getOrderNum() == null ? 0 : i.getOrderNum());
                         result.add(i);
                         result.add(i);
                     }
                     }
                 })
                 })
@@ -210,10 +209,16 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept>
             AssertionUtils.isStringEmpty(sysDept.getArea(), "四级机构区必填");
             AssertionUtils.isStringEmpty(sysDept.getArea(), "四级机构区必填");
             number = sysDept.getArea().substring(0, 6);
             number = sysDept.getArea().substring(0, 6);
         } else {
         } else {
-            if (comlevel.equals("5")) {
+            String deptType = "";
+
+            if ("C".equals(sysDept.getDeptType()) && comlevel.equals("5")) {
                 sysDeptVo.setDeptType("M");
                 sysDeptVo.setDeptType("M");
+            } else if ("D".equals(sysDept.getDeptType())) {
+                sysDeptVo.setDeptType("D");
+                deptType = "M";
             }
             }
-            String maxId = baseMapper.getMaxId(sysDept.getParentId());
+
+            String maxId = baseMapper.getMaxId(sysDept.getParentId(), deptType);
             if (!maxId.equals("0")) {
             if (!maxId.equals("0")) {
                 String substring = maxId.substring(sysDept.getParentId().length() + 1);
                 String substring = maxId.substring(sysDept.getParentId().length() + 1);
                 int i = Integer.parseInt("1" + substring) + 1;
                 int i = Integer.parseInt("1" + substring) + 1;
@@ -239,7 +244,7 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept>
         }
         }
         SysDept parentDept = baseMapper.selectById(sysDept.getParentId());
         SysDept parentDept = baseMapper.selectById(sysDept.getParentId());
 
 
-        if (parentDept.getComlevel().equals("5")){
+        if (parentDept.getComlevel().equals("5")) {
             sysDept.setManagementSource(parentDept.getManagementSource());
             sysDept.setManagementSource(parentDept.getManagementSource());
         }
         }
 
 
@@ -305,7 +310,7 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept>
                     break;
                     break;
                 }
                 }
             }
             }
-           baseMapper.updateById(record);
+            baseMapper.updateById(record);
         }
         }
         //向下换位
         //向下换位
         if (newOrderNum > orderNum) {
         if (newOrderNum > orderNum) {
@@ -432,7 +437,9 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept>
         LambdaQueryWrapper<SysDept> lqw = new LambdaQueryWrapper<>();
         LambdaQueryWrapper<SysDept> lqw = new LambdaQueryWrapper<>();
         lqw.eq(SysDept::getDelFlag, 0);
         lqw.eq(SysDept::getDelFlag, 0);
         lqw.likeRight(SysDept::getId, deptId);
         lqw.likeRight(SysDept::getId, deptId);
-        lqw.and((wrapper)->{wrapper.eq(SysDept::getDeptType,'C').or().eq(SysDept::getId,'9');});
+        lqw.and((wrapper) -> {
+            wrapper.eq(SysDept::getDeptType, 'C').or().eq(SysDept::getId, '9');
+        });
         List<SysDept> sysDeptList = list(lqw);
         List<SysDept> sysDeptList = list(lqw);
         Map<String, List<SysDept>> map = sysDeptList.stream().collect(Collectors.groupingBy(SysDept::getParentId));
         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<>())));
@@ -448,31 +455,31 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept>
         LambdaQueryWrapper<SysDept> lqw = new LambdaQueryWrapper<>();
         LambdaQueryWrapper<SysDept> lqw = new LambdaQueryWrapper<>();
         lqw.eq(SysDept::getDelFlag, 0);
         lqw.eq(SysDept::getDelFlag, 0);
         lqw.likeRight(SysDept::getId, deptId);
         lqw.likeRight(SysDept::getId, deptId);
-        lqw.eq(SysDept::getDeptType,'D');
+        lqw.eq(SysDept::getDeptType, 'D');
         lqw.apply(" exists (SELECT 1 FROM  `sys_dept` b WHERE sys_dept.parent_id = b.`id` AND b.`comlevel`='5') ");
         lqw.apply(" exists (SELECT 1 FROM  `sys_dept` b WHERE sys_dept.parent_id = b.`id` AND b.`comlevel`='5') ");
         List<SysDept> sysDeptList = list(lqw);
         List<SysDept> sysDeptList = list(lqw);
         return sysDeptList;
         return sysDeptList;
     }
     }
+
     /**
     /**
-     *  @version
-     *  @author: hxl
-     *  @Date: 2024/4/28 10:24
-     *  @Description: 查询省、市、县 、门店的列表
+     * @version
+     * @author: hxl
+     * @Date: 2024/4/28 10:24
+     * @Description: 查询省、市、县 、门店的列表
      */
      */
     @Override
     @Override
     public List<SysDept> queryListByParentId(String level, String parentId) {
     public List<SysDept> queryListByParentId(String level, String parentId) {
-        return sysDeptMapper.queryListByParentId(level,parentId);
+        return sysDeptMapper.queryListByParentId(level, parentId);
     }
     }
 
 
     @Override
     @Override
-    public String queryBelongArea(String deptId){
+    public String queryBelongArea(String deptId) {
         //长度大于8的话 进行切割
         //长度大于8的话 进行切割
         StringBuilder result = new StringBuilder();
         StringBuilder result = new StringBuilder();
-        if(deptId.length() >= 8)
-        {
-            String area = deptId.substring(2,8);
+        if (deptId.length() >= 8) {
+            String area = deptId.substring(2, 8);
             SysArea sysArea = sysAreaMapper.selectOne(new LambdaQueryWrapper<SysArea>().eq(SysArea::getAreaCode, area));
             SysArea sysArea = sysAreaMapper.selectOne(new LambdaQueryWrapper<SysArea>().eq(SysArea::getAreaCode, area));
-            if(sysArea == null){
+            if (sysArea == null) {
                 return "";
                 return "";
             }
             }
             List<SysArea> sysAreas = sysAreaService.queryAllParent(sysArea);
             List<SysArea> sysAreas = sysAreaService.queryAllParent(sysArea);
@@ -497,28 +504,30 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept>
         }
         }
         return sysAreas;
         return sysAreas;
     }
     }
+
     /**
     /**
-     *  @version
-     *  @author: hxl
-     *  @Date: 2024/6/28 8:43
-     *  @Description:  查询后线机构树
+     * @version
+     * @author: hxl
+     * @Date: 2024/6/28 8:43
+     * @Description: 查询后线机构树
      */
      */
     @Override
     @Override
     public List<SysDept> queryHXDeptTree() {
     public List<SysDept> queryHXDeptTree() {
         //所有的后线机构
         //所有的后线机构
         List<SysDept> sysDeptsHX = sysDeptMapper.queryHXDeptTree();
         List<SysDept> sysDeptsHX = sysDeptMapper.queryHXDeptTree();
         //查询后线中顶级的数据
         //查询后线中顶级的数据
-        List<SysDept> resultList =new ArrayList<SysDept>();
-        List<SysDept> sysDeptTop = sysDeptsHX.stream().filter(item ->"99".equals(item.getId())).collect(Collectors.toList());
+        List<SysDept> resultList = new ArrayList<SysDept>();
+        List<SysDept> sysDeptTop = sysDeptsHX.stream().filter(item -> "99".equals(item.getId())).collect(Collectors.toList());
         for (SysDept dept : sysDeptTop) {
         for (SysDept dept : sysDeptTop) {
-            resultList.add(buildDeptTree(dept,sysDeptsHX));
+            resultList.add(buildDeptTree(dept, sysDeptsHX));
         }
         }
         return resultList;
         return resultList;
     }
     }
+
     /**
     /**
      * 递归构建树形结构
      * 递归构建树形结构
      */
      */
-    private SysDept buildDeptTree(SysDept dept, List<SysDept> deptList){
+    private SysDept buildDeptTree(SysDept dept, List<SysDept> deptList) {
         for (SysDept d : deptList) {
         for (SysDept d : deptList) {
             if (dept.getId().equals(d.getParentId())) {
             if (dept.getId().equals(d.getParentId())) {
                 if (null == dept.getChildren()) {
                 if (null == dept.getChildren()) {
@@ -530,20 +539,21 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept>
         }
         }
         return dept;
         return dept;
     }
     }
+
     /**
     /**
-     *  @version
-     *  @author: hxl
-     *  @Date: 2024/6/28 8:42
-     *  @Description: 查询前线机构树
+     * @version
+     * @author: hxl
+     * @Date: 2024/6/28 8:42
+     * @Description: 查询前线机构树
      */
      */
     @Override
     @Override
     public List<SysDept> queryQXDeptTree() {
     public List<SysDept> queryQXDeptTree() {
         List<SysDept> sysDeptAll = sysDeptMapper.queryListByQXDept();
         List<SysDept> sysDeptAll = sysDeptMapper.queryListByQXDept();
         //查询后线中顶级的数据
         //查询后线中顶级的数据
-        List<SysDept> resultList =new ArrayList<SysDept>();
-        List<SysDept> sysDeptTop = sysDeptAll.stream().filter(item ->"3".equals(item.getComlevel())).collect(Collectors.toList());
+        List<SysDept> resultList = new ArrayList<SysDept>();
+        List<SysDept> sysDeptTop = sysDeptAll.stream().filter(item -> "3".equals(item.getComlevel())).collect(Collectors.toList());
         for (SysDept dept : sysDeptTop) {
         for (SysDept dept : sysDeptTop) {
-            resultList.add(buildDeptTree(dept,sysDeptAll));
+            resultList.add(buildDeptTree(dept, sysDeptAll));
         }
         }
         return sysDeptMapper.queryListByQXDept();
         return sysDeptMapper.queryListByQXDept();
     }
     }

+ 8 - 4
src/main/java/com/ydtech/modules/admin/service/impl/SysMenuServiceImpl.java

@@ -28,6 +28,9 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu>
     @Autowired
     @Autowired
     private SysRoleMenuKztService sysRoleMenuKztService;
     private SysRoleMenuKztService sysRoleMenuKztService;
 
 
+    @Autowired
+    private SysMenuMapper sysMenuMapper;
+
 
 
     @Override
     @Override
     public List<SysMenu> findTree(String userName, int menuType) {
     public List<SysMenu> findTree(String userName, int menuType) {
@@ -140,10 +143,11 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu>
         List<SysMenu> sysMenus = new ArrayList<>();
         List<SysMenu> sysMenus = new ArrayList<>();
         List<SysMenu> menus  =new ArrayList<>();
         List<SysMenu> menus  =new ArrayList<>();
         if(StringUtils.isBlank(userId) || (StringUtils.isNotBlank(userId) && "admin".equals(userId))){
         if(StringUtils.isBlank(userId) || (StringUtils.isNotBlank(userId) && "admin".equals(userId))){
-            LambdaQueryWrapper<SysMenu> lqw = new LambdaQueryWrapper<>();
-            lqw.eq(SysMenu::getDelFlag, 0);
-            lqw.eq(SysMenu::getSysType, sysType);
-            menus = list(lqw);
+          //  LambdaQueryWrapper<SysMenu> lqw = new LambdaQueryWrapper<>();
+          //  lqw.eq(SysMenu::getDelFlag, 0);
+           // lqw.eq(SysMenu::getSysType, sysType);
+            menus= sysMenuMapper.findBySysTypeList(sysType,"0");
+           // menus = list(lqw);
         }else{
         }else{
             return sysRoleMenuService.gainMenuIdsByUserId(userId,sysType);
             return sysRoleMenuService.gainMenuIdsByUserId(userId,sysType);
         }
         }

+ 6 - 0
src/main/java/com/ydtech/modules/fnc/dao/InsPlyIncomeMapper.java

@@ -4,10 +4,12 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.ydtech.modules.admin.model.report.financialReceivables.*;
 import com.ydtech.modules.admin.model.report.financialReceivables.*;
 import com.ydtech.modules.admin.model.report.profitAnalysis.ProfitAnalysisDto;
 import com.ydtech.modules.admin.model.report.profitAnalysis.ProfitAnalysisDto;
 import com.ydtech.modules.admin.model.report.profitAnalysis.ProfitAnalysisQueryDto;
 import com.ydtech.modules.admin.model.report.profitAnalysis.ProfitAnalysisQueryDto;
+import com.ydtech.modules.fnc.dto.InsuranceHandlingSettlementMonthDto;
 import com.ydtech.modules.fnc.dto.PlatformSettlementRecordDto;
 import com.ydtech.modules.fnc.dto.PlatformSettlementRecordDto;
 import com.ydtech.modules.fnc.entity.InsPlyIncome;
 import com.ydtech.modules.fnc.entity.InsPlyIncome;
 import com.ydtech.modules.fnc.vo.InsPlyIncomeVo;
 import com.ydtech.modules.fnc.vo.InsPlyIncomeVo;
 import com.ydtech.modules.fnc.vo.InsPlySettleVo;
 import com.ydtech.modules.fnc.vo.InsPlySettleVo;
+import com.ydtech.modules.fnc.vo.InsuranceHandlingSettlementMonthVo;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Select;
 import org.apache.ibatis.annotations.Select;
@@ -193,4 +195,8 @@ public interface InsPlyIncomeMapper extends BaseMapper<InsPlyIncome> {
 
 
     List<FinancialReceivablesVo> queryPrivateCar(@Param("vo") FinancialReceivablesQueryVo financialReceivablesQueryVo);
     List<FinancialReceivablesVo> queryPrivateCar(@Param("vo") FinancialReceivablesQueryVo financialReceivablesQueryVo);
 
 
+    List<ProfitAnalysisDto> getProfitAnalysisQueryList(@Param("vo")  ProfitAnalysisQueryDto profitAnalysisQueryDto);
+
+    List<InsuranceHandlingSettlementMonthDto> getInvociAmount(@Param("vo") InsuranceHandlingSettlementMonthVo insuranceHandlingSettlementMonthVo);
+
 }
 }

+ 1 - 0
src/main/java/com/ydtech/modules/fnc/dao/InsuranceHandlingSettlementMonthMapper.java

@@ -20,6 +20,7 @@ import java.util.List;
 @Mapper
 @Mapper
 public interface InsuranceHandlingSettlementMonthMapper extends BaseMapper<InsuranceHandlingSettlementMonthEntity> {
 public interface InsuranceHandlingSettlementMonthMapper extends BaseMapper<InsuranceHandlingSettlementMonthEntity> {
     List<InsuranceHandlingSettlementMonthDto> queryList( @Param("vo") InsuranceHandlingSettlementMonthVo insuranceHandlingSettlementMonthVo);
     List<InsuranceHandlingSettlementMonthDto> queryList( @Param("vo") InsuranceHandlingSettlementMonthVo insuranceHandlingSettlementMonthVo);
+    List<InsuranceHandlingSettlementMonthDto> queryListNew( @Param("vo") InsuranceHandlingSettlementMonthVo insuranceHandlingSettlementMonthVo);
 
 
 
 
 }
 }

+ 6 - 0
src/main/java/com/ydtech/modules/fnc/dto/InsuranceHandlingSettlementMonthDto.java

@@ -35,6 +35,9 @@ public class InsuranceHandlingSettlementMonthDto implements Serializable {
     @ApiModelProperty("签单时间")
     @ApiModelProperty("签单时间")
     private LocalDateTime signingTime;
     private LocalDateTime signingTime;
 
 
+    @ApiModelProperty("签单时间")
+    private String incomeSigningTime;
+
     @ApiModelProperty("创建人")
     @ApiModelProperty("创建人")
     private String createrId;
     private String createrId;
 
 
@@ -43,4 +46,7 @@ public class InsuranceHandlingSettlementMonthDto implements Serializable {
 
 
     @ApiModelProperty("开票手续费")
     @ApiModelProperty("开票手续费")
     private String invoiccommissionFeevalue;
     private String invoiccommissionFeevalue;
+
+    @ApiModelProperty("是否手续费")
+    private String isNotDocumentary;
 }
 }

+ 5 - 0
src/main/java/com/ydtech/modules/fnc/entity/InsuranceHandlingSettlementMonthEntity.java

@@ -62,4 +62,9 @@ public class InsuranceHandlingSettlementMonthEntity implements Serializable {
     @ApiModelProperty("合作公司id")
     @ApiModelProperty("合作公司id")
     @TableField("partner_companies_id")
     @TableField("partner_companies_id")
     private String partnerCompaniesId;
     private String partnerCompaniesId;
+
+
+    @ApiModelProperty("签单日期")
+    @TableField(exist = false)
+    private String incomeSigningTime;
 }
 }

+ 4 - 0
src/main/java/com/ydtech/modules/fnc/service/InsPlyIncomeService.java

@@ -6,12 +6,14 @@ import com.ydtech.modules.admin.model.report.financialReceivables.FinancialRecei
 import com.ydtech.modules.admin.model.report.financialReceivables.FinancialReceivablesAllVo;
 import com.ydtech.modules.admin.model.report.financialReceivables.FinancialReceivablesAllVo;
 import com.ydtech.modules.admin.model.report.financialReceivables.FinancialReceivablesQueryMonthVo;
 import com.ydtech.modules.admin.model.report.financialReceivables.FinancialReceivablesQueryMonthVo;
 import com.ydtech.modules.admin.model.report.financialReceivables.FinancialReceivablesQueryVo;
 import com.ydtech.modules.admin.model.report.financialReceivables.FinancialReceivablesQueryVo;
+import com.ydtech.modules.fnc.dto.InsuranceHandlingSettlementMonthDto;
 import com.ydtech.modules.fnc.dto.PlatformSettlementRecordDto;
 import com.ydtech.modules.fnc.dto.PlatformSettlementRecordDto;
 import com.ydtech.modules.fnc.entity.InsAreaCompany;
 import com.ydtech.modules.fnc.entity.InsAreaCompany;
 import com.ydtech.modules.fnc.entity.InsPlyIncome;
 import com.ydtech.modules.fnc.entity.InsPlyIncome;
 import com.ydtech.modules.fnc.entity.SettlementDocumentaryFeesEntity;
 import com.ydtech.modules.fnc.entity.SettlementDocumentaryFeesEntity;
 import com.ydtech.modules.fnc.vo.InsPlyIncomeIdsVo;
 import com.ydtech.modules.fnc.vo.InsPlyIncomeIdsVo;
 import com.ydtech.modules.fnc.vo.InsPlyIncomeVo;
 import com.ydtech.modules.fnc.vo.InsPlyIncomeVo;
+import com.ydtech.modules.fnc.vo.InsuranceHandlingSettlementMonthVo;
 import com.ydtech.modules.order.entity.BasePageResult;
 import com.ydtech.modules.order.entity.BasePageResult;
 import com.ydtech.modules.order.entity.InsOrders;
 import com.ydtech.modules.order.entity.InsOrders;
 import com.ydtech.modules.protocols.entity.po.InsFeeOrderNew;
 import com.ydtech.modules.protocols.entity.po.InsFeeOrderNew;
@@ -212,4 +214,6 @@ public interface InsPlyIncomeService extends IService<InsPlyIncome> {
      */
      */
     HttpResult<List<InsPlyIncome>> createData(InsPlyIncomeIdsVo insPlyIncomeIdsVo);
     HttpResult<List<InsPlyIncome>> createData(InsPlyIncomeIdsVo insPlyIncomeIdsVo);
 
 
+    List<InsuranceHandlingSettlementMonthDto> getInvociAmount(InsuranceHandlingSettlementMonthVo insuranceHandlingSettlementMonthVo);
+
 }
 }

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

@@ -26,6 +26,6 @@ public interface InsuranceHandlingSettlementMonthService  extends IService<Insur
      * @param insuranceHandlingSettlementMonthVo
      * @param insuranceHandlingSettlementMonthVo
      * @return
      * @return
      */
      */
-    HttpResult<InsuranceHandlingSettlementMonthDto> insertByEntity(InsuranceHandlingSettlementMonthVo insuranceHandlingSettlementMonthVo);
+    HttpResult<InsuranceHandlingSettlementMonthDto> insertByEntity(InsuranceHandlingSettlementMonthEntity insuranceHandlingSettlementMonthVo);
 
 
 }
 }

+ 43 - 1
src/main/java/com/ydtech/modules/fnc/service/impl/InsPlyIncomeServiceImpl.java

@@ -21,11 +21,13 @@ import com.ydtech.modules.esm.model.EsmInsCompany;
 import com.ydtech.modules.esm.service.EsmInsCompanyService;
 import com.ydtech.modules.esm.service.EsmInsCompanyService;
 import com.ydtech.modules.fnc.dao.FncInsAreaCompanyMapper;
 import com.ydtech.modules.fnc.dao.FncInsAreaCompanyMapper;
 import com.ydtech.modules.fnc.dao.InsPlyIncomeMapper;
 import com.ydtech.modules.fnc.dao.InsPlyIncomeMapper;
+import com.ydtech.modules.fnc.dto.InsuranceHandlingSettlementMonthDto;
 import com.ydtech.modules.fnc.dto.PlatformSettlementRecordDto;
 import com.ydtech.modules.fnc.dto.PlatformSettlementRecordDto;
 import com.ydtech.modules.fnc.entity.*;
 import com.ydtech.modules.fnc.entity.*;
 import com.ydtech.modules.fnc.service.*;
 import com.ydtech.modules.fnc.service.*;
 import com.ydtech.modules.fnc.vo.InsPlyIncomeIdsVo;
 import com.ydtech.modules.fnc.vo.InsPlyIncomeIdsVo;
 import com.ydtech.modules.fnc.vo.InsPlyIncomeVo;
 import com.ydtech.modules.fnc.vo.InsPlyIncomeVo;
+import com.ydtech.modules.fnc.vo.InsuranceHandlingSettlementMonthVo;
 import com.ydtech.modules.fnc.vo.SettlementDocumentaryFeesVo;
 import com.ydtech.modules.fnc.vo.SettlementDocumentaryFeesVo;
 import com.ydtech.modules.ins.model.vo.res.*;
 import com.ydtech.modules.ins.model.vo.res.*;
 import com.ydtech.modules.inv.model.dto.*;
 import com.ydtech.modules.inv.model.dto.*;
@@ -126,6 +128,9 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
     @Autowired
     @Autowired
     private FncInsAreaCompanyMapper fncInsAreaCompanyMapper;
     private FncInsAreaCompanyMapper fncInsAreaCompanyMapper;
 
 
+    @Autowired
+    private InsuranceHandlingSettlementMonthService   insuranceHandlingSettlementMonthService;
+
 
 
     public HttpResult<BasePageResult<InsPlyIncome>> queryplyIncome(InsPlyIncomeVo insPlyIncomeVo) {
     public HttpResult<BasePageResult<InsPlyIncome>> queryplyIncome(InsPlyIncomeVo insPlyIncomeVo) {
 
 
@@ -2068,7 +2073,38 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
                 }
                 }
             }
             }
         }
         }
-//            分批结算
+//      分批结算
+        List<InsuranceHandlingSettlementMonthEntity> insuranceHandlingList = insPlyIncomeVo.getInsuranceHandlingList();
+        BigDecimal allsettlementAmount = BigDecimal.ZERO;
+        for(InsuranceHandlingSettlementMonthEntity item :  insuranceHandlingList){
+            String incomeSigningTime = item.getIncomeSigningTime();
+
+            DateTimeFormatter yearMonthFormatter = DateTimeFormatter.ofPattern("yyyy-MM");
+
+            // 尝试解析为LocalDate(这里实际上解析为YearMonth,但使用LocalDate的parse方法,因为它会接受只有年和月的TemporalQuery)
+            // 注意:这里直接解析为LocalDate可能会引发异常,因为DateTimeFormatter应该与要解析的Temporal类型精确匹配。
+            // 但由于Java的灵活性,以及默认行为(假设日为1),这通常可以工作。
+            LocalDate date = YearMonth.parse(incomeSigningTime, yearMonthFormatter).atDay(1);
+
+            // 将LocalDate转换为LocalDateTime,时间为00:00:00
+            LocalDateTime localDateTime = date.atStartOfDay();
+
+
+            BigDecimal totalAmount = item.getTotalAmount();  //开票金额
+            BigDecimal settlementAmount = item.getSettlementAmount();  //结算金额
+
+            if(settlementAmount.compareTo(BigDecimal.ZERO) > 0){
+                allsettlementAmount =    this.calculateTotal(settlementAmount,allsettlementAmount,null);
+                BigDecimal subtract = totalAmount.subtract(settlementAmount);
+                item.setRemainingAmount(subtract);
+                item.setCreateTime(LocalDateTime.now());
+            }
+            item.setPartnerCompaniesId(insPlyIncomeVo.getPartnerCompaniesId());
+            item.setSigningTime(localDateTime);
+            item.setTotalAmount(item.getRemainingAmount());
+        }
+        insuranceHandlingSettlementMonthService.saveBatch(insuranceHandlingList);
+
         SettlementDocumentaryFeesVo settlementDocumentaryFeesVo = new SettlementDocumentaryFeesVo();
         SettlementDocumentaryFeesVo settlementDocumentaryFeesVo = new SettlementDocumentaryFeesVo();
         settlementDocumentaryFeesVo.setInvoiceId(insPlyIncomeVo.getInvoicId());   //开票号
         settlementDocumentaryFeesVo.setInvoiceId(insPlyIncomeVo.getInvoicId());   //开票号
         settlementDocumentaryFeesVo.setSettlementTime(insPlyIncomeVo.getSettlementTime());   //结算时间
         settlementDocumentaryFeesVo.setSettlementTime(insPlyIncomeVo.getSettlementTime());   //结算时间
@@ -3515,4 +3551,10 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
         }
         }
         return HttpResult.ok(newList);
         return HttpResult.ok(newList);
     }
     }
+
+    @Override
+    public List<InsuranceHandlingSettlementMonthDto> getInvociAmount(InsuranceHandlingSettlementMonthVo insuranceHandlingSettlementMonthVo) {
+
+        return baseMapper.getInvociAmount(insuranceHandlingSettlementMonthVo);
+    }
 }
 }

+ 41 - 20
src/main/java/com/ydtech/modules/fnc/service/impl/InsuranceHandlingSettlementMonthServiceImpl.java

@@ -4,16 +4,23 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.ydtech.core.page.HttpResult;
 import com.ydtech.core.page.HttpResult;
 import com.ydtech.modules.fnc.dao.InsuranceHandlingSettlementMonthMapper;
 import com.ydtech.modules.fnc.dao.InsuranceHandlingSettlementMonthMapper;
 import com.ydtech.modules.fnc.dto.InsuranceHandlingSettlementMonthDto;
 import com.ydtech.modules.fnc.dto.InsuranceHandlingSettlementMonthDto;
+import com.ydtech.modules.fnc.entity.InsPlyIncome;
 import com.ydtech.modules.fnc.entity.InsuranceHandlingSettlementMonthEntity;
 import com.ydtech.modules.fnc.entity.InsuranceHandlingSettlementMonthEntity;
+import com.ydtech.modules.fnc.service.InsPlyIncomeService;
 import com.ydtech.modules.fnc.service.InsuranceHandlingSettlementMonthService;
 import com.ydtech.modules.fnc.service.InsuranceHandlingSettlementMonthService;
 import com.ydtech.modules.fnc.vo.InsuranceHandlingSettlementMonthVo;
 import com.ydtech.modules.fnc.vo.InsuranceHandlingSettlementMonthVo;
 import lombok.extern.slf4j.Slf4j;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
+import org.springframework.util.CollectionUtils;
 
 
+import java.math.BigDecimal;
 import java.util.Comparator;
 import java.util.Comparator;
 import java.util.List;
 import java.util.List;
 import java.util.Map;
 import java.util.Map;
+import java.util.function.BinaryOperator;
+import java.util.function.Function;
 import java.util.stream.Collectors;
 import java.util.stream.Collectors;
 
 
 /**
 /**
@@ -27,27 +34,43 @@ import java.util.stream.Collectors;
 @Slf4j
 @Slf4j
 @Service
 @Service
 public class InsuranceHandlingSettlementMonthServiceImpl extends ServiceImpl<InsuranceHandlingSettlementMonthMapper, InsuranceHandlingSettlementMonthEntity> implements InsuranceHandlingSettlementMonthService {
 public class InsuranceHandlingSettlementMonthServiceImpl extends ServiceImpl<InsuranceHandlingSettlementMonthMapper, InsuranceHandlingSettlementMonthEntity> implements InsuranceHandlingSettlementMonthService {
-
+    @Autowired
+    private InsPlyIncomeService  insPlyIncomeService;
     @Override
     @Override
     public List<InsuranceHandlingSettlementMonthDto> queryList(InsuranceHandlingSettlementMonthVo insuranceHandlingSettlementMonthVo) {
     public List<InsuranceHandlingSettlementMonthDto> queryList(InsuranceHandlingSettlementMonthVo insuranceHandlingSettlementMonthVo) {
+        List<InsuranceHandlingSettlementMonthDto>  incomeList=  insPlyIncomeService.getInvociAmount(insuranceHandlingSettlementMonthVo);
         List<InsuranceHandlingSettlementMonthDto> resultList = baseMapper.queryList(insuranceHandlingSettlementMonthVo);
         List<InsuranceHandlingSettlementMonthDto> resultList = baseMapper.queryList(insuranceHandlingSettlementMonthVo);
+        if(resultList.size()>0){
+            Map<String, InsuranceHandlingSettlementMonthDto> latestByTaskId = resultList.stream()
+                    .collect(Collectors.toMap(
+                            InsuranceHandlingSettlementMonthDto::getIncomeSigningTime, // 用于生成Map的键
+                            Function.identity(),// 值是Stream中的元素本身
+                            // 如果两个元素有相同的key(即相同的taskId),则选择createTime更晚的那个
+                            BinaryOperator.maxBy(Comparator.comparing(InsuranceHandlingSettlementMonthDto::getCreateTime))
+                    ));
+
+            for (InsuranceHandlingSettlementMonthDto   incomeItem   : incomeList){
+                String incomeSigningTime = incomeItem.getIncomeSigningTime();
+                InsuranceHandlingSettlementMonthDto insuranceHandlingSettlementMonthDto = latestByTaskId.get(incomeSigningTime);
+                incomeItem.setRemainingAmount(insuranceHandlingSettlementMonthDto.getRemainingAmount());
+                incomeItem.setTotalAmount(insuranceHandlingSettlementMonthDto.getTotalAmount());
+                incomeItem.setCreateTime(null);
+                if( incomeItem.getSettlementAmount() ==null || incomeItem.getSettlementAmount().compareTo(BigDecimal.ZERO)==0){
+                    incomeItem.setSettlementAmount(new BigDecimal("0.00"));
+
+                }
+            }
+        }else {
+            for (InsuranceHandlingSettlementMonthDto   incomeItem   : incomeList){
+                    incomeItem.setRemainingAmount(incomeItem.getTotalAmount());
 
 
-        List<InsuranceHandlingSettlementMonthDto> latestRecords = resultList.stream()
-                // 根据taskId分组,并收集每个taskId对应的所有记录
-                .collect(Collectors.groupingBy(
-                        InsuranceHandlingSettlementMonthDto::getTaskId,
-                        Collectors.toList()
-                ))
-                // 遍历每个分组,找出每组中createTime最新的记录
-                .entrySet().stream()
-                .map(entry -> entry.getValue().stream()
-                        .max(Comparator.comparing(InsuranceHandlingSettlementMonthDto::getCreateTime))
-                        .orElse(null) // 如果没有记录,则返回null(这里根据需求决定是否处理null)
-                )
-                // 收集结果到新的List中
-                .collect(Collectors.toList());
+                if( incomeItem.getSettlementAmount() ==null || incomeItem.getSettlementAmount().compareTo(BigDecimal.ZERO)==0){
+                    incomeItem.setSettlementAmount(new BigDecimal("0.00"));
 
 
-        return resultList;
+                }
+            }
+        }
+        return incomeList;
     }
     }
 
 
     /**
     /**
@@ -57,10 +80,8 @@ public class InsuranceHandlingSettlementMonthServiceImpl extends ServiceImpl<Ins
      * @return
      * @return
      */
      */
     @Override
     @Override
-    public HttpResult<InsuranceHandlingSettlementMonthDto> insertByEntity(InsuranceHandlingSettlementMonthVo insuranceHandlingSettlementMonthVo) {
-        InsuranceHandlingSettlementMonthEntity insuranceHandlingSettlementMonthEntity = new InsuranceHandlingSettlementMonthEntity();
-        BeanUtils.copyProperties(insuranceHandlingSettlementMonthVo, insuranceHandlingSettlementMonthEntity);
-        baseMapper.insert(insuranceHandlingSettlementMonthEntity);
+    public HttpResult<InsuranceHandlingSettlementMonthDto> insertByEntity(InsuranceHandlingSettlementMonthEntity insuranceHandlingSettlementMonthVo) {
+        baseMapper.insert(insuranceHandlingSettlementMonthVo);
         return HttpResult.ok("结算成功");
         return HttpResult.ok("结算成功");
     }
     }
 }
 }

+ 7 - 0
src/main/java/com/ydtech/modules/fnc/vo/InsPlyIncomeVo.java

@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
 import com.baomidou.mybatisplus.annotation.TableName;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import com.ydtech.modules.fnc.entity.InsPlyIncome;
 import com.ydtech.modules.fnc.entity.InsPlyIncome;
+import com.ydtech.modules.fnc.entity.InsuranceHandlingSettlementMonthEntity;
 import com.ydtech.modules.order.entity.po.InsUploadFiles;
 import com.ydtech.modules.order.entity.po.InsUploadFiles;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import io.swagger.annotations.ApiModelProperty;
@@ -415,4 +416,10 @@ public class InsPlyIncomeVo implements Serializable {
 
 
     @ApiModelProperty("批量修改结果")
     @ApiModelProperty("批量修改结果")
     private List<InsPlyIncome> resultList;
     private List<InsPlyIncome> resultList;
+
+
+    @ApiModelProperty("保险手续费结算")
+    private List<InsuranceHandlingSettlementMonthEntity> insuranceHandlingList;
+
+
 }
 }

+ 7 - 0
src/main/java/com/ydtech/modules/fnc/vo/InsuranceHandlingSettlementMonthVo.java

@@ -44,4 +44,11 @@ public class InsuranceHandlingSettlementMonthVo implements Serializable {
 
 
     @ApiModelProperty("合作公司id")
     @ApiModelProperty("合作公司id")
     private String partnerCompaniesId;
     private String partnerCompaniesId;
+
+
+    @ApiModelProperty("是否手续费")
+    private String isNotDocumentary;
+
+    @ApiModelProperty("是否非车")
+    private String isNotCar;
 }
 }

+ 13 - 1
src/main/java/com/ydtech/modules/ins/model/pingan/respose/PingAnQuoteRespVo.java

@@ -13,8 +13,10 @@ public class PingAnQuoteRespVo extends QuoteRespVo {
     // 小微险保费
     // 小微险保费
     QuoteResponse.XwActualPremiumDTO xwActualPremium = new QuoteResponse.XwActualPremiumDTO();
     QuoteResponse.XwActualPremiumDTO xwActualPremium = new QuoteResponse.XwActualPremiumDTO();
 
 
+    QuoteResponse.CombinationPremiumDTO combinationPremium =new QuoteResponse.CombinationPremiumDTO();
+
     /***
     /***
-     * 财意险
+     *  意外
      */
      */
     double cyPremium=0;
     double cyPremium=0;
     /***
     /***
@@ -26,4 +28,14 @@ public class PingAnQuoteRespVo extends QuoteRespVo {
      */
      */
     double zhPremium=0;
     double zhPremium=0;
 
 
+    /***
+     * 财意险总保费
+     */
+    double ahsUpcTotalPremium=0;
+    /***
+     *  財产险
+     */
+    double ccPremium=0;
+
+
 }
 }

+ 1 - 0
src/main/java/com/ydtech/modules/inv/controller/InvAccountExpensesController.java

@@ -4,6 +4,7 @@ import com.ydtech.core.page.HttpResult;
 import com.ydtech.modules.base.controller.BaseController;
 import com.ydtech.modules.base.controller.BaseController;
 import com.ydtech.modules.inv.model.InvAccountExpenses;
 import com.ydtech.modules.inv.model.InvAccountExpenses;
 import com.ydtech.modules.inv.service.InvAccountExpensesService;
 import com.ydtech.modules.inv.service.InvAccountExpensesService;
+import com.ydtech.utils.StringUtils;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;

+ 8 - 0
src/main/java/com/ydtech/modules/inv/model/InvAccountExpenses.java

@@ -1,5 +1,6 @@
 package com.ydtech.modules.inv.model;
 package com.ydtech.modules.inv.model;
 
 
+import com.baomidou.mybatisplus.annotation.FieldStrategy;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
 import com.baomidou.mybatisplus.annotation.TableName;
@@ -68,6 +69,13 @@ public class InvAccountExpenses implements Serializable {
     @ApiModelProperty(value = "更新者")
     @ApiModelProperty(value = "更新者")
     private String updateBy;
     private String updateBy;
 
 
+    /**
+     * 属性
+     */
+    @ApiModelProperty(value = "更新者")
+    @TableField(updateStrategy = FieldStrategy.IGNORED)
+    private String expenditureDetails;
+
     /**
     /**
      * 更新时间
      * 更新时间
      */
      */

+ 9 - 0
src/main/java/com/ydtech/modules/order/controller/PingAnOrderApiController.java

@@ -124,6 +124,15 @@ public class PingAnOrderApiController {
         return this.pingAnOrderApiService.additionalInformation(additionalInformation);
         return this.pingAnOrderApiService.additionalInformation(additionalInformation);
     }
     }
 
 
+    @GetMapping(value = "/checkAdditional")
+    @ApiOperation(value = "事后资料补传")
+    public HttpResult<Object> checkAdditional(String companyId) throws Exception {
+        if(StringUtils.isBlank(companyId)){
+            throw new SystemException("子订单id不能为空!!");
+        }
+        return this.pingAnOrderApiService.checkAdditional(companyId);
+    }
+
     /**
     /**
      *  @version
      *  @version
      *  @author: hxl
      *  @author: hxl

+ 1 - 1
src/main/java/com/ydtech/modules/order/dao/InsTaskImagesMapper.java

@@ -25,7 +25,7 @@ public interface InsTaskImagesMapper extends BaseMapper<InsTaskImages> {
      *  @Date: 2024/8/16 20:00
      *  @Date: 2024/8/16 20:00
      *  @Description: 通过ids查询数据
      *  @Description: 通过ids查询数据
      */
      */
-    List<InsUploadImagesDto> findByIds(@Param("list") List<String> imageList);
+    List<InsUploadImagesDto> findByIds(@Param("list") List<InsTaskImages> imageList);
 }
 }
 
 
 
 

+ 18 - 0
src/main/java/com/ydtech/modules/order/dao/PinganRecordMapper.java

@@ -0,0 +1,18 @@
+package com.ydtech.modules.order.dao;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.ydtech.modules.order.entity.po.PinganRecord;
+
+/**
+* @author Administrator
+* @description 针对表【pingan_record】的数据库操作Mapper
+* @createDate 2024-08-20 11:26:28
+* @Entity generator.domain.PinganRecord
+*/
+public interface PinganRecordMapper extends BaseMapper<PinganRecord> {
+
+}
+
+
+
+

+ 5 - 0
src/main/java/com/ydtech/modules/order/entity/api/pingan/response/QuoteResponse.java

@@ -1603,6 +1603,11 @@ public class QuoteResponse extends PingAnBaseResponse {
          */
          */
         private List<CombinationPremiumDetaillDTO> premiumList =new ArrayList<CombinationPremiumDetaillDTO>();
         private List<CombinationPremiumDetaillDTO> premiumList =new ArrayList<CombinationPremiumDetaillDTO>();
 
 
+        /***
+         * 组合险保费
+         */
+        private String  comPremium;
+
     }
     }
     @Data
     @Data
     public static class CombinationPremiumDetaillDTO implements Serializable {
     public static class CombinationPremiumDetaillDTO implements Serializable {

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

@@ -16,5 +16,9 @@ public class InsAreaCompanyQueryDto extends InsAreaCompany {
      * 是否外部订单
      * 是否外部订单
      */
      */
     private Integer isExternal;
     private Integer isExternal;
+    /***
+     *  补传资料状态
+     */
+    private String fileStatus;
 
 
 }
 }

+ 19 - 0
src/main/java/com/ydtech/modules/order/entity/po/InsTaskImages.java

@@ -4,6 +4,7 @@ import cn.hutool.core.date.DateTime;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
 import com.baomidou.mybatisplus.annotation.TableName;
+import com.ydtech.modules.order.entity.dto.InsTaskImagesDto;
 import com.ydtech.modules.order.entity.vo.InsTaskImagesVo;
 import com.ydtech.modules.order.entity.vo.InsTaskImagesVo;
 import com.ydtech.utils.idgen.IdGenerate;
 import com.ydtech.utils.idgen.IdGenerate;
 import lombok.Data;
 import lombok.Data;
@@ -70,4 +71,22 @@ public class InsTaskImages implements Serializable {
         this.creator = username;
         this.creator = username;
         this.createTime = DateTime.now();
         this.createTime = DateTime.now();
     }
     }
+
+    public InsTaskImages(InsTaskImages image, String quoteNo, String username) {
+        this.id = IdGenerate.nextId();
+        this.quoteNo = quoteNo;
+        this.imageType = image.getImageType();
+        this.imageId = image.getImageId();
+        this.creator = username;
+        this.createTime = DateTime.now();
+    }
+
+    public InsTaskImages(InsTaskImagesDto dto, String quoteNo, String username) {
+        this.id = IdGenerate.nextId();
+        this.quoteNo = quoteNo;
+        this.imageType = dto.getImageType();
+        this.imageId = dto.getImageId();
+        this.creator = username;
+        this.createTime = DateTime.now();
+    }
 }
 }

+ 131 - 0
src/main/java/com/ydtech/modules/order/entity/po/PinganRecord.java

@@ -0,0 +1,131 @@
+package com.ydtech.modules.order.entity.po;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * 
+ * @TableName pingan_record
+ */
+@TableName(value ="pingan_record")
+@Data
+public class PinganRecord implements Serializable {
+    /**
+     * 主键
+     */
+    @TableId
+    private Long id;
+
+    /**
+     * 子订单号
+     */
+    private String subOrderNo;
+
+    /**
+     * 财意险总保费
+     */
+    private BigDecimal ahsUpcTotalPremium;
+
+    /**
+     * 意外险保费
+     */
+    private BigDecimal ahsPremium;
+
+    /**
+     * 财产险保费
+     */
+    private BigDecimal upcPremium;
+
+    /**
+     * 小微险保费
+     */
+    private BigDecimal xwPremium;
+
+    /**
+     * 组合产品保费
+     */
+    private BigDecimal comPremium;
+
+    /**
+     * 创建时间
+     */
+    private Date createTime;
+
+    @TableField(exist = false)
+    private static final long serialVersionUID = 1L;
+
+    @Override
+    public boolean equals(Object that) {
+        if (this == that) {
+            return true;
+        }
+        if (that == null) {
+            return false;
+        }
+        if (getClass() != that.getClass()) {
+            return false;
+        }
+        PinganRecord other = (PinganRecord) that;
+        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
+            && (this.getSubOrderNo() == null ? other.getSubOrderNo() == null : this.getSubOrderNo().equals(other.getSubOrderNo()))
+            && (this.getAhsUpcTotalPremium() == null ? other.getAhsUpcTotalPremium() == null : this.getAhsUpcTotalPremium().equals(other.getAhsUpcTotalPremium()))
+            && (this.getAhsPremium() == null ? other.getAhsPremium() == null : this.getAhsPremium().equals(other.getAhsPremium()))
+            && (this.getUpcPremium() == null ? other.getUpcPremium() == null : this.getUpcPremium().equals(other.getUpcPremium()))
+            && (this.getXwPremium() == null ? other.getXwPremium() == null : this.getXwPremium().equals(other.getXwPremium()))
+            && (this.getComPremium() == null ? other.getComPremium() == null : this.getComPremium().equals(other.getComPremium()))
+            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()));
+    }
+
+    @Override
+    public int hashCode() {
+        final int prime = 31;
+        int result = 1;
+        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
+        result = prime * result + ((getSubOrderNo() == null) ? 0 : getSubOrderNo().hashCode());
+        result = prime * result + ((getAhsUpcTotalPremium() == null) ? 0 : getAhsUpcTotalPremium().hashCode());
+        result = prime * result + ((getAhsPremium() == null) ? 0 : getAhsPremium().hashCode());
+        result = prime * result + ((getUpcPremium() == null) ? 0 : getUpcPremium().hashCode());
+        result = prime * result + ((getXwPremium() == null) ? 0 : getXwPremium().hashCode());
+        result = prime * result + ((getComPremium() == null) ? 0 : getComPremium().hashCode());
+        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
+        return result;
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder sb = new StringBuilder();
+        sb.append(getClass().getSimpleName());
+        sb.append(" [");
+        sb.append("Hash = ").append(hashCode());
+        sb.append(", id=").append(id);
+        sb.append(", subOrderNo=").append(subOrderNo);
+        sb.append(", ahsUpcTotalPremium=").append(ahsUpcTotalPremium);
+        sb.append(", ahsPremium=").append(ahsPremium);
+        sb.append(", upcPremium=").append(upcPremium);
+        sb.append(", xwPremium=").append(xwPremium);
+        sb.append(", comPremium=").append(comPremium);
+        sb.append(", createTime=").append(createTime);
+        sb.append(", serialVersionUID=").append(serialVersionUID);
+        sb.append("]");
+        return sb.toString();
+    }
+
+    public PinganRecord() {
+    }
+
+    public PinganRecord(String subOrderNo, BigDecimal ahsUpcTotalPremium, BigDecimal ahsPremium, BigDecimal upcPremium, BigDecimal xwPremium, BigDecimal comPremium, Date createTime) {
+        this.subOrderNo = subOrderNo;
+        this.ahsUpcTotalPremium = ahsUpcTotalPremium;
+        this.ahsPremium = ahsPremium;
+        this.upcPremium = upcPremium;
+        this.xwPremium = xwPremium;
+        this.comPremium = comPremium;
+        this.createTime = createTime;
+    }
+}

+ 2 - 1
src/main/java/com/ydtech/modules/order/entity/vo/pingan/AdditionalInformation.java

@@ -1,5 +1,6 @@
 package com.ydtech.modules.order.entity.vo.pingan;
 package com.ydtech.modules.order.entity.vo.pingan;
 
 
+import com.ydtech.modules.order.entity.po.InsTaskImages;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import lombok.Data;
@@ -21,5 +22,5 @@ public class AdditionalInformation {
     private String companyId;
     private String companyId;
 
 
     @ApiModelProperty("影像集合id")
     @ApiModelProperty("影像集合id")
-    private List<String>  imageList=new ArrayList<String>();
+    private List<InsTaskImages>  imageList=new ArrayList<InsTaskImages>();
 }
 }

+ 3 - 2
src/main/java/com/ydtech/modules/order/service/InsUploadFilesService.java

@@ -29,9 +29,10 @@ public interface InsUploadFilesService extends IService<InsUploadFiles> {
         InsUploadFiles uploadFiles1 = getById(insUploadFiles.getId());
         InsUploadFiles uploadFiles1 = getById(insUploadFiles.getId());
         if (ObjectUtil.isEmpty(uploadFiles1)) {
         if (ObjectUtil.isEmpty(uploadFiles1)) {
             save(insUploadFiles);
             save(insUploadFiles);
-        }else{
-            updateById(insUploadFiles);
         }
         }
+        //else{
+        //    updateById(insUploadFiles);
+      //  }
         return insUploadFiles;
         return insUploadFiles;
     }
     }
 
 

+ 7 - 0
src/main/java/com/ydtech/modules/order/service/PingAnOrderApiService.java

@@ -270,4 +270,11 @@ public interface PingAnOrderApiService {
      *  @Description:  事后补传资料
      *  @Description:  事后补传资料
      */
      */
     HttpResult<Object> additionalInformation(AdditionalInformation additionalInformation);
     HttpResult<Object> additionalInformation(AdditionalInformation additionalInformation);
+    /**
+     *  @version
+     *  @author: hxl
+     *  @Date: 2024/8/20 10:45
+     *  @Description:  判断是否有需要补传的资料
+     */
+    HttpResult<Object> checkAdditional(String companyId);
 }
 }

+ 13 - 0
src/main/java/com/ydtech/modules/order/service/PinganRecordService.java

@@ -0,0 +1,13 @@
+package com.ydtech.modules.order.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.ydtech.modules.order.entity.po.PinganRecord;
+
+/**
+* @author Administrator
+* @description 针对表【pingan_record】的数据库操作Service
+* @createDate 2024-08-20 11:26:28
+*/
+public interface PinganRecordService extends IService<PinganRecord> {
+
+}

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

@@ -44,7 +44,7 @@ public class InsUploadFilesServiceImpl extends ServiceImpl<InsUploadFilesMapper,
         String fileMD5 = DigestUtils.md5Hex(multipartFile.getBytes());
         String fileMD5 = DigestUtils.md5Hex(multipartFile.getBytes());
         InsUploadFiles uploadFiles = getById(fileMD5);
         InsUploadFiles uploadFiles = getById(fileMD5);
         if (ObjectUtil.isNotEmpty(uploadFiles)) {
         if (ObjectUtil.isNotEmpty(uploadFiles)) {
-           // return uploadFiles;
+            return uploadFiles;
         }
         }
 
 
         // 文件上传实体
         // 文件上传实体

+ 134 - 33
src/main/java/com/ydtech/modules/order/service/impl/PingAnOrderApiServiceImpl.java

@@ -34,9 +34,11 @@ import com.ydtech.modules.order.entity.api.zijin.request.SubmitVerifyRequest;
 import com.ydtech.modules.order.entity.api.zijin.response.QueryClauseDataResponse;
 import com.ydtech.modules.order.entity.api.zijin.response.QueryClauseDataResponse;
 import com.ydtech.modules.order.entity.config.PingAnConfigureParameters;
 import com.ydtech.modules.order.entity.config.PingAnConfigureParameters;
 import com.ydtech.modules.order.entity.crawler.vo.CrawlerPolicyPrintVo;
 import com.ydtech.modules.order.entity.crawler.vo.CrawlerPolicyPrintVo;
+import com.ydtech.modules.order.entity.dto.InsTaskImagesDto;
 import com.ydtech.modules.order.entity.dto.InsUploadImagesDto;
 import com.ydtech.modules.order.entity.dto.InsUploadImagesDto;
 import com.ydtech.modules.order.entity.po.InsTaskImages;
 import com.ydtech.modules.order.entity.po.InsTaskImages;
 import com.ydtech.modules.order.entity.po.InsUploadFiles;
 import com.ydtech.modules.order.entity.po.InsUploadFiles;
+import com.ydtech.modules.order.entity.po.PinganRecord;
 import com.ydtech.modules.order.entity.po.PinganShUploafile;
 import com.ydtech.modules.order.entity.po.PinganShUploafile;
 import com.ydtech.modules.order.entity.vo.BaseQuoteInfoVo;
 import com.ydtech.modules.order.entity.vo.BaseQuoteInfoVo;
 import com.ydtech.modules.order.entity.vo.InsDrivingIntentionInsuranceVo;
 import com.ydtech.modules.order.entity.vo.InsDrivingIntentionInsuranceVo;
@@ -113,6 +115,8 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
 
 
     private final PinganShUploafileService pinganShUploafileService;
     private final PinganShUploafileService pinganShUploafileService;
 
 
+
+    private final  PinganRecordService  pinganRecordService;
     /**
     /**
      * @Description 获取财意险险种套餐列表  调用 4.4
      * @Description 获取财意险险种套餐列表  调用 4.4
      * @Author hxl
      * @Author hxl
@@ -476,6 +480,8 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
         //小微险保费
         //小微险保费
         quoteRespVo.setAhsUpcActualPremium(ahsUpcActualPremium);
         quoteRespVo.setAhsUpcActualPremium(ahsUpcActualPremium);
         quoteRespVo.setXwActualPremium(xwActualPremium);
         quoteRespVo.setXwActualPremium(xwActualPremium);
+        quoteRespVo.setCombinationPremium(combinationPremium);
+
         List<RiskInfoVo> riskList = yaQuoteInfoVo.getRiskList();
         List<RiskInfoVo> riskList = yaQuoteInfoVo.getRiskList();
         // 非车险
         // 非车险
         double jyPremium = 0;
         double jyPremium = 0;
@@ -483,15 +489,24 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
             //   财意险总保费
             //   财意险总保费
             double ahsUpcTotalPremium = Double.parseDouble(ahsUpcActualPremium.getAhsUpcTotalPremium() == null ? "0" : ahsUpcActualPremium.getAhsUpcTotalPremium());;
             double ahsUpcTotalPremium = Double.parseDouble(ahsUpcActualPremium.getAhsUpcTotalPremium() == null ? "0" : ahsUpcActualPremium.getAhsUpcTotalPremium());;
             jyPremium += ahsUpcTotalPremium;
             jyPremium += ahsUpcTotalPremium;
-            quoteRespVo.setCyPremium(ahsUpcTotalPremium);
+            double ahsPremium = Double.parseDouble(ahsUpcActualPremium.getAhsPremium() == null ? "0" : ahsUpcActualPremium.getAhsPremium());;
+            double upcPremium = Double.parseDouble(ahsUpcActualPremium.getUpcPremium() == null ? "0" : ahsUpcActualPremium.getUpcPremium());;
+            quoteRespVo.setAhsUpcTotalPremium(ahsUpcTotalPremium);
+            quoteRespVo.setCyPremium(ahsPremium);
+            quoteRespVo.setCcPremium(upcPremium);
         }
         }
         if (!ObjectUtils.isEmpty(xwActualPremium)) {
         if (!ObjectUtils.isEmpty(xwActualPremium)) {
             double xwPremium = Double.parseDouble(xwActualPremium.getXwPremium() == null ? "0" : xwActualPremium.getXwPremium());
             double xwPremium = Double.parseDouble(xwActualPremium.getXwPremium() == null ? "0" : xwActualPremium.getXwPremium());
             jyPremium += xwPremium;
             jyPremium += xwPremium;
             quoteRespVo.setXwPremium(xwPremium);
             quoteRespVo.setXwPremium(xwPremium);
         }
         }
-        jyPremium += zhAmount;
-        quoteRespVo.setZhPremium(zhAmount);
+        if (!ObjectUtils.isEmpty(combinationPremium)) {
+            //   财意险总保费
+            double zhPremium = Double.parseDouble(combinationPremium.getComPremium() == null ? "0" : combinationPremium.getComPremium());;
+            zhAmount = zhPremium;
+            jyPremium += zhAmount;
+            quoteRespVo.setZhPremium(zhAmount);
+        }
         //  报价险种放入保费
         //  报价险种放入保费
         List<QuoteRiskRespVo> riskList1 = QuoteRiskRespVo.toQuoteRiskRespVoList(riskList, jqPremium, syPremium);
         List<QuoteRiskRespVo> riskList1 = QuoteRiskRespVo.toQuoteRiskRespVoList(riskList, jqPremium, syPremium);
         quoteRespVo.setRiskList(riskList1);
         quoteRespVo.setRiskList(riskList1);
@@ -545,6 +560,11 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
         insAreaCompany.setJqRenewal("2".equals(carConfirmResponse.getForceRenewalType())?"1":carConfirmResponse.getForceRenewalType());
         insAreaCompany.setJqRenewal("2".equals(carConfirmResponse.getForceRenewalType())?"1":carConfirmResponse.getForceRenewalType());
         insAreaCompany.setSyRenewal("2".equals(carConfirmResponse.getBizRenewalType())?"1":carConfirmResponse.getBizRenewalType());
         insAreaCompany.setSyRenewal("2".equals(carConfirmResponse.getBizRenewalType())?"1":carConfirmResponse.getBizRenewalType());
         insAreaCompanyService.insertCompanyAndOrders(insAreaCompany);
         insAreaCompanyService.insertCompanyAndOrders(insAreaCompany);
+        PinganRecord pingAnRecord= new PinganRecord(insAreaCompany.getId(), new BigDecimal(quoteRespVo.getAhsUpcTotalPremium()), new BigDecimal(quoteRespVo.getCyPremium()),
+                new BigDecimal(quoteRespVo.getCcPremium()), new BigDecimal(quoteRespVo.getXwPremium()),
+                new BigDecimal(quoteRespVo.getZhPremium()), new Date());
+         //插入費用关联表
+        pinganRecordService.save(pingAnRecord);
         quoteRespVo.setCompanyId(insAreaCompany.getId());
         quoteRespVo.setCompanyId(insAreaCompany.getId());
         return HttpResult.ok("报价成功", quoteRespVo);
         return HttpResult.ok("报价成功", quoteRespVo);
     }
     }
@@ -2232,10 +2252,17 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
     @Override
     @Override
     public HttpResult<Object> additionalInformation(AdditionalInformation additionalInformation) {
     public HttpResult<Object> additionalInformation(AdditionalInformation additionalInformation) {
         String companyId = additionalInformation.getCompanyId();
         String companyId = additionalInformation.getCompanyId();
+        InsAreaCompany insAreaCompany = insAreaCompanyService.getByIdIsExist(companyId);
+
+        InsOrders insOrders = insOrdersService.existOrder(insAreaCompany.getOrderno());
+        // 账号信息
+        PtlAgreementAttribution ptlAgreementAttribution = ptlAgreementAttributionService.getById(insAreaCompany.getAgreementId());
+        PingAnConfigureParameters parameters = configureParametersComponents.toEntity(PingAnConfigureParameters.class,
+                ptlAgreementAttribution);
         if(StringUtils.isBlank(companyId)){
         if(StringUtils.isBlank(companyId)){
             throw new SystemException("子订单id不能为空!!!");
             throw new SystemException("子订单id不能为空!!!");
         }
         }
-        List<String> imageList = additionalInformation.getImageList();
+        List<InsTaskImages> imageList = additionalInformation.getImageList();
         if(imageList ==null  || imageList.size()==0){
         if(imageList ==null  || imageList.size()==0){
             throw new SystemException("补传资料不能为空!!!");
             throw new SystemException("补传资料不能为空!!!");
         }
         }
@@ -2249,43 +2276,117 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
         String errorMsg="";
         String errorMsg="";
         if(list ==null ||  list.size()==0){
         if(list ==null ||  list.size()==0){
             throw new SystemException("没有事后补传资料不必上传!!!");
             throw new SystemException("没有事后补传资料不必上传!!!");
-        }else{
-            msg ="需要补传资料为:";
+        }else {
+            msg = "需要补传资料为:";
             //判断上传的资料是否包含需要补传的信息资料不包含提示信息
             //判断上传的资料是否包含需要补传的信息资料不包含提示信息
-            List<InsUploadImagesDto> imgList = insTaskImagesMapper.findByIds(imageList);
-
-            if(imgList!=null && imgList.size()>0){
-
-                Map<String, String> map = new HashMap<>();
-                for(InsUploadImagesDto  dto :imgList){
-                    PingAnDocumentClassEnum fileEnum = PingAnDocumentClassEnum.getCode(dto.getImageType());
-                    String documentType = fileEnum.getDocumentType();
-                    map.put(documentType,documentType);
+            //刪除资料重新添加
+            List<InsTaskImages> insTaskImagesList = imageList
+                    .stream()
+                    .map(x -> new InsTaskImages(x, insOrders.getQuoteno(), insOrders.getUserid()))
+                    .collect(Collectors.toList());
+            List<InsTaskImages> imageOldList =insTaskImagesService.lambdaQuery().eq(InsTaskImages::getQuoteNo, insOrders.getQuoteno()).list();
+
+            if (!list.isEmpty()) {
+                List<String> collect = imageOldList.stream().map(InsTaskImages::getId).collect(Collectors.toList());
+                insTaskImagesService.removeBatchByIds(collect);
+            }
+            //保存
+            boolean b = insTaskImagesService.saveBatch(insTaskImagesList);
+            if(b){
+                List<InsTaskImagesDto> insTaskImagesDtos = insTaskImagesMapper.getByQuoteNoInsTaskImagesDtoList(insOrders.getQuoteno());
+                List<UploadFilesRequest.DocListDTO> docList = new ArrayList<>();
+                if (insTaskImagesDtos != null && insTaskImagesDtos.size() > 0) {
+                    Map<String, String> map = new HashMap<>();
+                    for (InsTaskImagesDto dto : insTaskImagesDtos) {
+                        PingAnDocumentClassEnum fileEnum = PingAnDocumentClassEnum.getCode(dto.getImageType());
+                        String documentType = fileEnum.getDocumentType();
+                        map.put(documentType, documentType);
+                    }
+                    for (PinganShUploafile dto : list) {
+                        String val = map.get(dto.getDocumentType());
+                        if (StringUtils.isBlank(val)) {
+                            errorMsg += dto.getDocumentClassName() + "-" + dto.getDocumentTypeName() + ";";
+                        }
+                        msg += dto.getDocumentClassName() + "-" + dto.getDocumentTypeName() + ";";
+                    }
                 }
                 }
-                for(PinganShUploafile  dto :list){
-                    String val = map.get(dto.getDocumentType());
-                    if(StringUtils.isBlank(val)){
-                        errorMsg+=dto.getDocumentClassName()+"-"+dto.getDocumentTypeName()+";";
+                if (StringUtils.isNotBlank(errorMsg)) {
+                    throw new SystemException(msg + "(" + errorMsg + "未上传)");
+                } else {
+                    List<InsTaskImages>  dtoList =new ArrayList<>();
+                    //上传文件接口
+                    for (InsTaskImagesDto dto : insTaskImagesDtos) {
+                        InsUploadFiles fiels = insUploadFilesService.getById(dto.getImageId());
+                        File file = new File(fiels.getFilePath());
+                        PingAnDocumentClassEnum fileEnum = PingAnDocumentClassEnum.getCode(dto.getImageType());
+                        String key = "";
+                        String documentClass = fileEnum.getDocument();
+                        String documentType = fileEnum.getDocumentType();
+                        String fileName = file.getName();
+                        String documentName = fileName.split("\\.")[0];
+                        String documentFormat = fileName.split("\\.")[1];
+                        if (StringUtils.isBlank(dto.getPinganKey())) {
+                            key = parameters.getUserId() + "-" + new SimpleDateFormat("yyyyMMddhhmmss").format(new Date()) + "-" + UUID.randomUUID();
+                            boolean upLoadFileFlag = PingAnUpLoadUtils.getUpLoadFile(properties.getHost(), properties.getBucket(), properties.getAk(), properties.getSk(), file, key);
+                            if (!upLoadFileFlag) {
+                                throw new SystemException("上传影像文件失败");
+                            }
+                            dto.setPinganKey(key);
+
+                        } else {
+                            key = dto.getPinganKey();
+                        }
+                        UploadFilesRequest.DocListDTO docListDTO = new UploadFilesRequest.DocListDTO(dto.getPinganKey(), documentClass, documentType, documentName, documentFormat, null);
+                        docList.add(docListDTO);
+                        InsTaskImages dtoNew = new InsTaskImages(dto, insOrders.getQuoteno(), insOrders.getUserid());
+                        dtoList.add(dtoNew);
+                    }
+                    //更新文件平安key
+                    boolean flag = insTaskImagesService.saveBatch(dtoList);
+                    //组装上传的资料信息提交
+                    UploadFilesResponse uploadFilesResponse = null;
+                    PinganApiLog pinganApiLog = new PinganApiLog(insAreaCompany.getOrderno(), insAreaCompany.getId(), insAreaCompany.getAgreementId());
+                    //调用文件上传
+                    UploadFilesRequest uploadRequest = new UploadFilesRequest(docList, insAreaCompany.getJqapplyno(), insAreaCompany.getJqapplyno(), parameters.getUserId(), "openApi");
+                    try {
+                        uploadFilesResponse = pinganRequestApiComponents.uploadFiles(uploadRequest, pinganApiLog);
+                    } catch (Exception e) {
+                        throw new SystemException(e.getMessage());
+                    }
+                    if (uploadFilesResponse != null && "0".equals(uploadFilesResponse.getResultCode())) {
+                        //将补传资料的数据更新为1
+                        List<PinganShUploafile> newList = list.stream()
+                                .map(item -> {
+                                    item.setStatus("1");
+                                    return item;
+                                })
+                                .collect(Collectors.toList());
+                        pinganShUploafileService.updateBatchById(newList);
                     }
                     }
-                    msg+=dto.getDocumentClassName()+"-"+dto.getDocumentTypeName()+";";
                 }
                 }
-                errorMsg+="未上传";
-            }
-            if(StringUtils.isNotBlank(errorMsg)){
-                throw  new SystemException(msg+"("+errorMsg+")");
-            }else{
-                //将补传资料的数据更新为1
-                List<PinganShUploafile> newList = list.stream()
-                        .map(item -> {
-                            item.setStatus("1");
-                            return item;
-                        })
-                        .collect(Collectors.toList());
-                pinganShUploafileService.updateBatchById(newList);
             }
             }
         }
         }
         return HttpResult.ok("补传资料成功!!");
         return HttpResult.ok("补传资料成功!!");
     }
     }
+    /**
+     *  @version
+     *  @author: hxl
+     *  @Date: 2024/8/20 10:48
+     *  @Description: 判断是否需要补传资料
+     */
+    @Override
+    public HttpResult<Object> checkAdditional(String companyId) {
+        //通过子订单id查询需要补传的数据集合
+        LambdaQueryWrapper<PinganShUploafile> queryWrapper = new LambdaQueryWrapper<>();
+        queryWrapper.eq(PinganShUploafile::getSubOrderNo, companyId);
+        queryWrapper.eq(PinganShUploafile::getStatus, "0");
+        List<PinganShUploafile> list = pinganShUploafileService.list(queryWrapper);
+        //判断前台数据是否包含所有的回传资料
+        if(list ==null ||  list.size()==0) {
+            throw new SystemException("没有事后补传资料不必上传!!!");
+        }
+        return HttpResult.ok("需要补传资料!!");
+    }
 
 
     /**
     /**
      * @version
      * @version

+ 22 - 0
src/main/java/com/ydtech/modules/order/service/impl/PinganRecordServiceImpl.java

@@ -0,0 +1,22 @@
+package com.ydtech.modules.order.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.ydtech.modules.order.dao.PinganRecordMapper;
+import com.ydtech.modules.order.entity.po.PinganRecord;
+import com.ydtech.modules.order.service.PinganRecordService;
+import org.springframework.stereotype.Service;
+
+/**
+* @author Administrator
+* @description 针对表【pingan_record】的数据库操作Service实现
+* @createDate 2024-08-20 11:26:28
+*/
+@Service
+public class PinganRecordServiceImpl extends ServiceImpl<PinganRecordMapper, PinganRecord>
+    implements PinganRecordService {
+
+}
+
+
+
+

+ 6 - 9
src/main/java/com/ydtech/modules/protocols/controller/PtlNewAgreementController.java

@@ -4,20 +4,18 @@ package com.ydtech.modules.protocols.controller;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.ydtech.constants.enums.InsuranceRisk;
 import com.ydtech.constants.enums.InsuranceRisk;
 import com.ydtech.core.page.HttpResult;
 import com.ydtech.core.page.HttpResult;
-import com.ydtech.core.page.PageRequest;
 import com.ydtech.core.page.PageResult;
 import com.ydtech.core.page.PageResult;
 import com.ydtech.modules.base.controller.BaseController;
 import com.ydtech.modules.base.controller.BaseController;
-import com.ydtech.modules.fee.service.FeeRuleSchemeNewService;
 import com.ydtech.modules.order.entity.vo.FeeOrderNewRecordVo;
 import com.ydtech.modules.order.entity.vo.FeeOrderNewRecordVo;
-import com.ydtech.modules.order.entity.vo.FeeOrderNewVo;
 import com.ydtech.modules.protocol.entity.po.PtlAgreement;
 import com.ydtech.modules.protocol.entity.po.PtlAgreement;
-import com.ydtech.modules.protocol.entity.po.PtlAgreementProductCosts;
-import com.ydtech.modules.protocol.entity.vo.PtlAgreementPageVo;
-import com.ydtech.modules.protocol.entity.vo.PtlAgreementProductQueryVo;
 import com.ydtech.modules.protocol.service.PtlAgreementService;
 import com.ydtech.modules.protocol.service.PtlAgreementService;
-import com.ydtech.modules.protocols.entity.po.*;
+import com.ydtech.modules.protocols.entity.po.PtlAgreementProductCostsNew;
+import com.ydtech.modules.protocols.entity.po.PtlAgreementUndwrtRulesAttr;
 import com.ydtech.modules.protocols.entity.vo.*;
 import com.ydtech.modules.protocols.entity.vo.*;
-import com.ydtech.modules.protocols.service.*;
+import com.ydtech.modules.protocols.service.PtlAgreementProductCostsNewService;
+import com.ydtech.modules.protocols.service.PtlAgreementProductCostsTrajectoryService;
+import com.ydtech.modules.protocols.service.PtlAgreementUndwrtRulesAttrService;
+import com.ydtech.modules.protocols.service.PtlAgreementUndwrtRulesNewService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiOperation;
 import org.apache.poi.ss.formula.functions.T;
 import org.apache.poi.ss.formula.functions.T;
@@ -25,7 +23,6 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.bind.annotation.*;
 
 
 import java.util.List;
 import java.util.List;
-import java.util.Map;
 
 
 /**
 /**
 *@author: tz
 *@author: tz

+ 21 - 0
src/main/resources/mapper/modules/admin/KztDataPermissionMapper.xml

@@ -0,0 +1,21 @@
+<?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.admin.dao.KztDataPermissionMapper">
+
+    <resultMap id="BaseResultMap" type="com.ydtech.modules.admin.model.po.KztDataPermission">
+            <id property="id" column="id" jdbcType="BIGINT"/>
+            <result property="menuId" column="menu_id" jdbcType="BIGINT"/>
+            <result property="customScriptFlag" column="custom_script_flag" jdbcType="TINYINT"/>
+            <result property="dataPermissionId" column="data_permission_id" jdbcType="BIGINT"/>
+            <result property="scriptContent" column="script_content" jdbcType="VARCHAR"/>
+            <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
+             <result property="url" column="url" jdbcType="VARCHAR"/>
+    </resultMap>
+
+    <sql id="Base_Column_List">
+        id,menu_id,custom_script_flag,
+        data_permission_id,script_content,create_time,url
+    </sql>
+</mapper>

+ 4 - 1
src/main/resources/mapper/modules/admin/SysDeptMapper.xml

@@ -45,8 +45,11 @@
         SELECT IFNULL(MAX(id), 0) maxid
         SELECT IFNULL(MAX(id), 0) maxid
         FROM `sys_dept`
         FROM `sys_dept`
         WHERE parent_id = #{deptId}
         WHERE parent_id = #{deptId}
-    </select>
+        <if test='deptType != null and deptType != ""'>
+            and id NOT LIKE '%M%'
+        </if>
 
 
+    </select>
 
 
     <select id="queryListByParentId" resultType="com.ydtech.modules.admin.model.SysDept">
     <select id="queryListByParentId" resultType="com.ydtech.modules.admin.model.SysDept">
         SELECT
         SELECT

+ 27 - 0
src/main/resources/mapper/modules/admin/SysMenuMapper.xml

@@ -0,0 +1,27 @@
+<?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.admin.dao.SysMenuMapper">
+
+
+    <select id="findBySysTypeList" resultType="com.ydtech.modules.admin.model.SysMenu">
+        SELECT
+            p.id,
+            p.NAME,
+            p.url,
+            p.perms,
+            p.type,
+            p.icon,
+            p.order_num,
+            p.parent_id as parentId,
+            pp.NAME AS parentName,
+            pp.url AS parentUrl
+        FROM
+            sys_menu p
+                LEFT JOIN sys_menu pp ON p.parent_id = pp.id
+        WHERE
+            p.del_flag = #{delFlag}
+          AND p.sys_type = #{sysType}
+    </select>
+</mapper>

+ 208 - 0
src/main/resources/mapper/modules/fnc/InsPlyIncomeMapper.xml

@@ -2838,4 +2838,212 @@
         </where>
         </where>
         GROUP BY DATE_FORMAT( a.signdate, '%Y-%m' )
         GROUP BY DATE_FORMAT( a.signdate, '%Y-%m' )
     </select>
     </select>
+    <select id="getProfitAnalysisQueryList" resultType="com.ydtech.modules.admin.model.report.profitAnalysis.ProfitAnalysisDto">
+        SELECT
+            a.signingTime as "signingTime",
+            a.sumpremium as "sumpremium",
+            b.allAmount as "sumcount",
+            d.settlement as "meet",
+            c.ActualPayment as "paid",
+            ifnull(d.settlement,0) - IFNULL(c.ActualPayment,0)  as "unpaid",
+            IFNULL( b.allAmount,0)- IFNULL (d.settlement,0)  as "grossProfit",
+            e.applyAmount  as "laborCost",
+            f.applyAmount  as "fixedCost",
+            j.applyAmount  as "variableCost",
+            (IFNULL (b.allAmount,0) - IFNULL(d.settlement,0) ) -( IFNULL(e.applyAmount,0) + IFNULL(f.applyAmount,0) + IFNULL(j.applyAmount,0) ) as "operatingProfit",
+            g.applyAmount  as "税费",
+            (IFNULL(b.allAmount,0)- IFNULL(d.settlement,0) ) -( IFNULL(e.applyAmount,0) + IFNULL(f.applyAmount,0) + IFNULL(j.applyAmount,0) ) - IFNULL(g.applyAmount,0) as "netProfit"
+        FROM
+            (
+                SELECT
+                    sum( iac.sumpremium ) as "sumpremium",
+                    DATE_FORMAT( iac.signing_time, '%Y-%m' ) AS "signingTime"
+                FROM
+                    `ins_fee_audit` ifa
+                        LEFT JOIN ins_area_company iac ON iac.id = ifa.ins_order_no
+                WHERE
+                    ifa.auditstatus = '1'
+                  AND iac.signing_time IS NOT NULL
+                GROUP BY
+                    DATE_FORMAT( iac.signing_time, '%Y-%m' )
+            ) a
+                LEFT JOIN (
+                SELECT
+                    sum( ipi.commission_feevalue +ipi.other_feevalue ) as "allAmount",
+                    DATE_FORMAT( ipi.signdate, '%Y-%m' ) AS "signingTime"
+                FROM
+                    ins_ply_income ipi
+                GROUP BY
+                    DATE_FORMAT( ipi.signdate, '%Y-%m' )
+            ) b ON a.signingTime = b.signingTime
+                left  join (
+                select
+                    sum(a.amount) as "ActualPayment",DATE_FORMAT( a.auditing_time, '%Y-%m' )  as "auditingTime"
+                from sys_amount_auditing a
+                         left join sys_user_account_history b on a.id = b.auditiing_id
+                         left join sys_user su on su.id =a.user_id
+                where a.auditing_status= '3'
+                GROUP BY DATE_FORMAT( a.auditing_time, '%Y-%m' )
+            ) c  on  c.auditingTime  =a.signingTime
+        left  join  (
+                SELECT
+                    sum(
+                            ifo.jq_export_supervise_costs_premiums + ifo.sy_export_supervise_costs_premiums + ifo.no_export_supervise_costs_premiums + ifo.jq_export_other_costs_premiums + ifo.sy_export_other_costs_premiums + ifo.no_export_other_costs_premiums + ifo.first_detail_premiums + ifo.second_detail_premiums + ifo.third_detail_premiums
+                    ) AS "settlement",
+                    DATE_FORMAT( iac.signing_time, '%Y-%m' )  as "signingTime"
+                FROM
+                    ins_fee_order_new ifo
+                        LEFT JOIN ins_fee_audit ifa ON ifo.ins_order_no = ifa.ins_order_no
+                        LEFT JOIN ins_area_company iac ON ifa.ins_order_no = iac.id
+                WHERE
+                    ifa.auditstatus = '1'
+                  AND iac.orderstatus = '3'
+                GROUP BY
+                    DATE_FORMAT( iac.signing_time, '%Y-%m' )
+            ) d  on  d.signingTime =a.signingTime
+        left join  (
+                SELECT
+                    sum(apply_amount) as "applyAmount",
+                    DATE_FORMAT( a.create_time, '%Y-%m' ) as "createTime",
+                    b.expenditureDetails
+                FROM
+                    inv_account_operate a
+                        left  join  (
+                        select a.category as "aCategory",b. category as "bCategory",a.expenditure_details as "expenditureDetails" from  inv_account_expenses a
+                                                                                                                                            left  join  inv_account_expenses  b  on a.parent_id =b.expenses_id
+                        where   b.category  is  not  null
+                    )  b on a.fund_use  = b.bCategory  and  a.fund_fen  = b.aCategory
+                WHERE
+                    a.out_card_num IN (
+                        SELECT
+                            bank_card_num
+                        FROM
+                            inv_account_card iac
+                                LEFT JOIN inv_account ia ON iac.account_id = ia.account_id
+                        WHERE
+                            ia.del_flag = '0'
+                          AND ia.outer_flag LIKE concat( '%', '0', '%' )
+                    )
+                  AND a.revenue_outlay = '1'
+                  AND a.del_flag = '0'
+                  AND b.expenditureDetails = '1'
+                GROUP BY  DATE_FORMAT( a.create_time, '%Y-%m' )  , b.expenditureDetails
+            ) e on  e.createTime =a.signingTime
+        left  join (
+                SELECT
+                    sum(apply_amount) as "applyAmount",
+                    DATE_FORMAT( a.create_time, '%Y-%m' ) as "createTime",
+                    b.expenditureDetails
+                FROM
+                    inv_account_operate a
+                        left  join  (
+                        select a.category as "aCategory",b. category as "bCategory",a.expenditure_details as "expenditureDetails" from  inv_account_expenses a
+                                                                                                                                            left  join  inv_account_expenses  b  on a.parent_id =b.expenses_id
+                        where   b.category  is  not  null
+                    )  b on a.fund_use  = b.bCategory  and  a.fund_fen  = b.aCategory
+                WHERE
+                    a.out_card_num IN (
+                        SELECT
+                            bank_card_num
+                        FROM
+                            inv_account_card iac
+                                LEFT JOIN inv_account ia ON iac.account_id = ia.account_id
+                        WHERE
+                            ia.del_flag = '0'
+                          AND ia.outer_flag LIKE concat( '%', '0', '%' )
+                    )
+                  AND a.revenue_outlay = '1'
+                  AND a.del_flag = '0'
+                  AND b.expenditureDetails = '2'
+                GROUP BY  DATE_FORMAT( a.create_time, '%Y-%m' )  , b.expenditureDetails
+            ) f on  f.createTime =a.signingTime
+            left join  (
+                SELECT
+                    sum(apply_amount) as "applyAmount",
+                    DATE_FORMAT( a.create_time, '%Y-%m' ) as "createTime",
+                    b.expenditureDetails
+                FROM
+                    inv_account_operate a
+                        left  join  (
+                        select a.category as "aCategory",b. category as "bCategory",a.expenditure_details as "expenditureDetails" from  inv_account_expenses a
+                                                                                                                                            left  join  inv_account_expenses  b  on a.parent_id =b.expenses_id
+                        where   b.category  is  not  null
+                    )  b on a.fund_use  = b.bCategory  and  a.fund_fen  = b.aCategory
+                WHERE
+                    a.out_card_num IN (
+                        SELECT
+                            bank_card_num
+                        FROM
+                            inv_account_card iac
+                                LEFT JOIN inv_account ia ON iac.account_id = ia.account_id
+                        WHERE
+                            ia.del_flag = '0'
+                          AND ia.outer_flag LIKE concat( '%', '0', '%' )
+                    )
+                  AND a.revenue_outlay = '1'
+                  AND a.del_flag = '0'
+                  AND b.expenditureDetails = '3'
+                GROUP BY  DATE_FORMAT( a.create_time, '%Y-%m' )  , b.expenditureDetails
+            ) j on  j.createTime =a.signingTime
+         left  join (
+                SELECT
+                    sum(apply_amount) as "applyAmount",
+                    DATE_FORMAT( a.create_time, '%Y-%m' ) as "createTime",
+                    b.expenditureDetails
+                FROM
+                    inv_account_operate a
+                        left  join  (
+                        select a.category as "aCategory",b. category as "bCategory",a.expenditure_details as "expenditureDetails" from  inv_account_expenses a
+                                                                                                                                            left  join  inv_account_expenses  b  on a.parent_id =b.expenses_id
+                        where   b.category  is  not  null
+                    )  b on a.fund_use  = b.bCategory  and  a.fund_fen  = b.aCategory
+                WHERE
+                    a.out_card_num IN (
+                        SELECT
+                            bank_card_num
+                        FROM
+                            inv_account_card iac
+                                LEFT JOIN inv_account ia ON iac.account_id = ia.account_id
+                        WHERE
+                            ia.del_flag = '0'
+                          AND ia.outer_flag LIKE concat( '%', '0', '%' )
+                    )
+                  AND a.revenue_outlay = '1'
+                  AND a.del_flag = '0'
+                  AND b.expenditureDetails = '4'
+                GROUP BY  DATE_FORMAT( a.create_time, '%Y-%m' )  , b.expenditureDetails
+            )  g  on  g.createTime  =a.signingTime
+
+    </select>
+
+
+    <select id="getInvociAmount" resultType="com.ydtech.modules.fnc.dto.InsuranceHandlingSettlementMonthDto" >
+        select
+        DATE_FORMAT( a.signdate, '%Y-%m' ) as "incomeSigningTime",
+        a.task_id as "taskId",
+        sum(a.commission_feevalue) as "totalAmount"
+        from  ins_ply_income a
+        LEFT  JOIN  ptl_agreement  pa  on  a.agreement_id  = pa.id
+        LEFT  JOIN  sys_user   su  on su.id=a.user_id
+        LEFT  JOIN  sys_user   su1  on su1.id=a.settlement_user_id
+        LEFT  JOIN  sys_user   su2  on su2.id=a.update_user_id
+        LEFT  JOIN   ins_upload_files  upf   on  a.settlement_image_id=upf.id
+        LEFT  JOIN   esm_ins_company  eic   on  eic.id=a.partner_companies_id
+        LEFT  JOIN   sys_dept b on pa.dept_id=b.id
+        <where>
+            1=1
+            <if test="vo.isNotCar !=null  and  vo.isNotCar  !=''">
+                and a.is_not_car =#{vo.isNotCar}
+            </if>
+
+            <if test="vo.isNotDocumentary !=null  and  vo.isNotDocumentary  !=''">
+                and a.is_not_documentary   =#{vo.isNotDocumentary}
+            </if>
+
+            <if test="vo.taskId != null and vo.taskId != ''">
+                and a.task_id = #{vo.taskId}
+            </if>
+        </where>
+        group by   a.task_id  , DATE_FORMAT( a.signdate, '%Y-%m' )
+    </select>
 </mapper>
 </mapper>

+ 1 - 1
src/main/resources/mapper/modules/ins/InsTaskImagesMapper.xml

@@ -44,7 +44,7 @@
                            on i.image_id = f.id
                            on i.image_id = f.id
         where f.id in
         where f.id in
         <foreach item="item" index="index" collection="list" open="(" separator="," close=")">
         <foreach item="item" index="index" collection="list" open="(" separator="," close=")">
-            #{item}
+            #{item.imageId}
         </foreach>
         </foreach>
     </select>
     </select>
 
 

+ 24 - 18
src/main/resources/mapper/modules/insuranceHandlingSettlementMonth/InsuranceHandlingSettlementMonthMapper.xml

@@ -7,21 +7,16 @@
                 a.task_id  as  "taskId",
                 a.task_id  as  "taskId",
                 a.settlement_documentary_fees_id  as  "settlementDocumentaryFeesId",
                 a.settlement_documentary_fees_id  as  "settlementDocumentaryFeesId",
                 a.partner_companies_id  as  "partnerCompaniesId",
                 a.partner_companies_id  as  "partnerCompaniesId",
-                a.settlement_amount  as  "settlementAmount",
+                IFNULL(a.settlement_amount,0)  as  "settlementAmount",
                 a.total_amount  as  "totalAmount",
                 a.total_amount  as  "totalAmount",
                 a.remaining_amount  as  "remainingAmount",
                 a.remaining_amount  as  "remainingAmount",
                 a.create_time  as  "createTime",
                 a.create_time  as  "createTime",
                 a.signing_time  as  "signingTime",
                 a.signing_time  as  "signingTime",
+                DATE_FORMAT( a.signing_time, '%Y-%m' )  as  "incomeSigningTime",
                 a.creater_id  as  "createrId"
                 a.creater_id  as  "createrId"
     </sql>
     </sql>
 
 
     <select id="queryList" resultType="com.ydtech.modules.fnc.dto.InsuranceHandlingSettlementMonthDto">
     <select id="queryList" resultType="com.ydtech.modules.fnc.dto.InsuranceHandlingSettlementMonthDto">
-        select ipi.task_id as "taskId" ,
-        sum(IFNULL(ipi.commission_feevalue),0) as"invoiccommissionFeevalue"
-        from
-        ins_ply_income ipi
-        left join ptl_agreement pa on pa.id=ipi.agreement_id
-        left join (
         select
         select
         <include refid="insuranceHandling_com"/>
         <include refid="insuranceHandling_com"/>
         from
         from
@@ -35,23 +30,34 @@
                 AND  a.task_id=#{vo.taskId}
                 AND  a.task_id=#{vo.taskId}
             </if>
             </if>
         </where>
         </where>
-        )  b on b. taskId =ipi.task_id
+    </select>
+
+  <select id="queryListNew" resultType="com.ydtech.modules.fnc.dto.InsuranceHandlingSettlementMonthDto">
+        select
+          max( a.id ) AS "id",
+          max( a.task_id ) AS "taskId",
+          max( a.settlement_documentary_fees_id ) AS "settlementDocumentaryFeesId",
+          max( a.partner_companies_id ) AS "partnerCompaniesId",
+          max( IFNULL( a.settlement_amount, 0 ) ) AS "settlementAmount",
+          max( a.total_amount ) AS "totalAmount",
+          min( a.remaining_amount ) AS "remainingAmount",
+          max( a.create_time ) AS "createTime",
+          max( a.signing_time ) AS "signingTime",
+          max( DATE_FORMAT( a.signing_time, '%Y-%m' ) ) AS "incomeSigningTime",
+          max( a.creater_id ) AS "createrId"
+      from
+        sys_insurance_handling_settlement_month a
         <where>
         <where>
-            pa.agreement_type ='2'
-            AND ipi.task_id is  not  null
-            <if test="vo.isNotCar  !=null and vo.isNotCar !=''">
-                AND ipi.is_not_car =#{vo.isNotCar}
-            </if>
-            <if test="vo.isnotDocumentary !=null and vo.isnotDocumentary !=''">
-                AND ipi.is_not_documentary =#{vo.isnotDocumentary}
+            1=1
+            <if test="vo.partnerCompaniesId  !=null  and  vo.partnerCompaniesId!=''">
+                AND  a.partner_companies_id=#{vo.partnerCompaniesId}
             </if>
             </if>
             <if test="vo.taskId  !=null  and  vo.taskId!=''">
             <if test="vo.taskId  !=null  and  vo.taskId!=''">
                 AND  a.task_id=#{vo.taskId}
                 AND  a.task_id=#{vo.taskId}
             </if>
             </if>
         </where>
         </where>
-        group by ipi.task_id
-
-
+      GROUP BY
+      a.task_id, DATE_FORMAT(a.signing_time,  '%Y-%m' )
     </select>
     </select>
 
 
 
 

+ 2 - 1
src/main/resources/mapper/modules/inv/InvAccountExpensesMapper.xml

@@ -14,12 +14,13 @@
             <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
             <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
             <result property="updateBy" column="update_by" jdbcType="VARCHAR"/>
             <result property="updateBy" column="update_by" jdbcType="VARCHAR"/>
             <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
             <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
+            <result property="expenditure_details" column="expenditureDetails" jdbcType="VARCHAR"/>
     </resultMap>
     </resultMap>
 
 
     <sql id="Base_Column_List">
     <sql id="Base_Column_List">
         expenses_id,category,parent_id,
         expenses_id,category,parent_id,
         remark,del_flag,create_by,
         remark,del_flag,create_by,
-        create_time,update_by,update_time
+        create_time,update_by,update_time,expenditure_details
     </sql>
     </sql>
     <select id="selectExpensesList" resultType="com.ydtech.modules.inv.model.InvAccountExpenses">
     <select id="selectExpensesList" resultType="com.ydtech.modules.inv.model.InvAccountExpenses">
         select
         select

+ 5 - 2
src/main/resources/mapper/modules/order/InsAreaCompanyMapper.xml

@@ -77,6 +77,7 @@
     <resultMap id="InsAreaCompanyQueryDto" type="com.ydtech.modules.order.entity.dto.InsAreaCompanyQueryDto"
     <resultMap id="InsAreaCompanyQueryDto" type="com.ydtech.modules.order.entity.dto.InsAreaCompanyQueryDto"
                extends="BaseResultMap">
                extends="BaseResultMap">
         <result property="agreementName" column="agreement_name" jdbcType="VARCHAR"/>
         <result property="agreementName" column="agreement_name" jdbcType="VARCHAR"/>
+        <result property="fileStatus" column="file_status" jdbcType="VARCHAR"/>
     </resultMap>
     </resultMap>
 
 
     <sql id="Base_Column_List">
     <sql id="Base_Column_List">
@@ -92,7 +93,8 @@
     </sql>
     </sql>
 
 
     <select id="selectByOrderNo" resultMap="InsAreaCompanyQueryDto">
     <select id="selectByOrderNo" resultMap="InsAreaCompanyQueryDto">
-        SELECT iac.*, pa.agreement_name
+        SELECT iac.*, pa.agreement_name,
+               (select IF(count(0)>0,'true','false') from pingan_sh_uploafile  where sub_order_no=iac.id  AND  status=0) as fileStatus
         FROM ins_area_company as iac
         FROM ins_area_company as iac
                  left join ptl_agreement as pa on pa.id = iac.agreement_id
                  left join ptl_agreement as pa on pa.id = iac.agreement_id
                  INNER JOIN (SELECT company_id, max(createtime) AS max_createtime
                  INNER JOIN (SELECT company_id, max(createtime) AS max_createtime
@@ -104,7 +106,8 @@
     </select>
     </select>
 
 
     <select id="selectAcceptInsurance" resultMap="InsAreaCompanyQueryDto">
     <select id="selectAcceptInsurance" resultMap="InsAreaCompanyQueryDto">
-        SELECT iac.*, pa.agreement_name,io.is_external
+        SELECT iac.*, pa.agreement_name,io.is_external,
+        (select IF(count(0)>0,'true','false') from pingan_sh_uploafile  where sub_order_no=iac.id  AND  status=0) as fileStatus
         FROM ins_area_company as iac
         FROM ins_area_company as iac
                  left join ptl_agreement as pa on pa.id = iac.agreement_id
                  left join ptl_agreement as pa on pa.id = iac.agreement_id
                 left join ins_orders io on iac.orderno=io.orderno
                 left join ins_orders io on iac.orderno=io.orderno

+ 23 - 0
src/main/resources/mapper/modules/order/PinganRecordMapper.xml

@@ -0,0 +1,23 @@
+<?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.order.dao.PinganRecordMapper">
+
+    <resultMap id="BaseResultMap" type="com.ydtech.modules.order.entity.po.PinganRecord">
+            <id property="id" column="id" jdbcType="BIGINT"/>
+            <result property="subOrderNo" column="sub_order_no" jdbcType="VARCHAR"/>
+            <result property="ahsUpcTotalPremium" column="ahs_upc_total_premium" jdbcType="DECIMAL"/>
+            <result property="ahsPremium" column="ahs_premium" jdbcType="DECIMAL"/>
+            <result property="upcPremium" column="upc_premium" jdbcType="DECIMAL"/>
+            <result property="xwPremium" column="xw_premium" jdbcType="DECIMAL"/>
+            <result property="comPremium" column="com_premium" jdbcType="DECIMAL"/>
+            <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
+    </resultMap>
+
+    <sql id="Base_Column_List">
+        id,sub_order_no,ahs_upc_total_premium,
+        ahs_premium,upc_premium,xw_premium,
+        com_premium,create_time,url
+    </sql>
+</mapper>