Browse Source

Merge branch 'dev_oper_login' into dev_temp

dev
sunyuchao 5 years ago
parent
commit
614251e3db
  1. 2
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java
  2. 2
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerStaffDao.java
  3. 2
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/CustomerStaffService.java
  4. 26
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java
  5. 2
      epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml

2
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java

@ -385,7 +385,7 @@ public class CustomerStaffController {
* @Date 11:09 2020-08-25
**/
@PostMapping(value = "staffbasicinfo")
public Result<BasicInfoResultDTO> staffBasicInfo(@LoginUser TokenDto tokenDTO){
public Result<StaffBasicInfoResultDTO> staffBasicInfo(@LoginUser TokenDto tokenDTO){
return customerStaffService.selectStaffBasicInfo(tokenDTO.getUserId());
}

2
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerStaffDao.java

@ -189,7 +189,7 @@ public interface CustomerStaffDao extends BaseDao<CustomerStaffEntity> {
* @Author zhangyong
* @Date 10:07 2020-08-26
**/
BasicInfoResultDTO selectStaffBasicInfo(@Param("userId") String userId);
StaffBasicInfoResultDTO selectStaffBasicInfo(@Param("userId") String userId);
/**
* 根据staffId查询用户基本信息

2
epmet-user/epmet-user-server/src/main/java/com/epmet/service/CustomerStaffService.java

@ -305,7 +305,7 @@ public interface CustomerStaffService extends BaseService<CustomerStaffEntity> {
* @Author zhangyong
* @Date 11:10 2020-08-25
**/
Result<BasicInfoResultDTO> selectStaffBasicInfo(String userId);
Result<StaffBasicInfoResultDTO> selectStaffBasicInfo(String userId);
/**
* @param formDTO

26
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java

@ -623,7 +623,8 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl<CustomerStaffDao,
// 1.根据手机号,去 customer_staff表,进行查询; 查询结果 多条:字段 customer_id,user_id
List<CustomerStaffDTO> customerStaffList = baseDao.selectListCustomerStaffDTO(formDTO.getPhone());
for (CustomerStaffDTO staffDTO : customerStaffList){
//sun 2020.11.12 需求变更-之前pc工作端只能是工作端小程序的超级管理员能登陆 现调整为工作端小程序的工作人员均可登陆(使用账号密码登陆) start
/*for (CustomerStaffDTO staffDTO : customerStaffList){
// 2.根据 customer_id 去 gov_staff_role表,查询 customer_id + role_key = root_manager ,确定 根管理员的id,即roleId
GovStaffRoleDTO roleKey = govStaffRoleDao.getRoleByCustomerIdAndRoleKey(staffDTO.getCustomerId(), RoleKeyConstants.ROLE_KEY_ROOT_MANAGER);
if (null != roleKey){
@ -645,14 +646,29 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl<CustomerStaffDao,
}
}
}
}
}*/
for (CustomerStaffDTO staffDTO : customerStaffList){
customerDTO.setId(staffDTO.getCustomerId());
Result<CustomerDTO> customerInfo = operCrmOpenFeignClient.getCustomerInfo(customerDTO);
if (!customerInfo.success()) {
logger.error(String.format("获取客户信息失败,调用%s服务查询客户名称失败,入参%s", ServiceConstant.OPER_CRM_SERVER, JSON.toJSONString(staffDTO.getCustomerId())));
} else {
if (null != customerInfo.getData()){
CustomerListResultDTO resultDTO = new CustomerListResultDTO();
resultDTO.setCustomerId(customerInfo.getData().getId());
resultDTO.setCustomerName(customerInfo.getData().getCustomerName());
listResultDTO.add(resultDTO);
}
}
}
//2020.11.12 sun end
return new Result<List<CustomerListResultDTO>>().ok(listResultDTO);
}
@Override
public Result<BasicInfoResultDTO> selectStaffBasicInfo(String userId) {
BasicInfoResultDTO resultDTO = baseDao.selectStaffBasicInfo(userId);
return new Result<BasicInfoResultDTO>().ok(resultDTO);
public Result<StaffBasicInfoResultDTO> selectStaffBasicInfo(String userId) {
StaffBasicInfoResultDTO resultDTO = baseDao.selectStaffBasicInfo(userId);
return new Result<StaffBasicInfoResultDTO>().ok(resultDTO);
}
/**

2
epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml

@ -313,7 +313,7 @@
LIMIT 1
</select>
<select id="selectStaffBasicInfo" resultType="com.epmet.dto.result.BasicInfoResultDTO">
<select id="selectStaffBasicInfo" resultType="com.epmet.dto.result.StaffBasicInfoResultDTO">
SELECT
cs.CUSTOMER_ID customerId,
cs.USER_ID id,

Loading…
Cancel
Save