Jelajahi Sumber

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

wks 1 tahun lalu
induk
melakukan
31a0383631

+ 12 - 0
src/main/java/com/ydtech/modules/admin/controller/SysUserController.java

@@ -1053,4 +1053,16 @@ public class SysUserController extends BaseController {
         return sysUserService.selectForAgentsAndChannelsPage(agentsAndChannelsDto);
     }
 
+    /**
+     *  @version
+     *  @author: hxl
+     *  @Date: 2024/9/24 17:37
+     *  @Description: 电销管理人数据列表
+     */
+    @ApiOperation(value = "电销管理人数据列表")
+    @GetMapping(value = "/findDxUserList")
+    public HttpResult findDxUserList() {
+        return HttpResult.ok(sysUserService.findDxUserList());
+    }
+
 }

+ 8 - 0
src/main/java/com/ydtech/modules/admin/dao/SysUserMapper.java

@@ -467,6 +467,14 @@ public interface SysUserMapper extends BaseMapper<SysUser> {
 
     List<SysUser> getAllAgent(String pid ,  List<String>  ids);
 
+    /**
+     *  @version
+     *  @author: hxl
+     *  @Date: 2024/9/24 17:35
+     *  @Description:  查询电销的管理人列表
+     */
+    List<SysUser> findDxUserList();
+
 }
 
 

+ 8 - 0
src/main/java/com/ydtech/modules/admin/model/SysUser.java

@@ -217,6 +217,14 @@ public class SysUser extends BaseEntity {
     @TableField(exist = false)
     private List<SysUser> children;
 
+    @TableField(value = "manager_id")
+    @ApiModelProperty("电销管理人")
+    private String managerId;
+
+    @TableField(value = "manager_name")
+    @ApiModelProperty("电销管理人名称")
+    private String managerName;
+
     /**
      * 验证用户
      *

+ 8 - 0
src/main/java/com/ydtech/modules/admin/service/SysUserService.java

@@ -255,6 +255,14 @@ public interface SysUserService extends BaseIService<SysUser> {
      * @return
      */
     List<SysUser> findNextAgentTree(String pid);
+
+    /**
+     *  @version
+     *  @author: hxl
+     *  @Date: 2024/9/24 17:35
+     *  @Description:  查询电销的管理人列表
+     */
+    List<SysUser> findDxUserList();
 }
 
 

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

@@ -220,6 +220,7 @@ public class SysGeographyPositionServiceImpl extends ServiceImpl<SysGeographyPos
         //填充机构名
         for (SysGeographyPositionInfoVo sysGeographyPositionInfoVo : sysGeographyPositionList) {
             SysUser sysUser = sysUserService.getById(sysGeographyPositionInfoVo.getId());
+            sysGeographyPositionInfoVo.setLeaderName(sysUser.getLeaderName());
             if (sysUser == null) continue;
             SysDept sysDept = sysDeptMapper.selectOne(new LambdaQueryWrapper<SysDept>()
                     .eq(SysDept::getId, sysUser.getDeptId()).eq(SysDept::getDelFlag, 0));

+ 2 - 6
src/main/java/com/ydtech/modules/admin/service/impl/SysPartnerServiceImpl.java

@@ -16,7 +16,6 @@ import com.ydtech.modules.admin.model.dto.SysPartnerAPPPageDto;
 import com.ydtech.modules.admin.model.dto.SysPartnerDto;
 import com.ydtech.modules.admin.model.dto.SysPartnerPageDto;
 import com.ydtech.modules.admin.model.vo.AgencyExtractFeeVo;
-import com.ydtech.modules.admin.model.vo.SysAgencyLeaderVo;
 import com.ydtech.modules.admin.model.vo.SysPartnerAPPPageVo;
 import com.ydtech.modules.admin.model.vo.SysUserPartner;
 import com.ydtech.modules.admin.service.SysAgencyLeaderService;
@@ -41,7 +40,6 @@ import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
 import java.util.stream.Collectors;
-import java.util.stream.Stream;
 
 /**
  * 配置机构合伙人表(SysPartner)表服务实现类
@@ -437,10 +435,8 @@ public class SysPartnerServiceImpl extends ServiceImpl<SysPartnerMapper, SysPart
                             String dateStr = "";
                             if (updateTime != null) {
                                 dateStr = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(updateTime);
-                                agencyExtractFee.setStartTime(updateTime);
                             } else {
                                 dateStr = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(createTime);
-                                agencyExtractFee.setStartTime(createTime);
                             }
                             HashMap<String, BigDecimal> map = sysAgencyLeaderMapper.getBigDecimalNum(sysAgencyLeaders.getDeptId(), dateStr,null,null);
                             if (CollectionUtil.isNotEmpty(map)) {
@@ -597,10 +593,10 @@ public class SysPartnerServiceImpl extends ServiceImpl<SysPartnerMapper, SysPart
                                     String dateStr = "";
                                     if (updateTime != null) {
                                         dateStr = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(updateTime);
-                                        sysPartnerAPPPageVo.setStartTime(updateTime);
+//                                        sysPartnerAPPPageVo.setStartTime(updateTime);
                                     } else {
                                         dateStr = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(createTime);
-                                        sysPartnerAPPPageVo.setStartTime(createTime);
+//                                        sysPartnerAPPPageVo.setStartTime(createTime);
                                     }
                                     HashMap<String, BigDecimal> map = sysAgencyLeaderMapper.getBigDecimalNum(sysDept1.getId(), dateStr,null,null);
                                     if (CollectionUtil.isNotEmpty(map)) {

+ 10 - 1
src/main/java/com/ydtech/modules/admin/service/impl/SysUserServiceImpl.java

@@ -1684,5 +1684,14 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
         return HttpResult.ok();
 
     }
-
+    /**
+     *  @version
+     *  @author: hxl
+     *  @Date: 2024/9/24 17:36
+     *  @Description: 电销管理人数据
+     */
+    @Override
+    public List<SysUser> findDxUserList() {
+        return  sysUserMapper.findDxUserList();
+    }
 }

+ 25 - 0
src/main/java/com/ydtech/modules/ins/model/vo/CarInfoVo.java

@@ -6,6 +6,11 @@ import com.ydtech.validation.annotation.CheckDateTime;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
+import org.hibernate.validator.constraints.Range;
+
+import javax.validation.constraints.Digits;
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.Past;
 
 /**
  * @author qinfenglong
@@ -17,6 +22,7 @@ import lombok.Data;
 @ApiModel(value = "车辆信息")
 public class CarInfoVo {
 
+    @NotNull
     @ApiModelProperty(value = "品牌型号")
     private String brandName;
 
@@ -29,9 +35,12 @@ public class CarInfoVo {
     @ApiModelProperty(value = "行业车型编码")
     private String ciModelCode;
 
+    @NotNull(message = "整备质量不能为空")
+    @Range(message = "整备质量必须为整数")
     @ApiModelProperty(value = "整备质量")
     private String completeKerbMass;
 
+    @NotNull(message = "发动机号不能为空")
     @ApiModelProperty(value = "发动机号")
     private String engineNo;
 
@@ -44,9 +53,11 @@ public class CarInfoVo {
     @ApiModelProperty(value = "工厂编码")
     private String factoryid;
 
+    @NotNull(message = "车架号不能为空")
     @ApiModelProperty(value = "车架号")
     private String frameNo;
 
+    @NotNull(message = "车牌好不能为空")
     @ApiModelProperty(value = "车牌")
     private String licenseNo;
 
@@ -56,21 +67,28 @@ public class CarInfoVo {
     @ApiModelProperty(value = "精友车型编码")
     private String modelCode;
 
+    @NotNull(message = "新车购置价不能为空")
+    @Range(message = "新车购置价必须为整数")
     @ApiModelProperty(value = "新车购置价")
     private String purchasePrice;
 
+    @NotNull(message = "座位数不能为空")
+    @Range(min = 1,max = 99,message = "座位数只能填写 1 - 99的整数")
     @ApiModelProperty(value = "座位数")
     private String seatCount;
 
     @ApiModelProperty(value = "车辆类型(轿车类,特种车类)")
     private String vehicleclass;
 
+    @NotNull(message = "车架号不能为空")
     @ApiModelProperty(value = "车架号")
     private String vinNo;
 
+    @NotNull(message = "车型不能为空")
     @ApiModelProperty(value = "车型")
     private String familyName;
 
+    @NotNull(message = "车型名称不能为空")
     @ApiModelProperty(value = "车型名称")
     private String modelcname;
 
@@ -82,12 +100,14 @@ public class CarInfoVo {
     /**
      * @see com.ydtech.constants.enums.dict.insurance.EnergyType
      */
+    @NotNull(message = "能源种类不能为空")
     @ApiModelProperty(value = "能源种类")
     private String energyType;
 
     @ApiModelProperty(value = "总质量")
     private String vehicleweight;
 
+    @Range(message = "核定载质量必须为整数")
     @ApiModelProperty(value = "核定载质量")
     private String limitLoad;
 
@@ -97,19 +117,23 @@ public class CarInfoVo {
     /**
      * @see com.ydtech.constants.enums.dict.insurance.VehicleType
      */
+    @NotNull(message = "车辆种类不能为空")
     @ApiModelProperty(value = "车辆种类")
     private String cimodelclass;
 
     @ApiModelProperty(value = "燃料类型")
     private String powertype;
 
+    @Digits(integer = Integer.MAX_VALUE, fraction = 5, message = "排量必须是小数,且小数位最多5位")
     @ApiModelProperty(value = "排量(和exhaustScale区分开)")
     private String enginedesc;
 
+    @NotNull(message = "行驶证注册日期不能空")
     @ApiModelProperty(value = "行驶证注册日期")
     @CheckDateTime(format = "yyyy-MM-dd", message = "行驶证注册日期的正确格式为yyyy-MM-dd")
     private String registerDate;
 
+    @NotNull(message = "发证日期不能为空")
     @ApiModelProperty(value = "发证日期")
     @CheckDateTime(format = "yyyy-MM-dd", message = "发证日期的正确格式为yyyy-MM-dd")
     private String issueDate;
@@ -141,6 +165,7 @@ public class CarInfoVo {
     private boolean outOfInsurance;
 
     @ApiModelProperty(value = "过户日期")
+    @CheckDateTime(format = "yyyy-MM-dd", message = "发证日期的正确格式为yyyy-MM-dd")
     private String transferDate;
 
     @ApiModelProperty(value = "是否贷款车")

+ 6 - 0
src/main/java/com/ydtech/modules/ins/model/vo/CustomerInfoVo.java

@@ -10,6 +10,7 @@ import lombok.NoArgsConstructor;
 import org.springframework.util.ObjectUtils;
 
 import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
 
 /**
  * @author qinfenglong
@@ -23,16 +24,20 @@ import javax.validation.constraints.NotBlank;
 @ApiModel(value = "人员信息")
 public class CustomerInfoVo {
 
+    @NotNull(message = "车主、投保人、被保人姓名不能为空")
     @ApiModelProperty("姓名")
     private String name;
 
+    @NotNull(message = "车主、投保人、被保人身份证号不能为空")
     @CheckIdentifyNumber
     @ApiModelProperty("身份证号")
     private String identifyNumber;
 
+    @NotNull(message = "车主、投保人、被保人身份证类型不能为空")
     @ApiModelProperty("身份证类型")
     private String identifyType;
 
+    @NotNull(message = "车主、投保人、被保人地址不能为空")
     @ApiModelProperty("地址")
     private String addr;
 
@@ -45,6 +50,7 @@ public class CustomerInfoVo {
     @ApiModelProperty("邮箱")
     private String email;
 
+    @NotNull(message = "车主、投保人、被保人手机号不能为空")
     @ApiModelProperty("手机号")
     private String mobile;
 

+ 2 - 2
src/main/java/com/ydtech/modules/order/dao/InsOrdersMapper.java

@@ -25,10 +25,10 @@ public interface InsOrdersMapper extends BaseMapper<InsOrders> {
     InsOrders getByUseridAndLicenseNo(VerifyOrdersVo verifyOrdersVo);
 
     Long queryPageOrderCount(@Param("orderQueryVo") OrderQueryVo orderQueryVo,
-                             @Param("isTeamLeader") Boolean isTeamLeader, @Param("isCdy") Boolean isCdy, @Param("deptId") String deptId);
+                             @Param("isTeamLeader") Boolean isTeamLeader, @Param("isCdy") Boolean isCdy, @Param("deptId") String deptId,@Param("isDxFlag") Boolean isDxFlag);
 
     Page<InsOrders> queryPageOrder(@Param("page") Page page, @Param("orderQueryVo") OrderQueryVo orderQueryVo,
-                                   @Param("isTeamLeader") Boolean isTeamLeader, @Param("isCdy") Boolean isCdy, @Param("deptId") String deptId);
+                                   @Param("isTeamLeader") Boolean isTeamLeader, @Param("isCdy") Boolean isCdy, @Param("deptId") String deptId,@Param("isDxFlag") Boolean isDxFlag);
 
     List<InsOrdersExcel> queryOrderList(InsOrdersExcelVo insOrdersExcelVo);
 

+ 8 - 2
src/main/java/com/ydtech/modules/order/service/impl/InsOrdersServiceImpl.java

@@ -452,13 +452,19 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
         SysDept dept = sysDeptService.getById(user.getDeptId());
         String deptId = "";
         boolean isCdy = false;
+        boolean isDxFlag = false;
         //机构类型为1  角色id=21是渠道团队长
         if (dept != null && "1".equals(dept.getManagementSource()) && userRole != null && userRole.getRoleId() == 21) {
             deptId = dept.getId();
             isCdy = true;
         }
-        Page<InsOrders> orderVoPage = baseMapper.queryPageOrder(page, orderQueryVo, adminFalg, isCdy, deptId);
-        Long total = baseMapper.queryPageOrderCount(orderQueryVo, adminFalg, isCdy, deptId);
+        //车险查询添加电销组长可以查询电销下的数据   电销组长 72
+        if (dept != null && "3".equals(dept.getManagementSource()) && userRole != null && userRole.getRoleId() == 72) {
+            deptId = dept.getId();
+            isDxFlag = true;
+        }
+        Page<InsOrders> orderVoPage = baseMapper.queryPageOrder(page, orderQueryVo, adminFalg, isCdy, deptId,isDxFlag);
+        Long total = baseMapper.queryPageOrderCount(orderQueryVo, adminFalg, isCdy, deptId,isDxFlag);
         orderVoPage.setTotal(total);
         return new BasePageResult<>(orderQueryVo.getPageNum(), orderQueryVo.getPageSize(), orderVoPage.getTotal(),
                 orderVoPage.getPages()

+ 28 - 0
src/main/java/com/ydtech/modules/protocol/service/impl/PtlAgreementServiceImpl.java

@@ -1000,6 +1000,34 @@ public class PtlAgreementServiceImpl extends ServiceImpl<PtlAgreementMapper, Ptl
         newPtlAgreement.setPartnerCompaniesId(ptlAgreement.getPartnerCompaniesId());
         newPtlAgreement.generateTheProtocolCode();
         save(newPtlAgreement);
+        PtlAgreementAttribution ptlAgreementAttributionOld = ptlAgreementAttributionService.getById(ptlAgreementVo.getId());
+        // 复制账号配置
+        PtlAgreementAttribution ptlAgreementAttributionNew = new PtlAgreementAttribution();
+        BeanUtils.copyProperties(ptlAgreementAttributionOld, ptlAgreementAttributionNew, "id");
+        ptlAgreementAttributionNew.setId(newPtlAgreement.getId());
+        ptlAgreementAttributionService.save(ptlAgreementAttributionNew);
+        // 添加账号配置记录
+        String batchNo = IdGenerate.nextId();
+        PtlAgreementAttributionHistory ptlAgreementAttributionHistory = new PtlAgreementAttributionHistory();
+        ptlAgreementAttributionHistory.setId(IdGenerate.nextId());
+        ptlAgreementAttributionHistory.setBatch(batchNo);
+        ptlAgreementAttributionHistory.setInsCompanyId(newPtlAgreement.getInsuranceCompanyId());
+        ptlAgreementAttributionHistory.setInsCompanyName(newPtlAgreement.getAgreementName());
+        ptlAgreementAttributionHistory.setFields(ptlAgreementAttributionNew.getFields());
+        ptlAgreementAttributionHistory.setTemplateId(ptlAgreementAttributionNew.getTemplateId());
+        ptlAgreementAttributionHistory.setApiType(ptlAgreementAttributionNew.getApiType());
+        ptlAgreementAttributionHistory.setUsername(ptlAgreementAttributionNew.getUsername());
+        ptlAgreementAttributionHistory.setPassword(ptlAgreementAttributionNew.getPassword());
+        ptlAgreementAttributionHistoryService.save(ptlAgreementAttributionHistory);
+        // 复制授权部门
+        List<PtlAgreementDept> ptlAgreementDept = ptlAgreementDeptService.list(new LambdaQueryWrapper<PtlAgreementDept>().eq(PtlAgreementDept::getAgreementId, ptlAgreement.getId()));
+        List<String> deptIds = ptlAgreementDept.stream().map(PtlAgreementDept::getDeptId).collect(Collectors.toList());
+        ptlAgreementDeptService.saveBatchDept(newPtlAgreement.getId(),deptIds);
+        // 添加授权部门记录
+        List<PtlAgreementDeptHistory> ptlAgreementDeptList = PtlAgreementDeptHistory.toPtlAgreementDeptHistoryList(newPtlAgreement.getId(),
+                deptIds, batchNo);
+        ptlAgreementDeptHistoryService.saveBatch(ptlAgreementDeptList);
+        // 添加协议轨迹
         PtlAgreementTrajectory ptlAgreementTrajectory = new PtlAgreementTrajectory();
         ptlAgreementTrajectory.setId(IdGenerate.nextId());
         ptlAgreementTrajectory.setAgreementId(newPtlAgreement.getId());

+ 0 - 1
src/main/resources/mapper/modules/admin/SysGeographyPositionMapper.xml

@@ -4,7 +4,6 @@
 
     <resultMap type="com.ydtech.modules.admin.model.SysGeographyPosition" id="SysGeographyPositionMap">
         <result property="id" column="id" jdbcType="VARCHAR"/>
-        <result property="userId" column="user_id" jdbcType="VARCHAR"/>
         <result property="userName" column="user_name" jdbcType="VARCHAR"/>
         <result property="longitude" column="longitude" jdbcType="VARCHAR"/>
         <result property="latitude" column="latitude" jdbcType="VARCHAR"/>

+ 20 - 1
src/main/resources/mapper/modules/admin/SysUserMapper.xml

@@ -1570,5 +1570,24 @@
         </foreach>
     </update>
 
-
+    <select id="findDxUserList" resultType="com.ydtech.modules.admin.model.SysUser">
+        SELECT
+            t1.id AS id,
+            t1.NAME AS NAME
+        FROM
+            sys_user t1
+        WHERE
+            t1.`status` = 1
+          AND t1.id NOT LIKE '%M%' UNION
+        SELECT
+            t1.id AS id,
+            t1.NAME AS NAME
+        FROM
+            sys_user t1
+                LEFT JOIN sys_dept t2 ON t1.dept_id = t2.id
+        WHERE
+            t1.`status` = 1
+          AND t1.id LIKE '%M%'
+          AND t2.management_source = 3
+    </select>
 </mapper>

+ 10 - 0
src/main/resources/mapper/modules/order/InsOrdersMapper.xml

@@ -329,6 +329,11 @@
                             and io.deptid like "${deptId}%"
                         </if>
                     </when>
+                    <when test="isDxFlag">
+                        <if test="orderQueryVo.userId != null and orderQueryVo.userId != '' ">
+                            and  ( exists ( select id from  sys_user  where manager_id = #{orderQueryVo.userId})  or io.userid = #{orderQueryVo.userId}  )
+                        </if>
+                    </when>
                     <otherwise>
                         <if test="orderQueryVo.userId != null and orderQueryVo.userId != '' and !isTeamLeader">
                             and io.userid = #{orderQueryVo.userId}
@@ -393,6 +398,11 @@
                         and io.deptid like "${deptId}%"
                     </if>
                 </when>
+                <when test="isDxFlag">
+                    <if test="orderQueryVo.userId != null and orderQueryVo.userId != '' ">
+                        and  ( exists ( select id from  sys_user  where manager_id = #{orderQueryVo.userId})  or io.userid = #{orderQueryVo.userId}  )
+                    </if>
+                </when>
                 <otherwise>
                     <if test="orderQueryVo.userId != null and orderQueryVo.userId != '' and !isTeamLeader">
                         and io.userid = #{orderQueryVo.userId}