xuqiang 1 год назад
Родитель
Сommit
6d389a4718

+ 28 - 0
commons/src/main/java/com/jzg/commons/entity/dto/CostTypeEntity.java

@@ -0,0 +1,28 @@
+package com.jzg.commons.entity.dto;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+
+import java.math.BigDecimal;
+
+@Data
+public class CostTypeEntity {
+
+
+    @Schema(description = "费用类型1-交强险2-商业险3-驾意险")
+    private int costType;
+
+    @Schema(description = "入口比例")
+    private BigDecimal inlet;
+
+    @Schema(description = "出口比例")
+    private BigDecimal export;
+
+    @Schema(description = "手续费")
+    private BigDecimal commission;
+
+    @Schema(description = "加投比例")
+    private BigDecimal addThrow;
+
+
+}

+ 110 - 0
commons/src/main/java/com/jzg/commons/entity/dto/PtlAgreementCostEnd.java

@@ -0,0 +1,110 @@
+package com.jzg.commons.entity.dto;
+
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import jakarta.validation.constraints.NotBlank;
+import jakarta.validation.constraints.NotNull;
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.util.Date;
+import java.util.List;
+
+@Data
+@Schema(description = "协议费用管理新增")
+public class PtlAgreementCostEnd {
+
+
+    @Schema(description = "协议费用管理ID")
+    private String id;
+
+    @Schema(description = "协议ID")
+    @NotBlank(message = "协议ID不能为空")
+    private String ptlAgreementId;
+
+    @Schema(description = "险种")
+    @NotBlank(message = "险种不能为空")
+    private String productName;
+
+    @Schema(description = "险种ID")
+    private String productId;
+
+    @Schema(description = "承保规则ID")
+    private String coverRuleId;
+
+    @Schema(description = "生效时间")
+    @NotNull(message = "生效时间不能为空")
+    private Date effectiveTime;
+
+    @Schema(description = "手动审核截止日期")
+    @NotNull(message = "手动审核截止日期不能为空")
+    private Date deadlineTime;
+
+    @Schema(description = "失效时间")
+    @NotNull(message = "失效时间不能为空")
+    private Date failureTime;
+
+    @Schema(description = "审核方式0-自动审核;1-手动审核")
+    @NotBlank(message = "审核方式不能为空")
+    private String auditMethod;
+
+    @Schema(description = "费用描述")
+    private String costDescribe;
+
+    @Schema(description = "0-未审核1-审核通过2-审核未通过")
+    private String approved;
+
+    @Schema(description = "是否有效0有效1-失效")
+    private String isValid;
+
+    @Schema(description = "是否启用0-启用-1失效")
+    private String isEnabled;
+
+    @Schema(description = "费用类型集合")
+    private List<PtlAgreementCostTypeDto> ptlAgreementCostTypeList;
+
+
+    @Schema(description = "规则条件集合")
+    private List<RuleConditionDto> ruleConditions;
+
+
+    @Data
+    @Schema(description = "规则条件集合描述")
+    public static class RuleConditionDto {
+
+        @Schema(description = "费用管理ID")
+        private String ptlAgreementCostId;
+
+        @Schema(description = "规则ID")
+        private String ruleId;
+
+        @Schema(description = "运算符")
+        private String operator;
+
+        @Schema(description = "值")
+        private String dataValue;
+
+    }
+
+    @Data
+    @Schema(description = "费用类型集合描述")
+    public static class PtlAgreementCostTypeDto {
+
+        @Schema(description = "费用类型1-交强险2-商业险3-驾意险")
+        private int costType;
+
+        @Schema(description = "入口比例")
+        private BigDecimal inlet;
+
+        @Schema(description = "出口比例")
+        private BigDecimal export;
+
+        @Schema(description = "手续费")
+        private BigDecimal commission;
+
+        @Schema(description = "加投比例")
+        private BigDecimal addThrow;
+
+    }
+
+}

+ 15 - 0
commons/src/main/java/com/jzg/commons/entity/dto/RulesAttParam.java

@@ -0,0 +1,15 @@
+package com.jzg.commons.entity.dto;
+
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+
+@Data
+@Schema(description = "协议承保规则属性参数")
+public class RulesAttParam {
+
+    @Schema(description = "属性名称")
+    private String attrName;
+
+
+}

+ 38 - 0
commons/src/main/java/com/jzg/commons/entity/po/PtlAreaLicense.java

@@ -0,0 +1,38 @@
+package com.jzg.commons.entity.po;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import lombok.Data;
+
+@Data
+public class PtlAreaLicense {
+
+    /**
+     *
+     */
+    @TableId(type = IdType.ASSIGN_ID)
+    private Long id;
+
+    /**
+     * 车牌
+     */
+    private String license;
+
+    /**
+     * 地区编号
+     */
+    private String areaNumber;
+
+    /**
+     * 地区名称
+     */
+    private String areaName;
+
+
+    /**
+     * 父级id
+     */
+    private String parentNumber;
+
+
+}

+ 15 - 0
commons/src/main/java/com/jzg/commons/entity/po/RuleConditionsVerify.java

@@ -0,0 +1,15 @@
+package com.jzg.commons.entity.po;
+
+import lombok.Data;
+
+@Data
+public class RuleConditionsVerify {
+
+
+    private String ruleId;
+
+    private String operator;
+
+    private String dataValue;
+
+}

+ 138 - 0
commons/src/main/java/com/jzg/commons/util/ListUtils.java

@@ -0,0 +1,138 @@
+package com.jzg.commons.util;
+
+import org.jetbrains.annotations.NotNull;
+
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+import java.util.ListIterator;
+
+public class ListUtils implements List {
+    @Override
+    public int size() {
+        return 0;
+    }
+
+    @Override
+    public boolean isEmpty() {
+        return false;
+    }
+
+    @Override
+    public boolean contains(Object o) {
+        return false;
+    }
+
+    @NotNull
+    @Override
+    public Iterator iterator() {
+        return null;
+    }
+
+    @NotNull
+    @Override
+    public Object[] toArray() {
+        return new Object[0];
+    }
+
+    @Override
+    public boolean add(Object o) {
+        return false;
+    }
+
+    @Override
+    public boolean remove(Object o) {
+        return false;
+    }
+
+    @Override
+    public boolean addAll(@NotNull Collection c) {
+        return false;
+    }
+
+    @Override
+    public boolean addAll(int index, @NotNull Collection c) {
+        return false;
+    }
+
+    @Override
+    public void clear() {
+
+    }
+
+    @Override
+    public Object get(int index) {
+        return null;
+    }
+
+    @Override
+    public Object set(int index, Object element) {
+        return null;
+    }
+
+    @Override
+    public void add(int index, Object element) {
+
+    }
+
+    @Override
+    public Object remove(int index) {
+        return null;
+    }
+
+    @Override
+    public int indexOf(Object o) {
+        return 0;
+    }
+
+    @Override
+    public int lastIndexOf(Object o) {
+        return 0;
+    }
+
+    @NotNull
+    @Override
+    public ListIterator listIterator() {
+        return null;
+    }
+
+    @NotNull
+    @Override
+    public ListIterator listIterator(int index) {
+        return null;
+    }
+
+    @NotNull
+    @Override
+    public List subList(int fromIndex, int toIndex) {
+        return List.of();
+    }
+
+    @Override
+    public boolean retainAll(@NotNull Collection c) {
+        return false;
+    }
+
+    @Override
+    public boolean removeAll(@NotNull Collection c) {
+        return false;
+    }
+
+    @Override
+    public boolean containsAll(@NotNull Collection c) {
+        return false;
+    }
+
+    @NotNull
+    @Override
+    public Object[] toArray(@NotNull Object[] a) {
+        return new Object[0];
+    }
+
+
+    public static boolean hasDuplicates(List<?> list) {
+        return list.stream().distinct().count() != list.size();
+    }
+
+
+}

+ 32 - 0
tenant/organization/src/main/java/com/jzg/organization/controller/PtlAreaLicenseController.java

@@ -0,0 +1,32 @@
+package com.jzg.organization.controller;
+
+import com.jzg.commons.core.page.HttpResult;
+import com.jzg.commons.entity.po.PtlAreaLicense;
+import com.jzg.organization.service.PtlAreaLicenseService;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+@Tag(name = "地区车牌")
+@RequestMapping("/plt/areaLicense")
+@RestController
+public class PtlAreaLicenseController {
+
+    @Autowired
+    private PtlAreaLicenseService ptlAreaLicenseService;
+
+    @GetMapping("/getAreaLicense")
+    @Operation(summary = "查询地区车牌")
+    public HttpResult<List<PtlAreaLicense>> getAreaLicense(@RequestParam(required = false) String parentNumber) {
+        List<PtlAreaLicense> ptlAreaLicenses = ptlAreaLicenseService.getByParentNumber(parentNumber);
+        return HttpResult.ok(ptlAreaLicenses);
+    }
+
+
+}

+ 9 - 0
tenant/organization/src/main/java/com/jzg/organization/mapper/PtlAreaLicenseMapper.java

@@ -0,0 +1,9 @@
+package com.jzg.organization.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.jzg.commons.entity.po.PtlAreaLicense;
+import org.apache.ibatis.annotations.Mapper;
+
+@Mapper
+public interface PtlAreaLicenseMapper extends BaseMapper<PtlAreaLicense> {
+}

+ 18 - 0
tenant/organization/src/main/java/com/jzg/organization/service/PtlAreaLicenseService.java

@@ -0,0 +1,18 @@
+package com.jzg.organization.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.jzg.commons.entity.po.PtlAreaLicense;
+
+import java.util.List;
+
+public interface PtlAreaLicenseService extends IService<PtlAreaLicense> {
+
+    /**
+     * 通过父级编号查询地区车牌
+     *
+     * @param parentNumber 父级编号
+     * @return PtlAreaLicense
+     */
+    List<PtlAreaLicense> getByParentNumber(String parentNumber);
+
+}

+ 24 - 0
tenant/organization/src/main/java/com/jzg/organization/service/impl/PtlAreaLicenseServiceImpl.java

@@ -0,0 +1,24 @@
+package com.jzg.organization.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.jzg.commons.entity.po.PtlAreaLicense;
+import com.jzg.commons.util.StringUtils;
+import com.jzg.organization.mapper.PtlAreaLicenseMapper;
+import com.jzg.organization.service.PtlAreaLicenseService;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+@Service
+public class PtlAreaLicenseServiceImpl extends ServiceImpl<PtlAreaLicenseMapper, PtlAreaLicense>
+        implements PtlAreaLicenseService {
+
+
+    @Override
+    public List<PtlAreaLicense> getByParentNumber(String parentNumber) {
+        if (StringUtils.isEmpty(parentNumber)) {
+            parentNumber = "0";
+        }
+        return lambdaQuery().eq(PtlAreaLicense::getParentNumber, parentNumber).list();
+    }
+}