|
|
@@ -4,15 +4,16 @@ import cn.hutool.core.collection.CollUtil; |
|
|
|
import cn.hutool.http.HttpStatus; |
|
|
|
import com.alibaba.fastjson.JSON; |
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|
|
|
import com.google.common.collect.Lists; |
|
|
|
import com.ningdatech.pmapi.common.constant.ProjectDeclareConst; |
|
|
|
import com.ningdatech.pmapi.common.constant.RegionConst; |
|
|
|
import com.ningdatech.pmapi.common.statemachine.util.StateMachineUtils; |
|
|
|
import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum; |
|
|
|
import com.ningdatech.pmapi.projectlib.model.entity.Project; |
|
|
|
import com.ningdatech.pmapi.projectlib.service.IProjectService; |
|
|
|
import com.ningdatech.pmapi.provincial.enumeration.ProjectProvincialAuditStatusEnum; |
|
|
|
import com.ningdatech.pmapi.provincial.model.res.ProvincialProjectRes; |
|
|
|
import com.ningdatech.pmapi.provincial.model.res.SjApiResponse; |
|
|
|
import com.ningdatech.pmapi.provincial.service.IJoinReviewProvincialBureauService; |
|
|
|
import com.ningdatech.pmapi.scheduler.contants.TaskContant; |
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
@@ -51,8 +52,11 @@ public class CheckProvincialReviewResultTask { |
|
|
|
//1. 定时取 省级部门联审中的项目 去取项目 |
|
|
|
List<Project> projectList = projectService.list(Wrappers.lambdaQuery(Project.class) |
|
|
|
.eq(Project::getStage, ProjectStatusEnum.NOT_APPROVED.getCode()) |
|
|
|
.eq(Project::getStatus, ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS.getCode()) |
|
|
|
.orderByAsc(Project::getCreateOn)); |
|
|
|
.in(Project::getStatus, Lists.newArrayList(ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS.getCode(), |
|
|
|
ProjectStatusEnum.PENDING_PREQUALIFICATION.getCode(),ProjectStatusEnum.PRE_APPLYING.getCode())) |
|
|
|
.ge(Project::getDeclareAmount, ProjectDeclareConst.Number.DECLARE_AMOUNT_JUDGEMENT) |
|
|
|
.eq(Project::getAreaCode, RegionConst.RC_LS) |
|
|
|
.orderByAsc(Project::getCreateOn)); |
|
|
|
|
|
|
|
log.info("需要去查询省级联审结果的项目 size:{}",projectList.size()); |
|
|
|
if(CollUtil.isEmpty(projectList)){ |
|
|
@@ -72,51 +76,20 @@ public class CheckProvincialReviewResultTask { |
|
|
|
ProvincialProjectRes projectRes = JSON.parseObject(JSON.toJSONString(apiResponse.getData()), |
|
|
|
ProvincialProjectRes.class); |
|
|
|
|
|
|
|
if(ProjectProvincialAuditStatusEnum.NOT_AUDIT.getCode().equals(projectRes.getProjectStatus())){ |
|
|
|
log.info("此项目 【{}】 还未审核",projectRes.getProjectId()); |
|
|
|
} else if(ProjectProvincialAuditStatusEnum.AUDITING.getCode().equals(projectRes.getProjectStatus())){ |
|
|
|
log.info("此项目 【{}】 还在审核中",projectRes.getProjectId()); |
|
|
|
project.setUpdateOn(LocalDateTime.now()); |
|
|
|
//保存审核结果 |
|
|
|
project.setSjlsResult(CollUtil.isNotEmpty(projectRes.getProcessComment()) |
|
|
|
? JSON.toJSONString(projectRes.getProcessComment()) : StringUtils.EMPTY); |
|
|
|
projectService.updateById(project); |
|
|
|
}else if(ProjectProvincialAuditStatusEnum.SUCCESS.getCode().equals(projectRes.getProjectStatus())){ |
|
|
|
log.info("此项目 【{}】 审核通过",projectRes.getProjectId()); |
|
|
|
stateMachineUtils.pass(project); |
|
|
|
project.setUpdateOn(LocalDateTime.now()); |
|
|
|
//保存审核结果 |
|
|
|
project.setSjlsResult(CollUtil.isNotEmpty(projectRes.getProcessComment()) |
|
|
|
? JSON.toJSONString(projectRes.getProcessComment()) : StringUtils.EMPTY); |
|
|
|
projectService.updateById(project); |
|
|
|
//直接去预审(改成 省级部门联审成功 也可以去申报) |
|
|
|
// prequalificationDeclaredProjectManage.directStartProcess(project,project.getPreStartUserId()); |
|
|
|
}else if(ProjectProvincialAuditStatusEnum.FAIL.getCode().equals(projectRes.getProjectStatus())){ |
|
|
|
log.info("此项目 【{}】 审核不通过",projectRes.getProjectId()); |
|
|
|
stateMachineUtils.reject(project); |
|
|
|
project.setUpdateOn(LocalDateTime.now()); |
|
|
|
//保存审核结果 |
|
|
|
project.setSjlsResult(CollUtil.isNotEmpty(projectRes.getProcessComment()) |
|
|
|
? JSON.toJSONString(projectRes.getProcessComment()) : StringUtils.EMPTY); |
|
|
|
projectService.updateById(project); |
|
|
|
}else if(ProjectProvincialAuditStatusEnum.WITHDRAW.getCode().equals(projectRes.getProjectStatus())){ |
|
|
|
log.info("此项目 【{}】 审核被撤回",projectRes.getProjectId()); |
|
|
|
stateMachineUtils.reject(project); |
|
|
|
project.setUpdateOn(LocalDateTime.now()); |
|
|
|
//保存审核结果 |
|
|
|
project.setSjlsResult(CollUtil.isNotEmpty(projectRes.getProcessComment()) |
|
|
|
? JSON.toJSONString(projectRes.getProcessComment()) : StringUtils.EMPTY); |
|
|
|
projectService.updateById(project); |
|
|
|
}else if(ProjectProvincialAuditStatusEnum.BACK.getCode().equals(projectRes.getProjectStatus())){ |
|
|
|
log.info("此项目 【{}】 审核被退回",projectRes.getProjectId()); |
|
|
|
stateMachineUtils.reject(project); |
|
|
|
if(CollUtil.isNotEmpty(projectRes.getProcessComment())){ |
|
|
|
log.info("此项目 【{}】 返回了审批信息",projectRes.getProjectId()); |
|
|
|
//在省级联审 才调状态机 否则 只改变 联审结果 |
|
|
|
if(ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS.getCode().equals( |
|
|
|
project.getStatus())){ |
|
|
|
stateMachineUtils.pass(project); |
|
|
|
} |
|
|
|
project.setUpdateOn(LocalDateTime.now()); |
|
|
|
//保存审核结果 |
|
|
|
project.setSjlsResult(CollUtil.isNotEmpty(projectRes.getProcessComment()) |
|
|
|
? JSON.toJSONString(projectRes.getProcessComment()) : StringUtils.EMPTY); |
|
|
|
projectService.updateById(project); |
|
|
|
}else{ |
|
|
|
log.info("此项目 【{}】 审核结果错误",projectRes.getProjectId()); |
|
|
|
log.info("此项目 【{}】 还没有审批信息",projectRes.getProjectId()); |
|
|
|
} |
|
|
|
}catch (Exception e){ |
|
|
|
log.error("项目审核信息获取异常 projectId:【" + project.getId() + "】 异常内容:" + e.getMessage()); |
|
|
|