Browse Source

Merge branch 'dev_1118' of http://121.42.41.42:7070/r/esua-epdc-cloud into dev_1118

dev
王金鹏 6 years ago
parent
commit
294498dd29
  1. 36
      esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/constant/WorkAppMenuConstant.java
  2. 10
      esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/SysDeptDao.java
  3. 180
      esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/SysDeptServiceImpl.java
  4. 19
      esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/SysDeptDao.xml
  5. 22
      esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/form/WorkAppMenuStatisticsFormDTO.java
  6. 27
      esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/result/WorkAppMenuStatisticsResultDTO.java
  7. 16
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiWorkUserController.java
  8. 15
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/WorkUserService.java
  9. 94
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/WorkUserServiceImpl.java
  10. 2
      esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/item/form/ItemStatisticsFormDTO.java
  11. 8
      esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/item/result/ItemStatisticsResultDTO.java
  12. 6
      esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/events/EpdcEventsDao.xml
  13. 3
      esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/issue/IssueDao.xml
  14. 3
      esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/item/ItemDao.xml
  15. 27
      esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/resources/mapper/group/GroupDao.xml
  16. 9
      esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/resources/mapper/topic/TopicDao.xml
  17. 71
      esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/form/EpdcUserQueryFormDTO.java
  18. 27
      esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/result/EpdcUserQueryResultDTO.java
  19. 1
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/EpdcAppUserController.java
  20. 2
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/UserAuthenticateHistoryController.java
  21. 15
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/UserController.java
  22. 27
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/UserDao.java
  23. 40
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/entity/PartyAuthenticationFailedEntity.java
  24. 34
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/entity/PartyMembersEntity.java
  25. 23
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/entity/UserGridRelationEntity.java
  26. 9
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/UserService.java
  27. 2
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/PartyMembersServiceImpl.java
  28. 31
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/UserServiceImpl.java
  29. 92
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/UserDao.xml

36
esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/constant/WorkAppMenuConstant.java

@ -0,0 +1,36 @@
package com.elink.esua.epdc.constant;
/**
*
* 工作端-首页菜单常量
*
* @Authorliuchuang
* @Date2019/11/28 19:04
*/
public interface WorkAppMenuConstant {
/**
* 议题管理-待回应
*/
String WORK_APP_MENU_CODE_ISSUE_WAITING_RESPOND = "10001";
/**
* 议题管理-待处理
*/
String WORK_APP_MENU_CODE_ISSUE_WAITING_HANDLE = "10002";
/**
* 项目管理-待处理
*/
String WORK_APP_MENU_CODE_ITEM_WAITING_HANDLE = "10003";
/**
* 用户管理-待认证居民
*/
String WORK_APP_MENU_CODE_USER_RESIDENTS_TO_BE_CERTIFIED = "10004";
/**
* 消息
*/
String WORK_APP_MENU_CODE_NOTICE = "10005";
}

10
esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/SysDeptDao.java

@ -75,6 +75,16 @@ public interface SysDeptDao extends BaseDao<SysDeptEntity> {
*/
CompleteDeptDTO getCompleteDept(@Param("gridId") Long gridId);
/**
* 通过网格ID获取该网格所有上级机构
*
* @param deptId
* @return com.elink.esua.epdc.dto.CompleteDeptDTO
* @author yujintao
* @date 2019/9/7 09:20
*/
CompleteDeptDTO getParentAndAllDept(@Param("deptId") Long deptId);
/**
* 通过街道ID获取项目可流转部门
*

180
esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/SysDeptServiceImpl.java

@ -35,6 +35,7 @@ import com.elink.esua.epdc.feign.GroupFeignClient;
import com.elink.esua.epdc.service.SysDeptService;
import com.elink.esua.epdc.service.SysUserService;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
@ -249,22 +250,30 @@ public class SysDeptServiceImpl extends BaseServiceImpl<SysDeptDao, SysDeptEntit
if (null == deptId) {
return new Result().error("参数格式异常");
}
CompleteDeptDTO completeDept = this.baseDao.getCompleteDept(deptIdL);
CompleteDeptDTO completeDept = this.baseDao.getParentAndAllDept(deptIdL);
ParentAndAllDeptDTO parentAndAllDeptDTO = new ParentAndAllDeptDTO();
parentAndAllDeptDTO.setGrid(completeDept.getGrid());
parentAndAllDeptDTO.setGridId(completeDept.getGridId());
// 父所有部门(包含街道、社区)
String deptNames = (StringUtils.isNotEmpty(completeDept.getStreet()) ? completeDept.getStreet() : "");
deptNames += (StringUtils.isNotEmpty(completeDept.getCommunity()) ? "-"+completeDept.getCommunity() : "");
String deptIds = (completeDept.getStreetId()!=null && completeDept.getStreetId()!= 0 ? completeDept.getStreetId().toString() : "");
deptIds += (completeDept.getCommunityId()!=null && completeDept.getCommunityId()!= 0 ? ","+completeDept.getCommunityId().toString() : "");
parentAndAllDeptDTO.setParentDeptIds(deptIds);
parentAndAllDeptDTO.setParentDeptNames(deptNames);
// 所有部门(包含街道、社区、网格)
deptNames += (StringUtils.isNotEmpty(completeDept.getGrid()) ? "-"+completeDept.getGrid() : "");
deptIds += (completeDept.getGridId()!=null && completeDept.getGridId()!= 0 ? ","+completeDept.getGridId().toString() : "");
parentAndAllDeptDTO.setAllDeptIds(deptIds);
parentAndAllDeptDTO.setAllDeptNames(deptNames);
if(completeDept != null){
parentAndAllDeptDTO.setGrid(StringUtils.isNotEmpty(completeDept.getGrid()) ? completeDept.getGrid() : "");
parentAndAllDeptDTO.setGridId(completeDept.getGridId()!=null && completeDept.getGridId()!= 0 ? completeDept.getGridId() : null);
// 父所有部门(包含街道、社区)
String deptNames = (StringUtils.isNotEmpty(completeDept.getDistrict()) ? completeDept.getDistrict() : "");
deptNames += (StringUtils.isNotEmpty(completeDept.getStreet()) ? "-"+completeDept.getStreet() : "");
deptNames += (StringUtils.isNotEmpty(completeDept.getCommunity()) ? "-"+completeDept.getCommunity() : "");
String deptIds = (completeDept.getDistrictId()!=null && completeDept.getDistrictId()!= 0 ? completeDept.getDistrictId().toString() : "");
deptIds += (completeDept.getStreetId()!=null && completeDept.getStreetId()!= 0 ? ","+ completeDept.getStreetId().toString() : "");
deptIds += (completeDept.getCommunityId()!=null && completeDept.getCommunityId()!= 0 ? ","+ completeDept.getCommunityId().toString() : "");
parentAndAllDeptDTO.setParentDeptIds(deptIds);
parentAndAllDeptDTO.setParentDeptNames(deptNames);
// 所有部门(包含街道、社区、网格)
deptNames += (StringUtils.isNotEmpty(completeDept.getGrid()) ? "-"+completeDept.getGrid() : "");
deptIds += (completeDept.getGridId()!=null && completeDept.getGridId()!= 0 ? ","+completeDept.getGridId().toString() : "");
parentAndAllDeptDTO.setAllDeptIds(deptIds);
parentAndAllDeptDTO.setAllDeptNames(deptNames);
} else {
return new Result().error("部门Id错误");
}
return new Result().ok(parentAndAllDeptDTO);
}
@ -329,7 +338,6 @@ public class SysDeptServiceImpl extends BaseServiceImpl<SysDeptDao, SysDeptEntit
@Override
public void packageUserDeptOption(Long userId) {
UserDetail userDetail = userDetailRedis.get(userId);
// 用户拥有的所有部门权限
List<Long> dataScopeDeptList = userDetail.getDeptIdList();
@ -341,16 +349,13 @@ public class SysDeptServiceImpl extends BaseServiceImpl<SysDeptDao, SysDeptEntit
if (CollUtil.isEmpty(headDepts)) {
return;
}
String label = "label";
String value = "value";
String children = "children";
// 某个部门id 声明变量,方便操作数据
Long deptId;
// 存放上级节点的主键,查询下级节点用
List<Long> parentDeptIdList = Lists.newArrayList();
// 一级节点 相当于市区,此处虽然组装,但并没有应用第一级节点
JSONArray NodeListLevel_1 = new JSONArray();
// 所有父级节点 此处为第一次获取,为顶级节点,相当于市区
JSONArray parentNodeArray = new JSONArray();
JSONObject node;
for (int i = 0; i < headDepts.size(); i++) {
// 父节点主键
@ -358,102 +363,93 @@ public class SysDeptServiceImpl extends BaseServiceImpl<SysDeptDao, SysDeptEntit
parentDeptIdList.add(deptId);
node = new JSONObject();
node.put(label, headDepts.get(i).getName());
node.put(value, String.valueOf(deptId));
NodeListLevel_1.add(node);
node.put("label", headDepts.get(i).getName());
node.put("value", String.valueOf(deptId));
parentNodeArray.add(node);
}
// 用于存放 每次组装好的 某一级节点。页面只需展示三级,所以没有存放顶级节点(市区)
List<JSONArray> cache = Lists.newArrayList();
Map<String, Object> object;
while (CollUtil.isNotEmpty(dataScopeDeptList)) {
// 通过上级节点组装所有下级节点
object = this.packageChildrenNodeArray(parentNodeArray, dataScopeDeptList, parentDeptIdList);
dataScopeDeptList = (List<Long>) object.get("scope");
parentDeptIdList = (List<Long>) object.get("pids");
parentNodeArray = (JSONArray) object.get("node");
cache.add(parentNodeArray);
}
// 查询所有一级节点的下级部门,用于组装 二级节点
DeptOption option = new DeptOption();
option.setOptions(cache.get(0));
redisUtils.set(RedisKeys.getAdminUserDeptOptionKey(userId), option);
}
/**
* 组装下级结构节点
*
* @param allParentNode 所有的上级机构节点
* @param dataScopeDeptList 拥有数据权限的部门
* @param parentDeptIdList 上级部门id
* @return java.util.Map<java.lang.String, java.lang.Object>
* @author work@yujt.net.cn
* @date 2019/11/29 10:27
*/
private Map<String, Object> packageChildrenNodeArray(JSONArray allParentNode, List<Long> dataScopeDeptList, List<Long> parentDeptIdList) {
List<SysDeptEntity> childDepts = baseDao.selectChildrenDeptNode(dataScopeDeptList, parentDeptIdList);
parentDeptIdList = Lists.newArrayList();
// 所有二级节点 相当于街道
JSONArray NodeListLevel_2 = new JSONArray();
// 某个一级节点下所有的二级节点
// 用于存储所有子节点
JSONArray allChildrenNode = new JSONArray();
// 某个父节点下所有的子节点
JSONArray childrenNodeList;
// 单个 二级节点
// 单个 节点
JSONObject nodeChild;
// 单个 一级节点
JSONObject nodeParent;
for (int i = 0; i < NodeListLevel_1.size(); i++) {
// 一个父节点
nodeParent = NodeListLevel_1.getJSONObject(i);
// 一个父节点的所有下级节点
childrenNodeList = new JSONArray();
for (int j = 0; j < childDepts.size(); j++) {
deptId = childDepts.get(j).getId();
if (nodeParent.get(value).equals(String.valueOf(childDepts.get(j).getPid()))) {
nodeChild = new JSONObject();
nodeChild.put(label, childDepts.get(j).getName());
nodeChild.put(value, String.valueOf(deptId));
childrenNodeList.add(nodeChild);
NodeListLevel_2.add(nodeChild);
parentDeptIdList.add(deptId);
}
}
}
// 单个 父节点
JSONObject nodeParent;
Long deptId;
// 查询所有二级节点的下级部门,用于组装 三级节点
childDepts = baseDao.selectChildrenDeptNode(dataScopeDeptList, parentDeptIdList);
parentDeptIdList = Lists.newArrayList();
for (int i = 0; i < allParentNode.size(); i++) {
// 所有三级节点 相当于社区
JSONArray NodeListLevel_3 = new JSONArray();
for (int i = 0; i < NodeListLevel_2.size(); i++) {
// 一个父节点
nodeParent = NodeListLevel_2.getJSONObject(i);
// 一个父节点的所有下级节点
nodeParent = allParentNode.getJSONObject(i);
// 用于存储 一个父节点的所有下级节点
childrenNodeList = new JSONArray();
for (int j = 0; j < childDepts.size(); j++) {
deptId = childDepts.get(j).getId();
if (nodeParent.get(value).equals(String.valueOf(childDepts.get(j).getPid()))) {
if (nodeParent.get("value").equals(String.valueOf(childDepts.get(j).getPid()))) {
nodeChild = new JSONObject();
nodeChild.put(label, childDepts.get(j).getName());
nodeChild.put(value, String.valueOf(deptId));
nodeChild.put("label", childDepts.get(j).getName());
nodeChild.put("value", String.valueOf(deptId));
childrenNodeList.add(nodeChild);
NodeListLevel_3.add(nodeChild);
allChildrenNode.add(nodeChild);
parentDeptIdList.add(deptId);
}
}
if(childrenNodeList.size() > 0){
nodeParent.put(children, childrenNodeList);
if (childrenNodeList.size() > 0) {
nodeParent.put("children", childrenNodeList);
}
}
// 查询所有三级节点的下级部门,用于组装 四级节点
childDepts = baseDao.selectChildrenDeptNode(dataScopeDeptList, parentDeptIdList);
for (int i = 0; i < NodeListLevel_3.size(); i++) {
// 父节点
nodeParent = NodeListLevel_3.getJSONObject(i);
childrenNodeList = new JSONArray();
for (int j = 0; j < childDepts.size(); j++) {
deptId = childDepts.get(j).getId();
if (nodeParent.get(value).equals(String.valueOf(childDepts.get(j).getPid()))) {
nodeChild = new JSONObject();
nodeChild.put(label, childDepts.get(j).getName());
nodeChild.put(value, String.valueOf(deptId));
childrenNodeList.add(nodeChild);
}
}
if(childrenNodeList.size() > 0){
nodeParent.put(children, childrenNodeList);
List<Long> newDataScopeList = Lists.newArrayList();
for (int i = 0; i < dataScopeDeptList.size(); i++) {
deptId = dataScopeDeptList.get(i);
if (!parentDeptIdList.contains(deptId)) {
newDataScopeList.add(deptId);
}
}
DeptOption option = new DeptOption();
option.setOptions(NodeListLevel_2);
redisUtils.set(RedisKeys.getAdminUserDeptOptionKey(userId), option);
dataScopeDeptList = newDataScopeList;
Map<String, Object> result = Maps.newHashMap();
result.put("node", allChildrenNode);
result.put("scope", dataScopeDeptList);
result.put("pids", parentDeptIdList);
return result;
}
}

19
esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/SysDeptDao.xml

@ -65,6 +65,25 @@
AND gri.del_flag = '0'
AND dis.id IS NOT NULL
</select>
<select id="getParentAndAllDept" resultType="com.elink.esua.epdc.dto.CompleteDeptDTO">
SELECT
dis.`name` district,
dis.id districtId,
str.`name` street,
str.id streetId,
com.`name` community,
com.id communityId,
gri.`name` grid,
gri.id gridId
FROM
sys_dept gri
LEFT JOIN sys_dept com ON gri.pid = com.id
LEFT JOIN sys_dept str ON com.pid = str.id
LEFT JOIN sys_dept dis ON str.pid = dis.id
WHERE
gri.ID = #{deptId}
AND gri.del_flag = '0'
</select>
<select id="selectListOfItemCirculationDept" resultType="com.elink.esua.epdc.dto.SysDeptDTO">
SELECT

22
esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/form/WorkAppMenuStatisticsFormDTO.java

@ -0,0 +1,22 @@
package com.elink.esua.epdc.dto.form;
import lombok.Data;
import java.io.Serializable;
/**
*
* 工作端小程序首页菜单消息数量Form DTO
*
* @Authorliuchuang
* @Date2019/11/29 9:14
*/
@Data
public class WorkAppMenuStatisticsFormDTO implements Serializable {
private static final long serialVersionUID = 4881526875170357671L;
/**
* 部门ID
*/
private Long deptId;
}

27
esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/result/WorkAppMenuStatisticsResultDTO.java

@ -0,0 +1,27 @@
package com.elink.esua.epdc.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
*
* 工作端小程序首页菜单消息数量
*
* @Authorliuchuang
* @Date2019/11/28 19:53
*/
@Data
public class WorkAppMenuStatisticsResultDTO implements Serializable {
private static final long serialVersionUID = -8971266834441830462L;
/**
* 菜单编码
*/
private String menuCode;
/**
* 菜单消息数量
*/
private Integer menuNum;
}

16
esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiWorkUserController.java

@ -7,6 +7,8 @@ import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils;
import com.elink.esua.epdc.dto.epdc.form.*;
import com.elink.esua.epdc.dto.epdc.result.*;
import com.elink.esua.epdc.dto.form.EpdcWorkAppUserMaTokenFormDTO;
import com.elink.esua.epdc.dto.form.WorkAppMenuStatisticsFormDTO;
import com.elink.esua.epdc.dto.result.WorkAppMenuStatisticsResultDTO;
import com.elink.esua.epdc.service.WorkUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@ -167,4 +169,18 @@ public class ApiWorkUserController {
ValidatorUtils.validateEntity(formDto);
return workUserService.removeGrid(formDto);
}
/**
*
* 首页菜单消息数量显示
*
* @params []
* @return com.elink.esua.epdc.commons.tools.utils.Result<java.util.List<com.elink.esua.epdc.dto.result.WorkAppMenuStatisticsResultDTO>>
* @author liuchuang
* @since 2019/11/28 19:56
*/
@GetMapping("indexStatistics")
public Result<List<WorkAppMenuStatisticsResultDTO>> indexStatistics(WorkAppMenuStatisticsFormDTO formDto) {
return workUserService.indexStatistics(formDto);
}
}

15
esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/WorkUserService.java

@ -5,11 +5,11 @@ import com.elink.esua.epdc.common.token.dto.WorkUserLoginDTO;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.dto.epdc.form.*;
import com.elink.esua.epdc.dto.epdc.result.*;
import com.elink.esua.epdc.common.token.dto.TokenDto;
import com.elink.esua.epdc.dto.form.EpdcWorkAppUserMaTokenFormDTO;
import com.elink.esua.epdc.dto.form.WorkAppMenuStatisticsFormDTO;
import com.elink.esua.epdc.dto.result.WorkAppMenuStatisticsResultDTO;
import java.util.List;
import java.util.Map;
/**
* 工作端用户登录用户管理 相关业务接口
@ -119,4 +119,15 @@ public interface WorkUserService {
* @Date 2019/11/22 14:17
**/
Result removeGrid(EpdcAppRemoveGridFormDTO formDto);
/**
*
* 首页菜单消息数量显示
*
* @params []
* @return com.elink.esua.epdc.commons.tools.utils.Result<java.util.List<com.elink.esua.epdc.dto.result.WorkAppMenuStatisticsResultDTO>>
* @author liuchuang
* @since 2019/11/28 20:03
*/
Result<List<WorkAppMenuStatisticsResultDTO>> indexStatistics(WorkAppMenuStatisticsFormDTO formDto);
}

94
esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/WorkUserServiceImpl.java

@ -10,14 +10,22 @@ import com.elink.esua.epdc.commons.tools.security.user.SecurityUser;
import com.elink.esua.epdc.commons.tools.security.user.UserDetail;
import com.elink.esua.epdc.commons.tools.utils.ConvertUtils;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.constant.WorkAppMenuConstant;
import com.elink.esua.epdc.dto.SysUserDTO;
import com.elink.esua.epdc.dto.epdc.form.*;
import com.elink.esua.epdc.dto.epdc.result.*;
import com.elink.esua.epdc.common.token.dto.TokenDto;
import com.elink.esua.epdc.dto.form.EpdcWorkAppUserMaTokenFormDTO;
import com.elink.esua.epdc.dto.form.WorkAppMenuStatisticsFormDTO;
import com.elink.esua.epdc.dto.issue.form.IssueStateStatisticsFormDTO;
import com.elink.esua.epdc.dto.issue.result.IssueStateStatisticsResultDTO;
import com.elink.esua.epdc.dto.item.form.ItemStatisticsFormDTO;
import com.elink.esua.epdc.dto.item.result.ItemStatisticsResultDTO;
import com.elink.esua.epdc.dto.result.WorkAppMenuStatisticsResultDTO;
import com.elink.esua.epdc.feign.AdminFeignClient;
import com.elink.esua.epdc.feign.ResourceFeignClient;
import com.elink.esua.epdc.feign.UserFeignClient;
import com.elink.esua.epdc.service.WorkIssueService;
import com.elink.esua.epdc.service.WorkItemService;
import com.elink.esua.epdc.service.WorkUserService;
import com.elink.esua.epdc.utils.WxMaServiceUtils;
import me.chanjar.weixin.common.error.WxErrorException;
@ -25,6 +33,7 @@ import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
/**
@ -47,6 +56,12 @@ public class WorkUserServiceImpl implements WorkUserService {
@Autowired
private WxMaServiceUtils wxMaServiceUtils;
@Autowired
private WorkIssueService workIssueService;
@Autowired
private WorkItemService workItemService;
@Override
public Result<WorkUserAuthorizationDTO> getMaToken(EpdcWorkAppUserMaTokenFormDTO formDto) {
// 获取openId
@ -202,4 +217,81 @@ public class WorkUserServiceImpl implements WorkUserService {
public Result removeGrid(EpdcAppRemoveGridFormDTO formDto) {
return userFeignClient.removeGrid(formDto);
}
@Override
public Result<List<WorkAppMenuStatisticsResultDTO>> indexStatistics(WorkAppMenuStatisticsFormDTO formDto) {
if (null == SecurityUser.getUser()) {
return new Result<List<WorkAppMenuStatisticsResultDTO>>().error("获取当前登录用户信息失败");
}
// 获取当前用户菜单信息
Result<List<EpdcAppIndexPanelResultDTO>> adminResult = adminFeignClient.indexPanel(SecurityUser.getUser().getMobile());
if (!adminResult.success()) {
return new Result<List<WorkAppMenuStatisticsResultDTO>>().error(adminResult.getMsg());
}
// 议题管理菜单消息数量统计
IssueStateStatisticsFormDTO issueFormDto = new IssueStateStatisticsFormDTO();
issueFormDto.setDeptId(formDto.getDeptId());
Result<IssueStateStatisticsResultDTO> issueResult = workIssueService.stateStatistics(issueFormDto);
// 项目管理菜单消息数量统计
ItemStatisticsFormDTO itemFormDto = new ItemStatisticsFormDTO();
itemFormDto.setDeptId(formDto.getDeptId());
Result<ItemStatisticsResultDTO> itemResult = workItemService.getItemStatistics(itemFormDto);
// 用户管理菜单消息数量统计
EpdcUnauthorizedAmountFromDTO unauthorizedFromDto = new EpdcUnauthorizedAmountFromDTO();
unauthorizedFromDto.setGridId(formDto.getDeptId());
Result<Integer> unauthorizedResult = this.getUnauthorizedAmount(unauthorizedFromDto);
// 组装返回数据
List<WorkAppMenuStatisticsResultDTO> resultDtoList = new ArrayList<>();
for (EpdcAppIndexPanelResultDTO indexPanelDto:
adminResult.getData()) {
for (EpdcAppChildNavResultDTO childDto:
indexPanelDto.getChildNav()) {
if (NumConstant.ZERO_STR.equals(childDto.getNumFlag())) {
continue;
}
WorkAppMenuStatisticsResultDTO resultDto = null;
switch (childDto.getNavCode()) {
case WorkAppMenuConstant.WORK_APP_MENU_CODE_ISSUE_WAITING_RESPOND:
resultDto = this.packageMenuData(childDto.getNavCode(), issueResult.getData().getPendingResponseNum());
break;
case WorkAppMenuConstant.WORK_APP_MENU_CODE_ISSUE_WAITING_HANDLE:
resultDto = this.packageMenuData(childDto.getNavCode(), issueResult.getData().getPendingHandleNum());
break;
case WorkAppMenuConstant.WORK_APP_MENU_CODE_ITEM_WAITING_HANDLE:
resultDto = this.packageMenuData(childDto.getNavCode(), itemResult.getData().getPendingHandleNum());
break;
case WorkAppMenuConstant.WORK_APP_MENU_CODE_USER_RESIDENTS_TO_BE_CERTIFIED:
resultDto = this.packageMenuData(childDto.getNavCode(), unauthorizedResult.getData());
break;
case WorkAppMenuConstant.WORK_APP_MENU_CODE_NOTICE:
resultDto = this.packageMenuData(childDto.getNavCode(), itemResult.getData().getNoticeNum());
break;
default:
break;
}
if (null != resultDto) {
resultDtoList.add(resultDto);
}
}
}
return new Result<List<WorkAppMenuStatisticsResultDTO>>().ok(resultDtoList);
}
/**
*
* 组装菜单数据
*
* @params [menuCode, menuNum]
* @return com.elink.esua.epdc.dto.result.WorkAppMenuStatisticsResultDTO
* @author liuchuang
* @since 2019/11/29 9:58
*/
private WorkAppMenuStatisticsResultDTO packageMenuData(String menuCode, Integer menuNum) {
WorkAppMenuStatisticsResultDTO resultDto = new WorkAppMenuStatisticsResultDTO();
resultDto.setMenuCode(menuCode);
resultDto.setMenuNum(menuNum);
return resultDto;
}
}

2
esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/item/form/ItemStatisticsFormDTO.java

@ -19,7 +19,7 @@ public class ItemStatisticsFormDTO implements Serializable {
/**
* 部门ID
*/
private String deptId;
private Long deptId;
/**
* 部门ID列表
*/

8
esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/item/result/ItemStatisticsResultDTO.java

@ -15,18 +15,18 @@ public class ItemStatisticsResultDTO implements Serializable {
/**
* 待处理数量
*/
private String pendingHandleNum;
private Integer pendingHandleNum;
/**
* 已结案数量
*/
private String closingCaseNum;
private Integer closingCaseNum;
/**
* 已关闭数量
*/
private String closedNum;
private Integer closedNum;
/**
* 消息数量
*/
private String noticeNum;
private Integer noticeNum;
}

6
esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/events/EpdcEventsDao.xml

@ -68,7 +68,8 @@
AND DATE_FORMAT( temp.CREATED_TIME, '%Y-%m-%d' ) BETWEEN #{startTime} AND #{endTime}
</if>
<if test="gridId != null and gridId != ''">
AND temp.grid_id = #{gridId}
AND (temp.GRID_ID = #{gridId}
OR find_in_set(#{gridId},temp.ALL_DEPT_IDS))
</if>
<if test="streetId != null and streetId != ''">
AND (find_in_set(#{streetId},temp.PARENT_DEPT_IDS)
@ -96,7 +97,8 @@
AND DATE_FORMAT( temp.CREATED_TIME, '%Y-%m-%d' ) BETWEEN #{startTime} AND #{endTime}
</if>
<if test="gridId != null and gridId != ''">
AND temp.grid_id = #{gridId}
AND (temp.GRID_ID = #{gridId}
OR find_in_set(#{gridId},temp.ALL_DEPT_IDS))
</if>
<if test="streetId != null and streetId != ''">
AND find_in_set(#{streetId},temp.PARENT_DEPT_IDS)

3
esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/issue/IssueDao.xml

@ -24,7 +24,8 @@
AND DATE_FORMAT( issue.CREATED_TIME, '%Y-%m-%d' ) BETWEEN #{startTime} AND #{endTime}
</if>
<if test="gridId != null and gridId != ''">
AND issue.GRID_ID = #{gridId}
AND (issue.GRID_ID = #{gridId}
OR find_in_set(#{gridId},issue.ALL_DEPT_IDS))
</if>
<if test="streetId != null and streetId != ''">
AND (find_in_set(#{streetId},issue.PARENT_DEPT_IDS)

3
esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/item/ItemDao.xml

@ -402,7 +402,8 @@
AND DATE_FORMAT( item.CREATED_TIME, '%Y-%m-%d' ) BETWEEN #{startTime} AND #{endTime}
</if>
<if test="gridId != null and gridId != ''">
AND item.GRID_ID = #{gridId}
AND (item.GRID_ID = #{gridId}
OR find_in_set(#{gridId},item.ALL_DEPT_IDS))
</if>
<if test="streetId != null and streetId != ''">
AND (find_in_set(#{streetId},item.PARENT_DEPT_IDS)

27
esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/resources/mapper/group/GroupDao.xml

@ -22,13 +22,16 @@
AND gp.STATE = #{state}
</if>
<if test="gridId != null and gridId != ''">
AND gp.GRID_ID = #{gridId}
AND (gp.GRID_ID = #{gridId}
OR find_in_set(#{gridId},gp.ALL_DEPT_IDS))
</if>
<if test="streetId != null and streetId != ''">
AND gp.STREET_ID = #{streetId}
AND (find_in_set(#{streetId},gp.PARENT_DEPT_IDS)
OR find_in_set(#{streetId},gp.ALL_DEPT_IDS))
</if>
<if test="communityId != null and communityId != ''">
AND gp.COMMUNITY_ID = #{communityId}
AND (find_in_set(#{communityId},gp.PARENT_DEPT_IDS)
OR find_in_set(#{communityId},gp.ALL_DEPT_IDS))
</if>
ORDER BY
gp.GROUP_CATEGORY, gp.CREATED_TIME DESC
@ -200,13 +203,16 @@
gp.DEL_FLAG = '0'
AND gp.STATE IN ( 10, 15 )
<if test="gridId != null and gridId != ''">
AND gp.GRID_ID = #{gridId}
AND (gp.GRID_ID = #{gridId}
OR find_in_set(#{gridId},gp.ALL_DEPT_IDS))
</if>
<if test="streetId != null and streetId != ''">
AND gp.STREET_ID = #{streetId}
AND (find_in_set(#{streetId},gp.PARENT_DEPT_IDS)
OR find_in_set(#{streetId},gp.ALL_DEPT_IDS))
</if>
<if test="communityId != null and communityId != ''">
AND gp.COMMUNITY_ID = #{communityId}
AND (find_in_set(#{communityId},gp.PARENT_DEPT_IDS)
OR find_in_set(#{communityId},gp.ALL_DEPT_IDS))
</if>
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
AND DATE_FORMAT( gp.CREATED_TIME, '%Y-%m-%d' ) BETWEEN #{startTime} AND #{endTime}
@ -234,13 +240,16 @@
gp.DEL_FLAG = '0'
AND gp.STATE IN ( 10, 15 )
<if test="gridId != null and gridId != ''">
AND gp.GRID_ID = #{gridId}
AND (gp.GRID_ID = #{gridId}
OR find_in_set(#{gridId},gp.ALL_DEPT_IDS))
</if>
<if test="streetId != null and streetId != ''">
AND gp.STREET_ID = #{streetId}
AND (find_in_set(#{streetId},gp.PARENT_DEPT_IDS)
OR find_in_set(#{streetId},gp.ALL_DEPT_IDS))
</if>
<if test="communityId != null and communityId != ''">
AND gp.COMMUNITY_ID = #{communityId}
AND (find_in_set(#{communityId},gp.PARENT_DEPT_IDS)
OR find_in_set(#{communityId},gp.ALL_DEPT_IDS))
</if>
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
AND DATE_FORMAT( gp.CREATED_TIME, '%Y-%m-%d' ) BETWEEN #{startTime} AND #{endTime}

9
esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/resources/mapper/topic/TopicDao.xml

@ -201,13 +201,16 @@
temp.DEL_FLAG = '0'
AND temp.STATE IN ( 0, 5, 20 )
<if test="streetId != null and streetId != ''">
AND temp.STREET_ID = #{streetId}
AND (find_in_set(#{streetId},temp.PARENT_DEPT_IDS)
OR find_in_set(#{streetId},temp.ALL_DEPT_IDS))
</if>
<if test="communityId != null and communityId != ''">
AND temp.COMMUNITY_ID = #{communityId}
AND (find_in_set(#{communityId},temp.PARENT_DEPT_IDS)
OR find_in_set(#{communityId},temp.ALL_DEPT_IDS))
</if>
<if test="gridId != null and gridId != ''">
AND temp.grid_id = #{gridId}
AND (temp.GRID_ID = #{gridId}
OR find_in_set(#{gridId},temp.ALL_DEPT_IDS))
</if>
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
AND DATE_FORMAT( temp.CREATED_TIME, '%Y-%m-%d' ) BETWEEN #{startTime} AND #{endTime}

71
esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/form/EpdcUserQueryFormDTO.java

@ -1,71 +0,0 @@
package com.elink.esua.epdc.dto.epdc.form;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* @Description 居民管理[未认证居民待认证居民已认证居民居民认证失败]页面查询入参DTO
* @Author yinzuomei
* @Date 2019/11/28 15:50
*/
@Data
public class EpdcUserQueryFormDTO implements Serializable {
private static final long serialVersionUID = -6726464735906160180L;
/**
* 姓名
*/
private String realName;
/**
* 手机号
*/
private String mobile;
/**
* 身份证号
*/
private String identityNo;
/**
* 注册开始日期
*/
private String startTime;
/**
* 注册结束日期
*/
private String endTime;
/**
* 是否是党员
*/
private String partyFlag;
/**
* 状态
*/
private String state;
/**
* 当前页码
*/
private int page;
/**
* 每页条数
*/
private int limit;
/**
* 所属机构
*/
private List<String> deptIdList;
/**
* 所属机构字符串
*/
private String deptIdListStr;
}

27
esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/result/EpdcUserQueryResultDTO.java

@ -1,27 +0,0 @@
package com.elink.esua.epdc.dto.epdc.result;
import com.elink.esua.epdc.dto.UserDTO;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* @Description 居民管理[未认证居民待认证居民已认证居民居民认证失败]页面查询返参DTO
* @Author yinzuomei
* @Date 2019/11/28 16:13
*/
@Data
public class EpdcUserQueryResultDTO implements Serializable {
private static final long serialVersionUID = -7375391737870073472L;
/**
* 总记录数
*/
private int total;
/**
* 居民信息列表
*/
private List<UserDTO> list;
}

1
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/EpdcAppUserController.java

@ -18,7 +18,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;
/**
* 对移动端开放

2
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/UserAuthenticateHistoryController.java

@ -48,7 +48,7 @@ import java.util.Map;
* @since v1.0.0 2019-11-21
*/
@RestController
@RequestMapping(Constant.EPDC_APP+"userauthenticatehistory")
@RequestMapping("userauthenticatehistory")
public class UserAuthenticateHistoryController {
@Autowired

15
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/UserController.java

@ -27,8 +27,6 @@ import com.elink.esua.epdc.commons.tools.validator.group.AddGroup;
import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup;
import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup;
import com.elink.esua.epdc.dto.UserDTO;
import com.elink.esua.epdc.dto.epdc.form.EpdcUserQueryFormDTO;
import com.elink.esua.epdc.dto.epdc.result.EpdcUserQueryResultDTO;
import com.elink.esua.epdc.enums.AppUserStatesEnum;
import com.elink.esua.epdc.excel.UserExcel;
import com.elink.esua.epdc.service.UserService;
@ -59,19 +57,6 @@ public class UserController {
return new Result<PageData<UserDTO>>().ok(page);
}
/**
* @param formDTO
* @return com.elink.esua.epdc.commons.tools.utils.Result<com.elink.esua.epdc.commons.tools.page.PageData < com.elink.esua.epdc.dto.UserDTO>>
* @Author yinzuomei
* @Description 居民列表[未认证居民待认证居民已认证居民居民认证失败]页面查询方法
* @Date 2019/11/28 16:01
**/
@PostMapping("query")
public Result<EpdcUserQueryResultDTO> query(@RequestBody EpdcUserQueryFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO);
return userService.listUserDTO(formDTO);
}
@GetMapping("{id}")
public Result<UserDTO> get(@PathVariable("id") String id) {
UserDTO data = userService.get(id);

27
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/UserDao.java

@ -18,17 +18,11 @@
package com.elink.esua.epdc.dao;
import com.elink.esua.epdc.commons.mybatis.dao.BaseDao;
import com.elink.esua.epdc.dto.UserDTO;
import com.elink.esua.epdc.dto.epdc.form.EpdcUnauthorizedAmountFromDTO;
import com.elink.esua.epdc.dto.epdc.form.EpdcUserGroupInviteFormDTO;
import com.elink.esua.epdc.dto.UserDTO;
import com.elink.esua.epdc.dto.epdc.form.EpdcUserQueryFormDTO;
import com.elink.esua.epdc.dto.epdc.result.*;
import com.elink.esua.epdc.dto.epdc.result.EpdcResidentDetailResultDTO;
import com.elink.esua.epdc.dto.epdc.result.EpdcUserInfoResultDTO;
import com.elink.esua.epdc.dto.epdc.result.EpdcUserRegisterAuditMsgResultDTO;
import com.elink.esua.epdc.dto.epdc.result.EpdcUserGroupInviteResultDTO;
import com.elink.esua.epdc.dto.epdc.form.EpdcWorkUserFromDTO;
import com.elink.esua.epdc.dto.epdc.result.EpdcWorkUserResultDTO;
import com.elink.esua.epdc.dto.epdc.result.*;
import com.elink.esua.epdc.entity.UserEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -154,21 +148,4 @@ public interface UserDao extends BaseDao<UserEntity> {
*/
int selectOneAnauthorizedAmount(EpdcUnauthorizedAmountFromDTO fromDto);
/**
* @param formDTO
* @return java.util.List<com.elink.esua.epdc.dto.UserDTO>
* @Author yinzuomei
* @Description 居民列表[未认证居民待认证居民已认证居民居民认证失败]页面查询方法
* @Date 2019/11/28 16:23
**/
List<UserDTO> selectListUserDTO(EpdcUserQueryFormDTO formDTO);
/**
* @param formDTO
* @return int
* @Author yinzuomei
* @Description 居民列表[未认证居民待认证居民已认证居民居民认证失败]页面查询总记录数
* @Date 2019/11/28 16:23
**/
int selectCountOfUserDTO(EpdcUserQueryFormDTO formDTO);
}

40
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/entity/PartyAuthenticationFailedEntity.java

@ -78,26 +78,6 @@ public class PartyAuthenticationFailedEntity extends BaseEpdcEntity {
*/
private Date registTime;
/**
* 街道名称
*/
private String streetName;
/**
* 街道ID
*/
private Long streetId;
/**
* 社区名称
*/
private String communityName;
/**
* 社区ID
*/
private Long communityId;
/**
* 网格名称
*/
@ -133,4 +113,24 @@ public class PartyAuthenticationFailedEntity extends BaseEpdcEntity {
*/
private String address;
/***
*所有部门名称
*/
private String allDeptNames;
/***
*所有部门ID
*/
private String allDeptIds;
/***
*父所有部门
*/
private String parentDeptNames;
/***
*父所有部门
*/
private String parentDeptIds;
}

34
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/entity/PartyMembersEntity.java

@ -73,22 +73,6 @@ public class PartyMembersEntity extends BaseEpdcEntity {
* 注册时间
*/
private Date registTime;
/**
* 街道名称
*/
private String streetName;
/**
* 街道ID
*/
private long streetId;
/**
* 社区名称
*/
private String communityName;
/**
* 社区ID
*/
private long communityId;
/**
* 网格名称
*/
@ -101,5 +85,23 @@ public class PartyMembersEntity extends BaseEpdcEntity {
* 部门ID
*/
private long deptId;
/***
*所有部门名称
*/
private String allDeptNames;
/***
*所有部门ID
*/
private String allDeptIds;
/***
*父所有部门
*/
private String parentDeptNames;
/***
*父所有部门
*/
private String parentDeptIds;
}

23
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/entity/UserGridRelationEntity.java

@ -28,7 +28,7 @@ import java.util.Date;
/**
* 网格长与网格关系表
*
* @author work@yujt.net.cn
* @author work@yujt.net.cn
* @since v1.0.0 2019-10-23
*/
@Data
@ -63,4 +63,23 @@ public class UserGridRelationEntity extends BaseEpdcEntity {
*/
private String leaderFlag;
}
/***
*所有部门名称
*/
private String allDeptNames;
/***
*所有部门ID
*/
private String allDeptIds;
/***
*父所有部门
*/
private String parentDeptNames;
/***
*父所有部门
*/
private String parentDeptIds;
}

9
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/UserService.java

@ -238,13 +238,4 @@ public interface UserService extends BaseService<UserEntity> {
* @date 2019/11/19 13:28
*/
Result<Integer> getAnauthorizedAmount(EpdcUnauthorizedAmountFromDTO fromDto);
/**
* @param formDTO
* @return com.elink.esua.epdc.commons.tools.utils.Result<com.elink.esua.epdc.dto.epdc.result.EpdcUserQueryResultDTO>
* @Author yinzuomei
* @Description 居民列表[未认证居民待认证居民已认证居民居民认证失败]页面查询方法
* @Date 2019/11/28 16:17
**/
Result<EpdcUserQueryResultDTO> listUserDTO(EpdcUserQueryFormDTO formDTO);
}

2
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/PartyMembersServiceImpl.java

@ -162,8 +162,6 @@ public class PartyMembersServiceImpl extends BaseServiceImpl<PartyMembersDao, Pa
partyMembersEntity.setCadreFlag("0");
partyMembersEntity.setRegistFlag("0");
partyMembersEntity.setRegistTime(new Date());
partyMembersEntity.setStreetName(null);
partyMembersEntity.setCommunityName(null);
partyMembersEntity.setGridName(null);
}
insertBatch(partyMembersEntityList);

31
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/UserServiceImpl.java

@ -465,10 +465,12 @@ public class UserServiceImpl extends BaseServiceImpl<UserDao, UserEntity> implem
String identityNo = userDto.getIdentityNo();
if (YesOrNoEnum.YES.value().equals(userDto.getPartyFlag())) {
PartyMembersEntity partyMembersEntity = new PartyMembersEntity();
partyMembersEntity.setStreetId(userGridRelation.getStreetId());
partyMembersEntity.setStreetName(userGridRelation.getStreet());
partyMembersEntity.setCommunityId(userGridRelation.getCommunityId());
partyMembersEntity.setCommunityName(userGridRelation.getCommunity());
//修改数据库结构
partyMembersEntity.setAllDeptNames(userGridRelation.getStreet()+"-"+userGridRelation.getCommunity()+"-"+userGridRelation.getGrid());
partyMembersEntity.setAllDeptIds(userGridRelation.getStreetId()+","+userGridRelation.getCommunityId()+","+userGridRelation.getGridId());
partyMembersEntity.setParentDeptNames(userGridRelation.getStreet()+"-"+userGridRelation.getCommunity());
partyMembersEntity.setParentDeptIds(userGridRelation.getStreetId()+","+userGridRelation.getCommunityId());
partyMembersEntity.setGridId(userGridRelation.getGridId());
partyMembersEntity.setGridName(userGridRelation.getGrid());
partyMembersEntity.setRegistFlag(YesOrNoEnum.YES.value());
@ -643,26 +645,5 @@ public class UserServiceImpl extends BaseServiceImpl<UserDao, UserEntity> implem
public Result<Integer> getAnauthorizedAmount(EpdcUnauthorizedAmountFromDTO fromDto) {
return new Result<Integer>().ok(baseDao.selectOneAnauthorizedAmount(fromDto));
}
/**
* @param formDTO
* @return com.elink.esua.epdc.commons.tools.utils.Result<com.elink.esua.epdc.dto.epdc.result.EpdcUserQueryResultDTO>
* @Author yinzuomei
* @Description 居民列表[未认证居民待认证居民已认证居民居民认证失败]页面查询方法
* @Date 2019/11/28 16:17
**/
@Override
public Result<EpdcUserQueryResultDTO> listUserDTO(EpdcUserQueryFormDTO formDTO) {
EpdcUserQueryResultDTO data = new EpdcUserQueryResultDTO();
int pageIndex = (formDTO.getPage() - NumConstant.ONE) * formDTO.getLimit();
formDTO.setPage(pageIndex);
if (null != formDTO.getDeptIdList() && formDTO.getDeptIdList().size() > 0) {
formDTO.setDeptIdListStr(formDTO.getDeptIdList().stream().map(String::valueOf).collect(Collectors.joining(",")));
}
List<UserDTO> userDTOList = baseDao.selectListUserDTO(formDTO);
int total = baseDao.selectCountOfUserDTO(formDTO);
data.setTotal(total);
data.setList(userDTOList);
return new Result<EpdcUserQueryResultDTO>().ok(data);
}
}

92
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/UserDao.xml

@ -66,11 +66,7 @@
ADDRESS,
STATE,
PARTY_FLAG,
CONCAT(
ifnull(ug.STREET,''),
'-',ug.COMMUNITY,
'-',ug.GRID
) AS myGridName
ug.ALL_DEPT_NAMES AS myGridName
FROM
epdc_user u
LEFT JOIN epdc_user_grid_relation ug ON u.ID = ug.USER_ID
@ -82,9 +78,18 @@
<if test="mobile != '' and mobile != null">and u.mobile like '%${mobile}%'</if>
<if test="identityNo != '' and identityNo != null">and u.identity_no like '%${identityNo}%'</if>
<if test="partyFlag != '' and partyFlag != null">and u.party_flag = #{partyFlag}</if>
<if test="streetId != '' and streetId != null">and ug.street_id = #{streetId}</if>
<if test="communityId != '' and communityId != null">and ug.community_id = #{communityId}</if>
<if test="gridId != '' and gridId != null">and ug.grid_id = #{gridId}</if>
<if test="streetId != '' and streetId != null">
AND (find_in_set(#{streetId},ug.PARENT_DEPT_IDS)
OR find_in_set(#{streetId},ug.ALL_DEPT_IDS))
</if>
<if test="communityId != '' and communityId != null">
AND (find_in_set(#{communityId},ug.PARENT_DEPT_IDS)
OR find_in_set(#{communityId},ug.ALL_DEPT_IDS))
</if>
<if test="gridId != '' and gridId != null">
and (ug.grid_id = #{gridId}
OR find_in_set(#{gridId},ug.ALL_DEPT_IDS))
</if>
GROUP BY
u.ID
ORDER BY
@ -305,75 +310,4 @@
</choose>
</select>
<!-- 居民列表[未认证居民、待认证居民、已认证居民、居民认证失败]页面查询方法 -->
<select id="selectListUserDTO" parameterType="com.elink.esua.epdc.dto.epdc.form.EpdcUserQueryFormDTO" resultType="com.elink.esua.epdc.dto.UserDTO">
SELECT
u.id,
u.REAL_NAME AS realName,
u.mobile,
u.REGISTER_TIME AS registerTime,
IDENTITY_NO AS identityNo,
address,
state,
PARTY_FLAG AS partyFlag,
u.ALL_DEPT_NAMES AS myGridName
FROM
epdc_user u
WHERE
u.del_flag = '0'
<if test="startTime != '' and endTime != ''">
and u.register_time between #{startTime} and #{endTime}
</if>
<if test="state != '' and state != null">
and u.state = #{state}
</if>
<if test="realName != '' and realName != null">
and u.real_name like '%${realName}%'
</if>
<if test="mobile != '' and mobile != null">
and u.mobile like '%${mobile}%'
</if>
<if test="identityNo != '' and identityNo != null">
and u.identity_no like '%${identityNo}%'
</if>
<if test="partyFlag != '' and partyFlag != null">
and u.party_flag = #{partyFlag}
</if>
<if test="deptIdListStr != '' and deptIdListStr != null">
and u.ALL_DEPT_IDS=#{deptIdListStr}
</if>
ORDER BY u.register_time desc
LIMIT #{page},#{limit}
</select>
<!-- 居民列表[未认证居民、待认证居民、已认证居民、居民认证失败]页面查询总记录数 -->
<select id="selectCountOfUserDTO" parameterType="com.elink.esua.epdc.dto.epdc.form.EpdcUserQueryFormDTO" resultType="java.lang.Integer">
SELECT
count(u.id) as totalNum
FROM
epdc_user u
WHERE
u.del_flag = '0'
<if test="startTime != '' and endTime != ''">
and u.register_time between #{startTime} and #{endTime}
</if>
<if test="state != '' and state != null">
and u.state = #{state}
</if>
<if test="realName != '' and realName != null">
and u.real_name like '%${realName}%'
</if>
<if test="mobile != '' and mobile != null">
and u.mobile like '%${mobile}%'
</if>
<if test="identityNo != '' and identityNo != null">
and u.identity_no like '%${identityNo}%'
</if>
<if test="partyFlag != '' and partyFlag != null">
and u.party_flag = #{partyFlag}
</if>
<if test="deptIdListStr != '' and deptIdListStr != null">
and u.ALL_DEPT_IDS=#{deptIdListStr}
</if>
</select>
</mapper>

Loading…
Cancel
Save