This commit is contained in:
lijiaqi 2022-10-11 10:47:40 +08:00
parent 80a04fbde9
commit b60a69e08e
9 changed files with 140 additions and 31 deletions

View File

@ -278,6 +278,17 @@ public class ApiReviewWorkController extends ApiBaseController {
render(Ret.ok().data(ReviewWorkWrapper.build().entityVO(review)));
}
@ApiOperation("上传评议意见")
@PostMapping("state/message")
@ResponseBody
@DynamicResponseParameters(properties = {
@DynamicParameter(name = "data", value = "评议", dataTypeClass = ReviewWorkDto.class)
})
public void stateMessageSave(@Validated @RequestBody ReviewWorkMessageStateRequest reviewWorkMessageStateRequest) {
ReviewWork review = reviewWorkService.stateMessageSave(reviewWorkMessageStateRequest, getApiUser());
render(Ret.ok().data(ReviewWorkWrapper.build().entityVO(review)));
}
@ApiOperation("上传整改结果环节")
@PostMapping("state/result")
@ResponseBody

View File

@ -26,14 +26,15 @@ public class ReviewWork extends BaseEntity {
private static final long serialVersionUID = 1L;
//当前环节 (内部上报拟评议部门inReport:1 上报评议部门report:2 调查报告check:3
// 向社会征求被评议部门意见ask:4 评议意见opinion:5 整改结果result:6 公示public:7)
// 向社会征求被评议部门意见ask:4 评议意见opinion:5 评议意见message:6 整改结果result:7 公示public:8)
public static Integer STATE_IN_REPORT = 1;
public static Integer STATE_REPORT = 2;
public static Integer STATE_CHECK = 3;
public static Integer STATE_ASK = 4;
public static Integer STATE_OPINION = 5;
public static Integer STATE_RESULT = 6;
public static Integer STATE_PUBLIC = 7;
public static Integer STATE_MESSAGE = 6;
public static Integer STATE_RESULT = 7;
public static Integer STATE_PUBLIC = 8;
/**
* 创建者
@ -206,6 +207,12 @@ public class ReviewWork extends BaseEntity {
@ApiModelProperty(value = "测评得分")
private String workOpinionScore;
@ApiModelProperty(value = "评议部门")
private String reviewWorkDept;
@ApiModelProperty(value = "评议时间")
private String reviewWorkAt;
public ReviewWork() {
//默认公开分数
this.checkScoreState=1;

View File

@ -3,6 +3,7 @@ import com.baomidou.mybatisplus.annotation.TableName;
import com.ydool.boot.core.entity.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* <p>
* 评议意见汇总

View File

@ -32,6 +32,9 @@ public class ReviewWorkDto extends ReviewWork {
@ApiModelProperty(value = "评议方案附件")
List<ReviewWorkAttachment> reportAttachmentList;
@ApiModelProperty(value = "评议意见附件")
List<ReviewWorkAttachment> messageAttachmentList;
@ApiModelProperty(value = "一级审批人员")
List<ReviewWorkAudit> inReportAudit1List;
@ApiModelProperty(value = "二级审批人员")
@ -49,4 +52,7 @@ public class ReviewWorkDto extends ReviewWork {
Boolean isCanAudit1;
@ApiModelProperty(value = "当前用户是否可以二级审批")
Boolean isCanAudit2;
@ApiModelProperty(value = "意见汇总")
private List<String> messages;
}

View File

@ -13,4 +13,8 @@ public class ReviewWorkAskStateRequest {
@ApiModelProperty(value = "调查问卷")
private List<CheckAttachment> attachment;
@ApiModelProperty(value = "意见汇总")
private List<String> messages;
}

View File

@ -0,0 +1,16 @@
package com.ydool.boot.modules.rddb.entity.request.review_work.state;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
@Data
public class ReviewWorkMessageStateRequest {
@ApiModelProperty(value = "工作评议Id")
private String id;
@ApiModelProperty(value = "评议意见")
private List<CheckAttachment> attachment;
}

View File

@ -13,17 +13,24 @@ import java.util.List;
public class ReviewWorkReportStateRequest {
@ApiModelProperty(value = "id")
private String id;
@ApiModelProperty(value = "评议方案附件")
private List<CheckAttachment> reportAttachmentList;
/**
* 上报评议部门时间
*/
@DateTimeFormat(
pattern = "yyyy-MM-dd HH:mm:ss"
)
@JsonFormat(
pattern = "yyyy-MM-dd HH:mm:ss"
)
@ApiModelProperty(value = "上报评议部门时间")
private LocalDateTime reviewWorkReportUploadAt;
@ApiModelProperty(value = "评议部门")
private String reviewWorkDept;
@ApiModelProperty(value = "评议时间")
private String reviewWorkAt;
// @ApiModelProperty(value = "评议方案附件")
// private List<CheckAttachment> reportAttachmentList;
// /**
// * 上报评议部门时间
// */
// @DateTimeFormat(
// pattern = "yyyy-MM-dd HH:mm:ss"
// )
// @JsonFormat(
// pattern = "yyyy-MM-dd HH:mm:ss"
// )
// @ApiModelProperty(value = "上报评议部门时间")
// private LocalDateTime reviewWorkReportUploadAt;
}

View File

@ -250,9 +250,10 @@ public class ReviewWorkService extends BaseService<ReviewWorkMapper, ReviewWork>
if (ReviewWork.STATE_CHECK != reviewWork.getState())
throw new ResultException(Ret.fail("当前环节不能提交该信息"));
BeanUtil.copyProperties(workCheckRequest, reviewWork);
reviewWork.setState(ReviewWork.STATE_ASK);
saveOrUpdate(reviewWork);
saveReviewWorkCheck(reviewWork, workCheckRequest, loginUser);
saveReviewWorkUser(reviewWork.getId(), workCheckRequest.getCheckUserIds().toString(), loginUser);
// saveReviewWorkUser(reviewWork.getId(), workCheckRequest.getCheckUserIds().toString(), loginUser);
return reviewWork;
}
@ -263,6 +264,7 @@ public class ReviewWorkService extends BaseService<ReviewWorkMapper, ReviewWork>
if (ReviewWork.STATE_ASK != reviewWork.getState())
throw new ResultException(Ret.fail("当前环节不能提交该信息"));
BeanUtil.copyProperties(reviewWorkAskStateRequest, reviewWork);
reviewWork.setState(ReviewWork.STATE_OPINION);
saveOrUpdate(reviewWork);
// saveReviewWorkCheck(reviewWork, workCheckRequest, loginUser);
List<CheckAttachment> attachment = reviewWorkAskStateRequest.getAttachment();
@ -273,6 +275,15 @@ public class ReviewWorkService extends BaseService<ReviewWorkMapper, ReviewWork>
attachment.stream().map(CheckAttachment::getCheckAttachmentConferenceId).collect(Collectors.toList()).toString(),
attachment.stream().map(CheckAttachment::getCheckAttachmentConferenceName).collect(Collectors.toList()).toString());
}
if (CollectionUtil.isNotEmpty(reviewWorkAskStateRequest.getMessages())){
reviewWorkAskStateRequest.getMessages().forEach(message -> {
ReviewWorkMessage reviewWorkMessage = new ReviewWorkMessage();
reviewWorkMessage.setContent(message);
reviewWorkMessage.setReviewId(reviewWorkAskStateRequest.getId());
reviewWorkMessageService.saveOrUpdate(reviewWorkMessage);
});
}
return reviewWork;
}
@ -288,11 +299,11 @@ public class ReviewWorkService extends BaseService<ReviewWorkMapper, ReviewWork>
saveOrUpdate(reviewWork);
saveReviewWorkAttachment(reviewWork.getId(),
reviewWorkReportStateRequest.getReportAttachmentList().stream().map(CheckAttachment::getCheckAttachmentName).collect(Collectors.toList()).toString(),
reviewWorkReportStateRequest.getReportAttachmentList().stream().map(CheckAttachment::getCheckAttachmentPath).collect(Collectors.toList()).toString(), loginUser, ReviewWork.STATE_REPORT,
reviewWorkReportStateRequest.getReportAttachmentList().stream().map(CheckAttachment::getCheckAttachmentConferenceId).collect(Collectors.toList()).toString(),
reviewWorkReportStateRequest.getReportAttachmentList().stream().map(CheckAttachment::getCheckAttachmentConferenceName).collect(Collectors.toList()).toString());
// saveReviewWorkAttachment(reviewWork.getId(),
// reviewWorkReportStateRequest.getReportAttachmentList().stream().map(CheckAttachment::getCheckAttachmentName).collect(Collectors.toList()).toString(),
// reviewWorkReportStateRequest.getReportAttachmentList().stream().map(CheckAttachment::getCheckAttachmentPath).collect(Collectors.toList()).toString(), loginUser, ReviewWork.STATE_REPORT,
// reviewWorkReportStateRequest.getReportAttachmentList().stream().map(CheckAttachment::getCheckAttachmentConferenceId).collect(Collectors.toList()).toString(),
// reviewWorkReportStateRequest.getReportAttachmentList().stream().map(CheckAttachment::getCheckAttachmentConferenceName).collect(Collectors.toList()).toString());
return reviewWork;
@ -435,7 +446,7 @@ public class ReviewWorkService extends BaseService<ReviewWorkMapper, ReviewWork>
if (ReviewWork.STATE_OPINION != reviewWork.getState())
throw new ResultException(Ret.fail("当前环节不能提交该信息"));
BeanUtil.copyProperties(reviewWorkOpinionStateRequest, reviewWork);
reviewWork.setState(ReviewWork.STATE_RESULT);
reviewWork.setState(ReviewWork.STATE_MESSAGE);
saveOrUpdate(reviewWork);
List<CheckAttachment> attachment1 = reviewWorkOpinionStateRequest.getAttachment1();
@ -739,4 +750,24 @@ public class ReviewWorkService extends BaseService<ReviewWorkMapper, ReviewWork>
}
}
public ReviewWork stateMessageSave(ReviewWorkMessageStateRequest reviewWorkMessageStateRequest, User loginUser) {
ReviewWork reviewWork = getById(reviewWorkMessageStateRequest.getId());
Assert.notNull(reviewWork, "未找到该记录");
if (ReviewWork.STATE_MESSAGE != reviewWork.getState())
throw new ResultException(Ret.fail("当前环节不能提交该信息"));
BeanUtil.copyProperties(reviewWorkMessageStateRequest, reviewWork);
reviewWork.setState(ReviewWork.STATE_RESULT);
saveOrUpdate(reviewWork);
List<CheckAttachment> attachment1 = reviewWorkMessageStateRequest.getAttachment();
if (CollectionUtil.isNotEmpty(attachment1)) {
saveReviewWorkAttachment(reviewWork.getId(),
attachment1.stream().map(CheckAttachment::getCheckAttachmentName).collect(Collectors.toList()).toString(),
attachment1.stream().map(CheckAttachment::getCheckAttachmentPath).collect(Collectors.toList()).toString(), loginUser, ReviewWork.STATE_MESSAGE,
attachment1.stream().map(CheckAttachment::getCheckAttachmentConferenceId).collect(Collectors.toList()).toString(),
attachment1.stream().map(CheckAttachment::getCheckAttachmentConferenceName).collect(Collectors.toList()).toString());
}
return reviewWork;
}
}

View File

@ -42,6 +42,7 @@ public class ReviewWorkWrapper extends BaseWrapper<ReviewWork, ReviewWorkDto> {
ReviewWorkAuditService reviewWorkAuditService = SpringUtils.getBean(ReviewWorkAuditService.class);
ReviewWorkCheckService reviewWorkCheckService = SpringUtils.getBean(ReviewWorkCheckService.class);
ReviewWorkCheckUserService reviewWorkCheckUserService = SpringUtils.getBean(ReviewWorkCheckUserService.class);
ReviewWorkMessageService reviewWorkMessageService = SpringUtils.getBean(ReviewWorkMessageService.class);
List<ReviewWorkAttachment> inReportAttachmentList =
reviewWorkAttachmentService.list(new LambdaQueryWrapper<ReviewWorkAttachment>()
@ -100,7 +101,8 @@ public class ReviewWorkWrapper extends BaseWrapper<ReviewWork, ReviewWorkDto> {
// .eq(ReviewWorkCheckUser::getWorkCheckId, workCheckId)
// .eq(ReviewWorkCheckUser::getReviewId, reviewWork.getId())
// );
// ReviewWorkCheckDto reviewWorkCheckDto = BeanUtil.copyProperties(reviewWorkCheck, ReviewWorkCheckDto.class);
// ReviewWorkCheckDto reviewWorkCheckDto = BeanUtil.copyProperties(reviewWorkCheck, ReviewWorkCheckDto
// .class);
// reviewWorkCheckDto.setReviewWorkAttachments(checkAttachmentList);
// reviewWorkCheckDto.setReviewWorkUsers(reviewWorkCheckUsers);
// reviewWorkCheckDtos.add(reviewWorkCheckDto);
@ -111,10 +113,10 @@ public class ReviewWorkWrapper extends BaseWrapper<ReviewWork, ReviewWorkDto> {
List<ReviewWorkAttachment> checkAttachment1List = reviewWorkAttachmentService.list(new
LambdaQueryWrapper<ReviewWorkAttachment>()
LambdaQueryWrapper<ReviewWorkAttachment>()
.eq(ReviewWorkAttachment::getReviewId, reviewWork.getId())
.eq(ReviewWorkAttachment::getType, ReviewWork.STATE_CHECK)
.eq(ReviewWorkAttachment::getClassify,"1")
.eq(ReviewWorkAttachment::getClassify, "1")
.orderByDesc(ReviewWorkAttachment::getCreatedAt));
//获取关联会议名称
if (CollectionUtil.isNotEmpty(checkAttachment1List)) {
@ -129,13 +131,17 @@ public class ReviewWorkWrapper extends BaseWrapper<ReviewWork, ReviewWorkDto> {
}
});
}
List<ReviewWorkMessage> reviewWorkMessageList =
reviewWorkMessageService.list(new LambdaQueryWrapper<ReviewWorkMessage>().eq(ReviewWorkMessage::getReviewId, reviewWork.getId()));
ReviewWorkDto.setMessages(reviewWorkMessageList.stream().map(ReviewWorkMessage::getContent).collect(Collectors.toList()));
List<ReviewWorkAttachment> checkAttachment2List = reviewWorkAttachmentService.list(new
LambdaQueryWrapper<ReviewWorkAttachment>()
.eq(ReviewWorkAttachment::getReviewId, reviewWork.getId())
.eq(ReviewWorkAttachment::getType, ReviewWork.STATE_CHECK)
.eq(ReviewWorkAttachment::getClassify,"1")
.eq(ReviewWorkAttachment::getClassify, "1")
.orderByDesc(ReviewWorkAttachment::getCreatedAt));
//获取关联会议名称
if (CollectionUtil.isNotEmpty(checkAttachment2List)) {
@ -191,11 +197,30 @@ public class ReviewWorkWrapper extends BaseWrapper<ReviewWork, ReviewWorkDto> {
});
}
List<ReviewWorkAttachment> messgerAttachmentList =
reviewWorkAttachmentService.list(new LambdaQueryWrapper<ReviewWorkAttachment>()
.eq(ReviewWorkAttachment::getReviewId, reviewWork.getId())
.eq(ReviewWorkAttachment::getType, ReviewWork.STATE_MESSAGE)
.orderByDesc(ReviewWorkAttachment::getCreatedAt));
//获取关联会议名称
if (CollectionUtil.isNotEmpty(messgerAttachmentList)) {
messgerAttachmentList.stream().forEach(i -> {
if (StrUtil.isNotBlank(i.getConferenceId())) {
Conference conference = conferenceMapper.selectById(i.getConferenceId());
String conferenceName = "";
if (conference != null) {
conferenceName = conference.getTitle();
}
i.setConferenceName(conferenceName);
}
});
}
List<ReviewWorkAttachment> opinionAttachmentList =
reviewWorkAttachmentService.list(new LambdaQueryWrapper<ReviewWorkAttachment>()
.eq(ReviewWorkAttachment::getReviewId, reviewWork.getId())
.eq(ReviewWorkAttachment::getType, ReviewWork.STATE_OPINION)
.eq(ReviewWorkAttachment::getClassify,"1")
.eq(ReviewWorkAttachment::getClassify, "1")
.orderByDesc(ReviewWorkAttachment::getCreatedAt));
//获取关联会议名称
if (CollectionUtil.isNotEmpty(opinionAttachmentList)) {
@ -215,7 +240,7 @@ public class ReviewWorkWrapper extends BaseWrapper<ReviewWork, ReviewWorkDto> {
reviewWorkAttachmentService.list(new LambdaQueryWrapper<ReviewWorkAttachment>()
.eq(ReviewWorkAttachment::getReviewId, reviewWork.getId())
.eq(ReviewWorkAttachment::getType, ReviewWork.STATE_OPINION)
.eq(ReviewWorkAttachment::getClassify,"2")
.eq(ReviewWorkAttachment::getClassify, "2")
.orderByDesc(ReviewWorkAttachment::getCreatedAt));
//获取关联会议名称
if (CollectionUtil.isNotEmpty(opinionAttachment2List)) {
@ -235,7 +260,7 @@ public class ReviewWorkWrapper extends BaseWrapper<ReviewWork, ReviewWorkDto> {
reviewWorkAttachmentService.list(new LambdaQueryWrapper<ReviewWorkAttachment>()
.eq(ReviewWorkAttachment::getReviewId, reviewWork.getId())
.eq(ReviewWorkAttachment::getType, ReviewWork.STATE_RESULT)
.eq(ReviewWorkAttachment::getClassify,"1")
.eq(ReviewWorkAttachment::getClassify, "1")
.orderByDesc(ReviewWorkAttachment::getCreatedAt));
//获取关联会议名称
if (CollectionUtil.isNotEmpty(resultAttachmentList)) {
@ -255,7 +280,7 @@ public class ReviewWorkWrapper extends BaseWrapper<ReviewWork, ReviewWorkDto> {
reviewWorkAttachmentService.list(new LambdaQueryWrapper<ReviewWorkAttachment>()
.eq(ReviewWorkAttachment::getReviewId, reviewWork.getId())
.eq(ReviewWorkAttachment::getType, ReviewWork.STATE_RESULT)
.eq(ReviewWorkAttachment::getClassify,"2")
.eq(ReviewWorkAttachment::getClassify, "2")
.orderByDesc(ReviewWorkAttachment::getCreatedAt));
//获取关联会议名称
if (CollectionUtil.isNotEmpty(resultAttachment2List)) {
@ -297,6 +322,7 @@ public class ReviewWorkWrapper extends BaseWrapper<ReviewWork, ReviewWorkDto> {
ReviewWorkDto.setInReportAudit1List(inReportAudit1List);
ReviewWorkDto.setInReportAudit2List(inReportAudit2List);
ReviewWorkDto.setCheckUserList(checkUserList);
ReviewWorkDto.setMessageAttachmentList(messgerAttachmentList);
//打分结束算平均分
if (ReviewWork.STATE_CHECK < reviewWork.getState()) {