瀏覽代碼

Merge branch 'master' of http://39.101.143.165:8090/785834757/jzg

lipf 2 周之前
父節點
當前提交
4bac83258a

+ 2 - 0
commons/src/main/java/com/jzg/commons/entity/dto/CostExternalPageParam.java

@@ -31,6 +31,8 @@ public class CostExternalPageParam extends PageRequest {
 
     @Schema(description = "有效状态")
     private String validState;
+    @Schema(description = "协议id")
+    private String ptlAgreementId;
 
     @Schema(description = "生效时间")
     private List<String> effectiveTime;

+ 26 - 0
commons/src/main/java/com/jzg/commons/entity/dto/PtlAgreementCostCopyExternalParam.java

@@ -0,0 +1,26 @@
+package com.jzg.commons.entity.dto;
+
+
+import com.jzg.commons.core.base.PageRequest;
+import io.swagger.v3.oas.annotations.media.Schema;
+import jakarta.validation.constraints.NotBlank;
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+@Schema(description = "协议费用复制参数")
+public class PtlAgreementCostCopyExternalParam extends PageRequest {
+
+    @Schema(description = "需要复制的费用id")
+    private List<String> costIds;
+
+    @Schema(description = "需要复制的协议id")
+    private String agreementId;
+
+    @Schema(description = "对接人姓名")
+    private String contactPerson;
+
+    @Schema(description = "对接人手机号")
+    private String contactMobile;
+}

+ 1 - 1
tenant/insurance/quotation-chengtai/src/main/java/com/jzg/quotation/chengtai/api/entity/request/PremiumCalculationRequest.java

@@ -604,7 +604,7 @@ public class PremiumCalculationRequest {
             this.actualValue = actualValue;
             this.loanVehicleFlag = "0";
             this.seatNum = Integer.valueOf(vehicle.getSeat());
-            if (vehicle.getVehicleDisplacement().equals("")) {
+            if (vehicle.getVehicleDisplacement() == null || vehicle.getVehicleDisplacement().equals("") ) {
                 this.displacement = vehicle.getVehicleDisplacement();
             } else {
                 this.displacement = vehicle.getVehicleDisplacement();

+ 5 - 1
tenant/insurance/quotation-yangguang/src/main/java/com/jzg/quotation/yangguang/api/entity/request/YangGuangAccuracyCalculateRequest.java

@@ -742,7 +742,11 @@ public class YangGuangAccuracyCalculateRequest extends YangGuangBaseRequest{
             }
             this.LicenseCategory = carInfoVo.getCarTypeCode();
             this.CarCheckStatus = "2";
-            this.Inputnewenergyflag = carInfoVo.isNewEnergyMark() ? "1" : "0";
+            if (carInfoVo.getLicenseNo().length() == 8) {
+                this.Inputnewenergyflag = "1";
+            } else {
+                this.Inputnewenergyflag = "0";
+            }
             this.FuelType = carInfoVo.getEnergyTypeCode();
             this.SeatCount = carInfoVo.getSeatCount();
         }

+ 11 - 0
tenant/organization/src/main/java/com/jzg/organization/controller/PtlAgreementCostExternalController.java

@@ -118,5 +118,16 @@ public class PtlAgreementCostExternalController {
         return ptlAgreementCostExternalService.auditFailed(costReviewParam);
     }
 
+    @Operation(summary = "批量复制外部费用")
+    @PostMapping("copyCostExternal")
+    public HttpResult copyCostExternal(@RequestBody PtlAgreementCostCopyExternalParam costCopyParam){
+        try{
+            return ptlAgreementCostExternalService.copyCostExternal(costCopyParam);
+
+        }catch (Exception e){
+            return HttpResult.error("批量复制外部费用异常:"+e.getMessage());
+        }
+    }
+
 
 }

+ 1 - 0
tenant/organization/src/main/java/com/jzg/organization/service/PtlAgreementCostExternalService.java

@@ -37,4 +37,5 @@ public interface PtlAgreementCostExternalService extends IService<PtlAgreementCo
 
     HttpResult auditFailed(CostReviewParam costReviewParam);
 
+    HttpResult copyCostExternal(PtlAgreementCostCopyExternalParam costCopyParam);
 }

+ 58 - 2
tenant/organization/src/main/java/com/jzg/organization/service/impl/PtlAgreementCostExternalServiceImpl.java

@@ -2,6 +2,8 @@ package com.jzg.organization.service.impl;
 
 
 import cn.hutool.core.bean.BeanUtil;
+import cn.hutool.core.collection.CollUtil;
+import cn.hutool.core.util.StrUtil;
 import cn.hutool.json.JSONUtil;
 import com.alibaba.nacos.common.utils.CollectionUtils;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
@@ -13,14 +15,15 @@ import com.jzg.commons.core.base.BaseController;
 import com.jzg.commons.core.base.StateResult;
 import com.jzg.commons.core.page.HttpResult;
 import com.jzg.commons.entity.dto.*;
-import com.jzg.commons.entity.po.PtlAgreementCostExternal;
-import com.jzg.commons.entity.po.PtlAgreementCostExternalType;
+import com.jzg.commons.entity.po.*;
 import com.jzg.commons.entity.vo.CostExternalListVo;
 import com.jzg.commons.entity.vo.CostExternalVo;
 import com.jzg.commons.exception.SystemException;
 import com.jzg.commons.util.DateTimeUtils;
 import com.jzg.commons.util.StringUtils;
+import com.jzg.commons.util.idgen.IdGenerate;
 import com.jzg.organization.mapper.PtlAgreementCostExternalMapper;
+import com.jzg.organization.mapper.PtlAgreementCostExternalTypeMapper;
 import com.jzg.organization.service.PtlAgreementCostExternalService;
 import com.jzg.organization.service.PtlAgreementCostExternalTypeService;
 import com.jzg.organization.state.listener.CostStateListener;
@@ -39,6 +42,8 @@ public class PtlAgreementCostExternalServiceImpl extends ServiceImpl<PtlAgreemen
 
     @Resource
     private PtlAgreementCostExternalTypeService ptlAgreementCostExternalTypeService;
+    @Resource
+    private PtlAgreementCostExternalTypeMapper ptlAgreementCostExternalTypeMapper;
 
     @Resource
     private CostStateListener costStateListener;
@@ -260,6 +265,57 @@ public class PtlAgreementCostExternalServiceImpl extends ServiceImpl<PtlAgreemen
         return audit(costReviewParam, false);
     }
 
+    @Override
+    @Transactional
+    public HttpResult copyCostExternal(PtlAgreementCostCopyExternalParam costCopyParam) {
+        // 参数校验:所有参数都不能为空
+        if (costCopyParam == null) {
+            return HttpResult.error("复制参数不能为空");
+        }
+        if (CollUtil.isEmpty(costCopyParam.getCostIds())) {
+            return HttpResult.error("费用ID列表不能为空");
+        }
+        if (StrUtil.isBlank(costCopyParam.getAgreementId())) {
+            return HttpResult.error("协议ID不能为空");
+        }
+        if (StrUtil.isBlank(costCopyParam.getContactPerson())) {
+            return HttpResult.error("对接人姓名不能为空");
+        }
+        if (StrUtil.isBlank(costCopyParam.getContactMobile())) {
+            return HttpResult.error("对接人手机号不能为空");
+        }
+        List<String> costIds = costCopyParam.getCostIds();
+        StringBuilder errMsg = new StringBuilder();
+        costIds.forEach(oldCostId-> {
+            PtlAgreementCostExternal oldCostExternal = baseMapper.selectOne(
+                    new LambdaQueryWrapper<PtlAgreementCostExternal>()
+                            .eq(PtlAgreementCostExternal::getId, oldCostId));
+            if(oldCostExternal != null){
+                List<PtlAgreementCostExternalType> ptlAgreementCostTypes = ptlAgreementCostExternalTypeMapper.selectList(new LambdaQueryWrapper<PtlAgreementCostExternalType>()
+                        .eq(PtlAgreementCostExternalType::getPtlAgreementCostExternalId, oldCostExternal.getId()));
+                // 调整数据 进行copy
+                oldCostExternal.setId(null);
+                oldCostExternal.setPtlAgreementId(Long.valueOf(costCopyParam.getAgreementId()));
+                oldCostExternal.setCostDescribe("复制的费用:" + oldCostExternal.getCostDescribe());
+                oldCostExternal.setCreateTime(LocalDateTime.now());
+                oldCostExternal.setUpdateTime(LocalDateTime.now());
+                oldCostExternal.setContactPerson(costCopyParam.getContactPerson());
+                oldCostExternal.setContactMobile(costCopyParam.getContactMobile());
+                // 复制的费用为待审核
+                oldCostExternal.setAuditStatus(0);
+                baseMapper.insert(oldCostExternal);
+                ptlAgreementCostTypes.forEach(item ->{
+                    item.setId(null);
+                });
+                saveOrUpdate(ptlAgreementCostTypes,oldCostExternal.getId());
+
+            }else{
+                errMsg.append("costId为"+oldCostId+"的费用信息已被删除;");
+            }
+        });
+        return HttpResult.ok(errMsg.toString());
+    }
+
     private HttpResult audit(CostReviewParam costReviewParam, boolean isSuccess) {
         // 批量查询所有记录
         List<PtlAgreementCostExternal> records = baseMapper.selectBatchIds(costReviewParam.getIds());

+ 2 - 1
tenant/organization/src/main/java/com/jzg/organization/service/impl/SysDeptServiceImpl.java

@@ -310,7 +310,8 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> impl
         //获取用户的角色 是否是管理员
         SysUser sysUser = userService.getById(userId);
         SysUserJzgInfo userJzgInfo = sysUserJzgInfoService.getOne(new LambdaQueryWrapper<SysUserJzgInfo>()
-                .eq(SysUserJzgInfo::getUserId, userId));
+                .eq(SysUserJzgInfo::getUserId, userId)
+                .eq(SysUserJzgInfo::getIsDelete, 0));
         List<String> userRoleName = userService.getUserRoleName(userId);
         if(userRoleName.contains("管理员")){
             throw new SystemException("管理员不允许变更机构或删除");

+ 3 - 0
tenant/organization/src/main/resources/mapper/PtlAgreementCostExternalMapper.xml

@@ -170,6 +170,9 @@
             <if test="costParam.productId != null and costParam.productId != ''">
                 AND ce.product_id = #{costParam.productId}
             </if>
+            <if test="costParam.ptlAgreementId != null and costParam.ptlAgreementId != ''">
+                AND ce.ptl_agreement_id = #{costParam.ptlAgreementId}
+            </if>
             <if test="costParam.rulesName != null and costParam.rulesName != ''">
                 AND ce.rule_description  like concat('%',#{costParam.rulesName},'%')
             </if>