diff --git a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/EpmetUserFeignClient.java b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/EpmetUserFeignClient.java index 78f955955d..af24c8b644 100644 --- a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/EpmetUserFeignClient.java +++ b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/EpmetUserFeignClient.java @@ -7,7 +7,6 @@ import com.epmet.feign.fallback.EpmetUserFeignClientFallback; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; /** * @Description @@ -15,12 +14,5 @@ import org.springframework.web.bind.annotation.RequestBody; */ @FeignClient(name = ServiceConstant.EPMET_USER_SERVER, fallback = EpmetUserFeignClientFallback.class) public interface EpmetUserFeignClient { - /** - * 获取最近一次登录的客户信息 - * - * @param userId - * @return - */ - @GetMapping("/epmetuser/staffagencyvisited/getlatestcustomer/{userId}") - Result getLatestCustomer(@PathVariable("userId") String userId); + } diff --git a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/GovOrgFeignClient.java b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/GovOrgFeignClient.java index 6866e03ecd..f87abc24e4 100644 --- a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/GovOrgFeignClient.java +++ b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/GovOrgFeignClient.java @@ -3,6 +3,7 @@ package com.epmet.feign; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.result.CustomerGridByUserIdResultDTO; +import com.epmet.dto.result.LatestCustomerResultDTO; import com.epmet.feign.fallback.GovOrgFeignClientFallBack; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.GetMapping; @@ -25,4 +26,13 @@ public interface GovOrgFeignClient { */ @GetMapping(value = "/gov/org/customergrid/getmygrids/{userId}") Result> getMyGrids(@PathVariable("userId") String userId); + + /** + * 获取最近一次登录的客户信息 + * + * @param userId + * @return + */ + @GetMapping("/gov/org/customerstaffagency/getlatestcustomer/{userId}") + Result getLatestCustomer(@PathVariable("userId") String userId); } diff --git a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallback.java b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallback.java index dfd80859f3..5f551bef80 100644 --- a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallback.java +++ b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallback.java @@ -14,8 +14,4 @@ import org.springframework.stereotype.Component; @Component public class EpmetUserFeignClientFallback implements EpmetUserFeignClient { - @Override - public Result getLatestCustomer(String userId) { - return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getLatestCustomer", userId); - } } diff --git a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/impl/StaffAgencyServiceImpl.java b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/impl/StaffAgencyServiceImpl.java index 5ead6f7e81..1a7a56e39a 100644 --- a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/impl/StaffAgencyServiceImpl.java +++ b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/impl/StaffAgencyServiceImpl.java @@ -55,7 +55,7 @@ public class StaffAgencyServiceImpl implements StaffAgencyService { @Override public Result getLatestCustomer(TokenDto tokenDTO) { - return epmetUserFeignClient.getLatestCustomer(tokenDTO.getUserId()); + return govOrgFeignClient.getLatestCustomer(tokenDTO.getUserId()); } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerStaffAgencyDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerStaffAgencyDTO.java index c97e5097a1..8cc0f73320 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerStaffAgencyDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerStaffAgencyDTO.java @@ -51,7 +51,7 @@ public class CustomerStaffAgencyDTO implements Serializable { /** * 组织机构ID customer_organization.id */ - private String orgId; + private String agencyId; /** * 删除标识 diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/LatestCustomerResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/LatestCustomerResultDTO.java similarity index 91% rename from epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/LatestCustomerResultDTO.java rename to epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/LatestCustomerResultDTO.java index 5bdf00228b..1979096f1a 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/LatestCustomerResultDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/LatestCustomerResultDTO.java @@ -28,4 +28,8 @@ public class LatestCustomerResultDTO implements Serializable { * 工作人员头像 */ private String staffHeadPhoto; + /** + * 性别 + */ + private Integer gender; } diff --git a/epmet-module/gov-org/gov-org-server/pom.xml b/epmet-module/gov-org/gov-org-server/pom.xml index 3bb6930492..a9bd2b6ba3 100644 --- a/epmet-module/gov-org/gov-org-server/pom.xml +++ b/epmet-module/gov-org/gov-org-server/pom.xml @@ -62,6 +62,18 @@ 2.0.0 compile + + com.epmet + oper-crm-client + 2.0.0 + compile + + + com.epmet + epmet-user-client + 2.0.0 + compile + diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerStaffAgencyController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerStaffAgencyController.java index 58219da027..fa1976bf6d 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerStaffAgencyController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerStaffAgencyController.java @@ -26,6 +26,7 @@ import com.epmet.commons.tools.validator.group.AddGroup; import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.commons.tools.validator.group.DefaultGroup; import com.epmet.dto.CustomerStaffAgencyDTO; +import com.epmet.dto.result.LatestCustomerResultDTO; import com.epmet.excel.CustomerStaffAgencyExcel; import com.epmet.service.CustomerStaffAgencyService; import org.springframework.beans.factory.annotation.Autowired; @@ -91,4 +92,16 @@ public class CustomerStaffAgencyController { ExcelUtils.exportExcelToTarget(response, null, list, CustomerStaffAgencyExcel.class); } + /** + * 获取最近一次登录的客户信息 + * + * @param userId 参数 + * @return Result + * @author zhaoqifeng + */ + @GetMapping("getlatestcustomer/{userId}") + public Result getLatestCustomer(@PathVariable("userId") String userId) { + return customerStaffAgencyService.getLatestCustomer(userId); + } + } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffAgencyDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffAgencyDao.java index 8ac905edcb..828c6cdd98 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffAgencyDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffAgencyDao.java @@ -18,6 +18,7 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.CustomerStaffAgencyDTO; import com.epmet.entity.CustomerStaffAgencyEntity; import org.apache.ibatis.annotations.Mapper; @@ -29,5 +30,12 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface CustomerStaffAgencyDao extends BaseDao { + + /** + * 获取最近一次登录的客户信息 + * @param userId + * @return + */ + CustomerStaffAgencyDTO selectLatestCustomerByStaff(String userId); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerStaffAgencyEntity.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerStaffAgencyEntity.java index 9c333137a9..0aa07837ec 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerStaffAgencyEntity.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerStaffAgencyEntity.java @@ -51,6 +51,6 @@ public class CustomerStaffAgencyEntity extends BaseEpmetEntity { /** * 组织机构ID customer_organization.id */ - private String orgId; + private String agencyId; } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/EpmetUserFeignClient.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/EpmetUserFeignClient.java new file mode 100644 index 0000000000..27332bf916 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/EpmetUserFeignClient.java @@ -0,0 +1,30 @@ +package com.epmet.feign; + +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.CustomerStaffDTO; +import com.epmet.feign.fallback.EpmetUserFeignClientFallback; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/3/19 9:32 + */ +@FeignClient(name = ServiceConstant.EPMET_USER_SERVER, fallback = EpmetUserFeignClientFallback.class) +public interface EpmetUserFeignClient { + /** + * 根据用户ID获取工作人员基本信息 + * + * @param formDTO + * @return Result + * @author zhaoqifeng + * @date 2020/4/22 10:05 + **/ + @PostMapping(value = "/epmetuser/customerstaff/getstaffinfobyuserid") + Result getCustomerStaffInfoByUserId(CustomerStaffDTO formDTO); + +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/OperCrmFeignClient.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/OperCrmFeignClient.java new file mode 100644 index 0000000000..9cd6369f4f --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/OperCrmFeignClient.java @@ -0,0 +1,25 @@ +package com.epmet.feign; + +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.CustomerDTO; +import com.epmet.feign.fallback.OperCrmFeignClientFallBack; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/4/22 10:41 + */ +@FeignClient(name = ServiceConstant.OPER_CRM_SERVER, fallback = OperCrmFeignClientFallBack.class) +public interface OperCrmFeignClient { + /** + * 获取客户信息 + * @param dto + * @return + */ + @PostMapping("/oper/crm/customer/getcostomerInfo") + Result getCustomerInfo(@RequestBody CustomerDTO dto); +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallback.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallback.java new file mode 100644 index 0000000000..df59c03f22 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallback.java @@ -0,0 +1,23 @@ +package com.epmet.feign.fallback; + +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.utils.ModuleUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.CustomerStaffDTO; +import com.epmet.dto.OperUserDTO; +import com.epmet.feign.EpmetUserFeignClient; +import org.springframework.stereotype.Component; + +/** + * 用户模块 + * @author zhaoqifeng + * @date 2020/3/19 9:34 + */ +@Component +public class EpmetUserFeignClientFallback implements EpmetUserFeignClient { + + @Override + public Result getCustomerStaffInfoByUserId(CustomerStaffDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.OPER_CRM_SERVER, "getCustomerStaffInfoByUserId", formDTO); + } +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/fallback/OperCrmFeignClientFallBack.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/fallback/OperCrmFeignClientFallBack.java new file mode 100644 index 0000000000..d40619a04c --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/fallback/OperCrmFeignClientFallBack.java @@ -0,0 +1,21 @@ +package com.epmet.feign.fallback; + +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.utils.ModuleUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.CustomerDTO; +import com.epmet.feign.OperCrmFeignClient; +import org.springframework.stereotype.Component; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/4/22 10:43 + */ +@Component +public class OperCrmFeignClientFallBack implements OperCrmFeignClient { + @Override + public Result getCustomerInfo(CustomerDTO dto) { + return ModuleUtils.feignConError(ServiceConstant.OPER_CRM_SERVER, "getCustomerInfo", dto); + } +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerStaffAgencyService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerStaffAgencyService.java index 9ba776f271..2aaee92578 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerStaffAgencyService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerStaffAgencyService.java @@ -19,7 +19,9 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.Result; import com.epmet.dto.CustomerStaffAgencyDTO; +import com.epmet.dto.result.LatestCustomerResultDTO; import com.epmet.entity.CustomerStaffAgencyEntity; import java.util.List; @@ -33,63 +35,71 @@ import java.util.Map; */ public interface CustomerStaffAgencyService extends BaseService { - /** - * 默认分页 - * - * @param params - * @return PageData - * @author generator - * @date 2020-04-20 - */ - PageData page(Map params); + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-04-20 + */ + PageData page(Map params); - /** - * 默认查询 - * - * @param params - * @return java.util.List - * @author generator - * @date 2020-04-20 - */ - List list(Map params); + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-04-20 + */ + List list(Map params); - /** - * 单条查询 - * - * @param id - * @return CustomerStaffAgencyDTO - * @author generator - * @date 2020-04-20 - */ - CustomerStaffAgencyDTO get(String id); + /** + * 单条查询 + * + * @param id + * @return CustomerStaffAgencyDTO + * @author generator + * @date 2020-04-20 + */ + CustomerStaffAgencyDTO get(String id); - /** - * 默认保存 - * - * @param dto - * @return void - * @author generator - * @date 2020-04-20 - */ - void save(CustomerStaffAgencyDTO dto); + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-04-20 + */ + void save(CustomerStaffAgencyDTO dto); - /** - * 默认更新 - * - * @param dto - * @return void - * @author generator - * @date 2020-04-20 - */ - void update(CustomerStaffAgencyDTO dto); + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-04-20 + */ + void update(CustomerStaffAgencyDTO dto); - /** - * 批量删除 - * - * @param ids - * @return void - * @author generator - * @date 2020-04-20 - */ - void delete(String[] ids); + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-04-20 + */ + void delete(String[] ids); + + /** + * 获取最近一次登录的客户信息 + * + * @param userId + * @return + */ + Result getLatestCustomer(String userId); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffAgencyServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffAgencyServiceImpl.java index f1786860da..57d8ae21d8 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffAgencyServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffAgencyServiceImpl.java @@ -23,9 +23,14 @@ import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.utils.Result; import com.epmet.dao.CustomerStaffAgencyDao; +import com.epmet.dto.CustomerDTO; import com.epmet.dto.CustomerStaffAgencyDTO; +import com.epmet.dto.CustomerStaffDTO; import com.epmet.entity.CustomerStaffAgencyEntity; +import com.epmet.feign.EpmetUserFeignClient; +import com.epmet.feign.OperCrmFeignClient; import com.epmet.redis.CustomerStaffAgencyRedis; import com.epmet.service.CustomerStaffAgencyService; import org.apache.commons.lang3.StringUtils; @@ -48,6 +53,10 @@ public class CustomerStaffAgencyServiceImpl extends BaseServiceImpl page(Map params) { @@ -101,4 +110,26 @@ public class CustomerStaffAgencyServiceImpl extends BaseServiceImpl getLatestCustomer(String userId) { + LatestCustomerResultDTO resultDTO = new LatestCustomerResultDTO(); + CustomerStaffAgencyDTO customerStaffAgencyDTO = baseDao.selectLatestCustomerByStaff(userId); + + resultDTO.setAgencyId(customerStaffAgencyDTO.getAgencyId()); + resultDTO.setCustomerId(customerStaffAgencyDTO.getCustomerId()); + //获取工作人员头像 + CustomerStaffDTO customerStaffParam = new CustomerStaffDTO(); + customerStaffParam.setUserId(userId); + Result staffInfo = + epmetUserFeignClient.getCustomerStaffInfoByUserId(customerStaffParam); + resultDTO.setStaffHeadPhoto(staffInfo.getData().getHeadPhoto()); + resultDTO.setGender(staffInfo.getData().getGender()); + //获取客户名称 + CustomerDTO customerDTO = new CustomerDTO(); + customerDTO.setId(customerStaffAgencyDTO.getCustomerId()); + Result customerResult = operCrmFeignClient.getCustomerInfo(customerDTO); + resultDTO.setCustomerName(customerResult.getData().getCustomerName()); + return new Result().ok(resultDTO); + } + } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffAgencyDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffAgencyDao.xml index 33dbb3e61d..016f75962a 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffAgencyDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffAgencyDao.xml @@ -7,7 +7,7 @@ - + @@ -15,6 +15,18 @@ - + \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java index b68ea382c6..6ae1285955 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java @@ -116,4 +116,17 @@ public class CustomerStaffController { ValidatorUtils.validateEntity(formDTO); return customerStaffService.getCustomerStaffInfo(formDTO); } + + /** + * 根据用户ID获取工作人员基本信息 + * + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author zhaoqifeng + * @date 2020/4/22 10:05 + **/ + @PostMapping(value = "getstaffinfobyuserid") + public Result getCustomerStaffInfoByUserId(CustomerStaffDTO formDTO) { + return customerStaffService.getCustomerStaffInfoByUserId(formDTO); + } } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffAgencyVisitedController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffAgencyVisitedController.java index 73d2ea4d27..488a103ef0 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffAgencyVisitedController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffAgencyVisitedController.java @@ -19,7 +19,6 @@ package com.epmet.controller; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.form.StaffLoginAgencyRecordFormDTO; -import com.epmet.dto.result.LatestCustomerResultDTO; import com.epmet.dto.result.StaffLatestAgencyResultDTO; import com.epmet.service.StaffAgencyVisitedService; import org.springframework.beans.factory.annotation.Autowired; @@ -63,15 +62,4 @@ public class StaffAgencyVisitedController { return staffAgencyVisitedService.saveStaffLoginRecord(formDTO); } - /** - * 获取最近一次登录的客户信息 - * - * @param userId 参数 - * @return Result - * @author zhaoqifeng - */ - @GetMapping("getlatestcustomer/{userId}") - public Result getLatestCustomer(@PathVariable("userId") String userId) { - return staffAgencyVisitedService.getLatestCustomer(userId); - } } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffAgencyVisitedService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffAgencyVisitedService.java index d8a3dc064e..71622dfa4a 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffAgencyVisitedService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffAgencyVisitedService.java @@ -19,11 +19,9 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; -import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.StaffAgencyVisitedDTO; import com.epmet.dto.form.StaffLoginAgencyRecordFormDTO; -import com.epmet.dto.result.LatestCustomerResultDTO; import com.epmet.dto.result.StaffLatestAgencyResultDTO; import com.epmet.entity.StaffAgencyVisitedEntity; @@ -116,12 +114,4 @@ public interface StaffAgencyVisitedService extends BaseService getLatestCustomer(String userId); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffAgencyVisitedServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffAgencyVisitedServiceImpl.java index 5108b1d8a5..126dfd728c 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffAgencyVisitedServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffAgencyVisitedServiceImpl.java @@ -22,15 +22,11 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.page.PageData; -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.dao.StaffAgencyVisitedDao; -import com.epmet.dto.CustomerDTO; -import com.epmet.dto.CustomerStaffDTO; import com.epmet.dto.StaffAgencyVisitedDTO; import com.epmet.dto.form.StaffLoginAgencyRecordFormDTO; -import com.epmet.dto.result.LatestCustomerResultDTO; import com.epmet.dto.result.StaffLatestAgencyResultDTO; import com.epmet.entity.StaffAgencyVisitedEntity; import com.epmet.feign.OperCrmFeignClient; @@ -131,23 +127,4 @@ public class StaffAgencyVisitedServiceImpl extends BaseServiceImpl getLatestCustomer(String userId) { - LatestCustomerResultDTO resultDTO = new LatestCustomerResultDTO(); - StaffLatestAgencyResultDTO latestCustomer = baseDao.selectLatestCustomer(userId); - resultDTO.setAgencyId(latestCustomer.getAgencyId()); - resultDTO.setCustomerId(latestCustomer.getCustomerId()); - //获取工作人员头像 - CustomerStaffDTO customerStaffParam = new CustomerStaffDTO(); - customerStaffParam.setUserId(userId); - Result staffInfo = - customerStaffService.getCustomerStaffInfoByUserId(customerStaffParam); - resultDTO.setStaffHeadPhoto(staffInfo.getData().getHeadPhoto()); - //获取客户名称 - CustomerDTO customerDTO = new CustomerDTO(); - customerDTO.setId(latestCustomer.getCustomerId()); - Result customerResult = operCrmFeignClient.getCustomerInfo(customerDTO); - resultDTO.setCustomerName(customerResult.getData().getCustomerName()); - return new Result().ok(resultDTO); - } } \ No newline at end of file