Browse Source

管理提交

master
lichao 2 years ago
parent
commit
109c1ccbfc
  1. 36
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/CustomerCommunityManageUserListFormDTO.java
  2. 7
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/CustomerGridManageUserListFormDTO.java
  3. 9
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerCommunityManageUserController.java
  4. 5
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerCommunityManageUserService.java
  5. 60
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerCommunityManageUserServiceImpl.java
  6. 11
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridManageUserServiceImpl.java

36
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/CustomerCommunityManageUserListFormDTO.java

@ -0,0 +1,36 @@
package com.epmet.dto.form;
import lombok.Data;
import java.io.Serializable;
/**
* 社区治理人员
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2023-11-27
*/
@Data
public class CustomerCommunityManageUserListFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
private Integer pageNo;
private Integer pageSize;
private String agencyId;
private String level;
private String staffId;
private String communityId;
private Integer type;
private String name;
}

7
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/CustomerGridManageUserListFormDTO.java

@ -27,4 +27,11 @@ public class CustomerGridManageUserListFormDTO implements Serializable {
private String staffId;
private String gridId;
private Integer type;
private String name;
}

9
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerCommunityManageUserController.java

@ -1,7 +1,9 @@
package com.epmet.controller;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.aop.NoRepeatSubmit;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ExcelUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.AssertUtils;
@ -10,6 +12,8 @@ import com.epmet.commons.tools.validator.group.AddGroup;
import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.dto.CustomerCommunityManageUserDTO;
import com.epmet.dto.form.CustomerCommunityManageUserListFormDTO;
import com.epmet.dto.form.CustomerGridManageUserListFormDTO;
import com.epmet.excel.CustomerCommunityManageUserExcel;
import com.epmet.service.CustomerCommunityManageUserService;
import org.springframework.beans.factory.annotation.Autowired;
@ -34,8 +38,9 @@ public class CustomerCommunityManageUserController {
private CustomerCommunityManageUserService customerCommunityManageUserService;
@RequestMapping("page")
public Result<PageData<CustomerCommunityManageUserDTO>> page(@RequestParam Map<String, Object> params){
PageData<CustomerCommunityManageUserDTO> page = customerCommunityManageUserService.page(params);
public Result<PageData<CustomerCommunityManageUserDTO>> page(@LoginUser TokenDto tokenDto, @RequestBody CustomerCommunityManageUserListFormDTO dto){
dto.setStaffId(tokenDto.getUserId());
PageData<CustomerCommunityManageUserDTO> page = customerCommunityManageUserService.page(dto);
return new Result<PageData<CustomerCommunityManageUserDTO>>().ok(page);
}

5
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerCommunityManageUserService.java

@ -3,6 +3,7 @@ package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.CustomerCommunityManageUserDTO;
import com.epmet.dto.form.CustomerCommunityManageUserListFormDTO;
import com.epmet.entity.CustomerCommunityManageUserEntity;
import java.util.List;
@ -19,12 +20,12 @@ public interface CustomerCommunityManageUserService extends BaseService<Customer
/**
* 默认分页
*
* @param params
* @param dto
* @return PageData<CustomerCommunityManageUserDTO>
* @author generator
* @date 2023-11-27
*/
PageData<CustomerCommunityManageUserDTO> page(Map<String, Object> params);
PageData<CustomerCommunityManageUserDTO> page(CustomerCommunityManageUserListFormDTO dto);
/**
* 默认查询

60
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerCommunityManageUserServiceImpl.java

@ -4,14 +4,24 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.dao.CustomerAgencyDao;
import com.epmet.dao.CustomerCommunityManageUserDao;
import com.epmet.dao.CustomerStaffAgencyDao;
import com.epmet.dto.CustomerCommunityManageUserDTO;
import com.epmet.dto.CustomerStaffAgencyDTO;
import com.epmet.dto.form.CustomerCommunityManageUserListFormDTO;
import com.epmet.dto.result.CustomerGridManageUserListDTO;
import com.epmet.entity.CustomerAgencyEntity;
import com.epmet.entity.CustomerCommunityManageUserEntity;
import com.epmet.entity.CustomerGridManageUserEntity;
import com.epmet.redis.CustomerCommunityManageUserRedis;
import com.epmet.service.CustomerCommunityManageUserService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -20,6 +30,7 @@ import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* 社区治理人员
@ -32,14 +43,51 @@ public class CustomerCommunityManageUserServiceImpl extends BaseServiceImpl<Cust
@Autowired
private CustomerCommunityManageUserRedis customerCommunityManageUserRedis;
@Autowired
private CustomerStaffAgencyDao customerStaffAgencyDao;
@Autowired
private CustomerAgencyDao customerAgencyDao;
@Override
public PageData<CustomerCommunityManageUserDTO> page(Map<String, Object> params) {
IPage<CustomerCommunityManageUserEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, CustomerCommunityManageUserDTO.class);
public PageData<CustomerCommunityManageUserDTO> page(CustomerCommunityManageUserListFormDTO dto) {
CustomerStaffAgencyDTO customerStaffAgencyDTO = customerStaffAgencyDao.selectLatestCustomerByStaff(dto.getStaffId());
if (customerStaffAgencyDTO == null ){
throw new EpmetException("未查询到工作人员信息"+dto.getStaffId());
}
CustomerAgencyEntity customerAgencyEntity = customerAgencyDao.selectById(customerStaffAgencyDTO.getAgencyId());
LambdaQueryWrapper<CustomerCommunityManageUserEntity> resultLQ = new LambdaQueryWrapper<>();
if (customerAgencyEntity.getLevel().equals("community")){
resultLQ.eq(CustomerCommunityManageUserEntity::getCommunityId,customerAgencyEntity.getId());
}else{
LambdaQueryWrapper<CustomerAgencyEntity> agencyLq = new LambdaQueryWrapper<CustomerAgencyEntity>()
.like(CustomerAgencyEntity::getPids,customerAgencyEntity.getId()).eq(CustomerAgencyEntity::getLevel,"community");
List<String> agencyListIds = customerAgencyDao.selectList(agencyLq).stream().map(CustomerAgencyEntity::getId).collect(Collectors.toList());
resultLQ.in(CustomerCommunityManageUserEntity::getCommunityId,agencyListIds);
}
if (dto.getCommunityId()!=null){
resultLQ.eq(CustomerCommunityManageUserEntity::getCommunityId,dto.getCommunityId());
}
if (dto.getName()!=null){
resultLQ.like(CustomerCommunityManageUserEntity::getName,dto.getName());
}
if (dto.getType()!=null){
resultLQ.eq(CustomerCommunityManageUserEntity::getType,dto.getType());
}
PageHelper.startPage(dto.getPageNo(),dto.getPageSize());
List<CustomerCommunityManageUserEntity> list = baseDao.selectList(resultLQ);
PageInfo<CustomerCommunityManageUserEntity> resultPage = new PageInfo<>(list);
List<CustomerCommunityManageUserDTO> result = ConvertUtils.sourceToTarget(list,CustomerCommunityManageUserDTO.class);
return new PageData<>(result,resultPage.getTotal());
}
@Override

11
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridManageUserServiceImpl.java

@ -63,6 +63,17 @@ public class CustomerGridManageUserServiceImpl extends BaseServiceImpl<CustomerG
if (gridIds.size() > 0) {
LambdaQueryWrapper<CustomerGridManageUserEntity> lambdaQueryWrapper = new LambdaQueryWrapper<CustomerGridManageUserEntity>()
.in(CustomerGridManageUserEntity::getGridId, gridIds);
if (dto.getGridId()!=null){
lambdaQueryWrapper.eq(CustomerGridManageUserEntity::getGridId,dto.getGridId());
}
if (dto.getName()!=null){
lambdaQueryWrapper.like(CustomerGridManageUserEntity::getName,dto.getName());
}
if (dto.getType()!=null){
lambdaQueryWrapper.eq(CustomerGridManageUserEntity::getType,dto.getType());
}
PageHelper.startPage(dto.getPageNo(),dto.getPageSize());
List<CustomerGridManageUserEntity> list = baseDao.selectList(lambdaQueryWrapper);
PageInfo<CustomerGridManageUserEntity> customerGridManageUserEntityPageInfo = new PageInfo<>(list);

Loading…
Cancel
Save