Kaynağa Gözat

电销提交修改

wks 2 yıl önce
ebeveyn
işleme
956c790d9c

+ 4 - 1
src/main/java/com/ydtech/constants/enums/dict/FeeAuditAuditstatus.java

@@ -16,7 +16,10 @@ public enum FeeAuditAuditstatus {
 
     REJECT("2", "驳回", 3, 1),
 
-    TELEMARKETING_AUDIT("4", "电销审核", 5, 1),
+    TELEMARKETING_NOT_SUBMITTED("4", "电销未提交", 6, 1),
+
+    TELEMARKETING_AUDIT("5", "电销未提交", 5, 1),
+
     //轨迹中显示 承保信息
     UNDERWRITING("3", "已承保", 4, 1);
 

+ 18 - 0
src/main/java/com/ydtech/modules/fee/dao/InsFeeTelemarketingMapper.java

@@ -0,0 +1,18 @@
+package com.ydtech.modules.fee.dao;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.ydtech.modules.fee.entity.po.InsFeeTelemarketing;
+
+/**
+* @author Administrator
+* @description 针对表【ins_fee_telemarketing(电销费用扣减比例)】的数据库操作Mapper
+* @createDate 2024-08-28 19:13:00
+* @Entity com.ydtech.modules.fee.entity.po.InsFeeTelemarketing
+*/
+public interface InsFeeTelemarketingMapper extends BaseMapper<InsFeeTelemarketing> {
+
+}
+
+
+
+

+ 130 - 0
src/main/java/com/ydtech/modules/fee/entity/po/InsFeeTelemarketing.java

@@ -0,0 +1,130 @@
+package com.ydtech.modules.fee.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 java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.Date;
+
+import com.ydtech.modules.base.controller.BaseController;
+import com.ydtech.modules.order.entity.vo.SubmitExportFeesVo;
+import lombok.Data;
+
+/**
+ * 电销费用扣减比例
+ *
+ * @TableName ins_fee_telemarketing
+ */
+@TableName(value = "ins_fee_telemarketing")
+@Data
+public class InsFeeTelemarketing implements Serializable {
+    /**
+     * 主键
+     */
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    /**
+     * 子订单id
+     */
+    @TableField(value = "sub_order_no")
+    private String subOrderNo;
+
+    /**
+     * 交强扣减比例
+     */
+    @TableField(value = "jq_export_proportion")
+    private BigDecimal jqExportProportion;
+
+    /**
+     * 商业扣减比例
+     */
+    @TableField(value = "sy_export_proportion")
+    private BigDecimal syExportProportion;
+
+    /**
+     * 非车扣减比例
+     */
+    @TableField(value = "no_car_export_proportion")
+    private BigDecimal noCarExportProportion;
+
+    /**
+     * 创建用户
+     */
+    @TableField(value = "create_user")
+    private String createUser;
+
+    /**
+     * 创建时间
+     */
+    @TableField(value = "create_time")
+    private Date createTime;
+
+    @TableField(exist = false)
+    private static final long serialVersionUID = 1L;
+
+    public InsFeeTelemarketing(SubmitExportFeesVo submitExportFeesVo) {
+        this.subOrderNo = submitExportFeesVo.getSubOrderNo();
+        this.jqExportProportion = submitExportFeesVo.getJqExportProportion();
+        this.syExportProportion = submitExportFeesVo.getSyExportProportion();
+        this.noCarExportProportion = submitExportFeesVo.getNoCarExportProportion();
+        this.createTime = new Date();
+        this.createUser = BaseController.getUserId();
+    }
+
+    @Override
+    public boolean equals(Object that) {
+        if (this == that) {
+            return true;
+        }
+        if (that == null) {
+            return false;
+        }
+        if (getClass() != that.getClass()) {
+            return false;
+        }
+        InsFeeTelemarketing other = (InsFeeTelemarketing) that;
+        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
+                && (this.getSubOrderNo() == null ? other.getSubOrderNo() == null : this.getSubOrderNo().equals(other.getSubOrderNo()))
+                && (this.getJqExportProportion() == null ? other.getJqExportProportion() == null : this.getJqExportProportion().equals(other.getJqExportProportion()))
+                && (this.getSyExportProportion() == null ? other.getSyExportProportion() == null : this.getSyExportProportion().equals(other.getSyExportProportion()))
+                && (this.getNoCarExportProportion() == null ? other.getNoCarExportProportion() == null : this.getNoCarExportProportion().equals(other.getNoCarExportProportion()))
+                && (this.getCreateUser() == null ? other.getCreateUser() == null : this.getCreateUser().equals(other.getCreateUser()))
+                && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()));
+    }
+
+    @Override
+    public int hashCode() {
+        final int prime = 31;
+        int result = 1;
+        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
+        result = prime * result + ((getSubOrderNo() == null) ? 0 : getSubOrderNo().hashCode());
+        result = prime * result + ((getJqExportProportion() == null) ? 0 : getJqExportProportion().hashCode());
+        result = prime * result + ((getSyExportProportion() == null) ? 0 : getSyExportProportion().hashCode());
+        result = prime * result + ((getNoCarExportProportion() == null) ? 0 : getNoCarExportProportion().hashCode());
+        result = prime * result + ((getCreateUser() == null) ? 0 : getCreateUser().hashCode());
+        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
+        return result;
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder sb = new StringBuilder();
+        sb.append(getClass().getSimpleName());
+        sb.append(" [");
+        sb.append("Hash = ").append(hashCode());
+        sb.append(", id=").append(id);
+        sb.append(", subOrderNo=").append(subOrderNo);
+        sb.append(", jqExportProportion=").append(jqExportProportion);
+        sb.append(", syExportProportion=").append(syExportProportion);
+        sb.append(", noCarExportProportion=").append(noCarExportProportion);
+        sb.append(", createUser=").append(createUser);
+        sb.append(", createTime=").append(createTime);
+        sb.append(", serialVersionUID=").append(serialVersionUID);
+        sb.append("]");
+        return sb.toString();
+    }
+}

+ 13 - 0
src/main/java/com/ydtech/modules/fee/service/InsFeeTelemarketingService.java

@@ -0,0 +1,13 @@
+package com.ydtech.modules.fee.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.ydtech.modules.fee.entity.po.InsFeeTelemarketing;
+
+/**
+* @author Administrator
+* @description 针对表【ins_fee_telemarketing(电销费用扣减比例)】的数据库操作Service
+* @createDate 2024-08-28 19:13:00
+*/
+public interface InsFeeTelemarketingService extends IService<InsFeeTelemarketing> {
+
+}

+ 22 - 0
src/main/java/com/ydtech/modules/fee/service/impl/InsFeeTelemarketingServiceImpl.java

@@ -0,0 +1,22 @@
+package com.ydtech.modules.fee.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.ydtech.modules.fee.dao.InsFeeTelemarketingMapper;
+import com.ydtech.modules.fee.entity.po.InsFeeTelemarketing;
+import com.ydtech.modules.fee.service.InsFeeTelemarketingService;
+import org.springframework.stereotype.Service;
+
+/**
+* @author Administrator
+* @description 针对表【ins_fee_telemarketing(电销费用扣减比例)】的数据库操作Service实现
+* @createDate 2024-08-28 19:13:00
+*/
+@Service
+public class InsFeeTelemarketingServiceImpl extends ServiceImpl<InsFeeTelemarketingMapper, InsFeeTelemarketing>
+    implements InsFeeTelemarketingService {
+
+}
+
+
+
+

+ 2 - 0
src/main/java/com/ydtech/modules/order/controller/InsTelemarketingOrderController.java

@@ -38,4 +38,6 @@ public class InsTelemarketingOrderController {
         return HttpResult.ok();
     }
 
+
+
 }

+ 11 - 2
src/main/java/com/ydtech/modules/order/service/impl/InsTelemarketingOrderServiceImpl.java

@@ -2,7 +2,9 @@ package com.ydtech.modules.order.service.impl;
 
 
 import com.ydtech.constants.enums.dict.FeeAuditAuditstatus;
+import com.ydtech.modules.fee.entity.po.InsFeeTelemarketing;
 import com.ydtech.modules.fee.service.FeeRuleSchemeNewService;
+import com.ydtech.modules.fee.service.InsFeeTelemarketingService;
 import com.ydtech.modules.fnc.service.InsFeeAuditService;
 import com.ydtech.modules.order.entity.BasePageResult;
 import com.ydtech.modules.order.entity.InsAreaCompany;
@@ -19,6 +21,7 @@ import com.ydtech.modules.protocols.service.PtlAgreementProductCostsNewService;
 import com.ydtech.utils.BigDecimalUtils;
 import lombok.RequiredArgsConstructor;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
 
 import java.math.BigDecimal;
 
@@ -39,12 +42,15 @@ public class InsTelemarketingOrderServiceImpl implements InsTelemarketingOrderSe
 
     private final InsFeeAuditService insFeeAuditService;
 
+    private final InsFeeTelemarketingService insFeeTelemarketingService;
+
     @Override
     public BasePageResult<TelemarketingAuditOrderDTO> getOrderList(TelemarketingAuditOrderQueryVo telemarketingAuditOrderQueryVo) {
         return insOrdersService.getTelemarketingAudit(telemarketingAuditOrderQueryVo);
     }
 
     @Override
+    @Transactional(rollbackFor = Exception.class)
     public void submitExportFeesVo(SubmitExportFeesVo submitExportFeesVo) {
         InsAreaCompany insAreaCompany = insAreaCompanyService.getByIdIsExist(submitExportFeesVo.getSubOrderNo());
 
@@ -58,6 +64,10 @@ public class InsTelemarketingOrderServiceImpl implements InsTelemarketingOrderSe
                 .eq(PtlAgreementProductCostsNew::getId, insFeeOrderNew.getAgreementId())
                 .one();
 
+        // 保存扣减比例信息
+        InsFeeTelemarketing insFeeTelemarketing = new InsFeeTelemarketing(submitExportFeesVo);
+        insFeeTelemarketingService.save(insFeeTelemarketing);
+
         // 交强一级管理比例
         BigDecimal jqExportRadioLevel1 = BigDecimalUtils.transferToBigDecmail(ptlAgreementProductCostsNew.getJqExportRadioLevel1());
         BigDecimal jq = jqExportRadioLevel1.add(submitExportFeesVo.getJqExportProportion());
@@ -71,12 +81,11 @@ public class InsTelemarketingOrderServiceImpl implements InsTelemarketingOrderSe
         // 非车一级管理比例
         BigDecimal noCarExportRadioLevel1 = BigDecimalUtils.transferToBigDecmail(ptlAgreementProductCostsNew.getNoCarExportRadioLevel1());
         BigDecimal no = noCarExportRadioLevel1.add(submitExportFeesVo.getNoCarExportProportion());
-        ptlAgreementProductCostsNew.setSyExportRadioLevel1(String.valueOf(no));
+        ptlAgreementProductCostsNew.setNoCarExportRadioLevel1(String.valueOf(no));
 
         // 重新计算比例
         feeRuleSchemeNewService.calcCostsExternal(ptlAgreementProductCostsNew, insAreaCompany);
         insFeeAuditService.saveDefaultInsFeeAuditAndHistory(insAreaCompany.getOrderno(), insAreaCompany.getId(), FeeAuditAuditstatus.UNREVICEWED.getCode(), null);
     }
 
-
 }

+ 22 - 0
src/main/resources/mapper/modules/ins/InsFeeTelemarketingMapper.xml

@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.ydtech.modules.fee.dao.InsFeeTelemarketingMapper">
+
+    <resultMap id="BaseResultMap" type="com.ydtech.modules.fee.entity.po.InsFeeTelemarketing">
+            <id property="id" column="id" jdbcType="INTEGER"/>
+            <result property="subOrderNo" column="sub_order_no" jdbcType="VARCHAR"/>
+            <result property="jqExportProportion" column="jq_export_proportion" jdbcType="DECIMAL"/>
+            <result property="syExportProportion" column="sy_export_proportion" jdbcType="DECIMAL"/>
+            <result property="noCarExportProportion" column="no_car_export_proportion" jdbcType="DECIMAL"/>
+            <result property="createUser" column="create_user" jdbcType="VARCHAR"/>
+            <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
+    </resultMap>
+
+    <sql id="Base_Column_List">
+        id,sub_order_no,jq_export_proportion,
+        sy_export_proportion,no_car_export_proportion,create_user,
+        create_time
+    </sql>
+</mapper>