Преглед изворни кода

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

hxl13994548489 пре 2 година
родитељ
комит
23600a5511

+ 7 - 7
src/main/java/com/ydtech/modules/admin/service/impl/SysGeographyPositionServiceImpl.java

@@ -59,7 +59,7 @@ public class SysGeographyPositionServiceImpl extends ServiceImpl<SysGeographyPos
                 .eq(StringUtils.isNotEmpty(sysGeographyPositionDto.getDistrict()), SysGeographyPosition::getDistrict, sysGeographyPositionDto.getDistrict())
                 .in(SysGeographyPosition::getSource, Arrays.asList("1", "2"))
                 .eq(StringUtils.isNotEmpty(sysGeographyPositionDto.getSource()), SysGeographyPosition::getSource, sysGeographyPositionDto.getSource())
-                .eq(sysGeographyPositionDto.getSource() != null, SysGeographyPosition::getStatus, sysGeographyPositionDto.getStatus())
+                .eq(sysGeographyPositionDto.getStatus() != null, SysGeographyPosition::getStatus, sysGeographyPositionDto.getStatus())
                 .orderByDesc(SysGeographyPosition::getCreateTime));
         if (list.size() == 0) return new SysGeographyPositionVo();
 
@@ -107,26 +107,26 @@ public class SysGeographyPositionServiceImpl extends ServiceImpl<SysGeographyPos
                 .eq(StringUtils.isNotEmpty(sysGeographyPositionDto.getCity()), SysGeographyPosition::getCity, sysGeographyPositionDto.getCity())
                 .eq(StringUtils.isNotEmpty(sysGeographyPositionDto.getDistrict()), SysGeographyPosition::getDistrict, sysGeographyPositionDto.getDistrict())
                 .in(SysGeographyPosition::getSource, Arrays.asList("1", "2"))
-                .eq(sysGeographyPositionDto.getSource() != null, SysGeographyPosition::getStatus, sysGeographyPositionDto.getStatus()));
+                .eq(sysGeographyPositionDto.getStatus() != null, SysGeographyPosition::getStatus, sysGeographyPositionDto.getStatus()));
         Long channelNum = sysGeographyPositionMapper.selectCount(new LambdaQueryWrapper<SysGeographyPosition>()
                 .eq(StringUtils.isNotEmpty(sysGeographyPositionDto.getProvince()), SysGeographyPosition::getProvince, sysGeographyPositionDto.getProvince())
                 .eq(StringUtils.isNotEmpty(sysGeographyPositionDto.getCity()), SysGeographyPosition::getCity, sysGeographyPositionDto.getCity())
                 .eq(StringUtils.isNotEmpty(sysGeographyPositionDto.getDistrict()), SysGeographyPosition::getDistrict, sysGeographyPositionDto.getDistrict())
                 .eq(SysGeographyPosition::getSource, 1)
-                .eq(sysGeographyPositionDto.getSource() != null, SysGeographyPosition::getStatus, sysGeographyPositionDto.getStatus()));
+                .eq(sysGeographyPositionDto.getStatus() != null, SysGeographyPosition::getStatus, sysGeographyPositionDto.getStatus()));
         Long proxyNum = sysGeographyPositionMapper.selectCount(new LambdaQueryWrapper<SysGeographyPosition>()
                 .eq(StringUtils.isNotEmpty(sysGeographyPositionDto.getProvince()), SysGeographyPosition::getProvince, sysGeographyPositionDto.getProvince())
                 .eq(StringUtils.isNotEmpty(sysGeographyPositionDto.getCity()), SysGeographyPosition::getCity, sysGeographyPositionDto.getCity())
                 .eq(StringUtils.isNotEmpty(sysGeographyPositionDto.getDistrict()), SysGeographyPosition::getDistrict, sysGeographyPositionDto.getDistrict())
                 .eq(SysGeographyPosition::getSource, 2)
-                .eq(sysGeographyPositionDto.getSource() != null, SysGeographyPosition::getStatus, sysGeographyPositionDto.getStatus()));
+                .eq(sysGeographyPositionDto.getStatus() != null, SysGeographyPosition::getStatus, sysGeographyPositionDto.getStatus()));
         Long onlineNum = sysGeographyPositionMapper.selectCount(new LambdaQueryWrapper<SysGeographyPosition>()
                 .eq(StringUtils.isNotEmpty(sysGeographyPositionDto.getProvince()), SysGeographyPosition::getProvince, sysGeographyPositionDto.getProvince())
                 .eq(StringUtils.isNotEmpty(sysGeographyPositionDto.getCity()), SysGeographyPosition::getCity, sysGeographyPositionDto.getCity())
                 .eq(StringUtils.isNotEmpty(sysGeographyPositionDto.getDistrict()), SysGeographyPosition::getDistrict, sysGeographyPositionDto.getDistrict())
                 .in(SysGeographyPosition::getSource, Arrays.asList("1", "2"))
-                .eq(sysGeographyPositionDto.getSource() == null, SysGeographyPosition::getStatus, 1)
-                .eq(sysGeographyPositionDto.getSource() != null, SysGeographyPosition::getStatus, sysGeographyPositionDto.getStatus()));
+                .eq(sysGeographyPositionDto.getStatus() == null, SysGeographyPosition::getStatus, 1)
+                .eq(sysGeographyPositionDto.getStatus() != null, SysGeographyPosition::getStatus, sysGeographyPositionDto.getStatus()));
         sysPcAddressNumVo.setAllNum(all);
         sysPcAddressNumVo.setProxyNum(proxyNum);
         sysPcAddressNumVo.setChannelNum(channelNum);
@@ -146,7 +146,7 @@ public class SysGeographyPositionServiceImpl extends ServiceImpl<SysGeographyPos
                 .eq(StringUtils.isNotEmpty(sysGeographyPositionDto.getDistrict()), SysGeographyPosition::getDistrict, sysGeographyPositionDto.getDistrict())
                 .in(SysGeographyPosition::getSource, Arrays.asList("1", "2"))
                 .eq(StringUtils.isNotEmpty(sysGeographyPositionDto.getSource()), SysGeographyPosition::getSource, sysGeographyPositionDto.getSource())
-                .eq(sysGeographyPositionDto.getSource() != null, SysGeographyPosition::getStatus, sysGeographyPositionDto.getStatus()));
+                .eq(sysGeographyPositionDto.getStatus() != null, SysGeographyPosition::getStatus, sysGeographyPositionDto.getStatus()));
 
         if (CollectionUtil.isEmpty(sysGeographyPositionList)) return regionInfoVos;
 

+ 3 - 2
src/main/java/com/ydtech/modules/fee/service/impl/FeeRuleSchemeServiceNewImpl.java

@@ -33,6 +33,7 @@ import com.ydtech.modules.protocol.service.PtlNewCarJudgeRulesService;
 import com.ydtech.modules.protocols.entity.po.*;
 import com.ydtech.modules.protocols.entity.vo.AgreementProductCosts;
 import com.ydtech.modules.protocols.service.*;
+import com.ydtech.utils.BigDecimalUtils;
 import com.ydtech.utils.idgen.IdGenerate;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -294,7 +295,7 @@ public class FeeRuleSchemeServiceNewImpl implements FeeRuleSchemeNewService {
         //查找入口与出口费用比例
         //入口配置
         PtlAgreementProductCostsNew ptlAgreementProductCostsNew = ptlAgreementProductCostsNewService.getById(costsId);
-
+        ptlAgreementProductCostsNew.blank();
         //出口配置
         PtlAgreementProductCostsExport ptlAgreementProductCostsExport =
                 ptlAgreementProductCostsExportService.getOne(new LambdaQueryWrapper<PtlAgreementProductCostsExport>().eq(PtlAgreementProductCostsExport::getCostsId, costsId));
@@ -340,7 +341,7 @@ public class FeeRuleSchemeServiceNewImpl implements FeeRuleSchemeNewService {
 
         //商业入口信息
         FeeOrderNewVo.EntranceFee syEntranceFee = feeRuleSchemeService.calcEntranceFee(insFeeOrderNew.getSyPremium(),
-                new BigDecimal(ptlAgreementProductCostsNew.getSyCarCostsProportion()),
+                new BigDecimal(ptlAgreementProductCostsNew.getSyCarCostsProportion()) ,
                 new BigDecimal(ptlAgreementProductCostsNew.getSyCarOtherCostsProportion()), taxRadio);
         insFeeOrderNew.setSyCostsProportion(syEntranceFee.getTotalProportion());
         insFeeOrderNew.setSySuperviseCostsProportion(syEntranceFee.getSuperviseCosts());

+ 9 - 1
src/main/java/com/ydtech/modules/order/controller/CarModelController.java

@@ -1,10 +1,13 @@
 package com.ydtech.modules.order.controller;
 
+import com.alibaba.fastjson.JSONObject;
 import com.ydtech.core.page.HttpResult;
 import com.ydtech.modules.ins.model.ya.CarModelDTO;
 import com.ydtech.modules.order.service.CarModelService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
+import okhttp3.Request;
+import org.apache.http.client.methods.HttpPost;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestParam;
@@ -34,5 +37,10 @@ public class  CarModelController {
         return HttpResult.ok(carModelDTOS);
     }
 
-
+    @GetMapping("/licenseSearch")
+    @ApiOperation("车牌查询")
+    public HttpResult licenseSearch(@RequestParam String licenseNo){
+        JSONObject jsonObject = carModelService.licenseSearch(licenseNo);
+        return HttpResult.ok(jsonObject);
+    }
 }

+ 2 - 0
src/main/java/com/ydtech/modules/order/service/CarModelService.java

@@ -1,5 +1,6 @@
 package com.ydtech.modules.order.service;
 
+import com.alibaba.fastjson.JSONObject;
 import com.ydtech.modules.ins.model.ya.CarModelDTO;
 
 import java.util.List;
@@ -8,4 +9,5 @@ public interface CarModelService {
 
     List<CarModelDTO> vinSearch(String frameNo);
 
+    JSONObject licenseSearch(String licenseNo);
 }

+ 37 - 0
src/main/java/com/ydtech/modules/order/service/impl/CarModelServiceImpl.java

@@ -1,6 +1,10 @@
 package com.ydtech.modules.order.service.impl;
 
+import com.alibaba.druid.util.HttpClientUtils;
 import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import com.pingan.iobs.sdk.repkg.org.apache.http.HttpEntity;
+import com.pingan.iobs.sdk.repkg.org.apache.http.entity.StringEntity;
 import com.ydtech.modules.ins.model.ya.CarModelDTO;
 import com.ydtech.modules.order.components.vehicle.QueryVehicleComponents;
 import com.ydtech.modules.order.service.CarModelService;
@@ -8,9 +12,15 @@ import com.ydtech.modules.order.service.InsOrdersService;
 import com.ydtech.modules.order.service.YongAnOrderService;
 import com.ydtech.modules.order.service.ZhongMeiOrderService;
 import lombok.RequiredArgsConstructor;
+import okhttp3.*;
+import org.apache.http.client.HttpClient;
+import org.apache.http.client.methods.HttpPost;
+import org.apache.http.impl.client.DefaultHttpClient;
 import org.springframework.data.redis.core.StringRedisTemplate;
 import org.springframework.stereotype.Service;
 
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
 import java.util.Collections;
 import java.util.List;
 import java.util.Objects;
@@ -70,4 +80,31 @@ public class CarModelServiceImpl implements CarModelService {
         return Collections.emptyList();
     }
 
+    @Override
+    public JSONObject licenseSearch(String licenseNo) {
+        String requestUrl = "http://47.92.254.66:8088/lsearch/1";
+        JSONObject params = new JSONObject();
+        params.put("license",licenseNo);
+        OkHttpClient client = new OkHttpClient().newBuilder()
+                .build();
+        MediaType mediaType = MediaType.parse("application/json");
+        RequestBody body = RequestBody.create(mediaType, params.toString());
+        Request request = new Request.Builder()
+                .url(requestUrl)
+                .method("POST", body)
+                .build();
+        try {
+            Response response = client.newCall(request).execute();
+            if(response.isSuccessful()){
+                String responseBody = response.body().string();
+                JSONObject jsonResponse = JSONObject.parseObject(responseBody);
+                return jsonResponse;
+            }
+        } catch (IOException e) {
+            throw new RuntimeException(e);
+        }
+        return null;
+
+    }
+
 }

+ 6 - 0
src/main/java/com/ydtech/modules/protocol/controller/PtlAgreementController.java

@@ -236,4 +236,10 @@ public class PtlAgreementController extends BaseController {
         return HttpResult.ok(list);
     }
 
+    @PostMapping("/agreementCopy")
+    @ApiOperation("协议复制")
+    public HttpResult getAgreementCopy(@RequestBody PtlAgreementVo ptlAgreementVo) {
+        return ptlAgreementService.getAgreementCopy(ptlAgreementVo);
+    }
+
 }

+ 269 - 0
src/main/java/com/ydtech/modules/protocol/entity/vo/PtlAgreementVo.java

@@ -0,0 +1,269 @@
+package com.ydtech.modules.protocol.entity.vo;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import com.ydtech.modules.protocol.utils.AssertionUtils;
+import com.ydtech.utils.StringUtils;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
+
+@Data
+@ApiModel("协议")
+public class PtlAgreementVo {
+    /**
+     * 主键/自增
+     */
+    @TableId(value = "id", type = IdType.AUTO)
+    private String id;
+
+    /**
+     * 供应商类型
+     * 1 渠道
+     * 2 财险
+     * 3 寿险
+     */
+    @TableField(value = "companies_type")
+    private String companiesType;
+
+    /**
+     * 协议类型
+     * 1  平台协议-平台结算
+     * 2  私有协议-自行结算
+     * 3  网销协议-自行结算
+     */
+    @TableField(value = "agreement_type")
+    private String agreementType;
+
+    /**
+     * 协议代码
+     */
+    @TableField(value = "agreement_code")
+    private String agreementCode;
+
+    /**
+     * 协议描述
+     */
+    @TableField(value = "agreement_name")
+    private String agreementName;
+
+    /**
+     * 协议名称
+     */
+    @TableField(value = "agreement_title")
+    private String agreementTitle;
+
+    /**
+     * 承保描述
+     */
+    @TableField(value = "underwriting_description")
+    private String underwritingDescription;
+
+    /**
+     * 协议简称
+     */
+    @TableField(value = "agreement_abbreviation")
+    private String agreementAbbreviation;
+
+    /**
+     * 合作公司 id
+     */
+    @TableField(value = "partner_companies_id")
+    private String partnerCompaniesId;
+
+    /**
+     * 内部机构 id
+     */
+    @TableField(value = "dept_id")
+    private String deptId;
+
+    /**
+     * 保险公司id
+     */
+    @TableField(value = "association_companies_id")
+    private String associationCompaniesId;
+
+    /**
+     * 关联-保险公司
+     */
+    @TableField(value = "insurance_company")
+    private String insuranceCompany;
+
+    /**
+     * 关联-保险公司id
+     */
+    @TableField(value = "insurance_company_id")
+    private String insuranceCompanyId;
+
+    /**
+     * 协议起期
+     */
+    @TableField(value = "start_date")
+    private LocalDate startDate;
+
+    /**
+     * 协议止期
+     */
+    @TableField(value = "end_date")
+    private LocalDate endDate;
+
+    /**
+     * 结算周期
+     */
+    @TableField(value = "money_time")
+    private Integer moneyTime;
+
+    /**
+     * 保单匹配协议日期类型(保单日期类型)
+     */
+    @TableField(value = "match_type")
+    private String matchType;
+
+    /**
+     * 对接人
+     */
+    @TableField(value = "docking_person")
+    private String dockingPerson;
+
+    /**
+     * 联系方式(对接人)
+     */
+    @TableField(value = "docking_phone")
+    private String dockingPhone;
+
+    /**
+     * 含增值税结算
+     */
+    @TableField(value = "with_tax")
+    private String withTax;
+
+    /**
+     * 佣金发放方式
+     */
+    @TableField(value = "money_type")
+    private String moneyType;
+
+    /**
+     * 有效状态
+     */
+    @TableField(value = "valid_status")
+    private String validStatus;
+
+    /**
+     * 附件id
+     */
+    @TableField(value = "file_id")
+    private String fileId;
+
+    /**
+     * 审核内容
+     */
+    @TableField(value = "audit_content")
+    private String auditContent;
+
+    /**
+     * 审核状态 0 申请审核 1 审核通过 2 审核不通过
+     */
+    @TableField(value = "audit_status")
+    private Integer auditStatus;
+
+    /**
+     * 产品类型
+     */
+    @TableField(value = "products_code")
+    private String productsCode;
+
+    /**
+     * 序号
+     */
+    @ApiModelProperty("serial_number")
+    private Integer serialNumber;
+
+    /**
+     * 创建者
+     */
+    @TableField(value = "creator")
+    private String creator;
+
+    /**
+     * 创建时间
+     */
+    @TableField(value = "create_time")
+    private LocalDateTime createTime;
+
+    /**
+     * 修改人
+     */
+    @TableField(value = "modified_by")
+    private String modifiedBy;
+
+
+    /**
+     * 修改人
+     */
+    @TableField(value = "modified_name")
+    private String modifiedName;
+
+    /**
+     * 修改时间
+     */
+    @TableField(value = "update_time")
+    private LocalDateTime updateTime;
+
+    /**
+     * 是否是外部订单费用
+     */
+    @TableField(value = "is_external")
+    private Integer isExternal;
+
+    /**
+     * 审核类型
+     */
+    @TableField(value = "audit_type")
+    private Integer auditType;
+
+    /**
+     * 业务描述
+     */
+    @TableField(value = "business_description")
+    private String businessDescription;
+
+    /**
+     * 工号描述
+     */
+    @TableField(value = "job_description")
+    private String jobDescription;
+
+    @TableField(exist = false)
+    private static final long serialVersionUID = 1L;
+
+    /***
+     * 添加是否回显的标志
+     */
+    @TableField(exist = false)
+    private String flag;
+
+    /***
+     * 保险公司名称
+     */
+    @TableField(exist = false)
+    private String partnerCompaniesName;
+
+    /**
+     * 逻辑删除
+     */
+    @TableLogic
+    private Integer deleted;
+
+    public void generateTheProtocolCode() {
+        AssertionUtils.isFail(StringUtils.isNullOrEmpty(this.getPartnerCompaniesId()), "请检查合作保险公司是否选择");
+        String string = LocalDate.now().format(DateTimeFormatter.BASIC_ISO_DATE);
+        this.agreementCode = this.getPartnerCompaniesId() + string;
+    }
+}

+ 4 - 0
src/main/java/com/ydtech/modules/protocol/service/PtlAgreementService.java

@@ -272,4 +272,8 @@ public interface PtlAgreementService extends IService<PtlAgreement> {
      */
     List<PtlAgreement> getAllAgreement(String agreementId);
 
+    HttpResult getAgreementCopy(PtlAgreementVo ptlAgreementVo);
+
+
+
 }

+ 56 - 1
src/main/java/com/ydtech/modules/protocol/service/impl/PtlAgreementServiceImpl.java

@@ -3,6 +3,7 @@ package com.ydtech.modules.protocol.service.impl;
 import cn.hutool.core.date.DateUtil;
 import com.alibaba.fastjson.JSONArray;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.ydtech.config.DictEnumConfig;
@@ -205,7 +206,21 @@ public class PtlAgreementServiceImpl extends ServiceImpl<PtlAgreementMapper, Ptl
         ptlAgreement.setProductsCode(agreementSaveDto.getProductsCode());
         ptlAgreement.setCreator(userName);
         ptlAgreement.setCreateTime(LocalDateTime.now());
+        ptlAgreement.setDeleted(0);
         save(ptlAgreement);
+        // 新增协议后按序号重新排序
+        List<PtlAgreement> updateList = new ArrayList<>();
+        List<PtlAgreement> list = ptlAgreementMapper.selectList(new QueryWrapper<PtlAgreement>()
+                .ge("serial_number", ptlAgreement.getSerialNumber())
+                .ne("id", ptlAgreement.getId()));
+        if (list != null && !list.isEmpty()) {
+            int newSerialNumber = ptlAgreement.getSerialNumber();
+            for (PtlAgreement ptlAgreement1 : list) {
+                ptlAgreement1.setSerialNumber(++newSerialNumber);
+                updateList.add(ptlAgreement1);
+            }
+            proxyObject.updateBatchById(updateList);
+        }
         // 提交  账号信息 授权部门
         proxyObject.saveAssociationInformation(ptlAgreement.getId(), esmInsCompany, agreement);
         // 添加 历史记录表
@@ -580,11 +595,27 @@ public class PtlAgreementServiceImpl extends ServiceImpl<PtlAgreementMapper, Ptl
     @Override
     @Transactional
     public HttpResult<Object> deleteAgreement(String agreementId, String userName) {
-        proxyObject.ifExistsById(agreementId);
+        PtlAgreement ptlAgreement = proxyObject.ifExistsById(agreementId);
         HttpResult<PtlAgreementQueryVo> byAgreementId = getByAgreementId(agreementId);
 
         boolean b = removeById(agreementId);
         AssertionUtils.isSucceed(b, "协议信息删除失败");
+        // 删除协议后按序号重新排序
+        List<PtlAgreement> updateList = new ArrayList<>();
+        List<PtlAgreement> list = ptlAgreementMapper.selectList(new QueryWrapper<PtlAgreement>()
+                .ge("serial_number", ptlAgreement.getSerialNumber())
+                .ne("id", agreementId));
+        if (list != null && !list.isEmpty()) {
+            int newSerialNumber = ptlAgreement.getSerialNumber(); // 被删除协议的序列号
+            for (PtlAgreement ptlAgreement1 : list) {
+                // 对于每一个协议,如果其序列号大于等于被删除协议的序列号,则递增
+                if (ptlAgreement1.getSerialNumber() >= ptlAgreement.getSerialNumber()) {
+                    ptlAgreement1.setSerialNumber(newSerialNumber++);
+                }
+                updateList.add(ptlAgreement1);
+            }
+            proxyObject.updateBatchById(updateList);
+        }
         // 关联表删除
         proxyObject.deleteAssociationInformation(agreementId);
         // 添加 历史记录表
@@ -638,6 +669,19 @@ public class PtlAgreementServiceImpl extends ServiceImpl<PtlAgreementMapper, Ptl
         ptlAgreement.setUpdateTime(LocalDateTime.now());
         //add by hxl  2024-06-12 修改协议改为可以更新null的判断
         boolean b = ptlAgreementMapper.updateWithNull(ptlAgreement);
+
+        List<PtlAgreement> updateList = new ArrayList<>();
+        List<PtlAgreement> list = ptlAgreementMapper.selectList(new QueryWrapper<PtlAgreement>()
+                        .ge("serial_number", ptlAgreement.getSerialNumber())
+                        .ne("id", agreementId));
+        if (list != null && list.size() > 0) {
+            int newSerialNumber = ptlAgreement.getSerialNumber();
+            for (PtlAgreement ptlAgreement1 : list) {
+                ptlAgreement1.setSerialNumber(++newSerialNumber);
+                updateList.add(ptlAgreement1);
+            }
+            proxyObject.updateBatchById(updateList);
+        }
         // 修改协议
         //boolean b = updateById(ptlAgreement);
         AssertionUtils.isSucceed(b, "协议信息修改失败");
@@ -910,4 +954,15 @@ public class PtlAgreementServiceImpl extends ServiceImpl<PtlAgreementMapper, Ptl
                 .eq(PtlAgreement::getInsuranceCompanyId, ptlAgreement.getInsuranceCompanyId()));
     }
 
+    @Override
+    public HttpResult getAgreementCopy(PtlAgreementVo ptlAgreementVo) {
+        PtlAgreement ptlAgreement = baseMapper.selectById(ptlAgreementVo.getId());
+        PtlAgreement newPtlAgreement = new PtlAgreement();
+        BeanUtils.copyProperties(ptlAgreement, newPtlAgreement,"id","agreementCode");
+        newPtlAgreement.setPartnerCompaniesId(ptlAgreement.getPartnerCompaniesId());
+        newPtlAgreement.generateTheProtocolCode();
+        save(newPtlAgreement);
+        return HttpResult.ok("协议复制成功");
+    }
+
 }

+ 11 - 0
src/main/java/com/ydtech/modules/protocols/entity/po/PtlAgreementProductCostsNew.java

@@ -260,6 +260,17 @@ public class PtlAgreementProductCostsNew {
             this.noCarOtherCostsProportion = "0";
         }
 
+        if (this.jqCostsExportProportion == null || this.jqCostsExportProportion.equals("")) {
+            this.jqCostsExportProportion = "0";
+        }
+        if (this.syCostsExportProportion == null || this.syCostsExportProportion.equals("")) {
+            this.syCostsExportProportion = "0";
+        }
+        if (this.noCostsExportProportion == null || this.noCostsExportProportion.equals("")) {
+            this.noCostsExportProportion = "0";
+        }
+
+
     }
 
 }

+ 27 - 0
src/main/java/com/ydtech/modules/protocols/entity/vo/AgreementProductCosts.java

@@ -161,4 +161,31 @@ public class AgreementProductCosts implements Serializable {
     public PtlAgreementProductCostsAttrLink getAttrLinkByCode(String code) {
         return this.getCostsAttrLinks().stream().filter(attrLink -> code.equals(attrLink.getAttrCode())).findFirst().orElse(null);
     }
+
+    /**
+     * 清空商业比例信息
+     */
+    public void clearSyInfo(){
+        this.setSyCostsProportion("");
+        this.setSyCarCostsProportion("");
+        this.setSyCarOtherCostsProportion("");
+        this.setSyExportRadioLevel1(null);
+        this.setSyExportRadioLevel2(null);
+        this.setSyExportRadioLevel3(null);
+        this.setSyExportRadioLevel4(null);
+        this.setSyExportRadioLevel5(null);
+        this.setSyCostsExportProportion("");
+    }
+
+    public void clearJqInfo(){
+        this.setJqCostsProportion("");
+        this.setJqCarCostsProportion("");
+        this.setJqCarOtherCostsProportion("");
+        this.setJqExportRadioLevel1(null);
+        this.setJqExportRadioLevel2(null);
+        this.setJqExportRadioLevel3(null);
+        this.setJqExportRadioLevel4(null);
+        this.setJqExportRadioLevel5(null);
+        this.setJqCostsExportProportion("");
+    }
 }

+ 9 - 0
src/main/java/com/ydtech/modules/protocols/service/impl/PtlAgreementProductCostsNewServiceImpl.java

@@ -712,6 +712,15 @@ public class PtlAgreementProductCostsNewServiceImpl extends ServiceImpl<PtlAgree
 //                }
 //            }
 //        }
+        //单交
+        if(agreementProductCosts.getProductId().get(0).equals(ProductsType.PT_0330.getCode())){
+            //清空商业险信息
+            agreementProductCosts.clearSyInfo();
+        }else if(agreementProductCosts.getProductId().get(0).equals(ProductsType.PT_034001.getCode()) ||
+                agreementProductCosts.getProductId().get(0).equals(ProductsType.PT_034002.getCode())){
+            //清空交强险信息
+            agreementProductCosts.clearJqInfo();
+        }
 
         //更新费用主表信息
         PtlAgreementProductCostsNew ptlAgreementProductCostsNew = new PtlAgreementProductCostsNew();