Răsfoiți Sursa

应收的接口报错处理

hxl13994548489 2 ani în urmă
părinte
comite
17440b4b2a

+ 3 - 2
src/main/java/com/ydtech/modules/admin/controller/financialReceivables/FinancialReceivablesController.java

@@ -1,6 +1,7 @@
 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;
@@ -47,9 +48,9 @@ public class FinancialReceivablesController {
     }
 
 
-    @PostMapping("/queryDateByType")
+    @PostMapping("/queryDateByTypeByMonth")
     @ApiModelProperty(value = "获取平台私有数据列表")
-    public HttpResult<FinancialReceivablesAllVo> queryDateByTypeByMonth(@RequestBody FinancialReceivablesQueryMonthVo financialReceivablesQueryVo) {
+    public HttpResult<FinancialReceivablesAllMonthVo> queryDateByTypeByMonth(@RequestBody FinancialReceivablesQueryMonthVo financialReceivablesQueryVo) {
         return HttpResult.ok(insPlyIncomeService.queryDateByTypeByMonth(financialReceivablesQueryVo));
     }
     /**

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

@@ -1,6 +1,8 @@
 package com.ydtech.modules.fnc.dao;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.ydtech.modules.admin.model.report.financialReceivables.FinancialReceivablesAllMonthVo;
+import com.ydtech.modules.admin.model.report.financialReceivables.FinancialReceivablesQueryMonthVo;
 import com.ydtech.modules.admin.model.report.financialReceivables.FinancialReceivablesQueryVo;
 import com.ydtech.modules.admin.model.report.financialReceivables.FinancialReceivablesVo;
 import com.ydtech.modules.admin.model.report.profitAnalysis.ProfitAnalysisDto;
@@ -172,4 +174,11 @@ 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);
 }

+ 3 - 2
src/main/java/com/ydtech/modules/fnc/service/InsPlyIncomeService.java

@@ -2,6 +2,7 @@ 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;
@@ -192,6 +193,6 @@ public interface InsPlyIncomeService extends IService<InsPlyIncome> {
      *  @author: hxl
      *  @Date: 2024/8/5 9:43
      *  @Description:
-     */ 
-    FinancialReceivablesAllVo queryDateByTypeByMonth(FinancialReceivablesQueryMonthVo financialReceivablesQueryVo);
+     */
+    FinancialReceivablesAllMonthVo queryDateByTypeByMonth(FinancialReceivablesQueryMonthVo financialReceivablesQueryVo);
 }

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

@@ -12,10 +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.FinancialReceivablesQueryMonthVo;
-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;
@@ -3312,7 +3309,19 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
      *  @Description:  应收月份统计接口
      */
     @Override
-    public FinancialReceivablesAllVo queryDateByTypeByMonth(FinancialReceivablesQueryMonthVo financialReceivablesQueryVo) {
+    public FinancialReceivablesAllMonthVo queryDateByTypeByMonth(FinancialReceivablesQueryMonthVo financialReceivablesQueryVo) {
+        //检查参数
+        if(StringUtils.isBlank(financialReceivablesQueryVo.getType())){
+            throw new SystemException("应收类型不能为空,1为平台2为私有,默认传1");
+        }
+        //检查参数
+        if(StringUtils.isBlank(financialReceivablesQueryVo.getYearAndMonth())){
+            throw new SystemException("月份不能为空");
+        }
+        FinancialReceivablesAllMonthVo  vo= baseMapper.queryDateByTypeByMonth(financialReceivablesQueryVo);
+
+
+
         return null;
     }
 }

+ 36 - 1
src/main/resources/mapper/modules/fnc/InsPlyIncomeMapper.xml

@@ -2509,5 +2509,40 @@
         )  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>
 </mapper>