工作评议的上传拟评部门

This commit is contained in:
lijiaqi 2022-09-29 16:40:35 +08:00
parent c795ebe86d
commit 76f565cde7
7 changed files with 94 additions and 5 deletions

View File

@ -181,6 +181,15 @@ public class ApiReviewWorkController extends ApiBaseController {
ReviewWork review = reviewWorkService.stateCheckSave(workCheckRequest, getApiUser());
render(Ret.ok().data(ReviewWorkWrapper.build().entityVO(review)));
}
@ApiOperation("上报评议部门")
@PostMapping("state/report")
@ResponseBody
@DynamicResponseParameters(properties = {
@DynamicParameter(name = "data", value = "评议", dataTypeClass = ReviewWorkDto.class)
})
public void stateReport(@RequestBody ReviewWorkReportStateRequest reviewWorkReportStateRequest){
}

View File

@ -188,6 +188,18 @@ public class ReviewWork extends BaseEntity {
@ApiModelProperty(value = "截止时间")
private LocalDateTime reviewEndAt;
/**
* 上报评议部门时间
*/
@DateTimeFormat(
pattern = "yyyy-MM-dd HH:mm:ss"
)
@JsonFormat(
pattern = "yyyy-MM-dd HH:mm:ss"
)
@ApiModelProperty(value = "上报评议部门时间")
private LocalDateTime reviewWorkReportUploadAt;
public ReviewWork() {
//默认公开分数
this.checkScoreState=1;

View File

@ -18,6 +18,8 @@ public class ReviewWorkDto extends ReviewWork {
List<ReviewWorkAttachment> opinionAttachmentList;
@ApiModelProperty(value = "整改结果附件")
List<ReviewWorkAttachment> resultAttachmentList;
@ApiModelProperty(value = "评议方案附件")
List<ReviewWorkAttachment> reportAttachmentList;
@ApiModelProperty(value = "一级审批人员")
List<ReviewWorkAudit> inReportAudit1List;

View File

@ -0,0 +1,29 @@
package com.ydool.boot.modules.rddb.entity.request.review_work.state;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import java.util.List;
@Data
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;
}

View File

@ -20,9 +20,6 @@ import com.ydool.boot.modules.rddb.entity.request.CommentRequest;
import com.ydool.boot.modules.rddb.entity.request.ScoreRequest;
import com.ydool.boot.modules.rddb.entity.request.contact_db.SignRequest;
import com.ydool.boot.modules.rddb.entity.request.contact_db.state.*;
import com.ydool.boot.modules.rddb.entity.request.review_work.state.CheckAttachment;
import com.ydool.boot.modules.rddb.entity.request.review_work.state.CheckUser;
import com.ydool.boot.modules.rddb.entity.request.review_work.state.WorkCheck;
import com.ydool.boot.modules.rddb.mapper.ContactDbMapper;
import com.ydool.boot.modules.rddb.wrapper.ContactDbWrapper;
import com.ydool.boot.modules.sys.entity.User;

View File

@ -29,6 +29,7 @@ import org.springframework.transaction.annotation.Transactional;
import java.time.LocalDateTime;
import java.util.*;
import java.util.stream.Collectors;
/**
* <p>
@ -147,7 +148,7 @@ public class ReviewWorkService extends BaseService<ReviewWorkMapper, ReviewWork>
@Transactional
public ReviewWork stateInReportSave(ReviewWorkInReportStateRequest reviewWorkInReportStateRequest, User loginUser) {
ReviewWork reviewWork = BeanUtil.copyProperties(reviewWorkInReportStateRequest, ReviewWork.class);
reviewWork.setState(ReviewWork.STATE_CHECK);
reviewWork.setState(ReviewWork.STATE_REPORT);
reviewWork.setStatus(1);
reviewWork.setCreatedId(loginUser.getId());
saveOrUpdate(reviewWork);
@ -237,6 +238,27 @@ public class ReviewWorkService extends BaseService<ReviewWorkMapper, ReviewWork>
return reviewWork;
}
@Transactional
public ReviewWork stateReport(ReviewWorkReportStateRequest reviewWorkReportStateRequest, User loginUser) {
ReviewWork reviewWork = getById(reviewWorkReportStateRequest.getId());
Assert.notNull(reviewWork, "未找到该记录");
if (ReviewWork.STATE_REPORT != reviewWork.getState())
throw new ResultException(Ret.fail("当前环节不能提交该信息"));
BeanUtil.copyProperties(reviewWorkReportStateRequest, reviewWork);
reviewWork.setState(ReviewWork.STATE_CHECK);
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());
return reviewWork;
}
@Transactional
private void saveReviewWorkCheck(ReviewWork reviewWork, WorkCheckRequest workCheckRequest, User loginUser) {
//删除之前记录

View File

@ -128,7 +128,24 @@ public class ReviewWorkWrapper extends BaseWrapper<ReviewWork, ReviewWorkDto> {
// }
// });
// }
List<ReviewWorkAttachment> reportAttachmentList =
reviewWorkAttachmentService.list(new LambdaQueryWrapper<ReviewWorkAttachment>()
.eq(ReviewWorkAttachment::getReviewId, reviewWork.getId())
.eq(ReviewWorkAttachment::getType, ReviewWork.STATE_REPORT)
.orderByDesc(ReviewWorkAttachment::getCreatedAt));
//获取关联会议名称
if (CollectionUtil.isNotEmpty(reportAttachmentList)) {
reportAttachmentList.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>()
@ -184,6 +201,7 @@ public class ReviewWorkWrapper extends BaseWrapper<ReviewWork, ReviewWorkDto> {
ReviewWorkDto.setCheckAttachmentList(reviewWorkCheckDtos);
ReviewWorkDto.setOpinionAttachmentList(opinionAttachmentList);
ReviewWorkDto.setResultAttachmentList(resultAttachmentList);
ReviewWorkDto.setReportAttachmentList(reportAttachmentList);
ReviewWorkDto.setInReportAudit1List(inReportAudit1List);
ReviewWorkDto.setInReportAudit2List(inReportAudit2List);