Browse Source

灵山项目:修改工作人员获取角色错误的问题,增加返回工作人员名族和网格名称;

master
luyan 2 years ago
parent
commit
ecee67107b
  1. 10
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/StaffDetailResultDTO.java
  2. 2
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/CustomerStaffDTO.java
  3. 14
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java
  4. 4
      epmet-user/epmet-user-server/src/main/resources/mapper/GovStaffRoleDao.xml

10
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/StaffDetailResultDTO.java

@ -97,4 +97,14 @@ public class StaffDetailResultDTO implements Serializable {
*/
private String political;
/**
* 网格名称
*/
private String gridName;
/**
* 民族
*/
private String MZ;
}

2
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/CustomerStaffDTO.java

@ -189,5 +189,7 @@ public class CustomerStaffDTO implements Serializable {
*/
private String political;
private String MZ;
}

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

@ -24,6 +24,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.entity.DataScope;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.*;
import com.epmet.commons.tools.dto.form.IdAndNameDTO;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
@ -37,10 +38,7 @@ import com.epmet.commons.tools.redis.common.CustomerOrgRedis;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache;
import com.epmet.commons.tools.security.password.PasswordUtils;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.commons.tools.utils.IdCardRegexUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.utils.*;
import com.epmet.constant.CustomerStaffConstant;
import com.epmet.constant.RoleKeyConstants;
import com.epmet.constant.UserConstant;
@ -694,6 +692,13 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl<CustomerStaffDao,
if (StringUtils.isBlank(customerStaffDTO.getHeadPhoto())) {
customerStaffDTO.setHeadPhoto("");
}
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(EpmetRequestHolder.getLoginUserCustomerId(), fromDTO.getStaffId());
List<IdAndNameDTO> gridList = staffInfo.getGridList();
if (null != staffInfo.getGridList() && staffInfo.getGridList().size() > 0) {
resultDTO.setGridName(staffInfo.getAgencyName() + "-" + gridList.get(0).getName());
}else {
resultDTO.setGridName(staffInfo.getAgencyName());
}
resultDTO.setId(customerStaffDTO.getId());
resultDTO.setStaffId(customerStaffDTO.getUserId());
resultDTO.setName(customerStaffDTO.getRealName());
@ -711,6 +716,7 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl<CustomerStaffDao,
resultDTO.setBirthday(customerStaffDTO.getBirthday());
resultDTO.setPolitical(customerStaffDTO.getPolitical());
resultDTO.setIdCard(customerStaffDTO.getIdCard());
resultDTO.setMZ(customerStaffDTO.getMZ());
//获取工作人员角色
List<GovStaffRoleEntity> staffRoles = govStaffRoleService.listRolesByStaffId(fromDTO.getStaffId(), fromDTO.getAgencyId());

4
epmet-user/epmet-user-server/src/main/resources/mapper/GovStaffRoleDao.xml

@ -42,7 +42,9 @@
INNER JOIN gov_staff_role r ON ( sr.ROLE_ID = r.ID ) AND r.DEL_FLAG = '0'
WHERE
sr.STAFF_ID = #{staffId}
AND sr.ORG_ID = #{orgId}
<if test="null != orgId and orgId != ''">
AND sr.ORG_ID = #{orgId}
</if>
AND sr.DEL_FLAG = '0'
AND r.DEL_FLAG = '0'
ORDER BY r.SORT asc

Loading…
Cancel
Save