Browse Source

EXT staffInfo staffPermission接口修改

master
wangchao 5 years ago
parent
commit
6be7a5b8b5
  1. 9
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java
  2. 25
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java
  3. 16
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml
  4. 9
      epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java
  5. 5
      epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java
  6. 12
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffAgencyVisitedController.java
  7. 1
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffAgencyVisitedDao.java
  8. 8
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffAgencyVisitedService.java
  9. 16
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffAgencyVisitedServiceImpl.java
  10. 16
      epmet-user/epmet-user-server/src/main/resources/mapper/StaffAgencyVisitedDao.xml

9
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java

@ -133,7 +133,14 @@ public interface CustomerAgencyDao extends BaseDao<CustomerAgencyEntity> {
* @date 2020.08.17 09:50 * @date 2020.08.17 09:50
**/ **/
ExtStaffInfoResultDTO selectAgencyAndGridInfoExt(@Param("gridId") String gridId); ExtStaffInfoResultDTO selectAgencyAndGridInfoExt(@Param("gridId") String gridId);
/**
* @Description 当没有工作人员最近访问的gridId时查询该用户所属的组织机关信息
* @param staffId
* @return
* @author wangc
* @date 2020.08.17 09:50
**/
ExtStaffInfoResultDTO selectAgencyInfoWhenGridIdIsNull(@Param("staffId")String staffId);
/** /**
* @Description 根据agencyId查找指定机构的信息直属网格部门 * @Description 根据agencyId查找指定机构的信息直属网格部门
* @param agencyId * @param agencyId

25
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java

@ -848,8 +848,12 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl<CustomerAgencyDao
public ExtStaffInfoResultDTO staffInfoExt(ExtStaffInfoResultDTO result) { public ExtStaffInfoResultDTO staffInfoExt(ExtStaffInfoResultDTO result) {
//1.查找对应的所属关系,通过最近一次登陆的网格,通过网格查找对应的机关和客户 //1.查找对应的所属关系,通过最近一次登陆的网格,通过网格查找对应的机关和客户
ExtStaffInfoResultDTO orgInfo = ExtStaffInfoResultDTO orgInfo;
baseDao.selectAgencyAndGridInfoExt(result.getGridId()); if(StringUtils.isNotBlank(result.getGridId())){
orgInfo = baseDao.selectAgencyAndGridInfoExt(result.getGridId());
}else{
orgInfo = baseDao.selectAgencyInfoWhenGridIdIsNull(result.getUserId());
}
mergeObject(orgInfo,result); mergeObject(orgInfo,result);
//2.查找客户名称 //2.查找客户名称
CustomerDTO customerParam = new CustomerDTO(); CustomerDTO customerParam = new CustomerDTO();
@ -881,22 +885,17 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl<CustomerAgencyDao
@Override @Override
public ExtStaffPermissionResultDTO staffPermissionExt(String staffId) { public ExtStaffPermissionResultDTO staffPermissionExt(String staffId) {
//1.通过staffId去user服务查询最近一次登陆的agencyId
Result<String> agency = CustomerStaffAgencyDTO agency = customerStaffAgencyDao.selectLatestCustomerByStaff(staffId);
epmetUserOpenFeignClient.latestAgency(staffId); if(null == agency || StringUtils.isBlank(agency.getAgencyId())){
if(agency.success() && StringUtils.isNotBlank(agency.getData())){ logger.error("com.epmet.service.impl.CustomerAgencyServiceImpl.staffPermissionExt,没有找到工作人员所属的机关信息,用户Id:{}",staffId);
//2.根据此agencyId查询数据权限
ExtStaffPermissionResultDTO res = baseDao.selectAgencyById(agency.getData());
return res;
}else{
logger.error("com.epmet.service.impl.CustomerAgencyServiceImpl.staffPermissionExt,没有找到工作人员最近一次登陆的Agency信息,用户Id:{}",staffId);
ExtStaffPermissionResultDTO emptyResult = new ExtStaffPermissionResultDTO(); ExtStaffPermissionResultDTO emptyResult = new ExtStaffPermissionResultDTO();
checkFieldAndSetDefault(emptyResult); checkFieldAndSetDefault(emptyResult);
return emptyResult; return emptyResult;
} }
ExtStaffPermissionResultDTO res = baseDao.selectAgencyById(agency.getAgencyId());
return res;
} }
/** /**

16
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml

@ -169,6 +169,22 @@
ORDER BY created_time DESC ORDER BY created_time DESC
</select> </select>
<!-- 当没有工作人员最近访问的gridId时查询该用户所属的组织机关信息 -->
<select id="selectAgencyInfoWhenGridIdIsNull" resultType="com.epmet.dto.result.ExtStaffInfoResultDTO">
SELECT
agency.ID AS agencyId,
agency.ORGANIZATION_NAME AS agencyName,
agency.PIDS AS agencyIdPath,
agency.ALL_PARENT_NAME AS agencyNamePath,
agency.CUSTOMER_ID AS customerId
FROM
CUSTOMER_STAFF_AGENCY staff
LEFT JOIN CUSTOMER_AGENCY agency ON staff.AGENCY_ID = agency.ID AND agency.DEL_FLAG = '0'
WHERE
staff.DEL_FLAG = '0'
AND staff.USER_ID = #{staffId}
</select>
<!-- 查询一个工作人员最近登录的网格以及机关信息 --> <!-- 查询一个工作人员最近登录的网格以及机关信息 -->
<select id="selectAgencyAndGridInfoExt" resultType="com.epmet.dto.result.ExtStaffInfoResultDTO"> <select id="selectAgencyAndGridInfoExt" resultType="com.epmet.dto.result.ExtStaffInfoResultDTO">
SELECT SELECT

9
epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java

@ -269,15 +269,6 @@ public interface EpmetUserOpenFeignClient {
@PostMapping("epmetuser/customerstaff/getstaffinfolist") @PostMapping("epmetuser/customerstaff/getstaffinfolist")
Result<List<StaffSinGridResultDTO>> getStaffInfoList(@RequestBody UserIdsFormDTO formDTO); Result<List<StaffSinGridResultDTO>> getStaffInfoList(@RequestBody UserIdsFormDTO formDTO);
/**
* @Description 根绝staffId查询最近一次(既当前)登录到的AgencyId
* @param staffId
* @return
* @author wangc
* @date 2020.08.17 17:45
**/
@GetMapping("/epmetuser/staffagencyvisited/latestagency/{staffId}")
Result<String> latestAgency(@PathVariable("staffId") String staffId);
/** /**
* 修改根管理员信息 * 修改根管理员信息

5
epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java

@ -189,11 +189,6 @@ public class EpmetUserOpenFeignClientFallback implements EpmetUserOpenFeignClien
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getStaffInfoList", formDTO); return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getStaffInfoList", formDTO);
} }
@Override
public Result<String> latestAgency(String staffId) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "latestAgency", staffId);
}
@Override @Override
public Result updateRootManage(UpdateRootManageFormDTO formDTO) { public Result updateRootManage(UpdateRootManageFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "updateRootManage", formDTO); return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "updateRootManage", formDTO);

12
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffAgencyVisitedController.java

@ -63,16 +63,4 @@ public class StaffAgencyVisitedController {
} }
/**
* @Description 根绝staffId查询最近一次(既当前)登录到的AgencyId
* @param staffId
* @return
* @author wangc
* @date 2020.08.17 17:45
**/
@GetMapping(value = "latestagency/{staffId}")
public Result<String> latestAgency(@PathVariable("staffId") String staffId){
return new Result<String>().ok(staffAgencyVisitedService.getLatestStaffAgencyId(staffId));
}
} }

1
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffAgencyVisitedDao.java

@ -40,5 +40,4 @@ public interface StaffAgencyVisitedDao extends BaseDao<StaffAgencyVisitedEntity>
StaffLatestAgencyResultDTO selectLatestStaffWechatLoginRecord(String openId); StaffLatestAgencyResultDTO selectLatestStaffWechatLoginRecord(String openId);
StaffLatestAgencyResultDTO selectLatestCustomer(String userId);
} }

8
epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffAgencyVisitedService.java

@ -114,13 +114,5 @@ public interface StaffAgencyVisitedService extends BaseService<StaffAgencyVisite
**/ **/
Result saveStaffLoginRecord(StaffLoginAgencyRecordFormDTO formDTO); Result saveStaffLoginRecord(StaffLoginAgencyRecordFormDTO formDTO);
/**
* @Description 根绝staffId查询最近一次(既当前)登录到的AgencyId
* @param staffId
* @return
* @author wangc
* @date 2020.08.17 17:45
**/
String getLatestStaffAgencyId(String staffId);
} }

16
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffAgencyVisitedServiceImpl.java

@ -127,20 +127,6 @@ public class StaffAgencyVisitedServiceImpl extends BaseServiceImpl<StaffAgencyVi
return new Result(); return new Result();
} }
/**
* @Description 根绝staffId查询最近一次(既当前)登录到的AgencyId
* @param staffId
* @return
* @author wangc
* @date 2020.08.17 17:45
**/
@Override
public String getLatestStaffAgencyId(String staffId) {
StaffLatestAgencyResultDTO latestAgency =
baseDao.selectLatestCustomer(staffId);
if(null != latestAgency)
return latestAgency.getAgencyId();
return null;
}
} }

16
epmet-user/epmet-user-server/src/main/resources/mapper/StaffAgencyVisitedDao.xml

@ -35,19 +35,5 @@
sav.CREATED_TIME DESC sav.CREATED_TIME DESC
LIMIT 1 LIMIT 1
</select> </select>
<select id="selectLatestCustomer" parameterType="java.lang.String"
resultType="com.epmet.dto.result.StaffLatestAgencyResultDTO">
SELECT
sav.CUSTOMER_ID,
sav.STAFF_ID,
sav.AGENCY_ID
FROM
staff_agency_visited sav
WHERE
sav.DEL_FLAG = '0'
AND sav.STAFF_ID =#{userId}
ORDER BY
sav.CREATED_TIME DESC
LIMIT 1
</select>
</mapper> </mapper>
Loading…
Cancel
Save