ソースを参照

客户功能修改

lizhenhao 2 年 前
コミット
5ab7423065

+ 15 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/workClientInfo/controller/CwWorkClientController.java

@@ -68,6 +68,21 @@ public class CwWorkClientController {
     }
 
     /**
+     * 查询客户信息列表tree
+     * @param cwWorkClientBaseDTO
+     * @param page
+     * @return
+     * @throws Exception
+     */
+    @ApiLog("查询客户信息列表tree")
+    @GetMapping("list_tree")
+    public ResponseEntity<IPage<CwWorkClientBaseDTO>> dataTree(CwWorkClientBaseDTO cwWorkClientBaseDTO, Page<CwWorkClientBaseDTO> page) throws Exception {
+        IPage<CwWorkClientBaseDTO> result = new Page<CwWorkClientBaseDTO>();
+        result = cwWorkClientService.findListTree (page,cwWorkClientBaseDTO);
+        return ResponseEntity.ok (result);
+    }
+
+    /**
      * 查询客户信息数据
      * @param id
      * @return

+ 15 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/workClientInfo/domain/CwWorkClientBase.java

@@ -155,5 +155,20 @@ public class CwWorkClientBase extends BaseEntity {
      */
     private String agreeUserId;
 
+    /**
+     * 地址
+     */
+    private String address;
+
+    /**
+     * 联系电话
+     */
+    private String mobile;
+
+    /**
+     * 是否有社会统一信用代码
+     */
+    private String isUscCode;
+
     private static final long serialVersionUID = 1L;
 }

+ 5 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/workClientInfo/domain/CwWorkClientBilling.java

@@ -55,5 +55,10 @@ public class CwWorkClientBilling extends BaseEntity {
      */
     private String address;
 
+    /**
+     * 公司名称
+     */
+    private String companyName;
+
     private static final long serialVersionUID = 1L;
 }

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

@@ -43,6 +43,9 @@
             <result property="isListed" column="is_listed" jdbcType="VARCHAR"/>
             <result property="ownershipType" column="ownership_type" jdbcType="VARCHAR"/>
             <result property="finalStatusType" column="final_status_type" jdbcType="VARCHAR"/>
+            <result property="address" column="address" jdbcType="VARCHAR"/>
+            <result property="mobile" column="mobile" jdbcType="VARCHAR"/>
+            <result property="isUscCode" column="is_usc_code" jdbcType="VARCHAR"/>
             <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="cwWorkClientBillingDTOList" ofType="com.jeeplus.test.cw.workClientInfo.service.dto.CwWorkClientBillingDTO" column="id" select="getBilling"></collection>
@@ -94,7 +97,10 @@
         cw_wcb.process_definition_id,
         cw_wcb.status,
         cw_wcb.agree_date,
-        cw_wcb.agree_user_id
+        cw_wcb.agree_user_id,
+        cw_wcb.address,
+        cw_wcb.mobile,
+        cw_wcb.is_usc_code
     </sql>
     <sql id="File_Column_List">
         wa.id,
@@ -129,7 +135,8 @@
         cw_wcbi.account_holder,
         cw_wcbi.account,
         cw_wcbi.phone,
-        cw_wcbi.address
+        cw_wcbi.address,
+        cw_wcbi.company_name
     </sql>
     <sql id="Contact_Column_List">
         cw_wcc.id,

+ 3 - 1
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/workClientInfo/mapper/xml/CwWorkClientBillingMapper.xml

@@ -19,6 +19,7 @@
             <result property="account" column="account" jdbcType="VARCHAR"/>
             <result property="phone" column="phone" jdbcType="VARCHAR"/>
             <result property="address" column="address" jdbcType="VARCHAR"/>
+        <result property="companyName" column="company_name" jdbcType="VARCHAR"/>
     </resultMap>
 
     <sql id="Billing_Column_List">
@@ -35,6 +36,7 @@
         cw_wcbi.account_holder,
         cw_wcbi.account,
         cw_wcbi.phone,
-        cw_wcbi.address
+        cw_wcbi.address,
+        cw_wcbi.company_name
     </sql>
 </mapper>

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

@@ -34,6 +34,7 @@ import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
 import javax.annotation.Resource;
+import java.util.ArrayList;
 import java.util.List;
 import java.util.stream.Collectors;
 
@@ -87,6 +88,69 @@ public class CwWorkClientService extends ServiceImpl<CwWorkClientBaseMapper, CwW
         return cwWorkClientBaseMapper.findList(page, queryWrapper);
     }
 
+    public IPage<CwWorkClientBaseDTO> findListTree(Page<CwWorkClientBaseDTO> page, CwWorkClientBaseDTO cwWorkClientBaseDTO) throws Exception{
+        QueryWrapper<CwWorkClientBase> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("cw_wcb.del_flag","0");
+        queryWrapper.orderByDesc("cw_wcb.create_date");
+        if (ObjectUtil.isNotEmpty(cwWorkClientBaseDTO)) {
+            if (StringUtils.isNotBlank(cwWorkClientBaseDTO.getName()) ||
+                    StringUtils.isNotBlank(cwWorkClientBaseDTO.getNo()) ||
+                    StringUtils.isNotBlank(cwWorkClientBaseDTO.getType()) ||
+                    StringUtils.isNotBlank(cwWorkClientBaseDTO.getIndustry())) {
+                List<String> ids = new ArrayList<>();
+                List<CwWorkClientBase> list = this.list(new QueryWrapper<CwWorkClientBase>().lambda()
+                        .like(StringUtils.isNotBlank(cwWorkClientBaseDTO.getName()),CwWorkClientBase::getName, cwWorkClientBaseDTO.getName())
+                        .like(StringUtils.isNotBlank(cwWorkClientBaseDTO.getNo()),CwWorkClientBase::getNo, cwWorkClientBaseDTO.getNo())
+                        .eq(StringUtils.isNotBlank(cwWorkClientBaseDTO.getType()),CwWorkClientBase::getType, cwWorkClientBaseDTO.getType())
+                        .eq(StringUtils.isNotBlank(cwWorkClientBaseDTO.getIndustry()),CwWorkClientBase::getIndustry, cwWorkClientBaseDTO.getIndustry())
+                );
+                list.stream().forEach(item->{
+                    ids.add(item.getId());
+                    if (StringUtils.isNotBlank(item.getOneUpCompany())) {
+                        String parentId = item.getOneUpCompany();
+                        while (true) {
+                            CwWorkClientBase byId = this.getOne(new QueryWrapper<CwWorkClientBase>().lambda().eq(CwWorkClientBase::getId, parentId));
+                            if (ObjectUtil.isNotEmpty(byId)) {
+                                ids.add(byId.getId());
+                                if (StringUtils.isBlank(byId.getOneUpCompany())) {
+                                    break;
+                                } else {
+                                    parentId = byId.getOneUpCompany();
+                                }
+                            }
+                        }
+                    }
+                    List<String> childIdList = this.list(new QueryWrapper<CwWorkClientBase>().lambda().eq(CwWorkClientBase::getOneUpCompany, item.getId())).stream().map(CwWorkClientBase::getId).collect(Collectors.toList());
+                    while (true) {
+                        if (CollectionUtil.isNotEmpty(childIdList)) {
+                            childIdList.stream().forEach(childId->{
+                                ids.add(childId);
+                            });
+                            List<String> childIdS = this.list(new QueryWrapper<CwWorkClientBase>().lambda().in(CwWorkClientBase::getOneUpCompany, childIdList)).stream().map(CwWorkClientBase::getId).collect(Collectors.toList());
+                            if (CollectionUtil.isNotEmpty(childIdS)) {
+                                childIdList = childIdS;
+                            } else {
+                                break;
+                            }
+                        } else {
+                            break;
+                        }
+                    }
+                });
+                List<String> lastIdList = ids.stream().distinct().collect(Collectors.toList());
+                if (CollectionUtil.isNotEmpty(lastIdList)){
+                    queryWrapper.in("cw_wcb.id",lastIdList);
+                } else {
+                    return new Page<>();
+                }
+            }
+            if (StringUtils.isNotBlank(cwWorkClientBaseDTO.getStatus())) {
+                queryWrapper.eq("cw_wcb.status",cwWorkClientBaseDTO.getStatus());
+            }
+        }
+        return cwWorkClientBaseMapper.findList(page, queryWrapper);
+    }
+
     public CwWorkClientBaseDTO queryById(String id) {
 
         CwWorkClientBaseDTO cwWorkClientBaseDTO = cwWorkClientBaseMapper.queryById(id);

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

@@ -228,5 +228,20 @@ public class CwWorkClientBaseDTO extends BaseDTO {
     @Excel(name = "创建时间",exportFormat = "yyyy-MM-dd HH:mm:ss",width = 25,orderNum = "12")
     private Date createDateT;
 
+    /**
+     * 地址
+     */
+    private String address;
+
+    /**
+     * 联系电话
+     */
+    private String mobile;
+
+    /**
+     * 是否有社会统一信用代码
+     */
+    private String isUscCode;
+
     private static final long serialVersionUID = 1L;
 }

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

@@ -52,5 +52,10 @@ public class CwWorkClientBillingDTO extends BaseDTO {
      */
     private String address;
 
+    /**
+     * 公司名称
+     */
+    private String companyName;
+
     private static final long serialVersionUID = 1L;
 }