|
|
@ -193,15 +193,15 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl<CustomerStaffDao, |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public Result<List<StaffGridListDTO>> selectStaffGridListByUserId(List<UserIdAndPidDTO> customerStaffGridDTOS) { |
|
|
public Result<List<StaffGridListDTO>> selectStaffGridListByUserId(List<UserIdAndPidDTO> customerStaffGridDTOS) { |
|
|
if (CollectionUtils.isEmpty(customerStaffGridDTOS)){ |
|
|
if (CollectionUtils.isEmpty(customerStaffGridDTOS)) { |
|
|
return new Result<List<StaffGridListDTO>>().ok(new ArrayList<>()); |
|
|
return new Result<List<StaffGridListDTO>>().ok(new ArrayList<>()); |
|
|
} |
|
|
} |
|
|
List<GovStaffRoleResultDTO> gridManager = staffRoleService.listStaffsInRole(UserRoleConstant.GRID_MANAGER, customerStaffGridDTOS.get(0).getPid(), DataScope.getDefault()); |
|
|
List<GovStaffRoleResultDTO> gridManager = staffRoleService.listStaffsInRole(UserRoleConstant.GRID_MANAGER, customerStaffGridDTOS.get(0).getPid(), DataScope.getDefault()); |
|
|
List<StaffGridListDTO> staffGridListDTOS = baseDao.selectStaffGridListByUserId(customerStaffGridDTOS); |
|
|
List<StaffGridListDTO> staffGridListDTOS = baseDao.selectStaffGridListByUserId(customerStaffGridDTOS); |
|
|
for (GovStaffRoleResultDTO govStaffRoleResultDTO : gridManager) { |
|
|
for (GovStaffRoleResultDTO govStaffRoleResultDTO : gridManager) { |
|
|
if (govStaffRoleResultDTO.getRoleKey().equals(UserRoleConstant.GRID_MANAGER)){ |
|
|
if (govStaffRoleResultDTO.getRoleKey().equals(UserRoleConstant.GRID_MANAGER)) { |
|
|
for (StaffGridListDTO staffGridListDTO : staffGridListDTOS) { |
|
|
for (StaffGridListDTO staffGridListDTO : staffGridListDTOS) { |
|
|
if (staffGridListDTO.getStaffId().equals(govStaffRoleResultDTO.getStaffId())){ |
|
|
if (staffGridListDTO.getStaffId().equals(govStaffRoleResultDTO.getStaffId())) { |
|
|
staffGridListDTO.setRoleName(govStaffRoleResultDTO.getRoleName()); |
|
|
staffGridListDTO.setRoleName(govStaffRoleResultDTO.getRoleName()); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
@ -344,7 +344,7 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl<CustomerStaffDao, |
|
|
dto.setAgencyId(fromDTO.getAgencyId()); |
|
|
dto.setAgencyId(fromDTO.getAgencyId()); |
|
|
Map m = new HashMap(16); |
|
|
Map m = new HashMap(16); |
|
|
roleKeyValue.forEach(r -> { |
|
|
roleKeyValue.forEach(r -> { |
|
|
m.put(r.getRoleKey(),r.getRoleName()); |
|
|
m.put(r.getRoleKey(), r.getRoleName()); |
|
|
}); |
|
|
}); |
|
|
dto.setRoles(m); |
|
|
dto.setRoles(m); |
|
|
CustomerStaffRedis.delStaffInfoFormCache(dto.getCustomerId(), dto.getStaffId()); |
|
|
CustomerStaffRedis.delStaffInfoFormCache(dto.getCustomerId(), dto.getStaffId()); |
|
|
@ -359,7 +359,7 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl<CustomerStaffDao, |
|
|
customerStaffFormDTO.setCustomerId(fromDTO.getCustomerId()); |
|
|
customerStaffFormDTO.setCustomerId(fromDTO.getCustomerId()); |
|
|
customerStaffFormDTO.setMobile(fromDTO.getMobile()); |
|
|
customerStaffFormDTO.setMobile(fromDTO.getMobile()); |
|
|
CustomerStaffDTO customerStaffDTO = baseDao.selectListCustomerStaffInfo(customerStaffFormDTO); |
|
|
CustomerStaffDTO customerStaffDTO = baseDao.selectListCustomerStaffInfo(customerStaffFormDTO); |
|
|
if (null != customerStaffDTO && !fromDTO.getStaffId().equals(customerStaffDTO.getUserId())){ |
|
|
if (null != customerStaffDTO && !fromDTO.getStaffId().equals(customerStaffDTO.getUserId())) { |
|
|
return new Result<CustomerStaffDTO>().error(EpmetErrorCode.MOBILE_USED.getCode(), EpmetErrorCode.MOBILE_USED.getMsg()); |
|
|
return new Result<CustomerStaffDTO>().error(EpmetErrorCode.MOBILE_USED.getCode(), EpmetErrorCode.MOBILE_USED.getMsg()); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ -418,7 +418,7 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl<CustomerStaffDao, |
|
|
dto.setAgencyId(fromDTO.getAgencyId()); |
|
|
dto.setAgencyId(fromDTO.getAgencyId()); |
|
|
Map m = new HashMap(16); |
|
|
Map m = new HashMap(16); |
|
|
roleKeyValue.forEach(r -> { |
|
|
roleKeyValue.forEach(r -> { |
|
|
m.put(r.getRoleKey(),r.getRoleName()); |
|
|
m.put(r.getRoleKey(), r.getRoleName()); |
|
|
}); |
|
|
}); |
|
|
dto.setRoles(m); |
|
|
dto.setRoles(m); |
|
|
CustomerStaffRedis.delStaffInfoFormCache(dto.getCustomerId(), dto.getStaffId()); |
|
|
CustomerStaffRedis.delStaffInfoFormCache(dto.getCustomerId(), dto.getStaffId()); |
|
|
@ -541,21 +541,21 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl<CustomerStaffDao, |
|
|
**/ |
|
|
**/ |
|
|
@Override |
|
|
@Override |
|
|
public void resetStaffPassword(StaffResetPwFormDTO staffResetPwFormDTO) { |
|
|
public void resetStaffPassword(StaffResetPwFormDTO staffResetPwFormDTO) { |
|
|
CustomerStaffDTO customerStaffDTO=this.getCustomerStaff(staffResetPwFormDTO.getStaffId()); |
|
|
CustomerStaffDTO customerStaffDTO = this.getCustomerStaff(staffResetPwFormDTO.getStaffId()); |
|
|
if(null==customerStaffDTO){ |
|
|
if (null == customerStaffDTO) { |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
//密码加密
|
|
|
//密码加密
|
|
|
String password = PasswordUtils.encode(staffResetPwFormDTO.getNewPassword()); |
|
|
String password = PasswordUtils.encode(staffResetPwFormDTO.getNewPassword()); |
|
|
logger.info(String.format("密码%s加密后为%s",staffResetPwFormDTO.getNewPassword(),password)); |
|
|
logger.info(String.format("密码%s加密后为%s", staffResetPwFormDTO.getNewPassword(), password)); |
|
|
customerStaffDTO.setPassword(password); |
|
|
customerStaffDTO.setPassword(password); |
|
|
this.update(customerStaffDTO); |
|
|
this.update(customerStaffDTO); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* @Description 得到工组人员的头像、名称、所属机关名称 |
|
|
|
|
|
* @param userId |
|
|
* @param userId |
|
|
* @return |
|
|
* @return |
|
|
|
|
|
* @Description 得到工组人员的头像、名称、所属机关名称 |
|
|
* @author wangc |
|
|
* @author wangc |
|
|
* @date 2020.07.27 14:45 |
|
|
* @date 2020.07.27 14:45 |
|
|
**/ |
|
|
**/ |
|
|
@ -563,10 +563,10 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl<CustomerStaffDao, |
|
|
public StaffEtAgencyResultDTO getStaffMsg(IssueInitiatorFormDTO userId) { |
|
|
public StaffEtAgencyResultDTO getStaffMsg(IssueInitiatorFormDTO userId) { |
|
|
StaffEtAgencyResultDTO result = new StaffEtAgencyResultDTO(); |
|
|
StaffEtAgencyResultDTO result = new StaffEtAgencyResultDTO(); |
|
|
CustomerStaffDTO staff = baseDao.selectByStaffId(userId.getUserId()); |
|
|
CustomerStaffDTO staff = baseDao.selectByStaffId(userId.getUserId()); |
|
|
if(null != staff){ |
|
|
if (null != staff) { |
|
|
Result<CustomerAgencyDTO> agencyResult = govOrgOpenFeignClient.getAgencyByStaff(userId.getUserId()); |
|
|
Result<CustomerAgencyDTO> agencyResult = govOrgOpenFeignClient.getAgencyByStaff(userId.getUserId()); |
|
|
if(agencyResult.success() && null != agencyResult.getData()){ |
|
|
if (agencyResult.success() && null != agencyResult.getData()) { |
|
|
result = ConvertUtils.sourceToTarget(agencyResult.getData(),StaffEtAgencyResultDTO.class); |
|
|
result = ConvertUtils.sourceToTarget(agencyResult.getData(), StaffEtAgencyResultDTO.class); |
|
|
result.setAgencyId(agencyResult.getData().getId()); |
|
|
result.setAgencyId(agencyResult.getData().getId()); |
|
|
result.setNickname(new StringBuilder(agencyResult.getData().getOrganizationName()).append(ModuleConstant.DASH).append(staff.getRealName()).toString()); |
|
|
result.setNickname(new StringBuilder(agencyResult.getData().getOrganizationName()).append(ModuleConstant.DASH).append(staff.getRealName()).toString()); |
|
|
} |
|
|
} |
|
|
@ -594,8 +594,8 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl<CustomerStaffDao, |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* @Description 查询工作人员的信息 |
|
|
|
|
|
* @param formDTO |
|
|
* @param formDTO |
|
|
|
|
|
* @Description 查询工作人员的信息 |
|
|
* @author zxc |
|
|
* @author zxc |
|
|
* @date 2020/8/13 1:45 下午 |
|
|
* @date 2020/8/13 1:45 下午 |
|
|
*/ |
|
|
*/ |
|
|
@ -604,10 +604,10 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl<CustomerStaffDao, |
|
|
List<String> userIds = formDTO.getUserIds(); |
|
|
List<String> userIds = formDTO.getUserIds(); |
|
|
// 1. 根据userId查询人员基本信息
|
|
|
// 1. 根据userId查询人员基本信息
|
|
|
List<StaffSinGridResultDTO> staffInfoList = new ArrayList<>(); |
|
|
List<StaffSinGridResultDTO> staffInfoList = new ArrayList<>(); |
|
|
userIds.forEach(staffId->{ |
|
|
userIds.forEach(staffId -> { |
|
|
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), staffId); |
|
|
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), staffId); |
|
|
if (staffInfo ==null){ |
|
|
if (staffInfo == null) { |
|
|
log.error("getStaffInfoList fail customerId:{}, staffId:{} not exist in db",formDTO.getCustomerId(), staffId); |
|
|
log.error("getStaffInfoList fail customerId:{}, staffId:{} not exist in db", formDTO.getCustomerId(), staffId); |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
StaffSinGridResultDTO resultDTO = new StaffSinGridResultDTO(); |
|
|
StaffSinGridResultDTO resultDTO = new StaffSinGridResultDTO(); |
|
|
@ -617,7 +617,7 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl<CustomerStaffDao, |
|
|
resultDTO.setGender(staffInfo.getGender()); |
|
|
resultDTO.setGender(staffInfo.getGender()); |
|
|
|
|
|
|
|
|
List<RoleResultDTO> roleInfoList = new ArrayList<>(); |
|
|
List<RoleResultDTO> roleInfoList = new ArrayList<>(); |
|
|
staffInfo.getRoleMap().forEach((key,value) ->{ |
|
|
staffInfo.getRoleMap().forEach((key, value) -> { |
|
|
RoleResultDTO dto = new RoleResultDTO(); |
|
|
RoleResultDTO dto = new RoleResultDTO(); |
|
|
dto.setRoleKey(key); |
|
|
dto.setRoleKey(key); |
|
|
dto.setRoleName(value); |
|
|
dto.setRoleName(value); |
|
|
@ -649,9 +649,9 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl<CustomerStaffDao, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* @Description 查找工作人员的信息 - 对外开放接口 |
|
|
|
|
|
* @param staffParam |
|
|
* @param staffParam |
|
|
* @return |
|
|
* @return |
|
|
|
|
|
* @Description 查找工作人员的信息 - 对外开放接口 |
|
|
* @author wangc |
|
|
* @author wangc |
|
|
* @date 2020.08.17 10:30 |
|
|
* @date 2020.08.17 10:30 |
|
|
**/ |
|
|
**/ |
|
|
@ -660,15 +660,15 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl<CustomerStaffDao, |
|
|
//查找工作人员信息
|
|
|
//查找工作人员信息
|
|
|
//最近一次登陆的而网格、人员信息、权限
|
|
|
//最近一次登陆的而网格、人员信息、权限
|
|
|
ExtStaffInfoResultDTO result = baseDao.selectStaffInfoExt(staffParam.getStaffId()); |
|
|
ExtStaffInfoResultDTO result = baseDao.selectStaffInfoExt(staffParam.getStaffId()); |
|
|
if(null != result) { |
|
|
if (null != result) { |
|
|
result.setUserId(staffParam.getStaffId()); |
|
|
result.setUserId(staffParam.getStaffId()); |
|
|
Result<ExtStaffInfoResultDTO> govOrgResult = |
|
|
Result<ExtStaffInfoResultDTO> govOrgResult = |
|
|
govOrgOpenFeignClient.staffInfoExt(result); |
|
|
govOrgOpenFeignClient.staffInfoExt(result); |
|
|
if(govOrgResult.success() && null != govOrgResult.getData()){ |
|
|
if (govOrgResult.success() && null != govOrgResult.getData()) { |
|
|
return govOrgResult.getData(); |
|
|
return govOrgResult.getData(); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
log.warn("com.epmet.service.impl.CustomerStaffServiceImpl.extStaffInfo,根据传入的用户Id未找到对应的工作人员,传参:{}",JSON.toJSONString(staffParam)); |
|
|
log.warn("com.epmet.service.impl.CustomerStaffServiceImpl.extStaffInfo,根据传入的用户Id未找到对应的工作人员,传参:{}", JSON.toJSONString(staffParam)); |
|
|
return null; |
|
|
return null; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ -714,13 +714,13 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl<CustomerStaffDao, |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
}*/ |
|
|
}*/ |
|
|
for (CustomerStaffDTO staffDTO : customerStaffList){ |
|
|
for (CustomerStaffDTO staffDTO : customerStaffList) { |
|
|
customerDTO.setId(staffDTO.getCustomerId()); |
|
|
customerDTO.setId(staffDTO.getCustomerId()); |
|
|
Result<CustomerDTO> customerInfo = operCrmOpenFeignClient.getCustomerInfo(customerDTO); |
|
|
Result<CustomerDTO> customerInfo = operCrmOpenFeignClient.getCustomerInfo(customerDTO); |
|
|
if (!customerInfo.success()) { |
|
|
if (!customerInfo.success()) { |
|
|
logger.warn(String.format("获取客户信息失败,调用%s服务查询客户名称失败,入参%s", ServiceConstant.OPER_CRM_SERVER, JSON.toJSONString(staffDTO.getCustomerId()))); |
|
|
logger.warn(String.format("获取客户信息失败,调用%s服务查询客户名称失败,入参%s", ServiceConstant.OPER_CRM_SERVER, JSON.toJSONString(staffDTO.getCustomerId()))); |
|
|
} else { |
|
|
} else { |
|
|
if (null != customerInfo.getData()){ |
|
|
if (null != customerInfo.getData()) { |
|
|
CustomerListResultDTO resultDTO = new CustomerListResultDTO(); |
|
|
CustomerListResultDTO resultDTO = new CustomerListResultDTO(); |
|
|
resultDTO.setCustomerId(customerInfo.getData().getId()); |
|
|
resultDTO.setCustomerId(customerInfo.getData().getId()); |
|
|
resultDTO.setCustomerName(customerInfo.getData().getCustomerName()); |
|
|
resultDTO.setCustomerName(customerInfo.getData().getCustomerName()); |
|
|
@ -776,8 +776,9 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl<CustomerStaffDao, |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 根据staffId查询用户基本信息 |
|
|
* 根据staffId查询用户基本信息 |
|
|
* @author sun |
|
|
* |
|
|
* @return |
|
|
* @return |
|
|
|
|
|
* @author sun |
|
|
*/ |
|
|
*/ |
|
|
@Override |
|
|
@Override |
|
|
public BasicInfoResultDTO getStaffBasicInfo(StaffBasicInfoFromDTO fromDTO) { |
|
|
public BasicInfoResultDTO getStaffBasicInfo(StaffBasicInfoFromDTO fromDTO) { |
|
|
@ -791,6 +792,7 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl<CustomerStaffDao, |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 【通讯录】工作人员解禁 |
|
|
* 【通讯录】工作人员解禁 |
|
|
|
|
|
* |
|
|
* @author sun |
|
|
* @author sun |
|
|
*/ |
|
|
*/ |
|
|
@Override |
|
|
@Override |
|
|
|