Ver Fonte

处理平台已结算的记录查询

hxl13994548489 há 2 anos atrás
pai
commit
328bd97be7

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

@@ -2,6 +2,7 @@ package com.ydtech.modules.fnc.controller;
 
 import com.ydtech.core.page.HttpResult;
 import com.ydtech.modules.base.controller.BaseController;
+import com.ydtech.modules.fnc.dto.PlatformSettlementRecordDto;
 import com.ydtech.modules.fnc.entity.InsPlyIncome;
 import com.ydtech.modules.fnc.entity.SettlementDocumentaryFeesEntity;
 import com.ydtech.modules.fnc.service.ImportAsyncService;
@@ -412,8 +413,17 @@ public class InsPlyIncomeController extends BaseController {
     public HttpResult<List<HashMap<String, Object>>> otherTimeDetail(@RequestBody InsPlyIncomeVo insPlyIncomeVo) {
         return insPlyIncomeService.otherTimeDetail(insPlyIncomeVo);
     }
-
-
+    /**
+     *  @version
+     *  @author: hxl
+     *  @Date: 2024/6/18 10:27
+     *  @Description: 平台已结算-记录
+     */
+    @PostMapping("/platformSettlementRecord")
+    @ApiOperation(value = "平台已结算-记录")
+    public HttpResult<List<PlatformSettlementRecordDto>> platformSettlementRecord(@RequestBody InsPlyIncomeVo insPlyIncomeVo) {
+        return HttpResult.ok(insPlyIncomeService.platformSettlementRecord(insPlyIncomeVo));
+    }
 }
 
 

+ 8 - 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.fnc.dto.PlatformSettlementRecordDto;
 import com.ydtech.modules.fnc.entity.InsPlyIncome;
 import com.ydtech.modules.fnc.vo.InsPlyIncomeVo;
 import com.ydtech.modules.fnc.vo.InsPlySettleVo;
@@ -122,4 +123,11 @@ public interface InsPlyIncomeMapper extends BaseMapper<InsPlyIncome> {
     List<HashMap<String,Object>> otherTimeDetail(HashMap<String, Object> params);
 
     InsPlyIncome ptTotalAmount(HashMap<String, Object> params);
+    /**
+     *  @version
+     *  @author: hxl
+     *  @Date: 2024/6/18 10:15
+     *  @Description: 根据合作公司id和结算状态查询数据
+     */
+    List<PlatformSettlementRecordDto> platformSettlementRecord(@Param("partnerCompaniesId") String partnerCompaniesId, @Param("handlingFeesStatus") String handlingFeesStatus);
 }

+ 25 - 0
src/main/java/com/ydtech/modules/fnc/dto/PlatformSettlementRecordDto.java

@@ -0,0 +1,25 @@
+package com.ydtech.modules.fnc.dto;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import org.apache.poi.hpsf.Decimal;
+
+import java.io.Serializable;
+
+/**
+ *  @version
+ *  @author: hxl
+ *  @Date: 2024/6/18 10:07
+ *  @Description: 平台已结算的实体类
+ */
+@Data
+@ApiModel("平台已结算记录")
+public class PlatformSettlementRecordDto implements Serializable {
+
+    @ApiModelProperty(value = "进账时间")
+    private String settlementTime;
+
+    @ApiModelProperty(value = "进账金额")
+    private Decimal totalFeevalue;
+}

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

@@ -1,12 +1,12 @@
 package com.ydtech.modules.fnc.service;
 
+import com.baomidou.mybatisplus.extension.service.IService;
 import com.ydtech.core.page.HttpResult;
+import com.ydtech.modules.fnc.dto.PlatformSettlementRecordDto;
 import com.ydtech.modules.fnc.entity.InsAreaCompany;
 import com.ydtech.modules.fnc.entity.InsPlyIncome;
-import com.baomidou.mybatisplus.extension.service.IService;
 import com.ydtech.modules.fnc.entity.SettlementDocumentaryFeesEntity;
 import com.ydtech.modules.fnc.vo.InsPlyIncomeVo;
-import com.ydtech.modules.inv.model.dto.InsBxPlyIncomeExcelDto;
 import com.ydtech.modules.order.entity.BasePageResult;
 import com.ydtech.modules.order.entity.InsOrders;
 import com.ydtech.modules.protocols.entity.po.InsFeeOrderNew;
@@ -14,11 +14,8 @@ import org.springframework.web.multipart.MultipartFile;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
-import java.math.BigDecimal;
-import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
-import java.util.concurrent.CompletableFuture;
 
 /**
  * <p>
@@ -141,5 +138,11 @@ public interface InsPlyIncomeService extends IService<InsPlyIncome> {
     HttpResult<Object> reconciliation(InsPlyIncomeVo insPlyIncomeVo);
 
     HttpResult<Object> batchSumBalance(InsPlyIncomeVo insPlyIncomeVo);
-
+    /**
+     *  @version
+     *  @author: hxl
+     *  @Date: 2024/6/18 10:10
+     *  @Description:  查询平台已结算记录
+     */
+    List<PlatformSettlementRecordDto> platformSettlementRecord(InsPlyIncomeVo insPlyIncomeV);
 }

+ 20 - 7
src/main/java/com/ydtech/modules/fnc/service/impl/InsPlyIncomeServiceImpl.java

@@ -5,11 +5,8 @@ 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.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.ObjectMapper;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import com.ydtech.constants.InsuranceEnum;
@@ -20,7 +17,7 @@ import com.ydtech.modules.base.controller.BaseController;
 import com.ydtech.modules.esm.model.EsmInsCompany;
 import com.ydtech.modules.esm.service.EsmInsCompanyService;
 import com.ydtech.modules.fnc.dao.InsPlyIncomeMapper;
-import com.ydtech.modules.fnc.dao.SettlementDocumentaryFeesMapper;
+import com.ydtech.modules.fnc.dto.PlatformSettlementRecordDto;
 import com.ydtech.modules.fnc.entity.*;
 import com.ydtech.modules.fnc.service.*;
 import com.ydtech.modules.fnc.vo.InsPlyIncomeVo;
@@ -28,7 +25,6 @@ import com.ydtech.modules.fnc.vo.SettlementDocumentaryFeesVo;
 import com.ydtech.modules.ins.model.vo.res.*;
 import com.ydtech.modules.inv.model.dto.*;
 import com.ydtech.modules.inv.utils.EasyExcelUtils;
-import com.ydtech.modules.inv.utils.LocalDateTimeUtils;
 import com.ydtech.modules.order.entity.BasePageResult;
 import com.ydtech.modules.order.entity.InsOrders;
 import com.ydtech.modules.order.entity.api.dajia.response.NVHLODR1001Response;
@@ -1677,6 +1673,9 @@ handlingProportion,
         }
         return null;
     }
+
+
+
     /**
      * @param insPlyIncomeVo
      * @return
@@ -2637,7 +2636,21 @@ handlingProportion,
         }
         return HttpResult.ok();
     }
-
-
+    /**
+     *  @version
+     *  @author: hxl
+     *  @Date: 2024/6/18 10:14
+     *  @Description:  通过保险公司id和状态查询平台的记录
+     */
+    @Override
+    public List<PlatformSettlementRecordDto> platformSettlementRecord(InsPlyIncomeVo insPlyIncomeVo) {
+        if(insPlyIncomeVo.getPartnerCompaniesId()==null || "".equals(insPlyIncomeVo.getPartnerCompaniesId())){
+           throw new SystemException("合作公司编码(partnerCompaniesId)不能为空");
+        }
+        if(insPlyIncomeVo.getHandlingFeesStatus()==null || "".equals(insPlyIncomeVo.getHandlingFeesStatus())){
+            throw new SystemException("结算状态 0 未结算 1已结算(handlingFeesStatus)不能为空");
+        }
+        return baseMapper.platformSettlementRecord(insPlyIncomeVo.getPartnerCompaniesId(),insPlyIncomeVo.getHandlingFeesStatus());
+    }
 
 }

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

@@ -1688,5 +1688,23 @@
       ) s ON i.YEAR = s.YEAR AND i.monthNumber = s.monthNumber
       ORDER BY i.YEAR, i.monthNumber;
     </select>
+    <select id="platformSettlementRecord" resultType="com.ydtech.modules.fnc.dto.PlatformSettlementRecordDto">
+        SELECT
+            DATE_FORMAT(a.settlement_time, '%Y-%m-%d %H:%i:%s') as "settlementTime",
+            SUM( a.commission_feevalue + a.other_feevalue ) AS "totalFeevalue"
+        FROM
+            ins_ply_income a
+            LEFT  JOIN  ptl_agreement  pa  on  a.agreement_id  = pa.id
+        <where>
+            pa.agreement_type ='1'
+            <if test="partnerCompaniesId !=null  and  partnerCompaniesId  !=''">
+                AND a.partner_companies_id =#{partnerCompaniesId}
+            </if>
+            <if test="handlingFeesStatus !=null  and  handlingFeesStatus  !=''">
+                and a.handling_fees_status =#{handlingFeesStatus}
+            </if>
+
+        </where>
+    </select>
 
 </mapper>