Browse Source

管理系统-治理人员

master
lichao 2 years ago
parent
commit
77a08338fc
  1. 30
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/CustomerGridManageUserListFormDTO.java
  2. 85
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/CustomerGridManageUserListDTO.java
  3. 13
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridManageUserController.java
  4. 2
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java
  5. 3
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerCommunityManageUserEntity.java
  6. 7
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerGridManageUserEntity.java
  7. 6
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridManageUserService.java
  8. 2
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerCommunityManageUserServiceImpl.java
  9. 38
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridManageUserServiceImpl.java
  10. 9
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml

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

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

85
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/CustomerGridManageUserListDTO.java

@ -0,0 +1,85 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 网格治理人员
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2023-11-27
*/
@Data
public class CustomerGridManageUserListDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* ID 唯一标识
*/
private String id;
/**
* 客户ID
*/
private String customerId;
/**
* 网格id
*/
private String gridId;
/**
* 姓名
*/
private String name;
/**
* 手机号
*/
private String mobile;
/**
* 人员属性
*/
private String property;
/**
* 1专职网格员2北上速办专职3专业网格管理员4兼职网格管理员
*/
private String type;
/**
* 删除标识:0.未删除 1.已删除
*/
private Integer delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 更新人
*/
private String updatedBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新时间
*/
private Date updatedTime;
}

13
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridManageUserController.java

@ -1,7 +1,9 @@
package com.epmet.controller; package com.epmet.controller;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.aop.NoRepeatSubmit; import com.epmet.commons.tools.aop.NoRepeatSubmit;
import com.epmet.commons.tools.page.PageData; 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.ExcelUtils;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.AssertUtils; import com.epmet.commons.tools.validator.AssertUtils;
@ -11,6 +13,8 @@ import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.commons.tools.validator.group.DefaultGroup; import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.dto.CustomerCommunityManageUserDTO; import com.epmet.dto.CustomerCommunityManageUserDTO;
import com.epmet.dto.CustomerGridManageUserDTO; import com.epmet.dto.CustomerGridManageUserDTO;
import com.epmet.dto.form.CustomerGridManageUserListFormDTO;
import com.epmet.dto.result.CustomerGridManageUserListDTO;
import com.epmet.dto.result.CustomerGridStatisticsReulstDTO; import com.epmet.dto.result.CustomerGridStatisticsReulstDTO;
import com.epmet.excel.CustomerGridManageUserExcel; import com.epmet.excel.CustomerGridManageUserExcel;
import com.epmet.service.CustomerGridManageUserService; import com.epmet.service.CustomerGridManageUserService;
@ -35,10 +39,11 @@ public class CustomerGridManageUserController {
@Autowired @Autowired
private CustomerGridManageUserService customerGridManageUserService; private CustomerGridManageUserService customerGridManageUserService;
@RequestMapping("page") @PostMapping("page")
public Result<PageData<CustomerGridManageUserDTO>> page(@RequestParam Map<String, Object> params){ public Result<PageData<CustomerGridManageUserListDTO>> page(@LoginUser TokenDto tokenDto,@RequestBody CustomerGridManageUserListFormDTO dto){
PageData<CustomerGridManageUserDTO> page = customerGridManageUserService.page(params); dto.setStaffId(tokenDto.getUserId());
return new Result<PageData<CustomerGridManageUserDTO>>().ok(page); PageData<CustomerGridManageUserListDTO> page = customerGridManageUserService.page(dto);
return new Result<PageData<CustomerGridManageUserListDTO>>().ok(page);
} }
@RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET}) @RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET})

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

@ -385,6 +385,8 @@ public interface CustomerGridDao extends BaseDao<CustomerGridEntity> {
List<String> getDelGridIdList(@Param("agencyId") String agencyId); List<String> getDelGridIdList(@Param("agencyId") String agencyId);
List<String> getGridIdList(@Param("agencyId") String agencyId);
/** /**
* @describe: 通过网格id获取社区行政编码 * @describe: 通过网格id获取社区行政编码
* @author wangtong * @author wangtong

3
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerCommunityManageUserEntity.java

@ -1,5 +1,7 @@
package com.epmet.entity; package com.epmet.entity;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
@ -24,6 +26,7 @@ public class CustomerCommunityManageUserEntity extends BaseEpmetEntity {
/** /**
* 客户ID * 客户ID
*/ */
@TableField(fill = FieldFill.INSERT)
private String customerId; private String customerId;
/** /**

7
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerGridManageUserEntity.java

@ -1,5 +1,7 @@
package com.epmet.entity; package com.epmet.entity;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
@ -23,7 +25,10 @@ public class CustomerGridManageUserEntity extends BaseEpmetEntity {
/** /**
* 客户ID * 客户ID
*/ */ /**
* 客户ID
*/
@TableField(fill = FieldFill.INSERT)
private String customerId; private String customerId;
/** /**

6
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridManageUserService.java

@ -3,6 +3,8 @@ package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.CustomerGridManageUserDTO; import com.epmet.dto.CustomerGridManageUserDTO;
import com.epmet.dto.form.CustomerGridManageUserListFormDTO;
import com.epmet.dto.result.CustomerGridManageUserListDTO;
import com.epmet.dto.result.CustomerGridStatisticsReulstDTO; import com.epmet.dto.result.CustomerGridStatisticsReulstDTO;
import com.epmet.entity.CustomerGridManageUserEntity; import com.epmet.entity.CustomerGridManageUserEntity;
@ -20,12 +22,12 @@ public interface CustomerGridManageUserService extends BaseService<CustomerGridM
/** /**
* 默认分页 * 默认分页
* *
* @param params * @param dto
* @return PageData<CustomerGridManageUserDTO> * @return PageData<CustomerGridManageUserDTO>
* @author generator * @author generator
* @date 2023-11-27 * @date 2023-11-27
*/ */
PageData<CustomerGridManageUserDTO> page(Map<String, Object> params); PageData<CustomerGridManageUserListDTO> page(CustomerGridManageUserListFormDTO dto);
/** /**
* 默认查询 * 默认查询

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

@ -68,7 +68,7 @@ public class CustomerCommunityManageUserServiceImpl extends BaseServiceImpl<Cust
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void save(CustomerCommunityManageUserDTO dto) { public void save(CustomerCommunityManageUserDTO dto) {
CustomerCommunityManageUserEntity entity = ConvertUtils.sourceToTarget(dto, CustomerCommunityManageUserEntity.class); CustomerCommunityManageUserEntity entity = ConvertUtils.sourceToTarget(dto, CustomerCommunityManageUserEntity.class);
insert(entity); saveOrUpdate(entity);
} }
@Override @Override

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

@ -4,19 +4,28 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; 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.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.dao.CustomerGridDao; import com.epmet.dao.CustomerGridDao;
import com.epmet.dao.CustomerGridManageUserDao; import com.epmet.dao.CustomerGridManageUserDao;
import com.epmet.dao.CustomerStaffAgencyDao;
import com.epmet.dao.CustomerStaffGridDao;
import com.epmet.dto.CustomerCommunityManageUserDTO; import com.epmet.dto.CustomerCommunityManageUserDTO;
import com.epmet.dto.CustomerGridManageUserDTO; import com.epmet.dto.CustomerGridManageUserDTO;
import com.epmet.dto.CustomerStaffAgencyDTO;
import com.epmet.dto.form.CustomerGridManageUserListFormDTO;
import com.epmet.dto.result.CustomerGridManageUserListDTO;
import com.epmet.dto.result.CustomerGridStatisticsReulstDTO; import com.epmet.dto.result.CustomerGridStatisticsReulstDTO;
import com.epmet.dto.result.GridByStaffResultDTO;
import com.epmet.entity.CustomerCommunityManageUserEntity; import com.epmet.entity.CustomerCommunityManageUserEntity;
import com.epmet.entity.CustomerGridEntity; import com.epmet.entity.CustomerGridEntity;
import com.epmet.entity.CustomerGridManageUserEntity; import com.epmet.entity.CustomerGridManageUserEntity;
import com.epmet.redis.CustomerGridManageUserRedis; import com.epmet.redis.CustomerGridManageUserRedis;
import com.epmet.service.CustomerGridManageUserService; import com.epmet.service.CustomerGridManageUserService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -38,17 +47,30 @@ public class CustomerGridManageUserServiceImpl extends BaseServiceImpl<CustomerG
@Autowired @Autowired
private CustomerGridManageUserRedis customerGridManageUserRedis; private CustomerGridManageUserRedis customerGridManageUserRedis;
@Autowired @Autowired
private CustomerGridDao customerGridDao; private CustomerGridDao customerGridDao;
@Autowired
private CustomerStaffAgencyDao customerStaffAgencyDao;
@Override @Override
public PageData<CustomerGridManageUserDTO> page(Map<String, Object> params) { public PageData<CustomerGridManageUserListDTO> page(CustomerGridManageUserListFormDTO dto) {
IPage<CustomerGridManageUserEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false), CustomerStaffAgencyDTO customerStaffAgencyDTO = customerStaffAgencyDao.selectLatestCustomerByStaff(dto.getStaffId());
getWrapper(params) if (customerStaffAgencyDTO == null ){
); throw new EpmetException("未查询到工作人员信息"+dto.getStaffId());
return getPageData(page, CustomerGridManageUserDTO.class); }
List<String> gridIds = customerGridDao.getGridIdList(customerStaffAgencyDTO.getAgencyId());
if (gridIds.size() > 0) {
LambdaQueryWrapper<CustomerGridManageUserEntity> lambdaQueryWrapper = new LambdaQueryWrapper<CustomerGridManageUserEntity>()
.in(CustomerGridManageUserEntity::getGridId, gridIds);
PageHelper.startPage(dto.getPageNo(),dto.getPageSize());
List<CustomerGridManageUserEntity> list = baseDao.selectList(lambdaQueryWrapper);
PageInfo<CustomerGridManageUserEntity> customerGridManageUserEntityPageInfo = new PageInfo<>(list);
List<CustomerGridManageUserListDTO> result = ConvertUtils.sourceToTarget(list,CustomerGridManageUserListDTO.class);
return new PageData<>(result,customerGridManageUserEntityPageInfo.getTotal());
}
return new PageData<>();
} }
@Override @Override
@ -77,7 +99,7 @@ public class CustomerGridManageUserServiceImpl extends BaseServiceImpl<CustomerG
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void save(CustomerGridManageUserDTO dto) { public void save(CustomerGridManageUserDTO dto) {
CustomerGridManageUserEntity entity = ConvertUtils.sourceToTarget(dto, CustomerGridManageUserEntity.class); CustomerGridManageUserEntity entity = ConvertUtils.sourceToTarget(dto, CustomerGridManageUserEntity.class);
insert(entity); saveOrUpdate(entity);
} }
@Override @Override

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

@ -873,6 +873,15 @@
AND pids LIKE CONCAT('%', #{agencyId}, '%') AND pids LIKE CONCAT('%', #{agencyId}, '%')
</select> </select>
<select id="getGridIdList" resultType="java.lang.String">
SELECT
id
FROM
customer_grid
WHERE
pids LIKE CONCAT('%', #{agencyId}, '%')
</select>
<update id="updateTotalUser"> <update id="updateTotalUser">
UPDATE customer_grid SET total_user = total_user+#{incrCount} UPDATE customer_grid SET total_user = total_user+#{incrCount}
where id = #{gridId} and del_flag = '0' where id = #{gridId} and del_flag = '0'

Loading…
Cancel
Save