Răsfoiți Sursa

处理财务报表统计以及驾意外险

hxl13994548489 2 ani în urmă
părinte
comite
597b73c6ad

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

+ 8 - 4
src/main/java/com/ydtech/modules/fnc/dao/InsPlyIncomeMapper.java

@@ -1,10 +1,7 @@
 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.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;
@@ -181,4 +178,11 @@ public interface InsPlyIncomeMapper extends BaseMapper<InsPlyIncome> {
      *  @Description:  查询月份的统计数据
      */
     FinancialReceivablesAllMonthVo queryDateByTypeByMonth(FinancialReceivablesQueryMonthVo financialReceivablesQueryVo);
+    /**
+     *  @version
+     *  @author: hxl
+     *  @Date: 2024/8/5 10:32
+     *  @Description:  查询月份统计集合数据
+     */
+    List<FinancialReceivablesMonthVo> queryDateByTypeByMonthList(FinancialReceivablesQueryMonthVo financialReceivablesQueryVo);
 }

+ 13 - 0
src/main/java/com/ydtech/modules/fnc/service/impl/InsPlyIncomeServiceImpl.java

@@ -3318,7 +3318,20 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
         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()
 
 
 

+ 29 - 1
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,6 +20,7 @@ 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;
 
@@ -203,8 +205,34 @@ public class InsDrivingIntentionInsuranceServiceImpl extends ServiceImpl<InsDriv
     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.getRuleUseNature(),
+        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);

+ 6 - 23
src/main/java/com/ydtech/modules/order/service/impl/PingAnOrderApiServiceImpl.java

@@ -1124,29 +1124,6 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
      */
     public  Map<String, List<InsDrivingIntentionInsuranceVo>> productQueryList(ProductDetailsRequest productDetailsRequest) {
         Map<String, List<InsDrivingIntentionInsuranceVo>>  map=new HashMap<String, List<InsDrivingIntentionInsuranceVo>>();
-        //参数验证
-        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("货车(核定载质量(吨))不能为空!!");
-        }
         // 账号信息
         PtlAgreementAttribution ptlAgreementAttribution = ptlAgreementAttributionService.getById(productDetailsRequest.getAgreementId());
         // 通过 协议id获取配置实体
@@ -1176,6 +1153,12 @@ public class PingAnOrderApiServiceImpl implements PingAnOrderApiService {
             List<InsDrivingIntentionInsuranceVo> xwList = getCYAndXWList(xiaoWeiListInfo, productDetailsRequest.getSeats(), productDetailsRequest.getCompanyId());
             List<InsDrivingIntentionInsuranceVo> zhList = getCHList(combinationInfoList, productDetailsRequest.getSeats(), productDetailsRequest.getCompanyId());
             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);
         }

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

@@ -2544,5 +2544,12 @@
                 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>