Jelajahi Sumber

Merge remote-tracking branch 'origin/test' into test

785834757 2 tahun lalu
induk
melakukan
beee5c98a1
53 mengubah file dengan 1268 tambahan dan 256 penghapusan
  1. 7 0
      src/main/java/com/ydtech/components/TokenInterceptor.java
  2. 2 2
      src/main/java/com/ydtech/config/properties/PingAnApiConfigurationProperties.java
  3. 32 0
      src/main/java/com/ydtech/modules/admin/controller/SysLoginController.java
  4. 1 0
      src/main/java/com/ydtech/modules/admin/controller/SysMenuController.java
  5. 3 0
      src/main/java/com/ydtech/modules/admin/controller/SysRoleController.java
  6. 15 1
      src/main/java/com/ydtech/modules/admin/controller/SysUserController.java
  7. 78 0
      src/main/java/com/ydtech/modules/admin/controller/financialReceivables/FinancialReceivablesController.java
  8. 1 1
      src/main/java/com/ydtech/modules/admin/dao/SysRoleMenuMapper.java
  9. 11 0
      src/main/java/com/ydtech/modules/admin/dao/SysUserTrackMapper.java
  10. 6 0
      src/main/java/com/ydtech/modules/admin/model/SysMenu.java
  11. 7 0
      src/main/java/com/ydtech/modules/admin/model/SysRole.java
  12. 33 0
      src/main/java/com/ydtech/modules/admin/model/SysUserTrack.java
  13. 6 0
      src/main/java/com/ydtech/modules/admin/model/dto/SysUserTeamInfoDto.java
  14. 46 0
      src/main/java/com/ydtech/modules/admin/model/report/financialReceivables/FinancialReceivablesAllMonthVo.java
  15. 42 0
      src/main/java/com/ydtech/modules/admin/model/report/financialReceivables/FinancialReceivablesAllVo.java
  16. 42 0
      src/main/java/com/ydtech/modules/admin/model/report/financialReceivables/FinancialReceivablesMonthVo.java
  17. 29 0
      src/main/java/com/ydtech/modules/admin/model/report/financialReceivables/FinancialReceivablesQueryMonthVo.java
  18. 29 0
      src/main/java/com/ydtech/modules/admin/model/report/financialReceivables/FinancialReceivablesQueryVo.java
  19. 36 0
      src/main/java/com/ydtech/modules/admin/model/report/financialReceivables/FinancialReceivablesVo.java
  20. 2 2
      src/main/java/com/ydtech/modules/admin/model/report/profitAnalysis/ProfitAnalysisDto.java
  21. 1 0
      src/main/java/com/ydtech/modules/admin/model/vo/LoginBean.java
  22. 7 0
      src/main/java/com/ydtech/modules/admin/model/vo/SysUserBaseVO.java
  23. 10 0
      src/main/java/com/ydtech/modules/admin/service/SysUserTrackService.java
  24. 9 4
      src/main/java/com/ydtech/modules/admin/service/impl/AppCustomerManagementImpl.java
  25. 3 1
      src/main/java/com/ydtech/modules/admin/service/impl/SysMenuServiceImpl.java
  26. 30 0
      src/main/java/com/ydtech/modules/admin/service/impl/SysUserServiceImpl.java
  27. 17 0
      src/main/java/com/ydtech/modules/admin/service/impl/SysUserTrackServiceImpl.java
  28. 41 4
      src/main/java/com/ydtech/modules/admin/utils/SliceUpDateUtil.java
  29. 15 0
      src/main/java/com/ydtech/modules/esm/controller/EsmUserController.java
  30. 4 0
      src/main/java/com/ydtech/modules/esm/dao/EsmUserReferrerMapper.java
  31. 30 0
      src/main/java/com/ydtech/modules/esm/model/vo/EsmUserPolicyForUserVO.java
  32. 2 5
      src/main/java/com/ydtech/modules/esm/service/EsmUserReferrerService.java
  33. 12 4
      src/main/java/com/ydtech/modules/esm/service/impl/EsmUserReferrerServiceImpl.java
  34. 30 0
      src/main/java/com/ydtech/modules/fnc/dao/InsPlyIncomeMapper.java
  35. 18 1
      src/main/java/com/ydtech/modules/fnc/service/InsPlyIncomeService.java
  36. 110 106
      src/main/java/com/ydtech/modules/fnc/service/impl/ImportAsyncServiceImpl.java
  37. 98 35
      src/main/java/com/ydtech/modules/fnc/service/impl/InsPlyIncomeServiceImpl.java
  38. 1 2
      src/main/java/com/ydtech/modules/order/aop/aspect/QuoteVerificationAspect.java
  39. 2 0
      src/main/java/com/ydtech/modules/order/components/pingan/PinganRequestApiComponents.java
  40. 8 4
      src/main/java/com/ydtech/modules/order/controller/DrivingInsuranceController.java
  41. 14 6
      src/main/java/com/ydtech/modules/order/controller/PingAnOrderApiController.java
  42. 20 0
      src/main/java/com/ydtech/modules/order/entity/vo/pingan/RecoverApplyVerifyCodeVo.java
  43. 8 1
      src/main/java/com/ydtech/modules/order/service/InsDrivingIntentionInsuranceService.java
  44. 1 1
      src/main/java/com/ydtech/modules/order/service/PingAnOrderApiService.java
  45. 52 6
      src/main/java/com/ydtech/modules/order/service/impl/InsDrivingIntentionInsuranceServiceImpl.java
  46. 48 50
      src/main/java/com/ydtech/modules/order/service/impl/PingAnOrderApiServiceImpl.java
  47. 12 5
      src/main/resources/application-pre.yml
  48. 12 5
      src/main/resources/application-prod.yml
  49. 12 7
      src/main/resources/application-test.yml
  50. 15 3
      src/main/resources/mapper/modules/admin/SysUserMapper.xml
  51. 21 0
      src/main/resources/mapper/modules/admin/SysUserTrackMapper.xml
  52. 66 0
      src/main/resources/mapper/modules/esm/EsmUserReferrerMapper.xml
  53. 111 0
      src/main/resources/mapper/modules/fnc/InsPlyIncomeMapper.xml

+ 7 - 0
src/main/java/com/ydtech/components/TokenInterceptor.java

@@ -82,6 +82,13 @@ public class TokenInterceptor {
         notMatchList.add("/wxWork/verifyBind");
         notMatchList.add("/wxWork/bind");
 
+        // 平安相关屏蔽地址
+        notMatchList.add("/order/pingAnApi/getApplyVerifyCodeAndRecoverApplyVerifyCode");
+        notMatchList.add("/order/pingAnApi/recoverApplyVerifyCode");
+        notMatchList.add("/order/pingAnApi/payReturn");
+
+        notMatchList.add("/sysSys/sysList");//登录2  去除验证
+
         return new SaInterceptor(handler -> {
             // 指定一条 match 规则
             SaRouter

+ 2 - 2
src/main/java/com/ydtech/config/properties/PingAnApiConfigurationProperties.java

@@ -59,7 +59,7 @@ public class PingAnApiConfigurationProperties {
     private  String  sk;
 
     /***
-     * 文件上传前缀
+     * 短信验证页面
      */
-    private String fileUrl;
+    private String signatureUrl;
 }

+ 32 - 0
src/main/java/com/ydtech/modules/admin/controller/SysLoginController.java

@@ -8,17 +8,21 @@ import com.fasterxml.jackson.core.JsonProcessingException;
 import com.fasterxml.jackson.databind.ObjectMapper;
 import com.google.code.kaptcha.Producer;
 import com.ydtech.config.MasterPasswordConfig;
+import com.ydtech.constants.SysConstants;
 import com.ydtech.constants.sys.SysPasswordEnum;
 import com.ydtech.core.page.HttpResult;
 import com.ydtech.exception.SystemException;
+import com.ydtech.modules.admin.model.SysDept;
 import com.ydtech.modules.admin.model.SysPassword;
 import com.ydtech.modules.admin.model.SysRole;
 import com.ydtech.modules.admin.model.SysUser;
+import com.ydtech.modules.admin.model.po.SysUserLinkSys;
 import com.ydtech.modules.admin.model.vo.LoginBean;
 import com.ydtech.modules.admin.model.vo.LoginTicket;
 import com.ydtech.modules.admin.model.vo.PhoneLoginVo;
 import com.ydtech.modules.admin.model.vo.QrCodeStatusEnum;
 import com.ydtech.modules.admin.service.SysPasswordService;
+import com.ydtech.modules.admin.service.SysUserLinkSysService;
 import com.ydtech.modules.base.controller.BaseController;
 import com.ydtech.utils.RedisUtils;
 import com.ydtech.modules.admin.service.SysUserRoleService;
@@ -31,6 +35,7 @@ import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.ObjectUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.tomcat.util.http.fileupload.IOUtils;
 import org.springframework.data.redis.core.StringRedisTemplate;
@@ -78,6 +83,7 @@ public class SysLoginController {
 
     private final SysPasswordService sysPasswordService;
 
+    private final SysUserLinkSysService  sysUserLinkSysService;
     @GetMapping("captcha.jpg")
     @ApiOperation(value = "获取验证码", produces = "application/octet-stream")
     public void captcha(HttpServletResponse response, HttpServletRequest request) throws IOException {
@@ -141,6 +147,19 @@ public class SysLoginController {
 //
         // 用户信息
         SysUser user = sysUserService.getById(username);
+
+        /**
+         *  多个系统登录
+         * */
+        if(!SysConstants.ADMIN.equalsIgnoreCase(username) && !"1".equals(loginBean.getSysId())){
+            LambdaQueryWrapper<SysUserLinkSys> sysLambdaQueryWrapper = new LambdaQueryWrapper<>();
+            sysLambdaQueryWrapper.eq(SysUserLinkSys::getUserId, user.getId());
+            sysLambdaQueryWrapper.eq(SysUserLinkSys::getSysId, loginBean.getSysId());
+            List<SysUserLinkSys> list = sysUserLinkSysService.list(sysLambdaQueryWrapper);
+            if(list==null || list.size()==0){
+                throw  new SystemException("该用户未授权");
+            }
+        }
         //验证用户
         SysUser.verifyUser(user);
         SysPassword sysPassword = sysPasswordService.getOne(new LambdaQueryWrapper<SysPassword>().eq(SysPassword::getCode, SysPasswordEnum.GENERAL.getCode()));
@@ -186,6 +205,19 @@ public class SysLoginController {
         // 用户信息
         SysUser user = sysUserService.getById(username);
 
+        /**
+         *  多个系统登录
+         * */
+        if(!SysConstants.ADMIN.equalsIgnoreCase(username) && !"1".equals(loginBean.getSysId())){
+            LambdaQueryWrapper<SysUserLinkSys> sysLambdaQueryWrapper = new LambdaQueryWrapper<>();
+            sysLambdaQueryWrapper.eq(SysUserLinkSys::getUserId, user.getId());
+            sysLambdaQueryWrapper.eq(SysUserLinkSys::getSysId, loginBean.getSysId());
+            List<SysUserLinkSys> list = sysUserLinkSysService.list(sysLambdaQueryWrapper);
+            if(list==null || list.size()==0){
+                throw  new SystemException("该用户未授权");
+            }
+        }
+
         //验证用户
         SysUser.verifyUser(user);
         SysPassword sysPassword = sysPasswordService.getOne(new LambdaQueryWrapper<SysPassword>().eq(SysPassword::getCode, SysPasswordEnum.GENERAL.getCode()));

+ 1 - 0
src/main/java/com/ydtech/modules/admin/controller/SysMenuController.java

@@ -27,6 +27,7 @@ public class SysMenuController {
 //    @PreAuthorize("hasAuthority('sys:menu:add') AND hasAuthority('sys:menu:edit')")
     @PostMapping(value = "/save")
     public HttpResult save(@RequestBody SysMenu record) {
+        record.setSysType("1");
         if (StringUtils.isNullOrEmpty(record.getId()) || record.getId().equalsIgnoreCase("0")) {
             return HttpResult.ok(sysMenuService.save(record));
 //            return HttpResult.ok(sysMenuService.insertSelective(record));

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

@@ -52,6 +52,7 @@ public class SysRoleController extends BaseController {
         if ((record.getId() == null || record.getId() == 0) && sysRoleService.findByName(record.getName()) != null) {
             return HttpResult.error("角色名已存在!");
         }
+        record.setSysType("1");
         return HttpResult.ok(sysRoleService.saveOrUpdate(record));
     }
 
@@ -77,6 +78,7 @@ public class SysRoleController extends BaseController {
     public HttpResult findAll() {
         LambdaQueryWrapper<SysRole> lqw = new LambdaQueryWrapper<>();
         lqw.eq(SysRole::getDelFlag, "0");
+        lqw.eq(SysRole::getSysType, "1");
         List<SysRole> list = sysRoleService.list(lqw);
         return HttpResult.ok(list);
     }
@@ -99,6 +101,7 @@ public class SysRoleController extends BaseController {
         }
 
         lqw.eq(SysRole::getDelFlag, "0");
+        lqw.eq(SysRole::getSysType, "1");
         List<SysRole> list = sysRoleService.list(lqw);
         return HttpResult.ok(list);
     }

+ 15 - 1
src/main/java/com/ydtech/modules/admin/controller/SysUserController.java

@@ -92,6 +92,8 @@ public class SysUserController extends BaseController {
 
     private final MessageSecretaryService messageSecretaryService;
 
+    private final SysUserTrackService sysUserTrackService;
+
 
     //    @PreAuthorize("hasAuthority('sys:user:delete')")
     @ApiOperation(value = "逻辑删除")
@@ -462,6 +464,12 @@ public class SysUserController extends BaseController {
         }else if(sysUser.getStatus() == UserWorkStatus.UWS_4.getCode()){
             sysUser.setStatus(UserWorkStatus.UWS_0.getCode());
         }
+        SysUserTrack sysUserTrack = new SysUserTrack();
+        sysUserTrack.setUserId(userId);
+        sysUserTrack.setApproveBy(getUserName());
+        sysUserTrack.setStatus(sysUser.getStatus());
+        sysUserTrack.setApproveTime(new Date());
+        sysUserTrackService.save(sysUserTrack);
         return HttpResult.ok(sysUserService.updateById(sysUser));
 
 
@@ -483,7 +491,13 @@ public class SysUserController extends BaseController {
             sysUser.setStatus(UserWorkStatus.UWS_5.getCode());
         }
         sysUser.setApprovalOpinion(reason);
-
+        SysUserTrack sysUserTrack = new SysUserTrack();
+        sysUserTrack.setUserId(userId);
+        sysUserTrack.setApproveBy(getUserName());
+        sysUserTrack.setStatus(sysUser.getStatus());
+        sysUserTrack.setApproveMess(reason);
+        sysUserTrack.setApproveTime(new Date());
+        sysUserTrackService.save(sysUserTrack);
         return HttpResult.ok(sysUserService.updateById(sysUser));
 
     }

+ 78 - 0
src/main/java/com/ydtech/modules/admin/controller/financialReceivables/FinancialReceivablesController.java

@@ -0,0 +1,78 @@
+package com.ydtech.modules.admin.controller.financialReceivables;
+
+import com.ydtech.core.page.HttpResult;
+import com.ydtech.modules.admin.model.report.financialReceivables.FinancialReceivablesAllMonthVo;
+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.FinancialReceivablesQueryVo;
+import com.ydtech.modules.fnc.service.InsPlyIncomeService;
+import com.ydtech.modules.fnc.vo.InsPlyIncomeVo;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiModelProperty;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ *  @version
+ *  @author: hxl
+ *  @Date: 2024/7/31 15:33
+ *  @Description: 财务应收
+ */
+@Api(tags = "财务应收")
+@RequestMapping("/financialReceivables")
+@RestController
+public class FinancialReceivablesController {
+
+
+    @Autowired
+    private InsPlyIncomeService insPlyIncomeService;
+
+   /**
+    *  @version
+    *  @author: hxl
+    *  @Date: 2024/8/1 9:20
+    *  @Description:  获取平台(私有协议 、平台)
+    */
+    @PostMapping("/queryDateByType")
+    @ApiModelProperty(value = "获取平台私有数据列表")
+    public HttpResult<FinancialReceivablesAllVo> queryDateByType(@RequestBody FinancialReceivablesQueryVo financialReceivablesQueryVo) {
+        return HttpResult.ok(insPlyIncomeService.queryDateByType(financialReceivablesQueryVo));
+    }
+
+
+    @PostMapping("/queryDateByTypeByMonth")
+    @ApiModelProperty(value = "获取平台私有数据列表")
+    public HttpResult<FinancialReceivablesAllMonthVo> queryDateByTypeByMonth(@RequestBody FinancialReceivablesQueryMonthVo financialReceivablesQueryVo) {
+        return HttpResult.ok(insPlyIncomeService.queryDateByTypeByMonth(financialReceivablesQueryVo));
+    }
+    /**
+     *
+     * @param insPlyIncomeVo
+     * @return  返回私有 平台  应收 已收  未收
+     */
+    @PostMapping("/totalReceivables")
+    @ApiModelProperty(value = "平台 私有 应收未收 金额")
+    public HttpResult<ArrayList<Map<String,Object>>> totalReceivables(@RequestBody InsPlyIncomeVo insPlyIncomeVo) {
+        return insPlyIncomeService.totalReceivables(insPlyIncomeVo);
+    }
+
+    /**
+     *
+     * @param insPlyIncomeVo
+     * @return  返回私有   1   到 12  月   应收 已收
+     */
+    @PostMapping("/monthTotalReceivables")
+    @ApiModelProperty(value = "私有平台 已收未收金额")
+    public HttpResult<List<HashMap<String,Object>>> monthTotalReceivables(@RequestBody InsPlyIncomeVo insPlyIncomeVo) {
+        return insPlyIncomeService.monthTotalReceivables(insPlyIncomeVo);
+    }
+
+}

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

@@ -11,7 +11,7 @@ import java.util.List;
 public interface SysRoleMenuMapper extends BaseMapper<SysRoleMenu> {
 
     String SysMenuSql = "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 sysRoleMenuIdSql = " 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 ";
+    String sysRoleMenuIdSql = " 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='1'";
     String SysMenuSqlT1 = SysMenuSql + sysRoleMenuIdSql;
 
 

+ 11 - 0
src/main/java/com/ydtech/modules/admin/dao/SysUserTrackMapper.java

@@ -0,0 +1,11 @@
+package com.ydtech.modules.admin.dao;
+
+import com.ydtech.modules.admin.model.SysUserTrack;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+import java.util.Date;
+
+public interface SysUserTrackMapper extends BaseMapper<SysUserTrack> {
+
+    SysUserTrack getLastTime(String userId);
+}

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

@@ -46,6 +46,12 @@ public class SysMenu implements Serializable {
     @TableField(exist = false)
     private List<SysMenu> children;
 
+    /***
+     * 添加菜单类型 1.车险 2. 控制台
+     */
+    @TableField(value = "sys_type")
+    private String sysType;
+
 
 }
 

+ 7 - 0
src/main/java/com/ydtech/modules/admin/model/SysRole.java

@@ -19,6 +19,9 @@ public class SysRole implements Serializable {
     private Date lastUpdateTime;
     private Integer delFlag;
 
+    private String sysType;
+
+
     public Long getId() {
         return id;
     }
@@ -35,6 +38,10 @@ public class SysRole implements Serializable {
         this.name = name;
     }
 
+    public String getSysType() {return sysType;}
+
+    public void setSysType(String sysType) {this.sysType = sysType;}
+
     public String getRemark() {
         return remark;
     }

+ 33 - 0
src/main/java/com/ydtech/modules/admin/model/SysUserTrack.java

@@ -0,0 +1,33 @@
+package com.ydtech.modules.admin.model;
+
+import lombok.Data;
+
+import java.util.Date;
+
+@Data
+public class SysUserTrack {
+    /**
+     * id
+     */
+    private Integer id;
+    /**
+     * 用户id
+     */
+    private String userId;
+    /**
+     * 用户状态 0,"离司",1,"正常",2,"入司待审核",3,"入司审核驳回",4,"离司待审核",5,"离司审核驳回"
+     */
+    private Integer status;
+    /**
+     * 审核人
+     */
+    private String approveBy;
+    /**
+     * 审核时间
+     */
+    private Date approveTime;
+    /**
+     * 审核信息
+     */
+    private String approveMess;
+}

+ 6 - 0
src/main/java/com/ydtech/modules/admin/model/dto/SysUserTeamInfoDto.java

@@ -44,6 +44,12 @@ public class SysUserTeamInfoDto {
     @ApiModelProperty("注册时间")
     private Date createTime;
 
+    @ApiModelProperty(value = "审核时间")
+    private Date approveTime;
+
+    @ApiModelProperty(value = "审核人")
+    private String approveBy;
+
     public SysUserTeamInfoDto(SysUser sysUser, SysDept sysDept, SysDept  organization, SysUserInfo sysUserInfo) {
         this.organization = organization.getName();
         this.deptId = sysDept.getId();

+ 46 - 0
src/main/java/com/ydtech/modules/admin/model/report/financialReceivables/FinancialReceivablesAllMonthVo.java

@@ -0,0 +1,46 @@
+package com.ydtech.modules.admin.model.report.financialReceivables;
+
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ *  @version 
+ *  @author: hxl
+ *  @Date: 2024/8/1 9:20
+ *  @Description:   应收出参
+ */
+@Data
+@ApiModel("应收月份查询参数")
+public class FinancialReceivablesAllMonthVo {
+
+    @ApiModelProperty("年份")
+    private  String  yearAndMonth;
+
+    @ApiModelProperty("应收金额")
+    private  String  ysSumAmount;
+
+    @ApiModelProperty("已收金额")
+    private  String  yisSumAmount;
+
+    @ApiModelProperty("未收金额")
+    private  String  wsSumAmount;
+
+    @ApiModelProperty("数据列表")
+    private List<FinancialReceivablesMonthVo> list =new ArrayList<>();
+
+    public FinancialReceivablesAllMonthVo() {
+    }
+
+    public FinancialReceivablesAllMonthVo(String ysSumAmount, String  yisSumAmount,String  wsSumAmount,  String yearAndMonth, List<FinancialReceivablesMonthVo> list) {
+        this.ysSumAmount = ysSumAmount;
+        this.yisSumAmount = yisSumAmount;
+        this.wsSumAmount = wsSumAmount;
+        this.yearAndMonth = yearAndMonth;
+        this.list = list;
+    }
+}

+ 42 - 0
src/main/java/com/ydtech/modules/admin/model/report/financialReceivables/FinancialReceivablesAllVo.java

@@ -0,0 +1,42 @@
+package com.ydtech.modules.admin.model.report.financialReceivables;
+
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ *  @version 
+ *  @author: hxl
+ *  @Date: 2024/8/1 9:20
+ *  @Description:   应收出参
+ */
+@Data
+@ApiModel("应收查询参数")
+public class FinancialReceivablesAllVo {
+
+    @ApiModelProperty("平台应收金额")
+    private  String  ptSumAmount;
+
+    @ApiModelProperty("私有应收金额")
+    private  String  sySumAmount;
+
+    @ApiModelProperty("年份")
+    private  String  year;
+
+    @ApiModelProperty("数据列表")
+    private List<FinancialReceivablesVo> list =new ArrayList<>();
+
+    public FinancialReceivablesAllVo() {
+    }
+
+    public FinancialReceivablesAllVo(String sySumAmount,String  ptSumAmount, String year, List<FinancialReceivablesVo> list) {
+        this.sySumAmount = sySumAmount;
+        this.ptSumAmount = ptSumAmount;
+        this.year = year;
+        this.list = list;
+    }
+}

+ 42 - 0
src/main/java/com/ydtech/modules/admin/model/report/financialReceivables/FinancialReceivablesMonthVo.java

@@ -0,0 +1,42 @@
+package com.ydtech.modules.admin.model.report.financialReceivables;
+
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+ *  @version 
+ *  @author: hxl
+ *  @Date: 2024/8/1 9:20
+ *  @Description:   应收出参
+ */
+@Data
+@ApiModel("应收月份返回参数")
+public class FinancialReceivablesMonthVo {
+
+    @ApiModelProperty("年份")
+    private  String  yearAndMonth;
+
+    @ApiModelProperty("公司名称")
+    private  String  companyName;
+
+    @ApiModelProperty("地区名称")
+    private  String  areaName;
+
+    @ApiModelProperty("应收")
+    private String  commissionFeevalue;
+
+    @ApiModelProperty("已收")
+    private String  noInvoicCommissionFeevalue;
+
+    @ApiModelProperty("未收")
+    private String  readyCommissionFeevalue;
+
+    @ApiModelProperty("开票未结算")
+    private String  settlementAmount;
+
+    @ApiModelProperty("未开票金额")
+    private String  noSettlementAmount;
+
+}

+ 29 - 0
src/main/java/com/ydtech/modules/admin/model/report/financialReceivables/FinancialReceivablesQueryMonthVo.java

@@ -0,0 +1,29 @@
+package com.ydtech.modules.admin.model.report.financialReceivables;
+
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+ *  @version 
+ *  @author: hxl
+ *  @Date: 2024/8/1 9:20
+ *  @Description:   应收出参
+ */
+@Data
+@ApiModel("应收查询参数")
+public class FinancialReceivablesQueryMonthVo {
+
+    @ApiModelProperty("年份+月份  yyyy-mm")
+    private  String  yearAndMonth;
+
+    @ApiModelProperty("类型 1.平台  2.私有  默认是1 必传")
+    private String  type;
+
+    @ApiModelProperty("前台不需要传递后台使用")
+    private String beginDate;
+
+    @ApiModelProperty("前台不需要传递后台使用")
+    private String endDate;
+}

+ 29 - 0
src/main/java/com/ydtech/modules/admin/model/report/financialReceivables/FinancialReceivablesQueryVo.java

@@ -0,0 +1,29 @@
+package com.ydtech.modules.admin.model.report.financialReceivables;
+
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+ *  @version 
+ *  @author: hxl
+ *  @Date: 2024/8/1 9:20
+ *  @Description:   应收出参
+ */
+@Data
+@ApiModel("应收查询参数")
+public class FinancialReceivablesQueryVo {
+
+    @ApiModelProperty("年份")
+    private  String  year;
+
+    @ApiModelProperty("类型 1.平台  2.私有  默认是1 必传")
+    private String  type;
+
+    @ApiModelProperty("前台不需要传递后台使用")
+    private String beginDate;
+
+    @ApiModelProperty("前台不需要传递后台使用")
+    private String endDate;
+}

+ 36 - 0
src/main/java/com/ydtech/modules/admin/model/report/financialReceivables/FinancialReceivablesVo.java

@@ -0,0 +1,36 @@
+package com.ydtech.modules.admin.model.report.financialReceivables;
+
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+ *  @version 
+ *  @author: hxl
+ *  @Date: 2024/8/1 9:20
+ *  @Description:   应收出参
+ */
+@Data
+@ApiModel("应收返回参数")
+public class FinancialReceivablesVo {
+
+    @ApiModelProperty("年份")
+    private  String  yearAndMonth;
+
+    @ApiModelProperty("应收")
+    private String  commissionFeevalue;
+
+    @ApiModelProperty("已收")
+    private String  noInvoicCommissionFeevalue;
+
+    @ApiModelProperty("未收")
+    private String  readyCommissionFeevalue;
+
+    @ApiModelProperty("开票未结算")
+    private String  settlementAmount;
+
+    @ApiModelProperty("未开票金额")
+    private String  noSettlementAmount;
+
+}

+ 2 - 2
src/main/java/com/ydtech/modules/admin/model/report/profitAnalysis/ProfitAnalysisDto.java

@@ -25,10 +25,10 @@ public class ProfitAnalysisDto {
 
     @ApiModelProperty("应收")
     private String sumcount;
-    @ApiModelProperty("实")
+    @ApiModelProperty("实")
     private String paid;
 
-    @ApiModelProperty("未")
+    @ApiModelProperty("未")
     private String unpaid;
 
     @ApiModelProperty("毛利润")

+ 1 - 0
src/main/java/com/ydtech/modules/admin/model/vo/LoginBean.java

@@ -14,6 +14,7 @@ public class LoginBean {
     private String account;
     private String password;
     private String captcha;
+    private String sysId;
     //验证码ID
     private String captchaId;
 

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

@@ -4,6 +4,7 @@ import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
+import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
 
@@ -63,4 +64,10 @@ public class SysUserBaseVO {
     @ApiModelProperty(value = "报价单颜色")
     private String themeColour;
 
+
+    @ApiModelProperty(value = "提交时间")
+    private Date submitTime;
+
+    @ApiModelProperty(value = "审核时间")
+    private Date approveTime;
 }

+ 10 - 0
src/main/java/com/ydtech/modules/admin/service/SysUserTrackService.java

@@ -0,0 +1,10 @@
+package com.ydtech.modules.admin.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.ydtech.modules.admin.model.SysUserTrack;
+
+import java.util.Date;
+
+public interface SysUserTrackService extends IService<SysUserTrack> {
+    SysUserTrack getLastTime(String userId);
+}

+ 9 - 4
src/main/java/com/ydtech/modules/admin/service/impl/AppCustomerManagementImpl.java

@@ -7,13 +7,11 @@ import com.ydtech.core.page.HttpResult;
 import com.ydtech.modules.admin.model.SysDept;
 import com.ydtech.modules.admin.model.SysUser;
 import com.ydtech.modules.admin.model.SysUserInfo;
+import com.ydtech.modules.admin.model.SysUserTrack;
 import com.ydtech.modules.admin.model.dto.SysUserTeamDto;
 import com.ydtech.modules.admin.model.dto.SysUserTeamInfoDto;
 import com.ydtech.modules.admin.model.vo.AppCustomerManagementQueryVo;
-import com.ydtech.modules.admin.service.AppCustomerManagementService;
-import com.ydtech.modules.admin.service.SysDeptService;
-import com.ydtech.modules.admin.service.SysUserInfoService;
-import com.ydtech.modules.admin.service.SysUserService;
+import com.ydtech.modules.admin.service.*;
 import com.ydtech.modules.base.controller.BaseController;
 import com.ydtech.modules.esm.service.EsmUserReferrerService;
 import com.ydtech.modules.order.entity.BasePageResult;
@@ -36,6 +34,8 @@ public class AppCustomerManagementImpl implements AppCustomerManagementService {
 
     private final SysUserInfoService sysUserInfoService;
 
+    private final SysUserTrackService sysUserTrackService;
+
 
     @Override
     public HttpResult<BasePageResult<SysUserTeamDto>> authenticationQuery(AppCustomerManagementQueryVo managementQueryVo) {
@@ -75,6 +75,11 @@ public class AppCustomerManagementImpl implements AppCustomerManagementService {
         SysDept organization = sysDeptService.getById(dept.getParentId());
         SysUserInfo sysUserInfo = sysUserInfoService.getById(userId);
         SysUserTeamInfoDto sysUserTeamInfoDto = new SysUserTeamInfoDto(sysUser, dept, organization, sysUserInfo);
+        SysUserTrack sysUserTrack = sysUserTrackService.getLastTime(userId);
+        if (sysUserTrack != null) {
+            sysUserTeamInfoDto.setApproveTime(sysUserTrack.getApproveTime());
+            sysUserTeamInfoDto.setApproveBy(sysUserTrack.getApproveBy());
+        }
         return HttpResult.ok(sysUserTeamInfoDto);
     }
 }

+ 3 - 1
src/main/java/com/ydtech/modules/admin/service/impl/SysMenuServiceImpl.java

@@ -49,8 +49,9 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu>
 
     @Override
     public List<SysMenu> findByUser(String userName) {
-        LambdaQueryWrapper<SysMenu> lqw = new LambdaQueryWrapper<>();
+         LambdaQueryWrapper<SysMenu> lqw = new LambdaQueryWrapper<>();
         lqw.eq(SysMenu::getDelFlag, 0);
+        lqw.eq(SysMenu::getSysType, 1);
         if (userName == null || "".equals(userName) || SysConstants.ADMIN.equalsIgnoreCase(userName)) {
 //            return selectList(" where 1=1 and del_flag=0", null);
             return list(lqw);
@@ -79,6 +80,7 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu>
         LambdaQueryWrapper<SysMenu> smlqw = new LambdaQueryWrapper<>();
         smlqw.eq(SysMenu::getDelFlag, 0);
         smlqw.in(SysMenu::getId, longs);
+        smlqw.in(SysMenu::getSysType, "1");
         return list(smlqw);
 
 

+ 30 - 0
src/main/java/com/ydtech/modules/admin/service/impl/SysUserServiceImpl.java

@@ -1,5 +1,6 @@
 package com.ydtech.modules.admin.service.impl;
 
+import cn.dev33.satoken.stp.StpUtil;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@@ -79,6 +80,9 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
     @Autowired
     private SysUserIsDialService sysUserIsDialService;
 
+    @Autowired
+    private SysUserTrackService sysUserTrackService;
+
     @Override
     public IPage<SysUserBaseVO> findUserList(PageDto<SysUserDto> pageDto) {
         PageVo<SysUserBaseVO> pageVo = new PageVo();
@@ -632,6 +636,13 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
         List<EsmUserImageVo> esmUserImageVo = sysUserVo.getEsmUserImageVo();
         List<EsmUserImage> esmUserImages = esmUserImageVo.stream().map(x -> new EsmUserImage(x, userId)).collect(Collectors.toList());
         esmUserImageService.saveBatch(esmUserImages);
+        //添加轨迹
+        SysUserTrack sysUserTrack = new SysUserTrack();
+        sysUserTrack.setUserId(sysUser.getId());
+        sysUserTrack.setApproveBy(StpUtil.getLoginId().toString());
+        sysUserTrack.setStatus(sysUser.getStatus());
+        sysUserTrack.setApproveTime(new Date());
+        sysUserTrackService.save(sysUserTrack);
 
         return HttpResult.ok("新增成功");
     }
@@ -672,6 +683,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
     @Transactional
     public HttpResult updateUserInfo(String userId, SysUser2Vo sysUserVo) {
         SysUser sysUser = sysUserVo.getSysUser();
+        int beStatus = sysUser.getStatus();
         //如果审核驳回则 重新修改为 审核状态
         if(sysUserVo.getSysUser().getStatus() == UserWorkStatus.UWS_3.getCode()){
             sysUserVo.getSysUser().setStatus(UserWorkStatus.UWS_2.getCode());
@@ -740,6 +752,16 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
         List<EsmUserImage> esmUserImages = esmUserImageVo.stream().map(x -> new EsmUserImage(x, userId)).collect(Collectors.toList());
         esmUserImageService.saveBatch(esmUserImages);
 
+        if (UserWorkStatus.UWS_5.getCode() == beStatus ||
+                UserWorkStatus.UWS_3.getCode() == beStatus) {
+            //添加轨迹
+            SysUserTrack sysUserTrack = new SysUserTrack();
+            sysUserTrack.setUserId(sysUser.getId());
+            sysUserTrack.setApproveBy(StpUtil.getLoginId().toString());
+            sysUserTrack.setStatus(sysUserVo.getSysUser().getStatus());
+            sysUserTrack.setApproveTime(new Date());
+            sysUserTrackService.save(sysUserTrack);
+        }
         return HttpResult.ok("修改成功");
     }
 
@@ -1497,6 +1519,14 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
         esmUserImageVo.setType(InsuranceImageEnum.LZ_01.getCode());
         EsmUserImage esmUserImage = new EsmUserImage(esmUserImageVo,sysUserVO.getSysUser().getId());
         esmUserImageService.save(esmUserImage);
+
+        //添加轨迹
+        SysUserTrack sysUserTrack = new SysUserTrack();
+        sysUserTrack.setUserId(byId.getId());
+        sysUserTrack.setApproveBy(StpUtil.getLoginId().toString());
+        sysUserTrack.setStatus(byId.getStatus());
+        sysUserTrack.setApproveTime(new Date());
+        sysUserTrackService.save(sysUserTrack);
         return true;
     }
 

+ 17 - 0
src/main/java/com/ydtech/modules/admin/service/impl/SysUserTrackServiceImpl.java

@@ -0,0 +1,17 @@
+package com.ydtech.modules.admin.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.ydtech.modules.admin.dao.SysUserTrackMapper;
+import com.ydtech.modules.admin.model.SysUserTrack;
+import com.ydtech.modules.admin.service.SysUserTrackService;
+import org.springframework.stereotype.Service;
+
+import java.util.Date;
+
+@Service
+public class SysUserTrackServiceImpl extends ServiceImpl<SysUserTrackMapper, SysUserTrack> implements SysUserTrackService {
+    @Override
+    public SysUserTrack getLastTime(String userId) {
+        return baseMapper.getLastTime(userId);
+    }
+}

+ 41 - 4
src/main/java/com/ydtech/modules/admin/utils/SliceUpDateUtil.java

@@ -210,9 +210,11 @@ public class SliceUpDateUtil {
         calendar.set(Calendar.MONTH, Calendar.JANUARY);
         calendar.set(Calendar.DAY_OF_MONTH, 1);
         int startYear = calendar.get(Calendar.YEAR);
-        int startMonth = calendar.get(Calendar.MONTH);
+        int startMonth = calendar.get(Calendar.MONTH)+1;
         int startDay = calendar.get(Calendar.DAY_OF_MONTH);
-        return startYear+""+startMonth+""+startDay;
+        String month =startMonth<10?"0"+startMonth: String.valueOf(startMonth);
+        String day =startDay<10?"0"+startDay: String.valueOf(startDay);
+        return startYear+"-"+month+"-"+day;
     }
     /**
      *  @version
@@ -226,8 +228,43 @@ public class SliceUpDateUtil {
         calendar.set(Calendar.MONTH, Calendar.DECEMBER);
         calendar.set(Calendar.DAY_OF_MONTH, 31);
         int startYear = calendar.get(Calendar.YEAR);
-        int startMonth = calendar.get(Calendar.MONTH);
+        int startMonth = calendar.get(Calendar.MONTH)+1;
         int startDay = calendar.get(Calendar.DAY_OF_MONTH);
-        return startYear+""+startMonth+""+startDay;
+        String month =startMonth<10?"0"+startMonth: String.valueOf(startMonth);
+        String day =startDay<10?"0"+startDay: String.valueOf(startDay);
+        return startYear+"-"+month+"-"+day;
     }
+
+    /**
+     *  @version
+     *  @author: hxl
+     *  @Date: 2024/8/5 10:18
+     *  @Description:  获取月份的开始时间
+     */
+    public static String getStartOfMonth(int year, int month) {
+        Calendar calendar = Calendar.getInstance();
+        calendar.set(year, month - 1, 1);
+        calendar.set(Calendar.HOUR_OF_DAY, 0);
+        calendar.set(Calendar.MINUTE, 0);
+        calendar.set(Calendar.SECOND, 0);
+        calendar.set(Calendar.MILLISECOND, 0);
+        return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(calendar.getTime());
+    }
+    /**
+     *  @version
+     *  @author: hxl
+     *  @Date: 2024/8/5 10:18
+     *  @Description: 获取月份的结束时间
+     */
+    public static String getEndOfMonth(int year, int month) {
+        Calendar calendar = Calendar.getInstance();
+        calendar.set(year, month - 1, calendar.getActualMaximum(Calendar.DAY_OF_MONTH));
+        calendar.set(Calendar.HOUR_OF_DAY, 23);
+        calendar.set(Calendar.MINUTE, 59);
+        calendar.set(Calendar.SECOND, 59);
+        calendar.set(Calendar.MILLISECOND, 999);
+        return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(calendar.getTime());
+    }
+
+
 }

+ 15 - 0
src/main/java/com/ydtech/modules/esm/controller/EsmUserController.java

@@ -223,4 +223,19 @@ public class EsmUserController extends BaseController {
         return HttpResult.ok(list);
     }
 
+
+    /**
+     * 团队业绩统计-指定用户查询
+     *
+     * @param record
+     * @return
+     */
+    @PostMapping("/queryUserCountForUser")
+    public HttpResult<List<EsmUserPolicyForUserVO>> queryUserCountForUser(@RequestBody TeamUserQryVO record){
+        if (StringUtils.isNullOrEmpty(record.getId()) || StringUtils.isNullOrEmpty(record.getStartdate()) ||
+                StringUtils.isNullOrEmpty(record.getEnddate())) {
+            return HttpResult.error("起止时间/用户id不能为空!");
+        }
+        return HttpResult.ok(esmUserReferrerService.queryUserCountForUser(record));
+    }
 }

+ 4 - 0
src/main/java/com/ydtech/modules/esm/dao/EsmUserReferrerMapper.java

@@ -12,6 +12,7 @@ import com.ydtech.modules.base.model.dto.PageDto;
 import com.ydtech.modules.esm.model.EsmUserReferrer;
 import com.ydtech.modules.esm.model.QueryChannel;
 import com.ydtech.modules.esm.model.vo.EsmTeamPolicyVO;
+import com.ydtech.modules.esm.model.vo.EsmUserPolicyForUserVO;
 import com.ydtech.modules.esm.model.vo.EsmUserPolicyVO;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Select;
@@ -221,4 +222,7 @@ public interface EsmUserReferrerMapper extends BaseMapper<EsmUserReferrer> {
      *  @Description: 查询天数数据
      */
     List<EmployeeIncreaseReportDto> employeeIncreaseReportDay(HashMap<String,Object> map);
+
+
+    List<EsmUserPolicyForUserVO> queryOrderCountForUser(String userId,String startDate, String endDate);
 }

+ 30 - 0
src/main/java/com/ydtech/modules/esm/model/vo/EsmUserPolicyForUserVO.java

@@ -0,0 +1,30 @@
+package com.ydtech.modules.esm.model.vo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+
+@Data
+@ApiModel("团队管理展示-明细-人员明细")
+public class EsmUserPolicyForUserVO implements Serializable {
+
+    private static final long serialVersionUID = 5053893395186078389L;
+
+    private String companyId;//保险公司id
+    @ApiModelProperty(value = "保险公司名称")
+    private String companyName;//保险公司名称
+    @ApiModelProperty(value = "出单笔数")
+    private int ordernum;//出单笔数
+    @ApiModelProperty(value = "核保笔数")
+    private int policynum;//核保笔数
+    @ApiModelProperty(value = "签单保费")
+    private double sumpremium;//签单保费
+    @ApiModelProperty(value = "报价次数")
+    private int bjpolicynum;//报价次数
+    @ApiModelProperty(value = "报价金额")
+    private double bjsumpremium;//报价金额
+
+
+}

+ 2 - 5
src/main/java/com/ydtech/modules/esm/service/EsmUserReferrerService.java

@@ -13,10 +13,7 @@ import com.ydtech.modules.base.model.dto.PageDto;
 import com.ydtech.modules.base.model.vo.PageVo;
 import com.ydtech.modules.esm.model.EsmUserReferrer;
 import com.ydtech.modules.esm.model.QueryChannel;
-import com.ydtech.modules.esm.model.vo.EsmTeamPolicyVO;
-import com.ydtech.modules.esm.model.vo.EsmUserCountVO;
-import com.ydtech.modules.esm.model.vo.EsmUserPolicyVO;
-import com.ydtech.modules.esm.model.vo.TeamUserQryVO;
+import com.ydtech.modules.esm.model.vo.*;
 import com.ydtech.modules.order.entity.BasePageResult;
 
 import java.util.List;
@@ -77,7 +74,7 @@ public interface EsmUserReferrerService extends IService<EsmUserReferrer> {
      **/
     BasePageResult<SysUserTeamDto> getTeamUser(AppCustomerManagementQueryVo managementQueryVo, String userId);
 
-
+    public List<EsmUserPolicyForUserVO> queryUserCountForUser(TeamUserQryVO record);
 }
 
 

+ 12 - 4
src/main/java/com/ydtech/modules/esm/service/impl/EsmUserReferrerServiceImpl.java

@@ -18,10 +18,7 @@ import com.ydtech.modules.base.model.vo.PageVo;
 import com.ydtech.modules.esm.dao.EsmUserReferrerMapper;
 import com.ydtech.modules.esm.model.EsmUserReferrer;
 import com.ydtech.modules.esm.model.QueryChannel;
-import com.ydtech.modules.esm.model.vo.EsmTeamPolicyVO;
-import com.ydtech.modules.esm.model.vo.EsmUserCountVO;
-import com.ydtech.modules.esm.model.vo.EsmUserPolicyVO;
-import com.ydtech.modules.esm.model.vo.TeamUserQryVO;
+import com.ydtech.modules.esm.model.vo.*;
 import com.ydtech.modules.esm.service.EsmUserReferrerService;
 import com.ydtech.modules.order.entity.BasePageResult;
 import com.ydtech.utils.StringUtils;
@@ -468,6 +465,17 @@ public class EsmUserReferrerServiceImpl extends ServiceImpl<EsmUserReferrerMappe
     }
 
 
+
+    /**
+     * 人员团队业绩统计--指定业务员查询
+     *
+     * @return
+     */
+    @Override
+    public List<EsmUserPolicyForUserVO> queryUserCountForUser(TeamUserQryVO record) {
+        return this.baseMapper.queryOrderCountForUser(record.getId(), record.getStartdate(), record.getEnddate());
+    }
+
 }
 
 

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

@@ -1,6 +1,7 @@
 package com.ydtech.modules.fnc.dao;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+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.ProfitAnalysisQueryDto;
 import com.ydtech.modules.fnc.dto.PlatformSettlementRecordDto;
@@ -11,6 +12,7 @@ import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Select;
 
+import java.math.BigDecimal;
 import java.util.HashMap;
 import java.util.List;
 
@@ -155,4 +157,32 @@ public interface InsPlyIncomeMapper extends BaseMapper<InsPlyIncome> {
      *  @Description: 查询数据
      */
     List<ProfitAnalysisDto> queryPage( @Param("vo") ProfitAnalysisQueryDto profitAnalysisQueryDto);
+    /**
+     *  @version
+     *  @author: hxl
+     *  @Date: 2024/8/1 12:09
+     *  @Description:  查询应收总数据
+     */
+    BigDecimal queryDateByTypeSumAmount(@Param("vo") FinancialReceivablesQueryVo financialReceivablesQueryVo);
+    /**
+     *  @version
+     *  @author: hxl
+     *  @Date: 2024/8/1 12:16
+     *  @Description:  查询应收列表数据 1-12月
+     */
+    List<FinancialReceivablesVo> queryDateByType(@Param("vo") FinancialReceivablesQueryVo financialReceivablesQueryVo);
+    /**
+     *  @version
+     *  @author: hxl
+     *  @Date: 2024/8/5 10:06
+     *  @Description:  查询月份的统计数据
+     */
+    FinancialReceivablesAllMonthVo queryDateByTypeByMonth(FinancialReceivablesQueryMonthVo financialReceivablesQueryVo);
+    /**
+     *  @version
+     *  @author: hxl
+     *  @Date: 2024/8/5 10:32
+     *  @Description:  查询月份统计集合数据
+     */
+    List<FinancialReceivablesMonthVo> queryDateByTypeByMonthList(FinancialReceivablesQueryMonthVo financialReceivablesQueryVo);
 }

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

@@ -2,6 +2,10 @@ package com.ydtech.modules.fnc.service;
 
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.ydtech.core.page.HttpResult;
+import com.ydtech.modules.admin.model.report.financialReceivables.FinancialReceivablesAllMonthVo;
+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.FinancialReceivablesQueryVo;
 import com.ydtech.modules.fnc.dto.PlatformSettlementRecordDto;
 import com.ydtech.modules.fnc.entity.InsAreaCompany;
 import com.ydtech.modules.fnc.entity.InsPlyIncome;
@@ -177,5 +181,18 @@ public interface InsPlyIncomeService extends IService<InsPlyIncome> {
     void bxImportOtherConfirm(InsPlyIncomeVo insPlyIncomeVo);
 
     void noBxImportOtherConfirm(InsPlyIncomeVo insPlyIncomeVo);
-
+    /**
+     *  @version
+     *  @author: hxl
+     *  @Date: 2024/8/1 9:27
+     *  @Description:  获取平台、私有协议数据
+     */
+    FinancialReceivablesAllVo queryDateByType(FinancialReceivablesQueryVo financialReceivablesQueryVo);
+    /**
+     *  @version 
+     *  @author: hxl
+     *  @Date: 2024/8/5 9:43
+     *  @Description:
+     */
+    FinancialReceivablesAllMonthVo queryDateByTypeByMonth(FinancialReceivablesQueryMonthVo financialReceivablesQueryVo);
 }

+ 110 - 106
src/main/java/com/ydtech/modules/fnc/service/impl/ImportAsyncServiceImpl.java

@@ -81,72 +81,74 @@ public class ImportAsyncServiceImpl extends ServiceImpl<ImportAsyncMapper, Impor
         HashSet<String> hashSet = new HashSet<>();
         if (!CollectionUtils.isEmpty(dtoList)) {
             for (InsBxPlyIncomeExcelDto excelItem : dtoList) {
-                InsImportResult insImportResult = new InsImportResult();
+                if(!(StringUtils.isEmpty(excelItem.getLicenseno()) && StringUtils.isEmpty(excelItem.getPolicyno())&& StringUtils.isEmpty(excelItem.getSyPolicyno()))){
+                    InsImportResult insImportResult = new InsImportResult();
 
-                String reason = "";
-                i = i + 1;
-                params.clear();
-                if (StringUtils.isNotEmpty(excelItem.getLicenseno())) {
-                    String licenseno = excelItem.getLicenseno();//车牌号
-                    params.put("licenseno", licenseno);
-                }
-                if (StringUtils.isNotEmpty(excelItem.getPolicyno())) {
-                    String policyno = excelItem.getPolicyno(); //交强保单号
-                    params.put("policyno", policyno);
-                }
+                    String reason = "";
+                    i = i + 1;
+                    params.clear();
+                    if (StringUtils.isNotEmpty(excelItem.getLicenseno())) {
+                        String licenseno = excelItem.getLicenseno();//车牌号
+                        params.put("licenseno", licenseno);
+                    }
+                    if (StringUtils.isNotEmpty(excelItem.getPolicyno())) {
+                        String policyno = excelItem.getPolicyno(); //交强保单号
+                        params.put("policyno", policyno);
+                    }
 
-                if (StringUtils.isNotEmpty(excelItem.getSyPolicyno())) {
-                    String syPolicyno = excelItem.getSyPolicyno(); //商业保单号
-                    params.put("syPolicyno", syPolicyno);
-                }
+                    if (StringUtils.isNotEmpty(excelItem.getSyPolicyno())) {
+                        String syPolicyno = excelItem.getSyPolicyno(); //商业保单号
+                        params.put("syPolicyno", syPolicyno);
+                    }
 
 
 //                  只查手续费
-                params.put("isOther", "0");
-                params.put("isNotCar", isNotCar);
-                InsPlyIncome insPlyIncome = insPlyIncomeMapper.findByBxLicenseno(params);
-                if (ObjectUtils.isNotEmpty(insPlyIncome) && open) {
-                    open = false;
-                    companyId = insPlyIncome.getCompanyId(); // 保险公司id
-                    partnerCompaniesId =  insPlyIncome.getPartnerCompaniesId(); //合作公司id
-                    agreementId = insPlyIncome.getAgreementId();  //协议id
-                }
-                if (ObjectUtils.isNotEmpty(insPlyIncome)) {  // 比配上汇总金额 未匹配则返回到数据当中
-                    idList.add(insPlyIncome.getId());
-                    if (insPlyIncome.getCommissionFeevalue() != null && insPlyIncome.getCommissionFeevalue().compareTo(BigDecimal.ZERO) != 0) {
-                        totalAmount = totalAmount.add(insPlyIncome.getCommissionFeevalue());  //添加总手续费
+                    params.put("isOther", "0");
+                    params.put("isNotCar", isNotCar);
+                    InsPlyIncome insPlyIncome = insPlyIncomeMapper.findByBxLicenseno(params);
+                    if (ObjectUtils.isNotEmpty(insPlyIncome) && open) {
+                        open = false;
+                        companyId = insPlyIncome.getCompanyId(); // 保险公司id
+                        partnerCompaniesId =  insPlyIncome.getPartnerCompaniesId(); //合作公司id
+                        agreementId = insPlyIncome.getAgreementId();  //协议id
                     }
+                    if (ObjectUtils.isNotEmpty(insPlyIncome)) {  // 比配上汇总金额 未匹配则返回到数据当中
+                        idList.add(insPlyIncome.getId());
+                        if (insPlyIncome.getCommissionFeevalue() != null && insPlyIncome.getCommissionFeevalue().compareTo(BigDecimal.ZERO) != 0) {
+                            totalAmount = totalAmount.add(insPlyIncome.getCommissionFeevalue());  //添加总手续费
+                        }
 
-                    if (excelItem.getJqSuperviseCostsProportion() != null && excelItem.getJqSuperviseCostsProportion().compareTo(BigDecimal.ZERO) != 0 && excelItem.getJqSuperviseCostsProportion().compareTo(insPlyIncome.getJqSuperviseCostsProportion()) != 0) {
-                        params.put("jqSuperviseCostsProportion", excelItem.getJqSuperviseCostsProportion());
-                        InsPlyIncome byBxLicenseno = insPlyIncomeMapper.findByBxLicenseno(params);
-                        if (ObjectUtils.isEmpty(byBxLicenseno)) {
-                            reason = "该数据交强手续费比例有问题";
+                        if (excelItem.getJqSuperviseCostsProportion() != null && excelItem.getJqSuperviseCostsProportion().compareTo(BigDecimal.ZERO) != 0 && excelItem.getJqSuperviseCostsProportion().compareTo(insPlyIncome.getJqSuperviseCostsProportion()) != 0) {
+                            params.put("jqSuperviseCostsProportion", excelItem.getJqSuperviseCostsProportion());
+                            InsPlyIncome byBxLicenseno = insPlyIncomeMapper.findByBxLicenseno(params);
+                            if (ObjectUtils.isEmpty(byBxLicenseno)) {
+                                reason = "该数据交强手续费比例有问题";
+                            }
                         }
-                    }
-                    if (excelItem.getSySuperviseCostsProportion() != null && excelItem.getSySuperviseCostsProportion().compareTo(BigDecimal.ZERO) != 0 && excelItem.getSySuperviseCostsProportion().compareTo(insPlyIncome.getSySuperviseCostsProportion()) != 0) {
-                        params.put("sySuperviseCostsProportion", excelItem.getSySuperviseCostsProportion());
-                        InsPlyIncome byBxLicenseno = insPlyIncomeMapper.findByBxLicenseno(params);
-                        if (ObjectUtils.isEmpty(byBxLicenseno)) {
-                            reason = "该数据商业手续费比例有问题";
+                        if (excelItem.getSySuperviseCostsProportion() != null && excelItem.getSySuperviseCostsProportion().compareTo(BigDecimal.ZERO) != 0 && excelItem.getSySuperviseCostsProportion().compareTo(insPlyIncome.getSySuperviseCostsProportion()) != 0) {
+                            params.put("sySuperviseCostsProportion", excelItem.getSySuperviseCostsProportion());
+                            InsPlyIncome byBxLicenseno = insPlyIncomeMapper.findByBxLicenseno(params);
+                            if (ObjectUtils.isEmpty(byBxLicenseno)) {
+                                reason = "该数据商业手续费比例有问题";
+                            }
                         }
+                    } else {
+                        reason = "查询不到该车辆";
                     }
-                } else {
-                    reason = "查询不到该车辆";
-                }
-                if(StringUtils.isNotEmpty(reason)){
-                    insImportResult.setLicenseno(excelItem.getLicenseno());
-                    insImportResult.setPolicyno(excelItem.getPolicyno());
-                    insImportResult.setSyPolicyno(excelItem.getSyPolicyno());
-                    insImportResult.setReason(reason);
-                    insImportResultsExcel.add(insImportResult);
-                }else {
-                    if(StringUtils.isNotEmpty(insPlyIncome.getPartnerCompaniesId())){
-                        hashSet.add(insPlyIncome.getPartnerCompaniesId());
-                    }
-                    if(hashSet.size()>1){
-                        insImportResult.setReason("表里有不同保司机构");
+                    if(StringUtils.isNotEmpty(reason)){
+                        insImportResult.setLicenseno(excelItem.getLicenseno());
+                        insImportResult.setPolicyno(excelItem.getPolicyno());
+                        insImportResult.setSyPolicyno(excelItem.getSyPolicyno());
+                        insImportResult.setReason(reason);
                         insImportResultsExcel.add(insImportResult);
+                    }else {
+                        if(StringUtils.isNotEmpty(insPlyIncome.getPartnerCompaniesId())){
+                            hashSet.add(insPlyIncome.getPartnerCompaniesId());
+                        }
+                        if(hashSet.size()>1){
+                            insImportResult.setReason("表里有不同保司机构");
+                            insImportResultsExcel.add(insImportResult);
+                        }
                     }
                 }
             }
@@ -485,64 +487,66 @@ public class ImportAsyncServiceImpl extends ServiceImpl<ImportAsyncMapper, Impor
 
         if (!CollectionUtils.isEmpty(dtoList)) {
             for (InsBxNoPlyIncomeExcelDto excelItem : dtoList) {
-                InsImportResult insImportResult = new InsImportResult();
-                String reason = "";
-                i = i + 1;
-                params.clear();
-                if (StringUtils.isNotEmpty(excelItem.getLicenseno())) {
-                    String licenseno = excelItem.getLicenseno();//车牌号
-                    params.put("licenseno", licenseno);
-                }
-                if (StringUtils.isNotEmpty(excelItem.getNoPolicyno())) {
-                    String noPolicyno = excelItem.getNoPolicyno(); //交强保单号
-                    params.put("noPolicyno", noPolicyno);
-                }
-
-//                  只查手续费
-                params.put("isOther", "0");
-                params.put("isNotCar", "1");
-                InsPlyIncome insPlyIncome = insPlyIncomeMapper.findByBxLicenseno(params);
-                if (ObjectUtils.isNotEmpty(insPlyIncome) && open) {
-                    open = false;
-                    companyId = insPlyIncome.getCompanyId(); // 保险公司id
-                    partnerCompaniesId =  insPlyIncome.getPartnerCompaniesId(); //合作公司id
-                    agreementId = insPlyIncome.getAgreementId();  //协议id
-                }
-                if (ObjectUtils.isNotEmpty(insPlyIncome)) {  // 比配上汇总金额 未匹配则返回到数据当中
-                    idList.add(insPlyIncome.getId());
-                    if (insPlyIncome.getCommissionFeevalue() != null && insPlyIncome.getCommissionFeevalue().compareTo(BigDecimal.ZERO) != 0) {
-                        totalAmount = totalAmount.add(insPlyIncome.getCommissionFeevalue());  //添加总手续费
-                    }
-                    if (excelItem.getNoSuperviseCostsProportion()!=null  &&  excelItem.getNoSuperviseCostsProportion().compareTo(BigDecimal.ZERO) != 0 &&  excelItem.getNoSuperviseCostsProportion().compareTo(insPlyIncome.getNoSuperviseCostsProportion()) != 0 ) {
-                        BigDecimal noSuperviseCostsProportion = excelItem.getNoSuperviseCostsProportion();//商业保单号
-                        params.put("noSuperviseCostsProportion", noSuperviseCostsProportion);
-                        InsPlyIncome byBxLicenseno = insPlyIncomeMapper.findByBxLicenseno(params);
-                        if (ObjectUtils.isEmpty(byBxLicenseno)) {
-                            reason = "该数据非车手续费比例有问题";
-                        }
-                    }
-                    
-                } else {
-                    reason = "查询不到该车辆";
-                }
-                if(StringUtils.isNotEmpty(reason)){
-                    insImportResult.setReason(reason);
+                if(!(StringUtils.isEmpty(excelItem.getLicenseno()) && StringUtils.isEmpty(excelItem.getNoPolicyno()))){
+                    InsImportResult insImportResult = new InsImportResult();
+                    String reason = "";
+                    i = i + 1;
+                    params.clear();
                     if (StringUtils.isNotEmpty(excelItem.getLicenseno())) {
-                        insImportResult.setLicenseno(excelItem.getLicenseno());
+                        String licenseno = excelItem.getLicenseno();//车牌号
+                        params.put("licenseno", licenseno);
                     }
                     if (StringUtils.isNotEmpty(excelItem.getNoPolicyno())) {
-                        insImportResult.setPolicyno(excelItem.getNoPolicyno());
+                        String noPolicyno = excelItem.getNoPolicyno(); //交强保单号
+                        params.put("noPolicyno", noPolicyno);
                     }
-                    insImportResult.setReason(reason);
-                    insImportResultsExcel.add(insImportResult);
 
-                }else {
-                    if(StringUtils.isNotEmpty(insPlyIncome.getPartnerCompaniesId())){
-                        hashSet.add(insPlyIncome.getPartnerCompaniesId());
+//                  只查手续费
+                    params.put("isOther", "0");
+                    params.put("isNotCar", "1");
+                    InsPlyIncome insPlyIncome = insPlyIncomeMapper.findByBxLicenseno(params);
+                    if (ObjectUtils.isNotEmpty(insPlyIncome) && open) {
+                        open = false;
+                        companyId = insPlyIncome.getCompanyId(); // 保险公司id
+                        partnerCompaniesId =  insPlyIncome.getPartnerCompaniesId(); //合作公司id
+                        agreementId = insPlyIncome.getAgreementId();  //协议id
                     }
-                    if(hashSet.size()>1){
-                        insImportResult.setReason("表里有不同保司机构");
+                    if (ObjectUtils.isNotEmpty(insPlyIncome)) {  // 比配上汇总金额 未匹配则返回到数据当中
+                        idList.add(insPlyIncome.getId());
+                        if (insPlyIncome.getCommissionFeevalue() != null && insPlyIncome.getCommissionFeevalue().compareTo(BigDecimal.ZERO) != 0) {
+                            totalAmount = totalAmount.add(insPlyIncome.getCommissionFeevalue());  //添加总手续费
+                        }
+                        if (excelItem.getNoSuperviseCostsProportion()!=null  &&  excelItem.getNoSuperviseCostsProportion().compareTo(BigDecimal.ZERO) != 0 &&  excelItem.getNoSuperviseCostsProportion().compareTo(insPlyIncome.getNoSuperviseCostsProportion()) != 0 ) {
+                            BigDecimal noSuperviseCostsProportion = excelItem.getNoSuperviseCostsProportion();//商业保单号
+                            params.put("noSuperviseCostsProportion", noSuperviseCostsProportion);
+                            InsPlyIncome byBxLicenseno = insPlyIncomeMapper.findByBxLicenseno(params);
+                            if (ObjectUtils.isEmpty(byBxLicenseno)) {
+                                reason = "该数据非车手续费比例有问题";
+                            }
+                        }
+
+                    } else {
+                        reason = "查询不到该车辆";
+                    }
+                    if(StringUtils.isNotEmpty(reason)){
+                        insImportResult.setReason(reason);
+                        if (StringUtils.isNotEmpty(excelItem.getLicenseno())) {
+                            insImportResult.setLicenseno(excelItem.getLicenseno());
+                        }
+                        if (StringUtils.isNotEmpty(excelItem.getNoPolicyno())) {
+                            insImportResult.setPolicyno(excelItem.getNoPolicyno());
+                        }
+                        insImportResult.setReason(reason);
                         insImportResultsExcel.add(insImportResult);
+
+                    }else {
+                        if(StringUtils.isNotEmpty(insPlyIncome.getPartnerCompaniesId())){
+                            hashSet.add(insPlyIncome.getPartnerCompaniesId());
+                        }
+                        if(hashSet.size()>1){
+                            insImportResult.setReason("表里有不同保司机构");
+                            insImportResultsExcel.add(insImportResult);
+                        }
                     }
                 }
             }

+ 98 - 35
src/main/java/com/ydtech/modules/fnc/service/impl/InsPlyIncomeServiceImpl.java

@@ -4,7 +4,6 @@ import cn.afterturn.easypoi.excel.entity.ExportParams;
 import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.github.pagehelper.PageHelper;
@@ -13,6 +12,8 @@ import com.ydtech.constants.InsuranceEnum;
 import com.ydtech.constants.enums.dict.agreement.ProductsType;
 import com.ydtech.core.page.HttpResult;
 import com.ydtech.exception.SystemException;
+import com.ydtech.modules.admin.model.report.financialReceivables.*;
+import com.ydtech.modules.admin.utils.SliceUpDateUtil;
 import com.ydtech.modules.base.controller.BaseController;
 import com.ydtech.modules.esm.model.EsmInsCompany;
 import com.ydtech.modules.esm.service.EsmInsCompanyService;
@@ -47,7 +48,6 @@ import com.ydtech.utils.excel.ExcelStyleUtil;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.ObjectUtils;
 import org.apache.commons.lang3.StringUtils;
-import org.apache.ibatis.annotations.Param;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
@@ -61,18 +61,15 @@ import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
 import java.math.BigDecimal;
-import java.math.RoundingMode;
 import java.nio.file.Files;
 import java.nio.file.Path;
 import java.nio.file.Paths;
-import java.text.SimpleDateFormat;
 import java.time.LocalDate;
 import java.time.LocalDateTime;
 import java.time.LocalTime;
 import java.time.YearMonth;
 import java.time.format.DateTimeFormatter;
 import java.util.*;
-import java.util.stream.Collectors;
 
 /**
  * <p>
@@ -290,8 +287,8 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
 
         InsPlyIncome insPlyIncome = new InsPlyIncome(insFeeOrderNew.getInsOrderNo(), insAreaCompany.getJqpolicyno(),
                 insAreaCompany.getSypolicyno(), null, null, null, null, order.getProductid(), insAreaCompany.getPayDate(),
-          insAreaCompany.getSigningTime(), insAreaCompany.getCompanyId(), null, insFeeOrderNew.getAgreementId(), order.getLicenseno(),
-           insAreaCompany.getTaxamount(),
+                insAreaCompany.getSigningTime(), insAreaCompany.getCompanyId(), null, insFeeOrderNew.getAgreementId(), order.getLicenseno(),
+                insAreaCompany.getTaxamount(),
                 allNoTaxPremium, null, otherProportion, null, otherAmount, otherAmount, null, null, LocalDateTime.now(), null, null, null, "0"
                 , "0", "0", "1");
         //add by hxl  2024-07-31  修改插入结算表中险种信息错误的bug  将大订单中的险种信息改为小订单的险种信息
@@ -327,17 +324,17 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
     private void saveInsuranceProcedures(InsOrders order, InsFeeOrderNew insFeeOrderNew, InsAreaCompany insAreaCompany) {
 //        保险手续费
         BigDecimal handlingAmount = this.calculateTotal(insFeeOrderNew.getJqSuperviseCostsPremiums(),
-         insFeeOrderNew.getSySuperviseCostsPremiums(), null);
+                insFeeOrderNew.getSySuperviseCostsPremiums(), null);
         BigDecimal handlingProportion = this.calculateTotal(insFeeOrderNew.getJqSuperviseCostsProportion(),
                 insFeeOrderNew.getSySuperviseCostsProportion(), null);
         BigDecimal allNoTaxPremium = this.calculateTotal(insFeeOrderNew.getJqNoTaxPremium(), insFeeOrderNew.getSyNoTaxPremium(), null);
         //不含税保费
         InsPlyIncome insPlyIncome = new InsPlyIncome(insFeeOrderNew.getInsOrderNo(), insAreaCompany.getJqpolicyno(),
-         insAreaCompany.getSypolicyno(), null, null, null, null, order.getProductid(), insAreaCompany.getPayDate(),
-          insAreaCompany.getSigningTime(), insAreaCompany.getCompanyId(), null, insFeeOrderNew.getAgreementId(), order.getLicenseno(),
-           insAreaCompany.getTaxamount()
+                insAreaCompany.getSypolicyno(), null, null, null, null, order.getProductid(), insAreaCompany.getPayDate(),
+                insAreaCompany.getSigningTime(), insAreaCompany.getCompanyId(), null, insFeeOrderNew.getAgreementId(), order.getLicenseno(),
+                insAreaCompany.getTaxamount()
                 , allNoTaxPremium, handlingProportion, null, handlingAmount, null, handlingAmount, null, null, LocalDateTime.now(), null,
- null, null, "0", "0", "0", "0");
+                null, null, "0", "0", "0", "0");
         BigDecimal allTaxPremium = this.calculateTotal(insFeeOrderNew.getJqPremium(), insFeeOrderNew.getSyPremium(), null);
         insPlyIncome.setJqPremium(insFeeOrderNew.getJqPremium());
         insPlyIncome.setSyPremium(insFeeOrderNew.getSyPremium());
@@ -426,31 +423,31 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
 
     private void savePinTai(InsOrders order, InsFeeOrderNew insFeeOrderNew, InsAreaCompany insAreaCompany) {
         BigDecimal handlingAmount = this.calculateTotal(insFeeOrderNew.getJqSuperviseCostsPremiums(),
-         insFeeOrderNew.getSySuperviseCostsPremiums(), insFeeOrderNew.getNoSuperviseCostsPremiums());  //手续费
+                insFeeOrderNew.getSySuperviseCostsPremiums(), insFeeOrderNew.getNoSuperviseCostsPremiums());  //手续费
         BigDecimal handlingProportion = this.calculateTotal(insFeeOrderNew.getJqSuperviseCostsProportion(),
-         insFeeOrderNew.getSySuperviseCostsProportion(), insFeeOrderNew.getNoSuperviseCostsProportion());//手续费比例
+                insFeeOrderNew.getSySuperviseCostsProportion(), insFeeOrderNew.getNoSuperviseCostsProportion());//手续费比例
         BigDecimal otherAmount = this.calculateTotal(insFeeOrderNew.getJqOtherCostsPremiums(), insFeeOrderNew.getSyOtherCostsPremiums(),
-         insFeeOrderNew.getNoOtherCostsPremiums());//跟单费
+                insFeeOrderNew.getNoOtherCostsPremiums());//跟单费
         BigDecimal otherProportion = this.calculateTotal(insFeeOrderNew.getSyOtherCostsProportion(),
-         insFeeOrderNew.getJqOtherCostsProportion(), insFeeOrderNew.getNoOtherCostsProportion()); //跟单费比例
+                insFeeOrderNew.getJqOtherCostsProportion(), insFeeOrderNew.getNoOtherCostsProportion()); //跟单费比例
 //      不含税保费
         BigDecimal allNoTaxPremium = this.calculateTotal(insFeeOrderNew.getJqNoTaxPremium(), insFeeOrderNew.getSyNoTaxPremium(),
-         insFeeOrderNew.getNoNoTaxPremium());
+                insFeeOrderNew.getNoNoTaxPremium());
         BigDecimal allAmount = this.calculateTotal(otherAmount, handlingAmount, null);
         BigDecimal jqReceivableProportion = this.calculateTotal(insFeeOrderNew.getJqSuperviseCostsProportion(),
-         insFeeOrderNew.getJqOtherCostsProportion(), null);// 交强应收 比例
+                insFeeOrderNew.getJqOtherCostsProportion(), null);// 交强应收 比例
         BigDecimal syReceivableProportion = this.calculateTotal(insFeeOrderNew.getSySuperviseCostsProportion(),
-         insFeeOrderNew.getSyOtherCostsProportion(), null);//商业应收比例
+                insFeeOrderNew.getSyOtherCostsProportion(), null);//商业应收比例
         BigDecimal noReceivableProportion = this.calculateTotal(insFeeOrderNew.getNoSuperviseCostsProportion(),
-         insFeeOrderNew.getNoOtherCostsProportion(), null);
+                insFeeOrderNew.getNoOtherCostsProportion(), null);
 
         String noPolicyno = this.setNoPolicyno(insAreaCompany);
         InsPlyIncome insPlyIncome = new InsPlyIncome(insFeeOrderNew.getInsOrderNo(), insAreaCompany.getJqpolicyno(),
-         insAreaCompany.getSypolicyno(),
+                insAreaCompany.getSypolicyno(),
                 noPolicyno, null, null, null, order.getProductid(), insAreaCompany.getPayDate(), insAreaCompany.getSigningTime(),
-                 insAreaCompany.getCompanyId(),
+                insAreaCompany.getCompanyId(),
                 null, insFeeOrderNew.getAgreementId(), order.getLicenseno(), insAreaCompany.getTaxamount(), allNoTaxPremium,
-handlingProportion,
+                handlingProportion,
                 otherProportion, handlingAmount, otherAmount, allAmount, null, null, LocalDateTime.now(), null, null, null, "0", "0", "0", "0");
         insPlyIncome.setJqReceivableProportion(jqReceivableProportion);
         insPlyIncome.setSyReceivableProportion(syReceivableProportion);
@@ -568,7 +565,7 @@ handlingProportion,
             }
             if (StringUtils.isNotEmpty(insPlyIncomeVo.getId())) {
                 SettlementDocumentaryFeesEntity settlementDocumentaryFeesEntity =
-                 settlementDocumentaryFeesService.getById(insPlyIncomeVo.getId());
+                        settlementDocumentaryFeesService.getById(insPlyIncomeVo.getId());
 //                通过任务id查询 明细
                 String taskId = settlementDocumentaryFeesEntity.getTaskId();
                 List<String> incomeIds = incomeTaskRelationshipService.getByTaskId(taskId);
@@ -582,7 +579,7 @@ handlingProportion,
 
             pageHelper = new PageInfo(list);
             BasePageResult<InsPlyIncome> pageResult = new BasePageResult<InsPlyIncome>(insPlyIncomeVo.getPageNum(),
-             insPlyIncomeVo.getPageSize(), pageHelper.getTotal(), pageHelper.getPages(), list);
+                    insPlyIncomeVo.getPageSize(), pageHelper.getTotal(), pageHelper.getPages(), list);
             return HttpResult.ok(pageResult);
         } catch (Exception e) {
             e.printStackTrace();
@@ -800,7 +797,7 @@ handlingProportion,
             List<InsPlyIncome> list = this.baseMapper.NonSettlementQuery(params);
             pageHelper = new PageInfo(list);
             BasePageResult<InsPlyIncome> pageResult = new BasePageResult<InsPlyIncome>(insPlyIncomeVo.getPageNum(),
-             insPlyIncomeVo.getPageSize(), pageHelper.getTotal(), pageHelper.getPages(), list);
+                    insPlyIncomeVo.getPageSize(), pageHelper.getTotal(), pageHelper.getPages(), list);
             return HttpResult.ok(pageResult);
         } catch (Exception e) {
             e.printStackTrace();
@@ -1334,7 +1331,7 @@ handlingProportion,
             BigDecimal noPremium = initializationBigdecimal(insPlyIncomeVo.getNoPremium()); //非车保费
             //手续费比例
             insPlyIncome.setCommissionFeerate(this.calculateTotal(jqSuperviseCostsProportion, sySuperviseCostsProportion,
-             noSuperviseCostsProportion));  //手续费比例 = 商业手续费比例 +  交强手续费比例 + 非车手续费比例
+                    noSuperviseCostsProportion));  //手续费比例 = 商业手续费比例 +  交强手续费比例 + 非车手续费比例
             if (jqSuperviseCostsProportion != null && jqPremium != null) {
                 insPlyIncome.setJqSuperviseCostsPremiums(algorithmAmount(jqPremium, jqSuperviseCostsProportion));  //交强手续费
                 insPlyIncome.setJqSuperviseCostsProportion(jqSuperviseCostsProportion);
@@ -1622,9 +1619,9 @@ handlingProportion,
                 }
             } else {
 //                因为跟单没有关联表 也无法关联到开票表所以只能按照 条件去进行判断
-               if(StringUtils.isNotEmpty( insPlyIncome.getSettleOtherStatus())  && "1".equals( insPlyIncome.getSettleOtherStatus())){
-                   throw new SystemException("已经对账不能进行删除");
-               }
+                if(StringUtils.isNotEmpty( insPlyIncome.getSettleOtherStatus())  && "1".equals( insPlyIncome.getSettleOtherStatus())){
+                    throw new SystemException("已经对账不能进行删除");
+                }
             }
         }
 
@@ -1697,7 +1694,7 @@ handlingProportion,
         pageHelper = new PageInfo(list);
 
         return HttpResult.ok(new BasePageResult<>(insPlyIncomeVo.getPageNum(), insPlyIncomeVo.getPageSize(), pageHelper.getTotal(),
-         pageHelper.getPages(), list));
+                pageHelper.getPages(), list));
     }
 
     /**
@@ -1727,7 +1724,7 @@ handlingProportion,
         params.put("id", insPlyIncomeVo.getId());
         params.put("handlingFeesStatus", "1");
         SettlementDocumentaryFeesEntity parentSettlementDocumentaryFeesEntity =
-         settlementDocumentaryFeesService.getByParentSettlementAmount(params);
+                settlementDocumentaryFeesService.getByParentSettlementAmount(params);
 
         if (ObjectUtils.isNotEmpty(parentSettlementDocumentaryFeesEntity)) { // 多次结算
             BigDecimal totalAmount = parentSettlementDocumentaryFeesEntity.getTotalAmount();
@@ -2014,7 +2011,7 @@ handlingProportion,
 
 //         表内总金额
         SettlementDocumentaryFeesEntity byIdSettlementDocumentaryFeesEntity =
-         settlementDocumentaryFeesService.getById(insPlyIncomeVo.getId());
+                settlementDocumentaryFeesService.getById(insPlyIncomeVo.getId());
         BigDecimal invoicAmount = byIdSettlementDocumentaryFeesEntity.getTotalAmount();
 
 
@@ -2026,7 +2023,7 @@ handlingProportion,
         params.put("id", insPlyIncomeVo.getId());
         params.put("handlingFeesStatus", "0");
         SettlementDocumentaryFeesEntity parentSettlementDocumentaryFeesEntity =
-         settlementDocumentaryFeesService.getByParentSettlementAmount(params);
+                settlementDocumentaryFeesService.getByParentSettlementAmount(params);
 
         if (ObjectUtils.isNotEmpty(parentSettlementDocumentaryFeesEntity)) { // 多次结算
             BigDecimal totalAmount = parentSettlementDocumentaryFeesEntity.getTotalAmount();
@@ -3007,6 +3004,7 @@ handlingProportion,
         }
     }
 
+
     @Override
     public void batchUpdateVoucher(InsPlyIncomeVo insPlyIncomeVo) {
         String s = insPlyIncomeVo.getSelectIds().get(0);
@@ -3048,7 +3046,7 @@ handlingProportion,
     @Override
     public List<PlatformSettlementRecordDto> platformSettlementRecord(InsPlyIncomeVo insPlyIncomeVo) {
         if(insPlyIncomeVo.getPartnerCompaniesId()==null || "".equals(insPlyIncomeVo.getPartnerCompaniesId())){
-           throw new SystemException("合作公司编码(partnerCompaniesId)不能为空");
+            throw new SystemException("合作公司编码(partnerCompaniesId)不能为空");
         }
         if(insPlyIncomeVo.getHandlingFeesStatus()==null || "".equals(insPlyIncomeVo.getHandlingFeesStatus())){
             throw new SystemException("结算状态 0 未结算 1已结算(handlingFeesStatus)不能为空");
@@ -3272,6 +3270,71 @@ handlingProportion,
         }
         return HttpResult.ok();
     }
+    /**
+     *  @version
+     *  @author: hxl
+     *  @Date: 2024/8/1 9:28
+     *  @Description:  查询平台、私有数据
+     */
+    @Override
+    public FinancialReceivablesAllVo queryDateByType(FinancialReceivablesQueryVo financialReceivablesQueryVo) {
+        //检查参数
+        if(StringUtils.isBlank(financialReceivablesQueryVo.getType())){
+            throw new SystemException("应收类型不能为空,1为平台2为私有,默认传1");
+        }
+        int year =0;
+        if(StringUtils.isBlank(financialReceivablesQueryVo.getYear())){
+            Calendar cale = Calendar.getInstance();
+            year = cale.get(Calendar.YEAR);
+        }else{
+            year = Integer.parseInt(financialReceivablesQueryVo.getYear());
+        }
+        financialReceivablesQueryVo.setBeginDate(SliceUpDateUtil.getYearBeginDateStr(year)+" 00:00:00");
+        financialReceivablesQueryVo.setEndDate(SliceUpDateUtil.getYearEndDateStr(year)+" 23:59:59");
+        financialReceivablesQueryVo.setType("1");
+        //总应收
+        BigDecimal ptSumAmount =  baseMapper.queryDateByTypeSumAmount(financialReceivablesQueryVo);
+        financialReceivablesQueryVo.setType("2");
+        //总应收
+        BigDecimal sySumAmount =  baseMapper.queryDateByTypeSumAmount(financialReceivablesQueryVo);
+
+        List<FinancialReceivablesVo> list  =  baseMapper.queryDateByType(financialReceivablesQueryVo);
+
+        return new FinancialReceivablesAllVo(ptSumAmount.toString(),sySumAmount.toString(),year+"",list);
+    }
+    /**
+     *  @version
+     *  @author: hxl
+     *  @Date: 2024/8/5 9:56
+     *  @Description:  应收月份统计接口
+     */
+    @Override
+    public FinancialReceivablesAllMonthVo queryDateByTypeByMonth(FinancialReceivablesQueryMonthVo financialReceivablesQueryVo) {
+        //检查参数
+        if(StringUtils.isBlank(financialReceivablesQueryVo.getType())){
+            throw new SystemException("应收类型不能为空,1为平台2为私有,默认传1");
+        }
+        //检查参数
+        if(StringUtils.isBlank(financialReceivablesQueryVo.getYearAndMonth())){
+            throw new SystemException("月份不能为空");
+        }
+        String yearAndMonth = financialReceivablesQueryVo.getYearAndMonth();
+        int year = Integer.parseInt(yearAndMonth.split("-")[0]);
+        int month = Integer.parseInt(yearAndMonth.split("-")[1]);
 
+        financialReceivablesQueryVo.setBeginDate(SliceUpDateUtil.getStartOfMonth(year,month));
+        financialReceivablesQueryVo.setEndDate(SliceUpDateUtil.getEndOfMonth(year,month));
+        //查询总数
+        FinancialReceivablesAllMonthVo  vo= baseMapper.queryDateByTypeByMonth(financialReceivablesQueryVo);
+        vo.setYearAndMonth(yearAndMonth);
+        //查询列表
+        List<FinancialReceivablesMonthVo> list = baseMapper.queryDateByTypeByMonthList(financialReceivablesQueryVo);
 
+        //按区域
+        //if()
+
+
+
+        return null;
+    }
 }

+ 1 - 2
src/main/java/com/ydtech/modules/order/aop/aspect/QuoteVerificationAspect.java

@@ -7,7 +7,6 @@ import com.ydtech.constants.enums.dict.InsOrderStatusEnum;
 import com.ydtech.constants.enums.dict.agreement.ProductsType;
 import com.ydtech.constants.sys.SystemConstant;
 import com.ydtech.core.page.HttpResult;
-import com.ydtech.exception.SystemException;
 import com.ydtech.modules.admin.model.SysUser;
 import com.ydtech.modules.admin.model.SysUserRole;
 import com.ydtech.modules.admin.service.SysUserRoleService;
@@ -174,7 +173,7 @@ public class QuoteVerificationAspect {
                     for(InsAreaCompany subOrder : insAreaList){
                         PtlAgreement ptlAgreement = ptlAgreementService.getById(subOrder.getAgreementId());
                         if(ptlAgreement!=null && ptlAgreement.getIsExternal()!=null && ptlAgreement.getIsExternal()==1){
-                            throw new SystemException("外部订单不允许报价,请到外部订单编辑页面进行编辑!!");
+                           // throw new SystemException("外部订单不允许报价,请到外部订单编辑页面进行编辑!!");
                         }
                     }
                 }

+ 2 - 0
src/main/java/com/ydtech/modules/order/components/pingan/PinganRequestApiComponents.java

@@ -269,6 +269,8 @@ public class PinganRequestApiComponents {
             InsuranceLog.infoLog(InsuranceEnum.PAIC.getPinyin(), "\n\t---------> {} \n\t---------> 返回数据:{}", requestUrl.getCode() + "--" + url + "--" + requestUrl.getDesc(), sm4DecodeResult);
             SignEleApplyResponse signEleApplyResponse =new  SignEleApplyResponse();
             signEleApplyResponse.setResultMessage(sm4DecodeResult);
+            pinganApiLog.setResponseBody(sm4DecodeResult);
+            pinganApiLogService.save(pinganApiLog);
             return (S)signEleApplyResponse;
         }else{
             CommonResponse obj = JSON.parseObject(responseBody).toJavaObject(CommonResponse.class);

+ 8 - 4
src/main/java/com/ydtech/modules/order/controller/DrivingInsuranceController.java

@@ -2,11 +2,7 @@ package com.ydtech.modules.order.controller;
 
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.ydtech.core.page.HttpResult;
-import com.ydtech.core.page.PageRequest;
 import com.ydtech.modules.base.controller.BaseController;
-import com.ydtech.modules.ins.model.guoren.CarModelResp;
-import com.ydtech.modules.ins.model.vo.CarInfoVo;
-import com.ydtech.modules.order.entity.InsDrivingIntentionInsurance;
 import com.ydtech.modules.order.entity.PtlAgreementNonCarProductRule;
 import com.ydtech.modules.order.entity.vo.DrivingInsuranceQueryVo;
 import com.ydtech.modules.order.entity.vo.InsDrivingIntentionInsuranceVo;
@@ -23,6 +19,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
 import java.util.List;
+import java.util.Map;
 
 @Api(tags = "驾意险 API")
 @RestController
@@ -95,4 +92,11 @@ public class DrivingInsuranceController extends BaseController {
         List<InsDrivingIntentionInsuranceVo> insDrivingIntentionInsuranceVo = insDrivingIntentionInsuranceService.getInsDrivingIntentionInsuranceRule(insuranceQueryVo);
         return HttpResult.ok(insDrivingIntentionInsuranceVo);
     }
+
+    @ApiOperation(value = "根据规则获取平安驾意险信息")
+    @PostMapping(value = "getPingAnDrivingInsuranceRule")
+    public HttpResult<Map<String,List<InsDrivingIntentionInsuranceVo>>> getPingAnDrivingInsuranceRule(@RequestBody NoCarInsuranceQueryVo insuranceQueryVo) {
+        Map<String,List<InsDrivingIntentionInsuranceVo>> insDrivingIntentionInsuranceVo = insDrivingIntentionInsuranceService.getPingAnDrivingInsuranceRule(insuranceQueryVo);
+        return HttpResult.ok(insDrivingIntentionInsuranceVo);
+    }
 }

+ 14 - 6
src/main/java/com/ydtech/modules/order/controller/PingAnOrderApiController.java

@@ -3,6 +3,7 @@ package com.ydtech.modules.order.controller;
 
 import com.ydtech.aop.request.RequestSingleParam;
 import com.ydtech.core.page.HttpResult;
+import com.ydtech.exception.SystemException;
 import com.ydtech.modules.ins.model.vo.QuoteRespVo;
 import com.ydtech.modules.order.aop.QuoteVerification;
 import com.ydtech.modules.order.components.InsOrdersComponents;
@@ -14,15 +15,13 @@ import com.ydtech.modules.order.entity.vo.BaseQuoteInfoVo;
 import com.ydtech.modules.order.entity.vo.InsDrivingIntentionInsuranceVo;
 import com.ydtech.modules.order.entity.vo.SpecialAuditVo;
 import com.ydtech.modules.order.entity.vo.bohai.ProductDetailsQueryVo;
-import com.ydtech.modules.order.entity.vo.pingan.InsDrivingIntentionInsuranceSonVo;
-import com.ydtech.modules.order.entity.vo.pingan.PingAnQuoteVo;
-import com.ydtech.modules.order.entity.vo.pingan.RenewalConfirmVo;
-import com.ydtech.modules.order.entity.vo.pingan.StorefrontQueryVo;
+import com.ydtech.modules.order.entity.vo.pingan.*;
 import com.ydtech.modules.order.service.PingAnOrderApiService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.web.bind.annotation.*;
 
 import java.util.List;
@@ -144,7 +143,16 @@ public class PingAnOrderApiController {
      */
     @PostMapping("/recoverApplyVerifyCode")
     @ApiOperation(value = "5短信回收阅读状态")
-    public HttpResult<Object> recoverApplyVerifyCode(String companyId,String msgCode) throws Exception {
+    public HttpResult<Object> recoverApplyVerifyCode(@RequestBody RecoverApplyVerifyCodeVo recoverApplyVerifyCodeVo) throws Exception {
+
+        String companyId = recoverApplyVerifyCodeVo.getCompanyId();
+        String msgCode = recoverApplyVerifyCodeVo.getMsgCode();
+        if(StringUtils.isBlank(companyId)){
+            throw new SystemException("子订单id不能为空!!");
+        }
+        if(StringUtils.isBlank(msgCode)){
+            throw new SystemException("短信验证码不能为空!!");
+        }
         return this.pingAnOrderApiService.recoverApplyVerifyCode(companyId,msgCode);
     }
     /**
@@ -166,7 +174,7 @@ public class PingAnOrderApiController {
      */
     @PostMapping("/payReturn")
     @ApiOperation(value = "7支付回调-更新承保状态")
-    public HttpResult<Object> payReturn(PayReturnRequest payReturnRequest) throws Exception {
+    public HttpResult<Object> payReturn(@RequestBody PayReturnRequest payReturnRequest) throws Exception {
         return this.pingAnOrderApiService.payReturn(payReturnRequest);
     }
     /**

+ 20 - 0
src/main/java/com/ydtech/modules/order/entity/vo/pingan/RecoverApplyVerifyCodeVo.java

@@ -0,0 +1,20 @@
+package com.ydtech.modules.order.entity.vo.pingan;
+
+import io.swagger.annotations.ApiModel;
+import lombok.Data;
+
+/**
+ *  @version
+ *  @author: hxl
+ *  @Date: 2024/8/1 15:53
+ *  @Description:
+ */
+@Data
+@ApiModel(value = "短线验证对象")
+public class RecoverApplyVerifyCodeVo {
+
+     private  String  companyId;
+
+
+     private String msgCode;
+}

+ 8 - 1
src/main/java/com/ydtech/modules/order/service/InsDrivingIntentionInsuranceService.java

@@ -1,13 +1,13 @@
 package com.ydtech.modules.order.service;
 
 import com.baomidou.mybatisplus.extension.service.IService;
-import com.ydtech.modules.order.entity.InsCopyFeeOrder;
 import com.ydtech.modules.order.entity.InsDrivingIntentionInsurance;
 import com.ydtech.modules.order.entity.InsDrivingIntentionInsuranceSon;
 import com.ydtech.modules.order.entity.vo.InsDrivingIntentionInsuranceVo;
 import com.ydtech.modules.order.entity.vo.NoCarInsuranceQueryVo;
 
 import java.util.List;
+import java.util.Map;
 
 /**
  * 针对表【ins_driving_intention_insurance(驾意险)】的数据库操作Service
@@ -45,4 +45,11 @@ public interface InsDrivingIntentionInsuranceService extends IService<InsDriving
      * @return
      */
     List<InsDrivingIntentionInsuranceSon> getInsDrivingIntentionInsuranceSon(String companyId,String drivingCodeId);
+    /**
+     *  @version
+     *  @author: hxl
+     *  @Date: 2024/8/5 8:34
+     *  @Description:  获取平安的驾意外险信息
+     */
+    Map<String, List<InsDrivingIntentionInsuranceVo>> getPingAnDrivingInsuranceRule(NoCarInsuranceQueryVo insuranceQueryVo);
 }

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

@@ -156,7 +156,7 @@ public interface PingAnOrderApiService {
      *  @Date: 2024/7/18 15:00
      *  @Description:  返回驾意险信息
      */
-    public List<InsDrivingIntentionInsuranceVo> productQueryList(ProductDetailsRequest productDetailsRequest);
+    public Map<String, List<InsDrivingIntentionInsuranceVo>> productQueryList(ProductDetailsRequest productDetailsRequest);
     /**
      *  @version
      *  @author: hxl

+ 52 - 6
src/main/java/com/ydtech/modules/order/service/impl/InsDrivingIntentionInsuranceServiceImpl.java

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.ydtech.constants.enums.InsuranceRisk;
 import com.ydtech.constants.enums.dict.agreement.ProductsType;
+import com.ydtech.exception.SystemException;
 import com.ydtech.modules.order.dao.InsDrivingIntentionInsuranceMapper;
 import com.ydtech.modules.order.dao.InsDrivingIntentionInsuranceSonMapper;
 import com.ydtech.modules.order.entity.InsDrivingIntentionInsurance;
@@ -19,11 +20,13 @@ import com.ydtech.modules.protocol.entity.po.PtlAgreement;
 import com.ydtech.modules.protocol.entity.po.PtlAgreementAttribution;
 import com.ydtech.modules.protocol.service.PtlAgreementAttributionService;
 import com.ydtech.modules.protocol.service.PtlAgreementService;
+import com.ydtech.utils.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Map;
 import java.util.stream.Collectors;
 
 /**
@@ -114,12 +117,12 @@ public class InsDrivingIntentionInsuranceServiceImpl extends ServiceImpl<InsDriv
         //判断是否是平安
         if("PAIC1000000".equals(ptlAgreement.getInsuranceCompanyId())){
             //调用接口返回数据
-            ProductDetailsRequest productDetailsRequest  =new ProductDetailsRequest(insuranceVo.getAgreementId(), insuranceVo.getRuleUseNature() ,
-                    insuranceVo.getOwnAttribute(), insuranceVo.getRuleSeatNum(), insuranceVo.getTonNumber(),
-                    insuranceVo.getIsUseCombine(), insuranceVo.getCimodelclass(),ptlAgreement.getInsuranceCompanyId());
-            List<InsDrivingIntentionInsuranceVo> insDrivingIntentionInsuranceVos = pingAnOrderApiService.productQueryList(productDetailsRequest);
-            return insDrivingIntentionInsuranceVos;
-
+          //  ProductDetailsRequest productDetailsRequest  =new ProductDetailsRequest(insuranceVo.getAgreementId(), insuranceVo.getRuleUseNature() ,
+          //          insuranceVo.getOwnAttribute(), insuranceVo.getRuleSeatNum(), insuranceVo.getTonNumber(),
+          //          insuranceVo.getIsUseCombine(), insuranceVo.getCimodelclass(),ptlAgreement.getInsuranceCompanyId());
+           // List<InsDrivingIntentionInsuranceVo> insDrivingIntentionInsuranceVos = pingAnOrderApiService.productQueryList(productDetailsRequest);
+           // return insDrivingIntentionInsuranceVos;
+            return null;
         }else{
             LambdaQueryWrapper<PtlAgreementNonCarProductRule> query = new LambdaQueryWrapper<PtlAgreementNonCarProductRule>();
             ProductsType productType = InsuranceRisk.determineInsuranceInformation(insuranceVo.getKind(), insuranceVo.getRisk());
@@ -192,4 +195,47 @@ public class InsDrivingIntentionInsuranceServiceImpl extends ServiceImpl<InsDriv
                         .eq(InsDrivingIntentionInsuranceSon::getDrivingCodeId, drivingCodeId)));
         return insDrivingIntentionInsuranceSons;
     }
+    /**
+     *  @version
+     *  @author: hxl
+     *  @Date: 2024/8/5 8:36
+     *  @Description:  获取平安驾意险信息
+     */
+    @Override
+    public Map<String, List<InsDrivingIntentionInsuranceVo>> getPingAnDrivingInsuranceRule(NoCarInsuranceQueryVo insuranceVo) {
+        // 添加平安的驾意险的险种信息   2024-07-18
+        PtlAgreement ptlAgreement = ptlAgreementService.getById(insuranceVo.getAgreementId());
+        //参数验证
+        if (StringUtils.isBlank(insuranceVo.getAgreementId())) {
+            new SystemException("协议id不能为空!!");
+        }
+        if (StringUtils.isBlank(insuranceVo.getUseAttribute())) {
+            new SystemException("车辆使用性质代码01-营业02-非营业不能为空!!");
+        }
+        if (StringUtils.isBlank(insuranceVo.getUseAttribute())) {
+            new SystemException("所属性质(01:机关,02:企业,03:私人 默认03:私人 车辆使用性质为01:营业时,所属性质不可以选择01:机关)不能为空!!");
+        }
+        if (StringUtils.isBlank(insuranceVo.getRuleSeatNum())) {
+            new SystemException("座位数不能为空!!");
+        }
+        if (StringUtils.isBlank(insuranceVo.getIsUseCombine())) {
+            new SystemException("是否查询组合产品不能为空!!");
+        }
+        if (StringUtils.isBlank(insuranceVo.getCimodelclass())) {
+            new SystemException("车辆种类(A0客户 、A1货车)不能为空!!");
+        }
+        //核定载质量(吨) 必填
+        if ("A1".equals(insuranceVo.getCimodelclass()) && StringUtils.isBlank(insuranceVo.getTonNumber())) {
+            new SystemException("货车(核定载质量(吨))不能为空!!");
+        }
+        if ("A0".equals(insuranceVo.getCimodelclass())) {
+            insuranceVo.setTonNumber(null);
+        }
+        //调用接口返回数据
+        ProductDetailsRequest productDetailsRequest = new ProductDetailsRequest(insuranceVo.getAgreementId(), insuranceVo.getUseAttribute(),
+                insuranceVo.getOwnAttribute(), insuranceVo.getRuleSeatNum(), insuranceVo.getTonNumber(),
+                insuranceVo.getIsUseCombine(), insuranceVo.getCimodelclass(), ptlAgreement.getInsuranceCompanyId());
+        Map<String, List<InsDrivingIntentionInsuranceVo>> insDrivingIntentionInsuranceVos = pingAnOrderApiService.productQueryList(productDetailsRequest);
+        return insDrivingIntentionInsuranceVos;
+    }
 }

+ 48 - 50
src/main/java/com/ydtech/modules/order/service/impl/PingAnOrderApiServiceImpl.java

@@ -84,8 +84,8 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
     private final PingAnApiConfigurationProperties properties;
 
     private final InsUploadFilesService insUploadFilesService;
-    
 
+    private final PinganApiLogService   pinganApiLogService;
 
 
     /**
@@ -277,7 +277,7 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
                                                   SearchPAVehicleListResponse.ModelsDto modelsDto,String userId,
                                                   PinganApiLog pinganApiLog,
                                                   CarConfirmResponse carConfirmResponse
-                                                  ) {
+    ) {
 
         PingAnQuoteRespVo quoteRespVo = new PingAnQuoteRespVo();
         CarInfoVo carInfo = yaQuoteInfoVo.getCarInfo();
@@ -390,7 +390,7 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
                                                  String userId,
                                                  PinganApiLog pinganApiLog,
                                                  CarConfirmResponse carConfirmResponse
-                                                 ) {
+    ) {
         // 保存订单信息
         InsAreaCompany insAreaCompany = new InsAreaCompany(quoteRespVo, ptlAgreementAttribution);
         //平安业务id
@@ -595,13 +595,13 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
                                 jqflag = true;
                             }
                         }
-                        if ("单交".equals(insAreaCompany.getProduct()) && !jqflag) {
-                            insAreaCompany.setJqpolicyno(bizApplyNo);
-                        } else if (("交三".equals(insAreaCompany.getProduct()) || "交商".equals(insAreaCompany.getProduct())) && !jqflag && !sqflag) {
-                            insAreaCompany.setJqpolicyno(bizApplyNo);
-                            insAreaCompany.setSypolicyno(forceApplyNo);
-                        } else if (("单商".equals(insAreaCompany.getProduct()) || "单三".equals(insAreaCompany.getProduct())) && !sqflag) {
-                            insAreaCompany.setSypolicyno(forceApplyNo);
+                        if ("单交".equals(insAreaCompany.getProduct()) && jqflag) {
+                            insAreaCompany.setJqapplyno(forceApplyNo);
+                        } else if (("交三".equals(insAreaCompany.getProduct()) || "交商".equals(insAreaCompany.getProduct())) && jqflag && sqflag) {
+                            insAreaCompany.setJqpolicyno(forceApplyNo);
+                            insAreaCompany.setSyapplyno(bizApplyNo);
+                        } else if (("单商".equals(insAreaCompany.getProduct()) || "单三".equals(insAreaCompany.getProduct())) && sqflag) {
+                            insAreaCompany.setSyapplyno(bizApplyNo);
                         }
                         //说明核保成功,更新大订单和小订单的状态为1  更新为已核保待缴费
                         insAreaCompany.setOrderstatus(InsOrderStatusEnum.WAIT_PAY.getCode());
@@ -1122,30 +1122,8 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
      * @Date: 2024/7/18 14:45
      * @Description: 组合成驾意外险信息
      */
-    public List<InsDrivingIntentionInsuranceVo> productQueryList(ProductDetailsRequest productDetailsRequest) {
-        //参数验证
-        if (StringUtils.isBlank(productDetailsRequest.getAgreementId())) {
-            new SystemException("协议id不能为空!!");
-        }
-        if (StringUtils.isBlank(productDetailsRequest.getUseAttribute())) {
-            new SystemException("车辆使用性质代码01-营业02-非营业不能为空!!");
-        }
-        if (StringUtils.isBlank(productDetailsRequest.getUseAttribute())) {
-            new SystemException("所属性质(01:机关,02:企业,03:私人 默认03:私人 车辆使用性质为01:营业时,所属性质不可以选择01:机关)不能为空!!");
-        }
-        if (StringUtils.isBlank(productDetailsRequest.getSeats())) {
-            new SystemException("座位数不能为空!!");
-        }
-        if (StringUtils.isBlank(productDetailsRequest.getIsUseCombine())) {
-            new SystemException("是否查询组合产品不能为空!!");
-        }
-        if (StringUtils.isBlank(productDetailsRequest.getCimodelclass())) {
-            new SystemException("车辆种类(A0客户 、A1货车)不能为空!!");
-        }
-        //核定载质量(吨) 必填
-        if ("A1".equals(productDetailsRequest.getCimodelclass()) && StringUtils.isBlank(productDetailsRequest.getTonNumber())) {
-            new SystemException("货车(核定载质量(吨))不能为空!!");
-        }
+    public  Map<String, List<InsDrivingIntentionInsuranceVo>> productQueryList(ProductDetailsRequest productDetailsRequest) {
+        Map<String, List<InsDrivingIntentionInsuranceVo>>  map=new HashMap<String, List<InsDrivingIntentionInsuranceVo>>();
         // 账号信息
         PtlAgreementAttribution ptlAgreementAttribution = ptlAgreementAttributionService.getById(productDetailsRequest.getAgreementId());
         // 通过 协议id获取配置实体
@@ -1174,11 +1152,17 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
             List<InsDrivingIntentionInsuranceVo> cyList = getCYAndXWList(unAutoListInfo, productDetailsRequest.getSeats(), productDetailsRequest.getCompanyId());
             List<InsDrivingIntentionInsuranceVo> xwList = getCYAndXWList(xiaoWeiListInfo, productDetailsRequest.getSeats(), productDetailsRequest.getCompanyId());
             List<InsDrivingIntentionInsuranceVo> zhList = getCHList(combinationInfoList, productDetailsRequest.getSeats(), productDetailsRequest.getCompanyId());
-            all.addAll(cyList);
-            all.addAll(xwList);
-            all.addAll(zhList);
+            map.put("1",cyList);
+            if(xwList==null || xwList.size()==0){
+                xwList=cyList;
+            }
+            if(zhList==null || zhList.size()==0){
+                zhList=cyList;
+            }
+            map.put("2",xwList);
+            map.put("3",zhList);
         }
-        return all;
+        return map;
     }
     /**
      *  @version
@@ -1194,10 +1178,14 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
         // 通过 协议id获取配置实体
         PingAnConfigureParameters parameters = configureParametersComponents.toEntity(PingAnConfigureParameters.class,
                 ptlAgreementAttribution);
-        String bizApplyNo = insAreaCompany.getJqpolicyno();
-        String forceApplyNo = insAreaCompany.getSypolicyno();
-        SignEleApplyRequest signEleApplyRequest = new SignEleApplyRequest(parameters.getUserId(), bizApplyNo, forceApplyNo, String.valueOf(System.currentTimeMillis()), "GET", null);
+        String  forceApplyNo = insAreaCompany.getJqapplyno();
+        String bizApplyNo= insAreaCompany.getSyapplyno();
+
+        String signatureUrl = properties.getSignatureUrl();
+        signatureUrl=signatureUrl+"?companyId=" +companyId;
+        SignEleApplyRequest signEleApplyRequest = new SignEleApplyRequest(parameters.getUserId(), bizApplyNo, forceApplyNo, String.valueOf(System.currentTimeMillis()), "GET", signatureUrl);
         SignEleApplyResponse signEleApplyResponse = null;
+
         PinganApiLog pinganApiLog = new PinganApiLog(insAreaCompany.getOrderno(),companyId,insAreaCompany.getAgreementId());
         try {
             signEleApplyResponse = pinganRequestApiComponents.signEleApply(signEleApplyRequest,pinganApiLog);
@@ -1223,8 +1211,8 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
         // 通过 协议id获取配置实体
         PingAnConfigureParameters parameters = configureParametersComponents.toEntity(PingAnConfigureParameters.class,
                 ptlAgreementAttribution);
-        String forceApplyNo = insAreaCompany.getJqpolicyno();
-        String  bizApplyNo= insAreaCompany.getSypolicyno();
+        String forceApplyNo = insAreaCompany.getJqapplyno();
+        String  bizApplyNo= insAreaCompany.getSyapplyno();
         ApplyVerifyCodeRequest applyVerifyCodeRequest = new ApplyVerifyCodeRequest(parameters.getUserId(), bizApplyNo, forceApplyNo);
         ApplyVerifyCodeResponse applyVerifyCodeResponse = null;
         PinganApiLog pinganApiLog = new PinganApiLog(insAreaCompany.getOrderno(),companyId,insAreaCompany.getAgreementId());
@@ -1249,8 +1237,8 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
         // 通过 协议id获取配置实体
         PingAnConfigureParameters parameters = configureParametersComponents.toEntity(PingAnConfigureParameters.class,
                 ptlAgreementAttribution);
-        String bizApplyNo = insAreaCompany.getJqpolicyno();
-        String forceApplyNo = insAreaCompany.getSypolicyno();
+        String forceApplyNo= insAreaCompany.getJqapplyno();
+        String  bizApplyNo = insAreaCompany.getSyapplyno();
         RecoverApplyVerifyCodeRequest recoverApplyVerifyCodeRequest = new RecoverApplyVerifyCodeRequest(parameters.getUserId(), bizApplyNo, forceApplyNo,issueCode,null);
         RecoverApplyVerifyCodeResponse recoverApplyVerifyCodeResponse = null;
         PinganApiLog pinganApiLog = new PinganApiLog(insAreaCompany.getOrderno(),companyId,insAreaCompany.getAgreementId());
@@ -1259,7 +1247,11 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
         } catch (Exception e) {
             throw new SystemException(e.getMessage());
         }
-        return HttpResult.ok(recoverApplyVerifyCodeResponse);
+        if (recoverApplyVerifyCodeResponse != null && "0".equals(recoverApplyVerifyCodeResponse.getResultCode())) {
+            return createNotice(companyId);
+        }else{
+            throw new SystemException(recoverApplyVerifyCodeResponse.getResultMessage());
+        }
     }
     /**
      *  @version
@@ -1275,8 +1267,8 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
         // 通过 协议id获取配置实体
         PingAnConfigureParameters parameters = configureParametersComponents.toEntity(PingAnConfigureParameters.class,
                 ptlAgreementAttribution);
-        String bizApplyNo = insAreaCompany.getJqpolicyno();
-        String forceApplyNo = insAreaCompany.getSypolicyno();
+        String forceApplyNo= insAreaCompany.getJqapplyno();
+        String  bizApplyNo = insAreaCompany.getSyapplyno();
         //生成通知单号
         ArrayList<String>  noticelist =new ArrayList<String>();
         if (StringUtils.isNotBlank(bizApplyNo)) {
@@ -1317,7 +1309,6 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
             return HttpResult.error("二维码支付接口报错");
         }
         insAreaCompany.setPaymentLink(payUrl);
-
         return HttpResult.ok(payUrl);
     }
     /**
@@ -1546,6 +1537,13 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
             String businessNo = payReturnRequest.getBusinessNo();
             InsAreaCompany insAreaCompany = insAreaCompanyService.getOne(new LambdaQueryWrapper<InsAreaCompany>()
                     .eq(InsAreaCompany::getNoticeNo, businessNo));
+            PinganApiLog pinganApiLog = new PinganApiLog(insAreaCompany.getOrderno(),insAreaCompany.getId(),insAreaCompany.getAgreementId());
+            pinganApiLog.setId(null);
+            pinganApiLog.setRequestUrl("/payReturn");
+            pinganApiLog.setRequestType("支付回调");
+            pinganApiLog.setRequestParam(payReturnRequest.toString());
+            pinganApiLog.setResponseBody(null);
+            pinganApiLogService.save(pinganApiLog);
             // 账号信息
             PtlAgreementAttribution ptlAgreementAttribution = ptlAgreementAttributionService.getById(insAreaCompany.getAgreementId());
             //查询单证状态
@@ -1560,7 +1558,7 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
             if (StringUtils.isNotBlank(forceApplyNo)) {
                 list.add(forceApplyNo);
             }
-            PinganApiLog pinganApiLog = new PinganApiLog(insAreaCompany.getOrderno(),insAreaCompany.getId(),insAreaCompany.getAgreementId());
+            pinganApiLog.setId(null);
             DocumentStatusListRequest documentStatusListRequest = new DocumentStatusListRequest(list, parameters);
             DocumentStatusListResponse documentStatusListResponse = null;
             try {

+ 12 - 5
src/main/resources/application-pre.yml

@@ -316,11 +316,18 @@ bohai:
 # 平安财险
 pingan:
   api:
-    url: https://api.pingan.com.cn/open/appsvr
-    accessUrl: https://api.pingan.com.cn/oauth/oauth2/access_token
-    selfPublicKey:
-    selfPrivateKey:
-    pingAnPublicKey:
+    url: https://test-api.pingan.com.cn:20443/open/appsvr/
+    accessUrl: https://test-api.pingan.com.cn:20443/oauth/oauth2/access_token
+    selfPublicKey: 04d25a22205e582d9328d019059bc3faa4f73fee7a6892110fa27cfd32f1453328244ea51ba159745dc584bb4e99777499a138ee8fd06e17a29c4c40d1de8adb32
+    selfPrivateKey: 3f0ce053992cbcff8fe96780048c7a61a2cb3ad812ec6121b4047a666ca587f3
+    pingAnPublicKey: 2399dea79c2749d3ba5629206804ea30
+    clientId: P_TQIA_AUTO
+    clientSecret: f.ym4dMV!JZa
+    host: http://stg.iobs.pingan.com.cn
+    bucket: icore-pts-openapi-dmz-stg-pri
+    ak: 8CJK29FVFY2IK9W0Y8IIdKWD06MI202F
+    sk: K9VIM2C6W2YWDWDVK6966F29229dYMDF
+    signatureUrl: https://test.baoxianzhanggui.com/web-api/#/Signature
 
 knife4j:
   enable: false

+ 12 - 5
src/main/resources/application-prod.yml

@@ -315,11 +315,18 @@ bohai:
 # 平安财险
 pingan:
   api:
-    url: https://api.pingan.com.cn/open/appsvr
-    accessUrl: https://api.pingan.com.cn/oauth/oauth2/access_token
-    selfPublicKey:
-    selfPrivateKey:
-    pingAnPublicKey:
+    url: https://test-api.pingan.com.cn:20443/open/appsvr/
+    accessUrl: https://test-api.pingan.com.cn:20443/oauth/oauth2/access_token
+    selfPublicKey: 04d25a22205e582d9328d019059bc3faa4f73fee7a6892110fa27cfd32f1453328244ea51ba159745dc584bb4e99777499a138ee8fd06e17a29c4c40d1de8adb32
+    selfPrivateKey: 3f0ce053992cbcff8fe96780048c7a61a2cb3ad812ec6121b4047a666ca587f3
+    pingAnPublicKey: 2399dea79c2749d3ba5629206804ea30
+    clientId: P_TQIA_AUTO
+    clientSecret: f.ym4dMV!JZa
+    host: http://stg.iobs.pingan.com.cn
+    bucket: icore-pts-openapi-dmz-stg-pri
+    ak: 8CJK29FVFY2IK9W0Y8IIdKWD06MI202F
+    sk: K9VIM2C6W2YWDWDVK6966F29229dYMDF
+    signatureUrl: https://test.baoxianzhanggui.com/web-api/#/Signature
 
 knife4j:
   enable: false

+ 12 - 7
src/main/resources/application-test.yml

@@ -396,16 +396,21 @@ bohai:
     insurerCode: 'BPIC'
 
 
-# 平安财险
 pingan:
   api:
-    url: https://test-api.pingan.com.cn:20443/open/appsvr
+    url: https://test-api.pingan.com.cn:20443/open/appsvr/
     accessUrl: https://test-api.pingan.com.cn:20443/oauth/oauth2/access_token
-    selfPublicKey:
-    selfPrivateKey:
-    pingAnPublicKey:
-    clientId:
-    clientSecret:
+    selfPublicKey: 04d25a22205e582d9328d019059bc3faa4f73fee7a6892110fa27cfd32f1453328244ea51ba159745dc584bb4e99777499a138ee8fd06e17a29c4c40d1de8adb32
+    selfPrivateKey: 3f0ce053992cbcff8fe96780048c7a61a2cb3ad812ec6121b4047a666ca587f3
+    pingAnPublicKey: 2399dea79c2749d3ba5629206804ea30
+    clientId: P_TQIA_AUTO
+    clientSecret: f.ym4dMV!JZa
+    host: http://stg.iobs.pingan.com.cn
+    bucket: icore-pts-openapi-dmz-stg-pri
+    ak: 8CJK29FVFY2IK9W0Y8IIdKWD06MI202F
+    sk: K9VIM2C6W2YWDWDVK6966F29229dYMDF
+    signatureUrl: https://test.baoxianzhanggui.com/web-api
+
 
 xxl:
   job:

+ 15 - 3
src/main/resources/mapper/modules/admin/SysUserMapper.xml

@@ -87,13 +87,17 @@
         psd.id as pDeptId,
         psd.name as pDeptName,
         t4.id as roleId,
-        t4.name as roleName
+        t4.name as roleName,
+        su.create_time as submitTime,
+        sut.approveTime as approveTime
         from sys_user su
         left join sys_dept sd on su.dept_id=sd.id
         left join sys_dept psd on sd.parent_id=psd.id
         left join sys_user_info info on info.id=su.id
         left join sys_user_role t3 on su.id=t3.user_id
         left join sys_role t4 on t3.role_id=t4.id
+        left join (select user_id,MAX(approve_time) approveTime
+        from sys_user_track group by user_id ) sut on sut.user_id = su.id
         where 1=1
         AND sd.id &lt;&gt; ''
         <if test='user !=null  '>
@@ -132,7 +136,9 @@
         t4.name as roleName,
         sd.management_source,
         psd.id as pDeptId,
-        psd.name as pDeptName
+        psd.name as pDeptName,
+        su.create_time as submitTime,
+        sut.approveTime as approveTime
         FROM
         sys_user su
         LEFT JOIN sys_user_info info ON info.id = su.id
@@ -140,6 +146,8 @@
         left join sys_dept psd on psd.id = sd.parent_id
         LEFT JOIN sys_user_role t3 ON su.id = t3.user_id
         LEFT JOIN sys_role t4 ON t3.role_id = t4.id
+        left join (select user_id,MAX(approve_time) approveTime
+        from sys_user_track group by user_id ) sut on sut.user_id = su.id
         AND sd.del_flag = '0'
         WHERE
         1=1
@@ -238,7 +246,9 @@
         t4.name as roleName,
         sd.management_source,
         psd.id as pDeptId,
-        psd.name as pDeptName
+        psd.name as pDeptName,
+        su.create_time as submitTime,
+        sut.approveTime as approveTime
         FROM
         sys_user su
         LEFT JOIN sys_user_info info ON info.id = su.id
@@ -246,6 +256,8 @@
         left join sys_dept psd on psd.id = sd.parent_id
         LEFT JOIN sys_user_role t3 ON su.id = t3.user_id
         LEFT JOIN sys_role t4 ON t3.role_id = t4.id
+        left join (select user_id,MAX(approve_time) approveTime
+        from sys_user_track group by user_id ) sut on sut.user_id = su.id
         AND sd.del_flag = '0'
         WHERE
         1=1

+ 21 - 0
src/main/resources/mapper/modules/admin/SysUserTrackMapper.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.SysUserTrackMapper">
+    <resultMap id="sysUserTrackMap" type="com.ydtech.modules.admin.model.SysUserTrack">
+        <id column="id" property="id" javaType="java.lang.Integer"/>
+        <result column="user_id" property="userId" javaType="java.lang.String"/>
+        <result column="status" property="status" javaType="java.lang.Integer"/>
+        <result column="approve_by" property="approveBy" javaType="java.lang.String"/>
+        <result column="approve_time" property="approveTime" javaType="java.util.Date"/>
+        <result column="approve_mess" property="approveMess" javaType="java.lang.String"/>
+    </resultMap>
+    <insert id="insert">
+        insert into sys_user_track (user_id,status,approve_by,approve_time,approve_mess)
+        values (#{userId},#{status},#{approveBy}, #{approveTime},#{approveMess})
+    </insert>
+
+    <select id="getLastTime" resultMap="sysUserTrackMap">
+        select  approve_by,approve_time from sys_user_track
+        where user_id = #{userId} order by approve_time desc limit 1
+    </select>
+</mapper>

+ 66 - 0
src/main/resources/mapper/modules/esm/EsmUserReferrerMapper.xml

@@ -224,4 +224,70 @@
             </if>
         GROUP BY  CONCAT(YEAR ( us.create_time ),'-',LPAD( MONTH ( us.create_time ), 2, '0' ),'-',LPAD( DAY ( us.create_time ), 2, '0' ),' ',LPAD( HOUR ( us.create_time ), 2, '0' ))
     </select>
+
+
+    <select id="queryOrderCountForUser" resultType="com.ydtech.modules.esm.model.vo.EsmUserPolicyForUserVO">
+        select a.companyId as companyId,
+               a.companyName as companyName,
+               a.policynum as bjpolicynum,
+               a.sumpremium as bjsumpremium,
+               b.policynum as ordernum,
+               b.sumpremium as sumpremium,
+               c.policynum as policynum
+        from (
+                 SELECT
+                     iac.company_id AS companyId,
+                     iac.inscompany AS companyName,
+                     COALESCE ( count( iac.company_id ), 0 ) AS policynum,
+                     COALESCE ( sum( jqpremium + sypremium + jypremium ), 0 ) AS sumpremium
+                 FROM
+                     sys_user su
+                         LEFT JOIN ins_orders io ON io.userid = su.id
+                         AND io.createtime BETWEEN #{startDate} AND #{endDate}
+                         LEFT JOIN ins_area_company iac ON io.orderno = iac.orderno
+                 WHERE
+                     su.id = #{userId}
+                 GROUP BY
+                     iac.company_id,
+                     iac.inscompany
+             ) a left join
+             (
+                 SELECT
+                     iac.company_id AS companyId,
+                     iac.inscompany AS companyName,
+                     COALESCE ( count( iac.company_id ), 0 ) AS policynum,
+                     COALESCE ( sum( jqpremium + sypremium + jypremium ), 0 ) AS sumpremium
+                 FROM
+                     sys_user su
+                         LEFT JOIN ins_orders io ON io.userid = su.id
+                         AND io.createtime BETWEEN #{startDate} AND #{endDate}
+                         LEFT JOIN ins_area_company iac ON io.orderno = iac.orderno
+                         AND iac.orderstatus = 3
+                 WHERE
+                     su.id = #{userId}
+                 GROUP BY
+                     iac.company_id,
+                     iac.inscompany
+             )b on a.companyId = b.companyId
+             left join
+             (
+                 SELECT
+                     iac.company_id AS companyId,
+                     iac.inscompany AS companyName,
+                     COALESCE ( count( iac.company_id ), 0 ) AS policynum,
+                     COALESCE ( sum( jqpremium + sypremium + jypremium ), 0 ) AS sumpremium
+                 FROM
+                     sys_user su
+                         LEFT JOIN ins_orders io ON io.userid = su.id
+                         AND io.createtime BETWEEN #{startDate} AND #{endDate}
+                         LEFT JOIN ins_area_company iac ON io.orderno = iac.orderno
+                         AND iac.orderstatus = 2
+                 WHERE
+                     su.id = #{userId}
+                 GROUP BY
+                     iac.company_id,
+                     iac.inscompany
+             )c on a.companyId = c.companyId
+        where a.companyId is not null
+    </select>
 </mapper>

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

@@ -2440,5 +2440,116 @@
 
     </select>
 
+    <select id="queryDateByTypeSumAmount" resultType="java.math.BigDecimal">
+        SELECT
+          SUM(IFNULL(a.commission_feevalue ,0 ) + IFNULL(a.other_feevalue ,0 ))
+        FROM
+        ins_ply_income a
+        LEFT JOIN
+        ptl_agreement pa ON pa.id = a.agreement_id
+        <where>
+            <if test="vo.type !=null  and  vo.type  !=''">
+                and pa.agreement_type =#{vo.type}
+            </if>
+            <if test="vo.beginDate  != null  and  vo.beginDate!=''  and vo.endDate  != null  and  vo.endDate!=''">
+                AND  a.create_time  BETWEEN #{vo.beginDate} AND #{vo.endDate}
+            </if>
+        </where>
+    </select>
+
+    <select id="queryDateByType"
+            resultType="com.ydtech.modules.admin.model.report.financialReceivables.FinancialReceivablesVo">
+        select
+        a.years as yearAndMonth,
+        a.commissionFeevalue as commissionFeevalue,
+        a.noInvoicCommissionFeevalue as noInvoicCommissionFeevalue,
+        a.readyCommissionFeevalue  as readyCommissionFeevalue,
+        ifnull(b.settlementAmount,0) as settlementAmount,
+        ifnull(b.noSettlementAmount,0) as noSettlementAmount
+        from (
+        SELECT
+        DATE_FORMAT( a.create_time, '%Y-%m' ) as years,
+        SUM(IFNULL(a.commission_feevalue ,0 ) + IFNULL(a.other_feevalue ,0 )) AS commissionFeevalue,
+        SUM(CASE WHEN a.handling_fees_status = '0' THEN IFNULL(a.commission_feevalue ,0 ) + IFNULL(a.other_feevalue ,0 ) ELSE 0 END ) AS noInvoicCommissionFeevalue,
+        SUM(CASE WHEN a.handling_fees_status = '1' THEN IFNULL(a.commission_feevalue ,0 ) + IFNULL(a.other_feevalue ,0 ) ELSE 0 END) AS readyCommissionFeevalue
+        FROM
+        ins_ply_income a
+        LEFT JOIN
+        ptl_agreement pa ON pa.id = a.agreement_id
+        <where>
+            1=1
+            <if test="vo.type !=null  and  vo.type  !=''">
+                and pa.agreement_type =#{vo.type}
+            </if>
+            <if test="vo.beginDate  != null  and  vo.beginDate!=''  and vo.endDate  != null  and  vo.endDate!=''">
+                AND  a.create_time  BETWEEN #{vo.beginDate} AND #{vo.endDate}
+            </if>
+        </where>
+        GROUP BY
+        DATE_FORMAT( a.create_time, '%Y-%m' )
+
+        )  a   left join
+        (
+        SELECT
+        DATE_FORMAT( a.create_time, '%Y-%m' ) as years,
+        SUM(IFNULL(a.settlement_amount ,0 )) as  settlementAmount,
+        SUM(IFNULL(a.total_amount ,0 ) -IFNULL(a.settlement_amount ,0 ) ) AS noSettlementAmount
+        FROM
+        settlement_documentary_fees a
+        <where>
+            a.settlement_status=2
+            <if test="vo.type !=null  and  vo.type  !=''">
+                and  a.agreement_type =#{vo.type}
+            </if>
+            <if test="vo.beginDate  != null  and  vo.beginDate!=''  and vo.endDate  != null  and  vo.endDate!=''">
+                AND  a.create_time  BETWEEN #{vo.beginDate} AND #{vo.endDate}
+            </if>
+        </where>
+        GROUP BY DATE_FORMAT( a.create_time, '%Y-%m' )
+        )  b  on a.years =b.years
+    </select>
 
+    <select id="queryDateByTypeMonthSumAmount" resultType="java.math.BigDecimal">
+        SELECT
+        SUM(IFNULL(a.commission_feevalue ,0 ) + IFNULL(a.other_feevalue ,0 ))
+        FROM
+        ins_ply_income a
+        LEFT JOIN
+        ptl_agreement pa ON pa.id = a.agreement_id
+        <where>
+            <if test="vo.type !=null  and  vo.type  !=''">
+                and pa.agreement_type =#{vo.type}
+            </if>
+            <if test="vo.beginDate  != null  and  vo.beginDate!=''  and vo.endDate  != null  and  vo.endDate!=''">
+                AND  a.create_time  BETWEEN #{vo.beginDate} AND #{vo.endDate}
+            </if>
+        </where>
+    </select>
+    <select id="queryDateByTypeByMonth"
+            resultType="com.ydtech.modules.admin.model.report.financialReceivables.FinancialReceivablesAllMonthVo">
+        SELECT
+            SUM(IFNULL(a.commission_feevalue ,0 ) + IFNULL(a.other_feevalue ,0 )) AS ysSumAmount,
+            SUM(CASE WHEN a.handling_fees_status = '0' THEN IFNULL(a.commission_feevalue ,0 ) + IFNULL(a.other_feevalue ,0 ) ELSE 0 END ) AS "ysSumAmount",
+            SUM(CASE WHEN a.handling_fees_status = '1' THEN IFNULL(a.commission_feevalue ,0 ) + IFNULL(a.other_feevalue ,0 ) ELSE 0 END) AS "wsSumAmount"
+        FROM
+            ins_ply_income a
+                LEFT JOIN
+            ptl_agreement pa ON pa.id = a.agreement_id
+        where
+        <where>
+            <if test="vo.type !=null  and  vo.type  !=''">
+                and pa.agreement_type =#{vo.type}
+            </if>
+            <if test="vo.beginDate  != null  and  vo.beginDate!=''  and vo.endDate  != null  and  vo.endDate!=''">
+                AND  a.signdate  BETWEEN #{vo.beginDate} AND #{vo.endDate}
+            </if>
+        </where>
+    </select>
+    <select id="queryDateByTypeByMonthList"
+            resultType="com.ydtech.modules.admin.model.report.financialReceivables.FinancialReceivablesMonthVo">
+
+
+
+
+    </select>
 </mapper>