Conflicts: pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectDetailVO.javamaster
@@ -2,10 +2,12 @@ package com.ningdatech.pmapi.meeting.controller; | |||
import com.ningdatech.pmapi.meeting.entity.req.MeetingExpertJudgeReq; | |||
import com.ningdatech.pmapi.meeting.entity.req.MeetingExpertJudgeReq.Basic; | |||
import com.ningdatech.pmapi.meeting.manage.MeetingExpertJudgeManage; | |||
import io.swagger.annotations.Api; | |||
import io.swagger.annotations.ApiOperation; | |||
import lombok.AllArgsConstructor; | |||
import org.springframework.validation.annotation.Validated; | |||
import org.springframework.web.bind.annotation.*; | |||
import javax.validation.Valid; | |||
@@ -28,7 +30,7 @@ public class MeetingExpertJudgeController { | |||
@ApiOperation("保存履职评价") | |||
@PostMapping("/submit") | |||
public void saveExpertJudge(@Valid @RequestBody MeetingExpertJudgeReq req) { | |||
public void saveExpertJudge(@Validated(Basic.class) @RequestBody MeetingExpertJudgeReq req) { | |||
expertJudgeManage.saveExpertJudge(req); | |||
} | |||
@@ -0,0 +1,49 @@ | |||
package com.ningdatech.pmapi.meeting.entity.enumeration; | |||
import lombok.AllArgsConstructor; | |||
import lombok.Getter; | |||
/** | |||
* <p> | |||
* ExpertJudgeEnum | |||
* </p> | |||
* | |||
* @author WendyYang | |||
* @since 2023/8/3 | |||
**/ | |||
public class ExpertJudgeEnum { | |||
private ExpertJudgeEnum() { | |||
} | |||
@Getter | |||
@AllArgsConstructor | |||
public enum AttendStatus { | |||
ON_TIME(1, "准时"), | |||
BE_LATE(2, "迟到"), | |||
ABSENT(3, "缺席"); | |||
private final Integer code; | |||
private final String value; | |||
public boolean eq(Integer code) { | |||
return this.code.equals(code); | |||
} | |||
} | |||
@Getter | |||
@AllArgsConstructor | |||
public enum Performance { | |||
POSITIVE(1, "积极"), | |||
NEGATIVE(2, "消极"); | |||
private final Integer code; | |||
private final String value; | |||
public boolean eq(Integer code) { | |||
return this.code.equals(code); | |||
} | |||
} | |||
} |
@@ -7,6 +7,9 @@ import lombok.Data; | |||
import javax.validation.constraints.NotNull; | |||
import java.time.LocalDateTime; | |||
import com.ningdatech.pmapi.meeting.entity.enumeration.ExpertJudgeEnum; | |||
import org.hibernate.validator.constraints.Range; | |||
/** | |||
* <p> | |||
* MeetingExpertJudgeReq | |||
@@ -20,34 +23,41 @@ public class MeetingExpertJudgeReq { | |||
private Long id; | |||
@NotNull(message = "会议ID不能为空") | |||
@NotNull(message = "会议ID不能为空", groups = Basic.class) | |||
private Long meetingId; | |||
@NotNull(message = "会议专家ID不能为空") | |||
@NotNull(message = "会议专家ID不能为空", groups = Basic.class) | |||
private Long meetingExpertId; | |||
@ApiModelProperty("评分(1~10)") | |||
@NotNull(message = "评分不能为空") | |||
@NotNull(message = "评分不能为空", groups = Basic.class) | |||
@Range(min = 1, max = 10, message = "评分范围为:1~10") | |||
private Integer score; | |||
/** | |||
* @see ExpertJudgeEnum.AttendStatus | |||
*/ | |||
@ApiModelProperty("是否参加:1 准时、2 迟到、3 缺席") | |||
@NotNull(message = "是否参加不能为空") | |||
@NotNull(message = "是否参加不能为空", groups = Basic.class) | |||
private Integer attended; | |||
/** | |||
* @see ExpertJudgeEnum.Performance | |||
*/ | |||
@ApiModelProperty("参与程度:1 积极、2 消极") | |||
@NotNull(message = "参与度不能为空") | |||
@NotNull(message = "参与度不能为空", groups = Attend.class) | |||
private Integer performance; | |||
@ApiModelProperty("是否提出建议:true 是、false 否") | |||
@NotNull(message = "是否提出建议不能为空") | |||
@NotNull(message = "是否提出建议不能为空", groups = Attend.class) | |||
private Boolean advised; | |||
@ApiModelProperty("是否早退:true 早退、false 未早退") | |||
@NotNull(message = "是否早退不能为空") | |||
@NotNull(message = "是否早退不能为空", groups = Attend.class) | |||
private Boolean leaveEarly; | |||
@ApiModelProperty("是否违规:true 是、false 否") | |||
@NotNull(message = "是否违规不能为空") | |||
@NotNull(message = "是否违规不能为空", groups = Attend.class) | |||
private Boolean brokeRule; | |||
@ApiModelProperty("违规内容") | |||
@@ -56,4 +66,12 @@ public class MeetingExpertJudgeReq { | |||
@JSONField(format = "yyyy-MM-dd HH:mm:ss") | |||
private LocalDateTime createOn; | |||
//================================================================================================================== | |||
public interface Attend { | |||
} | |||
public interface Basic { | |||
} | |||
} |
@@ -4,19 +4,25 @@ import cn.hutool.core.bean.BeanUtil; | |||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |||
import com.ningdatech.basic.exception.BizException; | |||
import com.ningdatech.basic.util.CollUtils; | |||
import com.ningdatech.basic.util.ValidUtil; | |||
import com.ningdatech.cache.lock.DistributedLock; | |||
import com.ningdatech.pmapi.meeting.entity.domain.Meeting; | |||
import com.ningdatech.pmapi.meeting.entity.domain.MeetingExpert; | |||
import com.ningdatech.pmapi.meeting.entity.domain.MeetingExpertJudge; | |||
import com.ningdatech.pmapi.meeting.entity.enumeration.ExpertAttendStatusEnum; | |||
import com.ningdatech.pmapi.meeting.entity.enumeration.ExpertJudgeEnum; | |||
import com.ningdatech.pmapi.meeting.entity.enumeration.MeetingStatusEnum; | |||
import com.ningdatech.pmapi.meeting.entity.req.MeetingExpertJudgeReq; | |||
import com.ningdatech.pmapi.meeting.entity.req.MeetingExpertJudgeReq.Attend; | |||
import com.ningdatech.pmapi.meeting.service.IMeetingExpertJudgeService; | |||
import com.ningdatech.pmapi.meeting.service.IMeetingExpertService; | |||
import com.ningdatech.pmapi.meeting.service.IMeetingService; | |||
import lombok.AllArgsConstructor; | |||
import org.springframework.stereotype.Component; | |||
import java.util.Map; | |||
/** | |||
* <p> | |||
* MeetingExpertJudgeManage | |||
@@ -46,6 +52,13 @@ public class MeetingExpertJudgeManage { | |||
throw BizException.wrap("履职评价失败,请重试"); | |||
} | |||
try { | |||
if (!ExpertJudgeEnum.AttendStatus.ABSENT.eq(req.getAttended())) { | |||
Map<String, String> validMap = ValidUtil.valid(req, Attend.class); | |||
if (!validMap.isEmpty()) { | |||
String errMsg = CollUtils.joinByComma(validMap.values()); | |||
throw BizException.wrap(errMsg); | |||
} | |||
} | |||
// 会议状态校验 | |||
Meeting meeting = meetingService.getById(req.getMeetingId()); | |||
if (meeting == null || MeetingStatusEnum.CANCELED.eq(meeting.getStatus())) { | |||
@@ -238,7 +238,8 @@ public class FinalAcceptanceManage { | |||
//保存终验项目 | |||
//生成新版本 并且进入下一状态 | |||
projectInfo = projectLibManage.saveProjectWithVersionAndPass(projectInfo,instanceId, InstTypeEnum.PROJECT_FINAL_INSPECTION.getCode()); | |||
projectInfo = projectLibManage.saveProjectWithVersionAndPass(projectInfo,instanceId, | |||
InstTypeEnum.PROJECT_FINAL_INSPECTION.getCode(),Boolean.TRUE); | |||
//发送给第一个审批人消息 | |||
noticeManage.sendFirtUser(projectInfo,model.getFormName(),instanceId, | |||
@@ -298,7 +299,8 @@ public class FinalAcceptanceManage { | |||
//保存终验项目 | |||
//生成新版本 并且进入下一状态 | |||
projectInfo = projectLibManage.saveProjectWithVersionAndPass(projectInfo,instanceId, InstTypeEnum.PROJECT_FINAL_INSPECTION.getCode()); | |||
projectInfo = projectLibManage.saveProjectWithVersionAndPass(projectInfo,instanceId, | |||
InstTypeEnum.PROJECT_FINAL_INSPECTION.getCode(),Boolean.TRUE); | |||
//发送给第一个审批人消息 | |||
noticeManage.sendFirtUser(projectInfo,model.getFormName(),instanceId, | |||
@@ -102,9 +102,6 @@ public class ReviewByDeptJointManage { | |||
//保存项目信息 | |||
projectInfo = projectLibManage.saveProjectWithVersion(projectInfo,instanceId,ProjectProcessStageEnum.DEPARTMENT_JOINT_APPROVAL_PROCESS.getCode()); | |||
// if(!modifyProject(projectInfo, instanceId)){ | |||
// return Boolean.FALSE; | |||
// } | |||
//发送给第一个审批人消息 | |||
noticeManage.sendFirtUser(projectInfo,model.getFormName(),instanceId, | |||
@@ -365,6 +365,7 @@ public class ProjectLibManage { | |||
project.setVersion(oldProject.getVersion() + 1); | |||
// 标记为建设方案申报 | |||
project.setIsConstruct(Boolean.TRUE); | |||
project.setIsBackReject(Boolean.FALSE); | |||
// 保存初步方案项目ID | |||
if (Boolean.TRUE.equals(oldProject.getIsConstruct())) { | |||
// 重新提交 | |||
@@ -432,6 +433,7 @@ public class ProjectLibManage { | |||
project.setId(null); | |||
project.setCreateOn(LocalDateTime.now()); | |||
project.setUpdateOn(LocalDateTime.now()); | |||
project.setIsBackReject(Boolean.TRUE); | |||
stateMachineUtils.pass(project); | |||
projectService.save(project); | |||
@@ -458,6 +460,8 @@ public class ProjectLibManage { | |||
project.setId(null); | |||
project.setCreateOn(LocalDateTime.now()); | |||
project.setUpdateOn(LocalDateTime.now()); | |||
//都是在驳回 重新提交时用的 | |||
project.setIsBackReject(Boolean.TRUE); | |||
if (Objects.nonNull(stageCode)) { | |||
project.setStage(stageCode); | |||
} | |||
@@ -548,7 +552,7 @@ public class ProjectLibManage { | |||
return project; | |||
} | |||
public Project saveProjectWithVersionAndPass(Project oldProject, String instanceId, Integer instType) { | |||
public Project saveProjectWithVersionAndPass(Project oldProject, String instanceId, Integer instType,Boolean isBackReject) { | |||
Project project = new Project(); | |||
VUtils.isTrue(Objects.isNull(oldProject)) | |||
.throwMessage("项目不存在!"); | |||
@@ -561,6 +565,7 @@ public class ProjectLibManage { | |||
project.setUpdateOn(LocalDateTime.now()); | |||
// 标识保存的项目信息是否为建设方案申报项目 | |||
project.setIsConstruct(Boolean.TRUE); | |||
project.setIsBackReject(isBackReject); | |||
stateMachineUtils.pass(project); | |||
if (projectService.save(project)) { | |||
@@ -1093,8 +1098,11 @@ public class ProjectLibManage { | |||
return res; | |||
} | |||
//只查 当前版本 和历史被驳回|退回的版本 | |||
List<Project> historyProjects = projectService.list(Wrappers.lambdaQuery(Project.class) | |||
.eq(Project::getProjectCode, project.getProjectCode()) | |||
.and(q1->q1.eq(Project::getNewest, Boolean.TRUE) | |||
.or(q2->q2.eq(Project::getIsBackReject,Boolean.TRUE))) | |||
.orderByDesc(Project::getCreateOn)); | |||
if (CollUtil.isEmpty(historyProjects)) { | |||
@@ -317,4 +317,7 @@ public class ProjectDTO implements Serializable { | |||
@ApiModelProperty("项目类型 01首次建设;02迭代升级;03结转建设;04新运维;05续运维") | |||
private String baseProjType; | |||
@ApiModelProperty("是否退回|驳回的项目版本") | |||
private Boolean isBackReject = Boolean.FALSE; | |||
} |
@@ -483,4 +483,8 @@ public class Project implements Serializable { | |||
@ApiModelProperty("区县预审本级主管单位盖章审核日期") | |||
private String countrySealAuditDate; | |||
@ApiModelProperty("是否退回|驳回的项目版本") | |||
private Boolean isBackReject; | |||
} |
@@ -405,6 +405,9 @@ public class ProjectDetailVO { | |||
@ApiModelProperty("标签") | |||
private List<TagVO> tags; | |||
@ApiModelProperty("是否退回|驳回的项目版本") | |||
private Boolean isBackReject; | |||
public String getVersionStr() { | |||
if (Objects.nonNull(this.newest) && this.newest) { | |||
this.versionStr = "当前版本"; | |||
@@ -1106,6 +1106,7 @@ public class TodoCenterManage { | |||
project.setId(null); | |||
project.setCreateOn(LocalDateTime.now()); | |||
project.setUpdateOn(LocalDateTime.now()); | |||
project.setIsBackReject(Boolean.TRUE); | |||
projectService.save(project); | |||
ProjectInst oldInst = projectInstService.getOne(Wrappers.lambdaUpdate(ProjectInst.class) | |||