diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/agentservice/AgentServiceList4WorkPcResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/agentservice/AgentServiceList4WorkPcResultDTO.java new file mode 100644 index 0000000000..1ec156b2d9 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/agentservice/AgentServiceList4WorkPcResultDTO.java @@ -0,0 +1,30 @@ +package com.epmet.dto.result.agentservice; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.util.Date; + +/** + * @Description PC工作端-服务列表 + * @Author wangxianzhang + * @Time 2023/5/10 2:58 PM + */ +@Data +public class AgentServiceList4WorkPcResultDTO { + private String id; + private String orgNamePath; + private String serviceCategory; + private String serviceCategoryName; + private String applicantName; + @JsonFormat(pattern = "yyyy-MM-dd") + private Date createdTime; + + private String agentName; + private Integer processStatus; + private String processStatusDisplay; + @JsonFormat(pattern = "yyyy-MM-dd") + private Date processTime; + + private Integer satisfaction; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/agentservice/ResiMyCreatedAgentServiceResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/agentservice/ResiMyCreatedAgentServiceResultDTO.java index 1922dea3bd..db90db2c38 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/agentservice/ResiMyCreatedAgentServiceResultDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/agentservice/ResiMyCreatedAgentServiceResultDTO.java @@ -1,17 +1,19 @@ package com.epmet.dto.result.agentservice; +import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; import java.util.Date; @Data public class ResiMyCreatedAgentServiceResultDTO { - + private String id; private String serviceCategory; private String serviceCategoryName; private String content; private Date createdTime; // 待受理 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date exceptServeTime; private String exceptServeAddress; diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/LingShanAgentServiceController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/LingShanAgentServiceController.java index 91338c87f1..219cfae250 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/LingShanAgentServiceController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/LingShanAgentServiceController.java @@ -5,10 +5,12 @@ import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.exception.ValidateException; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.DateUtils; 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.ResiMyCreatedAgentServiceResultDTO; import com.epmet.dto.result.agentservice.WorkServiceAgentResultDTO; import com.epmet.service.LingShanAgentServiceService; @@ -16,6 +18,7 @@ import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; +import java.util.Date; import java.util.List; import java.util.Map; @@ -79,6 +82,13 @@ public class LingShanAgentServiceController { return new Result(); } + /** + * @Description: 居民端-评价 + * @param form: + * @Return com.epmet.commons.tools.utils.Result + * @Author: wangxianzhang + * @Date: 2023/5/10 2:53 PM + */ @PostMapping("resi/evaluate") public Result resiEvaluate(@RequestBody Map form) { String id = (String) form.get("id"); @@ -157,5 +167,42 @@ public class LingShanAgentServiceController { return new Result(); } + /** + * @Description: pc工作端:服务列表 + * @param orgId: + * @param orgType: + * @param serviceCategory: + * @param content: + * @param agentName: + * @param processTimeStartStr: + * @param processTimeEndStr: + * @Return com.epmet.commons.tools.utils.Result> + * @Author: wangxianzhang + * @Date: 2023/5/10 3:00 PM + */ + @GetMapping("workpc/serviceList") + public Result> workPcServiceList(@RequestParam(value = "orgId", required = false) String orgId, + @RequestParam(value = "orgType", required = false) String orgType, + @RequestParam(value = "serviceCategory", required = false) String serviceCategory, + @RequestParam(value = "content", required = false) String content, + @RequestParam(value = "agentName", required = false) String agentName, + @RequestParam(value = "processTimeStart", required = false) String processTimeStartStr, + @RequestParam(value = "processTimeEnd", required = false) String processTimeEndStr, + @RequestParam(value = "pageNo") Integer pageNo, + @RequestParam(value = "pageSize") Integer pageSize) { + + Date processTimeStart = null, processTimeEnd = null; + + if (StringUtils.isNotBlank(processTimeStartStr)) { + processTimeStart = DateUtils.parse(processTimeStartStr, DateUtils.DATE_TIME_PATTERN); + } + if (StringUtils.isNotBlank(processTimeEndStr)) { + processTimeEnd = DateUtils.parse(processTimeEndStr, DateUtils.DATE_TIME_PATTERN); + } + + PageData pd = lingShanServiceAgentService.workPcServiceList(orgId, orgType, serviceCategory, content, agentName, + processTimeStart, processTimeEnd, pageNo, pageSize); + return new Result>().ok(pd); + } } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/LingShanAgentServiceService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/LingShanAgentServiceService.java index 14e83ec1a9..0a7cda1e30 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/LingShanAgentServiceService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/LingShanAgentServiceService.java @@ -2,9 +2,11 @@ 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.ResiMyCreatedAgentServiceResultDTO; import com.epmet.dto.result.agentservice.WorkServiceAgentResultDTO; +import java.util.Date; import java.util.List; public interface LingShanAgentServiceService { @@ -21,4 +23,7 @@ public interface LingShanAgentServiceService { void resiWithDraw(String id); void resiEvaluate(String id, Integer satisfication); + + PageData workPcServiceList(String orgId, String orgType, String serviceCategory, String content, + String agentName, Date processTimeStart, Date processTimeEnd, Integer pageNo, Integer pageSize); } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LingShanAgentServiceServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LingShanAgentServiceServiceImpl.java index 405e93721e..18b40ac60a 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LingShanAgentServiceServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LingShanAgentServiceServiceImpl.java @@ -2,6 +2,7 @@ package com.epmet.service.impl; 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.distributedlock.DistributedLock; import com.epmet.commons.tools.exception.EpmetErrorCode; @@ -10,22 +11,27 @@ import com.epmet.commons.tools.exception.ExceptionUtils; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.redis.common.CustomerOrgRedis; import com.epmet.commons.tools.redis.common.CustomerResiUserRedis; +import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache; import com.epmet.commons.tools.redis.common.bean.GridInfoCache; import com.epmet.commons.tools.redis.common.bean.ResiUserInfoCache; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.EpmetRequestHolder; 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.dto.form.lingshan.AgentServiceResiSubmitFormDTO; +import com.epmet.dto.result.agentservice.AgentServiceList4WorkPcResultDTO; import com.epmet.dto.result.agentservice.ResiMyCreatedAgentServiceResultDTO; import com.epmet.dto.result.agentservice.WorkServiceAgentResultDTO; import com.epmet.entity.LingshanAgentServiceCategoryEntity; import com.epmet.entity.LingshanAgentServiceRecordEntity; +import com.epmet.remote.EpmetUserRemoteService; import com.epmet.service.LingShanAgentServiceService; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; import org.redisson.api.RLock; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -47,6 +53,9 @@ public class LingShanAgentServiceServiceImpl implements LingShanAgentServiceServ @Autowired private DistributedLock distributedLock; + @Autowired + private EpmetUserRemoteService epmetUserRemoteService; + public static final String AGENT_SERVICE_LOCK_PREFIX = "lingshan:agentservice:statuschange:"; @@ -247,4 +256,84 @@ public class LingShanAgentServiceServiceImpl implements LingShanAgentServiceServ e2update.setSatisfication(satisfication); agentServiceRecordDao.updateById(e2update); } + + @Override + public PageData workPcServiceList(String orgId, String orgType, String serviceCategory, String content, + String agentName, Date processTimeStart, Date processTimeEnd, Integer pageNo, Integer pageSize) { + + String orgIdPath; + if (StringUtils.isBlank(orgId)) { + // 没传组织id,则默认使用当前人员所属的组织 + orgIdPath = epmetUserRemoteService.getLoginUserDetails().getOrgIdPath(); + } else { + if (StringUtils.isBlank(orgType)) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), null, + "【代办服务】缺少组织类型参数"); + } + if (OrgInfoConstant.AGENCY.equals(orgType)) { + AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(orgId); + orgIdPath = PidUtils.convertPid2OrgIdPath(agencyInfo.getId(), agencyInfo.getPids()); + } else if (OrgInfoConstant.GRID.equals(orgType)) { + GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(orgId); + orgIdPath = PidUtils.convertPid2OrgIdPath(gridInfo.getId(), gridInfo.getPids()); + } else { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), null, + "【代办服务】未知的组织类型"); + } + } + + LambdaQueryWrapper q = new LambdaQueryWrapper<>(); + // q.likeRight(LingshanAgentServiceRecordEntity::getOrgIdPath, orgIdPath); + // q.eq(StringUtils.isNotBlank(serviceCategory), LingshanAgentServiceRecordEntity::getServiceCategory, serviceCategory); + // q.like(StringUtils.isNotBlank(content), LingshanAgentServiceRecordEntity::getContent, content); + // q.like(StringUtils.isNotBlank(agentName), LingshanAgentServiceRecordEntity::getAgentName, agentName); + // q.like(StringUtils.isNotBlank(agentName), LingshanAgentServiceRecordEntity::getAgentName, agentName); + // q.ge(processTimeStart != null , LingshanAgentServiceRecordEntity::getProcessTime, processTimeStart); + // q.le(processTimeStart != null , LingshanAgentServiceRecordEntity::getProcessTime, processTimeEnd); + + // PageHelper.startPage(pageNo, pageSize); + List l = agentServiceRecordDao.selectList(q); + Page pd = agentServiceRecordDao.selectPage(new Page<>(pageNo, pageSize), q); + + List ds = pd.getRecords().stream().map(serviceEntity -> { + String categoryName = null; + LingshanAgentServiceCategoryEntity categoryEntity = agentServiceCategoryDao.selectById(serviceEntity.getServiceCategory()); + if (categoryEntity != null) { + categoryName = categoryEntity.getCategoryName(); + } + + AgentServiceList4WorkPcResultDTO d = new AgentServiceList4WorkPcResultDTO(); + d.setId(serviceEntity.getId()); + d.setOrgNamePath(getOrgNamePath(serviceEntity.getGridId())); + d.setServiceCategory(serviceEntity.getServiceCategory()); + d.setServiceCategoryName(categoryName); + d.setApplicantName(serviceEntity.getApplicantName()); + d.setCreatedTime(serviceEntity.getCreatedTime()); + d.setAgentName(serviceEntity.getAgentName()); + d.setProcessStatus(serviceEntity.getProcessStatus()); + d.setProcessStatusDisplay(LingShanAgentServiceProcessStatusEnum.getByStatus(serviceEntity.getProcessStatus()).getStatusName()); + if (!(LingShanAgentServiceProcessStatusEnum.REJECTED.getStatusCode() == serviceEntity.getProcessStatus().intValue())) { + // 驳回的话,不显示处理时间;受理、办结状态显示;待受理还没有处理时间 + d.setProcessTime(serviceEntity.getProcessTime()); + } + d.setSatisfaction(serviceEntity.getSatisfication()); + return d; + }).collect(Collectors.toList()); + + return new PageData<>(ds, pd.getTotal()); + } + + /** + * 通过gridid列表,拼接处组织名称path,例如:开发者社区-Java第一网格,开发者社区-Python第一网格 + */ + private String getOrgNamePath(String gridId) { + GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(gridId); + if (gridInfo == null) { + return null; + } + + AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(gridInfo.getPid()); + String agencyName = agencyInfo.getOrganizationName(); + return agencyName.concat("-").concat(gridInfo.getGridName()); + } } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LingshanAgentServiceRecordDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LingshanAgentServiceRecordDao.xml index 3eea2c861e..1486105b71 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LingshanAgentServiceRecordDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LingshanAgentServiceRecordDao.xml @@ -13,16 +13,17 @@ - + + + - diff --git a/epmet-user/epmet-user-server/src/main/resources/excel/lingshan/special_crowd_xidurenyuan_import.xlsx b/epmet-user/epmet-user-server/src/main/resources/excel/lingshan/special_crowd_jiedurenyuan_import.xlsx similarity index 100% rename from epmet-user/epmet-user-server/src/main/resources/excel/lingshan/special_crowd_xidurenyuan_import.xlsx rename to epmet-user/epmet-user-server/src/main/resources/excel/lingshan/special_crowd_jiedurenyuan_import.xlsx