ソースを参照

Merge remote-tracking branch 'origin/master'

master
PoffyZhang 1年前
コミット
34471c2ff1
32個のファイルの変更117行の追加184行の削除
  1. +7
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/meeting/controller/MeetingController.java
  2. +7
    -6
      pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/domain/MeetingExpert.java
  3. +3
    -3
      pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/dto/InviteCacheDTO.java
  4. +0
    -3
      pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/enumeration/ExpertAttendStatusEnum.java
  5. +1
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/meeting/helper/MeetingManageHelper.java
  6. +3
    -7
      pmapi/src/main/java/com/ningdatech/pmapi/meeting/manage/DashboardManage.java
  7. +3
    -8
      pmapi/src/main/java/com/ningdatech/pmapi/meeting/manage/ExpertInviteManage.java
  8. +22
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/meeting/manage/MeetingManage.java
  9. +1
    -8
      pmapi/src/main/java/com/ningdatech/pmapi/meeting/mapper/MeetingExpertMapper.xml
  10. +7
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/meeting/service/IMeetingService.java
  11. +1
    -6
      pmapi/src/main/java/com/ningdatech/pmapi/meeting/service/impl/MeetingExpertServiceImpl.java
  12. +1
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/meeting/service/impl/MeetingServiceImpl.java
  13. +16
    -17
      pmapi/src/main/java/com/ningdatech/pmapi/meeting/task/ExpertInviteTask.java
  14. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/ProjectLibController.java
  15. +0
    -52
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/enumeration/StepStatusEnum.java
  16. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/AbstractProcessBusinessHandle.java
  17. +2
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/AnnualPlanHandle.java
  18. +2
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ArchivedHandle.java
  19. +2
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ConstructionPlanReviewHandle.java
  20. +2
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/DeptUnitedReviewHandle.java
  21. +2
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/PreliminaryPreviewHandle.java
  22. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ProcessExecuteChainHandle.java
  23. +2
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ProjectApprovalHandle.java
  24. +2
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ProjectDeclareHandle.java
  25. +2
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ProjectFinalInspectionHandle.java
  26. +2
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ProjectPreliminaryInspectionHandle.java
  27. +2
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/TenderPurchaseHandle.java
  28. +2
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/UnitInnerAuditHandle.java
  29. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java
  30. +0
    -40
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProcessDetailVO.java
  31. +0
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/staging/enums/MsgTypeEnum.java
  32. +19
    -3
      pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java

+ 7
- 0
pmapi/src/main/java/com/ningdatech/pmapi/meeting/controller/MeetingController.java ファイルの表示

@@ -46,6 +46,13 @@ public class MeetingController {
meetingManage.continueInvite(req.getMeetingId());
}

@PostMapping("/convertToAppoint")
@ApiOperation(value = "转为指定抽取")
@WebLog(value = "转为指定抽取")
public void convertToAppoint(@Valid @RequestBody MeetingIdReq req) {
meetingManage.convertToAppoint(req.getMeetingId());
}

@PostMapping("/expertInviteByCreate")
@ApiOperation(value = "新建会议-专家抽取", hidden = true)
@WebLog(value = "新建会议-专家抽取")


+ 7
- 6
pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/domain/MeetingExpert.java ファイルの表示

@@ -1,8 +1,6 @@
package com.ningdatech.pmapi.meeting.entity.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Builder;
@@ -58,15 +56,18 @@ public class MeetingExpert implements Serializable {
@ApiModelProperty("邀请类型")
private Integer inviteType;

private String submitKey;

@TableField(fill = FieldFill.INSERT)
private Long createBy;

@TableField(fill = FieldFill.INSERT)
private LocalDateTime createOn;

@TableField(fill = FieldFill.INSERT_UPDATE)
private Long updateBy;

@TableField(fill = FieldFill.INSERT_UPDATE)
private LocalDateTime updateOn;

private String submitKey;


}

pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/dto/MeetingInviteCacheDTO.java → pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/dto/InviteCacheDTO.java ファイルの表示

@@ -11,14 +11,14 @@ import lombok.Data;
* @since 19:21 2023/3/7
*/
@Data
public final class MeetingInviteCacheDTO {
public final class InviteCacheDTO {

private Long meetingId;

private Boolean invitedRefused;

public static MeetingInviteCacheDTO of(Long meetingId, Boolean invitedRefused) {
MeetingInviteCacheDTO bo = new MeetingInviteCacheDTO();
public static InviteCacheDTO of(Long meetingId, Boolean invitedRefused) {
InviteCacheDTO bo = new InviteCacheDTO();
bo.setMeetingId(meetingId);
bo.setInvitedRefused(invitedRefused);
return bo;

+ 0
- 3
pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/enumeration/ExpertAttendStatusEnum.java ファイルの表示

@@ -19,11 +19,8 @@ public enum ExpertAttendStatusEnum {

NOTICING("通知中", 0),
UNANSWERED("未应答", 1),
REPLACED("已替换", 2),
AGREED("同意参加", 3),
REFUSED("拒绝参加", 4),
REMOVED("已移除", 5),
ON_LEAVE("已请假", 6),
RELEASED("已释放", 7);

private final String value;


+ 1
- 2
pmapi/src/main/java/com/ningdatech/pmapi/meeting/helper/MeetingManageHelper.java ファイルの表示

@@ -196,6 +196,7 @@ public class MeetingManageHelper {
*
* @param meetingId 会议ID
* @param expertIds 专家ID
* @return 符合邀请规则的专家
* @author WendyYang
**/
public List<ExpertUserFullInfo> appointExpertCheck(Long meetingId, List<Long> expertIds) {
@@ -226,8 +227,6 @@ public class MeetingManageHelper {
switch (ExpertAttendStatusEnum.getByCode(w.getStatus())) {
case REFUSED:
throw BizException.wrap("专家%s已拒绝参加", expertName);
case REMOVED:
throw BizException.wrap("专家%s已被移除", expertName);
case AGREED:
throw BizException.wrap("专家%s已同意参加", expertName);
case NOTICING:


+ 3
- 7
pmapi/src/main/java/com/ningdatech/pmapi/meeting/manage/DashboardManage.java ファイルの表示

@@ -12,10 +12,9 @@ import com.ningdatech.pmapi.meeting.entity.domain.Meeting;
import com.ningdatech.pmapi.meeting.entity.domain.MeetingExpert;
import com.ningdatech.pmapi.meeting.entity.dto.CountConfirmByMeetingIdDTO;
import com.ningdatech.pmapi.meeting.entity.dto.MeetingAndAttendStatusDTO;
import com.ningdatech.pmapi.meeting.entity.enumeration.ExpertAttendStatusEnum;
import com.ningdatech.pmapi.meeting.entity.enumeration.ExpertInviteTypeEnum;
import com.ningdatech.pmapi.meeting.entity.enumeration.MeetingStatusEnum;
import com.ningdatech.pmapi.meeting.entity.enumeration.MeetingStatusByDashboard;
import com.ningdatech.pmapi.meeting.entity.enumeration.MeetingStatusEnum;
import com.ningdatech.pmapi.meeting.entity.req.MeetingCalenderReq;
import com.ningdatech.pmapi.meeting.entity.req.MeetingListReq;
import com.ningdatech.pmapi.meeting.entity.vo.*;
@@ -186,8 +185,7 @@ public class DashboardManage {
return PageVo.empty();
}
List<Long> meetingIds = CollUtils.fieldList(meetings, Meeting::getId);
Page<MeetingExpert> page = meetingExpertService.pageExpertByStatusAndMeetingIds(new Page<>(po.getPageNumber(), po.getPageSize()),
meetingIds, ExpertAttendStatusEnum.ON_LEAVE);
Page<MeetingExpert> page = meetingExpertService.pageExpertByStatusAndMeetingIds(po.page(), meetingIds, null);
if (page.getTotal() == 0) {
return PageVo.empty();
}
@@ -224,9 +222,7 @@ public class DashboardManage {
List<MeetingAndAttendStatusDTO> attendStatusList = meetingExpertService.listByExpertIdAndStatus(LoginUserUtil.getUserId(), null, null);
MeetingCountByExpertVO result = MeetingCountByExpertVO.init();
attendStatusList.forEach(w -> {
if (w.getStatus().equals(ExpertAttendStatusEnum.ON_LEAVE.getCode())) {
result.incrLeaved();
} else if (w.getAttended() != null && w.getAttended()) {
if (w.getAttended() != null && w.getAttended()) {
result.incrAttended();
} else {
result.incrToBeAttended();


+ 3
- 8
pmapi/src/main/java/com/ningdatech/pmapi/meeting/manage/ExpertInviteManage.java ファイルの表示

@@ -407,11 +407,6 @@ public class ExpertInviteManage {
removeExpertIds.addAll(tempRefused);
});
}
// 被取消的也不可以被再次抽中
BizUtils.notEmpty(expertGroupByStatus.get(ExpertAttendStatusEnum.REMOVED), w -> {
List<Long> tempCanceled = CollUtils.fieldList(w, MeetingExpert::getExpertId);
removeExpertIds.addAll(tempCanceled);
});
List<Long> tempExpertIds = CollUtils.fieldList(removeExpertByCompany, MeetingExpert::getExpertId);
// 移除确认参加、通知中的、拒绝参加、已取消
userFullInfos.removeIf(w -> tempExpertIds.contains(w.getUserId()) || removeExpertIds.contains(w.getUserId()));
@@ -545,13 +540,13 @@ public class ExpertInviteManage {
if (CollectionUtils.isNotEmpty(randomRules)) {
List<ExpertInviteRule> randoms = new ArrayList<>();
List<ExpertChooseDTO> expertsByRandom = new ArrayList<>();
List<Long> choosedExpertIds = new ArrayList<>();
List<Long> chooseExpertIds = new ArrayList<>();
LocalDateTime startTime = meeting.getStartTime();
LocalDateTime endTime = meeting.getEndTime();
randomRules.forEach(rule -> {
ExpertChooseDTO tempExperts = expertInviteByRandomRule(avoidRuled, rule, choosedExpertIds, startTime, endTime);
ExpertChooseDTO tempExperts = expertInviteByRandomRule(avoidRuled, rule, chooseExpertIds, startTime, endTime);
expertsByRandom.add(tempExperts);
choosedExpertIds.addAll(CollUtils.fieldList(tempExperts.getExperts(), ExpertUserFullInfo::getUserId));
chooseExpertIds.addAll(CollUtils.fieldList(tempExperts.getExperts(), ExpertUserFullInfo::getUserId));
randoms.add(getExpertInviteRule(rule, meeting.getId()));
});
inviteRuleService.saveBatch(randoms);


+ 22
- 0
pmapi/src/main/java/com/ningdatech/pmapi/meeting/manage/MeetingManage.java ファイルの表示

@@ -140,6 +140,7 @@ public class MeetingManage {
}
}

@Transactional(rollbackFor = Exception.class)
public void continueInvite(Long meetingId) {
String key = "CONTINUE_INVITE:" + meetingId;
if (!distributedLock.lock(key, RETRY_TIMES)) {
@@ -157,7 +158,28 @@ public class MeetingManage {
if (!invitedContinue) {
throw BizException.wrap("抽取人员数量已满足抽取规则");
}
expertInviteTask.notifyInviteTask(meetingId);
} finally {
distributedLock.releaseLock(key);
}
}

@Transactional(rollbackFor = Exception.class)
public void convertToAppoint(Long meetingId) {
String key = "CONVERT_TO_APPOINT:" + meetingId;
if (!distributedLock.lock(key, RETRY_TIMES)) {
throw BizException.wrap("已进行转换,请勿重复点击");
}
try {
Meeting meeting = meetingService.getById(meetingId);
if (!MeetingStatusEnum.NORMAL.eq(meeting.getStatus())) {
throw BizException.wrap("转换失败,请刷新后重试");
}
expertInviteTask.cancelByMeetingId(meetingId);
LambdaUpdateWrapper<Meeting> meetingUpdate = Wrappers.lambdaUpdate(Meeting.class)
.set(Meeting::getInviteType, ExpertInviteTypeEnum.APPOINT.getCode())
.eq(Meeting::getId, meetingId);
meetingService.update(meetingUpdate);
} finally {
distributedLock.releaseLock(key);
}


+ 1
- 8
pmapi/src/main/java/com/ningdatech/pmapi/meeting/mapper/MeetingExpertMapper.xml ファイルの表示

@@ -4,7 +4,7 @@

<select id="selectByExpertIdAndStatus"
resultType="com.ningdatech.pmapi.meeting.entity.dto.MeetingAndAttendStatusDTO">
SELECT em.meeting_id meetingId, em.status, mee.is_attended attended
SELECT em.meeting_id meetingId, em.status
FROM (SELECT ROW_NUMBER() OVER ( PARTITION BY meeting_id ORDER BY update_on DESC ) rowNumber, ID, expert_id,
status, meeting_id
FROM meeting_expert
@@ -14,14 +14,7 @@
<foreach collection="meetingIds" open="in (" close=")" item="item">#{item}</foreach>
</if>
) em
left join meeting_expert_evaluation mee on mee.expert_meeting_id = em.id
WHERE rowNumber = 1
<if test="status == 1">
AND em.status = 3 and mee.is_attended is null
</if>
<if test="status == 2">
AND em.status = 3 and mee.is_attended = true
</if>
<if test="status == 3">
AND em.status = 6
</if>


+ 7
- 0
pmapi/src/main/java/com/ningdatech/pmapi/meeting/service/IMeetingService.java ファイルの表示

@@ -23,6 +23,13 @@ public interface IMeetingService extends IService<Meeting> {
**/
void stopRandomInvite(Long meetingId);

/**
* 工作台会议状态统计
*
* @param createBy 创建人
* @return 各状态会议统计
* @author WendyYang
**/
Map<MeetingStatusByDashboard, Integer> meetingCountSummary(Long createBy);

}

+ 1
- 6
pmapi/src/main/java/com/ningdatech/pmapi/meeting/service/impl/MeetingExpertServiceImpl.java ファイルの表示

@@ -59,12 +59,7 @@ public class MeetingExpertServiceImpl extends ServiceImpl<MeetingExpertMapper, M
.build();
w.forEach(item -> {
ExpertAttendStatusEnum attendStatus = ExpertAttendStatusEnum.getByCode(item.getStatus());
if (item.getInviteType().equals(ExpertInviteTypeEnum.APPOINT.getCode())) {
// 被替换和已取消的不计数
if (attendStatus.equals(ExpertAttendStatusEnum.REMOVED)
|| attendStatus.equals(ExpertAttendStatusEnum.REPLACED)) {
return;
}
if (ExpertInviteTypeEnum.APPOINT.eq(item.getInviteType())) {
confirm.setTotal(confirm.getTotal() + 1);
}
// 除通知中的均为已确认


+ 1
- 2
pmapi/src/main/java/com/ningdatech/pmapi/meeting/service/impl/MeetingServiceImpl.java ファイルの表示

@@ -34,8 +34,7 @@ public class MeetingServiceImpl extends ServiceImpl<MeetingMapper, Meeting> impl
@Override
public Map<MeetingStatusByDashboard, Integer> meetingCountSummary(Long createBy) {
List<CountGroupByDTO<String>> meetingCountSummary = baseMapper.meetingCountSummary(createBy);
return CollUtils.listToMap(meetingCountSummary,
w -> MeetingStatusByDashboard.valueOf(w.getGroupKey()),
return CollUtils.listToMap(meetingCountSummary, w -> MeetingStatusByDashboard.valueOf(w.getGroupKey()),
CountGroupByDTO::getTotal);
}



+ 16
- 17
pmapi/src/main/java/com/ningdatech/pmapi/meeting/task/ExpertInviteTask.java ファイルの表示

@@ -12,10 +12,9 @@ import com.ningdatech.pmapi.meeting.entity.domain.Meeting;
import com.ningdatech.pmapi.meeting.entity.domain.MeetingExpert;
import com.ningdatech.pmapi.meeting.entity.dto.AvoidRuleDTO;
import com.ningdatech.pmapi.meeting.entity.dto.ExpertChooseDTO;
import com.ningdatech.pmapi.meeting.entity.dto.MeetingInviteCacheDTO;
import com.ningdatech.pmapi.meeting.entity.dto.InviteCacheDTO;
import com.ningdatech.pmapi.meeting.entity.dto.RandomInviteRuleDTO;
import com.ningdatech.pmapi.meeting.entity.enumeration.ExpertAttendStatusEnum;
import com.ningdatech.pmapi.meeting.helper.ExpertInviteHelper;
import com.ningdatech.pmapi.meeting.helper.YxtCallOrSmsHelper;
import com.ningdatech.pmapi.meeting.manage.ExpertInviteManage;
import com.ningdatech.pmapi.meeting.service.IExpertInviteAvoidRuleService;
@@ -62,15 +61,10 @@ import java.util.stream.Collectors;
@AllArgsConstructor
public class ExpertInviteTask {

private final ExpertInviteHelper expertInviteHelper;
private final RandomInviteProperties properties;
private static final String MEETING_ID_INVITE_RANDOM = "MEETING_ID_INVITE_RANDOM";
private static final CacheHashKey CACHE_KEY = new CacheHashKey();

static {
CACHE_KEY.setKey(MEETING_ID_INVITE_RANDOM);
CACHE_KEY.setExpire(Duration.ofDays(100));
}
private static final Duration EXPIRE_TIME = Duration.ofDays(60);

private final CachePlusOps cachePlusOps;
@Qualifier("expertInviteScheduler")
@@ -92,6 +86,10 @@ public class ExpertInviteTask {
return (ExpertInviteTask) AopContext.currentProxy();
}

private CacheHashKey getCacheKey(Long meetingId) {
return new CacheHashKey(MEETING_ID_INVITE_RANDOM, meetingId, EXPIRE_TIME);
}

@PostConstruct
public void initTask() {
if (!properties.getEnable()) {
@@ -105,12 +103,12 @@ public class ExpertInviteTask {
* 项目重启之后重新初始化邀请任务
*/
private void initInviteTaskAfterAppStarted() {
Map<Long, MeetingInviteCacheDTO> meetingIdMap = cachePlusOps.hGetAll(CACHE_KEY);
if (MapUtils.isEmpty(meetingIdMap)) {
Map<Long, InviteCacheDTO> caches = cachePlusOps.hGetAll(getCacheKey(null));
if (MapUtils.isEmpty(caches)) {
log.info("暂无需要初始化的抽取会议信息");
return;
}
for (MeetingInviteCacheDTO cache : meetingIdMap.values()) {
for (InviteCacheDTO cache : caches.values()) {
addInviteExpertTask(cache.getMeetingId(), true, properties.getInviteDelay(), cache.getInvitedRefused());
}
}
@@ -151,16 +149,16 @@ public class ExpertInviteTask {
* @param meetingId 会议ID
* @author WendyYang
**/
public void addInviteExpertTask(Long meetingId) {
public void notifyInviteTask(Long meetingId) {
if (!INVITE_MAP.containsKey(meetingId)) {
addInviteExpertTask(meetingId, false, properties.getInviteDelay(), false);
addInviteExpertTask(meetingId, false, properties.getInviteDelay(), true);
log.info("重置会议的随机抽取状态:{}", meetingId);
LambdaUpdateWrapper<Meeting> update = Wrappers.lambdaUpdate(Meeting.class);
update.set(Meeting::getInviteStatus, false);
update.set(Meeting::getUpdateBy, LoginUserUtil.getUserId());
update.set(Meeting::getUpdateOn, LocalDateTime.now());
update.eq(Meeting::getId, meetingId);
meetingService.update(update);
InviteCacheDTO cacheVal = InviteCacheDTO.of(meetingId, true);
cachePlusOps.hSet(getCacheKey(meetingId), cacheVal);
}
}

@@ -201,7 +199,8 @@ public class ExpertInviteTask {
public void addInviteExpertTaskByMeetingCreate(Long meetingId, int delayedMinutes) {
Assert.isTrue(properties.getEnable(), "随机邀请已关闭");
addInviteExpertTask(meetingId, false, delayedMinutes, false);
cachePlusOps.sAdd(CACHE_KEY, meetingId);
InviteCacheDTO cacheVal = InviteCacheDTO.of(meetingId, false);
cachePlusOps.hSet(getCacheKey(meetingId), cacheVal);
}

@Transactional(rollbackFor = Exception.class)
@@ -268,7 +267,7 @@ public class ExpertInviteTask {
public void cancelByMeetingId(Long meetingId) {
log.info("终止专家抽取:{}", meetingId);
meetingService.stopRandomInvite(meetingId);
cachePlusOps.sRem(CACHE_KEY, meetingId);
cachePlusOps.hDel(getCacheKey(meetingId));
ScheduledFuture<?> future = INVITE_MAP.get(meetingId);
if (future != null) {
INVITE_MAP.remove(meetingId);


+ 1
- 1
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/ProjectLibController.java ファイルの表示

@@ -3,9 +3,9 @@ package com.ningdatech.pmapi.projectlib.controller;
import com.ningdatech.basic.model.PageVo;
import com.ningdatech.pmapi.projectlib.manage.ProjectLibManage;
import com.ningdatech.pmapi.projectlib.model.req.ProjectListReq;
import com.ningdatech.pmapi.projectlib.model.vo.ProcessDetailVO;
import com.ningdatech.pmapi.projectlib.model.vo.ProjectDetailVO;
import com.ningdatech.pmapi.projectlib.model.vo.ProjectLibListItemVO;
import com.wflow.workflow.bean.vo.ProcessDetailVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;


+ 0
- 52
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/enumeration/StepStatusEnum.java ファイルの表示

@@ -1,52 +0,0 @@
package com.ningdatech.pmapi.projectlib.enumeration;

import com.google.common.collect.Lists;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.StringUtils;

import java.util.ArrayList;
import java.util.List;
import java.util.Objects;

@Getter
@AllArgsConstructor
@NoArgsConstructor
/**
* 环节状态枚举
* @author CMM
* @since 2023/02/24 11:51
*/
public enum StepStatusEnum {
/**
* 环节状态
*/
NOT_START(1, "未开始"),
ON_GOING(2, "进行中"),
REJECTED(3,"被驳回"),
COMPLETED(4,"已完成");

private Integer code;
private String desc;

public static String getDescByCode(Integer code) {
if (Objects.isNull(code)) {
return StringUtils.EMPTY;
}
for (StepStatusEnum t : StepStatusEnum.values()) {
if (code.equals(t.getCode())) {
return t.desc;
}
}
return StringUtils.EMPTY;
}

public boolean eq(String val) {
return this.name().equals(val);
}

public static boolean contains (StepStatusEnum e, List<StepStatusEnum> enums){
return enums.contains(e);
}
}

+ 1
- 1
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/AbstractProcessBusinessHandle.java ファイルの表示

@@ -1,6 +1,6 @@
package com.ningdatech.pmapi.projectlib.handle;

import com.ningdatech.pmapi.projectlib.model.vo.ProcessDetailVO;
import com.wflow.workflow.bean.vo.ProcessDetailVO;

import java.util.List;



+ 2
- 2
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/AnnualPlanHandle.java ファイルの表示

@@ -10,12 +10,12 @@ import com.ningdatech.pmapi.projectlib.model.entity.ProjectStatusChange;
import com.ningdatech.pmapi.projectlib.model.entity.Project;
import com.ningdatech.pmapi.projectlib.service.INdProjectStatusChangeService;
import com.ningdatech.pmapi.projectlib.service.IProjectService;
import com.wflow.workflow.bean.vo.ProcessDetailVO;
import com.wflow.workflow.enums.StepStatusEnum;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

import com.ningdatech.pmapi.common.constant.CommonConst;
import com.ningdatech.pmapi.projectlib.enumeration.StepStatusEnum;
import com.ningdatech.pmapi.projectlib.model.vo.ProcessDetailVO;

import static com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum.*;



+ 2
- 2
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ArchivedHandle.java ファイルの表示

@@ -4,15 +4,15 @@ package com.ningdatech.pmapi.projectlib.handle;
import java.util.List;
import com.ningdatech.pmapi.projectlib.model.entity.Project;
import com.ningdatech.pmapi.projectlib.service.IProjectService;
import com.wflow.workflow.bean.vo.ProcessDetailVO;
import com.wflow.workflow.enums.StepStatusEnum;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ningdatech.pmapi.common.constant.CommonConst;
import com.ningdatech.pmapi.common.statemachine.event.ProjectStatusChangeEvent;
import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum;
import com.ningdatech.pmapi.projectlib.enumeration.StepStatusEnum;
import com.ningdatech.pmapi.projectlib.model.entity.ProjectStatusChange;
import com.ningdatech.pmapi.projectlib.model.vo.ProcessDetailVO;
import com.ningdatech.pmapi.projectlib.service.INdProjectStatusChangeService;

/**


+ 2
- 2
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ConstructionPlanReviewHandle.java ファイルの表示

@@ -7,15 +7,15 @@ import java.util.Objects;
import com.google.common.collect.Lists;
import com.ningdatech.basic.util.NdDateUtils;
import com.wflow.workflow.bean.process.ProgressNode;
import com.wflow.workflow.bean.vo.ProcessDetailVO;
import com.wflow.workflow.enums.StepStatusEnum;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ningdatech.pmapi.common.constant.CommonConst;
import com.ningdatech.pmapi.projectlib.enumeration.InstTypeEnum;
import com.ningdatech.pmapi.projectlib.enumeration.StepStatusEnum;
import com.ningdatech.pmapi.projectlib.model.entity.ProjectInst;
import com.ningdatech.pmapi.projectlib.model.vo.ProcessDetailVO;
import com.ningdatech.pmapi.projectlib.service.IProjectInstService;
import com.wflow.workflow.bean.vo.ProcessProgressVo;
import com.wflow.workflow.enums.ProcessStatusEnum;


+ 2
- 2
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/DeptUnitedReviewHandle.java ファイルの表示

@@ -7,15 +7,15 @@ import java.util.Objects;
import com.google.common.collect.Lists;
import com.ningdatech.basic.util.NdDateUtils;
import com.wflow.workflow.bean.process.ProgressNode;
import com.wflow.workflow.bean.vo.ProcessDetailVO;
import com.wflow.workflow.enums.StepStatusEnum;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ningdatech.pmapi.common.constant.CommonConst;
import com.ningdatech.pmapi.projectlib.enumeration.InstTypeEnum;
import com.ningdatech.pmapi.projectlib.enumeration.StepStatusEnum;
import com.ningdatech.pmapi.projectlib.model.entity.ProjectInst;
import com.ningdatech.pmapi.projectlib.model.vo.ProcessDetailVO;
import com.ningdatech.pmapi.projectlib.service.IProjectInstService;
import com.wflow.workflow.bean.vo.ProcessProgressVo;
import com.wflow.workflow.enums.ProcessStatusEnum;


+ 2
- 2
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/PreliminaryPreviewHandle.java ファイルの表示

@@ -5,13 +5,13 @@ import com.google.common.collect.Lists;
import com.ningdatech.basic.util.NdDateUtils;
import com.ningdatech.pmapi.common.constant.CommonConst;
import com.ningdatech.pmapi.projectlib.enumeration.InstTypeEnum;
import com.ningdatech.pmapi.projectlib.enumeration.StepStatusEnum;
import com.ningdatech.pmapi.projectlib.model.entity.ProjectInst;
import com.ningdatech.pmapi.projectlib.model.vo.ProcessDetailVO;
import com.ningdatech.pmapi.projectlib.service.IProjectInstService;
import com.wflow.workflow.bean.process.ProgressNode;
import com.wflow.workflow.bean.vo.ProcessDetailVO;
import com.wflow.workflow.bean.vo.ProcessProgressVo;
import com.wflow.workflow.enums.ProcessStatusEnum;
import com.wflow.workflow.enums.StepStatusEnum;
import com.wflow.workflow.service.ProcessInstanceService;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;


+ 1
- 1
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ProcessExecuteChainHandle.java ファイルの表示

@@ -1,6 +1,6 @@
package com.ningdatech.pmapi.projectlib.handle;

import com.ningdatech.pmapi.projectlib.model.vo.ProcessDetailVO;
import com.wflow.workflow.bean.vo.ProcessDetailVO;
import org.springframework.stereotype.Component;

import java.util.Collections;


+ 2
- 2
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ProjectApprovalHandle.java ファイルの表示

@@ -6,6 +6,8 @@ import java.util.*;

import com.ningdatech.basic.util.CollUtils;
import com.ningdatech.pmapi.projectlib.model.entity.Project;
import com.wflow.workflow.bean.vo.ProcessDetailVO;
import com.wflow.workflow.enums.StepStatusEnum;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

@@ -13,10 +15,8 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ningdatech.pmapi.common.constant.CommonConst;
import com.ningdatech.pmapi.common.statemachine.event.ProjectStatusChangeEvent;
import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum;
import com.ningdatech.pmapi.projectlib.enumeration.StepStatusEnum;
import com.ningdatech.pmapi.projectlib.manage.AnnualPlanLibManage;
import com.ningdatech.pmapi.projectlib.model.entity.ProjectStatusChange;
import com.ningdatech.pmapi.projectlib.model.vo.ProcessDetailVO;
import com.ningdatech.pmapi.projectlib.service.INdProjectStatusChangeService;
import com.ningdatech.pmapi.projectlib.service.IProjectService;



+ 2
- 2
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ProjectDeclareHandle.java ファイルの表示

@@ -1,10 +1,10 @@
package com.ningdatech.pmapi.projectlib.handle;

import com.ningdatech.pmapi.common.constant.CommonConst;
import com.ningdatech.pmapi.projectlib.enumeration.StepStatusEnum;
import com.ningdatech.pmapi.projectlib.model.entity.Project;
import com.ningdatech.pmapi.projectlib.model.vo.ProcessDetailVO;
import com.ningdatech.pmapi.projectlib.service.IProjectService;
import com.wflow.workflow.bean.vo.ProcessDetailVO;
import com.wflow.workflow.enums.StepStatusEnum;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;



+ 2
- 2
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ProjectFinalInspectionHandle.java ファイルの表示

@@ -9,15 +9,15 @@ import com.ningdatech.pmapi.projectlib.enumeration.InstTypeEnum;
import com.ningdatech.pmapi.projectlib.model.entity.ProjectInst;
import com.ningdatech.pmapi.projectlib.service.IProjectInstService;
import com.wflow.workflow.bean.process.ProgressNode;
import com.wflow.workflow.bean.vo.ProcessDetailVO;
import com.wflow.workflow.bean.vo.ProcessProgressVo;
import com.wflow.workflow.enums.ProcessStatusEnum;
import com.wflow.workflow.enums.StepStatusEnum;
import com.wflow.workflow.service.ProcessInstanceService;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ningdatech.pmapi.common.constant.CommonConst;
import com.ningdatech.pmapi.projectlib.enumeration.StepStatusEnum;
import com.ningdatech.pmapi.projectlib.model.vo.ProcessDetailVO;


/**


+ 2
- 2
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ProjectPreliminaryInspectionHandle.java ファイルの表示

@@ -5,6 +5,8 @@ import static com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum.*;
import java.util.Arrays;
import java.util.List;

import com.wflow.workflow.bean.vo.ProcessDetailVO;
import com.wflow.workflow.enums.StepStatusEnum;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

@@ -13,10 +15,8 @@ import com.ningdatech.basic.util.CollUtils;
import com.ningdatech.pmapi.common.constant.CommonConst;
import com.ningdatech.pmapi.common.statemachine.event.ProjectStatusChangeEvent;
import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum;
import com.ningdatech.pmapi.projectlib.enumeration.StepStatusEnum;
import com.ningdatech.pmapi.projectlib.model.entity.ProjectStatusChange;
import com.ningdatech.pmapi.projectlib.model.entity.Project;
import com.ningdatech.pmapi.projectlib.model.vo.ProcessDetailVO;
import com.ningdatech.pmapi.projectlib.service.INdProjectStatusChangeService;
import com.ningdatech.pmapi.projectlib.service.IProjectService;



+ 2
- 2
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/TenderPurchaseHandle.java ファイルの表示

@@ -4,6 +4,8 @@ import static com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum.*;

import java.util.*;

import com.wflow.workflow.bean.vo.ProcessDetailVO;
import com.wflow.workflow.enums.StepStatusEnum;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

@@ -12,10 +14,8 @@ import com.ningdatech.basic.util.CollUtils;
import com.ningdatech.pmapi.common.constant.CommonConst;
import com.ningdatech.pmapi.common.statemachine.event.ProjectStatusChangeEvent;
import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum;
import com.ningdatech.pmapi.projectlib.enumeration.StepStatusEnum;
import com.ningdatech.pmapi.projectlib.model.entity.ProjectStatusChange;
import com.ningdatech.pmapi.projectlib.model.entity.Project;
import com.ningdatech.pmapi.projectlib.model.vo.ProcessDetailVO;
import com.ningdatech.pmapi.projectlib.service.INdProjectStatusChangeService;
import com.ningdatech.pmapi.projectlib.service.IProjectService;



+ 2
- 2
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/UnitInnerAuditHandle.java ファイルの表示

@@ -11,11 +11,11 @@ import com.ningdatech.pmapi.projectlib.model.entity.ProjectInst;
import com.ningdatech.pmapi.projectlib.service.IProjectInstService;

import com.ningdatech.pmapi.common.constant.CommonConst;
import com.ningdatech.pmapi.projectlib.enumeration.StepStatusEnum;
import com.ningdatech.pmapi.projectlib.model.vo.ProcessDetailVO;
import com.wflow.workflow.bean.process.ProgressNode;
import com.wflow.workflow.bean.vo.ProcessDetailVO;
import com.wflow.workflow.bean.vo.ProcessProgressVo;
import com.wflow.workflow.enums.ProcessStatusEnum;
import com.wflow.workflow.enums.StepStatusEnum;
import com.wflow.workflow.service.ProcessInstanceService;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;


+ 1
- 1
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java ファイルの表示

@@ -17,12 +17,12 @@ import com.ningdatech.pmapi.projectlib.model.entity.ProjectApplication;
import com.ningdatech.pmapi.projectlib.model.entity.ProjectRenewalFundDeclaration;
import com.ningdatech.pmapi.projectlib.model.req.ProjectListReq;
import com.ningdatech.pmapi.projectlib.model.vo.AnnualAmountVO;
import com.ningdatech.pmapi.projectlib.model.vo.ProcessDetailVO;
import com.ningdatech.pmapi.projectlib.model.vo.ProjectDetailVO;
import com.ningdatech.pmapi.projectlib.model.vo.ProjectLibListItemVO;
import com.ningdatech.pmapi.projectlib.service.IProjectApplicationService;
import com.ningdatech.pmapi.projectlib.service.IProjectRenewalFundDeclarationService;
import com.ningdatech.pmapi.projectlib.service.IProjectService;
import com.wflow.workflow.bean.vo.ProcessDetailVO;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Component;


+ 0
- 40
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProcessDetailVO.java ファイルの表示

@@ -1,40 +0,0 @@
package com.ningdatech.pmapi.projectlib.model.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.ningdatech.pmapi.projectlib.enumeration.StepStatusEnum;
import com.wflow.workflow.bean.vo.ProcessProgressVo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

/**
* 流程进度详情VO
*
* @author CMM
* @since 2023/02/24 11:25
*/
@ApiModel(value = "ProcessDetailVO", description = "流程进度详情VO")
@Data
public class ProcessDetailVO implements Serializable {

private static final long serialVersionUID = 1L;

@ApiModelProperty("环节状态")
private StepStatusEnum stepStatus;

@ApiModelProperty("流程名称")
private String processName;

@ApiModelProperty("完成时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
private LocalDateTime finishTime;

@ApiModelProperty("流程处理进度详情")
private ProcessProgressVo processProgressVo;


}

+ 0
- 1
pmapi/src/main/java/com/ningdatech/pmapi/staging/enums/MsgTypeEnum.java ファイルの表示

@@ -1,6 +1,5 @@
package com.ningdatech.pmapi.staging.enums;

import com.ningdatech.pmapi.projectlib.enumeration.StepStatusEnum;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;


+ 19
- 3
pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java ファイルの表示

@@ -9,6 +9,7 @@ import com.ningdatech.basic.function.VUtils;
import com.ningdatech.basic.model.PageVo;
import com.ningdatech.basic.util.CollUtils;
import com.ningdatech.pmapi.common.constant.CommonConst;
import com.ningdatech.pmapi.common.helper.UserInfoHelper;
import com.ningdatech.pmapi.common.model.entity.ExcelExportWriter;
import com.ningdatech.pmapi.common.statemachine.event.ProjectStatusChangeEvent;
import com.ningdatech.pmapi.common.statemachine.util.StateMachineUtils;
@@ -39,6 +40,7 @@ import com.ningdatech.pmapi.todocenter.model.req.ToBeProcessedExportReq;
import com.ningdatech.pmapi.todocenter.model.req.ToBeProcessedReq;
import com.ningdatech.pmapi.todocenter.model.vo.ResToBeProcessedVO;
import com.ningdatech.pmapi.user.entity.UserInfo;
import com.ningdatech.pmapi.user.security.auth.model.UserFullInfoDTO;
import com.ningdatech.pmapi.user.service.IUserInfoService;
import com.ningdatech.pmapi.user.util.LoginUserUtil;
import com.wflow.contants.HisProInsEndActId;
@@ -97,6 +99,7 @@ public class TodoCenterManage {
private final INdWorkNoticeStagingService workNoticeStagingService;
private final DefaultDeclaredProjectManage defaultDeclaredProjectManage;
private final IProjectApplicationService projectApplicationService;
private final UserInfoHelper userInfoHelper;


/**
@@ -363,14 +366,27 @@ public class TodoCenterManage {
} else {
// 当前登录用户不是流程发起人
List<ProgressNode> currentProgressInfo = currentInstanceDetail.getProgressInfo();

ProgressNode progressNode = currentProgressInfo.get(currentProgressInfo.size() - 1);
ProgressNode beforeProgressNode;
ProgressNode currentProgressNode;
// 说明当前节点是子流程节点
if (progressNode.getNodeType().name().equals(NodeTypeEnum.SUB.name())) {
List<ProgressNode> children = progressNode.getChildren();
beforeProgressNode = children.get(children.size() - 2);
currentProgressNode = children.get(children.size() - 1);
} else {
beforeProgressNode = currentProgressInfo.get(currentProgressInfo.size() - 2);
currentProgressNode = currentProgressInfo.get(currentProgressInfo.size() - 1);
}
// 获取当前工作流任务前一个审核人信息
ProgressNode beforeProgressNode = currentProgressInfo.get(currentProgressInfo.size() - 2);
ProcessInstanceUserDto beforeUser = beforeProgressNode.getUser();
UserFullInfoDTO beforeUserInfo = userInfoHelper.getUserFullInfo(Long.valueOf(beforeUser.getUserId()));
// 获取当前当前工作流任务当前审核人信息
ProgressNode currentProgressNode = currentProgressInfo.get(currentProgressInfo.size() - 1);
ProcessInstanceUserDto currentUser = currentProgressNode.getUser();
UserFullInfoDTO currentUserInfo = userInfoHelper.getUserFullInfo(Long.valueOf(currentUser.getUserId()));
// 判断当前工作流任务前一个审核人的部门和当前登录用户的部门是否是同一个,如果是同一个才可以撤回,否则抛出异常
boolean orgFlag = currentUser.getOrgCode().equals(beforeUser.getOrgCode());
boolean orgFlag = currentUserInfo.getOrganizationCode().equals(beforeUserInfo.getOrganizationCode());
boolean userFlag = beforeUser.getUserId().equals(String.valueOf(userId));
if (!orgFlag) {
throw new BizException("下一个审核人和您不是同一个部门,无法撤回!");


読み込み中…
キャンセル
保存