فهرست منبع

新车判断逻辑

cuixinpeng 2 سال پیش
والد
کامیت
d161e08c45

+ 160 - 0
src/main/java/com/ydtech/modules/order/components/huatai/HuaTaiRepeatInsuranceComponents.java

@@ -0,0 +1,160 @@
+package com.ydtech.modules.order.components.huatai;
+
+
+import com.ydtech.constants.InsuranceEnum;
+import com.ydtech.constants.enums.InsuranceRisk;
+import com.ydtech.modules.ins.model.vo.RiskInfoVo;
+import com.ydtech.modules.order.components.ZhongmeiRequestApiComponents;
+import com.ydtech.modules.order.entity.api.huatai.request.HuaTaiQuotedPriceRequest;
+import com.ydtech.modules.order.entity.api.huatai.response.HuaTaiQuotedPriceResponse;
+import com.ydtech.modules.order.entity.api.zhongmei.constants.TimeConstants;
+import com.ydtech.modules.order.entity.api.zhongmei.request.QuotedPriceRequest;
+import com.ydtech.modules.order.entity.api.zhongmei.response.QuotedPriceResponse;
+import com.ydtech.modules.order.entity.vo.BaseQuoteInfoVo;
+import com.ydtech.modules.order.utils.InsuranceLog;
+import com.ydtech.utils.DateTimeUtil;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.context.annotation.Lazy;
+import org.springframework.stereotype.Component;
+
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
+import java.util.List;
+
+
+/**
+ * 华泰重复投保保期处理
+ */
+@Slf4j
+@Component
+public class HuaTaiRepeatInsuranceComponents {
+
+    private final HuaTaiRequestApiComponents huaTaiRequestApiComponents;
+
+    public HuaTaiRepeatInsuranceComponents(@Lazy HuaTaiRequestApiComponents huaTaiRequestApiComponents) {
+        this.huaTaiRequestApiComponents = huaTaiRequestApiComponents;
+    }
+
+
+    public HuaTaiQuotedPriceResponse dealRepeatDate(HuaTaiQuotedPriceRequest huaTaiQuotedPriceRequest, HuaTaiQuotedPriceResponse huaTaiQuotedPriceResponse, BaseQuoteInfoVo quoteInfo) {
+        String rtnMsgBz = "";
+        String rtnMsgBusi = "";
+        List<RiskInfoVo> riskList = quoteInfo.getRiskList();
+        InsuranceLog.infoLog(InsuranceEnum.ZMBX.getPinyin(), "\n\t---------> {}\n\t---------> {}", "中煤财险重复投保处理", rtnMsgBz + rtnMsgBusi);
+       /* rtnMsgBz = "交强险平台返回:号牌号码“晋HQE092”的保单发生重复投保,与其重复投保的其它公司的保单信息如下:投保确认码 02CCIC140022102196416712744293;保单号 PDFA22140123250000001413;起保日期 2022-10-24 00:00;终保日期 2023-10-24 00:00;号牌号码 晋HQE092;号牌种类 02;车架号 LSGBC5356HG101426;发动机号 170971343;地区 山西。";
+        rtnMsgBusi = "平台校验:成功 投保查询码:V0101ZMBX140023092205710579353 平台校验,可能存在重复投保,请关注以下平台返回的信息。保单号:6605212022140193005587; 保险公司:中国人寿财产保险公司: 起保日期:2022-10-1600:00:00; 终保日期:2023-10-16; 录单日期:2022-09-15; 险种名称:机动车第三者责任保险: 号牌号码:晋A711BW; 号牌种类代码:02; 号牌底色:01; 车辆识别代号: LGWEF4A52HF424155; 发动机号:1725091016";
+        投保查询码:V0101ZMBX140023102198367810970平台校验,可能存在重复投保,请关注以下平台返回的信息。保单号:;保险公司:;起保日期:;终保日期:;录单日期:;车辆识别代号:LVHRE4876B5049915;发动机号:5049956;重复投保公司种类:其他公司
+*/
+        HuaTaiQuotedPriceRequest.ContractDto.ContractMainDto contractMainDTOBiz = null;
+        HuaTaiQuotedPriceRequest.ContractDto.ContractMainDto contractMainDTOBusi = null;
+        List<HuaTaiQuotedPriceRequest.ContractDto> contractDtoList = huaTaiQuotedPriceRequest.getBusinessData().getContract();
+
+        for (HuaTaiQuotedPriceRequest.ContractDto contractDto : contractDtoList) {
+            HuaTaiQuotedPriceRequest.ContractDto.ContractMainDto contractMainDTO = contractDto.getContractMain();
+            if ("1002".equals(contractMainDTO.getRiskCode())) {
+                contractMainDTOBiz = contractDto.getContractMain();
+            } else {
+                contractMainDTOBusi = contractDto.getContractMain();
+            }
+
+        }
+        String jqEndDate = "";
+        String syEndDate = "";
+
+        if (StringUtils.isNotEmpty(rtnMsgBz) && rtnMsgBz.contains("起保日期") && rtnMsgBz.contains("终保日期")) {
+            String coverageEndDate = rtnMsgBz.substring(rtnMsgBz.indexOf("终保日期") + 5, rtnMsgBz.indexOf("终保日期") + 5 + 16);
+            if(coverageEndDate.contains("-")){
+                LocalDateTime start = DateTimeUtil.parseLocalDateTime(coverageEndDate, DateTimeUtil.DATETIME_PATTERN_EXT1);
+                jqEndDate = DateTimeUtil.getStartTimeOfDayStr(start, DateTimeUtil.DATETIME_PATTERN);
+                contractMainDTOBiz = getPeriodDate(jqEndDate, contractMainDTOBiz);
+                for (RiskInfoVo riskInfoVo : riskList) {
+                    if (InsuranceRisk.TRAFFIC.getCode().equals(riskInfoVo.getRiskCode())) {
+                        riskInfoVo.setStartDate(contractMainDTOBiz.getValidDate());
+                        riskInfoVo.setEndDate(contractMainDTOBiz.getExpiryDate());
+                    }
+                }
+            }else{
+                return huaTaiQuotedPriceResponse;
+            }
+
+        }
+
+        // 商业险
+        if (StringUtils.isNotEmpty(rtnMsgBusi) && rtnMsgBusi.contains("起保日期") && rtnMsgBusi.contains("终保日期")) {
+            String coverageEndDate = rtnMsgBusi.substring(rtnMsgBusi.indexOf("终保日期") + 5, rtnMsgBusi.indexOf("终保日期") + 5 + 10);
+            if(coverageEndDate.contains("-")){
+                DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
+                LocalDateTime start = LocalDate.parse(coverageEndDate, dateTimeFormatter).atStartOfDay();
+                syEndDate = DateTimeUtil.getStartTimeOfDayStr(start, DateTimeUtil.DATETIME_PATTERN);
+                contractMainDTOBusi = getPeriodDate(syEndDate, contractMainDTOBusi);
+                for (RiskInfoVo riskInfoVo : riskList) {
+                    if (InsuranceRisk.BUSINESS.getCode().equals(riskInfoVo.getRiskCode())) {
+                        riskInfoVo.setStartDate(contractMainDTOBusi.getValidDate());
+                        riskInfoVo.setEndDate(contractMainDTOBusi.getExpiryDate());
+                    }
+                }
+            }else{
+                return huaTaiQuotedPriceResponse;
+            }
+        }
+
+        return huaTaiRequestApiComponents.quotedPrice(huaTaiQuotedPriceRequest, HuaTaiQuotedPriceResponse.class);
+    }
+
+    public HuaTaiQuotedPriceResponse dealRepeatDateFormError(HuaTaiQuotedPriceRequest quotedPriceRequest, HuaTaiQuotedPriceResponse quotedPriceResponse, BaseQuoteInfoVo quoteInfo) {
+        InsuranceLog.infoLog(InsuranceEnum.ZMBX.getPinyin(), "\n\t---------> {}\n\t---------> {}", "华泰财险重复投保处理", quotedPriceResponse.getHead().getReturnMessage());
+        String rtnMsgBusi = quotedPriceResponse.getHead().getReturnMessage();
+        List<RiskInfoVo> riskList = quoteInfo.getRiskList();
+
+        HuaTaiQuotedPriceRequest.ContractDto.ContractMainDto contractMainDTOBiz = null;
+        HuaTaiQuotedPriceRequest.ContractDto.ContractMainDto contractMainDTOBusi = null;
+        List<HuaTaiQuotedPriceRequest.ContractDto> contractDTOList = quotedPriceRequest.getBusinessData().getContract();
+
+        for (HuaTaiQuotedPriceRequest.ContractDto contractDTO : contractDTOList) {
+            HuaTaiQuotedPriceRequest.ContractDto.ContractMainDto contractMainDTO = contractDTO.getContractMain();
+            if ("1002".equals(contractMainDTO.getRiskCode())) {
+                contractMainDTOBiz = contractDTO.getContractMain();
+            } else {
+                contractMainDTOBusi = contractDTO.getContractMain();
+            }
+
+        }
+        String syEndDate = "";
+        // 商业险
+        if (StringUtils.isNotEmpty(rtnMsgBusi) && rtnMsgBusi.contains("起保日期") && rtnMsgBusi.contains("终保日期")) {
+            String coverageEndDate = rtnMsgBusi.substring(rtnMsgBusi.indexOf("终保日期") + 5, rtnMsgBusi.indexOf("终保日期") + 5 + 10);
+            DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
+            LocalDateTime start = LocalDate.parse(coverageEndDate, dateTimeFormatter).atStartOfDay().plusDays(1);
+            syEndDate = DateTimeUtil.getStartTimeOfDayStr(start, DateTimeUtil.DATETIME_PATTERN);
+            contractMainDTOBusi = getPeriodDate(syEndDate, contractMainDTOBusi);
+            for (RiskInfoVo riskInfoVo : riskList) {
+                if (InsuranceRisk.BUSINESS.getCode().equals(riskInfoVo.getRiskCode())) {
+                    riskInfoVo.setStartDate(contractMainDTOBusi.getValidDate());
+                    riskInfoVo.setEndDate(contractMainDTOBusi.getExpiryDate());
+                }
+            }
+        }
+
+        return huaTaiRequestApiComponents.quotedPrice(quotedPriceRequest, HuaTaiQuotedPriceResponse.class);
+    }
+
+    private HuaTaiQuotedPriceRequest.ContractDto.ContractMainDto getPeriodDate(String startDate, HuaTaiQuotedPriceRequest.ContractDto.ContractMainDto contractMainDto) {
+        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+        LocalDate localDate = LocalDate.parse(startDate, formatter);
+        LocalDate nextYears = localDate.plusYears(1);
+        if (startDate.contains(TimeConstants.START_TIME)) {
+            LocalDate expiry = nextYears.minusDays(1);
+            contractMainDto.setValidDate(startDate);
+            contractMainDto.setExpiryDate(expiry + " " + TimeConstants.END_TIME);
+        } else {
+            // 及时
+            LocalDateTime localDateTime = LocalDateTime.parse(startDate, formatter);
+            LocalDateTime expiryDateTime = localDateTime.plusYears(1);
+            contractMainDto.setValidDate(startDate);
+            contractMainDto.setExpiryDate(expiryDateTime.format(formatter));
+        }
+        return contractMainDto;
+    }
+}

+ 62 - 0
src/main/java/com/ydtech/modules/protocol/controller/PtlNewCarJudgeRulesController.java

@@ -0,0 +1,62 @@
+package com.ydtech.modules.protocol.controller;
+
+
+import com.ydtech.core.page.HttpResult;
+import com.ydtech.core.page.PageResult;
+import com.ydtech.modules.protocol.entity.po.PtlNewCarJudgeRules;
+import com.ydtech.modules.protocol.entity.vo.PtlNewCarJudgeRulesVo;
+import com.ydtech.modules.protocol.service.PtlNewCarJudgeRulesService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+@Api(tags = "新车判断规则")
+@RestController
+@RequestMapping("/ptl/newCar/judgeRule")
+public class PtlNewCarJudgeRulesController {
+
+    private final PtlNewCarJudgeRulesService ptlNewCarJudgeRulesService;
+
+    public PtlNewCarJudgeRulesController(PtlNewCarJudgeRulesService ptlNewCarJudgeRulesService) {
+        this.ptlNewCarJudgeRulesService = ptlNewCarJudgeRulesService;
+    }
+
+    @PostMapping("/page")
+    @ApiOperation("分页查询新车判断规则")
+    public HttpResult<PageResult<PtlNewCarJudgeRules>> page(@RequestBody PtlNewCarJudgeRulesVo ptlNewCarJudgeRulesVo) {
+        return ptlNewCarJudgeRulesService.pageNewCarJudgeRules(ptlNewCarJudgeRulesVo);
+    }
+
+    @PostMapping
+    @ApiOperation("添加新车判断规则")
+    public HttpResult<Object> save(@RequestBody PtlNewCarJudgeRulesVo ptlNewCarJudgeRulesVo) {
+        return ptlNewCarJudgeRulesService.saveNewCarJudgeRules(ptlNewCarJudgeRulesVo);
+    }
+
+    @PutMapping("/{ruleId}")
+    @ApiOperation("修改新车判断规则")
+    public HttpResult<Object> revise(@PathVariable String ruleId, @RequestBody PtlNewCarJudgeRulesVo ptlNewCarJudgeRulesVo) {
+        return ptlNewCarJudgeRulesService.reviseNewCarJudgeRules(ruleId, ptlNewCarJudgeRulesVo);
+    }
+
+    @GetMapping("/{ruleId}")
+    @ApiOperation("通过规则id查询所有信息")
+    public HttpResult<PtlNewCarJudgeRulesVo> getByAgreementId(@PathVariable String ruleId) {
+        return  ptlNewCarJudgeRulesService.getByRuleId(ruleId);
+    }
+
+    @DeleteMapping("/{ruleId}")
+    @ApiOperation("删除新车判断规则")
+    public HttpResult<Object> delete(@PathVariable String ruleId) {
+        return ptlNewCarJudgeRulesService.deleteByRuleId(ruleId);
+    }
+
+    @GetMapping("/getByCompanyId/{companyId}")
+    @ApiOperation("通过保险公司编号查询新车判断规则")
+    public HttpResult<List<PtlNewCarJudgeRules>> getByCompanyId(@PathVariable String companyId) {
+        return ptlNewCarJudgeRulesService.getByCompanyId(companyId);
+    }
+
+}

+ 14 - 0
src/main/java/com/ydtech/modules/protocol/dao/PtlNewCarJudgeRulesMapper.java

@@ -0,0 +1,14 @@
+package com.ydtech.modules.protocol.dao;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.ydtech.modules.protocol.entity.po.PtlNewCarJudgeRules;
+import com.ydtech.modules.protocol.entity.po.PtlNonCarProductImg;
+
+/**
+ * @author CXP
+ * @description 针对表【ptl_new_car_judge_rules(新车判断规则表)】的数据库操作Mapper
+ * @createDate 2023年11月17日21:31:23
+ * @Entity generator.domain.PtlNewCarJudgeRules
+ */
+public interface PtlNewCarJudgeRulesMapper extends BaseMapper<PtlNewCarJudgeRules> {
+}

+ 66 - 0
src/main/java/com/ydtech/modules/protocol/entity/po/PtlNewCarJudgeRules.java

@@ -0,0 +1,66 @@
+package com.ydtech.modules.protocol.entity.po;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.time.LocalDateTime;
+import java.util.Date;
+
+/**
+ * 新车判断规则
+ *
+ * @TableName ptl_new_car_judge_rules
+ */
+@Data
+@TableName(value = "ptl_new_car_judge_rules")
+public class PtlNewCarJudgeRules implements Serializable {
+    /**
+     * 主键
+     */
+    @TableId(type = IdType.AUTO)
+    private Integer id;
+
+    /**
+     * 归属保司
+     */
+    @TableField(value = "company_id")
+    private String companyId;
+
+    /**
+     * 单位  month-月 day-天
+     */
+    @TableField(value = "unit_type_code")
+    private String unitTypeCode;
+
+    /**
+     * 单位值
+     */
+    @TableField(value = "unit_type_value")
+    private String unitTypeValue;
+
+
+    /**
+     * 是否有效(0有效 1 无效)
+     */
+    @TableField(value = "is_effective")
+    private String isEffective;
+
+    /**
+     * 保存日期
+     */
+    @TableField(value = "save_date")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date saveDate;
+
+
+
+    @TableField(exist = false)
+    private static final long serialVersionUID = 1L;
+
+
+}

+ 22 - 0
src/main/java/com/ydtech/modules/protocol/entity/vo/PtlNewCarJudgeRulesVo.java

@@ -0,0 +1,22 @@
+package com.ydtech.modules.protocol.entity.vo;
+
+import com.ydtech.core.page.BasePageVO;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+@EqualsAndHashCode(callSuper = true)
+@Data
+public class PtlNewCarJudgeRulesVo extends BasePageVO {
+
+
+    private static final long serialVersionUID = 9216585915260214721L;
+
+    @ApiModelProperty(value = "保险公司")
+    private String companyId;
+    @ApiModelProperty(value = "单位")
+    private String unitTypeCode;
+    @ApiModelProperty(value = "单位值")
+    private String unitTypeValue;
+
+}

+ 67 - 0
src/main/java/com/ydtech/modules/protocol/service/PtlNewCarJudgeRulesService.java

@@ -0,0 +1,67 @@
+package com.ydtech.modules.protocol.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.ydtech.core.page.HttpResult;
+import com.ydtech.core.page.PageResult;
+import com.ydtech.modules.protocol.entity.po.PtlNewCarJudgeRules;
+import com.ydtech.modules.protocol.entity.vo.PtlNewCarJudgeRulesVo;
+
+import java.util.List;
+
+/**
+ * @author CXP
+ * @description 针对表【ptl_new_car_judge_rules(新车判断规则)】的数据库操作Service
+ * @createDate 2023-08-11 15:50:20
+ */
+public interface PtlNewCarJudgeRulesService extends IService<PtlNewCarJudgeRules> {
+
+    /**
+     * 添加新车判断规则
+     *
+     * @param newCarJudgeRulesVo 新车判断规则保存实体
+     * @return HttpResult
+     */
+    HttpResult<Object> saveNewCarJudgeRules(PtlNewCarJudgeRulesVo newCarJudgeRulesVo);
+
+    /**
+     * 修改新车判断规则
+     *
+     * @param ruleId              规则id
+     * @param newCarJudgeRulesVo 新车判断规则保存实体
+     * @return HttpResult
+     */
+    HttpResult<Object> reviseNewCarJudgeRules(String ruleId, PtlNewCarJudgeRulesVo newCarJudgeRulesVo);
+
+    /**
+     * 通过规则id查询所有信息
+     *
+     * @param ruleId 规则id
+     * @return PtlNonCarInsuranceProductQueryVo
+     */
+    HttpResult<PtlNewCarJudgeRulesVo> getByRuleId(String ruleId);
+
+    /**
+     * 删除新车判断规则
+     *
+     * @param ruleId 规则id
+     * @return HttpResult
+     */
+    HttpResult<Object> deleteByRuleId(String ruleId);
+
+    /**
+     * 分页查询
+     *
+     * @param newCarJudgeRulesVo 新车判断规则查询实体
+     * @return HttpResult<PageResult < PtlNewCarJudgeRules>>
+     */
+    HttpResult<PageResult<PtlNewCarJudgeRules>> pageNewCarJudgeRules(PtlNewCarJudgeRulesVo newCarJudgeRulesVo);
+
+    /**
+     * 通过保险公司编号查询新车判断规则
+     *
+     * @param companyId 保险公司编号
+     * @return List<PtlNonCarInsuranceProduct>
+     */
+    HttpResult<List<PtlNewCarJudgeRules>> getByCompanyId(String companyId);
+
+}

+ 97 - 0
src/main/java/com/ydtech/modules/protocol/service/impl/PtlNewCarJudgeRulesServiceImpl.java

@@ -0,0 +1,97 @@
+package com.ydtech.modules.protocol.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.ydtech.core.page.HttpResult;
+import com.ydtech.core.page.PageResult;
+import com.ydtech.modules.protocol.dao.PtlNewCarJudgeRulesMapper;
+import com.ydtech.modules.protocol.entity.po.PtlNewCarJudgeRules;
+import com.ydtech.modules.protocol.entity.vo.PtlNewCarJudgeRulesVo;
+import com.ydtech.modules.protocol.service.PtlNewCarJudgeRulesService;
+import com.ydtech.modules.protocol.utils.AssertionUtils;
+import com.ydtech.utils.StringUtils;
+import org.springframework.beans.BeanUtils;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.Collections;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * @author CXP
+ * @description 针对表【ptl_new_car_judge_rules(新车判断规则)】的数据库操作Service实现
+ * @createDate 2023年11月18日22:50:18
+ */
+@Service
+public class PtlNewCarJudgeRulesServiceImpl extends ServiceImpl<PtlNewCarJudgeRulesMapper, PtlNewCarJudgeRules>
+        implements PtlNewCarJudgeRulesService {
+
+
+    @Override
+    public HttpResult<Object> saveNewCarJudgeRules(PtlNewCarJudgeRulesVo newCarJudgeRulesVo) {
+        PtlNewCarJudgeRules ptlNewCarJudgeRules = new PtlNewCarJudgeRules();
+        BeanUtils.copyProperties(newCarJudgeRulesVo, ptlNewCarJudgeRules);
+        ptlNewCarJudgeRules.setIsEffective("1");
+        ptlNewCarJudgeRules.setSaveDate(new Date());
+        boolean b = save(ptlNewCarJudgeRules);
+        AssertionUtils.isSucceed(b, "保存失败");
+        return HttpResult.ok("保存成功");
+    }
+
+    @Override
+    @Transactional
+    public HttpResult<Object> reviseNewCarJudgeRules(String ruleId, PtlNewCarJudgeRulesVo newCarJudgeRulesVo) {
+        PtlNewCarJudgeRules newCarJudgeRules = getById(ruleId);
+        BeanUtils.copyProperties(newCarJudgeRulesVo, newCarJudgeRules);
+        newCarJudgeRules.setIsEffective("1");
+        newCarJudgeRules.setSaveDate(new Date());
+        boolean b = updateById(newCarJudgeRules);
+        AssertionUtils.isSucceed(b, "修改失败");
+        return HttpResult.ok("修改成功");
+    }
+
+    @Override
+    public HttpResult<Object> deleteByRuleId(String ruleId) {
+        boolean b = removeById(ruleId);
+        AssertionUtils.isSucceed(b, "删除失败");
+        return HttpResult.ok("删除成功");
+    }
+
+    @Override
+    public HttpResult<PageResult<PtlNewCarJudgeRules>> pageNewCarJudgeRules(PtlNewCarJudgeRulesVo newCarJudgeRulesVo) {
+        Integer pageNum = newCarJudgeRulesVo.getPageNum();
+        Integer pageSize = newCarJudgeRulesVo.getPageSize();
+        Page<PtlNewCarJudgeRules> ptlNewCarJudgeRulesPage = new Page<>(pageNum, pageSize);
+        LambdaQueryWrapper<PtlNewCarJudgeRules> wrapper = new LambdaQueryWrapper<>();
+        wrapper.eq(StringUtils.isNotEmpty(newCarJudgeRulesVo.getUnitTypeCode()),PtlNewCarJudgeRules::getUnitTypeCode,newCarJudgeRulesVo.getUnitTypeCode());
+        wrapper.eq(StringUtils.isNotEmpty(newCarJudgeRulesVo.getUnitTypeValue()),PtlNewCarJudgeRules::getUnitTypeValue,newCarJudgeRulesVo.getUnitTypeValue());
+        wrapper.eq(StringUtils.isNotEmpty(newCarJudgeRulesVo.getCompanyId()),PtlNewCarJudgeRules::getCompanyId,newCarJudgeRulesVo.getCompanyId());
+        Page<PtlNewCarJudgeRules> newCarJudgeRulesPage = page(ptlNewCarJudgeRulesPage,wrapper);
+        PageResult<PtlNewCarJudgeRules> ptlNewCarJudgeRulesPageResult = new PageResult<>(pageNum, pageSize, (int) newCarJudgeRulesPage.getTotal(), newCarJudgeRulesPage.getRecords());
+        return HttpResult.ok(ptlNewCarJudgeRulesPageResult);
+    }
+
+    @Override
+    public HttpResult<List<PtlNewCarJudgeRules>> getByCompanyId(String companyId) {
+        String code = "000000";
+        String substring = companyId.substring(0, 5);
+        String s = substring + code;
+        List<PtlNewCarJudgeRules> list = lambdaQuery().eq(PtlNewCarJudgeRules::getCompanyId, s).list();
+        if (list != null && !list.isEmpty()) {
+            return HttpResult.ok(list);
+        }
+        return HttpResult.ok(Collections.emptyList());
+    }
+
+    @Override
+    public HttpResult<PtlNewCarJudgeRulesVo> getByRuleId(String ruleId) {
+        PtlNewCarJudgeRulesVo resultVo=new PtlNewCarJudgeRulesVo();
+        //获取新车规则判断信息
+        PtlNewCarJudgeRules newCarJudgeRules = getById(ruleId);
+        BeanUtils.copyProperties(newCarJudgeRules, resultVo);
+        AssertionUtils.isEmpty(newCarJudgeRules, "没有此新车判断规则");
+        return HttpResult.ok(resultVo);
+    }
+}