Browse Source

查询未结案项目状态

dev
zxc 3 years ago
parent
commit
373ac76d5f
  1. 9
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java
  2. 5
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java
  3. 11
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerStaffGridController.java
  4. 9
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffGridDao.java
  5. 9
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerStaffGridService.java
  6. 11
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffGridServiceImpl.java
  7. 9
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffGridDao.xml
  8. 25
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectAuditResetResultDTO.java
  9. 4
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectController.java
  10. 13
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectDao.java
  11. 2
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectService.java
  12. 36
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java
  13. 26
      epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectDao.xml

9
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java

@ -596,4 +596,13 @@ public interface GovOrgOpenFeignClient {
*/
@GetMapping("/gov/org/icbuildingunit/{id}")
Result<IcBuildingUnitDTO> getUnitById(@PathVariable("id") String id);
/**
* Desc: 查询网格下所有的工作人员
* @param gridId
* @author zxc
* @date 2022/3/21 16:02
*/
@PostMapping("/gov/org/customerstaffgrid/getallstaffbygridid")
Result<List<String>> getAllStaffByGridId(@RequestParam("gridId")String gridId);
}

5
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java

@ -388,4 +388,9 @@ public class GovOrgOpenFeignClientFallback implements GovOrgOpenFeignClient {
public Result<IcBuildingUnitDTO> getUnitById(String id) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getUnitById", id);
}
@Override
public Result<List<String>> getAllStaffByGridId(String gridId) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getAllStaffByGridId", gridId);
}
}

11
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerStaffGridController.java

@ -145,4 +145,15 @@ public class CustomerStaffGridController {
public Result<List<EventTitleOrgResultDTO>> eventOrg(@LoginUser TokenDto tokenDto){
return new Result<List<EventTitleOrgResultDTO>>().ok(customerStaffGridService.eventOrg(tokenDto.getUserId()));
}
/**
* Desc: 查询网格下所有的工作人员
* @param gridId
* @author zxc
* @date 2022/3/21 16:02
*/
@PostMapping("getallstaffbygridid")
public Result<List<String>> getAllStaffByGridId(@RequestParam("gridId")String gridId){
return new Result<List<String>>().ok(customerStaffGridService.getAllStaffByGridId(gridId));
}
}

9
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffGridDao.java

@ -121,4 +121,13 @@ public interface CustomerStaffGridDao extends BaseDao<CustomerStaffGridEntity> {
* @return
*/
List<StaffOrgRelationDTO> getGridStaffList(String gridId);
/**
* Desc: 查询网格下所有的工作人员
* @param gridId
* @author zxc
* @date 2022/3/21 16:02
*/
List<String> getAllStaffByGridId(String gridId);
}

9
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerStaffGridService.java

@ -135,4 +135,13 @@ public interface CustomerStaffGridService extends BaseService<CustomerStaffGridE
* @date 2021/8/5 5:36 下午
*/
List<EventTitleOrgResultDTO> eventOrg(String userId);
/**
* Desc: 查询网格下所有的工作人员
* @param gridId
* @author zxc
* @date 2022/3/21 16:02
*/
List<String> getAllStaffByGridId(String gridId);
}

11
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffGridServiceImpl.java

@ -191,4 +191,15 @@ public class CustomerStaffGridServiceImpl extends BaseServiceImpl<CustomerStaffG
public List<EventTitleOrgResultDTO> eventOrg(String userId) {
return baseDao.eventOrg(userId);
}
/**
* Desc: 查询网格下所有的工作人员
* @param gridId
* @author zxc
* @date 2022/3/21 16:02
*/
@Override
public List<String> getAllStaffByGridId(String gridId) {
return baseDao.getAllStaffByGridId(gridId);
}
}

9
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffGridDao.xml

@ -187,4 +187,13 @@
csg.del_flag = '0'
AND csg.GRID_ID = #{gridId}
</select>
<!-- 查询网格下所有的工作人员 -->
<select id="getAllStaffByGridId" resultType="java.lang.String">
SELECT
USER_ID
FROM customer_staff_grid
WHERE DEL_FLAG = '0'
AND GRID_ID = #{gridId}
</select>
</mapper>

25
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectAuditResetResultDTO.java

@ -0,0 +1,25 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2022/3/21 15:48
* @DESC
*/
@Data
public class ProjectAuditResetResultDTO implements Serializable {
private static final long serialVersionUID = -4523314881244005376L;
private Boolean projectStatus;
private Boolean resiEventStatus;
public ProjectAuditResetResultDTO() {
this.projectStatus = false;
this.resiEventStatus = false;
}
}

4
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectController.java

@ -333,7 +333,7 @@ public class ProjectController {
* @date 2022/3/15 5:05 下午
*/
@PostMapping("audit-reset")
public Result<Boolean> eventAuditReset(@RequestParam("gridId")String gridId){
return new Result<Boolean>().ok(projectService.eventAuditReset(gridId));
public Result<ProjectAuditResetResultDTO> eventAuditReset(@RequestParam("gridId")String gridId){
return new Result<ProjectAuditResetResultDTO>().ok(projectService.eventAuditReset(gridId));
}
}

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

@ -21,10 +21,7 @@ import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.EventProjectInfoDTO;
import com.epmet.dto.ProjectDTO;
import com.epmet.dto.ProjectStaffDTO;
import com.epmet.dto.form.LatestListFormDTO;
import com.epmet.dto.form.PatrolProjectFormDTO;
import com.epmet.dto.form.ProjectListFromDTO;
import com.epmet.dto.form.ShiftProjectsFromDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
import com.epmet.entity.ProjectEntity;
import org.apache.ibatis.annotations.Mapper;
@ -50,6 +47,14 @@ public interface ProjectDao extends BaseDao<ProjectEntity> {
**/
List<ProjectDTO> selectPendList(ProjectListFromDTO fromDTO);
/**
* Desc: 待处理项目列表
* @param userIds
* @author zxc
* @date 2022/3/21 14:12
*/
List<ProjectDTO> selectPendListByUserIds(@Param("userIds")List<String> userIds);
/**
* 我发起的项目列表
*

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

@ -383,6 +383,6 @@ public interface ProjectService extends BaseService<ProjectEntity> {
* @author zxc
* @date 2022/3/15 5:05 下午
*/
Boolean eventAuditReset(String gridId);
ProjectAuditResetResultDTO eventAuditReset(String gridId);
}

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

@ -234,14 +234,28 @@ public class ProjectServiceImpl extends BaseServiceImpl<ProjectDao, ProjectEntit
return list;
}
/**
* Desc: 复制楼上方法略做修改
* @param userIds
* @author zxc
* @date 2022/3/21 15:33
*/
public boolean getPendProjectListByUserIds(List<String> userIds) {
if (CollectionUtils.isNotEmpty(userIds)){
List<ProjectDTO> projectList = baseDao.selectPendListByUserIds(userIds);
if (projectList.size() == 0){
return false;
}else {
return true;
}
}
return false;
}
@Override
public List<CreatedListResultDTO> getCreatedList(ProjectListFromDTO fromDTO) {
List<CreatedListResultDTO> list = new ArrayList<>();
//查询条件
int pageIndex = (fromDTO.getPageNo() - NumConstant.ONE) * fromDTO.getPageSize();
fromDTO.setPageNo(pageIndex);
List<ProjectDTO> projectList = baseDao.selectCreatedList(fromDTO);
//获取客户定制的可滞留天数
Integer finalDays = getDays(fromDTO);
@ -3140,12 +3154,20 @@ public class ProjectServiceImpl extends BaseServiceImpl<ProjectDao, ProjectEntit
* @date 2022/3/15 5:05 下午
*/
@Override
public Boolean eventAuditReset(String gridId) {
public ProjectAuditResetResultDTO eventAuditReset(String gridId) {
ProjectAuditResetResultDTO result = new ProjectAuditResetResultDTO();
Integer processingCount = baseDao.selectEventStatus(gridId);
if (processingCount.compareTo(NumConstant.ZERO) != NumConstant.ZERO){
return true;
result.setResiEventStatus(true);
}
return false;
Result<List<String>> allStaffByGridId = govOrgOpenFeignClient.getAllStaffByGridId(gridId);
if (!allStaffByGridId.success()){
throw new EpmetException("查询网格下的工作人员失败");
}
if (CollectionUtils.isNotEmpty(allStaffByGridId.getData())){
result.setProjectStatus(getPendProjectListByUserIds(allStaffByGridId.getData()));
}
return result;
}
/**

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

@ -41,6 +41,32 @@
ORDER BY psp.created_time, p.created_time ASC<!-- 先按滞留时间降序再按创建时间升序(带奇峰修改) -->
LIMIT #{pageNo}, #{pageSize}
</select>
<!-- 待处理项目列表 -->
<select id="selectPendListByUserIds" resultType="com.epmet.dto.ProjectDTO" parameterType="com.epmet.dto.form.ProjectListUserIdsFromDTO">
SELECT distinct
p.ID,
p.TITLE,
p.CREATED_TIME,
psp.CREATED_TIME AS UPDATED_TIME
FROM project p
INNER JOIN (SELECT
ps.PROJECT_ID,
MAX(ps.CREATED_TIME) AS CREATED_TIME
FROM project_staff ps
WHERE ps.DEL_FLAG = '0'
AND ps.IS_HANDLE = 'unhandled'
AND ps.STAFF_ID IN (
<foreach collection="userIds" item="userId" separator=",">
#{userId}
</foreach>
)
GROUP BY ps.PROJECT_ID) psp ON p.ID = psp.PROJECT_ID
WHERE p.DEL_FLAG = '0'
AND p.status = 'pending'
ORDER BY psp.created_time, p.created_time ASC<!-- 先按滞留时间降序再按创建时间升序 -->
</select>
<select id="selectCreatedList" resultType="com.epmet.dto.ProjectDTO" parameterType="com.epmet.dto.form.ProjectListFromDTO">
SELECT distinct
p.ID,

Loading…
Cancel
Save