Browse Source

党群管理bug修改

feature/syp_points
songyunpeng 5 years ago
parent
commit
f44f4c5456
  1. 8
      esua-epdc/epdc-module/epdc-party-group/epdc-party-group-client/src/main/java/com/elink/esua/epdc/dto/PartyGroupOfficialsDTO.java
  2. 2
      esua-epdc/epdc-module/epdc-party-group/epdc-party-group-client/src/main/java/com/elink/esua/epdc/dto/constant/PartyGroupConstant.java
  3. 13
      esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/controller/PartyGroupController.java
  4. 8
      esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/dao/PartyGroupDao.java
  5. 8
      esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/entity/PartyGroupOfficialsEntity.java
  6. 9
      esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/service/PartyGroupService.java
  7. 1
      esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/service/PartyUserGroupService.java
  8. 79
      esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/service/impl/PartyGroupServiceImpl.java
  9. 3
      esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/service/impl/PartyUserGroupServiceImpl.java
  10. 7
      esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/resources/mapper/PartyGroupDao.xml
  11. 46
      esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/resources/mapper/PartyGroupOfficialsDao.xml
  12. 4
      esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/resources/mapper/PartyUserGroupDao.xml
  13. 12
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/UserController.java
  14. 9
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/UserDao.java
  15. 8
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/UserService.java
  16. 7
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/UserServiceImpl.java
  17. 59
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/UserDao.xml

8
esua-epdc/epdc-module/epdc-party-group/epdc-party-group-client/src/main/java/com/elink/esua/epdc/dto/PartyGroupOfficialsDTO.java

@ -17,12 +17,12 @@
package com.elink.esua.epdc.dto; package com.elink.esua.epdc.dto;
import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import lombok.Data;
/** /**
* 网格长楼长 * 网格长楼长
@ -44,6 +44,10 @@ public class PartyGroupOfficialsDTO implements Serializable {
* 党群ID * 党群ID
*/ */
private String partyGroupId; private String partyGroupId;
/**
* 党群名
*/
private String partyGroupName;
/** /**
* 姓名 * 姓名

2
esua-epdc/epdc-module/epdc-party-group/epdc-party-group-client/src/main/java/com/elink/esua/epdc/dto/constant/PartyGroupConstant.java

@ -18,6 +18,6 @@ public interface PartyGroupConstant {
/** /**
* 党群身份标识 群主 * 党群身份标识 群主
*/ */
String PARTY_GROUP_IDENTITY_FLAG = "1"; String PARTY_GROUP_IDENTITY_FLAG = "0";
} }

13
esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/controller/PartyGroupController.java

@ -24,14 +24,12 @@ import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.commons.tools.validator.AssertUtils; import com.elink.esua.epdc.commons.tools.validator.AssertUtils;
import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils;
import com.elink.esua.epdc.commons.tools.validator.group.AddGroup; import com.elink.esua.epdc.commons.tools.validator.group.AddGroup;
import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup;
import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup; 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.PartyGroupDTO; import com.elink.esua.epdc.dto.PartyGroupDTO;
import com.elink.esua.epdc.dto.PartyGroupListDTO; import com.elink.esua.epdc.dto.PartyGroupListDTO;
import com.elink.esua.epdc.dto.UserDTO;
import com.elink.esua.epdc.excel.PartyGroupExcel; import com.elink.esua.epdc.excel.PartyGroupExcel;
import com.elink.esua.epdc.service.PartyGroupService; import com.elink.esua.epdc.service.PartyGroupService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@ -109,13 +107,4 @@ public class PartyGroupController {
} }
@GetMapping("getUserList/{deptId}")
public Result<List<UserDTO>> getUserList(@PathVariable("deptId") Long deptId) {
if(deptId==null){
return new Result<List<UserDTO>>().error("部门ID为空!");
}
List<UserDTO> data = partyGroupService.getUserList(deptId);
return new Result<List<UserDTO>>().ok(data);
}
} }

8
esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/dao/PartyGroupDao.java

@ -66,4 +66,12 @@ public interface PartyGroupDao extends BaseDao<PartyGroupEntity> {
* @return java.util.List<com.elink.esua.epdc.dto.result.PartyGroupResultDTO> * @return java.util.List<com.elink.esua.epdc.dto.result.PartyGroupResultDTO>
**/ **/
List<PartyGroupResultDTO> getAllPartyGroup(String userId); List<PartyGroupResultDTO> getAllPartyGroup(String userId);
/**
* @Description 根据党群名获取党群
* @Author songyunpeng
* @Date 2020/6/5
* @Param [partyGroupName]
* @return com.elink.esua.epdc.dto.PartyGroupDTO
**/
PartyGroupDTO getPartyGroupDTOByName(String partyGroupName);
} }

8
esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/entity/PartyGroupOfficialsEntity.java

@ -18,13 +18,10 @@
package com.elink.esua.epdc.entity; package com.elink.esua.epdc.entity;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity; import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import java.util.Date;
/** /**
* 网格长楼长 * 网格长楼长
* *
@ -43,6 +40,11 @@ public class PartyGroupOfficialsEntity extends BaseEpdcEntity {
*/ */
private String partyGroupId; private String partyGroupId;
/**
* 党群名
*/
private String partyGroupName;
/** /**
* 姓名 * 姓名
*/ */

9
esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/service/PartyGroupService.java

@ -137,4 +137,13 @@ public interface PartyGroupService extends BaseService<PartyGroupEntity> {
* @return com.elink.esua.epdc.commons.tools.utils.Result * @return com.elink.esua.epdc.commons.tools.utils.Result
**/ **/
Result joinGroup(PartyUserJoinGroupFormDTO partyUserJoinGroupFormDTO); Result joinGroup(PartyUserJoinGroupFormDTO partyUserJoinGroupFormDTO);
/**
* @Description 根据党群名获取党群
* @Author songyunpeng
* @Date 2020/6/5
* @Param [partyGroupName]
* @return com.elink.esua.epdc.dto.PartyGroupDTO
**/
PartyGroupDTO getPartyGroupDTOByName(String partyGroupName);
} }

1
esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/service/PartyUserGroupService.java

@ -171,4 +171,5 @@ public interface PartyUserGroupService extends BaseService<PartyUserGroupEntity>
* @return com.elink.esua.epdc.commons.tools.utils.Result * @return com.elink.esua.epdc.commons.tools.utils.Result
**/ **/
Result modifyIdentity(PartyUserIdentityFormDTO formDTO); Result modifyIdentity(PartyUserIdentityFormDTO formDTO);
} }

79
esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/service/impl/PartyGroupServiceImpl.java

@ -46,7 +46,7 @@ import java.util.List;
import java.util.Map; import java.util.Map;
/** /**
* 党群表 * 党群表
* *
* @author elink elink@elink-cn.com * @author elink elink@elink-cn.com
* @since v1.0.0 2020-05-29 * @since v1.0.0 2020-05-29
@ -83,8 +83,8 @@ public class PartyGroupServiceImpl extends BaseServiceImpl<PartyGroupDao, PartyG
return ConvertUtils.sourceToTarget(entityList, PartyGroupDTO.class); return ConvertUtils.sourceToTarget(entityList, PartyGroupDTO.class);
} }
private QueryWrapper<PartyGroupEntity> getWrapper(Map<String, Object> params){ private QueryWrapper<PartyGroupEntity> getWrapper(Map<String, Object> params) {
String id = (String)params.get(FieldConstant.ID_HUMP); String id = (String) params.get(FieldConstant.ID_HUMP);
QueryWrapper<PartyGroupEntity> wrapper = new QueryWrapper<>(); QueryWrapper<PartyGroupEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
@ -94,24 +94,49 @@ public class PartyGroupServiceImpl extends BaseServiceImpl<PartyGroupDao, PartyG
@Override @Override
public PartyGroupDTO get(String id) { public PartyGroupDTO get(String id) {
return baseDao.selectDetailById(id); return baseDao.selectDetailById(id);
} }
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void save(PartyGroupDTO dto) { public void save(PartyGroupDTO dto) {
//确认党群名字是否重复
this.isPartyGroupNameExists(dto);
//保存部门信息 //保存部门信息
this.saveDeptInfo(dto); this.saveDeptInfo(dto);
PartyGroupEntity entity = ConvertUtils.sourceToTarget(dto, PartyGroupEntity.class); PartyGroupEntity entity = ConvertUtils.sourceToTarget(dto, PartyGroupEntity.class);
insert(entity); insert(entity);
//保存群主信息 //保存群主信息
this.insertUserGroup(dto.getUserId(),entity.getId()); this.insertUserGroup(dto.getUserId(), entity.getId());
}
private void isPartyGroupNameExists(PartyGroupDTO dto) {
//先判断党群名是否重复
if (StringUtils.isNotBlank(dto.getId())) {
//代表更新党群
PartyGroupDTO oldPartyGroupDTO = get(dto.getId());
if (oldPartyGroupDTO == null) {
throw new RenException("该党群不存在");
}
//若是改名则判断新名字是否重复
if (!dto.getPartyGroupName().equals(oldPartyGroupDTO.getPartyGroupName())) {
PartyGroupDTO partyGroupDTO = getPartyGroupDTOByName(dto.getPartyGroupName());
if (partyGroupDTO != null) {
throw new RenException("该党群名名字已存在");
}
}
} else {
PartyGroupDTO partyGroupDTO = getPartyGroupDTOByName(dto.getPartyGroupName());
if (partyGroupDTO != null) {
throw new RenException("该党群名名字已存在");
}
}
} }
private void saveDeptInfo(PartyGroupDTO dto) { private void saveDeptInfo(PartyGroupDTO dto) {
//赋值部门名称 //赋值部门名称
Result<SysDeptDTO> sysDeptDTO = adminFeignClient.getSysDeptDTO(Long.parseLong(dto.getDeptId())); Result<SysDeptDTO> sysDeptDTO = adminFeignClient.getSysDeptDTO(Long.parseLong(dto.getDeptId()));
if(!sysDeptDTO.success() || sysDeptDTO.getData()==null){ if (!sysDeptDTO.success() || sysDeptDTO.getData() == null) {
throw new RenException(sysDeptDTO.getMsg()); throw new RenException(sysDeptDTO.getMsg());
} }
SysDeptDTO dept = sysDeptDTO.getData(); SysDeptDTO dept = sysDeptDTO.getData();
@ -129,31 +154,32 @@ public class PartyGroupServiceImpl extends BaseServiceImpl<PartyGroupDao, PartyG
} }
} }
private void insertUserGroup(String userId,String partyGroupId) { private void insertUserGroup(String userId, String partyGroupId) {
Result<UserDTO> userInfoById = userFeignClient.getUserInfoById(userId); Result<UserDTO> userInfoById = userFeignClient.getUserInfoById(userId);
if(!userInfoById.success() || userInfoById.getData() == null){ if (!userInfoById.success() || userInfoById.getData() == null) {
throw new RenException("获取用户信息失败"); throw new RenException("获取用户信息失败");
} }
UserDTO userDto = userInfoById.getData(); UserDTO userDto = userInfoById.getData();
PartyUserGroupEntity partyUserGroupEntity = new PartyUserGroupEntity(); PartyUserGroupEntity partyUserGroupEntity = new PartyUserGroupEntity();
partyUserGroupEntity.setIdentityFlag(userDto.getPartyFlag()); partyUserGroupEntity.setPartyMember(userDto.getPartyFlag());
partyUserGroupEntity.setUserId(userDto.getId()); partyUserGroupEntity.setUserId(userDto.getId());
partyUserGroupEntity.setNickname(userDto.getNickname()); partyUserGroupEntity.setNickname(userDto.getNickname());
partyUserGroupEntity.setUserAvatar(userDto.getFaceImg()); partyUserGroupEntity.setUserAvatar(userDto.getFaceImg());
partyUserGroupEntity.setMobile(userDto.getMobile()); partyUserGroupEntity.setMobile(userDto.getMobile());
partyUserGroupEntity.setPartyGroupId(partyGroupId); partyUserGroupEntity.setPartyGroupId(partyGroupId);
partyUserGroupEntity.setIdentityFlag("1"); //身份标识为群主
partyUserGroupEntity.setIdentityFlag("0");
//网格信息 //网格信息
if(userDto.getGridId()!=null && userDto.getGridId()!=0){ if (userDto.getGridId() != null && userDto.getGridId() != 0) {
partyUserGroupEntity.setGrid(userDto.getGrid()); partyUserGroupEntity.setGrid(userDto.getGrid());
partyUserGroupEntity.setGridId(userDto.getGridId()); partyUserGroupEntity.setGridId(userDto.getGridId());
partyUserGroupEntity.setAllDeptIds(userDto.getAllDeptIds()); partyUserGroupEntity.setAllDeptIds(userDto.getAllDeptIds());
partyUserGroupEntity.setAllDeptNames(userDto.getAllDeptNames()); partyUserGroupEntity.setAllDeptNames(userDto.getAllDeptNames());
partyUserGroupEntity.setParentDeptIds(userDto.getParentDeptIds()); partyUserGroupEntity.setParentDeptIds(userDto.getParentDeptIds());
partyUserGroupEntity.setParentDeptNames(userDto.getParentDeptNames()); partyUserGroupEntity.setParentDeptNames(userDto.getParentDeptNames());
}else{ } else {
Result<UserGridRelationDTO> userFirstScanGird = userFeignClient.getUserFirstScanGird(userId); Result<UserGridRelationDTO> userFirstScanGird = userFeignClient.getUserFirstScanGird(userId);
if(!userFirstScanGird.success() || userFirstScanGird.getData() == null){ if (!userFirstScanGird.success() || userFirstScanGird.getData() == null) {
throw new RenException("获取用户网格关联信息失败"); throw new RenException("获取用户网格关联信息失败");
} }
UserGridRelationDTO userGridRelationDTO = userFirstScanGird.getData(); UserGridRelationDTO userGridRelationDTO = userFirstScanGird.getData();
@ -171,6 +197,7 @@ public class PartyGroupServiceImpl extends BaseServiceImpl<PartyGroupDao, PartyG
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void update(PartyGroupDTO dto) { public void update(PartyGroupDTO dto) {
this.isPartyGroupNameExists(dto);
//保存部门信息 //保存部门信息
this.saveDeptInfo(dto); this.saveDeptInfo(dto);
PartyGroupEntity entity = ConvertUtils.sourceToTarget(dto, PartyGroupEntity.class); PartyGroupEntity entity = ConvertUtils.sourceToTarget(dto, PartyGroupEntity.class);
@ -178,19 +205,20 @@ public class PartyGroupServiceImpl extends BaseServiceImpl<PartyGroupDao, PartyG
//判断是否更新群主 //判断是否更新群主
PartyUserGroupDTO managerByGroupId = partyUserGroupService.getManagerByGroupId(dto.getId()); PartyUserGroupDTO managerByGroupId = partyUserGroupService.getManagerByGroupId(dto.getId());
//存在群主且如过改变群主信息 则之前群主为群成员 //存在群主且如过改变群主信息 则之前群主为群成员
if(managerByGroupId != null && !managerByGroupId.getUserId().equals(dto.getUserId())){ if (managerByGroupId != null && !managerByGroupId.getUserId().equals(dto.getUserId())) {
//先更新之前的群主为群成员 //先更新之前的群主为群成员
managerByGroupId.setIdentityFlag("0"); managerByGroupId.setIdentityFlag("2");
partyUserGroupService.update(managerByGroupId); partyUserGroupService.update(managerByGroupId);
} }
//判断新指定的群主是否已存在党群成员中 //判断新指定的群主是否已存在党群成员中
PartyUserGroupDTO userByGroupIdAndUserId = partyUserGroupService.getUserByGroupIdAndUserId(dto.getId(), dto.getUserId()); PartyUserGroupDTO userByGroupIdAndUserId = partyUserGroupService.getUserByGroupIdAndUserId(dto.getId(), dto.getUserId());
//新指定群主不存在则直接新增 //新指定群主不存在则直接新增
if(userByGroupIdAndUserId==null){ if (userByGroupIdAndUserId == null) {
//保存群主信息 //保存群主信息
this.insertUserGroup(dto.getUserId(),entity.getId()); this.insertUserGroup(dto.getUserId(), entity.getId());
}else{//存在则只更新身份标识 } else {//存在则只更新身份标识
userByGroupIdAndUserId.setIdentityFlag("1"); //身份标识为群主
userByGroupIdAndUserId.setIdentityFlag("0");
partyUserGroupService.update(userByGroupIdAndUserId); partyUserGroupService.update(userByGroupIdAndUserId);
} }
} }
@ -211,7 +239,7 @@ public class PartyGroupServiceImpl extends BaseServiceImpl<PartyGroupDao, PartyG
@Override @Override
public List<UserDTO> getUserList(Long deptId) { public List<UserDTO> getUserList(Long deptId) {
Result<List<UserDTO>> userList = userFeignClient.getUserList(deptId); Result<List<UserDTO>> userList = userFeignClient.getUserList(deptId);
if(!userList.success() || userList.getData()==null){ if (!userList.success() || userList.getData() == null) {
throw new RenException("获取用户列表信息失败"); throw new RenException("获取用户列表信息失败");
} }
return userList.getData(); return userList.getData();
@ -233,15 +261,20 @@ public class PartyGroupServiceImpl extends BaseServiceImpl<PartyGroupDao, PartyG
public Result joinGroup(PartyUserJoinGroupFormDTO partyUserJoinGroupFormDTO) { public Result joinGroup(PartyUserJoinGroupFormDTO partyUserJoinGroupFormDTO) {
//判断是够已加入党群 //判断是够已加入党群
PartyUserGroupDTO userByGroupIdAndUserId = partyUserGroupService.getUserByGroupIdAndUserId(partyUserJoinGroupFormDTO.getPartyGroupId(), partyUserJoinGroupFormDTO.getUserId()); PartyUserGroupDTO userByGroupIdAndUserId = partyUserGroupService.getUserByGroupIdAndUserId(partyUserJoinGroupFormDTO.getPartyGroupId(), partyUserJoinGroupFormDTO.getUserId());
if(userByGroupIdAndUserId!=null){ if (userByGroupIdAndUserId != null) {
return new Result().error("用户已加入此群!"); return new Result().error("用户已加入此群!");
} }
PartyUserGroupDTO partyUserGroupDTO = ConvertUtils.sourceToTarget(partyUserJoinGroupFormDTO,PartyUserGroupDTO.class); PartyUserGroupDTO partyUserGroupDTO = ConvertUtils.sourceToTarget(partyUserJoinGroupFormDTO, PartyUserGroupDTO.class);
partyUserGroupDTO.setIdentityFlag("0"); //身份标识为群成员
partyUserGroupDTO.setIdentityFlag("2");
partyUserGroupDTO.setState(0); partyUserGroupDTO.setState(0);
partyUserGroupService.save(partyUserGroupDTO); partyUserGroupService.save(partyUserGroupDTO);
return new Result(); return new Result();
} }
@Override
public PartyGroupDTO getPartyGroupDTOByName(String partyGroupName) {
return baseDao.getPartyGroupDTOByName(partyGroupName);
}
} }

3
esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/service/impl/PartyUserGroupServiceImpl.java

@ -209,7 +209,8 @@ public class PartyUserGroupServiceImpl extends BaseServiceImpl<PartyUserGroupDao
//获取之前的群主信息 //获取之前的群主信息
PartyUserGroupDTO managerByGroupId = getManagerByGroupId(partyUserGroupDTO.getPartyGroupId()); PartyUserGroupDTO managerByGroupId = getManagerByGroupId(partyUserGroupDTO.getPartyGroupId());
if(managerByGroupId!=null){ if(managerByGroupId!=null){
managerByGroupId.setIdentityFlag("0"); //更新为群成员
managerByGroupId.setIdentityFlag("2");
updateById(ConvertUtils.sourceToTarget(managerByGroupId,PartyUserGroupEntity.class)); updateById(ConvertUtils.sourceToTarget(managerByGroupId,PartyUserGroupEntity.class));
} }
} }

7
esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/resources/mapper/PartyGroupDao.xml

@ -56,7 +56,7 @@
t.UPDATED_TIME, t.UPDATED_TIME,
t1.NICKNAME t1.NICKNAME
from epdc_party_group t from epdc_party_group t
left join (select PARTY_GROUP_ID,NICKNAME from epdc_party_user_group where IDENTITY_FLAG = '1' and DEL_FLAG='0' and STATE='0') t1 on t.ID = t1.PARTY_GROUP_ID left join (select PARTY_GROUP_ID,NICKNAME from epdc_party_user_group where IDENTITY_FLAG = '0' and DEL_FLAG='0' and STATE='0') t1 on t.ID = t1.PARTY_GROUP_ID
where t.DEL_FLAG ='0' where t.DEL_FLAG ='0'
order by CREATED_TIME desc order by CREATED_TIME desc
</select> </select>
@ -84,7 +84,7 @@
t1.NICKNAME, t1.NICKNAME,
t1.USER_ID t1.USER_ID
from epdc_party_group t from epdc_party_group t
left join (select PARTY_GROUP_ID,NICKNAME,USER_ID from epdc_party_user_group where IDENTITY_FLAG = '1' and DEL_FLAG='0' and STATE='0') t1 on t.ID = t1.PARTY_GROUP_ID left join (select PARTY_GROUP_ID,NICKNAME,USER_ID from epdc_party_user_group where IDENTITY_FLAG = '0' and DEL_FLAG='0' and STATE='0') t1 on t.ID = t1.PARTY_GROUP_ID
where t.DEL_FLAG ='0' and t.ID = #{id} where t.DEL_FLAG ='0' and t.ID = #{id}
</select> </select>
@ -99,4 +99,7 @@
left join epdc_party_user_group t1 on t1.PARTY_GROUP_ID = t.ID and t1.DEL_FLAG ='0' and t1.USER_ID=#{userId} left join epdc_party_user_group t1 on t1.PARTY_GROUP_ID = t.ID and t1.DEL_FLAG ='0' and t1.USER_ID=#{userId}
where t.DEL_FLAG ='0' and t.STATE ='0' order by t.CREATED_TIME desc where t.DEL_FLAG ='0' and t.STATE ='0' order by t.CREATED_TIME desc
</select> </select>
<select id="getPartyGroupDTOByName" resultType="com.elink.esua.epdc.dto.PartyGroupDTO">
select ID from epdc_party_group where PARTY_GROUP_NAME = #{partyGroupName} and DEL_FLAG='0' limit 1;
</select>
</mapper> </mapper>

46
esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/resources/mapper/PartyGroupOfficialsDao.xml

@ -23,35 +23,39 @@
<result property="allDeptNames" column="ALL_DEPT_NAMES"/> <result property="allDeptNames" column="ALL_DEPT_NAMES"/>
<result property="parentDeptIds" column="PARENT_DEPT_IDS"/> <result property="parentDeptIds" column="PARENT_DEPT_IDS"/>
<result property="parentDeptNames" column="PARENT_DEPT_NAMES"/> <result property="parentDeptNames" column="PARENT_DEPT_NAMES"/>
<result property="partyGroupName" column="PARTY_GROUP_NAME"/>
<result property="gridId" column="GRID_ID"/> <result property="gridId" column="GRID_ID"/>
</resultMap> </resultMap>
<select id="selectListOfPartyGroupOfficialsDTO" resultMap="partyGroupOfficialsMap"> <select id="selectListOfPartyGroupOfficialsDTO" resultMap="partyGroupOfficialsMap">
select ID, select
PARTY_GROUP_ID, t.ID,
NAME, t.PARTY_GROUP_ID,
MOBILE, t.NAME,
MOTTO, t.MOBILE,
DUTY, t.MOTTO,
FACE_IMG, t.DUTY,
AREA_RESPONSIBILITY, t.FACE_IMG,
DEL_FLAG, t.AREA_RESPONSIBILITY,
REVISION, t.DEL_FLAG,
CREATED_BY, t.REVISION,
CREATED_TIME, t.CREATED_BY,
UPDATED_BY, t.CREATED_TIME,
UPDATED_TIME t.UPDATED_BY,
from epdc_party_group_officials t.UPDATED_TIME,
where DEL_FLAG ='0' t1.PARTY_GROUP_NAME
<if test="partyGroupId!=null and partyGroupId != ''"> from epdc_party_group_officials t
PARTY_GROUP_ID = #{partyGroupId} left join epdc_party_group t1 on t.PARTY_GROUP_ID = t1.ID and t1.DEL_FLAG='0'
where t.DEL_FLAG ='0'
<if test="groupId!=null and groupId != ''">
and t.PARTY_GROUP_ID = #{groupId}
</if> </if>
<if test="gridId != null and gridId != ''"> <if test="gridId != null and gridId != ''">
AND (GRID_ID = #{gridId} AND (t.GRID_ID = #{gridId}
OR find_in_set(#{gridId},ALL_DEPT_IDS)) OR find_in_set(#{gridId},t.ALL_DEPT_IDS))
</if> </if>
order by CREATED_TIME desc order by t.CREATED_TIME desc
</select> </select>

4
esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/resources/mapper/PartyUserGroupDao.xml

@ -46,7 +46,7 @@
UPDATED_BY, UPDATED_BY,
UPDATED_TIME UPDATED_TIME
from epdc_party_user_group from epdc_party_user_group
where DEL_FLAG='0' and PARTY_GROUP_ID = #{groupId} and IDENTITY_FLAG = '1' where DEL_FLAG='0' and PARTY_GROUP_ID = #{groupId} and IDENTITY_FLAG = '0'
</select> </select>
<select id="getUserByGroupIdAndUserId" resultType="com.elink.esua.epdc.dto.PartyUserGroupDTO"> <select id="getUserByGroupIdAndUserId" resultType="com.elink.esua.epdc.dto.PartyUserGroupDTO">
@ -184,7 +184,7 @@
GRID,DATEDIFF(BANNED_END_TIME,BANNED_START_TIME) as bannedTime from epdc_party_user_group)a GRID,DATEDIFF(BANNED_END_TIME,BANNED_START_TIME) as bannedTime from epdc_party_user_group)a
where DEL_FLAG='0' where DEL_FLAG='0'
and PARTY_GROUP_ID = #{partyGroupId} and PARTY_GROUP_ID = #{partyGroupId}
order by CREATED_TIME desc order by IDENTITY_FLAG,CREATED_TIME desc
LIMIT #{pageIndex},#{pageSize} LIMIT #{pageIndex},#{pageSize}
</select> </select>
<select id="selectOneOfPartyUserGroup" resultType="com.elink.esua.epdc.dto.result.PartyUserGroupResultDTO"> <select id="selectOneOfPartyUserGroup" resultType="com.elink.esua.epdc.dto.result.PartyUserGroupResultDTO">

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

@ -190,4 +190,16 @@ public class UserController {
public Result<List<UserDTO>> getUserList(@PathVariable("deptId") Long deptId) { public Result<List<UserDTO>> getUserList(@PathVariable("deptId") Long deptId) {
return userService.getUserList(deptId); return userService.getUserList(deptId);
} }
/**
* @Description 获取已认证未删除用户列表分页列表
* @Author songyunpeng
* @Date 2020/6/1
* @Param []
* @return com.elink.esua.epdc.commons.tools.utils.Result<java.util.List<com.elink.esua.epdc.dto.UserDTO>>
**/
@GetMapping("getUserListPage")
public Result<PageData<UserDTO>> getUserListPage(@RequestParam Map<String, Object> params) {
PageData<UserDTO> page = userService.getUserListPage(params);
return new Result<PageData<UserDTO>>().ok(page); }
} }

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

@ -18,7 +18,6 @@
package com.elink.esua.epdc.dao; package com.elink.esua.epdc.dao;
import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; import com.elink.esua.epdc.commons.mybatis.dao.BaseDao;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.dto.CachingUserInfoDTO; import com.elink.esua.epdc.dto.CachingUserInfoDTO;
import com.elink.esua.epdc.dto.UserDTO; import com.elink.esua.epdc.dto.UserDTO;
import com.elink.esua.epdc.dto.epdc.form.EpdcUnauthorizedAmountFromDTO; import com.elink.esua.epdc.dto.epdc.form.EpdcUnauthorizedAmountFromDTO;
@ -205,4 +204,12 @@ public interface UserDao extends BaseDao<UserEntity> {
* @return java.util.List<com.elink.esua.epdc.dto.UserDTO> * @return java.util.List<com.elink.esua.epdc.dto.UserDTO>
**/ **/
List<UserDTO> getUserList(Long deptId); List<UserDTO> getUserList(Long deptId);
/**
* @Description 获取指定部门下未删除已认证用户列表分页
* @Author songyunpeng
* @Date 2020/6/5
* @Param [params]
* @return java.util.List<com.elink.esua.epdc.dto.UserDTO>
**/
List<UserDTO> getUserListPage(Map<String, Object> params);
} }

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

@ -314,4 +314,12 @@ public interface UserService extends BaseService<UserEntity> {
* @return com.elink.esua.epdc.commons.tools.utils.Result<java.util.List<com.elink.esua.epdc.dto.UserDTO>> * @return com.elink.esua.epdc.commons.tools.utils.Result<java.util.List<com.elink.esua.epdc.dto.UserDTO>>
**/ **/
Result<List<UserDTO>> getUserList(Long deptId); Result<List<UserDTO>> getUserList(Long deptId);
/**
* @Description 获取已认证未删除用户列表分页
* @Author songyunpeng
* @Date 2020/6/5
* @Param [params]
* @return com.elink.esua.epdc.commons.tools.page.PageData<com.elink.esua.epdc.dto.UserDTO>
**/
PageData<UserDTO> getUserListPage(Map<String, Object> params);
} }

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

@ -1021,4 +1021,11 @@ public class UserServiceImpl extends BaseServiceImpl<UserDao, UserEntity> implem
return new Result<List<UserDTO>>().ok(list); return new Result<List<UserDTO>>().ok(list);
} }
@Override
public PageData<UserDTO> getUserListPage(Map<String, Object> params) {
IPage<UserDTO> page = getPage(params);
List<UserDTO> list = baseDao.getUserListPage(params);
return new PageData<>(list, page.getTotal());
}
} }

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

@ -504,5 +504,64 @@
select ID,NICKNAME,MOBILE,PARTY_FLAG,FACE_IMG from epdc_user select ID,NICKNAME,MOBILE,PARTY_FLAG,FACE_IMG from epdc_user
where DEL_FLAG = '0' and STATE != '0' and FIND_IN_SET( #{deptId}, ALL_DEPT_IDS ) where DEL_FLAG = '0' and STATE != '0' and FIND_IN_SET( #{deptId}, ALL_DEPT_IDS )
</select> </select>
<select id="getUserListPage" resultType="com.elink.esua.epdc.dto.UserDTO">
select ID,
NICKNAME,
MOBILE,
PASSWORD,
REGISTER_TIME,
FACE_IMG,
SEX,
BIRTHDAY,
EMAIL,
TELEPHONE,
ZIP_CODE,
PROFESSION,
HOBBIES,
USER_SIGN,
INVITATION_CODE,
LAST_LOGIN_TIME,
LAST_LOGIN_IP,
LAST_LONGITUDE,
LAST_LATITUDE,
REAL_NAME,
IDENTITY_NO,
ROAD,
VILLAGE_NAME,
DWELLING_PLACE,
ADDRESS,
WX_OPEN_ID,
WX_UNION_ID,
PARTY_FLAG,
REGISTER_WAY,
REGISTER_SOURCE,
MOBILE_PROVINCE,
MOBILE_CITY,
MOBILE_CARRIER,
POINTS,
POINTS_TOTLE,
INVITE_USER_ID,
STATE,
DEL_FLAG,
REVISION,
CREATED_BY,
CREATED_TIME,
UPDATED_BY,
UPDATED_TIME,
LAST_NAME,
FIRST_NAME,
REMARK,
DEPT_ID,
PARENT_DEPT_IDS,
PARENT_DEPT_NAMES,
ALL_DEPT_IDS,
ALL_DEPT_NAMES
from epdc_user
where DEL_FLAG = '0' and STATE != '0' and FIND_IN_SET( #{deptId}, ALL_DEPT_IDS )
<if test="mobile!=null and mobile != ''">
and MOBILE like concat('%',#{mobile},'%')
</if>
</select>
</mapper> </mapper>

Loading…
Cancel
Save