Browse Source

项目问题修改

master
zhaoqifeng 5 years ago
parent
commit
4d1f267cdc
  1. 5
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java
  2. 4
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectProcessServiceImpl.java
  3. 51
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java
  4. 2
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectTraceServiceImpl.java
  5. 8
      epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectDao.xml
  6. 2
      epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectStaffDao.xml

5
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java

@ -43,7 +43,10 @@ public enum EpmetErrorCode {
CANNOT_DISABLE_YOURSELF(8405,"您不能禁用自己"),
ALREADY_EVALUATE(8501,"您已评价"),
ALREADY_VOTE(8502,"您已表态");
ALREADY_VOTE(8502,"您已表态"),
PROJECT_IS_CLOSED(8601,"项目已结案")
;
private int code;
private String msg;

4
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectProcessServiceImpl.java

@ -147,10 +147,10 @@ public class ProjectProcessServiceImpl extends BaseServiceImpl<ProjectProcessDao
//获取项目信息
ProjectEntity projectEntity = projectService.selectById(fromDTO.getProjectId());
//获取组织信息
Result<CustomerAgencyDTO> customerAgency = govOrgFeignClient.getAgencyById(projectEntity.getAgencyId());
// Result<CustomerAgencyDTO> customerAgency = govOrgFeignClient.getAgencyById(projectEntity.getAgencyId());
//获取人员信息
StaffsInAgencyFromDTO staffsInAgencyFromDTO = new StaffsInAgencyFromDTO();
staffsInAgencyFromDTO.setCustomerId(customerAgency.getData().getCustomerId());
staffsInAgencyFromDTO.setCustomerId(projectEntity.getCustomerId());
staffsInAgencyFromDTO.setStaffList(userIds);
List<StaffInfoResultDTO> staffList = epmetUserFeignClient.getStaffList(staffsInAgencyFromDTO).getData();
//合成返回值

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

@ -21,6 +21,8 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.constant.FieldConstant;
@ -181,19 +183,23 @@ public class ProjectServiceImpl extends BaseServiceImpl<ProjectDao, ProjectEntit
created.setProjectStatus(p.getStatus());
created.setPublicReply(p.getPublicReply());
created.setProjectTime(p.getCreatedTime().getTime());
String detentionDays = getDetentionDays(p);
if (!ONE_DAY.equals(detentionDays) && Integer.parseInt(detentionDays) > finalDays) {
created.setWarningFlag(true);
created.setDetentionDays(detentionDays);
} else {
created.setDetentionDays(detentionDays);
created.setWarningFlag(false);
}
//获取当前处理部门
List<String> departmentNameList = new ArrayList<>();
if (ProjectConstant.CLOSED.equals(p.getStatus())) {
created.setDepartmentNameList(departmentNameList);
created.setWarningFlag(false);
created.setDetentionDays("0");
} else {
String detentionDays = getDetentionDays(p);
if (!ONE_DAY.equals(detentionDays) && Integer.parseInt(detentionDays) > finalDays) {
created.setWarningFlag(true);
created.setDetentionDays(detentionDays);
} else {
created.setDetentionDays(detentionDays);
created.setWarningFlag(false);
}
departmentNameList = baseDao.selectDepartmentNameList(p);
created.setDepartmentNameList(departmentNameList);
}
@ -220,19 +226,23 @@ public class ProjectServiceImpl extends BaseServiceImpl<ProjectDao, ProjectEntit
involved.setProjectStatus(p.getStatus());
involved.setPublicReply(p.getPublicReply());
involved.setProjectTime(p.getCreatedTime().getTime());
String detentionDays = getDetentionDays(p);
if (!ONE_DAY.equals(detentionDays) && Integer.parseInt(detentionDays) > finalDays) {
involved.setWarningFlag(true);
involved.setDetentionDays(detentionDays);
} else {
involved.setDetentionDays(detentionDays);
involved.setWarningFlag(false);
}
//获取当前处理部门
List<String> departmentNameList = new ArrayList<>();
if (ProjectConstant.CLOSED.equals(p.getStatus())) {
involved.setDepartmentNameList(departmentNameList);
involved.setWarningFlag(false);
involved.setDetentionDays("0");
} else {
String detentionDays = getDetentionDays(p);
if (!ONE_DAY.equals(detentionDays) && Integer.parseInt(detentionDays) > finalDays) {
involved.setWarningFlag(true);
involved.setDetentionDays(detentionDays);
} else {
involved.setDetentionDays(detentionDays);
involved.setWarningFlag(false);
}
departmentNameList = baseDao.selectDepartmentNameList(p);
involved.setDepartmentNameList(departmentNameList);
}
@ -280,6 +290,9 @@ public class ProjectServiceImpl extends BaseServiceImpl<ProjectDao, ProjectEntit
public void closed(ProjectClosedFromDTO fromDTO) {
//更新项目表状态
ProjectEntity projectEntity = baseDao.selectById(fromDTO.getProjectId());
if (ProjectConstant.CLOSED.equals(projectEntity.getStatus())) {
throw new RenException(EpmetErrorCode.PROJECT_IS_CLOSED.getCode());
}
projectEntity.setStatus(ProjectConstant.CLOSED);
projectEntity.setClosedStatus(fromDTO.getClosedStatus());
baseDao.updateById(projectEntity);
@ -307,6 +320,11 @@ public class ProjectServiceImpl extends BaseServiceImpl<ProjectDao, ProjectEntit
@Override
@Transactional(rollbackFor = Exception.class)
public void projectReturn(ReturnFromDTO fromDTO) {
ProjectEntity projectEntity = baseDao.selectById(fromDTO.getProjectId());
if (ProjectConstant.CLOSED.equals(projectEntity.getStatus())) {
throw new RenException(EpmetErrorCode.PROJECT_IS_CLOSED.getCode());
}
//更新项目关联表
ProjectStaffEntity projectStaffEntity = new ProjectStaffEntity();
projectStaffEntity.setId(fromDTO.getProjectStaffId());
@ -328,6 +346,7 @@ public class ProjectServiceImpl extends BaseServiceImpl<ProjectDao, ProjectEntit
ProjectStaffDTO projectStaffDTO = projectStaffService.getProjectStaffInfo(fromDTO.getProjectProcessId());
ProjectStaffEntity projectStaff = ConvertUtils.sourceToTarget(projectStaffDTO, ProjectStaffEntity.class);
projectStaff.setId(null);
projectStaff.setProcessId(projectProcessEntity.getId());
projectStaff.setIsHandle(ProjectConstant.UNHANDLED);
projectStaffService.insert(projectStaff);

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

@ -54,7 +54,7 @@ public class ProjectTraceServiceImpl implements ProjectTraceService {
@Override
public ProjectDetailResultDTO getProjectDetail(TokenDto tokenDto, ProjectDetailFromDTO fromDTO) {
fromDTO.setProjectId(tokenDto.getUserId());
fromDTO.setUserId(tokenDto.getUserId());
return projectService.getProjectDetail(fromDTO);
}

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

@ -61,14 +61,14 @@
AND ps.IS_HANDLE = 'handle'
AND ps.STAFF_ID = #{userId}
GROUP BY ps.PROJECT_ID) psp ON p.ID = psp.PROJECT_ID
INNER JOIN (
LEFT JOIN (
SELECT DISTINCT
PROJECT_ID,
MIN(CREATED_TIME) AS CREATED_TIME
FROM
project_staff
WHERE DEL_FLAG = '0'
AND IS_HANDLE = 'handle'
AND IS_HANDLE = 'unhandled'
GROUP BY PROJECT_ID) ps ON p.ID = ps.PROJECT_ID
LEFT JOIN project_process pp ON p.ID = pp.PROJECT_ID AND pp.OPERATION = 'close'
WHERE
@ -107,14 +107,14 @@
AND ps.IS_HANDLE = 'handle'
AND ps.STAFF_ID = #{userId}
GROUP BY ps.PROJECT_ID) psp ON p.ID = psp.PROJECT_ID
INNER JOIN (
LEFT JOIN (
SELECT DISTINCT
PROJECT_ID,
MIN(CREATED_TIME) AS CREATED_TIME
FROM
project_staff
WHERE DEL_FLAG = '0'
AND IS_HANDLE = 'handle'
AND IS_HANDLE = 'unhandled'
GROUP BY PROJECT_ID) ps ON p.ID = ps.PROJECT_ID
LEFT JOIN project_process pp ON p.ID = pp.PROJECT_ID AND pp.OPERATION = 'close'
WHERE

2
epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectStaffDao.xml

@ -22,7 +22,7 @@
</resultMap>
<select id="selectDepartmentNameList" resultType="com.epmet.dto.result.DepartmentResultDTO" parameterType="com.epmet.dto.ProjectStaffDTO">
SELECT
ID,
ID AS projectStaffId,
DEPARTMENT_NAME
FROM
project_staff

Loading…
Cancel
Save