瀏覽代碼

Merge remote-tracking branch 'origin/master'

tags/24080901
CMM 1 年之前
父節點
當前提交
1dcdbc3b71
共有 9 個文件被更改,包括 41 次插入76 次删除
  1. +2
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/expert/controller/ReviewTemplateSettingsController.java
  2. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/meeting/manage/MeetingManage.java
  3. +5
    -5
      pmapi/src/main/java/com/ningdatech/pmapi/meeting/mapper/MeetingExpertMapper.xml
  4. +17
    -11
      pmapi/src/main/java/com/ningdatech/pmapi/meeting/task/ExpertInviteTask.java
  5. +2
    -6
      pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/ReviewByDeptJointManage.java
  6. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/scheduler/task/ProjectStatusFlowTask.java
  7. +0
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/staging/service/impl/NdWorkNoticeStagingServiceImpl.java
  8. +0
    -44
      pmapi/src/main/java/com/ningdatech/pmapi/staging/utils/WorkNoticeFlowMapUtil.java
  9. +13
    -5
      pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java

+ 2
- 2
pmapi/src/main/java/com/ningdatech/pmapi/expert/controller/ReviewTemplateSettingsController.java 查看文件

@@ -45,14 +45,14 @@ public class ReviewTemplateSettingsController {
}

@GetMapping("/template")
@ApiModelProperty("根据模版ID获取评审模版")
@ApiOperation("根据模版ID获取评审模版")
@ApiImplicitParam(name = "templateId", defaultValue = "模版ID")
public ReviewTemplateVO getTemplateById(@RequestParam Long templateId) {
return reviewTemplateSettingsManage.getReviewTemplateSettings(templateId);
}

@GetMapping("/templates")
@ApiModelProperty("(批量)根据模版ID获取评审模版")
@ApiOperation("(批量)根据模版ID获取评审模版")
@ApiImplicitParam(name = "templateIds", defaultValue = "模版ID集合")
public List<ReviewTemplateVO> getTemplateById(@RequestParam List<Long> templateIds) {
return reviewTemplateSettingsManage.listReviewTemplateSettings(templateIds);


+ 1
- 1
pmapi/src/main/java/com/ningdatech/pmapi/meeting/manage/MeetingManage.java 查看文件

@@ -209,7 +209,7 @@ public class MeetingManage {
Assert.isTrue(checkCount >= inviteCount, "可供抽取的专家数量不足");
}
expertInviteManage.expertInviteByMeetingCreate(meeting, randomRules, avoidInfo);
expertInviteTask.addInviteExpertTaskByMeetingCreate(meeting.getId(), 5);
expertInviteTask.addInviteTaskByMeetingCreate(meeting.getId(), 5);
LambdaUpdateWrapper<Meeting> update = Wrappers.lambdaUpdate(Meeting.class);
update.set(Meeting::getInviteStatus, false);
update.eq(Meeting::getId, meeting.getId());


+ 5
- 5
pmapi/src/main/java/com/ningdatech/pmapi/meeting/mapper/MeetingExpertMapper.xml 查看文件

@@ -74,22 +74,22 @@

<sql id="reviewedByHeadman">
<if test="p.reviewed">
and exists(select 1 from nd_expert_review ner where ner.project_id = np.id and ner.create_by =
exists(select 1 from nd_expert_review ner where ner.project_id = np.id and ner.create_by =
me.expert_id and is_final = true)
</if>
<if test="!p.reviewed">
and not exists(select 1 from nd_expert_review ner where ner.project_id = np.id and ner.create_by =
not exists(select 1 from nd_expert_review ner where ner.project_id = np.id and ner.create_by =
me.expert_id and is_final = true)
</if>
</sql>

<sql id="reviewedByNotHeadman">
<if test="p.reviewed">
and exists(select 1 from nd_expert_review ner where ner.project_id = np.id and ner.create_by =
exists(select 1 from nd_expert_review ner where ner.project_id = np.id and ner.create_by =
me.expert_id)
</if>
<if test="!p.reviewed">
and not exists(select 1 from nd_expert_review ner where ner.project_id = np.id and ner.create_by =
not exists(select 1 from nd_expert_review ner where ner.project_id = np.id and ner.create_by =
me.expert_id)
</if>
</sql>
@@ -104,7 +104,7 @@
inner join meeting_expert me on m.id = me.meeting_id
where m.is_inner_project = true
<if test="p.reviewed != null">
if(me.is_headman,<include refid="reviewedByHeadman"/>,<include refid="reviewedByNotHeadman"/>)
and if(me.is_headman,<include refid="reviewedByHeadman"/>,<include refid="reviewedByNotHeadman"/>)
</if>
and me.expert_id = #{p.userId}
<if test="p.projectName != null and p.projectName.length > 0">


+ 17
- 11
pmapi/src/main/java/com/ningdatech/pmapi/meeting/task/ExpertInviteTask.java 查看文件

@@ -78,9 +78,9 @@ public class ExpertInviteTask {
private final YxtCallOrSmsHelper yxtCallOrSmsHelper;

/**
* 用来存入线程执行情况, 方便于停止定时任务时使用
* 用来存入线程执行句柄, 停止定时任务时使用
*/
protected static final ConcurrentMap<Long, ScheduledFuture<?>> INVITE_MAP = new ConcurrentHashMap<>();
private static final ConcurrentMap<Long, ScheduledFuture<?>> INVITE_TASK_MAP = new ConcurrentHashMap<>();

public ExpertInviteTask currProxy() {
return (ExpertInviteTask) AopContext.currentProxy();
@@ -109,7 +109,7 @@ public class ExpertInviteTask {
return;
}
for (InviteCacheDTO cache : caches.values()) {
addInviteExpertTask(cache.getMeetingId(), true, properties.getInviteDelay(), cache.getInvitedRefused());
addInviteTask(cache.getMeetingId(), true, properties.getInviteDelay(), cache.getInvitedRefused());
}
}

@@ -155,8 +155,8 @@ public class ExpertInviteTask {
if (ArrayUtil.isNotEmpty(invitedRefused)) {
tmpInvitedRefused = invitedRefused[0];
}
if (!INVITE_MAP.containsKey(meetingId)) {
addInviteExpertTask(meetingId, false, properties.getInviteDelay(), tmpInvitedRefused);
if (!INVITE_TASK_MAP.containsKey(meetingId)) {
addInviteTask(meetingId, false, properties.getInviteDelay(), tmpInvitedRefused);
log.info("重置会议的随机抽取状态:{}", meetingId);
LambdaUpdateWrapper<Meeting> update = Wrappers.lambdaUpdate(Meeting.class);
update.set(Meeting::getInviteStatus, false);
@@ -176,7 +176,7 @@ public class ExpertInviteTask {
* @param invitedRefused 是否可以邀请被拒绝的专家
* @author WendyYang
**/
public void addInviteExpertTask(Long meetingId, boolean checked, int delayedMinutes, boolean invitedRefused) {
public void addInviteTask(Long meetingId, boolean checked, int delayedMinutes, boolean invitedRefused) {
if (checked && !inviteCountCheck(meetingId)) {
// 如果抽取数量满足直接返回
return;
@@ -190,7 +190,7 @@ public class ExpertInviteTask {
log.error("执行专家邀请任务异常:{}", meetingId, e);
}
}, startTime, Duration.ofMinutes(properties.getInviteFixedRate()));
INVITE_MAP.putIfAbsent(meetingId, future);
INVITE_TASK_MAP.putIfAbsent(meetingId, future);
log.info("添加专家抽取后台任务:{}", meetingId);
}

@@ -201,13 +201,19 @@ public class ExpertInviteTask {
* @param delayedMinutes 延迟时间
* @author WendyYang
**/
public void addInviteExpertTaskByMeetingCreate(Long meetingId, int delayedMinutes) {
public void addInviteTaskByMeetingCreate(Long meetingId, int delayedMinutes) {
Assert.isTrue(properties.getEnable(), "随机邀请已关闭");
addInviteExpertTask(meetingId, false, delayedMinutes, false);
addInviteTask(meetingId, false, delayedMinutes, false);
InviteCacheDTO cacheVal = InviteCacheDTO.of(meetingId, false);
cachePlusOps.hSet(getCacheKey(meetingId), cacheVal);
}

/**
* 抽取过程
*
* @param meetingId 会议ID
* @param invitedRefused 是否可以邀请已拒绝的专家
*/
@Transactional(rollbackFor = Exception.class)
public void invite(Long meetingId, Boolean invitedRefused) {
log.info("开始进行专家后台抽取:{}", meetingId);
@@ -269,9 +275,9 @@ public class ExpertInviteTask {
log.info("终止专家抽取:{}", meetingId);
meetingService.stopRandomInvite(meetingId);
cachePlusOps.hDel(getCacheKey(meetingId));
ScheduledFuture<?> future = INVITE_MAP.get(meetingId);
ScheduledFuture<?> future = INVITE_TASK_MAP.get(meetingId);
if (future != null) {
INVITE_MAP.remove(meetingId);
INVITE_TASK_MAP.remove(meetingId);
if (!future.isCancelled()) {
future.cancel(true);
}


+ 2
- 6
pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/ReviewByDeptJointManage.java 查看文件

@@ -51,8 +51,6 @@ public class ReviewByDeptJointManage {
private final ProcessInstanceService processService;

private final IProjectInstService projectInstService;

private final UserInfoHelper userInfoHelper;
private final DefaultDeclaredProjectManage declaredProjectManage;
private final DefaultDeclaredProjectManage defaultDeclaredProjectManage;

@@ -63,8 +61,8 @@ public class ReviewByDeptJointManage {
*/
@Transactional(rollbackFor = Exception.class)
public Boolean startTheProcess(Project project) {
Long userId = LoginUserUtil.getUserId();
VUtils.isTrue(Objects.isNull(userId)).throwMessage("获取登录用户失败!");
//这里是任务发起的 所以用项目发起人
Long userId = project.getSponsor();

VUtils.isTrue(Objects.isNull(project.getId())).throwMessage("提交失败 缺少项目ID!");
Project projectInfo = projectService.getById(project.getId());
@@ -122,8 +120,6 @@ public class ReviewByDeptJointManage {
try {
project.setUpdateOn(LocalDateTime.now());
project.setInstCode(instanceId);
project.setStage(ProjectStatusEnum.NOT_APPROVED.getCode());
project.setStatus(ProjectStatusEnum.UNDER_INTERNAL_AUDIT.getCode());
projectService.updateById(project);
//保存项目和实例的关系
ProjectInst projectInst = new ProjectInst();


+ 1
- 1
pmapi/src/main/java/com/ningdatech/pmapi/scheduler/task/ProjectStatusFlowTask.java 查看文件

@@ -82,7 +82,7 @@ public class ProjectStatusFlowTask {
projectStagingService.removeById(projectStaging);
}
}catch (Exception e){
log.error("项目流转 异常 projectId:【" + projectStaging.getProjectId() + "】 异常内容:" + e);
log.error("项目流转 异常 projectId:【" + projectStaging.getProjectId() + "】 异常内容:" + e.getMessage());
}finally {
//增加重试的次数 和下次扫描时间
projectStagingService.addRetryTimes(projectStaging);


+ 0
- 1
pmapi/src/main/java/com/ningdatech/pmapi/staging/service/impl/NdWorkNoticeStagingServiceImpl.java 查看文件

@@ -2,7 +2,6 @@ package com.ningdatech.pmapi.staging.service.impl;

import com.ningdatech.pmapi.staging.contants.StagingContant;
import com.ningdatech.pmapi.staging.enums.MsgTypeEnum;
import com.ningdatech.pmapi.staging.model.entity.ProjectStaging;
import com.ningdatech.pmapi.staging.model.entity.WorkNoticeStaging;
import com.ningdatech.pmapi.staging.mapper.NdWorkNoticeStagingMapper;
import com.ningdatech.pmapi.staging.service.INdWorkNoticeStagingService;


+ 0
- 44
pmapi/src/main/java/com/ningdatech/pmapi/staging/utils/WorkNoticeFlowMapUtil.java 查看文件

@@ -1,23 +1,9 @@
package com.ningdatech.pmapi.staging.utils;

import java.util.List;
import java.util.Map;
import java.util.function.Function;

import javax.annotation.PostConstruct;

import com.ningdatech.pmapi.common.util.SendWorkNoticeUtil;
import com.ningdatech.pmapi.staging.enums.MsgTypeEnum;
import com.ningdatech.pmapi.staging.model.entity.WorkNoticeStaging;
import com.ningdatech.pmapi.todocenter.bean.entity.WorkNoticeInfo;
import org.springframework.stereotype.Component;

import com.google.common.collect.Maps;
import com.ningdatech.pmapi.projectdeclared.manage.ReviewByDeptJointManage;
import com.ningdatech.pmapi.projectdeclared.manage.ReviewByProvincialDeptManage;
import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum;
import com.ningdatech.pmapi.projectlib.model.entity.Project;

import lombok.RequiredArgsConstructor;

/**
@@ -29,41 +15,11 @@ import lombok.RequiredArgsConstructor;
@Component
@RequiredArgsConstructor
public class WorkNoticeFlowMapUtil {
//public Map<Integer, Function<WorkNoticeInfo,Boolean>> workNoticeFlowFunctionMap = Maps.newHashMap();
/**
* key 重试的次数 , value 是增加是描述
*/
public Map<Integer, Integer> intervalTimeMap = Maps.newHashMap();

///**
// * 初始化工作通知分派逻辑,代替了if-else部分
// * key: 枚举 消息类型
// * value: lambda表达式,最终会获取发送工作通知的函数
// */
//@PostConstruct
//public void workNoticeFlowFunctionInit(){
// // 待审核
// workNoticeFlowFunctionMap.put(MsgTypeEnum.AUDIT.getCode(),
// workNoticeInfos-> SendWorkNoticeUtil.sendWorkNotice(workNoticeInfos));
//
// // 审核通过
// workNoticeFlowFunctionMap.put(MsgTypeEnum.PASS.getCode(),
// workNoticeInfos-> SendWorkNoticeUtil.sendWorkNotice(workNoticeInfos));
//
// // 被驳回
// workNoticeFlowFunctionMap.put(MsgTypeEnum.REJECTED.getCode(),
// workNoticeInfos-> SendWorkNoticeUtil.sendWorkNotice(workNoticeInfos));
//
// // 被退回
// workNoticeFlowFunctionMap.put(MsgTypeEnum.BACKED.getCode(),
// workNoticeInfos-> SendWorkNoticeUtil.sendWorkNotice(workNoticeInfos));
//
// // 被驳回
// workNoticeFlowFunctionMap.put(MsgTypeEnum.REJECTED.getCode(),
// workNoticeInfos-> SendWorkNoticeUtil.sendWorkNotice(workNoticeInfos));
//
//}

/**
* 扫描的间隔越来越长 秒数
*/


+ 13
- 5
pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java 查看文件

@@ -32,6 +32,7 @@ import com.ningdatech.pmapi.projectlib.service.IProjectApplicationService;
import com.ningdatech.pmapi.projectlib.service.IProjectService;
import com.ningdatech.pmapi.staging.enums.MsgTypeEnum;
import com.ningdatech.pmapi.staging.service.INdWorkNoticeStagingService;
import com.ningdatech.pmapi.staging.service.IProjectStagingService;
import com.ningdatech.pmapi.todocenter.bean.entity.WorkNoticeInfo;
import com.ningdatech.pmapi.todocenter.model.dto.AdjustHandleDTO;
import com.ningdatech.pmapi.todocenter.model.vo.ProcessProgressDetailVo;
@@ -105,6 +106,8 @@ public class TodoCenterManage {
private final UserInfoHelper userInfoHelper;
private final BuildUserUtils buildUserUtils;

private final IProjectStagingService projectStagingService;


/**
* 待办中心待我处理项目列表查询
@@ -270,15 +273,20 @@ public class TodoCenterManage {
// 并向流程发起人发送浙政钉工作通知:【项目名称】已通过【流程名称】,请及时开始下一步操作。
if (HisProInsEndActId.END.equals(newInstance.getEndActivityId())) {
switch (Objects.requireNonNull(ProjectStatusEnum.getValue(projectStatus))) {
// 当前项目状态是预审中
case PRE_APPLYING:
//先修改项目状态
updatePassProjectStatus(userId, declaredProject);
//然后入库暂存库
projectStagingService.addByProject(declaredProject,"暂存入库 待提交部门联审");
break;
// 当前项目状态是单位内部审核中
case UNDER_INTERNAL_AUDIT:
// 当前项目状态是预审中
case PRE_APPLYING:
// 当前项目状态是部门联审中
// 当前项目状态是部门联审中
case DEPARTMENT_JOINT_REVIEW:
// 当前项目状态是方案评审中
// 当前项目状态是方案评审中
case SCHEME_UNDER_REVIEW:
// 当前项目状态是终验审核中
// 当前项目状态是终验审核中
case FINAL_ACCEPTANCE_IS_UNDER_REVIEW:
updatePassProjectStatus(userId, declaredProject);
break;


Loading…
取消
儲存