Browse Source

Merge remote-tracking branch 'origin/dev_govgrid' into dev

dev
yinzuomei 5 years ago
parent
commit
313645bb4b
  1. 48
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/UserIdAndPidDTO.java
  2. 5
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java
  3. 2
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/EpmetUserFeignClient.java
  4. 2
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallBack.java
  5. 2
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java
  6. 14
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml
  7. 35
      epmet-user/epmet-user-server/src/main/java/com/epmet/constant/UserRoleConstant.java
  8. 2
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java
  9. 2
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerStaffDao.java
  10. 2
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/CustomerStaffService.java
  11. 14
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java

48
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/UserIdAndPidDTO.java

@ -0,0 +1,48 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dto;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 网格人员关系表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-04-20
*/
@Data
public class UserIdAndPidDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 用户id, user.id
*/
private String userId;
/**
* pid 所属机关id
*/
private String pid;
}

5
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java

@ -18,6 +18,7 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.UserIdAndPidDTO;
import com.epmet.dto.form.ListCustomerGridFormDTO;
import com.epmet.dto.form.SelectGridNameByGridIdFormDTO;
import com.epmet.dto.result.CustomerGridForStrangerResultDTO;
@ -98,11 +99,11 @@ public interface CustomerGridDao extends BaseDao<CustomerGridEntity> {
GridDetailResultDTO griddetail(CustomerGridFormDTO customerGridFormDTO);
/**
* 根据gridId查询uerId
* 根据gridId查询uerId和pid
* @param customerGridFormDTO
* @return
*/
List<CustomerStaffGridDTO> selectUserIdByGridId(CustomerGridFormDTO customerGridFormDTO);
List<UserIdAndPidDTO> selectUserIdByGridId(CustomerGridFormDTO customerGridFormDTO);
/**
* 根据userId查询customerId

2
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/EpmetUserFeignClient.java

@ -51,7 +51,7 @@ public interface EpmetUserFeignClient {
* @return
*/
@PostMapping("/epmetuser/customerstaff/selectstaffgridlistbyuserid")
Result<List<StaffGridListDTO>> getStaffGridList(@RequestBody List<CustomerStaffGridDTO> customerStaffGridDTOS);
Result<List<StaffGridListDTO>> getStaffGridList(@RequestBody List<UserIdAndPidDTO> customerStaffGridDTOS);
/**
* 组织首页-工作人员列表

2
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallBack.java

@ -37,7 +37,7 @@ public class EpmetUserFeignClientFallBack implements EpmetUserFeignClient {
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getCustomerStaffInfoByUserId", formDTO);
}
@Override
public Result<List<StaffGridListDTO>> getStaffGridList(List<CustomerStaffGridDTO> customerStaffGridDTOS) {
public Result<List<StaffGridListDTO>> getStaffGridList(List<UserIdAndPidDTO> customerStaffGridDTOS) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getStaffGridList", customerStaffGridDTOS);
}

2
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java

@ -187,7 +187,7 @@ public class CustomerGridServiceImpl extends BaseServiceImpl<CustomerGridDao, Cu
@Override
public Result<GridDetailResultDTO> griddetail(CustomerGridFormDTO customerGridFormDTO) {
GridDetailResultDTO griddetail = baseDao.griddetail(customerGridFormDTO);
List<CustomerStaffGridDTO> customerStaffGridDTOS = baseDao.selectUserIdByGridId(customerGridFormDTO);
List<UserIdAndPidDTO> customerStaffGridDTOS = baseDao.selectUserIdByGridId(customerGridFormDTO);
//获取人员具体信息(头像、名字...)
Result<List<StaffGridListDTO>> staffGridList = epmetUserFeignClient.getStaffGridList(customerStaffGridDTOS);
griddetail.setStaffGridList(staffGridList.getData());

14
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml

@ -139,15 +139,17 @@
ORDER BY created_by DESC
</select>
<!--根据gridId查询userId-->
<select id="selectUserIdByGridId" resultType="com.epmet.dto.CustomerStaffGridDTO">
<!--根据gridId查询userId和pid-->
<select id="selectUserIdByGridId" resultType="com.epmet.dto.UserIdAndPidDTO">
SELECT
user_id
csg.user_id AS userId,
cg.pid
FROM
customer_staff_grid
customer_staff_grid csg
LEFT JOIN customer_grid cg ON cg.id = csg.grid_id
WHERE
del_flag = 0
AND grid_id = #{gridId}
csg.del_flag = 0
AND csg.grid_id = #{gridId}
</select>
<!-- 根据userId查询customerId -->

35
epmet-user/epmet-user-server/src/main/java/com/epmet/constant/UserRoleConstant.java

@ -17,4 +17,39 @@ public interface UserRoleConstant {
*/
String DEPT_LEADER = "dept_leader";
/**
* 单位领导
*/
String AGENCY_LEADER = "agency_leader";
/**
* 党建负责人
*/
String PARTY_PRINCIPALS = "party_principals";
/**
* 管理员
*/
String MANAGER = "manager";
/**
* 工作人员
*/
String STAFF = "staff";
/**
* 网格长
*/
String GRID_MANAGER = "grid_manager";
/**
* 网格党建指导员
*/
String GRID_PARTY_DIRECTOR = "grid_party_director";
/**
* 网格员
*/
String GRID_MEMBER = "grid_member";
}

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

@ -132,7 +132,7 @@ public class CustomerStaffController {
* @return
*/
@PostMapping(value = "selectstaffgridlistbyuserid")
public Result<List<StaffGridListDTO>> selectStaffGridListByUserId(@RequestBody List<CustomerStaffGridDTO> customerStaffGridDTOS){
public Result<List<StaffGridListDTO>> selectStaffGridListByUserId(@RequestBody List<UserIdAndPidDTO> customerStaffGridDTOS){
Result<List<StaffGridListDTO>> listResult = customerStaffService.selectStaffGridListByUserId(customerStaffGridDTOS);
return listResult;
}

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

@ -71,7 +71,7 @@ public interface CustomerStaffDao extends BaseDao<CustomerStaffEntity> {
* @param customerStaffGridDTOS
* @return
*/
List<StaffGridListDTO> selectStaffGridListByUserId(List<CustomerStaffGridDTO> customerStaffGridDTOS);
List<StaffGridListDTO> selectStaffGridListByUserId(List<UserIdAndPidDTO> customerStaffGridDTOS);
/**
* 根据用户ID列表获取用户信息

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

@ -139,7 +139,7 @@ public interface CustomerStaffService extends BaseService<CustomerStaffEntity> {
* @param customerStaffGridDTOS
* @return
*/
Result<List<StaffGridListDTO>> selectStaffGridListByUserId(List<CustomerStaffGridDTO> customerStaffGridDTOS);
Result<List<StaffGridListDTO>> selectStaffGridListByUserId(List<UserIdAndPidDTO> customerStaffGridDTOS);
/**
* 组织首页-工作人员列表

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

@ -178,8 +178,20 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl<CustomerStaffDao,
}
@Override
public Result<List<StaffGridListDTO>> selectStaffGridListByUserId(List<CustomerStaffGridDTO> customerStaffGridDTOS) {
public Result<List<StaffGridListDTO>> selectStaffGridListByUserId(List<UserIdAndPidDTO> customerStaffGridDTOS) {
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()==UserRoleConstant.GRID_MANAGER){
for (StaffGridListDTO staffGridListDTO : staffGridListDTOS) {
if (staffGridListDTO.getStaffId()==govStaffRoleResultDTO.getStaffId()){
staffGridListDTO.setRoleName(govStaffRoleResultDTO.getRoleName());
}
break;
}
}
break;
}
return new Result<List<StaffGridListDTO>>().ok(staffGridListDTOS);
}

Loading…
Cancel
Save