Procházet zdrojové kódy

Merge remote-tracking branch 'origin/test' into test

helixiao před 1 rokem
rodič
revize
168ef1993d
21 změnil soubory, kde provedl 196 přidání a 33 odebrání
  1. 10 0
      src/main/java/com/ydtech/modules/admin/model/report/profitAnalysis/ProfitAnalysisDto.java
  2. 4 0
      src/main/java/com/ydtech/modules/admin/model/report/profitAnalysis/ProfitAnalysisQueryDto.java
  3. 19 1
      src/main/java/com/ydtech/modules/admin/service/impl/CompanyDataReportServiceImpl.java
  4. 29 2
      src/main/java/com/ydtech/modules/admin/service/impl/ProfitAnalysisServiceImpl.java
  5. 3 0
      src/main/java/com/ydtech/modules/fnc/dao/InsPlyIncomeMapper.java
  6. 3 3
      src/main/java/com/ydtech/modules/fnc/vo/InsPlyIncomeVo.java
  7. 3 0
      src/main/java/com/ydtech/modules/inv/dao/InvAccountMapper.java
  8. 6 0
      src/main/java/com/ydtech/modules/inv/model/InvAccountCardVo.java
  9. 1 0
      src/main/java/com/ydtech/modules/order/controller/InsOrdersController.java
  10. 19 0
      src/main/java/com/ydtech/modules/order/entity/crawler/request/VehicleInspectionCodeRequest.java
  11. 3 0
      src/main/java/com/ydtech/modules/order/entity/vo/InsAreaCompanyHistoryVo.java
  12. 7 0
      src/main/java/com/ydtech/modules/order/service/InsCrawlerOrderService.java
  13. 4 0
      src/main/java/com/ydtech/modules/order/service/impl/InsCrawlerOrderServiceImpl.java
  14. 16 15
      src/main/java/com/ydtech/modules/order/service/impl/InsOrdersServiceImpl.java
  15. 3 1
      src/main/java/com/ydtech/modules/protocols/service/impl/PtlAgreementUndwrtRulesDictServiceImpl.java
  16. 7 0
      src/main/java/com/ydtech/modules/protocols/service/impl/PtlAgreementUndwrtRulesNewServiceImpl.java
  17. 5 1
      src/main/resources/mapper/modules/admin/SysUserMapper.xml
  18. 9 8
      src/main/resources/mapper/modules/esm/EsmInsCompanyMapper.xml
  19. 31 0
      src/main/resources/mapper/modules/fnc/InsPlyIncomeMapper.xml
  20. 11 0
      src/main/resources/mapper/modules/inv/InvAccountMapper.xml
  21. 3 2
      src/main/resources/mapper/modules/order/InsAreaCompanyMapper.xml

+ 10 - 0
src/main/java/com/ydtech/modules/admin/model/report/profitAnalysis/ProfitAnalysisDto.java

@@ -59,4 +59,14 @@ public class ProfitAnalysisDto {
     @ApiModelProperty("净利润")
     @TableField(value="net_profit")
     private BigDecimal netProfit;
+
+
+    @ApiModelProperty("变动金额")
+    private BigDecimal applyAmount;
+
+    @ApiModelProperty("转入银行卡")
+    private String enterCardNum;
+
+    @ApiModelProperty("转出银行卡")
+    private String outCardNum;
 }

+ 4 - 0
src/main/java/com/ydtech/modules/admin/model/report/profitAnalysis/ProfitAnalysisQueryDto.java

@@ -39,4 +39,8 @@ public class ProfitAnalysisQueryDto {
     @ApiModelProperty("部门ids")
     private List<String> deptIds;
 
+
+    @ApiModelProperty("年月")
+    private String yearAndMonth;
+
 }

+ 19 - 1
src/main/java/com/ydtech/modules/admin/service/impl/CompanyDataReportServiceImpl.java

@@ -236,8 +236,26 @@ public class CompanyDataReportServiceImpl implements CompanyDataReportService {
         HashMap<String, String> dateMapByType = getDateMapByType(ordersDataVo.getDateType(), ordersDataVo.getBeginDate(), ordersDataVo.getEndDate());
         ordersDataVo.setBeginDate(dateMapByType.get("startDate"));
         ordersDataVo.setEndDate(dateMapByType.get("endDate"));
-
         List<OrdersDataExcel> resultSubOrder = insAreaCompanyMapper.querOrdersDataListExcel(ordersDataVo);
+            if(!resultSubOrder.isEmpty()){
+                OrdersDataDto ordersDataDto = new OrdersDataDto();
+                ordersDataDto.setBeginDate(dateMapByType.get("startDate"));
+                ordersDataDto.setEndDate(dateMapByType.get("endDate"));
+                for (OrdersDataExcel record : resultSubOrder) {
+                    String licenseno = record.getLicenseno();  //车牌号
+                    String frameno = record.getFrameno();   //车牌号
+                    ordersDataDto.setLicenseno(licenseno);
+                    ordersDataDto.setFrameno(frameno);
+                    OrdersDataDto dto = insAreaCompanyMapper.getSumBigOrderCount(ordersDataDto);
+                    String orderNumber = dto.getOrderNumber();
+                    BigDecimal num1 = new BigDecimal(orderNumber);
+                    BigDecimal num2 = new BigDecimal(record.getOrderNumber());
+                    BigDecimal result = num1.divide(num2, 2, RoundingMode.HALF_UP);
+                    record.setCloseRate(result.toString());
+                    record.setNamesimple(dto.getNamesimple());
+
+                }
+            }
         String uploadPath = this.uploadPath + "/excel/";
         Path path = Paths.get(uploadPath);
         if (!Files.exists(path)) {

+ 29 - 2
src/main/java/com/ydtech/modules/admin/service/impl/ProfitAnalysisServiceImpl.java

@@ -5,10 +5,15 @@ import com.ydtech.modules.admin.model.report.profitAnalysis.ProfitAnalysisQueryD
 import com.ydtech.modules.admin.service.ProfitAnalysisService;
 import com.ydtech.modules.admin.utils.SliceUpDateUtil;
 import com.ydtech.modules.fnc.dao.InsPlyIncomeMapper;
+import com.ydtech.modules.inv.dao.InvAccountMapper;
+import com.ydtech.modules.inv.model.InvAccount;
+import com.ydtech.modules.inv.model.InvAccountCardVo;
+import com.ydtech.utils.BigDecimalUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.math.BigDecimal;
 import java.util.Calendar;
 import java.util.Date;
 import java.util.HashMap;
@@ -22,7 +27,8 @@ import java.util.List;
  */
 @Service
 public class ProfitAnalysisServiceImpl implements ProfitAnalysisService {
-
+    @Autowired
+    private InvAccountMapper invAccountMapper;
 
     @Autowired
     private InsPlyIncomeMapper insPlyIncomeMapper;
@@ -52,7 +58,28 @@ public class ProfitAnalysisServiceImpl implements ProfitAnalysisService {
         HashMap<String, String> dateMapByType = getDateMapByType(profitAnalysisQueryDto.getDateType(), profitAnalysisQueryDto.getYear());
         profitAnalysisQueryDto.setBeginDate(dateMapByType.get("startDate"));
         profitAnalysisQueryDto.setEndDate(dateMapByType.get("endDate"));
-        return insPlyIncomeMapper.getProfitAnalysisQueryList(profitAnalysisQueryDto);
+        List<ProfitAnalysisDto> profitAnalysisQueryList = insPlyIncomeMapper.getProfitAnalysisQueryList(profitAnalysisQueryDto);
+        if(!profitAnalysisQueryList.isEmpty()){
+            for (ProfitAnalysisDto profitAnalysisDto : profitAnalysisQueryList) {
+                BigDecimal variableCost = BigDecimal.ZERO;
+                String yearAndMonth = profitAnalysisDto.getYearAndMonth();
+                profitAnalysisQueryDto.setYearAndMonth(yearAndMonth);
+                List<ProfitAnalysisDto> profitAnalysisDto1 = insPlyIncomeMapper.changeAmount(profitAnalysisQueryDto);
+                for (ProfitAnalysisDto analysisDto : profitAnalysisDto1) {
+                    String outCardNum = analysisDto.getOutCardNum();
+                    String enterCardNum = analysisDto.getEnterCardNum();
+                    InvAccountCardVo outAccount = invAccountMapper.getByCarNumber(outCardNum);
+                    InvAccountCardVo enterAccount  = invAccountMapper.getByCarNumber(enterCardNum);
+                    if(StringUtils.isNotEmpty(outAccount.getOuterFlag()) && StringUtils.isNotEmpty(enterAccount.getOuterFlag())){
+                        if(!enterAccount.getOuterFlag().equals(outAccount.getOuterFlag())){
+                            variableCost=variableCost.add(analysisDto.getApplyAmount());
+                        }
+                    }
+                }
+                profitAnalysisDto.setVariableCost(variableCost);
+            }
+        }
+        return profitAnalysisQueryList;
     }
 
     /**

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

@@ -225,4 +225,7 @@ public interface InsPlyIncomeMapper extends BaseMapper<InsPlyIncome> {
      * @return  合计金额
      */
     List<InsPlyIncome> totalBxAmountNew(HashMap<String, Object> params);
+
+    List<ProfitAnalysisDto> changeAmount(@Param("vo") ProfitAnalysisQueryDto profitAnalysisQueryDto);
+
 }

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

@@ -45,11 +45,11 @@ public class InsPlyIncomeVo implements Serializable {
     private String orderno;
 
     @ApiModelProperty(value = "开始时间")
-    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    @JsonFormat(shape = JsonFormat.Shape.STRING,pattern = "yyyy-MM-dd", timezone = "GMT+8")
     private LocalDate startDate;
 
     @ApiModelProperty(value = "结束时间")
-    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    @JsonFormat(shape = JsonFormat.Shape.STRING,pattern = "yyyy-MM-dd", timezone = "GMT+8")
     private LocalDate endDate;
 
 
@@ -57,7 +57,7 @@ public class InsPlyIncomeVo implements Serializable {
     private String signDate;
 
     @ApiModelProperty(value = "创建日期")
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss ", timezone = "GMT+8")
+    @JsonFormat(shape = JsonFormat.Shape.STRING,pattern = "yyyy-MM-dd HH:mm:ss ", timezone = "GMT+8")
     private LocalDate createTime;
 
     @ApiModelProperty(value = "结算日期")

+ 3 - 0
src/main/java/com/ydtech/modules/inv/dao/InvAccountMapper.java

@@ -32,6 +32,9 @@ public interface InvAccountMapper extends BaseMapper<InvAccount> {
      *  @Description:  通过账户名和银行卡号查询账户列表
      */
     Page<InvAccountCard> queryPage(@Param("page") Page<InvAccountCard> page, @Param("vo") InvAccountCardQueryDto invAccountCardQueryDto);
+
+    InvAccountCardVo getByCarNumber(String cardNum);
+
 }
 
 

+ 6 - 0
src/main/java/com/ydtech/modules/inv/model/InvAccountCardVo.java

@@ -35,4 +35,10 @@ public class InvAccountCardVo {/**
     @ApiModelProperty(value = "账户Id")
     private String accountId;
 
+    @ApiModelProperty(value = "账户性质")
+    private String accountQuality;
+
+    @ApiModelProperty(value = "外部账户标识(0内部账户 1外部账户)")
+    private String outerFlag;
+
 }

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

@@ -187,6 +187,7 @@ public class InsOrdersController extends BaseController {
             insAreaCompanyHistoryVo.setLicenseno(insOrders.getLicenseno());
             insAreaCompanyHistoryVo.setUserName(insOrders.getUsername());
             insAreaCompanyHistoryVo.setUserId(insOrders.getUserid());
+            insAreaCompanyHistoryVo.setQuoteno(insOrders.getQuoteno());
             InsFeeOrderNew insFeeOrderNew = insFeeOrderNewMap.get(a.getId());
             if (!ObjectUtils.isEmpty(insFeeOrderNew)){
                 SubOrderExportFeeVo subOrderExportFeeVo = costsCalcService.getExportFee(insFeeOrderNew);

+ 19 - 0
src/main/java/com/ydtech/modules/order/entity/crawler/request/VehicleInspectionCodeRequest.java

@@ -0,0 +1,19 @@
+package com.ydtech.modules.order.entity.crawler.request;
+
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+@Data
+public class VehicleInspectionCodeRequest implements Serializable {
+
+    private static final long serialVersionUID = 3595801416277668984L;
+
+    /**
+     * 用户名
+     */
+    private String username;
+
+
+}

+ 3 - 0
src/main/java/com/ydtech/modules/order/entity/vo/InsAreaCompanyHistoryVo.java

@@ -70,6 +70,9 @@ public class InsAreaCompanyHistoryVo extends InsAreaCompany {
     @ApiModelProperty("是否真单交")
     private String iszdj;
 
+    @ApiModelProperty("投保单号")
+    private String quoteno;
+
     public void setRatingInformation(){
         // 评分
         this.iLogPreUdwMess = this.getScore();

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

@@ -65,4 +65,11 @@ public interface InsCrawlerOrderService extends BaseOrderService<Object> {
      * 撤销订单
      */
     void quash(String subOrderNo);
+
+    /**
+     * 验车码识别
+     * @return 验车码
+     */
+    String vehicleInspectionCode();
+
 }

+ 4 - 0
src/main/java/com/ydtech/modules/order/service/impl/InsCrawlerOrderServiceImpl.java

@@ -541,4 +541,8 @@ public class InsCrawlerOrderServiceImpl implements InsCrawlerOrderService {
         insAreaCompanyService.updateCompanyAndOrdersNew(insAreaCompany);
     }
 
+    @Override
+    public String vehicleInspectionCode() {
+        return "";
+    }
 }

+ 16 - 15
src/main/java/com/ydtech/modules/order/service/impl/InsOrdersServiceImpl.java

@@ -476,22 +476,23 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
         orderVoPage.setTotal(total);
 
         List<InsOrders> records = orderVoPage.getRecords();
-        List<String> collect = records.stream().map(InsOrders::getOrderno).collect(Collectors.toList());
-        Map<String, String> subOrderCountDTO = insAreaCompanyService.getSubOrderCountDTO(collect);
-
-        records.forEach(x -> {
-
-            if (InsOrderStatusEnum.ACCEPT_INSURANCE.getCode().equals(x.getOrderstatus())) {
-                JSONArray risk = x.getRisk();
-                List<RiskInfoVo> javaList = risk.toJavaList(RiskInfoVo.class);
-                javaList.forEach(RiskInfoVo::expirationTime);
-                JSONArray objects = JSON.parseArray(JSON.toJSONString(javaList));
-                x.setRisk(objects);
-            }
-
-            x.setSubOrderStatus(subOrderCountDTO);
-        });
+        if (!records.isEmpty()) {
+            List<String> collect = records.stream().map(InsOrders::getOrderno).collect(Collectors.toList());
+            Map<String, String> subOrderCountDTO = insAreaCompanyService.getSubOrderCountDTO(collect);
+
+            records.forEach(x -> {
+
+                if (!InsOrderStatusEnum.ACCEPT_INSURANCE.getCode().equals(x.getOrderstatus())) {
+                    JSONArray risk = x.getRisk();
+                    List<RiskInfoVo> javaList = risk.toJavaList(RiskInfoVo.class);
+                    javaList.forEach(RiskInfoVo::expirationTime);
+                    JSONArray objects = JSON.parseArray(JSON.toJSONString(javaList));
+                    x.setRisk(objects);
+                }
 
+                x.setSubOrderStatus(subOrderCountDTO);
+            });
+        }
         return new BasePageResult<>(orderQueryVo.getPageNum(), orderQueryVo.getPageSize(), orderVoPage.getTotal(),
                 orderVoPage.getPages()
                 , orderVoPage.getRecords());

+ 3 - 1
src/main/java/com/ydtech/modules/protocols/service/impl/PtlAgreementUndwrtRulesDictServiceImpl.java

@@ -1,5 +1,6 @@
 package com.ydtech.modules.protocols.service.impl;
 
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.ydtech.modules.protocols.dao.PtlAgreementUndwrtRulesDictMapper;
@@ -36,7 +37,8 @@ public class PtlAgreementUndwrtRulesDictServiceImpl extends ServiceImpl<PtlAgree
     @Override
     public List<PtlAgreementUndwrtRulesDictLabal> getUndwrtRulesDictList() {
         List<PtlAgreementUndwrtRulesDict> ptlAgreementUndwrtRulesDicts = baseMapper.selectList(new QueryWrapper<>(new PtlAgreementUndwrtRulesDict()));
-        List<PtlAgreementUndwrtRulesDictLabal> list = ptlAgreementUndwrtRulesDictLabalService.list();
+        List<PtlAgreementUndwrtRulesDictLabal> list = ptlAgreementUndwrtRulesDictLabalService.list(new LambdaQueryWrapper<PtlAgreementUndwrtRulesDictLabal>()
+                .orderByAsc(PtlAgreementUndwrtRulesDictLabal::getSort));
 
         Map<Integer,List<PtlAgreementUndwrtRulesDictLabal>> collect = list.stream().collect(Collectors.groupingBy(PtlAgreementUndwrtRulesDictLabal::getParentId));
         list = collect.get(0);

+ 7 - 0
src/main/java/com/ydtech/modules/protocols/service/impl/PtlAgreementUndwrtRulesNewServiceImpl.java

@@ -174,6 +174,13 @@ public class PtlAgreementUndwrtRulesNewServiceImpl extends ServiceImpl<PtlAgreem
             if ("checkbox".equals(ptlAgreementUndwrtRulesAttr.getAttrType()) || "select".equals(ptlAgreementUndwrtRulesAttr.getAttrType())) {
                 desc += ptlAgreementUndwrtRulesAttr.getAttrName() + "包含" + v.get(i).getMin() + "\n";
             }
+            if ("input".equals(ptlAgreementUndwrtRulesAttr.getAttrType())){
+                if(v.get(i).getOperator().equals("2")) {
+                    desc += ptlAgreementUndwrtRulesAttr.getAttrName() + "不包含" + v.get(i).getMin() + "\n";
+                }else{
+                    desc += ptlAgreementUndwrtRulesAttr.getAttrName() + "包含" + v.get(i).getMin() + "\n";
+                }
+            }
         }
         return desc;
     }

+ 5 - 1
src/main/resources/mapper/modules/admin/SysUserMapper.xml

@@ -1446,7 +1446,11 @@
     <select id="findByReferrerId" resultType="com.ydtech.modules.admin.model.vo.SysUserVO">
         SELECT u.id, u.name
         FROM sys_user u
-        where u.dept_id = #{deptId}
+        <where>
+            <if test="deptId != null and deptId != ''">
+                and u.dept_id = #{deptId}
+            </if>
+        </where>
     </select>
 
 

+ 9 - 8
src/main/resources/mapper/modules/esm/EsmInsCompanyMapper.xml

@@ -68,16 +68,17 @@
 
     </select>
     <select id="findOrderCompanyList" resultType="com.ydtech.modules.esm.model.vo.res.EsmInsCompanyResVo">
-        SELECT
-            DISTINCT
-            company_id as id,
-            inscompany as name
+        SELECT DISTINCT
+            ins.company_id AS id,
+            eic.namesimple AS NAME
         FROM
-            ins_area_company
+            ins_area_company ins
+                LEFT JOIN esm_ins_company eic ON ins.company_id = eic.id
         WHERE
-            IFNULL( company_id, '' )!= ''
+            IFNULL( ins.company_id, '' )!= ''
+	        AND IFNULL( eic.id, '' )!= ''
         GROUP BY
-            company_id,
-            inscompany
+            ins.company_id,
+            ins.inscompany
     </select>
 </mapper>

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

@@ -3040,6 +3040,37 @@
 
     </select>
 
+    <select id="changeAmount" resultType="com.ydtech.modules.admin.model.report.profitAnalysis.ProfitAnalysisDto">
+        SELECT
+            a.apply_amount as "applyAmount",
+            a.enter_card_num as "enterCardNum",
+            a.out_card_num as "outCardNum"
+        FROM
+            inv_account_operate a
+                left  join  (
+                select a.category as "aCategory",b. category as "bCategory",a.expenditure_details as "expenditureDetails" from  inv_account_expenses a
+                left  join  inv_account_expenses  b  on a.parent_id =b.expenses_id
+                where   b.category  is  not  null
+            )  b on a.fund_use  = b.bCategory  and  a.fund_fen  = b.aCategory
+        where
+            a.out_card_num IN (
+                SELECT
+                    bank_card_num
+                FROM
+                    inv_account_card iac
+                        LEFT JOIN inv_account ia ON iac.account_id = ia.account_id
+                WHERE
+                    ia.del_flag = '0'
+                  AND ia.outer_flag LIKE concat( '%', '0', '%' )
+            )
+          AND a.del_flag = '0'
+          AND b.expenditureDetails = '3'
+          AND a.revenue_outlay = '0'
+        <if test="vo.yearAndMonth != null  and vo.yearAndMonth !=''">
+          AND   DATE_FORMAT( a.create_time, '%Y-%m' ) =#{vo.yearAndMonth}
+        </if>
+    </select>
+
 
     <select id="getInvociAmount" resultType="com.ydtech.modules.fnc.dto.InsuranceHandlingSettlementMonthDto" >
         select

+ 11 - 0
src/main/resources/mapper/modules/inv/InvAccountMapper.xml

@@ -220,4 +220,15 @@
         a.account_id,
         b.bank_card_num
     </select>
+
+    <select id="getByCarNumber" resultType="com.ydtech.modules.inv.model.InvAccountCardVo">
+        select  ia.outer_flag as "outerFlag" from inv_account_card iac
+        LEFT JOIN inv_account ia ON iac.account_id = ia.account_id
+        <where>
+            <if test="cardNum !=null  and  cardNum!=''">
+                iac.bank_card_num  =#{cardNum}
+            </if>
+        </where>
+
+    </select>
 </mapper>

+ 3 - 2
src/main/resources/mapper/modules/order/InsAreaCompanyMapper.xml

@@ -1550,7 +1550,7 @@
             </if>
 
              <if test="taskStatisticsVo.companyId !=null  and  taskStatisticsVo.companyId !=''">
-                and ifa.company_id =#{taskStatisticsVo.companyId}
+                and iac.company_id =#{taskStatisticsVo.companyId}
             </if>
 
             <if test="taskStatisticsVo.createtimeStart !=null and taskStatisticsVo.createtimeStart != '' and taskStatisticsVo.createtimeEnd !=null and taskStatisticsVo.createtimeEnd != ''">
@@ -2364,6 +2364,7 @@
                 AND DATE_FORMAT( io.createtime, '%Y') =#{vo.year}
             </if>
         </where>
+        limit  10
     </select>
     <select id="queryAgencyUserInsAreaPage" resultType="com.ydtech.modules.admin.model.vo.AgencyUserInsAreaVo">
         select
@@ -2527,7 +2528,7 @@
             </if>
 
             <if test="taskStatisticsVo.companyId !=null  and  taskStatisticsVo.companyId !=''">
-                and ifa.company_id =#{taskStatisticsVo.companyId}
+                and iac.company_id =#{taskStatisticsVo.companyId}
             </if>
 
             <if test="taskStatisticsVo.createtimeStart !=null and taskStatisticsVo.createtimeStart != '' and taskStatisticsVo.createtimeEnd !=null and taskStatisticsVo.createtimeEnd != ''">