Browse Source

Merge branch 'lingshan_master' into dev

# Conflicts:
#	epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/DictTypeEnum.java
#	epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcHouseDTO.java
#	epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcHouseEntity.java
master
wxz 3 years ago
parent
commit
483b09460b
  1. 1
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/DictTypeEnum.java
  2. 21
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/LingShanScreenAgentRstDTO.java
  3. 4
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/LingshanServiceAgentAgentList.java
  4. 49
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/feign/DataAggregatorOpenFeignClient.java
  5. 16
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/feign/impl/DataAggregatorOpenFeignClientFallback.java
  6. 32
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/LingShanServiceAgentController.java
  7. 10
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/CustomerStaffDao.java
  8. 6
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/LingShanServiceAgentService.java
  9. 2
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/EpmetUserService.java
  10. 20
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java
  11. 3
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java
  12. 18
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java
  13. 137
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/LingShanServiceAgentServiceImpl.java
  14. 19
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/CustomerStaffDao.xml
  15. 1
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerStaffGridDao.xml
  16. 199
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/LingshanOfficeHallServiceRecordDTO.java
  17. 48
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/lingshan/LingshanOfficeHallServiceRecordPageFormDTO.java
  18. 21
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/agentservice/LingShanScreenAgentRstDTO.java
  19. 20
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/agentservice/LingShanScreenServiceRstDTO.java
  20. 22
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/agentservice/ScreenCatalogueQtyStatsRstDTO.java
  21. 56
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/LingShanAgentServiceController.java
  22. 175
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/LingshanOfficeHallServiceRecordController.java
  23. 15
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/LingshanAgentServiceRecordDao.java
  24. 28
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/LingshanOfficeHallServiceRecordDao.java
  25. 118
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/LingshanOfficeHallServiceRecordEntity.java
  26. 92
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/LingshanOfficeHallServiceRecordExportExcel.java
  27. 11
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/LingShanAgentServiceService.java
  28. 70
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/LingshanOfficeHallServiceRecordService.java
  29. 178
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LingShanAgentServiceServiceImpl.java
  30. 169
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LingshanOfficeHallServiceRecordServiceImpl.java
  31. 22
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LingshanAgentServiceRecordDao.xml
  32. 42
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LingshanOfficeHallServiceRecordDao.xml
  33. 3
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcHouseDTO.java
  34. 3
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcHouseAddFormDTO.java
  35. 3
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcHouseEntity.java
  36. 2
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java

1
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/DictTypeEnum.java

@ -38,6 +38,7 @@ public enum DictTypeEnum {
YT_POPULATION_TYPE("yt_population_type","人口类型",41),
YT_POLITICS_STATUS("yt_politics_status","政治面貌",42),
YT_ID_CARD_TYPE("yt_id_card_type","证件类型",43),
LINGSHAN_OFFICE_HALL_SERVICE_RECORD("lingshan_office_hall_service_record","灵山-办事大厅业务类型",44),
;
private final String code;

21
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/LingShanScreenAgentRstDTO.java

@ -0,0 +1,21 @@
package com.epmet.dataaggre.dto.epmetuser.result;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @Description 灵山代办员信息
* @Author wangxianzhang
* @Time 2023/5/15 2:57 PM
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class LingShanScreenAgentRstDTO {
private String agentName;
private String longitude;
private String latitude;
private String mobile;
}

4
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/LingshanServiceAgentAgentList.java

@ -22,4 +22,8 @@ public class LingshanServiceAgentAgentList {
private String mobile;
private String idCard;
private String longitude;
private String latitude;
}

49
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/feign/DataAggregatorOpenFeignClient.java

@ -5,13 +5,16 @@ import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dataaggre.dto.epmetuser.form.ResisByPolicyRulesFormDTO;
import com.epmet.dataaggre.dto.epmetuser.result.LingshanServiceAgentAgentList;
import com.epmet.dataaggre.dto.epmetuser.result.ResiByPolicyInfoResultDTO;
import com.epmet.dataaggre.dto.govorg.form.GridLivelyFormDTO;
import com.epmet.dataaggre.dto.govorg.result.GridLivelyResultDTO;
import com.epmet.dataaggre.feign.impl.DataAggregatorOpenFeignClientFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
@ -40,4 +43,50 @@ public interface DataAggregatorOpenFeignClient {
*/
@PostMapping(value = "data/aggregator/org/gridlively")
Result<List<GridLivelyResultDTO>> grdiLively(@RequestBody GridLivelyFormDTO form);
/**
* @description: 工作端pc代办员列表
* @param pageNo:
* @param pageSize:
* @param orgId:
* @param orgType:
* @param agentName:
* @param mobile:
* @param idCard:
* @return
* @author: WangXianZhang
* @date: 2023/5/9 4:30 PM
*/
@GetMapping("data/aggregator/lingshan/serviceAgent/workpc/agentList")
Result<PageData<LingshanServiceAgentAgentList>> workPcAgentList(@RequestParam("pageNo") Integer pageNo,
@RequestParam("pageSize") Integer pageSize,
@RequestParam(value = "orgId", required = false) String orgId,
@RequestParam(value = "orgType", required = false) String orgType,
@RequestParam(value = "agentName",required = false) String agentName,
@RequestParam(value = "mobile", required = false) Integer mobile,
@RequestParam(value = "idCard", required = false) Integer idCard);
/**
* @Description: 大屏-代办员数量
* @param orgId:
* @param orgType:
* @Return com.epmet.commons.tools.utils.Result<java.lang.Integer>
* @Author: wangxianzhang
* @Date: 2023/5/15 10:29 AM
*/
@GetMapping("data/aggregator/lingshan/serviceAgent/screen/agentQty")
Result<Integer> lingshanScreenAgentQty(@RequestParam(value = "orgId", required = false) String orgId,
@RequestParam(value = "orgType", required = false) String orgType);
/**
* @Description: 大屏代办员列表
* @param orgId:
* @param orgType:
* @Return com.epmet.commons.tools.utils.Result<com.epmet.commons.tools.page.PageData<com.epmet.dataaggre.dto.epmetuser.result.LingshanServiceAgentAgentList>>
* @Author: wangxianzhang
* @Date: 2023/5/15 4:57 PM
*/
@GetMapping("data/aggregator/lingshan/serviceAgent/screen/agentList")
Result<List<LingshanServiceAgentAgentList>> screenAgentList(@RequestParam(value = "orgId", required = false) String orgId,
@RequestParam(value = "orgType", required = false) String orgType);
}

16
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/feign/impl/DataAggregatorOpenFeignClientFallback.java

@ -5,6 +5,7 @@ import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ModuleUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dataaggre.dto.epmetuser.form.ResisByPolicyRulesFormDTO;
import com.epmet.dataaggre.dto.epmetuser.result.LingshanServiceAgentAgentList;
import com.epmet.dataaggre.dto.epmetuser.result.ResiByPolicyInfoResultDTO;
import com.epmet.dataaggre.dto.govorg.form.GridLivelyFormDTO;
import com.epmet.dataaggre.dto.govorg.result.GridLivelyResultDTO;
@ -32,4 +33,19 @@ public class DataAggregatorOpenFeignClientFallback implements DataAggregatorOpen
public Result<List<GridLivelyResultDTO>> grdiLively(GridLivelyFormDTO form) {
return ModuleUtils.feignConError(ServiceConstant.DATA_AGGREGATOR_SERVER, "grdiLively",form);
}
@Override
public Result<Integer> lingshanScreenAgentQty(String orgId, String orgType) {
return ModuleUtils.feignConError(ServiceConstant.DATA_AGGREGATOR_SERVER, "lingshanScreenAgentQty",orgId, orgType);
}
@Override
public Result<PageData<LingshanServiceAgentAgentList>> workPcAgentList(Integer pageNo, Integer pageSize, String orgId, String orgType, String agentName, Integer mobile, Integer idCard) {
return ModuleUtils.feignConError(ServiceConstant.DATA_AGGREGATOR_SERVER, "workPcAgentList",pageNo, pageSize, orgId, orgType, agentName, mobile, idCard);
}
@Override
public Result<List<LingshanServiceAgentAgentList>> screenAgentList(String orgId, String orgType) {
return ModuleUtils.feignConError(ServiceConstant.DATA_AGGREGATOR_SERVER, "screenAgentList", orgId, orgType);
}
}

32
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/LingShanServiceAgentController.java

@ -10,6 +10,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@RestController
@RequestMapping("lingshan/serviceAgent")
public class LingShanServiceAgentController {
@ -43,4 +45,34 @@ public class LingShanServiceAgentController {
return new Result<PageData<LingshanServiceAgentAgentList>>().ok(pd);
}
/**
* @Description: 大屏-代办员数量
* @param orgId:
* @param orgType:
* @Return com.epmet.commons.tools.utils.Result<java.lang.Integer>
* @Author: wangxianzhang
* @Date: 2023/5/15 10:29 AM
*/
@GetMapping("screen/agentQty")
public Result<Integer> lingshanScreenAgentQty(@RequestParam(value = "orgId", required = false) String orgId,
@RequestParam(value = "orgType", required = false) String orgType) {
return new Result<Integer>().ok(lingShanServiceAgentService.lingshanScreenAgentQty(orgId, orgType));
}
/**
* @Description: 大屏代办员列表
* @param orgId:
* @param orgType:
* @Return com.epmet.commons.tools.utils.Result<com.epmet.commons.tools.page.PageData<com.epmet.dataaggre.dto.epmetuser.result.LingshanServiceAgentAgentList>>
* @Author: wangxianzhang
* @Date: 2023/5/15 4:57 PM
*/
@GetMapping("screen/agentList")
public Result<List<LingshanServiceAgentAgentList>> screenAgentList(@RequestParam(value = "orgId", required = false) String orgId,
@RequestParam(value = "orgType", required = false) String orgType) {
List<LingshanServiceAgentAgentList> rl = lingShanServiceAgentService.screenAgentList(orgId, orgType);
return new Result<List<LingshanServiceAgentAgentList>>().ok(rl);
}
}

10
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/CustomerStaffDao.java

@ -101,4 +101,14 @@ public interface CustomerStaffDao extends BaseDao<CustomerStaffEntity> {
@Param("mobile") Integer mobile,
@Param("realname") String realname,
@Param("idCard") Integer idCard);
/**
* @Description: 查询网格下具有某角色的工作人员数量
* @param staffIds:
* @param roleId:
* @Return java.lang.Integer
* @Author: wangxianzhang
* @Date: 2023/5/15 11:21 AM
*/
Integer countStaffQtyByStaffIdsAndRole(@Param("staffIds") Set<String> staffIds, @Param("roleId") String roleId);
}

6
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/LingShanServiceAgentService.java

@ -3,6 +3,12 @@ package com.epmet.dataaggre.service;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dataaggre.dto.epmetuser.result.LingshanServiceAgentAgentList;
import java.util.List;
public interface LingShanServiceAgentService {
PageData<LingshanServiceAgentAgentList> workPcAgentList(String orgId, String orgType, String agentName, Integer mobile, Integer idCard, Integer pageNo, Integer pageSize);
Integer lingshanScreenAgentQty(String orgId, String orgType);
List<LingshanServiceAgentAgentList> screenAgentList(String orgId, String orgType);
}

2
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/EpmetUserService.java

@ -267,4 +267,6 @@ public interface EpmetUserService {
PageData<StaffInfoInGridOfRole> staffListInGridsOfRole(String roleKey, Set<String> staffIds, String agentName, Integer mobile, Integer idCard,
Integer pageNo, Integer pageSize);
Integer staffQtyInGridsOfRole(String roleKeyAgent, Set<String> staffIds);
}

20
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java

@ -1163,8 +1163,13 @@ public class EpmetUserServiceImpl implements EpmetUserService, ResultDataResolve
public PageData<StaffInfoInGridOfRole> staffListInGridsOfRole(String roleKey, Set<String> staffIds, String agentName, Integer mobile,
Integer idCard, Integer pageNo, Integer pageSize) {
String customerId;
if (StringUtils.isBlank(customerId = EpmetRequestHolder.getLoginUserCustomerId())) {
throw new EpmetException(EpmetErrorCode.ERR10005.getCode());
}
LambdaQueryWrapper<GovStaffRoleEntity> rq = new LambdaQueryWrapper<>();
rq.eq(GovStaffRoleEntity::getCustomerId, EpmetRequestHolder.getLoginUserCustomerId());
rq.eq(GovStaffRoleEntity::getCustomerId, customerId);
rq.eq(GovStaffRoleEntity::getRoleKey, roleKey);
GovStaffRoleEntity role = govStaffRoleDao.selectOne(rq);
if (role == null) {
@ -1177,4 +1182,17 @@ public class EpmetUserServiceImpl implements EpmetUserService, ResultDataResolve
return new PageData<>(ss, new PageInfo<>(ss).getTotal());
}
@Override
public Integer staffQtyInGridsOfRole(String roleKey, Set<String> staffIds) {
LambdaQueryWrapper<GovStaffRoleEntity> rq = new LambdaQueryWrapper<>();
rq.eq(GovStaffRoleEntity::getCustomerId, EpmetRequestHolder.getLoginUserCustomerId());
rq.eq(GovStaffRoleEntity::getRoleKey, roleKey);
GovStaffRoleEntity role = govStaffRoleDao.selectOne(rq);
if (role == null) {
return 0;
}
return customerStaffDao.countStaffQtyByStaffIdsAndRole(staffIds, role.getId());
}
}

3
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java

@ -14,6 +14,7 @@ import com.epmet.dataaggre.dto.govorg.form.*;
import com.epmet.dataaggre.dto.govorg.result.*;
import com.epmet.dataaggre.dto.resigroup.result.OrgInfoCommonDTO;
import com.epmet.dataaggre.entity.govorg.CustomerAgencyEntity;
import com.epmet.dataaggre.entity.govorg.CustomerGridEntity;
import com.epmet.dto.IcNeighborHoodDTO;
import javax.servlet.http.HttpServletResponse;
@ -306,4 +307,6 @@ public interface GovOrgService {
List<LingShanAgentServiceStaffAndGrid> getStaffAndItsBelongsGridByAgencyIdPath(String agencyIdPath);
Set<String> getStaffIdsInGrid(String gridId);
List<CustomerGridEntity> listBelongGridsByStaffId(String staffId);
}

18
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java

@ -1554,4 +1554,22 @@ public class GovOrgServiceImpl implements GovOrgService {
List<CustomerStaffGridEntity> es = customerStaffGridDao.selectList(q);
return es.stream().map(CustomerStaffGridEntity::getUserId).collect(Collectors.toSet());
}
/**
* @Description: 一个人多个网格根据工作人员id查询所属网格id
* @param staffId:
* @Return java.util.List<com.epmet.dataaggre.entity.govorg.CustomerStaffGridEntity>
* @Author: wangxianzhang
* @Date: 2023/5/15 4:39 PM
*/
@Override
public List<CustomerGridEntity> listBelongGridsByStaffId(String staffId) {
LambdaQueryWrapper<CustomerStaffGridEntity> q = new LambdaQueryWrapper<>();
q.eq(CustomerStaffGridEntity::getUserId, staffId);
List<CustomerStaffGridEntity> staffAndGrids = customerStaffGridDao.selectList(q);
LambdaQueryWrapper<CustomerGridEntity> q2 = new LambdaQueryWrapper<>();
q2.in(CustomerGridEntity::getId, staffAndGrids.stream().map(CustomerStaffGridEntity::getGridId).collect(Collectors.toList()));
return customerGridDao.selectList(q2);
}
}

137
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/LingShanServiceAgentServiceImpl.java

@ -1,5 +1,6 @@
package com.epmet.dataaggre.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.enums.DictTypeEnum;
import com.epmet.commons.tools.enums.GenderEnum;
@ -14,7 +15,11 @@ import com.epmet.constant.OrgInfoConstant;
import com.epmet.constant.RoleKeyConstants;
import com.epmet.dataaggre.beans.LingShanAgentServiceStaffAndGrid;
import com.epmet.dataaggre.beans.StaffInfoInGridOfRole;
import com.epmet.dataaggre.dao.govorg.CustomerGridDao;
import com.epmet.dataaggre.dao.govorg.CustomerStaffGridDao;
import com.epmet.dataaggre.dto.epmetuser.result.LingshanServiceAgentAgentList;
import com.epmet.dataaggre.entity.govorg.CustomerGridEntity;
import com.epmet.dataaggre.entity.govorg.CustomerStaffGridEntity;
import com.epmet.dataaggre.service.LingShanServiceAgentService;
import com.epmet.dataaggre.service.epmetuser.EpmetUserService;
import com.epmet.dataaggre.service.govorg.GovOrgService;
@ -24,12 +29,13 @@ import com.epmet.feign.EpmetAdminOpenFeignClient;
import com.epmet.remote.EpmetUserRemoteService;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.sql.Array;
import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.Stream;
@Service
public class LingShanServiceAgentServiceImpl implements LingShanServiceAgentService, ResultDataResolver {
@ -46,22 +52,17 @@ public class LingShanServiceAgentServiceImpl implements LingShanServiceAgentServ
@Autowired
private EpmetUserRemoteService epmetUserRemoteService;
@Override
public PageData<LingshanServiceAgentAgentList> workPcAgentList(String orgId, String orgType, String agentName, Integer mobile, Integer idCard,
Integer pageNo, Integer pageSize) {
// 1个人可能属于多个wangge
Map<String, List<String>> staffIdAndGridIds = new HashMap<>();
Set<String> staffIds = new HashSet<>();
if (StringUtils.isAnyBlank(orgId, orgType)) {
// 如果前端没选择,那就取当前工作人员所属组织
LoginUserDetailsResultDTO loginUserDetails = epmetUserRemoteService.getLoginUserDetails();
orgId = loginUserDetails.getAgencyId();
orgType = OrgInfoConstant.AGENCY;
}
// 得到staffIds和staffIdAndGridIds
/**
* @Description: 填充
* @param orgId:
* @param orgType:
* @param staffIdAndGridIds:
* @param staffIds:
* @Return void
* @Author: wangxianzhang
* @Date: 2023/5/15 10:33 AM
*/
private void fillDatas4AgentQuery(String orgId, String orgType, Map<String, List<String>> staffIdAndGridIds, Set<String> staffIds) {
if (OrgInfoConstant.AGENCY.equals(orgType)) {
// agency
AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(orgId);
@ -84,6 +85,27 @@ public class LingShanServiceAgentServiceImpl implements LingShanServiceAgentServ
staffIdAndGridIds.put(staffId, Arrays.asList(orgId));
}
}
}
@Override
public PageData<LingshanServiceAgentAgentList> workPcAgentList(String orgId, String orgType, String agentName, Integer mobile, Integer idCard,
Integer pageNo, Integer pageSize) {
// 1个人可能属于多个网格,这里用来给页面显示多个网格,逗号分割
Map<String, List<String>> staffIdAndGridIds = new HashMap<>();
// 用来进一步查询工作人员
Set<String> staffIds = new HashSet<>();
if (StringUtils.isAnyBlank(orgId, orgType)) {
// 如果前端没选择,那就取当前工作人员所属组织
LoginUserDetailsResultDTO loginUserDetails = epmetUserRemoteService.getLoginUserDetails();
orgId = loginUserDetails.getAgencyId();
orgType = OrgInfoConstant.AGENCY;
}
// 得到staffIds和staffIdAndGridIds
fillDatas4AgentQuery(orgId, orgType, staffIdAndGridIds, staffIds);
// 开始查询staff列表
PageData<StaffInfoInGridOfRole> pd = epmetUserService.staffListInGridsOfRole(RoleKeyConstants.ROLE_KEY_AGENT, staffIds, agentName, mobile, idCard, pageNo, pageSize);
@ -137,5 +159,86 @@ public class LingShanServiceAgentServiceImpl implements LingShanServiceAgentServ
return String.join(",", orgNames);
}
@Override
public Integer lingshanScreenAgentQty(String orgId, String orgType) {
// 1个人可能属于多个wangge
Map<String, List<String>> staffIdAndGridIds = new HashMap<>();
Set<String> staffIds = new HashSet<>();
if (StringUtils.isAnyBlank(orgId, orgType)) {
// 如果前端没选择,那就取当前工作人员所属组织
LoginUserDetailsResultDTO loginUserDetails = epmetUserRemoteService.getLoginUserDetails();
orgId = loginUserDetails.getAgencyId();
orgType = OrgInfoConstant.AGENCY;
}
// 得到staffIds和staffIdAndGridIds
fillDatas4AgentQuery(orgId, orgType, staffIdAndGridIds, staffIds);
// 开始查询staff列表
return epmetUserService.staffQtyInGridsOfRole(RoleKeyConstants.ROLE_KEY_AGENT, staffIds);
}
@Override
public List<LingshanServiceAgentAgentList> screenAgentList(String orgId, String orgType) {
// 1个人可能属于多个wangge
Map<String, List<String>> staffIdAndGridIds = new HashMap<>();
Set<String> staffIds = new HashSet<>();
if (StringUtils.isAnyBlank(orgId, orgType)) {
// 如果前端没选择,那就取当前工作人员所属组织
LoginUserDetailsResultDTO loginUserDetails = epmetUserRemoteService.getLoginUserDetails();
orgId = loginUserDetails.getAgencyId();
orgType = OrgInfoConstant.AGENCY;
}
fillDatas4AgentQuery(orgId, orgType, staffIdAndGridIds, staffIds);
// 开始查询staff列表
PageData<StaffInfoInGridOfRole> staffPage = epmetUserService.staffListInGridsOfRole(RoleKeyConstants.ROLE_KEY_AGENT, staffIds,
null, null, null, 1, Integer.MAX_VALUE);
if (staffPage == null) {
return new ArrayList();
}
// 性别&教育字典
List<SysDictDataDTO> edus = getResultDataOrReturnNull(adminOpenFeignClient.dictDataList(DictTypeEnum.EDUCATION.getCode()), ServiceConstant.EPMET_ADMIN_SERVER);
Map<String, String> eduMap = edus.stream().collect(Collectors.toMap(SysDictDataDTO::getDictValue, SysDictDataDTO::getDictLabel));
// 转换为dto
List<LingshanServiceAgentAgentList> rl = staffPage.getList().stream().map(e -> {
LingshanServiceAgentAgentList d = new LingshanServiceAgentAgentList();
d.setAgentName(e.getStaffName());
d.setAgentId(e.getStaffId());
d.setGender(e.getGender());
d.setGenderDisplay(GenderEnum.getName(e.getGender().toString()));
d.setAge(e.getAge());
d.setCulture(e.getCulture());
if (e.getCulture() != null) {
d.setCultureDisplay(eduMap.get(e.getCulture().toString()));
}
d.setMobile(e.getMobile());
d.setIdCard(e.getIdCard());
// 组织名称
return d;
}).collect(Collectors.toList());
// 展开工作人员与网格的对应关系,开始赋值坐标,坐标使用所属网格的坐标,但是一个工作人员可能属于多个网格,有几个网格就复制出来几条工作人员信息,内容重复即可。
List<LingshanServiceAgentAgentList> finalAgentList = rl.stream().flatMap(agent -> {
List<String> gridIdsOfAgent = staffIdAndGridIds.get(agent.getAgentId());
return gridIdsOfAgent.stream().map(gridId -> {
GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(gridId);
LingshanServiceAgentAgentList newOne = ConvertUtils.sourceToTarget(agent, LingshanServiceAgentAgentList.class);
newOne.setLatitude(gridInfo.getLatitude());
newOne.setLongitude(gridInfo.getLongitude());
newOne.setGridId(gridId);
newOne.setOrgNamePath(gridInfo.getGridNamePath());
return newOne;
});
}).collect(Collectors.toList());
return finalAgentList;
}
}

19
epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/CustomerStaffDao.xml

@ -164,6 +164,7 @@
</foreach>
</select>
<!--查询网格下具有指定角色的工作人员列表-->
<select id="selectStaffListByStaffIdsAndRole" resultType="com.epmet.dataaggre.beans.StaffInfoInGridOfRole">
select sr.STAFF_ID staffId
, s.REAL_NAME staffName
@ -194,4 +195,22 @@
and s.ID_CARD like CONCAT('%',#{idCard},'%')
</if>
</select>
<!--查询网格下具有某角色的工作人员数量-->
<select id="countStaffQtyByStaffIdsAndRole"
resultType="java.lang.Integer">
select count(*)
from staff_role sr
inner join customer_staff s on (s.DEL_FLAG = 0 and sr.STAFF_ID = s.USER_ID)
where sr.DEL_FLAG = 0
<if test="staffIds != null and staffIds.size() > 0">
and sr.STAFF_ID in
<foreach collection="staffIds" item="staffId" open="(" separator="," close=")">
#{staffId}
</foreach>
</if>
<if test="roleId != null and roleId != ''">
and sr.ROLE_ID = #{roleId}
</if>
</select>
</mapper>

1
epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerStaffGridDao.xml

@ -69,6 +69,7 @@
</select>
<!--一个工作人员可能属于同一个agencyId下的多个grid-->
<select id="getStaffAndItsBelongsGridByAgencyIdPath" resultType="com.epmet.dataaggre.beans.LingShanAgentServiceStaffAndGrid">
select g.ID gridId, sg.USER_ID staffId
from customer_grid g

199
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/LingshanOfficeHallServiceRecordDTO.java

@ -0,0 +1,199 @@
package com.epmet.dto;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;
/**
* 灵山_办事大厅服务记录
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2023-05-15
*/
@Data
public class LingshanOfficeHallServiceRecordDTO implements Serializable {
private static final long serialVersionUID = 2157075710544884607L;
public interface AddInternalGroup {
}
public interface AddShowGroup extends CustomerClientShowGroup {
}
public interface UpdateInternalGroup {
}
public interface UpdateShowGroup extends CustomerClientShowGroup {
}
/**
* 主键
*/
@NotBlank(message = "id不能为空",groups = {UpdateInternalGroup.class})
private String id;
/**
* 租户号
*/
private String customerId;
/**
* 工作人员录入gov_pc居民端小程序resi_mp
*/
private String sourceType;
/**
* 事项类型
*/
@NotBlank(message = "事项类型不能为空",groups = {AddShowGroup.class,UpdateShowGroup.class})
private String categoryCode;
/**
* 类别名称
* 举例营业执照服务食品许可证服务医疗保险业务养老保险业务
*/
private String categoryName;
/**
* 事项说明
*/
@NotBlank(message = "事项说明不能为空",groups = {AddShowGroup.class,UpdateShowGroup.class})
@Length(max = 500, message = "事项说明最多输入500字", groups = {AddShowGroup.class, UpdateShowGroup.class})
private String content;
/**
* 申请人所属组织id或者网格id
*/
@NotBlank(message = "申请人所属组织不能为空",groups = {AddShowGroup.class,UpdateShowGroup.class})
private String applicantOrgId;
/**
* agency或者grid
*/
@NotBlank(message = "orgType不能为空",groups = {AddInternalGroup.class,UpdateInternalGroup.class})
private String applicantOrgType;
/**
* ORG_ID全路径
*/
private String applicantOrgIdPath;
/**
* 申请人所属组织名称
*/
private String applicantOrgName;
/**
* 申请人姓名
*/
// @NotBlank(message = "申请人姓名不能为空",groups = {AddShowGroup.class,UpdateShowGroup.class})
// @Length(max = 30, message = "申请人姓名最多输入30字", groups = {AddShowGroup.class, UpdateShowGroup.class})
private String applicantName;
/**
* 申请人联系电话
*/
// @NotBlank(message = "申请人电话不能为空",groups = {AddShowGroup.class,UpdateShowGroup.class})
// @Length(max = 30, message = "申请人电话最多输入30字", groups = {AddShowGroup.class, UpdateShowGroup.class})
private String applicantMobile;
/**
* 申请人身份证号
*/
// @NotBlank(message = "申请人身份证号不能为空",groups = {AddShowGroup.class,UpdateShowGroup.class})
// @Length(max = 30, message = "申请人身份证号最多输入30字", groups = {AddShowGroup.class, UpdateShowGroup.class})
private String applicantIdCard;
/**
* 申请日期
*/
@NotNull(message = "申请日期不能为空",groups = {AddShowGroup.class,UpdateShowGroup.class})
private Date applicantTime;
/**
* 办理人姓名
*/
@NotBlank(message = "办理人姓名不能为空",groups = {AddShowGroup.class,UpdateShowGroup.class})
@Length(max = 30, message = "办理人姓名最多输入30字", groups = {AddShowGroup.class, UpdateShowGroup.class})
private String transactorName;
/**
* 未办结0已办结1
*/
@NotBlank(message = "办理状态不能为空",groups = {AddShowGroup.class,UpdateShowGroup.class})
private String status;
private String statusName;
/**
* 办结日期
*/
@JsonFormat(pattern = "yyyy-MM-dd")
private Date closeTime;
/**
* 满意度评价-1不满意0基本满意1非常满意
*/
private Integer satisfication;
private String satisficationName;
/**
* 本条数据所属组织id/所属网格id
*/
private String orgId;
/**
* agency或者grid
*/
private String orgType;
/**
* 本条数据所属组织的org_id_path
*/
private String orgIdPath;
/**
* 乐观锁
*/
@JsonIgnore
private Integer revision;
/**
* 删除标记
*/
@JsonIgnore
private String delFlag;
/**
* 创建人
*/
@JsonIgnore
private String createdBy;
/**
* 创建时间
*/
@JsonIgnore
private Date createdTime;
/**
* 更新人
*/
@JsonIgnore
private String updatedBy;
/**
* 更新时间
*/
@JsonIgnore
private Date updatedTime;
}

48
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/lingshan/LingshanOfficeHallServiceRecordPageFormDTO.java

@ -0,0 +1,48 @@
package com.epmet.dto.form.lingshan;
import com.epmet.commons.tools.dto.form.PageFormDTO;
import lombok.Data;
/**
* @Description
* @Author yzm
* @Date 2023/5/15 16:31
*/
@Data
public class LingshanOfficeHallServiceRecordPageFormDTO extends PageFormDTO {
private String orgId;
private String orgType;
/**
* 事项类型
*/
private String categoryCode;
/**
* 事项说明
*/
private String content;
/**
* 满意度评价-1不满意0基本满意1非常满意
*/
private Integer satisfication;
/**
* 办结日期
*/
// @DateTimeFormat(pattern = "yyyy-MM-dd")
// @JsonFormat(pattern = "yyyy-MM-dd")
private String startDate;
// @DateTimeFormat(pattern = "yyyy-MM-dd")
// @JsonFormat(pattern = "yyyy-MM-dd")
private String endDate;
/**
* 未办结0已办结1
*/
private String status;
//tokenDto.
private String customerId;
//tokenDto.
private String staffId;
}

21
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/agentservice/LingShanScreenAgentRstDTO.java

@ -0,0 +1,21 @@
package com.epmet.dto.result.agentservice;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@AllArgsConstructor
@NoArgsConstructor
public class LingShanScreenAgentRstDTO {
private String gridId;
private String agentId;
private String agentName;
private String longitude;
private String latitude;
private String mobile;
private Integer unClosedServiceQty;
private Integer closedServiceQty;
}

20
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/agentservice/LingShanScreenServiceRstDTO.java

@ -0,0 +1,20 @@
package com.epmet.dto.result.agentservice;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.Date;
@Data
@AllArgsConstructor
@NoArgsConstructor
public class LingShanScreenServiceRstDTO {
private String content;
private String applicantName;
private String applicantMobile;
private String applicantHomeAddress;
private Date createdTime;
private String agentName;
private String agentMobile;
}

22
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/agentservice/ScreenCatalogueQtyStatsRstDTO.java

@ -0,0 +1,22 @@
package com.epmet.dto.result.agentservice;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @Description
* @Author wangxianzhang
* @Time 2023/5/15 10:09 AM
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class ScreenCatalogueQtyStatsRstDTO {
// agent service_unclosed service_closed
private String dataType;
private String name;
private Integer qty = 0;
}

56
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/LingShanAgentServiceController.java

@ -10,10 +10,7 @@ import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dto.form.agentservice.WorkCloseAgentServiceFormDTO;
import com.epmet.dto.form.lingshan.AgentServiceResiSubmitFormDTO;
import com.epmet.dto.result.agentservice.AgentServiceList4WorkPcResultDTO;
import com.epmet.dto.result.agentservice.LingShanAgentServiceCategoryResultDTO;
import com.epmet.dto.result.agentservice.ResiMyCreatedAgentServiceResultDTO;
import com.epmet.dto.result.agentservice.WorkServiceAgentResultDTO;
import com.epmet.dto.result.agentservice.*;
import com.epmet.service.LingShanAgentServiceService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
@ -237,4 +234,55 @@ public class LingShanAgentServiceController {
return new Result<PageData<AgentServiceList4WorkPcResultDTO>>().ok(pd);
}
/**
* @Description: 大屏中央红色待办选择目录带数量
* @param orgId:
* @param orgType:
* @Return com.epmet.commons.tools.utils.Result
* @Author: wangxianzhang
* @Date: 2023/5/15 12:06 AM
*/
@GetMapping("screen/catalagueQtyStats")
public Result<List<ScreenCatalogueQtyStatsRstDTO>> screenCatalogueQtyStats(@RequestParam("orgId") String orgId,
@RequestParam("orgType") String orgType) {
List<ScreenCatalogueQtyStatsRstDTO> l = lingShanServiceAgentService.screenCatalogueQtyStats(orgId, orgType);
return new Result<List<ScreenCatalogueQtyStatsRstDTO>>().ok(l);
}
/**
* @Description: 代办员列表
* @param type: agent:代办员service_unclosed:未办结服务service_closed:已办结服务
* @param orgType: gridagency
* @param orgId: 组织id
* @Return com.epmet.commons.tools.utils.Result
* @Author: wangxianzhang
* @Date: 2023/5/15 2:51 PM
*/
@GetMapping("screen/agentList")
public Result<List<LingShanScreenAgentRstDTO>> screenAagentList(@RequestParam("orgType") String orgType,
@RequestParam("orgId") String orgId) {
List<LingShanScreenAgentRstDTO> rs = lingShanServiceAgentService.screenAgentList(orgType, orgId);
return new Result<List<LingShanScreenAgentRstDTO>>().ok(rs);
}
/**
* @Description: 大屏中央服务列表
* @param orgType:
* @param orgId:
* @param dataType: agnet service_unclosed service_closed
* @Return com.epmet.commons.tools.utils.Result
* @Author: wangxianzhang
* @Date: 2023/5/15 7:56 PM
*/
@GetMapping("screen/serviceList")
public Result<List<LingShanScreenServiceRstDTO>> screenServiceList(@RequestParam("orgType") String orgType,
@RequestParam("orgId") String orgId,
@RequestParam("dataType") String dataType) {
List<LingShanScreenServiceRstDTO> rl = lingShanServiceAgentService.screenServiceList(orgType, orgId, dataType);
return new Result<List<LingShanScreenServiceRstDTO>>().ok(rl);
}
}

175
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/LingshanOfficeHallServiceRecordController.java

@ -0,0 +1,175 @@
package com.epmet.controller;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.write.metadata.WriteSheet;
import com.alibaba.excel.write.metadata.style.WriteCellStyle;
import com.alibaba.excel.write.style.HorizontalCellStyleStrategy;
import com.alibaba.excel.write.style.column.LongestMatchColumnWidthStyleStrategy;
import com.alibaba.fastjson.JSON;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.aop.NoRepeatSubmit;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.commons.tools.utils.ExcelUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.utils.poi.excel.handler.FreezeAndFilter;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dto.LingshanOfficeHallServiceRecordDTO;
import com.epmet.dto.form.lingshan.LingshanOfficeHallServiceRecordPageFormDTO;
import com.epmet.service.LingshanOfficeHallServiceRecordService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.poi.ss.usermodel.IndexedColors;
import org.apache.poi.ss.usermodel.VerticalAlignment;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Date;
import java.util.List;
/**
* 灵山_办事大厅服务记录
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2023-05-15
*/
@Slf4j
@RestController
@RequestMapping("lingshanOfficeHallServiceRecord")
public class LingshanOfficeHallServiceRecordController {
@Autowired
private LingshanOfficeHallServiceRecordService lingshanOfficeHallServiceRecordService;
/**
* 分页列表
*
* @param formDTO
* @return
*/
@PostMapping("page")
public Result<PageData<LingshanOfficeHallServiceRecordDTO>> page(@LoginUser TokenDto tokenDto, @RequestBody LingshanOfficeHallServiceRecordPageFormDTO formDTO) {
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setStaffId(tokenDto.getUserId());
PageData<LingshanOfficeHallServiceRecordDTO> page = lingshanOfficeHallServiceRecordService.page(formDTO);
return new Result<PageData<LingshanOfficeHallServiceRecordDTO>>().ok(page);
}
/**
* 办事大厅-查看详情
*
* @param id
* @return
*/
@RequestMapping(value = "detail/{id}", method = {RequestMethod.POST})
public Result<LingshanOfficeHallServiceRecordDTO> get(@PathVariable("id") String id) {
LingshanOfficeHallServiceRecordDTO data = lingshanOfficeHallServiceRecordService.get(id);
return new Result<LingshanOfficeHallServiceRecordDTO>().ok(data);
}
/**
* 工作端添加
*
* @param dto
* @return
*/
@NoRepeatSubmit
@PostMapping("save")
public Result save(@LoginUser TokenDto tokenDto, @RequestBody LingshanOfficeHallServiceRecordDTO dto) {
dto.setCustomerId(tokenDto.getCustomerId());
dto.setSourceType("gov_pc");
ValidatorUtils.validateEntity(dto, LingshanOfficeHallServiceRecordDTO.AddShowGroup.class, LingshanOfficeHallServiceRecordDTO.AddInternalGroup.class);
lingshanOfficeHallServiceRecordService.save(dto);
return new Result();
}
/**
* 工作端修改
*
* @param dto
* @return
*/
@NoRepeatSubmit
@PostMapping("update")
public Result update(@LoginUser TokenDto tokenDto, @RequestBody LingshanOfficeHallServiceRecordDTO dto) {
dto.setCustomerId(tokenDto.getCustomerId());
dto.setSourceType("gov_pc");
ValidatorUtils.validateEntity(dto, LingshanOfficeHallServiceRecordDTO.UpdateShowGroup.class, LingshanOfficeHallServiceRecordDTO.UpdateInternalGroup.class);
lingshanOfficeHallServiceRecordService.update(dto);
return new Result();
}
/**
* 批量删除
* 单挑删除
*
* @param ids
* @return
*/
@PostMapping("delete")
public Result delete(@RequestBody List<String> ids) {
if (CollectionUtils.isNotEmpty(ids)) {
lingshanOfficeHallServiceRecordService.delete(ids);
}
return new Result();
}
@PostMapping("export")
public void exportEnterprise(@LoginUser TokenDto tokenDto, @RequestBody LingshanOfficeHallServiceRecordPageFormDTO formDTO, HttpServletResponse response) throws IOException {
formDTO.setCustomerId(tokenDto.getCustomerId());
ExcelWriter excelWriter = null;
formDTO.setPageNo(NumConstant.ONE);
formDTO.setPageSize(NumConstant.TEN_THOUSAND);
try {
String fileName = "办事大厅" + DateUtils.format(new Date()) + ".xlsx";
// 头的策略
WriteCellStyle headWriteCellStyle = new WriteCellStyle();
// 背景设置为红色
headWriteCellStyle.setFillForegroundColor(IndexedColors.PALE_BLUE.getIndex());
WriteCellStyle contentWriteCellStyle = new WriteCellStyle();
contentWriteCellStyle.setVerticalAlignment(VerticalAlignment.CENTER);
HorizontalCellStyleStrategy horizontalCellStyleStrategy = new HorizontalCellStyleStrategy(headWriteCellStyle, contentWriteCellStyle);
FreezeAndFilter writeHandler = new FreezeAndFilter();
excelWriter = EasyExcel.write(ExcelUtils.getOutputStreamForExcel(fileName, response), LingshanOfficeHallServiceRecordDTO.class)
.registerWriteHandler(horizontalCellStyleStrategy)
.registerWriteHandler(new LongestMatchColumnWidthStyleStrategy())
.registerWriteHandler(writeHandler).build();
WriteSheet writeSheet = EasyExcel.writerSheet("Sheet1").registerWriteHandler(new FreezeAndFilter()).build();
PageData<LingshanOfficeHallServiceRecordDTO> data = null;
List<LingshanOfficeHallServiceRecordDTO> list = null;
do {
data = lingshanOfficeHallServiceRecordService.page(formDTO);
list = ConvertUtils.sourceToTarget(data.getList(), LingshanOfficeHallServiceRecordDTO.class);
formDTO.setPageNo(formDTO.getPageNo() + NumConstant.ONE);
excelWriter.write(list, writeSheet);
} while (CollectionUtils.isNotEmpty(list) && list.size() == formDTO.getPageSize());
} catch (EpmetException e) {
response.reset();
response.setCharacterEncoding("UTF-8");
response.setHeader("content-type", "application/json; charset=UTF-8");
PrintWriter printWriter = response.getWriter();
Result<Object> result = new Result<>().error(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), e.getMsg());
printWriter.write(JSON.toJSONString(result));
printWriter.close();
} catch (Exception e) {
log.error("办事大厅列表导出异常export exception", e);
} finally {
if (excelWriter != null) {
excelWriter.finish();
}
}
}
}

15
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/LingshanAgentServiceRecordDao.java

@ -1,8 +1,13 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.result.agentservice.LingShanScreenAgentRstDTO;
import com.epmet.entity.LingshanAgentServiceRecordEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Set;
/**
* 待办服务记录
@ -12,5 +17,13 @@ import org.apache.ibatis.annotations.Mapper;
*/
@Mapper
public interface LingshanAgentServiceRecordDao extends BaseDao<LingshanAgentServiceRecordEntity> {
/**
* @Description: 大屏代办员列表+服务数量统计
* @param agentIds:
* @Return java.util.List<com.epmet.dto.result.agentservice.LingShanScreenAgentRstDTO>
* @Author: wangxianzhang
* @Date: 2023/5/15 3:22 PM
*/
List<LingShanScreenAgentRstDTO> screenAgentListAndServiceQty(@Param("agentIds") Set<String> agentIds);
}

28
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/LingshanOfficeHallServiceRecordDao.java

@ -0,0 +1,28 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.LingshanOfficeHallServiceRecordDTO;
import com.epmet.entity.LingshanOfficeHallServiceRecordEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 灵山_办事大厅服务记录
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2023-05-15
*/
@Mapper
public interface LingshanOfficeHallServiceRecordDao extends BaseDao<LingshanOfficeHallServiceRecordEntity> {
List<LingshanOfficeHallServiceRecordDTO> pageList(@Param("customerId") String customerId,
@Param("orgIdPath") String orgIdPath,
@Param("categoryCode") String categoryCode,
@Param("content") String content,
@Param("satisfication") Integer satisfication,
@Param("startDate") String startDate,
@Param("endDate") String endDate,
@Param("status") String status);
}

118
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/LingshanOfficeHallServiceRecordEntity.java

@ -0,0 +1,118 @@
package com.epmet.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 灵山_办事大厅服务记录
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2023-05-15
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("lingshan_office_hall_service_record")
public class LingshanOfficeHallServiceRecordEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 租户号
*/
private String customerId;
/**
* 工作人员录入gov_pc居民端小程序resi_mp
*/
private String sourceType;
/**
* 事项类型
*/
private String categoryCode;
/**
* 事项说明
*/
private String content;
/**
* 申请人所属组织id或者网格id
*/
private String applicantOrgId;
/**
* agency或者grid
*/
private String applicantOrgType;
/**
* ORG_ID全路径
*/
private String applicantOrgIdPath;
/**
* 申请人所属组织名称
*/
private String applicantOrgName;
/**
* 申请人姓名
*/
private String applicantName;
/**
* 申请人联系电话
*/
private String applicantMobile;
/**
* 申请人身份证号
*/
private String applicantIdCard;
/**
* 申请日期
*/
private Date applicantTime;
/**
* 办理人姓名
*/
private String transactorName;
/**
* 未办结0已办结1
*/
private String status;
/**
* 办结日期
*/
private Date closeTime;
/**
* 满意度评价-1不满意0基本满意1非常满意
*/
private Integer satisfication;
/**
* 本条数据所属组织id/所属网格id
*/
private String orgId;
/**
* agency或者grid
*/
private String orgType;
/**
* 本条数据所属组织的org_id_path
*/
private String orgIdPath;
}

92
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/LingshanOfficeHallServiceRecordExportExcel.java

@ -0,0 +1,92 @@
package com.epmet.excel;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.util.Date;
/**
* @Description
* @Author yzm
* @Date 2023/5/15 18:24
*/
@Data
public class LingshanOfficeHallServiceRecordExportExcel {
/**
* 申请人所属组织名称
*/
@ExcelProperty(value = "所属组织")
@ColumnWidth(30)
private String applicantOrgName;
/**
* 类别名称
* 举例营业执照服务食品许可证服务医疗保险业务养老保险业务
*/
@ExcelProperty(value = "事项类型")
@ColumnWidth(25)
private String categoryName;
/**
* 事项说明
*/
@ExcelProperty(value = "事项说明")
@ColumnWidth(40)
private String content;
/**
* 申请人姓名
*/
@ExcelProperty(value = "申请人")
@ColumnWidth(30)
private String applicantName;
/**
* 申请人联系电话
*/
@ExcelProperty(value = "申请人联系电话")
@ColumnWidth(30)
private String applicantMobile;
/**
* 申请人身份证号
*/
@ExcelProperty(value = "申请人身份证号")
@ColumnWidth(30)
private String applicantIdCard;
@ExcelProperty(value = "申请日期")
@ColumnWidth(30)
@JsonFormat(pattern = "yyyy-MM-dd")
private Date applicantTime;
/**
* 办理人姓名
*/
@ExcelProperty(value = "办理人")
@ColumnWidth(30)
private String transactorName;
@ExcelProperty(value = "办理状态")
@ColumnWidth(30)
private String statusName;
/**
* 办结日期
*/
@ExcelProperty(value = "办结日期")
@ColumnWidth(30)
@JsonFormat(pattern = "yyyy-MM-dd")
private Date closeTime;
/**
* 满意度评价-1不满意0基本满意1非常满意
*/
@ExcelProperty(value = "满意度")
@ColumnWidth(25)
private String satisficationName;
}

11
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/LingShanAgentServiceService.java

@ -2,10 +2,7 @@ package com.epmet.service;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.form.lingshan.AgentServiceResiSubmitFormDTO;
import com.epmet.dto.result.agentservice.AgentServiceList4WorkPcResultDTO;
import com.epmet.dto.result.agentservice.LingShanAgentServiceCategoryResultDTO;
import com.epmet.dto.result.agentservice.ResiMyCreatedAgentServiceResultDTO;
import com.epmet.dto.result.agentservice.WorkServiceAgentResultDTO;
import com.epmet.dto.result.agentservice.*;
import java.util.Date;
import java.util.List;
@ -31,4 +28,10 @@ public interface LingShanAgentServiceService {
void workPcDelete(String id);
List<LingShanAgentServiceCategoryResultDTO> listServiceCategories();
List<ScreenCatalogueQtyStatsRstDTO> screenCatalogueQtyStats(String orgId, String orgType);
List<LingShanScreenAgentRstDTO> screenAgentList(String orgType, String orgId);
List<LingShanScreenServiceRstDTO> screenServiceList(String orgType, String orgId, String dataType);
}

70
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/LingshanOfficeHallServiceRecordService.java

@ -0,0 +1,70 @@
package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.LingshanOfficeHallServiceRecordDTO;
import com.epmet.dto.form.lingshan.LingshanOfficeHallServiceRecordPageFormDTO;
import com.epmet.entity.LingshanOfficeHallServiceRecordEntity;
import java.util.List;
/**
* 灵山_办事大厅服务记录
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2023-05-15
*/
public interface LingshanOfficeHallServiceRecordService extends BaseService<LingshanOfficeHallServiceRecordEntity> {
/**
* 办事大厅-分页列表
*
* @param formDTO
* @return PageData<LingshanOfficeHallServiceRecordDTO>
* @author generator
* @date 2023-05-15
*/
PageData<LingshanOfficeHallServiceRecordDTO> page(LingshanOfficeHallServiceRecordPageFormDTO formDTO);
/**
* 单条查询
*
* @param id
* @return LingshanOfficeHallServiceRecordDTO
* @author generator
* @date 2023-05-15
*/
LingshanOfficeHallServiceRecordDTO get(String id);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2023-05-15
*/
void save(LingshanOfficeHallServiceRecordDTO dto);
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2023-05-15
*/
void update(LingshanOfficeHallServiceRecordDTO dto);
/**
* 批量删除
*
* @param ids
* @return void
* @author generator
* @date 2023-05-15
*/
void delete(List<String> ids);
}

178
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LingShanAgentServiceServiceImpl.java

@ -4,11 +4,13 @@ import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.epmet.LingShanAgentServiceProcessStatusEnum;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.distributedlock.DistributedLock;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.exception.ExceptionUtils;
import com.epmet.commons.tools.feign.ResultDataResolver;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.redis.common.CustomerOrgRedis;
import com.epmet.commons.tools.redis.common.CustomerResiUserRedis;
@ -22,14 +24,15 @@ import com.epmet.commons.tools.utils.PidUtils;
import com.epmet.constant.OrgInfoConstant;
import com.epmet.dao.LingshanAgentServiceCategoryDao;
import com.epmet.dao.LingshanAgentServiceRecordDao;
import com.epmet.dataaggre.dto.epmetuser.result.LingshanServiceAgentAgentList;
import com.epmet.dataaggre.feign.DataAggregatorOpenFeignClient;
import com.epmet.dto.IcResiUserDTO;
import com.epmet.dto.form.lingshan.AgentServiceResiSubmitFormDTO;
import com.epmet.dto.result.LoginUserDetailsResultDTO;
import com.epmet.dto.result.agentservice.AgentServiceList4WorkPcResultDTO;
import com.epmet.dto.result.agentservice.LingShanAgentServiceCategoryResultDTO;
import com.epmet.dto.result.agentservice.ResiMyCreatedAgentServiceResultDTO;
import com.epmet.dto.result.agentservice.WorkServiceAgentResultDTO;
import com.epmet.dto.result.agentservice.*;
import com.epmet.entity.LingshanAgentServiceCategoryEntity;
import com.epmet.entity.LingshanAgentServiceRecordEntity;
import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.remote.EpmetUserRemoteService;
import com.epmet.service.LingShanAgentServiceService;
import com.github.pagehelper.PageHelper;
@ -40,13 +43,13 @@ import org.redisson.api.RLock;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;
@Service
@Slf4j
public class LingShanAgentServiceServiceImpl implements LingShanAgentServiceService {
public class LingShanAgentServiceServiceImpl implements LingShanAgentServiceService, ResultDataResolver {
@Autowired
private LingshanAgentServiceCategoryDao agentServiceCategoryDao;
@ -60,6 +63,12 @@ public class LingShanAgentServiceServiceImpl implements LingShanAgentServiceServ
@Autowired
private EpmetUserRemoteService epmetUserRemoteService;
@Autowired
private DataAggregatorOpenFeignClient dataAggregatorOpenFeignClient;
@Autowired
private EpmetUserOpenFeignClient userOpenFeignClient;
public static final String AGENT_SERVICE_LOCK_PREFIX = "lingshan:agentservice:statuschange:";
@Override
@ -368,4 +377,157 @@ public class LingShanAgentServiceServiceImpl implements LingShanAgentServiceServ
String agencyName = agencyInfo.getOrganizationName();
return agencyName.concat("-").concat(gridInfo.getGridName());
}
}
@Override
public List<ScreenCatalogueQtyStatsRstDTO> screenCatalogueQtyStats(String orgId, String orgType) {
ArrayList<ScreenCatalogueQtyStatsRstDTO> rl = new ArrayList<>();
// 代办员
Integer c = getResultDataOrThrowsException(dataAggregatorOpenFeignClient.lingshanScreenAgentQty(orgId, orgType),
ServiceConstant.DATA_AGGREGATOR_SERVER, EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), null, "查询代办员数量失败");
rl.add(new ScreenCatalogueQtyStatsRstDTO("agent", "代办员", c));
LambdaQueryWrapper<LingshanAgentServiceRecordEntity> q = new LambdaQueryWrapper<>();
String orgIdPath;
if (OrgInfoConstant.AGENCY.equals(orgType)) {
// 行政组织
AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(orgId);
orgIdPath = PidUtils.convertPid2OrgIdPath(agencyInfo.getId(), agencyInfo.getPids());
} else {
// 网格
GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(orgId);
orgIdPath = PidUtils.convertPid2OrgIdPath(gridInfo.getId(), gridInfo.getPids());
}
// 未办结事件
q.eq(LingshanAgentServiceRecordEntity::getCustomerId, EpmetRequestHolder.getLoginUserCustomerId());
q.likeRight(LingshanAgentServiceRecordEntity::getOrgIdPath, orgIdPath);
q.eq(LingshanAgentServiceRecordEntity::getProcessStatus, LingShanAgentServiceProcessStatusEnum.ACCEPTED); //已受理=未办结
rl.add(new ScreenCatalogueQtyStatsRstDTO("service_unclosed", "未办结事件", agentServiceRecordDao.selectCount(q)));
// 已办结事件
q.clear();
q.eq(LingshanAgentServiceRecordEntity::getCustomerId, EpmetRequestHolder.getLoginUserCustomerId());
q.likeRight(LingshanAgentServiceRecordEntity::getOrgIdPath, orgIdPath);
q.eq(LingshanAgentServiceRecordEntity::getProcessStatus, LingShanAgentServiceProcessStatusEnum.CLOSED); //已受理=未办结
rl.add(new ScreenCatalogueQtyStatsRstDTO("service_closed", "已办结事件", agentServiceRecordDao.selectCount(q)));
return rl;
}
@Override
public List<LingShanScreenAgentRstDTO> screenAgentList(String orgType, String orgId) {
// 此时一个工作人员可能对应两个网格,也即这个列表里面,可能有同一个agentId对应多个GridId数据,笛卡尔积
List<LingshanServiceAgentAgentList> agentList = getResultDataOrThrowsException(dataAggregatorOpenFeignClient.screenAgentList(orgId, orgType),
ServiceConstant.DATA_AGGREGATOR_SERVER, EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), null, "查询代办员列表失败");
Set<String> agentIds = agentList.stream().map(LingshanServiceAgentAgentList::getAgentId).collect(Collectors.toSet());
// 拼接一个二维map;得到每一个agentId和gridId和统计数量列表
// <agentId:<gridId:LingShanScreenAgentRstDTO>>
HashMap<String, Map<String, LingShanScreenAgentRstDTO>> staffsIdAndStatsDatasInGrid = new HashMap<>();
List<LingShanScreenAgentRstDTO> agents = agentServiceRecordDao.screenAgentListAndServiceQty(agentIds);
agents.stream().forEach(agent -> {
Map<String, LingShanScreenAgentRstDTO> gridIdAndStatsData = staffsIdAndStatsDatasInGrid.get(agent.getAgentId());
if (gridIdAndStatsData == null) {
gridIdAndStatsData = new HashMap<>();
staffsIdAndStatsDatasInGrid.put(agent.getAgentId(), gridIdAndStatsData);
}
LingShanScreenAgentRstDTO statsDataInGrid = gridIdAndStatsData.get(agent.getGridId());
if (statsDataInGrid == null) {
gridIdAndStatsData.put(agent.getGridId(), agent);
}
});
return agentList.stream().map(agent -> {
LingShanScreenAgentRstDTO d = new LingShanScreenAgentRstDTO();
d.setGridId(agent.getGridId());
d.setMobile(agent.getMobile());
d.setAgentId(agent.getAgentId());
d.setAgentName(agent.getAgentName());
d.setLatitude(agent.getLatitude());
d.setLongitude(agent.getLongitude());
d.setClosedServiceQty(0);
d.setUnClosedServiceQty(0);
// 赋值数量
Map<String, LingShanScreenAgentRstDTO> gridIdsAndStats = staffsIdAndStatsDatasInGrid.get(agent.getAgentId());
if (gridIdsAndStats != null) {
LingShanScreenAgentRstDTO statsOfGrid = gridIdsAndStats.get(agent.getGridId());
if (statsOfGrid != null) {
d.setClosedServiceQty(statsOfGrid.getClosedServiceQty());
d.setUnClosedServiceQty(statsOfGrid.getUnClosedServiceQty());
}
}
return d;
}).collect(Collectors.toList());
}
@Override
public List<LingShanScreenServiceRstDTO> screenServiceList(String orgType, String orgId, String dataType) {
String orgIdPath;
if (StringUtils.isAnyBlank(orgType, orgId)) {
LoginUserDetailsResultDTO loginUserDetails = epmetUserRemoteService.getLoginUserDetails();
orgIdPath = loginUserDetails.getOrgIdPath();
} else {
if (OrgInfoConstant.AGENCY.equals(orgType)) {
AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(orgId);
orgIdPath = PidUtils.convertPid2OrgIdPath(agencyInfo.getId(), agencyInfo.getPids());
} else {
GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(orgId);
orgIdPath = PidUtils.convertPid2OrgIdPath(gridInfo.getId(), gridInfo.getPids());
}
}
Integer processStatus;
if ("service_unclosed".equals(dataType)) {
processStatus = LingShanAgentServiceProcessStatusEnum.ACCEPTED.getStatusCode();
} else if ("service_closed".equals(dataType)) {
processStatus = LingShanAgentServiceProcessStatusEnum.CLOSED.getStatusCode();
} else {
processStatus = -100;
}
LambdaQueryWrapper<LingshanAgentServiceRecordEntity> q = new LambdaQueryWrapper<>();
q.likeRight(LingshanAgentServiceRecordEntity::getOrgIdPath, orgIdPath);
q.eq(LingshanAgentServiceRecordEntity::getProcessStatus, processStatus);
List<LingshanAgentServiceRecordEntity> serviceRecords = agentServiceRecordDao.selectList(q);
return serviceRecords.stream().map(rec -> {
LingShanScreenServiceRstDTO d = new LingShanScreenServiceRstDTO();
CustomerStaffInfoCacheResult agentInfo = CustomerStaffRedis.getStaffInfo(EpmetRequestHolder.getLoginUserCustomerId(), rec.getAgentId());
if (agentInfo != null) {
d.setAgentMobile(agentInfo.getMobile());
}
// todo 此处要查什么??申请人家庭住址?申请人家庭住址是什么?
// IcResiUserDTO resiUser = getResultDataOrReturnNull(userOpenFeignClient.getIcResiUserDTO(rec.getApplicantId()), ServiceConstant.EPMET_USER_SERVER);
// if (resiUser == null) {
// log.error("【灵山大屏】代办事件列表:查询申请人信息失败,申请人ID:" + rec.getApplicantId());
// } else {
// GridInfoCache resiUserGridInfo = CustomerOrgRedis.getGridInfo(resiUser.getGridId());
// if (resiUserGridInfo == null) {
// log.error("【灵山大屏】代办事件列表:查询申请人所属网格信息失败,申请人ID:" + rec.getApplicantId());
// } else {
// d.setApplicantHomeAddress(resiUserGridInfo.getGridName());
// }
// }
d.setContent(rec.getContent());
d.setCreatedTime(rec.getCreatedTime());
d.setApplicantName(rec.getApplicantName());
d.setApplicantMobile(rec.getContactMobile());
d.setAgentName(rec.getAgentName());
return d;
}).collect(Collectors.toList());
}
}

169
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LingshanOfficeHallServiceRecordServiceImpl.java

@ -0,0 +1,169 @@
package com.epmet.service.impl;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.enums.DictTypeEnum;
import com.epmet.commons.tools.enums.OrgTypeEnum;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.redis.common.CustomerOrgRedis;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache;
import com.epmet.commons.tools.redis.common.bean.GridInfoCache;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.EpmetRequestHolder;
import com.epmet.commons.tools.utils.PidUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dao.LingshanOfficeHallServiceRecordDao;
import com.epmet.dto.LingshanOfficeHallServiceRecordDTO;
import com.epmet.dto.form.lingshan.LingshanOfficeHallServiceRecordPageFormDTO;
import com.epmet.entity.LingshanOfficeHallServiceRecordEntity;
import com.epmet.feign.EpmetAdminOpenFeignClient;
import com.epmet.service.LingshanOfficeHallServiceRecordService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.collections4.MapUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
import java.util.Map;
/**
* 灵山_办事大厅服务记录
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2023-05-15
*/
@Service
public class LingshanOfficeHallServiceRecordServiceImpl extends BaseServiceImpl<LingshanOfficeHallServiceRecordDao, LingshanOfficeHallServiceRecordEntity> implements LingshanOfficeHallServiceRecordService {
@Autowired
private EpmetAdminOpenFeignClient adminOpenFeignClient;
/**
* 办事大厅-分页列表
*
* @param formDTO
* @return
*/
@Override
public PageData<LingshanOfficeHallServiceRecordDTO> page(LingshanOfficeHallServiceRecordPageFormDTO formDTO) {
if (StringUtils.isBlank(formDTO.getOrgId()) && StringUtils.isBlank(formDTO.getOrgType())) {
formDTO.setOrgId(CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId()).getAgencyId());
formDTO.setOrgType(OrgTypeEnum.AGENCY.getCode());
}
String orgIdPath = queryOrgIdPath(formDTO.getCustomerId(), formDTO.getStaffId(), formDTO.getOrgId(), formDTO.getOrgType());
PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize());
List<LingshanOfficeHallServiceRecordDTO> resultList = baseDao.pageList(formDTO.getCustomerId(), orgIdPath, formDTO.getCategoryCode(), formDTO.getContent(), formDTO.getSatisfication(), formDTO.getStartDate(), formDTO.getEndDate(), formDTO.getStatus());
if (CollectionUtils.isNotEmpty(resultList)) {
Result<Map<String, String>> categoryRes = adminOpenFeignClient.dictMap(DictTypeEnum.LINGSHAN_OFFICE_HALL_SERVICE_RECORD.getCode());
resultList.forEach(dto -> {
dto.setCategoryName(MapUtils.isNotEmpty(categoryRes.getData()) ? categoryRes.getData().get(dto.getCategoryCode()) : StrConstant.EPMETY_STR);
});
}
PageInfo pageInfo = new PageInfo<>(resultList);
return new PageData<>(resultList, pageInfo.getTotal());
}
/**
* 办事大厅-查看详情
*
* @param id
* @return
*/
@Override
public LingshanOfficeHallServiceRecordDTO get(String id) {
LingshanOfficeHallServiceRecordEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, LingshanOfficeHallServiceRecordDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(LingshanOfficeHallServiceRecordDTO dto) {
LingshanOfficeHallServiceRecordEntity entity = ConvertUtils.sourceToTarget(dto, LingshanOfficeHallServiceRecordEntity.class);
entity.setStatus(NumConstant.ZERO_STR);
if (StringUtils.isNotBlank(dto.getApplicantOrgId())) {
if (OrgTypeEnum.GRID.getCode().equals(dto.getApplicantOrgType())) {
GridInfoCache gridInfoCache = CustomerOrgRedis.getGridInfo(dto.getApplicantOrgId());
entity.setApplicantOrgIdPath(PidUtils.convertPid2OrgIdPath(gridInfoCache.getId(), gridInfoCache.getPids()));
entity.setApplicantOrgName(gridInfoCache.getGridNamePath());
// 本条数据属于网格
entity.setOrgId(gridInfoCache.getId());
entity.setOrgType(dto.getOrgType());
entity.setOrgIdPath(entity.getApplicantOrgIdPath());
} else if (OrgTypeEnum.AGENCY.getCode().equals(dto.getApplicantOrgType())) {
AgencyInfoCache agencyInfoCache = CustomerOrgRedis.getAgencyInfo(dto.getApplicantOrgId());
entity.setApplicantOrgIdPath(PidUtils.convertPid2OrgIdPath(agencyInfoCache.getId(), agencyInfoCache.getPids()));
entity.setApplicantOrgName(agencyInfoCache.getOrganizationName());
// 本条数据属于组织
entity.setOrgId(agencyInfoCache.getId());
entity.setOrgType(dto.getOrgType());
entity.setOrgIdPath(entity.getApplicantOrgIdPath());
}
} else {
// 如果申请人所属组织没填写, 本条数据属于当前工作人员所属组织
entity.setOrgId(CustomerStaffRedis.getStaffInfo(dto.getCustomerId(), EpmetRequestHolder.getLoginUserId()).getAgencyId());
entity.setOrgType(OrgTypeEnum.AGENCY.getCode());
entity.setOrgIdPath(CustomerOrgRedis.getOrgIdPath(entity.getOrgId(), entity.getOrgType()));
}
insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(LingshanOfficeHallServiceRecordDTO dto) {
LingshanOfficeHallServiceRecordEntity entity = ConvertUtils.sourceToTarget(dto, LingshanOfficeHallServiceRecordEntity.class);
if (StringUtils.isNotBlank(dto.getApplicantOrgId())) {
if (OrgTypeEnum.GRID.getCode().equals(dto.getApplicantOrgType())) {
GridInfoCache gridInfoCache = CustomerOrgRedis.getGridInfo(dto.getApplicantOrgId());
entity.setApplicantOrgIdPath(PidUtils.convertPid2OrgIdPath(gridInfoCache.getId(), gridInfoCache.getPids()));
entity.setApplicantOrgName(gridInfoCache.getGridNamePath());
// 本条数据属于网格
entity.setOrgId(gridInfoCache.getId());
entity.setOrgType(dto.getOrgType());
entity.setOrgIdPath(entity.getApplicantOrgIdPath());
} else if (OrgTypeEnum.AGENCY.getCode().equals(dto.getApplicantOrgType())) {
AgencyInfoCache agencyInfoCache = CustomerOrgRedis.getAgencyInfo(dto.getApplicantOrgId());
entity.setApplicantOrgIdPath(PidUtils.convertPid2OrgIdPath(agencyInfoCache.getId(), agencyInfoCache.getPids()));
entity.setApplicantOrgName(agencyInfoCache.getOrganizationName());
// 本条数据属于组织
entity.setOrgId(agencyInfoCache.getId());
entity.setOrgType(dto.getOrgType());
entity.setOrgIdPath(entity.getApplicantOrgIdPath());
}
} else {
// 如果申请人所属组织没填写, 本条数据属于当前工作人员所属组织
entity.setOrgId(CustomerStaffRedis.getStaffInfo(dto.getCustomerId(), EpmetRequestHolder.getLoginUserId()).getAgencyId());
entity.setOrgType(OrgTypeEnum.AGENCY.getCode());
entity.setOrgIdPath(CustomerOrgRedis.getOrgIdPath(entity.getOrgId(), entity.getOrgType()));
}
updateById(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(List<String> ids) {
// 逻辑删除(@TableLogic 注解)
baseDao.deleteBatchIds(ids);
}
private String queryOrgIdPath(String customerId, String staffId, String orgId, String orgType) {
String orgIdPath = "";
// 如果没传,默认查询当前工作人员所属组织
if (StringUtils.isBlank(orgId) && StringUtils.isBlank(orgType)) {
CustomerStaffInfoCacheResult staffInfoCacheResult = CustomerStaffRedis.getStaffInfo(customerId, staffId);
orgId = staffInfoCacheResult.getAgencyId();
orgType = OrgTypeEnum.AGENCY.getCode();
}
orgIdPath = CustomerOrgRedis.getOrgIdPath(orgId, orgType);
return orgIdPath;
}
}

22
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LingshanAgentServiceRecordDao.xml

@ -36,5 +36,27 @@
<result property="latitude" column="LATITUDE"/>
</resultMap>
<!--大屏:代办员列表+服务数量统计-->
<select id="screenAgentListAndServiceQty"
resultType="com.epmet.dto.result.agentservice.LingShanScreenAgentRstDTO">
select r.AGENT_ID
, r.GRID_ID
, count(r.PROCESS_STATUS = 1 or null) as unClosedServiceQty
, count(r.PROCESS_STATUS = 3 or null) as closedServiceQty
from lingshan_agent_service_record r
<where>
<if test="agentIds != null and agentIds.size() > 0">
r.AGENT_ID in
<foreach collection="agentIds" open="(" separator="," item="agentId" close=")" >
#{agentId}
</foreach>
</if>
and r.DEL_FLAG = 0
and r.AGENT_ID is not null
and r.AGENT_ID != ''
</where>
group by r.AGENT_ID, r.GRID_ID
</select>
</mapper>

42
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LingshanOfficeHallServiceRecordDao.xml

@ -0,0 +1,42 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.dao.LingshanOfficeHallServiceRecordDao">
<select id="pageList" parameterType="map" resultType="com.epmet.dto.LingshanOfficeHallServiceRecordDTO">
select r.*,
(case when r.STATUS='0' then '未办结'
when r.STATUS='1' then '已办结'
else ''
end)as statusName,
(
case when r.SATISFICATION='-1' then '不满意'
when r.SATISFICATION='0' then '基本满意'
when r.SATISFICATION='1' then '非常满意'
else ''
end)as satisficationName
from lingshan_office_hall_service_record r
where r.DEL_FLAG = '0'
and r.CUSTOMER_ID = #{customerId}
and r.ORG_ID_PATH like concat(#{orgIdPath},'%')
<if test="categoryCode != null and categoryCode != ''">
and r.CATEGORY_CODE = #{categoryCode}
</if>
<if test="content != null and content != ''">
and r.CONTENT like concat('%',#{content},'%')
</if>
<if test="satisfication != null">
and r.SATISFICATION = #{satisfication}
</if>
<if test="status != null and status != ''">
and r.STATUS = #{status}
</if>
<if test='startDate != null and startDate != "" '>
AND DATE_FORMAT(r.CLOSE_TIME,'%Y-%m-%d') >= #{startDate}
</if>
<if test='endDate != null and endDate != "" '>
AND DATE_FORMAT(r.CLOSE_TIME,'%Y-%m-%d') <![CDATA[ <= ]]> #{endDate}
</if>
ORDER BY R.CREATED_TIME DESC
</select>
</mapper>

3
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcHouseDTO.java

@ -179,4 +179,7 @@ public class IcHouseDTO implements Serializable {
* 面积
*/
private String area;
private String longitude;
private String latitude;
}

3
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcHouseAddFormDTO.java

@ -121,4 +121,7 @@ public class IcHouseAddFormDTO implements Serializable {
*/
private String area;
private String longitude;
private String latitude;
}

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

@ -144,4 +144,7 @@ public class IcHouseEntity extends BaseEpmetEntity {
* 面积
*/
private String area;
private String longitude;
private String latitude;
}

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

@ -238,6 +238,8 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver {
}
IcHouseDTO icHouseDTO = ConvertUtils.sourceToTarget(formDTO, IcHouseDTO.class);
icHouseDTO.setId(formDTO.getHouseId());
icHouseDTO.setLatitude(formDTO.getLatitude());
icHouseDTO.setLongitude(formDTO.getLongitude());
icHouseDTO.setCustomerId(customerId);
icHouseDTO.setRentFlag(formDTO.getRentFlag());
icHouseDTO.setHouseTypeName(HouseTypeEnums.getTypeValue(formDTO.getHouseType()));

Loading…
Cancel
Save