Browse Source

客户登记

lizhenhao 2 years ago
parent
commit
7b4b5cb6bc

+ 9 - 2
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/workClientInfo/mapper/xml/CwWorkClientBaseMapper.xml

@@ -37,6 +37,7 @@
             <result property="status" column="status" jdbcType="VARCHAR"/>
             <result property="status" column="status" jdbcType="VARCHAR"/>
             <result property="agreeDate" column="agree_date" jdbcType="TIMESTAMP"/>
             <result property="agreeDate" column="agree_date" jdbcType="TIMESTAMP"/>
             <result property="agreeUserId" column="agree_user_id" jdbcType="VARCHAR"/>
             <result property="agreeUserId" column="agree_user_id" jdbcType="VARCHAR"/>
+            <result property="createBy.name" column="user_name" jdbcType="VARCHAR"/>
             <association property="cwWorkClientTypeDTO" column="id" select="getType" javaType="com.jeeplus.test.cw.workClientInfo.service.dto.CwWorkClientTypeDTO"></association>
             <association property="cwWorkClientTypeDTO" column="id" select="getType" javaType="com.jeeplus.test.cw.workClientInfo.service.dto.CwWorkClientTypeDTO"></association>
             <collection property="workAttachmentDtoList" ofType="com.jeeplus.test.workContract.service.dto.WorkAttachmentDto" column="id" select="getFileList"></collection>
             <collection property="workAttachmentDtoList" ofType="com.jeeplus.test.workContract.service.dto.WorkAttachmentDto" column="id" select="getFileList"></collection>
             <collection property="cwWorkClientBillingDTOList" ofType="com.jeeplus.test.cw.workClientInfo.service.dto.CwWorkClientBillingDTO" column="id" select="getBilling"></collection>
             <collection property="cwWorkClientBillingDTOList" ofType="com.jeeplus.test.cw.workClientInfo.service.dto.CwWorkClientBillingDTO" column="id" select="getBilling"></collection>
@@ -206,15 +207,21 @@
 
 
     <select id="findList" resultMap="BaseResultMap">
     <select id="findList" resultMap="BaseResultMap">
         select
         select
-        <include refid="Base_Column_List"></include>
+        <include refid="Base_Column_List"></include>,
+        su.name as user_name
         from cw_work_client_base cw_wcb
         from cw_work_client_base cw_wcb
+        left join sys_user su on su.id = cw_wcb.create_by
         ${ew.customSqlSegment}
         ${ew.customSqlSegment}
     </select>
     </select>
 
 
     <select id="queryById" resultMap="BaseResultMap">
     <select id="queryById" resultMap="BaseResultMap">
         select
         select
-        <include refid="Base_Column_List"></include>
+        <include refid="Base_Column_List"></include>,
+        wcb.name as one_up_company_name,
+        su.name as user_name
         from cw_work_client_base cw_wcb
         from cw_work_client_base cw_wcb
+        left join cw_work_client_base wcb on cw_wcb.one_up_company = wcb.id and wcb.del_flag = '0'
+        left join sys_user su on su.id = cw_wcb.create_by
         where cw_wcb.del_flag = '0' and cw_wcb.id = ${id}
         where cw_wcb.del_flag = '0' and cw_wcb.id = ${id}
     </select>
     </select>
 </mapper>
 </mapper>

+ 20 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/workClientInfo/service/CwWorkClientService.java

@@ -8,7 +8,9 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.google.common.collect.Lists;
 import com.google.common.collect.Lists;
 import com.jeeplus.core.query.QueryWrapperGenerator;
 import com.jeeplus.core.query.QueryWrapperGenerator;
+import com.jeeplus.sys.service.dto.UserDTO;
 import com.jeeplus.sys.utils.StringUtils;
 import com.jeeplus.sys.utils.StringUtils;
+import com.jeeplus.sys.utils.UserUtils;
 import com.jeeplus.test.cw.workClientInfo.domain.CwWorkClientBase;
 import com.jeeplus.test.cw.workClientInfo.domain.CwWorkClientBase;
 import com.jeeplus.test.cw.workClientInfo.domain.CwWorkClientBilling;
 import com.jeeplus.test.cw.workClientInfo.domain.CwWorkClientBilling;
 import com.jeeplus.test.cw.workClientInfo.domain.CwWorkClientContact;
 import com.jeeplus.test.cw.workClientInfo.domain.CwWorkClientContact;
@@ -21,7 +23,9 @@ import com.jeeplus.test.cw.workClientInfo.service.mapstruct.CwWorkClientBaseWrap
 import com.jeeplus.test.cw.workClientInfo.service.mapstruct.CwWorkClientBillingWrapper;
 import com.jeeplus.test.cw.workClientInfo.service.mapstruct.CwWorkClientBillingWrapper;
 import com.jeeplus.test.cw.workClientInfo.service.mapstruct.CwWorkClientContactWrapper;
 import com.jeeplus.test.cw.workClientInfo.service.mapstruct.CwWorkClientContactWrapper;
 import com.jeeplus.test.cw.workClientInfo.service.mapstruct.CwWorkClientTypeWrapper;
 import com.jeeplus.test.cw.workClientInfo.service.mapstruct.CwWorkClientTypeWrapper;
+import com.jeeplus.test.mould.service.SerialnumTplService;
 import com.jeeplus.test.oss.service.OssService;
 import com.jeeplus.test.oss.service.OssService;
+import com.jeeplus.test.program.configuration.projectList.service.dto.ProjectListDto;
 import org.springframework.http.ResponseEntity;
 import org.springframework.http.ResponseEntity;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.transaction.annotation.Transactional;
@@ -47,6 +51,8 @@ public class CwWorkClientService extends ServiceImpl<CwWorkClientBaseMapper, CwW
     @Resource
     @Resource
     private CwOrganizationTypeService cwOrganizationTypeService;
     private CwOrganizationTypeService cwOrganizationTypeService;
     @Resource
     @Resource
+    private SerialnumTplService serialnumTplService;
+    @Resource
     private OssService ossService;
     private OssService ossService;
 
 
     public IPage<CwWorkClientBaseDTO> findList(Page<CwWorkClientBaseDTO> page, CwWorkClientBaseDTO cwWorkClientBaseDTO) throws Exception{
     public IPage<CwWorkClientBaseDTO> findList(Page<CwWorkClientBaseDTO> page, CwWorkClientBaseDTO cwWorkClientBaseDTO) throws Exception{
@@ -66,6 +72,13 @@ public class CwWorkClientService extends ServiceImpl<CwWorkClientBaseMapper, CwW
 
 
     public String saveForm(CwWorkClientBaseDTO cwWorkClientBaseDTO) throws Exception{
     public String saveForm(CwWorkClientBaseDTO cwWorkClientBaseDTO) throws Exception{
         CwWorkClientBase cwWorkClientBase = CwWorkClientBaseWrapper.INSTANCE.toEntity(cwWorkClientBaseDTO);
         CwWorkClientBase cwWorkClientBase = CwWorkClientBaseWrapper.INSTANCE.toEntity(cwWorkClientBaseDTO);
+        if(ObjectUtil.isNotEmpty(cwWorkClientBase)){
+            if(StringUtils.isBlank(cwWorkClientBase.getId())){
+                UserDTO userDTO = UserUtils.getCurrentUserDTO();
+                String no = serialnumTplService.genSerialNum(userDTO.getCompanyDTO().getId(), CwWorkClientBaseDTO.BIZ_CODE);
+                cwWorkClientBase.setNo(no);
+            }
+        }
         this.saveOrUpdate(cwWorkClientBase);
         this.saveOrUpdate(cwWorkClientBase);
         if (ObjectUtil.isNotEmpty(cwWorkClientBaseDTO)) {
         if (ObjectUtil.isNotEmpty(cwWorkClientBaseDTO)) {
             // 附件
             // 附件
@@ -73,6 +86,7 @@ public class CwWorkClientService extends ServiceImpl<CwWorkClientBaseMapper, CwW
             // 客户类型
             // 客户类型
             if (ObjectUtil.isNotEmpty(cwWorkClientBaseDTO.getCwWorkClientTypeDTO())){
             if (ObjectUtil.isNotEmpty(cwWorkClientBaseDTO.getCwWorkClientTypeDTO())){
                 CwWorkClientType cwWorkClientType = CwWorkClientTypeWrapper.INSTANCE.toEntity(cwWorkClientBaseDTO.getCwWorkClientTypeDTO());
                 CwWorkClientType cwWorkClientType = CwWorkClientTypeWrapper.INSTANCE.toEntity(cwWorkClientBaseDTO.getCwWorkClientTypeDTO());
+                cwWorkClientType.setClientId(cwWorkClientBase.getId());
                 cwWorkClientTypeService.saveOrUpdate(cwWorkClientType);
                 cwWorkClientTypeService.saveOrUpdate(cwWorkClientType);
             }
             }
             // 开票信息
             // 开票信息
@@ -91,6 +105,9 @@ public class CwWorkClientService extends ServiceImpl<CwWorkClientBaseMapper, CwW
                 }
                 }
                 cwWorkClientBaseDTO.getCwWorkClientBillingDTOList().stream().forEach(item->{
                 cwWorkClientBaseDTO.getCwWorkClientBillingDTOList().stream().forEach(item->{
                     CwWorkClientBilling cwWorkClientBilling = CwWorkClientBillingWrapper.INSTANCE.toEntity(item);
                     CwWorkClientBilling cwWorkClientBilling = CwWorkClientBillingWrapper.INSTANCE.toEntity(item);
+                    if (StringUtils.isEmpty(item.getId())) {
+                        cwWorkClientBilling.setClientId(cwWorkClientBase.getId());
+                    }
                     cwWorkClientBillingService.saveOrUpdate(cwWorkClientBilling);
                     cwWorkClientBillingService.saveOrUpdate(cwWorkClientBilling);
                 });
                 });
             } else {
             } else {
@@ -112,6 +129,9 @@ public class CwWorkClientService extends ServiceImpl<CwWorkClientBaseMapper, CwW
                 }
                 }
                 cwWorkClientBaseDTO.getCwWorkClientContactDTOList().stream().forEach(item->{
                 cwWorkClientBaseDTO.getCwWorkClientContactDTOList().stream().forEach(item->{
                     CwWorkClientContact cwWorkClientContact = CwWorkClientContactWrapper.INSTANCE.toEntity(item);
                     CwWorkClientContact cwWorkClientContact = CwWorkClientContactWrapper.INSTANCE.toEntity(item);
+                    if (StringUtils.isEmpty(item.getId())) {
+                        cwWorkClientContact.setClientId(cwWorkClientBase.getId());
+                    }
                     cwWorkClientContactService.saveOrUpdate(cwWorkClientContact);
                     cwWorkClientContactService.saveOrUpdate(cwWorkClientContact);
                 });
                 });
             } else {
             } else {

+ 7 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/workClientInfo/service/dto/CwWorkClientBaseDTO.java

@@ -16,6 +16,8 @@ import java.util.List;
 @Data
 @Data
 public class CwWorkClientBaseDTO extends BaseDTO {
 public class CwWorkClientBaseDTO extends BaseDTO {
 
 
+    public static final String BIZ_CODE = "11";
+
     /**
     /**
      * 备注信息
      * 备注信息
      */
      */
@@ -67,6 +69,11 @@ public class CwWorkClientBaseDTO extends BaseDTO {
     private String oneUpCompany;
     private String oneUpCompany;
 
 
     /**
     /**
+     * 上一级公司名称
+     */
+    private String oneUpCompanyName;
+
+    /**
      * 公司级次
      * 公司级次
      */
      */
     private String companyLevel;
     private String companyLevel;

+ 8 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/workClientInfo/service/dto/CwWorkClientTypeDTO.java

@@ -1,9 +1,11 @@
 package com.jeeplus.test.cw.workClientInfo.service.dto;
 package com.jeeplus.test.cw.workClientInfo.service.dto;
 
 
 import com.baomidou.mybatisplus.annotation.TableName;
 import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
 import com.jeeplus.core.domain.BaseEntity;
 import com.jeeplus.core.domain.BaseEntity;
 import com.jeeplus.core.service.dto.BaseDTO;
 import com.jeeplus.core.service.dto.BaseDTO;
 import lombok.Data;
 import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
 
 
 import java.util.Date;
 import java.util.Date;
 
 
@@ -57,11 +59,15 @@ public class CwWorkClientTypeDTO extends BaseDTO {
     /**
     /**
      * 发行日期
      * 发行日期
      */
      */
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @JsonFormat(pattern = "yyyy-MM-dd")
     private Date releaseDate;
     private Date releaseDate;
 
 
     /**
     /**
      * 上市日期
      * 上市日期
      */
      */
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @JsonFormat(pattern = "yyyy-MM-dd")
     private Date listedDate;
     private Date listedDate;
 
 
     /**
     /**
@@ -87,6 +93,8 @@ public class CwWorkClientTypeDTO extends BaseDTO {
     /**
     /**
      * 首次承接业务日期
      * 首次承接业务日期
      */
      */
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @JsonFormat(pattern = "yyyy-MM-dd")
     private Date undertakeBusinessDate;
     private Date undertakeBusinessDate;
 
 
     /**
     /**

+ 6 - 0
jeeplus-platform/jeeplus-admin/src/main/java/com/jeeplus/sys/controller/UserController.java

@@ -175,6 +175,12 @@ public class UserController {
                 }
                 }
             }
             }
         }
         }
+        if (ObjectUtil.isNotEmpty(userDTO)) {
+            // 当certType传值时,获取拥有此资格证类型的人员
+            if (StringUtils.isNotBlank(userDTO.getCertType())) {
+                queryWrapper.eq("sc.type",userDTO.getCertType());
+            }
+        }
         IPage <UserDTO> result = userService.findPage ( page, queryWrapper );
         IPage <UserDTO> result = userService.findPage ( page, queryWrapper );
         return ResponseEntity.ok ( result );
         return ResponseEntity.ok ( result );
     }
     }

+ 1 - 0
jeeplus-platform/jeeplus-admin/src/main/java/com/jeeplus/sys/mapper/xml/UserMapper.xml

@@ -155,6 +155,7 @@
 		SELECT
 		SELECT
 		<include refid="userColumns"/>
 		<include refid="userColumns"/>
 		FROM sys_user a
 		FROM sys_user a
+		left join sys_cert sc on a.id = sc.user_id and sc.del_flag = '0'
 		<include refid="userJoins"/>
 		<include refid="userJoins"/>
 			${ew.customSqlSegment}
 			${ew.customSqlSegment}
 	</select>
 	</select>

+ 7 - 0
jeeplus-platform/jeeplus-admin/src/main/java/com/jeeplus/sys/service/dto/UserDTO.java

@@ -177,9 +177,16 @@ public class  UserDTO extends BaseDTO {
     /**
     /**
      * 执业资格证列表
      * 执业资格证列表
      */
      */
+    @JsonIgnore
     private List<CertDTO> certDTOList;
     private List<CertDTO> certDTOList;
 
 
     /**
     /**
+     * 执业资格证类型
+     */
+    @JsonIgnore
+    private String certType;
+
+    /**
      * 拥有角色列表
      * 拥有角色列表
      */
      */
     @ApiModelProperty(hidden = true)
     @ApiModelProperty(hidden = true)