|
@ -2,6 +2,7 @@ package com.epmet.service.impl; |
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSON; |
|
|
import com.alibaba.fastjson.JSON; |
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
import com.epmet.LingShanAgentServiceProcessStatusEnum; |
|
|
import com.epmet.LingShanAgentServiceProcessStatusEnum; |
|
|
import com.epmet.commons.tools.distributedlock.DistributedLock; |
|
|
import com.epmet.commons.tools.distributedlock.DistributedLock; |
|
|
import com.epmet.commons.tools.exception.EpmetErrorCode; |
|
|
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.page.PageData; |
|
|
import com.epmet.commons.tools.redis.common.CustomerOrgRedis; |
|
|
import com.epmet.commons.tools.redis.common.CustomerOrgRedis; |
|
|
import com.epmet.commons.tools.redis.common.CustomerResiUserRedis; |
|
|
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.GridInfoCache; |
|
|
import com.epmet.commons.tools.redis.common.bean.ResiUserInfoCache; |
|
|
import com.epmet.commons.tools.redis.common.bean.ResiUserInfoCache; |
|
|
import com.epmet.commons.tools.utils.ConvertUtils; |
|
|
import com.epmet.commons.tools.utils.ConvertUtils; |
|
|
import com.epmet.commons.tools.utils.EpmetRequestHolder; |
|
|
import com.epmet.commons.tools.utils.EpmetRequestHolder; |
|
|
import com.epmet.commons.tools.utils.PidUtils; |
|
|
import com.epmet.commons.tools.utils.PidUtils; |
|
|
|
|
|
import com.epmet.constant.OrgInfoConstant; |
|
|
import com.epmet.dao.LingshanAgentServiceCategoryDao; |
|
|
import com.epmet.dao.LingshanAgentServiceCategoryDao; |
|
|
import com.epmet.dao.LingshanAgentServiceRecordDao; |
|
|
import com.epmet.dao.LingshanAgentServiceRecordDao; |
|
|
import com.epmet.dto.form.lingshan.AgentServiceResiSubmitFormDTO; |
|
|
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.ResiMyCreatedAgentServiceResultDTO; |
|
|
import com.epmet.dto.result.agentservice.WorkServiceAgentResultDTO; |
|
|
import com.epmet.dto.result.agentservice.WorkServiceAgentResultDTO; |
|
|
import com.epmet.entity.LingshanAgentServiceCategoryEntity; |
|
|
import com.epmet.entity.LingshanAgentServiceCategoryEntity; |
|
|
import com.epmet.entity.LingshanAgentServiceRecordEntity; |
|
|
import com.epmet.entity.LingshanAgentServiceRecordEntity; |
|
|
|
|
|
import com.epmet.remote.EpmetUserRemoteService; |
|
|
import com.epmet.service.LingShanAgentServiceService; |
|
|
import com.epmet.service.LingShanAgentServiceService; |
|
|
import com.github.pagehelper.PageHelper; |
|
|
import com.github.pagehelper.PageHelper; |
|
|
import com.github.pagehelper.PageInfo; |
|
|
import com.github.pagehelper.PageInfo; |
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
import org.redisson.api.RLock; |
|
|
import org.redisson.api.RLock; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.stereotype.Service; |
|
|
import org.springframework.stereotype.Service; |
|
@ -47,6 +53,9 @@ public class LingShanAgentServiceServiceImpl implements LingShanAgentServiceServ |
|
|
@Autowired |
|
|
@Autowired |
|
|
private DistributedLock distributedLock; |
|
|
private DistributedLock distributedLock; |
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
|
private EpmetUserRemoteService epmetUserRemoteService; |
|
|
|
|
|
|
|
|
public static final String AGENT_SERVICE_LOCK_PREFIX = "lingshan:agentservice:statuschange:"; |
|
|
public static final String AGENT_SERVICE_LOCK_PREFIX = "lingshan:agentservice:statuschange:"; |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -247,4 +256,84 @@ public class LingShanAgentServiceServiceImpl implements LingShanAgentServiceServ |
|
|
e2update.setSatisfication(satisfication); |
|
|
e2update.setSatisfication(satisfication); |
|
|
agentServiceRecordDao.updateById(e2update); |
|
|
agentServiceRecordDao.updateById(e2update); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
public PageData<AgentServiceList4WorkPcResultDTO> 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<LingshanAgentServiceRecordEntity> 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<LingshanAgentServiceRecordEntity> l = agentServiceRecordDao.selectList(q); |
|
|
|
|
|
Page<LingshanAgentServiceRecordEntity> pd = agentServiceRecordDao.selectPage(new Page<>(pageNo, pageSize), q); |
|
|
|
|
|
|
|
|
|
|
|
List<AgentServiceList4WorkPcResultDTO> 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()); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|