Browse Source

【网格员工作统计】项目列表

dev_shibei_match
zhaoqifeng 4 years ago
parent
commit
d2d7421268
  1. 5
      epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/IssueProjectCategoryDictDTO.java
  2. 18
      epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/GovIssueOpenFeignClient.java
  3. 14
      epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/fallback/GovIssueOpenFeignClientFallBack.java
  4. 13
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueProjectCategoryDictController.java
  5. 9
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueProjectCategoryDictDao.java
  6. 3
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueProjectCategoryDictService.java
  7. 15
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueProjectCategoryDictServiceImpl.java
  8. 18
      epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueProjectCategoryDictDao.xml
  9. 27
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ApprovaledListFromDTO.java
  10. 28
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ApprovaledListResultDTO.java
  11. 17
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectTraceController.java
  12. 11
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectDao.java
  13. 10
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectCategoryService.java
  14. 10
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectService.java
  15. 11
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectTraceService.java
  16. 27
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectCategoryServiceImpl.java
  17. 18
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java
  18. 52
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectTraceServiceImpl.java
  19. 25
      epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectDao.xml

5
epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/IssueProjectCategoryDictDTO.java

@ -17,9 +17,10 @@
package com.epmet.dto; package com.epmet.dto;
import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date; import java.util.Date;
import lombok.Data;
/** /**
@ -67,7 +68,7 @@ public class IssueProjectCategoryDictDTO implements Serializable {
* 分类名称 * 分类名称
*/ */
private String categoryName; private String categoryName;
private String parentCategoryName;
/** /**
* 分类类别1,2,3,4.... * 分类类别1,2,3,4....
*/ */

18
epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/GovIssueOpenFeignClient.java

@ -4,9 +4,6 @@ import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.IssueApplicationDTO;
import com.epmet.dto.IssueDTO;
import com.epmet.dto.IssueSuggestionDTO;
import com.epmet.dto.*; import com.epmet.dto.*;
import com.epmet.dto.form.*; import com.epmet.dto.form.*;
import com.epmet.dto.result.*; import com.epmet.dto.result.*;
@ -25,10 +22,7 @@ import com.epmet.resi.mine.dto.from.MyShiftIssueTopicsFormDTO;
import com.epmet.resi.mine.dto.result.MyShiftIssueTopicsResultDTO; import com.epmet.resi.mine.dto.result.MyShiftIssueTopicsResultDTO;
import org.springframework.cloud.openfeign.FeignClient; import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType; import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.*;
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; import java.util.List;
import java.util.Map; import java.util.Map;
@ -372,4 +366,14 @@ public interface GovIssueOpenFeignClient {
**/ **/
@PostMapping(value = "/gov/issue/issueprojectcategorydict/getcategorylist") @PostMapping(value = "/gov/issue/issueprojectcategorydict/getcategorylist")
Result<List<IssueProjectCategoryDictDTO>> getCategoryList(@RequestBody IssueProjectCategoryDictListFormDTO formDTO); Result<List<IssueProjectCategoryDictDTO>> getCategoryList(@RequestBody IssueProjectCategoryDictListFormDTO formDTO);
/**
* 获取项目分类名
* @Param customerId
* @Return {@link Result< Map< String, String>>}
* @Author zhaoqifeng
* @Date 2022/1/5 10:16
*/
@PostMapping("/gov/issue/issueprojectcategorydict/categoryMap/{customerId}")
Result<Map<String, String>> getCategoryMap(@PathVariable("customerId") String customerId);
} }

14
epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/fallback/GovIssueOpenFeignClientFallBack.java

@ -305,4 +305,18 @@ public class GovIssueOpenFeignClientFallBack implements GovIssueOpenFeignClient
public Result<List<IssueProjectCategoryDictDTO>> getCategoryList(IssueProjectCategoryDictListFormDTO formDTO) { public Result<List<IssueProjectCategoryDictDTO>> getCategoryList(IssueProjectCategoryDictListFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ISSUE_SERVER, "getCategoryList", formDTO); return ModuleUtils.feignConError(ServiceConstant.GOV_ISSUE_SERVER, "getCategoryList", formDTO);
} }
/**
* 获取项目分类名
*
* @param customerId
* @Param customerId
* @Return {@link Result< Map< String, String>>}
* @Author zhaoqifeng
* @Date 2022/1/5 10:16
*/
@Override
public Result<Map<String, String>> getCategoryMap(String customerId) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ISSUE_SERVER, "getCategoryMap", customerId);
}
} }

13
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueProjectCategoryDictController.java

@ -33,7 +33,6 @@ import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.dto.IssueProjectCategoryDictDTO; import com.epmet.dto.IssueProjectCategoryDictDTO;
import com.epmet.dto.form.*; import com.epmet.dto.form.*;
import com.epmet.dto.result.*; import com.epmet.dto.result.*;
import com.epmet.entity.IssueProjectCategoryDictEntity;
import com.epmet.excel.IssueProjectCategoryDictExcel; import com.epmet.excel.IssueProjectCategoryDictExcel;
import com.epmet.project.dto.CustomerCategoryDTO; import com.epmet.project.dto.CustomerCategoryDTO;
import com.epmet.project.dto.result.ProjectCategoryDictResultDTO; import com.epmet.project.dto.result.ProjectCategoryDictResultDTO;
@ -288,5 +287,17 @@ public class IssueProjectCategoryDictController {
return new Result<List<CategoryListResultDTO>>().ok(issueProjectCategoryDictService.selectCategoryOneLevelListByCustomerId(tokenDto.getCustomerId())); return new Result<List<CategoryListResultDTO>>().ok(issueProjectCategoryDictService.selectCategoryOneLevelListByCustomerId(tokenDto.getCustomerId()));
} }
/**
* 获取项目分类名
* @Param customerId
* @Return {@link Result< Map< String, String>>}
* @Author zhaoqifeng
* @Date 2022/1/5 10:16
*/
@PostMapping("categoryMap/{customerId}")
public Result<Map<String, String>> getCategoryMap(@PathVariable("customerId") String customerId) {
return new Result<Map<String, String>>().ok(issueProjectCategoryDictService.getCategoryMap(customerId));
}
} }

9
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueProjectCategoryDictDao.java

@ -192,4 +192,13 @@ public interface IssueProjectCategoryDictDao extends BaseDao<IssueProjectCategor
*/ */
List<CategoryListResultDTO> selectCategoryOneLevelListByCustomerId(@Param("customerId")String customerId); List<CategoryListResultDTO> selectCategoryOneLevelListByCustomerId(@Param("customerId")String customerId);
/**
* @Description 获取客户下分类
* @Param customerId
* @Return {@link List< IssueProjectCategoryDictDTO>}
* @Author zhaoqifeng
* @Date 2022/1/5 10:45
*/
List<IssueProjectCategoryDictDTO> getCategoryByCustomer(@Param("customerId") String customerId);
} }

3
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueProjectCategoryDictService.java

@ -25,7 +25,6 @@ import com.epmet.dto.form.*;
import com.epmet.dto.result.*; import com.epmet.dto.result.*;
import com.epmet.entity.IssueProjectCategoryDictEntity; import com.epmet.entity.IssueProjectCategoryDictEntity;
import com.epmet.project.dto.result.ProjectCategoryDictResultDTO; import com.epmet.project.dto.result.ProjectCategoryDictResultDTO;
import org.springframework.web.bind.annotation.RequestBody;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -230,4 +229,6 @@ public interface IssueProjectCategoryDictService extends BaseService<IssueProjec
*/ */
List<CategoryListResultDTO> selectCategoryOneLevelListByCustomerId(String customerId); List<CategoryListResultDTO> selectCategoryOneLevelListByCustomerId(String customerId);
Map<String, String> getCategoryMap(String customerId);
} }

15
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueProjectCategoryDictServiceImpl.java

@ -22,6 +22,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.constant.FieldConstant;
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.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.EpmetErrorCode;
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.page.PageData;
@ -507,6 +508,20 @@ public class IssueProjectCategoryDictServiceImpl extends BaseServiceImpl<IssuePr
return baseDao.selectCategoryOneLevelListByCustomerId(customerId); return baseDao.selectCategoryOneLevelListByCustomerId(customerId);
} }
@Override
public Map<String, String> getCategoryMap(String customerId) {
List<IssueProjectCategoryDictDTO> list = baseDao.getCategoryByCustomer(customerId);
if (CollectionUtils.isEmpty(list)) {
return Collections.emptyMap();
}
list.forEach(item -> {
if(StringUtils.isNotBlank(item.getParentCategoryName())) {
item.setCategoryName(item.getParentCategoryName().concat(StrConstant.HYPHEN).concat(item.getCategoryName()));
}
});
return list.stream().collect(Collectors.toMap(IssueProjectCategoryDictDTO::getCategoryCode, IssueProjectCategoryDictDTO::getCategoryName));
}
/** /**
* @Description 项目分类处理 * @Description 项目分类处理
* @Param list * @Param list

18
epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueProjectCategoryDictDao.xml

@ -41,7 +41,7 @@
ORDER BY sort ASC ORDER BY sort ASC
</select> </select>
<!-- sql递归 查询客户议题项目的分类信息以及递归查询二级分类信息 end--> <!-- sql递归 查询客户议题项目的分类信息以及递归查询二级分类信息 end-->
<select id="selectCategoryListByCustomer" resultType="com.epmet.entity.IssueProjectCategoryDictEntity"> <select id="selectCategoryListByCustomer" resultType="com.epmet.dto.IssueProjectCategoryDictDTO">
SELECT SELECT
ID, ID,
PID, PID,
@ -292,4 +292,20 @@
WHERE WHERE
customer_id = #{customerId} AND id = #{id} AND DEL_FLAG = '0' customer_id = #{customerId} AND id = #{id} AND DEL_FLAG = '0'
</update> </update>
<select id="getCategoryByCustomer" resultType="com.epmet.dto.IssueProjectCategoryDictDTO">
SELECT
a.CATEGORY_CODE,
a.CATEGORY_NAME,
b.CATEGORY_NAME AS parentCategoryName
FROM
issue_project_category_dict a
LEFT JOIN issue_project_category_dict b ON a.PARENT_CATEGORY_CODE = b.CATEGORY_CODE
AND b.DEL_FLAG = '0'
AND b.CUSTOMER_ID = #{customerId}
WHERE
a.DEL_FLAG = '0'
AND a.CUSTOMER_ID = #{customerId}
ORDER BY a.CATEGORY_CODE
</select>
</mapper> </mapper>

27
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ApprovaledListFromDTO.java

@ -0,0 +1,27 @@
package com.epmet.dto.form;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @Description
* @Author zhaoqifeng
* @Date 2022/1/4 14:49
*/
@NoArgsConstructor
@Data
public class ApprovaledListFromDTO implements Serializable {
private static final long serialVersionUID = 5700160700676332579L;
private String customerId;
@NotBlank(message = "组织id不能为空")
private String agencyId;
private String startTime;
private String endTime;
private String staffId;
private Integer pageSize = 1;
private Integer pageNo = 20;
}

28
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ApprovaledListResultDTO.java

@ -0,0 +1,28 @@
package com.epmet.dto.result;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* @Description
* @Author zhaoqifeng
* @Date 2022/1/4 14:58
*/
@NoArgsConstructor
@Data
public class ApprovaledListResultDTO implements Serializable {
private static final long serialVersionUID = 5118030421632653558L;
private String projectId;
private String title;
private String projectCategory;
private String locateAddress;
private String happenTime;
private String staffId;
private String staffName;
private String gridId;
private String gridName;
private String createdTime;
}

17
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectTraceController.java

@ -3,6 +3,7 @@ package com.epmet.controller;
import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.annotation.RequirePermission; import com.epmet.commons.tools.annotation.RequirePermission;
import com.epmet.commons.tools.enums.RequirePermissionEnum; import com.epmet.commons.tools.enums.RequirePermissionEnum;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.commons.tools.validator.ValidatorUtils;
@ -380,5 +381,21 @@ public class ProjectTraceController {
ValidatorUtils.validateEntity(formDTO,EventToProjectFormDTO.ApprovalCategory.class,EventToProjectFormDTO.AddUserInternalGroup.class); ValidatorUtils.validateEntity(formDTO,EventToProjectFormDTO.ApprovalCategory.class,EventToProjectFormDTO.AddUserInternalGroup.class);
return new Result<EventToProjectResultDTO>().ok(projectTraceService.eventToProject(formDTO)); return new Result<EventToProjectResultDTO>().ok(projectTraceService.eventToProject(formDTO));
} }
/**
* 网格员工作统计项目列表
*
* @Param formDTO
* @Return {@link Result< PageData< ApprovaledListResultDTO>>}
* @Author zhaoqifeng
* @Date 2022/1/4 15:32
*/
@PostMapping("approvaled-list")
public Result<PageData<ApprovaledListResultDTO>> approvaledList(@LoginUser TokenDto tokenDto, @RequestBody ApprovaledListFromDTO formDTO) {
ValidatorUtils.validateEntity(formDTO);
formDTO.setCustomerId(tokenDto.getCustomerId());
PageData<ApprovaledListResultDTO> result = projectTraceService.approvaledList(formDTO);
return new Result<PageData<ApprovaledListResultDTO>>().ok(result);
}
} }

11
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectDao.java

@ -267,4 +267,15 @@ public interface ProjectDao extends BaseDao<ProjectEntity> {
*/ */
List<ProjectDistributionAnalysisRightDTO> selectProjectCountByOrg(List<SonOrgResultDTO> orgIds,@Param("startDate")String startDate,@Param("endDate")String endDate); List<ProjectDistributionAnalysisRightDTO> selectProjectCountByOrg(List<SonOrgResultDTO> orgIds,@Param("startDate")String startDate,@Param("endDate")String endDate);
/**
* 网格员立项
* @Param agencyId
* @Param staffId
* @Param startTime
* @Param endTime
* @Return {@link List< ApprovaledListResultDTO>}
* @Author zhaoqifeng
* @Date 2022/1/4 16:45
*/
List<ApprovaledListResultDTO> getGridMemberProjectList(@Param("agencyId") String agencyId, @Param("staffId") String staffId, @Param("startTime") String startTime, @Param("endTime") String endTime);
} }

10
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectCategoryService.java

@ -28,6 +28,7 @@ import com.epmet.entity.ProjectCategoryEntity;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Set;
/** /**
* 项目所属分类表 * 项目所属分类表
@ -126,4 +127,13 @@ public interface ProjectCategoryService extends BaseService<ProjectCategoryEntit
* @return * @return
*/ */
List<ProjectCategoryDTO> getProjectCategoryService(String projectId); List<ProjectCategoryDTO> getProjectCategoryService(String projectId);
/**
* @Description 获取项目分类列表
* @Param projectIds
* @Return {@link Map< String, Set< String>>}
* @Author zhaoqifeng
* @Date 2022/1/5 9:50
*/
Map<String, Set<String>> getProjectCategoryMap(List<String> projectIds);
} }

10
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectService.java

@ -357,4 +357,14 @@ public interface ProjectService extends BaseService<ProjectEntity> {
* @return * @return
*/ */
TopicResearchAnalysisResDTO topicResearchAnalysis(TopicResearchAnalysisFormDTO formDTO); TopicResearchAnalysisResDTO topicResearchAnalysis(TopicResearchAnalysisFormDTO formDTO);
/**
* 网格员工作统计项目列表
*
* @Param formDTO
* @Return {@link PageData< ApprovaledListResultDTO>}
* @Author zhaoqifeng
* @Date 2022/1/4 16:27
*/
PageData<ApprovaledListResultDTO> approvaledList(ApprovaledListFromDTO formDTO);
} }

11
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectTraceService.java

@ -1,5 +1,6 @@
package com.epmet.service; package com.epmet.service;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.dto.form.*; import com.epmet.dto.form.*;
import com.epmet.dto.result.*; import com.epmet.dto.result.*;
@ -183,4 +184,14 @@ public interface ProjectTraceService {
* @date 2021/8/5 15:38 * @date 2021/8/5 15:38
*/ */
EventToProjectResultDTO eventToProject(EventToProjectFormDTO formDTO); EventToProjectResultDTO eventToProject(EventToProjectFormDTO formDTO);
/**
* 网格员工作统计项目列表
*
* @Param formDTO
* @Return {@link PageData< ApprovaledListResultDTO>}
* @Author zhaoqifeng
* @Date 2022/1/4 15:33
*/
PageData<ApprovaledListResultDTO> approvaledList(ApprovaledListFromDTO formDTO);
} }

27
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectCategoryServiceImpl.java

@ -17,6 +17,7 @@
package com.epmet.service.impl; package com.epmet.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
@ -39,15 +40,14 @@ import com.epmet.entity.ProjectEntity;
import com.epmet.feign.GovIssueOpenFeignClient; import com.epmet.feign.GovIssueOpenFeignClient;
import com.epmet.redis.ProjectCategoryRedis; import com.epmet.redis.ProjectCategoryRedis;
import com.epmet.service.ProjectCategoryService; import com.epmet.service.ProjectCategoryService;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList; import java.util.*;
import java.util.Arrays; import java.util.stream.Collectors;
import java.util.List;
import java.util.Map;
/** /**
* 项目所属分类表 * 项目所属分类表
@ -225,4 +225,23 @@ public class ProjectCategoryServiceImpl extends BaseServiceImpl<ProjectCategoryD
return baseDao.selectListByProjectId(projectId); return baseDao.selectListByProjectId(projectId);
} }
/**
* @param projectIds
* @Description 获取项目分类列表
* @Param projectIds
* @Return {@link Map< String, Set < String>>}
* @Author zhaoqifeng
* @Date 2022/1/5 9:50
*/
@Override
public Map<String, Set<String>> getProjectCategoryMap(List<String> projectIds) {
LambdaQueryWrapper<ProjectCategoryEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.in(ProjectCategoryEntity::getProjectId, projectIds);
List<ProjectCategoryEntity> list = baseDao.selectList(wrapper);
if (CollectionUtils.isEmpty(list)) {
return Collections.emptyMap();
}
return list.stream().collect(Collectors.groupingBy(ProjectCategoryEntity::getProjectId, Collectors.mapping(ProjectCategoryEntity::getCategoryCode, Collectors.toSet())));
}
} }

18
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java

@ -3045,6 +3045,24 @@ public class ProjectServiceImpl extends BaseServiceImpl<ProjectDao, ProjectEntit
return resultDTO; return resultDTO;
} }
/**
* 网格员工作统计项目列表
*
* @param formDTO
* @Param formDTO
* @Return {@link PageData< ApprovaledListResultDTO>}
* @Author zhaoqifeng
* @Date 2022/1/4 16:27
*/
@Override
public PageData<ApprovaledListResultDTO> approvaledList(ApprovaledListFromDTO formDTO) {
PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize());
List<ApprovaledListResultDTO> list = baseDao.getGridMemberProjectList(formDTO.getAgencyId(), formDTO.getStaffId(),
formDTO.getStartTime(), formDTO.getEndTime());
PageInfo<ApprovaledListResultDTO> pageInfo = new PageInfo<>(list);
return new PageData<>(list, pageInfo.getTotal());
}
/** /**
* @Description 区间项目分类数量处理 * @Description 区间项目分类数量处理
* 查询的是时间段内的分类项目数查询的时间 是传入一个日期拼上时间在进行比较大小 * 查询的是时间段内的分类项目数查询的时间 是传入一个日期拼上时间在进行比较大小

52
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectTraceServiceImpl.java

@ -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);

25
epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectDao.xml

@ -483,4 +483,29 @@
AND DATE_FORMAT(CREATED_TIME,'%Y-%m-%d') <![CDATA[ <= ]]> #{endDate} AND DATE_FORMAT(CREATED_TIME,'%Y-%m-%d') <![CDATA[ <= ]]> #{endDate}
</foreach> </foreach>
</select> </select>
<select id="getGridMemberProjectList" resultType="com.epmet.dto.result.ApprovaledListResultDTO">
SELECT
ID AS "projectId",
TITLE,
LOCATE_ADDRESS,
DATE_FORMAT( CREATED_TIME, '%Y-%m-%d' ) AS "happenTime",
CREATED_BY AS "staffId",
DATE_FORMAT( CREATED_TIME, '%Y-%m-%d %H:%i:%s' ) AS "createdTime"
FROM
project
WHERE
DEL_FLAG = '0'
AND ORIGIN = 'agency'
AND AGENCY_ID = #{agencyId}
<if test="staffId != null and staffId != ''">
AND CREATED_BY = #{staffId}
</if>
<if test="startTime != null and startTime != ''">
AND DATE_FORMAT( CREATED_TIME, '%Y-%m-%d' ) &gt;= #{startTime}
</if>
<if test="endTime != null and endTime != ''">
AND DATE_FORMAT( CREATED_TIME, '%Y-%m-%d' ) &lt;= #{endTime}
</if>
ORDER BY CREATED_TIME DESC
</select>
</mapper> </mapper>
Loading…
Cancel
Save