Преглед изворни кода

Merge branch 'test' into master-20240326

785834757 пре 2 година
родитељ
комит
71ee8e5342

+ 17 - 0
pom.xml

@@ -578,6 +578,23 @@
             <artifactId>commons-lang3</artifactId>
             <artifactId>commons-lang3</artifactId>
             <version>3.12.0</version> <!-- 使用最新的稳定版本 -->
             <version>3.12.0</version> <!-- 使用最新的稳定版本 -->
         </dependency>
         </dependency>
+        <!--接口防爬虫盗刷-->
+        <dependency>
+            <groupId>cn.keking.project</groupId>
+            <artifactId>kk-anti-reptile</artifactId>
+            <version>1.0.0-RELEASE</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.redisson</groupId>
+            <artifactId>redisson-spring-boot-starter</artifactId>
+            <version>3.17.5</version>
+        </dependency>
+        <dependency>
+            <groupId>org.redisson</groupId>
+            <artifactId>redisson-spring-data-27</artifactId>
+            <version>3.17.5</version>
+        </dependency>
     </dependencies>
     </dependencies>
 
 
 
 

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

@@ -333,7 +333,7 @@ public class InsPlyIncome implements Serializable {
 
 
     @ApiModelProperty("跟单费未结算金额")
     @ApiModelProperty("跟单费未结算金额")
     @TableField(exist = false)
     @TableField(exist = false)
-    private BigDecimal unsettledAmount;
+    private BigDecimal unSettledAmount;
 
 
     @ApiModelProperty("开始时间")
     @ApiModelProperty("开始时间")
     @TableField(exist = false)
     @TableField(exist = false)
@@ -372,6 +372,9 @@ public class InsPlyIncome implements Serializable {
     @ApiModelProperty("开票ids")
     @ApiModelProperty("开票ids")
     @TableField(exist = false)
     @TableField(exist = false)
     private String incomeIds;
     private String incomeIds;
+    @ApiModelProperty("已经开票未结算ids")
+    @TableField(exist = false)
+    private String invoicIds;
 
 
 
 
     public InsPlyIncome(String orderno, String policyno, String syPolicyno, String noPolicyno, String settleno, String deptId, String deptName, String riskcode, LocalDateTime payDate, LocalDateTime signDate, String companyId, String companyName, String agreementId, String licenseno, BigDecimal taxamount, BigDecimal noTaxPremium, BigDecimal commissionFeerate, BigDecimal otherFeerate, BigDecimal commissionFeevalue, BigDecimal otherFeevalue, BigDecimal allFeeValue, BigDecimal finalFeeValue, BigDecimal doingFeeValue, LocalDate createTime, String voucherNumber, String contractId, String contractFileId, String handlingFeesStatus, String documentaryFeesStatus, String isNotCar, String isNotDocumentary) {
     public InsPlyIncome(String orderno, String policyno, String syPolicyno, String noPolicyno, String settleno, String deptId, String deptName, String riskcode, LocalDateTime payDate, LocalDateTime signDate, String companyId, String companyName, String agreementId, String licenseno, BigDecimal taxamount, BigDecimal noTaxPremium, BigDecimal commissionFeerate, BigDecimal otherFeerate, BigDecimal commissionFeevalue, BigDecimal otherFeevalue, BigDecimal allFeeValue, BigDecimal finalFeeValue, BigDecimal doingFeeValue, LocalDate createTime, String voucherNumber, String contractId, String contractFileId, String handlingFeesStatus, String documentaryFeesStatus, String isNotCar, String isNotDocumentary) {

+ 14 - 2
src/main/java/com/ydtech/modules/fnc/service/impl/InsPlyIncomeServiceImpl.java

@@ -17,6 +17,7 @@ import com.ydtech.modules.esm.service.EsmInsCompanyService;
 import com.ydtech.modules.fnc.entity.InsAreaCompany;
 import com.ydtech.modules.fnc.entity.InsAreaCompany;
 import com.ydtech.modules.fnc.entity.InsPlyIncome;
 import com.ydtech.modules.fnc.entity.InsPlyIncome;
 import com.ydtech.modules.fnc.dao.InsPlyIncomeMapper;
 import com.ydtech.modules.fnc.dao.InsPlyIncomeMapper;
+import com.ydtech.modules.fnc.entity.SettlementDocumentaryFeesEntity;
 import com.ydtech.modules.fnc.entity.SettlementDocumentaryLogEntity;
 import com.ydtech.modules.fnc.entity.SettlementDocumentaryLogEntity;
 import com.ydtech.modules.fnc.service.InsPlyIncomeService;
 import com.ydtech.modules.fnc.service.InsPlyIncomeService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@@ -762,7 +763,7 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
     @Transactional
     @Transactional
     public HttpResult batchBalance(InsPlyIncomeVo insPlyIncomeVo) {
     public HttpResult batchBalance(InsPlyIncomeVo insPlyIncomeVo) {
 //  通过ids 查出跟单非结算单
 //  通过ids 查出跟单非结算单
-        String ids = insPlyIncomeVo.getIncomeIds();
+        String ids = insPlyIncomeVo.getIds();
         if(StringUtils.isNotEmpty(ids)){
         if(StringUtils.isNotEmpty(ids)){
             String[] split = ids.split(",");
             String[] split = ids.split(",");
             for (int i =0; i <split.length ; i++) {
             for (int i =0; i <split.length ; i++) {
@@ -868,7 +869,7 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
     @Transactional
     @Transactional
     public HttpResult<Object> batchInvoic(InsPlyIncomeVo insPlyIncomeVo) {
     public HttpResult<Object> batchInvoic(InsPlyIncomeVo insPlyIncomeVo) {
         //  通过ids 查出跟单非结算单
         //  通过ids 查出跟单非结算单
-        String ids = insPlyIncomeVo.getIncomeIds();
+        String ids = insPlyIncomeVo.getIds();
         if(StringUtils.isNotEmpty(ids)){
         if(StringUtils.isNotEmpty(ids)){
             String[] split = ids.split(",");
             String[] split = ids.split(",");
             for (int i =0; i <split.length ; i++) {
             for (int i =0; i <split.length ; i++) {
@@ -885,10 +886,20 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
         if(StringUtils.isNotEmpty(insPlyIncomeVo.getYear())){
         if(StringUtils.isNotEmpty(insPlyIncomeVo.getYear())){
             settlementDocumentaryFeesVo.setTimeFrame(insPlyIncomeVo.getYear());//年度
             settlementDocumentaryFeesVo.setTimeFrame(insPlyIncomeVo.getYear());//年度
         }
         }
+        if(StringUtils.isNotEmpty(insPlyIncomeVo.getYear())){
+            settlementDocumentaryFeesVo.setYear(insPlyIncomeVo.getYear());
+        }
+        if(StringUtils.isNotEmpty(insPlyIncomeVo.getMonth())){
+            settlementDocumentaryFeesVo.setMonth(insPlyIncomeVo.getMonth());
+        }
+        if(StringUtils.isNotEmpty(insPlyIncomeVo.getDay())){
+            settlementDocumentaryFeesVo.setDay(insPlyIncomeVo.getDay());
+        }
         settlementDocumentaryFeesVo.setCompanyId(insPlyIncomeVo.getCompanyId());// 保险公司id
         settlementDocumentaryFeesVo.setCompanyId(insPlyIncomeVo.getCompanyId());// 保险公司id
         settlementDocumentaryFeesVo.setTotalAmount(insPlyIncomeVo.getOtherFeevalue());  //其他费用金额
         settlementDocumentaryFeesVo.setTotalAmount(insPlyIncomeVo.getOtherFeevalue());  //其他费用金额
         settlementDocumentaryFeesVo.setUnsettledAmount(insPlyIncomeVo.getNoInvoicCommissionFeevalue().subtract(insPlyIncomeVo.getSettlementAmount())); //未结算
         settlementDocumentaryFeesVo.setUnsettledAmount(insPlyIncomeVo.getNoInvoicCommissionFeevalue().subtract(insPlyIncomeVo.getSettlementAmount())); //未结算
         settlementDocumentaryFeesVo.setSettlementAmount(insPlyIncomeVo.getSettlementAmount());//已经开票
         settlementDocumentaryFeesVo.setSettlementAmount(insPlyIncomeVo.getSettlementAmount());//已经开票
+        settlementDocumentaryFeesVo.setCreateTime(LocalDate.now());
         settlementDocumentaryFeesVo.setIds(insPlyIncomeVo.getIncomeIds());
         settlementDocumentaryFeesVo.setIds(insPlyIncomeVo.getIncomeIds());
         settlementDocumentaryFeesVo.setSettlementStatus("1");
         settlementDocumentaryFeesVo.setSettlementStatus("1");
         return  settlementDocumentaryFeesService.inertSettle(settlementDocumentaryFeesVo);
         return  settlementDocumentaryFeesService.inertSettle(settlementDocumentaryFeesVo);
@@ -983,6 +994,7 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
     public InsPlyIncome bxTotalAmount(InsPlyIncomeVo insPlyIncomeVo) {
     public InsPlyIncome bxTotalAmount(InsPlyIncomeVo insPlyIncomeVo) {
         HashMap<String, Object> params = new HashMap<>();
         HashMap<String, Object> params = new HashMap<>();
         params = this.saveParams(insPlyIncomeVo, params);
         params = this.saveParams(insPlyIncomeVo, params);
+        params.remove("handlingFeesStatus");
         InsPlyIncome totalledAmount =baseMapper.bxTotalAmount(params);  //总金额
         InsPlyIncome totalledAmount =baseMapper.bxTotalAmount(params);  //总金额
         return totalledAmount;
         return totalledAmount;
     }
     }

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

@@ -238,4 +238,7 @@ public class InsPlyIncomeVo implements Serializable {
     @ApiModelProperty("商业跟单金额")
     @ApiModelProperty("商业跟单金额")
     private BigDecimal syOtherCostsPremium;
     private BigDecimal syOtherCostsPremium;
 
 
+    @ApiModelProperty("已经开票未结算ids")
+    private String invoicIds;
+
 }
 }

+ 9 - 2
src/main/java/com/ydtech/modules/fnc/vo/SettlementDocumentaryFeesVo.java

@@ -31,7 +31,7 @@ public class SettlementDocumentaryFeesVo implements Serializable {
     private BigDecimal totalAmount;
     private BigDecimal totalAmount;
 
 
     @ApiModelProperty("创建时间")
     @ApiModelProperty("创建时间")
-    private LocalDateTime createTime;
+    private LocalDate createTime;
 
 
     @ApiModelProperty("结算金额")
     @ApiModelProperty("结算金额")
     @TableField("settlement_amount")
     @TableField("settlement_amount")
@@ -43,7 +43,7 @@ public class SettlementDocumentaryFeesVo implements Serializable {
 
 
     @ApiModelProperty("开始时间")
     @ApiModelProperty("开始时间")
     @JsonFormat(pattern = "yyyy-MM-dd")
     @JsonFormat(pattern = "yyyy-MM-dd")
-    private LocalDateTime startTime;
+    private LocalDate startTime;
 
 
     @ApiModelProperty("结束时间")
     @ApiModelProperty("结束时间")
     @JsonFormat(pattern = "yyyy-MM-dd")
     @JsonFormat(pattern = "yyyy-MM-dd")
@@ -69,4 +69,11 @@ public class SettlementDocumentaryFeesVo implements Serializable {
 
 
     @ApiModelProperty("结算ids")
     @ApiModelProperty("结算ids")
     private String ids;
     private String ids;
+
+    @ApiModelProperty("年")
+    private String year;
+    @ApiModelProperty("月")
+    private String month;
+    @ApiModelProperty("日")
+    private String day;
 }
 }

+ 11 - 0
src/main/java/com/ydtech/modules/order/controller/InsOrdersController.java

@@ -141,6 +141,7 @@ public class InsOrdersController extends BaseController {
         return this.insOrdersService.getByCompanyId(companyId, userId);
         return this.insOrdersService.getByCompanyId(companyId, userId);
     }
     }
 
 
+
     @PostMapping("/getAccidentalDriving")
     @PostMapping("/getAccidentalDriving")
     @ApiOperation(value = "获取驾意险")
     @ApiOperation(value = "获取驾意险")
     public HttpResult<List<InsAccidentalDriving>> getAccidentalDriving(@RequestBody @Valid AccidentalDrivingQueryVo accidentalDrivingVo) {
     public HttpResult<List<InsAccidentalDriving>> getAccidentalDriving(@RequestBody @Valid AccidentalDrivingQueryVo accidentalDrivingVo) {
@@ -202,6 +203,7 @@ public class InsOrdersController extends BaseController {
      *  @Date: 2024/4/17 15:32
      *  @Date: 2024/4/17 15:32
      *  @Description: 通过用户id和订单状态查询关联渠道的订单数据+分页
      *  @Description: 通过用户id和订单状态查询关联渠道的订单数据+分页
      */
      */
+   // @AntiReptile
     @PostMapping("/queryPageHospitalityByChannel")
     @PostMapping("/queryPageHospitalityByChannel")
     @ApiOperation(value = "通过用户id和订单状态查询关联渠道的订单数据+分页")
     @ApiOperation(value = "通过用户id和订单状态查询关联渠道的订单数据+分页")
     public HttpResult<Object> queryPageHospitalityByChannel(@RequestBody  OrderQueryVo orderQueryVo) {
     public HttpResult<Object> queryPageHospitalityByChannel(@RequestBody  OrderQueryVo orderQueryVo) {
@@ -221,6 +223,7 @@ public class InsOrdersController extends BaseController {
      *  @Date: 2024/4/17 15:32
      *  @Date: 2024/4/17 15:32
      *  @Description: 通过用户id和订单状态查询关联代理人的订单数据+分页
      *  @Description: 通过用户id和订单状态查询关联代理人的订单数据+分页
      */
      */
+    //@AntiReptile
     @PostMapping("/queryPageHospitalityLinkagent")
     @PostMapping("/queryPageHospitalityLinkagent")
     @ApiOperation(value = "通过用户id和订单状态查询关联代理人的订单数据+分页")
     @ApiOperation(value = "通过用户id和订单状态查询关联代理人的订单数据+分页")
     public HttpResult<Object> queryPageHospitalityLinkagent(@RequestBody  OrderQueryVo orderQueryVo) {
     public HttpResult<Object> queryPageHospitalityLinkagent(@RequestBody  OrderQueryVo orderQueryVo) {
@@ -240,6 +243,7 @@ public class InsOrdersController extends BaseController {
      *  @Date: 2024/4/17 15:32
      *  @Date: 2024/4/17 15:32
      *  @Description: 通过用户id和订单状态查询关联保险公司的订单数据+分页
      *  @Description: 通过用户id和订单状态查询关联保险公司的订单数据+分页
      */
      */
+    //@AntiReptile
     @PostMapping("/queryPageHospitalityByInsuranceCompany")
     @PostMapping("/queryPageHospitalityByInsuranceCompany")
     @ApiOperation(value = "通过用户id和订单状态查询关联保险公司的订单数据+分页")
     @ApiOperation(value = "通过用户id和订单状态查询关联保险公司的订单数据+分页")
     public HttpResult<Object> queryPageHospitalityByInsuranceCompany(@RequestBody  OrderQueryVo orderQueryVo) {
     public HttpResult<Object> queryPageHospitalityByInsuranceCompany(@RequestBody  OrderQueryVo orderQueryVo) {
@@ -256,4 +260,11 @@ public class InsOrdersController extends BaseController {
             return HttpResult.error("查询失败"+e.getMessage());
             return HttpResult.error("查询失败"+e.getMessage());
         }
         }
     }
     }
+
+    @PostMapping("/getTaskByCompanyId")
+    @ApiOperation(value = "通过子订单查询订单信息(任务管理)")
+    public HttpResult<OrderVo> getTaskByCompanyId(@RequestSingleParam(value = "companyId") String companyId) {
+        String userId = getUserId();
+        return this.insOrdersService.getTaskByCompanyId(companyId, userId);
+    }
 }
 }

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

@@ -151,4 +151,11 @@ public interface InsOrdersService extends IService<InsOrders> {
      *  @Description: 查询子订单的数据列表
      *  @Description: 查询子订单的数据列表
      */
      */
     BasePageResult<InsOrders> queryPageSubOrders(OrderTaskPoolsVo orderTaskPoolsVo);
     BasePageResult<InsOrders> queryPageSubOrders(OrderTaskPoolsVo orderTaskPoolsVo);
+    /**
+     *  @version
+     *  @author: hxl
+     *  @Date: 2024/5/6 18:02
+     *  @Description:  任务管理的详细信息
+     */
+    HttpResult<OrderVo> getTaskByCompanyId(String companyId, String userId);
 }
 }

+ 143 - 3
src/main/java/com/ydtech/modules/order/service/impl/InsOrdersServiceImpl.java

@@ -749,9 +749,9 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
 
 
         //获取出单员地区信息
         //获取出单员地区信息
         //add by  hxl  添加手机号只显示最后四位
         //add by  hxl  添加手机号只显示最后四位
-        orderAndAreaCompany.setOwnerinfo(setNewPhone(orderAndAreaCompany.getOwnerinfo()));
-        orderAndAreaCompany.setApplyinfo(setNewPhone(orderAndAreaCompany.getApplyinfo()));
-        orderAndAreaCompany.setInsureinfo(setNewPhone(orderAndAreaCompany.getInsureinfo()));
+        //orderAndAreaCompany.setOwnerinfo(setNewPhone(orderAndAreaCompany.getOwnerinfo()));
+        //orderAndAreaCompany.setApplyinfo(setNewPhone(orderAndAreaCompany.getApplyinfo()));
+        //orderAndAreaCompany.setInsureinfo(setNewPhone(orderAndAreaCompany.getInsureinfo()));
         return HttpResult.ok("success", orderAndAreaCompany);
         return HttpResult.ok("success", orderAndAreaCompany);
     }
     }
     /**
     /**
@@ -962,4 +962,144 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
                 orderVoPage.getPages()
                 orderVoPage.getPages()
                 , orderVoPage.getRecords());
                 , orderVoPage.getRecords());
     }
     }
+
+    @Override
+    public HttpResult<OrderVo> getTaskByCompanyId(String companyId, String userId) {
+
+        OrderVo orderAndAreaCompany = baseMapper.getOrderAndAreaCompany(companyId);
+        //团队归属信息
+        String areaInfo = sysDeptService.queryBelongArea(orderAndAreaCompany.getDeptid());
+        SysUser sysUser = sysUserService.getById(orderAndAreaCompany.getUserid());
+        SysUserInfo sysUserInfo = sysUserInfoService.getById(orderAndAreaCompany.getUserid());
+        if(!ObjectUtils.isEmpty(sysUserInfo)){
+            if("M".equals(sysUserInfo.getSex())){
+                orderAndAreaCompany.setSex("男");
+            }else{
+                orderAndAreaCompany.setSex("女");
+            }
+        }
+        orderAndAreaCompany.setMobile(sysUser.getMobile());
+        orderAndAreaCompany.setDeptAreaInfo(areaInfo);
+        //推荐人信息查询
+        EsmUserReferrer esmUserReferrer = esmUserReferrerService.getById(orderAndAreaCompany.getUserid());
+        if(esmUserReferrer != null){
+            SysUser referrerUser = sysUserService.findByUserId(esmUserReferrer.getReferrerId());
+            SysUserInfo referrerSysUserInfo = sysUserInfoService.getById(esmUserReferrer.getReferrerId());
+            if("M".equals(referrerSysUserInfo.getSex())){
+                orderAndAreaCompany.setReferrerSex("男");
+            }else{
+                orderAndAreaCompany.setReferrerSex("女");
+            }
+            orderAndAreaCompany.setReferrerMobile(referrerUser.getMobile());
+            orderAndAreaCompany.setReferrerNo(referrerUser.getId());
+            orderAndAreaCompany.setReferrerName(referrerUser.getName());
+            orderAndAreaCompany.setReferrerDeptId(referrerUser.getDeptId());
+            SysDept sysDept = sysDeptService.getById(referrerUser.getDeptId());
+            orderAndAreaCompany.setReferrerDeptName(sysDept.getName());
+            orderAndAreaCompany.setReferrerDeptAreaInfo(sysDeptService.queryBelongArea(referrerUser.getDeptId()));
+        }
+
+        //计算今年应缴税
+        JSONArray taxArrears = orderAndAreaCompany.getTaxArrears();
+        if(taxArrears != null && !taxArrears.isEmpty()) {
+            JSONObject taxArrear = taxArrears.getJSONObject(0);
+            taxArrear.put("dayYearTax", orderAndAreaCompany.getTaxamount().subtract(taxArrear.getBigDecimal("taxDefault")
+                    .subtract(taxArrear.getBigDecimal("lateFee"))));
+        }
+
+        YaExtendInfoDto yaExtendInfoDto = new YaExtendInfoDto();
+        // 永安财险
+        if (InsuranceEnum.YAIC.getCode().equals(orderAndAreaCompany.getCompanyId().substring(0, 4))) {
+            JSONObject reptxt = orderAndAreaCompany.getReptxt();
+            ResponseDataC2 responseDataC2 = JSON.toJavaObject(reptxt, ResponseDataC2.class);
+            List<ExtendInfoDto> extendInfoDtos = responseDataC2.getResponseBody().getExtendInfo();
+            Map<String, String> stringStringMap = extendInfoDtos.stream().collect(LinkedHashMap::new,
+                    (m, v) -> m.put(v.getKey(),
+                            v.getValue()), LinkedHashMap::putAll);
+            yaExtendInfoDto = MapToYaExtendInfoDto.INSTANCE.mapToYaExtendInfoDto(stringStringMap);
+            orderAndAreaCompany.setExtendInfo(yaExtendInfoDto);
+        }
+        InsAreaCompany iac = insAreaCompanyService.getById(companyId);
+        //保费因素
+        yaExtendInfoDto.setAccidentInfoStr(iac.getAccidentStrInfo());
+        //评分
+        yaExtendInfoDto.setScore(iac.getScore());
+        yaExtendInfoDto.setJqScore(iac.getJqScore());
+        yaExtendInfoDto.setSyScore(iac.getSyScore());
+        //赔付率
+        yaExtendInfoDto.setLossRation(String.valueOf(iac.getLossRation()));
+        yaExtendInfoDto.setJqLossRation(String.valueOf(iac.getJqLossRation()));
+        yaExtendInfoDto.setSyLossRation(String.valueOf(iac.getSyLossRation()));
+        //折扣率
+        yaExtendInfoDto.setTotalAdjustRate(iac.getTotalAdjustRate());
+        yaExtendInfoDto.setJqAdjustRate(iac.getJqAdjustRate());
+        yaExtendInfoDto.setSyAdjustRate(iac.getSyAdjustRate());
+
+        orderAndAreaCompany.setExtendInfo(yaExtendInfoDto);
+
+        orderAndAreaCompany.setReptxt(null);
+
+        //新增费用明细信息
+//        QueryOrderFeeVo queryOrderFeeVo = feeRuleSchemeService.queryFeeOrderInfo(companyId);
+        //查询费用信息
+        InsFeeOrderNew insFeeOrderNew = insFeeOrderNewService.getOne(new LambdaQueryWrapper<InsFeeOrderNew>()
+                .eq(InsFeeOrderNew::getInsOrderNo, companyId));
+//        orderAndAreaCompany.setOrderCommissionVo(queryOrderFeeVo.getOrderCommissionVo());
+//        orderAndAreaCompany.setAdjustFeeDescVo(queryOrderFeeVo.getAdjustFeeDescVo());
+        boolean isShowOrderFee = false;
+        //如果是财务菜单进入的,不再进行权限控制,所有都可查看
+//        if ("accountingUser".equals(userId)) {
+//            isShowOrderFee = true;
+//        } else {
+//            //判断当前登录人员是否为后线人员,来决定是否返回总费用详情信息
+//            List<SysUser> userList = sysUserService.findAllAgentRoleUser(userId, "22");
+//            if (userList != null && !userList.isEmpty()) {
+//                isShowOrderFee = true;
+//            }
+//        }
+//        if (isShowOrderFee) {
+//            List<QueryOrderFeeResultVo> orderFeeVoList = feeRuleSchemeService.convertOrderFeeVoData(queryOrderFeeVo);
+//            if (!orderFeeVoList.isEmpty()) {
+//                orderAndAreaCompany.setOrderFeeResult(orderFeeVoList);
+//            }
+//        }
+        if (!Objects.isNull(insFeeOrderNew)) {
+            PtlAgreementProductCostsNew ptlAgreementProductCostsNew =
+                    ptlAgreementProductCostsNewService.getById(insFeeOrderNew.getCostsId());
+            List<QueryOrderFeeResultVo> orderFeeVoList = feeRuleSchemeService.convertOrderFeeVoData(insFeeOrderNew);
+            orderAndAreaCompany.setOrderFeeResult(orderFeeVoList);
+//            List<FeeOrderNewVo> feeOrderNewVoList = feeRuleSchemeService.newConvertOrderFeeVoData(insFeeOrderNew);
+//            orderAndAreaCompany.setFeeOrderNewVoList(feeOrderNewVoList);
+            FeeOrderNewVo feeOrderNewVo = feeRuleSchemeService.newConvertOrderFeeVoData(insFeeOrderNew, ptlAgreementProductCostsNew);
+            feeOrderNewVo.setFeeId(insFeeOrderNew.getId());
+            orderAndAreaCompany.setFeeOrderNewVo(feeOrderNewVo);
+            //计算总和
+
+            BigDecimal sum = feeOrderNewVo.getExportFee()
+                    .stream()
+                    .map(FeeOrderNewVo.ExportFee::getTotalAmount)
+                    .reduce(BigDecimal.ZERO, BigDecimal::add);
+            orderAndAreaCompany.setSumFee(sum.toString());
+            List<DistributionLevelVo> distributionLevelVoList = feeRuleSchemeService.converDistrbutionData(insFeeOrderNew);
+            orderAndAreaCompany.setDistributionLevelVoList(distributionLevelVoList);
+        }
+        //查询费用审核状态
+        List<InsFeeAudit> feeAuditList = insFeeAuditService.query().eq("ins_order_no", companyId).list();
+        if (feeAuditList != null && !feeAuditList.isEmpty()) {
+            orderAndAreaCompany.setFeeStatus(feeAuditList.get(0).getAuditstatus());
+        }
+        //add 解决返回null页面错误  lig 2023-09-14
+        if (null == orderAndAreaCompany.getExtendInfo()) orderAndAreaCompany.setExtendInfo("");
+        if (null == orderAndAreaCompany.getCrossInsurance())
+            orderAndAreaCompany.setCrossInsurance(JSON.parseArray("[]"));
+        if (null == orderAndAreaCompany.getKindinfo()) orderAndAreaCompany.setKindinfo(JSON.parseArray("[]"));
+        if (null == orderAndAreaCompany.getFeeStatus()) orderAndAreaCompany.setFeeStatus("0");
+
+        //获取出单员地区信息
+        //add by  hxl  添加手机号只显示最后四位
+        orderAndAreaCompany.setOwnerinfo(setNewPhone(orderAndAreaCompany.getOwnerinfo()));
+        orderAndAreaCompany.setApplyinfo(setNewPhone(orderAndAreaCompany.getApplyinfo()));
+        orderAndAreaCompany.setInsureinfo(setNewPhone(orderAndAreaCompany.getInsureinfo()));
+        return HttpResult.ok("success", orderAndAreaCompany);
+    }
 }
 }

+ 6 - 1
src/main/java/com/ydtech/modules/protocols/entity/vo/AgreementProductCosts.java

@@ -1,17 +1,22 @@
 package com.ydtech.modules.protocols.entity.vo;
 package com.ydtech.modules.protocols.entity.vo;
 
 
+import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
 import com.ydtech.modules.protocol.entity.po.PtlAgreementProductCosts;
 import com.ydtech.modules.protocol.entity.po.PtlAgreementProductCosts;
 import com.ydtech.modules.protocols.entity.po.PtlAgreementProductCostsAttrLink;
 import com.ydtech.modules.protocols.entity.po.PtlAgreementProductCostsAttrLink;
 import io.swagger.annotations.ApiModelProperty;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import lombok.Data;
 
 
+import java.io.Serializable;
 import java.math.BigDecimal;
 import java.math.BigDecimal;
 import java.util.List;
 import java.util.List;
 
 
 @Data
 @Data
-public class AgreementProductCosts {
+public class AgreementProductCosts implements Serializable {
 
 
+
+    @TableId(value = "id", type = IdType.AUTO)
     @ApiModelProperty(value = "费用id")
     @ApiModelProperty(value = "费用id")
     private String id;
     private String id;
 
 

+ 8 - 9
src/main/resources/mapper/modules/fnc/InsPlyIncomeMapper.xml

@@ -740,19 +740,18 @@
             a.company_id AS "companyId",
             a.company_id AS "companyId",
             MAX( a.company_name ) AS "companyName",
             MAX( a.company_name ) AS "companyName",
             MAX( a.partner_companies_name) as "partnerCompaniesName",
             MAX( a.partner_companies_name) as "partnerCompaniesName",
-            IF(MAX( c.unsettledAmount ) IS NULL , sum( a.other_feevalue ),  sum( a.other_feevalue ) - MAX(d.settleMentAmount) ) AS "noInvoicCommissionFeevalue",
-            GROUP_CONCAT(a.id) as  "incomeIds",
-            MAX(d.settleMentAmount) as "invoicCommissionFeevalue",
-            MAX(e.settleMentAmount) as "settleMentAmount",
-            IF(MAX( f.unSettledAmount ) is null ,MAX( d.settleMentAmount ) ,MAX( f.unSettledAmount )) AS "unSettledAmount",
+            IF(MAX( c.unsettledAmount ) IS NULL , sum( a.other_feevalue ),  MAX( c.unsettledAmount ) ) AS "noInvoicCommissionFeevalue",
+            IF(MAX(c.invoicIds) IS NULL ,  GROUP_CONCAT(a.id),MAX(c.invoicIds) ) as  "incomeIds",
+            MAX(c.settleMentAmount) -MAX( f.settleMentAmount )  AS "invoicCommissionFeevalue",
+            MAX(f.settleMentAmount) as "settleMentAmount",
+            GROUP_CONCAT(a.id) as "ids",
+            IF(MAX( f.unSettledAmount ) is null ,MAX( c.settleMentAmount ) ,MAX( f.unSettledAmount )) AS "unSettledAmount",
             sum( a.other_feevalue ) AS "otherFeevalue"
             sum( a.other_feevalue ) AS "otherFeevalue"
         FROM
         FROM
             ins_ply_income a
             ins_ply_income a
                 LEFT JOIN ptl_agreement pa ON a.agreement_id = pa.id
                 LEFT JOIN ptl_agreement pa ON a.agreement_id = pa.id
-                LEFT JOIN ( SELECT a.company_id AS "companyId", sum( a.unsettled_amount ) AS "unsettledAmount" FROM settlement_documentary_fees a WHERE a.settlement_status = '1' GROUP BY company_id ) c ON c.companyId = a.company_id
-                LEFT JOIN ( SELECT a.company_id AS "companyId", sum( settlement_amount ) AS "settleMentAmount" FROM settlement_documentary_fees a WHERE a.settlement_status = '1' GROUP BY company_id ) d ON d.companyId = a.company_id
-                LEFT JOIN ( SELECT a.company_id AS "companyId", sum( settlement_amount ) AS "settleMentAmount" FROM settlement_documentary_fees a WHERE a.settlement_status = '2' GROUP BY company_id ) e ON e.companyId = a.company_id
-                LEFT JOIN ( SELECT a.company_id AS "companyId", sum( unsettled_amount ) AS "unSettledAmount" FROM settlement_documentary_fees a WHERE a.settlement_status = '2' GROUP BY company_id ) f ON f.companyId = a.company_id
+                LEFT JOIN ( SELECT a.company_id AS "companyId", MIN( a.unsettled_amount ) AS "unsettledAmount" ,sum( settlement_amount ) AS "settleMentAmount", GROUP_CONCAT(a.id) as "invoicIds" FROM settlement_documentary_fees a WHERE a.settlement_status = '1' GROUP BY company_id ) c ON c.companyId = a.company_id
+                LEFT JOIN ( SELECT a.company_id AS "companyId", MIN( unsettled_amount ) AS "unSettledAmount",sum( settlement_amount ) AS "settleMentAmount" FROM settlement_documentary_fees a WHERE a.settlement_status = '2' GROUP BY company_id ) f ON f.companyId = a.company_id
        <where>
        <where>
            1=1
            1=1
            <if test="agreementType !=null  and agreementType!='' ">
            <if test="agreementType !=null  and agreementType!='' ">