Parcourir la source

Merge branch 'test' of http://www.baoxianzhanggui.com:8090/sxzgd/java-insagent-pc into test-cyr

caiyaru il y a 2 ans
Parent
commit
a16727f7df
29 fichiers modifiés avec 559 ajouts et 181 suppressions
  1. 32 0
      src/main/java/com/ydtech/modules/admin/controller/SysLoginController.java
  2. 1 0
      src/main/java/com/ydtech/modules/admin/controller/SysMenuController.java
  3. 3 0
      src/main/java/com/ydtech/modules/admin/controller/SysRoleController.java
  4. 8 0
      src/main/java/com/ydtech/modules/admin/controller/financialReceivables/FinancialReceivablesController.java
  5. 1 1
      src/main/java/com/ydtech/modules/admin/dao/SysRoleMenuMapper.java
  6. 6 0
      src/main/java/com/ydtech/modules/admin/model/SysMenu.java
  7. 7 0
      src/main/java/com/ydtech/modules/admin/model/SysRole.java
  8. 46 0
      src/main/java/com/ydtech/modules/admin/model/report/financialReceivables/FinancialReceivablesAllMonthVo.java
  9. 42 0
      src/main/java/com/ydtech/modules/admin/model/report/financialReceivables/FinancialReceivablesMonthVo.java
  10. 29 0
      src/main/java/com/ydtech/modules/admin/model/report/financialReceivables/FinancialReceivablesQueryMonthVo.java
  11. 1 1
      src/main/java/com/ydtech/modules/admin/model/report/financialReceivables/FinancialReceivablesVo.java
  12. 1 0
      src/main/java/com/ydtech/modules/admin/model/vo/LoginBean.java
  13. 3 1
      src/main/java/com/ydtech/modules/admin/service/impl/SysMenuServiceImpl.java
  14. 33 0
      src/main/java/com/ydtech/modules/admin/utils/SliceUpDateUtil.java
  15. 15 2
      src/main/java/com/ydtech/modules/fnc/dao/InsPlyIncomeMapper.java
  16. 9 0
      src/main/java/com/ydtech/modules/fnc/service/InsPlyIncomeService.java
  17. 110 106
      src/main/java/com/ydtech/modules/fnc/service/impl/ImportAsyncServiceImpl.java
  18. 37 4
      src/main/java/com/ydtech/modules/fnc/service/impl/InsPlyIncomeServiceImpl.java
  19. 1 2
      src/main/java/com/ydtech/modules/order/aop/aspect/QuoteVerificationAspect.java
  20. 2 0
      src/main/java/com/ydtech/modules/order/components/pingan/PinganRequestApiComponents.java
  21. 8 4
      src/main/java/com/ydtech/modules/order/controller/DrivingInsuranceController.java
  22. 8 1
      src/main/java/com/ydtech/modules/order/service/InsDrivingIntentionInsuranceService.java
  23. 1 1
      src/main/java/com/ydtech/modules/order/service/PingAnOrderApiService.java
  24. 52 6
      src/main/java/com/ydtech/modules/order/service/impl/InsDrivingIntentionInsuranceServiceImpl.java
  25. 21 30
      src/main/java/com/ydtech/modules/order/service/impl/PingAnOrderApiServiceImpl.java
  26. 12 5
      src/main/resources/application-pre.yml
  27. 12 5
      src/main/resources/application-prod.yml
  28. 12 7
      src/main/resources/application-test.yml
  29. 46 5
      src/main/resources/mapper/modules/fnc/InsPlyIncomeMapper.xml

+ 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);
     }

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

@@ -1,7 +1,9 @@
 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;
@@ -45,6 +47,12 @@ public class FinancialReceivablesController {
         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

+ 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;
 
 

+ 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;
     }

+ 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/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;
+}

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

@@ -12,7 +12,7 @@ import lombok.Data;
  *  @Description:   应收出参
  */
 @Data
-@ApiModel("应收查询参数")
+@ApiModel("应收返回参数")
 public class FinancialReceivablesVo {
 
     @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;
 

+ 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);
 
 

+ 33 - 0
src/main/java/com/ydtech/modules/admin/utils/SliceUpDateUtil.java

@@ -234,4 +234,37 @@ public class SliceUpDateUtil {
         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 - 2
src/main/java/com/ydtech/modules/fnc/dao/InsPlyIncomeMapper.java

@@ -1,8 +1,7 @@
 package com.ydtech.modules.fnc.dao;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.ydtech.modules.admin.model.report.financialReceivables.FinancialReceivablesQueryVo;
-import com.ydtech.modules.admin.model.report.financialReceivables.FinancialReceivablesVo;
+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;
@@ -172,4 +171,18 @@ public interface InsPlyIncomeMapper extends BaseMapper<InsPlyIncome> {
      *  @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);
 }

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

@@ -2,7 +2,9 @@ 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;
@@ -186,4 +188,11 @@ public interface InsPlyIncomeService extends IService<InsPlyIncome> {
      *  @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);
+                        }
                     }
                 }
             }

+ 37 - 4
src/main/java/com/ydtech/modules/fnc/service/impl/InsPlyIncomeServiceImpl.java

@@ -12,9 +12,7 @@ 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.FinancialReceivablesAllVo;
-import com.ydtech.modules.admin.model.report.financialReceivables.FinancialReceivablesQueryVo;
-import com.ydtech.modules.admin.model.report.financialReceivables.FinancialReceivablesVo;
+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;
@@ -3292,7 +3290,7 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
             year = Integer.parseInt(financialReceivablesQueryVo.getYear());
         }
         financialReceivablesQueryVo.setBeginDate(SliceUpDateUtil.getYearBeginDateStr(year)+" 00:00:00");
-        financialReceivablesQueryVo.setBeginDate(SliceUpDateUtil.getYearEndDateStr(year)+" 23:59:59");
+        financialReceivablesQueryVo.setEndDate(SliceUpDateUtil.getYearEndDateStr(year)+" 23:59:59");
         financialReceivablesQueryVo.setType("1");
         //总应收
         BigDecimal ptSumAmount =  baseMapper.queryDateByTypeSumAmount(financialReceivablesQueryVo);
@@ -3304,4 +3302,39 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
 
         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);
+    }
 }

+ 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;
+    }
 }

+ 21 - 30
src/main/java/com/ydtech/modules/order/service/impl/PingAnOrderApiServiceImpl.java

@@ -85,7 +85,7 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
 
     private final InsUploadFilesService insUploadFilesService;
 
-
+    private final PinganApiLogService   pinganApiLogService;
 
 
     /**
@@ -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
@@ -1553,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());
             //查询单证状态
@@ -1567,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: http://39.98.239.48/#/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: http://39.98.239.48/#/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: http://39.98.239.48/#/Signature
+
 
 xxl:
   job:

+ 46 - 5
src/main/resources/mapper/modules/fnc/InsPlyIncomeMapper.xml

@@ -2452,7 +2452,7 @@
                 and pa.agreement_type =#{vo.type}
             </if>
             <if test="vo.beginDate  != null  and  vo.beginDate!=''  and vo.endDate  != null  and  vo.endDate!=''">
-                AND  create_time  BETWEEN #{vo.beginDate} AND #{vo.endDate}
+                AND  a.create_time  BETWEEN #{vo.beginDate} AND #{vo.endDate}
             </if>
         </where>
     </select>
@@ -2464,8 +2464,8 @@
         a.commissionFeevalue as commissionFeevalue,
         a.noInvoicCommissionFeevalue as noInvoicCommissionFeevalue,
         a.readyCommissionFeevalue  as readyCommissionFeevalue,
-        b.settlementAmount as settlementAmount,
-        b.noSettlementAmount as noSettlementAmount
+        ifnull(b.settlementAmount,0) as settlementAmount,
+        ifnull(b.noSettlementAmount,0) as noSettlementAmount
         from (
         SELECT
         DATE_FORMAT( a.create_time, '%Y-%m' ) as years,
@@ -2485,7 +2485,6 @@
                 AND  a.create_time  BETWEEN #{vo.beginDate} AND #{vo.endDate}
             </if>
         </where>
-        a.create_time  BETWEEN '2024-01-01 00:00:00' AND '2024-12-31 23:59:59'
         GROUP BY
         DATE_FORMAT( a.create_time, '%Y-%m' )
 
@@ -2496,7 +2495,7 @@
         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_2024_06_30 a
+        settlement_documentary_fees a
         <where>
             a.settlement_status=2
             <if test="vo.type !=null  and  vo.type  !=''">
@@ -2510,5 +2509,47 @@
         )  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>