Browse Source

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

dev_shibei_match
sunyuchao 5 years ago
parent
commit
a273179e09
  1. 5
      epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/service/impl/OpenUpServiceImpl.java
  2. 21
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/CustomerIdFormDTO.java
  3. 20
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/CustomerGridCountResultDTO.java
  4. 13
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java
  5. 5
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java
  6. 12
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java
  7. 8
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java
  8. 16
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java
  9. 36
      epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/result/CustomerInfoResultDTO.java
  10. 11
      epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/constant/ModuleConstant.java
  11. 25
      epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/controller/CustomerController.java
  12. 9
      epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/dao/CustomerDao.java
  13. 10
      epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/CustomerService.java
  14. 19
      epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerServiceImpl.java
  15. 13
      epmet-module/oper-crm/oper-crm-server/src/main/resources/mapper/CustomerDao.xml

5
epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/service/impl/OpenUpServiceImpl.java

@ -1,8 +1,10 @@
package com.epmet.service.impl;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.utils.Result;
import com.epmet.constant.ModuleConstant;
import com.epmet.dto.CustomerAgencyDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.result.StaffSinDeptResultDTO;
import com.epmet.dto.result.StaffSinGridResultDTO;
@ -16,6 +18,7 @@ import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
/**
* @Author zxc
@ -39,7 +42,7 @@ public class OpenUpServiceImpl implements OpenUpService {
public List<StaffSinGridResultDTO> staffSinGrid(StaffSinGridFormDTO formDTO) {
CommonGridIdFormDTO commonGridId = new CommonGridIdFormDTO();
commonGridId.setGridId(formDTO.getGridId());
commonGridId.setUserId("");
commonGridId.setUserId(UUID.randomUUID().toString().replace(StrConstant.HYPHEN, ""));
Result<List<String>> gridStaffs = govOrgOpenFeignClient.getGridStaffs(commonGridId);
if (!gridStaffs.success()){
throw new RenException(ModuleConstant.ERROR_GOV_ORG_GRID);

21
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/CustomerIdFormDTO.java

@ -0,0 +1,21 @@
package com.epmet.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2020/8/13 5:56 下午
*/
@Data
public class CustomerIdFormDTO implements Serializable {
private static final long serialVersionUID = 4512080710854617599L;
public interface Customer{}
@NotBlank(message = "customerId不能为空",groups = {Customer.class})
private String customerId;
}

20
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/CustomerGridCountResultDTO.java

@ -0,0 +1,20 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2020/8/14 9:27 上午
*/
@Data
public class CustomerGridCountResultDTO implements Serializable {
private static final long serialVersionUID = 386294009143897744L;
/**
* 客户下的网格数量
*/
private Integer gridCount;
}

13
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java

@ -19,7 +19,7 @@ import java.util.List;
* @author yinzuomei@elink-cn.com
* @date 2020/6/4 13:37
*/
// @FeignClient(name = ServiceConstant.GOV_ORG_SERVER, fallback = GovOrgOpenFeignClientFallback.class, url = "localhost:8092")
//@FeignClient(name = ServiceConstant.GOV_ORG_SERVER, fallback = GovOrgOpenFeignClientFallback.class, url = "localhost:8092")
@FeignClient(name = ServiceConstant.GOV_ORG_SERVER, fallback = GovOrgOpenFeignClientFallback.class)
public interface GovOrgOpenFeignClient {
@ -191,7 +191,7 @@ public interface GovOrgOpenFeignClient {
* @author zxc
* @date 2020/8/13 10:46 上午
*/
@PostMapping("/gov/org/customerstaffgrid/getgridstaffs")
@PostMapping(value = "/gov/org/customerstaffgrid/getgridstaffs")
Result<List<String>> getGridStaffs(@RequestBody CommonGridIdFormDTO gridIdFormDTO);
/**
@ -202,4 +202,13 @@ public interface GovOrgOpenFeignClient {
*/
@PostMapping("/gov/org/customerstaffdepartment/getdepartmentstaffs")
Result<List<String>> getDepartmentStaffs(@RequestBody DepartmentIdFormDTO formDTO);
/**
* @Description 查询客户下的网格数量
* @param customerIdFormDTO
* @author zxc
* @date 2020/8/14 9:31 上午
*/
@PostMapping("/gov/org/customergrid/gridcount")
Result<CustomerGridCountResultDTO> selectGridCount(@RequestBody CustomerIdFormDTO customerIdFormDTO);
}

5
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java

@ -121,4 +121,9 @@ public class GovOrgOpenFeignClientFallback implements GovOrgOpenFeignClient {
public Result<List<String>> getDepartmentStaffs(DepartmentIdFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getDepartmentStaffs", formDTO);
}
@Override
public Result<CustomerGridCountResultDTO> selectGridCount(CustomerIdFormDTO customerIdFormDTO) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "selectGridCount", customerIdFormDTO);
}
}

12
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java

@ -216,4 +216,16 @@ public class CustomerGridController {
return customerGridService.queryCustomerGridList(formDTO);
}
/**
* @Description 查询客户下的网格数量
* @param customerIdFormDTO
* @author zxc
* @date 2020/8/14 9:31 上午
*/
@PostMapping("gridcount")
public Result<CustomerGridCountResultDTO> selectGridCount(@RequestBody CustomerIdFormDTO customerIdFormDTO){
ValidatorUtils.validateEntity(customerIdFormDTO, CustomerIdFormDTO.Customer.class);
return new Result<CustomerGridCountResultDTO>().ok(customerGridService.selectGridCount(customerIdFormDTO));
}
}

8
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java

@ -251,4 +251,12 @@ public interface CustomerGridService extends BaseService<CustomerGridEntity> {
* @Description 单客户-陌生人导览模块调用-根据地区编码查询客户下的网格列表
**/
Result<List<PublicCustomerGridForStrangerResultDTO>> queryCustomerGridList(ThirdCustomerGridListFormDTO formDTO);
/**
* @Description 查询客户下的网格数量
* @param customerIdFormDTO
* @author zxc
* @date 2020/8/14 9:31 上午
*/
CustomerGridCountResultDTO selectGridCount( CustomerIdFormDTO customerIdFormDTO);
}

16
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java

@ -29,7 +29,6 @@ import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.constant.CustomerGridConstant;
import com.epmet.dao.CustomerAgencyDao;
import com.epmet.dao.CustomerGridDao;
import com.epmet.dao.CustomerStaffGridDao;
import com.epmet.dto.*;
@ -40,7 +39,6 @@ import com.epmet.feign.EpmetUserFeignClient;
import com.epmet.feign.OperCrmOpenFeignClient;
import com.epmet.service.CustomerAgencyService;
import com.epmet.service.CustomerGridService;
import com.epmet.service.CustomerStaffGridService;
import com.epmet.util.ModuleConstant;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
@ -637,4 +635,18 @@ public class CustomerGridServiceImpl extends BaseServiceImpl<CustomerGridDao, Cu
}
/**
* @Description 查询客户下的网格数量
* @param customerIdFormDTO
* @author zxc
* @date 2020/8/14 9:31 上午
*/
@Override
public CustomerGridCountResultDTO selectGridCount(CustomerIdFormDTO customerIdFormDTO) {
Integer gridCount = customerGridDao.selectGridCount(customerIdFormDTO.getCustomerId());
CustomerGridCountResultDTO customerGridCount = new CustomerGridCountResultDTO();
customerGridCount.setGridCount(gridCount);
return customerGridCount;
}
}

36
epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/result/CustomerInfoResultDTO.java

@ -0,0 +1,36 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2020/8/14 9:01 上午
*/
@Data
public class CustomerInfoResultDTO implements Serializable {
private static final long serialVersionUID = 7653925905635170972L;
/**
* 客户Id
*/
private String customerId;
/**
* 客户名称
*/
private String customerName;
/**
* 已创建网格数
*/
private Integer createGridNum;
/**
* 最大允许创建数
*/
private Integer maxGridNum;
}

11
epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/constant/ModuleConstant.java

@ -0,0 +1,11 @@
package com.epmet.constant;
/**
* @Author zxc
* @DateTime 2020/8/14 9:46 上午
*/
public interface ModuleConstant {
String ERROR_GOV_ORG_COUNT = "调用gov_org服务【查询客户下网格数量】失败";
}

25
epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/controller/CustomerController.java

@ -32,10 +32,12 @@ import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.dto.CustomerDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.result.CustomerDetailResultDTO;
import com.epmet.dto.result.CustomerInfoResultDTO;
import com.epmet.dto.result.GridCountResultDTO;
import com.epmet.dto.result.ValidCustomerResultDTO;
import com.epmet.excel.CustomerExcel;
import com.epmet.feign.GovOrgFeignClient;
import com.epmet.feign.GovOrgOpenFeignClient;
import com.epmet.service.CustomerService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -64,6 +66,8 @@ public class CustomerController {
@Autowired
private GovOrgFeignClient govOrgFeignClient;
@Autowired
private GovOrgOpenFeignClient govOrgOpenFeignClient;
@GetMapping("page")
public Result<PageData<CustomerDTO>> page(@RequestParam Map<String, Object> params) {
@ -267,4 +271,25 @@ public class CustomerController {
return new Result<GridCountResultDTO>().ok(customerService.getGridCount(formDTO));
}
/**
* @Description 查询客户基本信息
* @param formDTO
* @author zxc
* @date 2020/8/14 9:08 上午
*/
@PostMapping("getcustomer")
public Result<CustomerInfoResultDTO> getCustomer(@RequestBody CustomerIdFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO, CustomerIdFormDTO.Customer.class);
return new Result<CustomerInfoResultDTO>().ok(customerService.getCustomer(formDTO));
}
@PostMapping("zxc")
public void getZxc(){
CommonGridIdFormDTO commonGridId = new CommonGridIdFormDTO();
commonGridId.setGridId("111");
commonGridId.setUserId("111");
Result<List<String>> gridStaffs = govOrgOpenFeignClient.getGridStaffs(commonGridId);
System.out.println(gridStaffs);
}
}

9
epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/dao/CustomerDao.java

@ -19,6 +19,7 @@ package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.CustomerDTO;
import com.epmet.dto.result.CustomerInfoResultDTO;
import com.epmet.dto.result.CustomerResultDTO;
import com.epmet.dto.result.GridCountResultDTO;
import com.epmet.dto.result.ValidCustomerResultDTO;
@ -83,4 +84,12 @@ public interface CustomerDao extends BaseDao<CustomerEntity> {
*/
GridCountResultDTO getGridCount(@Param("customerId")String customerId);
/**
* @Description 根据客户Id查询客户基本信息
* @param customerId
* @author zxc
* @date 2020/8/14 9:12 上午
*/
CustomerInfoResultDTO selectCustomerBasicInfo(@Param("customerId")String customerId);
}

10
epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/CustomerService.java

@ -23,9 +23,11 @@ import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.CustomerDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.result.CustomerDetailResultDTO;
import com.epmet.dto.result.CustomerInfoResultDTO;
import com.epmet.dto.result.GridCountResultDTO;
import com.epmet.dto.result.ValidCustomerResultDTO;
import com.epmet.entity.CustomerEntity;
import org.springframework.web.bind.annotation.RequestBody;
import java.util.List;
import java.util.Map;
@ -179,4 +181,12 @@ public interface CustomerService extends BaseService<CustomerEntity> {
* @date 2020/8/12 4:30 下午
*/
GridCountResultDTO getGridCount( GridCountFormDTO formDTO);
/**
* @Description 查询客户基本信息
* @param formDTO
* @author zxc
* @date 2020/8/14 9:08 上午
*/
CustomerInfoResultDTO getCustomer( CustomerIdFormDTO formDTO);
}

19
epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerServiceImpl.java

@ -30,6 +30,7 @@ import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.HttpClientManager;
import com.epmet.commons.tools.utils.Result;
import com.epmet.constant.ModuleConstant;
import com.epmet.constant.RoleKeyConstants;
import com.epmet.constant.UserWorkType;
import com.epmet.dao.CustomerDao;
@ -557,4 +558,22 @@ public class CustomerServiceImpl extends BaseServiceImpl<CustomerDao, CustomerEn
return customerDao.getGridCount(formDTO.getCustomerId());
}
/**
* @Description 查询客户基本信息
* @param formDTO
* @author zxc
* @date 2020/8/14 9:08 上午
*/
@Override
public CustomerInfoResultDTO getCustomer(CustomerIdFormDTO formDTO) {
String customerId = formDTO.getCustomerId();
CustomerInfoResultDTO customerInfoResultDTO = customerDao.selectCustomerBasicInfo(customerId);
Result<CustomerGridCountResultDTO> result = govOrgOpenFeignClient.selectGridCount(formDTO);
if (!result.success()){
throw new RenException(ModuleConstant.ERROR_GOV_ORG_COUNT);
}
customerInfoResultDTO.setCreateGridNum(result.getData().getGridCount());
return customerInfoResultDTO;
}
}

13
epmet-module/oper-crm/oper-crm-server/src/main/resources/mapper/CustomerDao.xml

@ -89,4 +89,17 @@
del_flag = 0
AND id = #{customerId}
</select>
<!-- 根据客户Id查询客户基本信息 -->
<select id="selectCustomerBasicInfo" resultType="com.epmet.dto.result.CustomerInfoResultDTO">
SELECT
id AS customerId,
customer_name AS customerName,
IFNULL( grid_number, 0 ) AS maxGridNum
FROM
customer
WHERE
del_flag = 0
AND id = #{customerId}
</select>
</mapper>

Loading…
Cancel
Save