|
@ -5,10 +5,15 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
import com.epmet.commons.rocketmq.messages.ProjectChangedMQMsg; |
|
|
import com.epmet.commons.rocketmq.messages.ProjectChangedMQMsg; |
|
|
import com.epmet.commons.tools.constant.AppClientConstant; |
|
|
import com.epmet.commons.tools.constant.AppClientConstant; |
|
|
import com.epmet.commons.tools.constant.NumConstant; |
|
|
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.OrgTypeEnum; |
|
|
import com.epmet.commons.tools.enums.OrgTypeEnum; |
|
|
import com.epmet.commons.tools.exception.EpmetErrorCode; |
|
|
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.exception.ExceptionUtils; |
|
|
import com.epmet.commons.tools.exception.RenException; |
|
|
import com.epmet.commons.tools.exception.RenException; |
|
|
|
|
|
import com.epmet.commons.tools.page.PageData; |
|
|
|
|
|
import com.epmet.commons.tools.redis.common.CustomerStaffRedis; |
|
|
import com.epmet.commons.tools.scan.param.TextScanParamDTO; |
|
|
import com.epmet.commons.tools.scan.param.TextScanParamDTO; |
|
|
import com.epmet.commons.tools.scan.param.TextTaskDTO; |
|
|
import com.epmet.commons.tools.scan.param.TextTaskDTO; |
|
|
import com.epmet.commons.tools.scan.result.SyncScanResult; |
|
|
import com.epmet.commons.tools.scan.result.SyncScanResult; |
|
@ -33,14 +38,14 @@ import com.epmet.feign.*; |
|
|
import com.epmet.send.SendMqMsgUtil; |
|
|
import com.epmet.send.SendMqMsgUtil; |
|
|
import com.epmet.service.*; |
|
|
import com.epmet.service.*; |
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
|
|
import org.apache.commons.collections4.CollectionUtils; |
|
|
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
import org.apache.logging.log4j.LogManager; |
|
|
import org.apache.logging.log4j.LogManager; |
|
|
import org.apache.logging.log4j.Logger; |
|
|
import org.apache.logging.log4j.Logger; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.beans.factory.annotation.Value; |
|
|
import org.springframework.beans.factory.annotation.Value; |
|
|
import org.springframework.stereotype.Service; |
|
|
import org.springframework.stereotype.Service; |
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
import org.springframework.util.CollectionUtils; |
|
|
|
|
|
import org.springframework.util.StringUtils; |
|
|
|
|
|
import org.springframework.web.context.request.RequestContextHolder; |
|
|
import org.springframework.web.context.request.RequestContextHolder; |
|
|
import org.springframework.web.context.request.ServletRequestAttributes; |
|
|
import org.springframework.web.context.request.ServletRequestAttributes; |
|
|
|
|
|
|
|
@ -882,6 +887,49 @@ public class ProjectTraceServiceImpl<ProjectTagService> implements ProjectTraceS |
|
|
return resultDTO; |
|
|
return resultDTO; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 【网格员工作统计】项目列表 |
|
|
|
|
|
* |
|
|
|
|
|
* @param formDTO |
|
|
|
|
|
* @Param formDTO |
|
|
|
|
|
* @Return {@link PageData < ApprovaledListResultDTO>} |
|
|
|
|
|
* @Author zhaoqifeng |
|
|
|
|
|
* @Date 2022/1/4 15:33 |
|
|
|
|
|
*/ |
|
|
|
|
|
@Override |
|
|
|
|
|
public PageData<ApprovaledListResultDTO> approvaledList(ApprovaledListFromDTO formDTO) { |
|
|
|
|
|
//获取项目列表
|
|
|
|
|
|
PageData<ApprovaledListResultDTO> result = projectService.approvaledList(formDTO); |
|
|
|
|
|
//获取项目分类
|
|
|
|
|
|
Result<Map<String, String>> categoryMapResult = govIssueOpenFeignClient.getCategoryMap(formDTO.getCustomerId()); |
|
|
|
|
|
if (!categoryMapResult.success()) { |
|
|
|
|
|
throw new EpmetException(categoryMapResult.getCode(),categoryMapResult.getMsg()); |
|
|
|
|
|
} |
|
|
|
|
|
Map<String, String> categoryMap = categoryMapResult.getData(); |
|
|
|
|
|
if(CollectionUtils.isNotEmpty(result.getList())) { |
|
|
|
|
|
List<String> projectIds = result.getList().stream().map(ApprovaledListResultDTO::getProjectId).collect(Collectors.toList()); |
|
|
|
|
|
Map<String, Set<String>> projectCategory = projectCategoryService.getProjectCategoryMap(projectIds); |
|
|
|
|
|
result.getList().forEach(item -> { |
|
|
|
|
|
//工作人员姓名
|
|
|
|
|
|
CustomerStaffInfoCacheResult staff = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), item.getStaffId()); |
|
|
|
|
|
item.setStaffName(staff.getRealName()); |
|
|
|
|
|
//项目分类
|
|
|
|
|
|
Set<String> categoryList = projectCategory.get(item.getProjectCategory()); |
|
|
|
|
|
if (null != categoryList) { |
|
|
|
|
|
List<String> categoryNames = new ArrayList<>(); |
|
|
|
|
|
categoryList.forEach(category -> { |
|
|
|
|
|
if (StringUtils.isNotBlank(categoryMap.get(category))) { |
|
|
|
|
|
categoryNames.add(categoryMap.get(category)); |
|
|
|
|
|
} |
|
|
|
|
|
} ); |
|
|
|
|
|
item.setProjectCategory(StringUtils.join(categoryNames.toArray(), StrConstant.SEMICOLON)); |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
return result; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
private List<StaffListResultDTO> queryStaffListRes(List<TickStaffFormDTO> staffList,String currentUserId) { |
|
|
private List<StaffListResultDTO> queryStaffListRes(List<TickStaffFormDTO> staffList,String currentUserId) { |
|
|
List<String> staffIdList = staffList.stream().map(TickStaffFormDTO::getStaffId).collect(Collectors.toList()); |
|
|
List<String> staffIdList = staffList.stream().map(TickStaffFormDTO::getStaffId).collect(Collectors.toList()); |
|
|
staffIdList.add(currentUserId); |
|
|
staffIdList.add(currentUserId); |
|
|