Browse Source

默认密码

master
YUJT 3 years ago
parent
commit
305f1c8a1f
  1. 52
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java

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

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

Loading…
Cancel
Save