评议一拆为三,流程暂未改

This commit is contained in:
周源 2022-07-12 10:38:02 +08:00
parent 8b53641f10
commit efb49da458
205 changed files with 7675 additions and 446 deletions

View File

@ -1,204 +1,204 @@
package com.ydool.boot.api.controller;
import cn.hutool.core.lang.Assert;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.xiaoymin.knife4j.annotations.DynamicParameter;
import com.github.xiaoymin.knife4j.annotations.DynamicResponseParameters;
import com.ydool.boot.common.result.Ret;
import com.ydool.boot.modules.rddb.entity.Review;
import com.ydool.boot.modules.rddb.entity.ReviewComment;
import com.ydool.boot.modules.rddb.entity.dto.ReviewDto;
import com.ydool.boot.modules.rddb.entity.request.review.ReviewAuditRequest;
import com.ydool.boot.modules.rddb.entity.request.review.ReviewCheckRequest;
import com.ydool.boot.modules.rddb.entity.request.review.ReviewCommentRequest;
import com.ydool.boot.modules.rddb.entity.request.review.state.ReviewCheckStateRequest;
import com.ydool.boot.modules.rddb.entity.request.review.state.ReviewInReportStateRequest;
import com.ydool.boot.modules.rddb.entity.request.review.state.ReviewOpinionStateRequest;
import com.ydool.boot.modules.rddb.entity.request.review.state.ReviewResultStateRequest;
import com.ydool.boot.modules.rddb.service.ReviewCommentService;
import com.ydool.boot.modules.rddb.service.ReviewService;
import com.ydool.boot.modules.rddb.wrapper.ReviewWrapper;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
/**
* @author: zhouyuan
* @date: 2022年05月16日
*/
@Controller
@RequestMapping("/api/review")
@Api(value = "A评议", tags = "A评议")
public class ApiReviewController extends ApiBaseController {
@Autowired
ReviewService reviewService;
@Autowired
ReviewCommentService reviewCommentService;
@ApiImplicitParams({
@ApiImplicitParam(name = "page", value = "当前页"),
@ApiImplicitParam(name = "size", value = "显示条数"),
@ApiImplicitParam(name = "type", value = "类型 work工作评议/subject专题评议/officer两官评议", required = true),
})
@DynamicResponseParameters(properties = {
@DynamicParameter(value = "评议", name = "data", dataTypeClass = ReviewDto.class)
})
@ApiOperation("评议列表 (被指定的人与创建人可见)")
@GetMapping
public void reviewPage(String type) {
QueryWrapper<Review> qw = new QueryWrapper<Review>()
.eq("type", type)
.and(_qw -> _qw
.eq("created_id", getApiUserId())
.or()
.inSql("id", "select review_id from t_review_user where user_id='" + getApiUserId() + "'")
.or()
.inSql("id", "select review_id from t_review_audit where user_id='" + getApiUserId() + "'"))
.orderByDesc("created_at");
IPage<Review> paged = reviewService.page(new Page<>(getPageNum(), getPageSize()), qw);
render(Ret.ok().paged(ReviewWrapper.build().pageVO(paged)));
}
@ApiImplicitParams({
@ApiImplicitParam(name = "page", value = "当前页"),
@ApiImplicitParam(name = "size", value = "显示条数"),
@ApiImplicitParam(name = "type", value = "类型 work工作评议/subject专题评议/officer两官评议", required = true),
})
@DynamicResponseParameters(properties = {
@DynamicParameter(value = "评议", name = "data", dataTypeClass = ReviewDto.class)
})
@ApiOperation("公告栏 (所有人可见)")
@GetMapping("public")
public void publicPage(String type) {
QueryWrapper<Review> qw = new QueryWrapper<Review>()
.eq("type", type)
.ge("state", Review.STATE_PUBLIC)
.orderByDesc("created_at");
IPage<Review> paged = reviewService.page(new Page<>(getPageNum(), getPageSize()), qw);
render(Ret.ok().paged(ReviewWrapper.build().pageVO(paged)));
}
@ApiOperation("详情")
@GetMapping("{id}")
@ResponseBody
@ApiImplicitParam(name = "id", value = "评议id")
@DynamicResponseParameters(properties = {
@DynamicParameter(name = "data", value = "评议", dataTypeClass = ReviewDto.class)
})
public void reviewDetail(@PathVariable String id) {
Review review = reviewService.getById(id);
Assert.notNull(review, "未找到该记录");
render(Ret.ok().data(ReviewWrapper.build().entityVO(review)));
}
@ApiOperation("评论")
@PostMapping("comment")
@ResponseBody
public void comment(@Validated ReviewCommentRequest reviewCommentRequest) {
Ret ret = reviewService.comment(reviewCommentRequest, getApiUser());
render(ret);
}
@ApiImplicitParams({
@ApiImplicitParam(name = "page", value = "当前页"),
@ApiImplicitParam(name = "size", value = "显示条数"),
@ApiImplicitParam(name = "reviewId", value = "评议id"),
@ApiImplicitParam(name = "type", value = "评议环节 1-7")
})
@DynamicResponseParameters(properties = {
@DynamicParameter(value = "评议评论", name = "data", dataTypeClass = ReviewComment.class)
})
@ApiOperation("评论列表")
@GetMapping("comment")
public void commentPage(String reviewId, Integer type) {
LambdaQueryWrapper<ReviewComment> qw = new LambdaQueryWrapper<ReviewComment>()
.eq(StrUtil.isNotBlank(reviewId), ReviewComment::getReviewId, reviewId)
.eq(type != null, ReviewComment::getType, type)
.orderByDesc(ReviewComment::getCreatedAt);
IPage<ReviewComment> paged = reviewCommentService.page(new Page<>(getPageNum(), getPageSize()), qw);
render(Ret.ok().paged(paged));
}
@ApiOperation("内部上报环节")
@PostMapping("state/in_report")
@ResponseBody
@DynamicResponseParameters(properties = {
@DynamicParameter(name = "data", value = "评议", dataTypeClass = ReviewDto.class)
})
public void stateInReportSave(@Validated ReviewInReportStateRequest reviewInReportStateRequest) {
Review review = reviewService.stateInReportSave(reviewInReportStateRequest, getApiUser());
render(Ret.ok().data(ReviewWrapper.build().entityVO(review)));
}
@ApiOperation("审批")
@PostMapping("audit")
@ResponseBody
public void audit(@Validated ReviewAuditRequest reviewAuditRequest) {
Ret ret = reviewService.audit(reviewAuditRequest, getApiUser());
render(ret);
}
@ApiOperation("上传自查/调查报告环节")
@PostMapping("state/check")
@ResponseBody
@DynamicResponseParameters(properties = {
@DynamicParameter(name = "data", value = "评议", dataTypeClass = ReviewDto.class)
})
public void stateCheckSave(@Validated ReviewCheckStateRequest reviewCheckStateRequest) {
Review review = reviewService.stateCheckSave(reviewCheckStateRequest, getApiUser());
render(Ret.ok().data(ReviewWrapper.build().entityVO(review)));
}
@ApiOperation("打分")
@PostMapping("check")
@ResponseBody
public void check(@Validated ReviewCheckRequest reviewCheckRequest) {
Ret ret = reviewService.check(reviewCheckRequest, getApiUser());
render(ret);
}
@ApiOperation("打分结束")
@PostMapping("check/end/{id}")
@ApiImplicitParam(name = "id", value = "评议id")
@ResponseBody
public void checkEnd(@PathVariable String id) {
Ret ret = reviewService.checkEnd(id, getApiUser());
render(ret);
}
@ApiOperation("上传评议意见环节")
@PostMapping("state/opinion")
@ResponseBody
@DynamicResponseParameters(properties = {
@DynamicParameter(name = "data", value = "评议", dataTypeClass = ReviewDto.class)
})
public void stateOpinionSave(@Validated ReviewOpinionStateRequest reviewOpinionStateRequest) {
Review review = reviewService.stateOpinionSave(reviewOpinionStateRequest, getApiUser());
render(Ret.ok().data(ReviewWrapper.build().entityVO(review)));
}
@ApiOperation("上传整改结果环节")
@PostMapping("state/result")
@ResponseBody
@DynamicResponseParameters(properties = {
@DynamicParameter(name = "data", value = "评议", dataTypeClass = ReviewDto.class)
})
public void stateResultSave(@Validated ReviewResultStateRequest reviewResultStateRequest) {
Review review = reviewService.stateResultSave(reviewResultStateRequest, getApiUser());
render(Ret.ok().data(ReviewWrapper.build().entityVO(review)));
}
}
//package com.ydool.boot.api.controller;
//
//
//import cn.hutool.core.lang.Assert;
//import cn.hutool.core.util.StrUtil;
//import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
//import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
//import com.baomidou.mybatisplus.core.metadata.IPage;
//import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
//import com.github.xiaoymin.knife4j.annotations.DynamicParameter;
//import com.github.xiaoymin.knife4j.annotations.DynamicResponseParameters;
//import com.ydool.boot.common.result.Ret;
//import com.ydool.boot.modules.rddb.entity.Review;
//import com.ydool.boot.modules.rddb.entity.ReviewComment;
//import com.ydool.boot.modules.rddb.entity.dto.ReviewDto;
//import com.ydool.boot.modules.rddb.entity.request.review.ReviewAuditRequest;
//import com.ydool.boot.modules.rddb.entity.request.review.ReviewCheckRequest;
//import com.ydool.boot.modules.rddb.entity.request.review.ReviewCommentRequest;
//import com.ydool.boot.modules.rddb.entity.request.review.state.ReviewCheckStateRequest;
//import com.ydool.boot.modules.rddb.entity.request.review.state.ReviewInReportStateRequest;
//import com.ydool.boot.modules.rddb.entity.request.review.state.ReviewOpinionStateRequest;
//import com.ydool.boot.modules.rddb.entity.request.review.state.ReviewResultStateRequest;
//import com.ydool.boot.modules.rddb.service.ReviewCommentService;
//import com.ydool.boot.modules.rddb.service.ReviewService;
//import com.ydool.boot.modules.rddb.wrapper.ReviewWrapper;
//import io.swagger.annotations.Api;
//import io.swagger.annotations.ApiImplicitParam;
//import io.swagger.annotations.ApiImplicitParams;
//import io.swagger.annotations.ApiOperation;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.stereotype.Controller;
//import org.springframework.validation.annotation.Validated;
//import org.springframework.web.bind.annotation.*;
//
//
///**
// * @author: zhouyuan
// * @date: 2022年05月16日
// */
//@Controller
//@RequestMapping("/api/review")
//@Api(value = "A评议", tags = "A评议")
//public class ApiReviewController extends ApiBaseController {
//
// @Autowired
// ReviewService reviewService;
// @Autowired
// ReviewCommentService reviewCommentService;
//
// @ApiImplicitParams({
// @ApiImplicitParam(name = "page", value = "当前页"),
// @ApiImplicitParam(name = "size", value = "显示条数"),
// @ApiImplicitParam(name = "type", value = "类型 work工作评议/subject专题评议/officer两官评议", required = true),
// })
// @DynamicResponseParameters(properties = {
// @DynamicParameter(value = "评议", name = "data", dataTypeClass = ReviewDto.class)
// })
// @ApiOperation("评议列表 (被指定的人与创建人可见)")
// @GetMapping
// public void reviewPage(String type) {
// QueryWrapper<Review> qw = new QueryWrapper<Review>()
// .eq("type", type)
// .and(_qw -> _qw
// .eq("created_id", getApiUserId())
// .or()
// .inSql("id", "select review_id from t_review_user where user_id='" + getApiUserId() + "'")
// .or()
// .inSql("id", "select review_id from t_review_audit where user_id='" + getApiUserId() + "'"))
// .orderByDesc("created_at");
// IPage<Review> paged = reviewService.page(new Page<>(getPageNum(), getPageSize()), qw);
// render(Ret.ok().paged(ReviewWrapper.build().pageVO(paged)));
// }
//
// @ApiImplicitParams({
// @ApiImplicitParam(name = "page", value = "当前页"),
// @ApiImplicitParam(name = "size", value = "显示条数"),
// @ApiImplicitParam(name = "type", value = "类型 work工作评议/subject专题评议/officer两官评议", required = true),
// })
// @DynamicResponseParameters(properties = {
// @DynamicParameter(value = "评议", name = "data", dataTypeClass = ReviewDto.class)
// })
// @ApiOperation("公告栏 (所有人可见)")
// @GetMapping("public")
// public void publicPage(String type) {
// QueryWrapper<Review> qw = new QueryWrapper<Review>()
// .eq("type", type)
// .ge("state", Review.STATE_PUBLIC)
// .orderByDesc("created_at");
// IPage<Review> paged = reviewService.page(new Page<>(getPageNum(), getPageSize()), qw);
// render(Ret.ok().paged(ReviewWrapper.build().pageVO(paged)));
// }
//
// @ApiOperation("详情")
// @GetMapping("{id}")
// @ResponseBody
// @ApiImplicitParam(name = "id", value = "评议id")
// @DynamicResponseParameters(properties = {
// @DynamicParameter(name = "data", value = "评议", dataTypeClass = ReviewDto.class)
// })
// public void reviewDetail(@PathVariable String id) {
// Review review = reviewService.getById(id);
// Assert.notNull(review, "未找到该记录");
// render(Ret.ok().data(ReviewWrapper.build().entityVO(review)));
// }
//
//
// @ApiOperation("评论")
// @PostMapping("comment")
// @ResponseBody
// public void comment(@Validated ReviewCommentRequest reviewCommentRequest) {
// Ret ret = reviewService.comment(reviewCommentRequest, getApiUser());
// render(ret);
// }
//
// @ApiImplicitParams({
// @ApiImplicitParam(name = "page", value = "当前页"),
// @ApiImplicitParam(name = "size", value = "显示条数"),
// @ApiImplicitParam(name = "reviewId", value = "评议id"),
// @ApiImplicitParam(name = "type", value = "评议环节 1-7")
// })
// @DynamicResponseParameters(properties = {
// @DynamicParameter(value = "评议评论", name = "data", dataTypeClass = ReviewComment.class)
// })
// @ApiOperation("评论列表")
// @GetMapping("comment")
// public void commentPage(String reviewId, Integer type) {
// LambdaQueryWrapper<ReviewComment> qw = new LambdaQueryWrapper<ReviewComment>()
// .eq(StrUtil.isNotBlank(reviewId), ReviewComment::getReviewId, reviewId)
// .eq(type != null, ReviewComment::getType, type)
// .orderByDesc(ReviewComment::getCreatedAt);
// IPage<ReviewComment> paged = reviewCommentService.page(new Page<>(getPageNum(), getPageSize()), qw);
// render(Ret.ok().paged(paged));
// }
//
// @ApiOperation("内部上报环节")
// @PostMapping("state/in_report")
// @ResponseBody
// @DynamicResponseParameters(properties = {
// @DynamicParameter(name = "data", value = "评议", dataTypeClass = ReviewDto.class)
// })
// public void stateInReportSave(@Validated ReviewInReportStateRequest reviewInReportStateRequest) {
// Review review = reviewService.stateInReportSave(reviewInReportStateRequest, getApiUser());
// render(Ret.ok().data(ReviewWrapper.build().entityVO(review)));
// }
//
// @ApiOperation("审批")
// @PostMapping("audit")
// @ResponseBody
// public void audit(@Validated ReviewAuditRequest reviewAuditRequest) {
// Ret ret = reviewService.audit(reviewAuditRequest, getApiUser());
// render(ret);
// }
//
// @ApiOperation("上传自查/调查报告环节")
// @PostMapping("state/check")
// @ResponseBody
// @DynamicResponseParameters(properties = {
// @DynamicParameter(name = "data", value = "评议", dataTypeClass = ReviewDto.class)
// })
// public void stateCheckSave(@Validated ReviewCheckStateRequest reviewCheckStateRequest) {
// Review review = reviewService.stateCheckSave(reviewCheckStateRequest, getApiUser());
// render(Ret.ok().data(ReviewWrapper.build().entityVO(review)));
// }
//
// @ApiOperation("打分")
// @PostMapping("check")
// @ResponseBody
// public void check(@Validated ReviewCheckRequest reviewCheckRequest) {
// Ret ret = reviewService.check(reviewCheckRequest, getApiUser());
// render(ret);
// }
//
// @ApiOperation("打分结束")
// @PostMapping("check/end/{id}")
// @ApiImplicitParam(name = "id", value = "评议id")
// @ResponseBody
// public void checkEnd(@PathVariable String id) {
// Ret ret = reviewService.checkEnd(id, getApiUser());
// render(ret);
// }
//
// @ApiOperation("上传评议意见环节")
// @PostMapping("state/opinion")
// @ResponseBody
// @DynamicResponseParameters(properties = {
// @DynamicParameter(name = "data", value = "评议", dataTypeClass = ReviewDto.class)
// })
// public void stateOpinionSave(@Validated ReviewOpinionStateRequest reviewOpinionStateRequest) {
// Review review = reviewService.stateOpinionSave(reviewOpinionStateRequest, getApiUser());
// render(Ret.ok().data(ReviewWrapper.build().entityVO(review)));
// }
//
// @ApiOperation("上传整改结果环节")
// @PostMapping("state/result")
// @ResponseBody
// @DynamicResponseParameters(properties = {
// @DynamicParameter(name = "data", value = "评议", dataTypeClass = ReviewDto.class)
// })
// public void stateResultSave(@Validated ReviewResultStateRequest reviewResultStateRequest) {
// Review review = reviewService.stateResultSave(reviewResultStateRequest, getApiUser());
// render(Ret.ok().data(ReviewWrapper.build().entityVO(review)));
// }
//
//}

View File

@ -0,0 +1,206 @@
package com.ydool.boot.api.controller;
import cn.hutool.core.lang.Assert;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.xiaoymin.knife4j.annotations.DynamicParameter;
import com.github.xiaoymin.knife4j.annotations.DynamicResponseParameters;
import com.ydool.boot.common.result.Ret;
import com.ydool.boot.modules.rddb.entity.ReviewOfficer;
import com.ydool.boot.modules.rddb.entity.ReviewOfficerComment;
import com.ydool.boot.modules.rddb.entity.dto.ReviewOfficerDto;
import com.ydool.boot.modules.rddb.entity.request.review_officer.ReviewOfficerAuditRequest;
import com.ydool.boot.modules.rddb.entity.request.review_officer.ReviewOfficerCheckRequest;
import com.ydool.boot.modules.rddb.entity.request.review_officer.ReviewOfficerCommentRequest;
import com.ydool.boot.modules.rddb.entity.request.review_officer.state.ReviewOfficerCheckStateRequest;
import com.ydool.boot.modules.rddb.entity.request.review_officer.state.ReviewOfficerInReportStateRequest;
import com.ydool.boot.modules.rddb.entity.request.review_officer.state.ReviewOfficerOpinionStateRequest;
import com.ydool.boot.modules.rddb.entity.request.review_officer.state.ReviewOfficerResultStateRequest;
import com.ydool.boot.modules.rddb.service.ReviewOfficerCommentService;
import com.ydool.boot.modules.rddb.service.ReviewOfficerService;
import com.ydool.boot.modules.rddb.wrapper.ReviewOfficerWrapper;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
/**
* @author: zhouyuan
* @date: 2022年05月16日
*/
@Controller
@RequestMapping("/api/review_officer")
@Api(value = "A两官评议", tags = "A两官评议")
public class ApiReviewOfficerController extends ApiBaseController {
@Autowired
ReviewOfficerService reviewOfficerService;
@Autowired
ReviewOfficerCommentService reviewOfficerCommentService;
@ApiImplicitParams({
@ApiImplicitParam(name = "page", value = "当前页"),
@ApiImplicitParam(name = "size", value = "显示条数"),
@ApiImplicitParam(name = "type", value = "类型 1法官评议 2检查官评议 "),
@ApiImplicitParam(name = "reviewSubject", value = "评议主题"),
})
@DynamicResponseParameters(properties = {
@DynamicParameter(value = "评议", name = "data", dataTypeClass = ReviewOfficerDto.class)
})
@ApiOperation("评议列表 (被指定的人与创建人可见)")
@GetMapping
public void reviewPage(String type,String reviewSubject) {
QueryWrapper<ReviewOfficer> qw = new QueryWrapper<ReviewOfficer>()
.eq("type", type)
.like(StrUtil.isNotBlank(reviewSubject),"review_subject", reviewSubject)
.and(_qw -> _qw
.eq("created_id", getApiUserId())
.or()
.inSql("id", "select review_id from t_review_officer_user where user_id='" + getApiUserId() + "'")
.or()
.inSql("id", "select review_id from t_review_officer_audit where user_id='" + getApiUserId() + "'"))
.orderByDesc("created_at");
IPage<ReviewOfficer> paged = reviewOfficerService.page(new Page<>(getPageNum(), getPageSize()), qw);
render(Ret.ok().paged(ReviewOfficerWrapper.build().pageVO(paged)));
}
// @ApiImplicitParams({
// @ApiImplicitParam(name = "page", value = "当前页"),
// @ApiImplicitParam(name = "size", value = "显示条数"),
// @ApiImplicitParam(name = "type", value = "类型"),
// })
// @DynamicResponseParameters(properties = {
// @DynamicParameter(value = "评议", name = "data", dataTypeClass = ReviewOfficerDto.class)
// })
// @ApiOperation("公告栏 (所有人可见)")
// @GetMapping("public")
// public void publicPage(String type) {
// QueryWrapper<ReviewOfficer> qw = new QueryWrapper<ReviewOfficer>()
//// .eq("type", type)
// .ge("state", ReviewOfficer.STATE_PUBLIC)
// .orderByDesc("created_at");
// IPage<ReviewOfficer> paged = reviewOfficerService.page(new Page<>(getPageNum(), getPageSize()), qw);
// render(Ret.ok().paged(ReviewOfficerWrapper.build().pageVO(paged)));
// }
@ApiOperation("详情")
@GetMapping("{id}")
@ResponseBody
@ApiImplicitParam(name = "id", value = "评议id")
@DynamicResponseParameters(properties = {
@DynamicParameter(name = "data", value = "评议", dataTypeClass = ReviewOfficerDto.class)
})
public void reviewDetail(@PathVariable String id) {
ReviewOfficer review = reviewOfficerService.getById(id);
Assert.notNull(review, "未找到该记录");
render(Ret.ok().data(ReviewOfficerWrapper.build().entityVO(review)));
}
@ApiOperation("评论")
@PostMapping("comment")
@ResponseBody
public void comment(@Validated ReviewOfficerCommentRequest reviewOfficerCommentRequest) {
Ret ret = reviewOfficerService.comment(reviewOfficerCommentRequest, getApiUser());
render(ret);
}
@ApiImplicitParams({
@ApiImplicitParam(name = "page", value = "当前页"),
@ApiImplicitParam(name = "size", value = "显示条数"),
@ApiImplicitParam(name = "reviewId", value = "评议id"),
@ApiImplicitParam(name = "type", value = "评议环节 1-7")
})
@DynamicResponseParameters(properties = {
@DynamicParameter(value = "评议评论", name = "data", dataTypeClass = ReviewOfficerComment.class)
})
@ApiOperation("评论列表")
@GetMapping("comment")
public void commentPage(String reviewId, Integer type) {
LambdaQueryWrapper<ReviewOfficerComment> qw = new LambdaQueryWrapper<ReviewOfficerComment>()
.eq(StrUtil.isNotBlank(reviewId), ReviewOfficerComment::getReviewId, reviewId)
.eq(type != null, ReviewOfficerComment::getType, type)
.orderByDesc(ReviewOfficerComment::getCreatedAt);
IPage<ReviewOfficerComment> paged = reviewOfficerCommentService.page(new Page<>(getPageNum(), getPageSize()), qw);
render(Ret.ok().paged(paged));
}
@ApiOperation("内部上报环节")
@PostMapping("state/in_report")
@ResponseBody
@DynamicResponseParameters(properties = {
@DynamicParameter(name = "data", value = "评议", dataTypeClass = ReviewOfficerDto.class)
})
public void stateInReportSave(@Validated ReviewOfficerInReportStateRequest reviewOfficerInReportStateRequest) {
ReviewOfficer review = reviewOfficerService.stateInReportSave(reviewOfficerInReportStateRequest, getApiUser());
render(Ret.ok().data(ReviewOfficerWrapper.build().entityVO(review)));
}
@ApiOperation("审批")
@PostMapping("audit")
@ResponseBody
public void audit(@Validated ReviewOfficerAuditRequest reviewOfficerAuditRequest) {
Ret ret = reviewOfficerService.audit(reviewOfficerAuditRequest, getApiUser());
render(ret);
}
@ApiOperation("上传自查/调查报告环节")
@PostMapping("state/check")
@ResponseBody
@DynamicResponseParameters(properties = {
@DynamicParameter(name = "data", value = "评议", dataTypeClass = ReviewOfficerDto.class)
})
public void stateCheckSave(@Validated ReviewOfficerCheckStateRequest reviewOfficerCheckStateRequest) {
ReviewOfficer review = reviewOfficerService.stateCheckSave(reviewOfficerCheckStateRequest, getApiUser());
render(Ret.ok().data(ReviewOfficerWrapper.build().entityVO(review)));
}
@ApiOperation("打分")
@PostMapping("check")
@ResponseBody
public void check(@Validated ReviewOfficerCheckRequest reviewOfficerCheckRequest) {
Ret ret = reviewOfficerService.check(reviewOfficerCheckRequest, getApiUser());
render(ret);
}
@ApiOperation("打分结束")
@PostMapping("check/end/{id}")
@ApiImplicitParam(name = "id", value = "评议id")
@ResponseBody
public void checkEnd(@PathVariable String id) {
Ret ret = reviewOfficerService.checkEnd(id, getApiUser());
render(ret);
}
@ApiOperation("上传评议意见环节")
@PostMapping("state/opinion")
@ResponseBody
@DynamicResponseParameters(properties = {
@DynamicParameter(name = "data", value = "评议", dataTypeClass = ReviewOfficerDto.class)
})
public void stateOpinionSave(@Validated ReviewOfficerOpinionStateRequest reviewOfficerOpinionStateRequest) {
ReviewOfficer review = reviewOfficerService.stateOpinionSave(reviewOfficerOpinionStateRequest, getApiUser());
render(Ret.ok().data(ReviewOfficerWrapper.build().entityVO(review)));
}
@ApiOperation("上传整改结果环节")
@PostMapping("state/result")
@ResponseBody
@DynamicResponseParameters(properties = {
@DynamicParameter(name = "data", value = "评议", dataTypeClass = ReviewOfficerDto.class)
})
public void stateResultSave(@Validated ReviewOfficerResultStateRequest reviewOfficerResultStateRequest) {
ReviewOfficer review = reviewOfficerService.stateResultSave(reviewOfficerResultStateRequest, getApiUser());
render(Ret.ok().data(ReviewOfficerWrapper.build().entityVO(review)));
}
}

View File

@ -0,0 +1,206 @@
package com.ydool.boot.api.controller;
import cn.hutool.core.lang.Assert;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.xiaoymin.knife4j.annotations.DynamicParameter;
import com.github.xiaoymin.knife4j.annotations.DynamicResponseParameters;
import com.ydool.boot.common.result.Ret;
import com.ydool.boot.modules.rddb.entity.ReviewSubject;
import com.ydool.boot.modules.rddb.entity.ReviewSubjectComment;
import com.ydool.boot.modules.rddb.entity.dto.ReviewSubjectDto;
import com.ydool.boot.modules.rddb.entity.request.review_subject.ReviewSubjectAuditRequest;
import com.ydool.boot.modules.rddb.entity.request.review_subject.ReviewSubjectCheckRequest;
import com.ydool.boot.modules.rddb.entity.request.review_subject.ReviewSubjectCommentRequest;
import com.ydool.boot.modules.rddb.entity.request.review_subject.state.ReviewSubjectCheckStateRequest;
import com.ydool.boot.modules.rddb.entity.request.review_subject.state.ReviewSubjectInReportStateRequest;
import com.ydool.boot.modules.rddb.entity.request.review_subject.state.ReviewSubjectOpinionStateRequest;
import com.ydool.boot.modules.rddb.entity.request.review_subject.state.ReviewSubjectResultStateRequest;
import com.ydool.boot.modules.rddb.service.ReviewSubjectCommentService;
import com.ydool.boot.modules.rddb.service.ReviewSubjectService;
import com.ydool.boot.modules.rddb.wrapper.ReviewSubjectWrapper;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
/**
* @author: zhouyuan
* @date: 2022年05月16日
*/
@Controller
@RequestMapping("/api/review_subject")
@Api(value = "A专题评议", tags = "A专题评议")
public class ApiReviewSubjectController extends ApiBaseController {
@Autowired
ReviewSubjectService reviewSubjectService;
@Autowired
ReviewSubjectCommentService reviewSubjectCommentService;
@ApiImplicitParams({
@ApiImplicitParam(name = "page", value = "当前页"),
@ApiImplicitParam(name = "size", value = "显示条数"),
@ApiImplicitParam(name = "type", value = "类型 1专题询问 2专项评议 "),
@ApiImplicitParam(name = "reviewSubject", value = "评议主题"),
})
@DynamicResponseParameters(properties = {
@DynamicParameter(value = "评议", name = "data", dataTypeClass = ReviewSubjectDto.class)
})
@ApiOperation("评议列表 (被指定的人与创建人可见)")
@GetMapping
public void reviewPage(String type,String reviewSubject) {
QueryWrapper<ReviewSubject> qw = new QueryWrapper<ReviewSubject>()
.eq("type", type)
.like(StrUtil.isNotBlank(reviewSubject),"review_subject", reviewSubject)
.and(_qw -> _qw
.eq("created_id", getApiUserId())
.or()
.inSql("id", "select review_id from t_review_subject_user where user_id='" + getApiUserId() + "'")
.or()
.inSql("id", "select review_id from t_review_subject_audit where user_id='" + getApiUserId() + "'"))
.orderByDesc("created_at");
IPage<ReviewSubject> paged = reviewSubjectService.page(new Page<>(getPageNum(), getPageSize()), qw);
render(Ret.ok().paged(ReviewSubjectWrapper.build().pageVO(paged)));
}
// @ApiImplicitParams({
// @ApiImplicitParam(name = "page", value = "当前页"),
// @ApiImplicitParam(name = "size", value = "显示条数"),
// @ApiImplicitParam(name = "type", value = "类型", required = true),
// })
// @DynamicResponseParameters(properties = {
// @DynamicParameter(value = "评议", name = "data", dataTypeClass = ReviewSubjectDto.class)
// })
// @ApiOperation("公告栏 (所有人可见)")
// @GetMapping("public")
// public void publicPage(String type) {
// QueryWrapper<ReviewSubject> qw = new QueryWrapper<ReviewSubject>()
//// .eq("type", type)
// .ge("state", ReviewSubject.STATE_PUBLIC)
// .orderByDesc("created_at");
// IPage<ReviewSubject> paged = reviewSubjectService.page(new Page<>(getPageNum(), getPageSize()), qw);
// render(Ret.ok().paged(ReviewSubjectWrapper.build().pageVO(paged)));
// }
@ApiOperation("详情")
@GetMapping("{id}")
@ResponseBody
@ApiImplicitParam(name = "id", value = "评议id")
@DynamicResponseParameters(properties = {
@DynamicParameter(name = "data", value = "评议", dataTypeClass = ReviewSubjectDto.class)
})
public void reviewDetail(@PathVariable String id) {
ReviewSubject review = reviewSubjectService.getById(id);
Assert.notNull(review, "未找到该记录");
render(Ret.ok().data(ReviewSubjectWrapper.build().entityVO(review)));
}
@ApiOperation("评论")
@PostMapping("comment")
@ResponseBody
public void comment(@Validated ReviewSubjectCommentRequest reviewSubjectCommentRequest) {
Ret ret = reviewSubjectService.comment(reviewSubjectCommentRequest, getApiUser());
render(ret);
}
@ApiImplicitParams({
@ApiImplicitParam(name = "page", value = "当前页"),
@ApiImplicitParam(name = "size", value = "显示条数"),
@ApiImplicitParam(name = "reviewId", value = "评议id"),
@ApiImplicitParam(name = "type", value = "评议环节 1-7")
})
@DynamicResponseParameters(properties = {
@DynamicParameter(value = "评议评论", name = "data", dataTypeClass = ReviewSubjectComment.class)
})
@ApiOperation("评论列表")
@GetMapping("comment")
public void commentPage(String reviewId, Integer type) {
LambdaQueryWrapper<ReviewSubjectComment> qw = new LambdaQueryWrapper<ReviewSubjectComment>()
.eq(StrUtil.isNotBlank(reviewId), ReviewSubjectComment::getReviewId, reviewId)
.eq(type != null, ReviewSubjectComment::getType, type)
.orderByDesc(ReviewSubjectComment::getCreatedAt);
IPage<ReviewSubjectComment> paged = reviewSubjectCommentService.page(new Page<>(getPageNum(), getPageSize()), qw);
render(Ret.ok().paged(paged));
}
@ApiOperation("内部上报环节")
@PostMapping("state/in_report")
@ResponseBody
@DynamicResponseParameters(properties = {
@DynamicParameter(name = "data", value = "评议", dataTypeClass = ReviewSubjectDto.class)
})
public void stateInReportSave(@Validated ReviewSubjectInReportStateRequest reviewSubjectInReportStateRequest) {
ReviewSubject review = reviewSubjectService.stateInReportSave(reviewSubjectInReportStateRequest, getApiUser());
render(Ret.ok().data(ReviewSubjectWrapper.build().entityVO(review)));
}
@ApiOperation("审批")
@PostMapping("audit")
@ResponseBody
public void audit(@Validated ReviewSubjectAuditRequest reviewSubjectAuditRequest) {
Ret ret = reviewSubjectService.audit(reviewSubjectAuditRequest, getApiUser());
render(ret);
}
@ApiOperation("上传自查/调查报告环节")
@PostMapping("state/check")
@ResponseBody
@DynamicResponseParameters(properties = {
@DynamicParameter(name = "data", value = "评议", dataTypeClass = ReviewSubjectDto.class)
})
public void stateCheckSave(@Validated ReviewSubjectCheckStateRequest reviewSubjectCheckStateRequest) {
ReviewSubject review = reviewSubjectService.stateCheckSave(reviewSubjectCheckStateRequest, getApiUser());
render(Ret.ok().data(ReviewSubjectWrapper.build().entityVO(review)));
}
@ApiOperation("打分")
@PostMapping("check")
@ResponseBody
public void check(@Validated ReviewSubjectCheckRequest reviewSubjectCheckRequest) {
Ret ret = reviewSubjectService.check(reviewSubjectCheckRequest, getApiUser());
render(ret);
}
@ApiOperation("打分结束")
@PostMapping("check/end/{id}")
@ApiImplicitParam(name = "id", value = "评议id")
@ResponseBody
public void checkEnd(@PathVariable String id) {
Ret ret = reviewSubjectService.checkEnd(id, getApiUser());
render(ret);
}
@ApiOperation("上传评议意见环节")
@PostMapping("state/opinion")
@ResponseBody
@DynamicResponseParameters(properties = {
@DynamicParameter(name = "data", value = "评议", dataTypeClass = ReviewSubjectDto.class)
})
public void stateOpinionSave(@Validated ReviewSubjectOpinionStateRequest reviewSubjectOpinionStateRequest) {
ReviewSubject review = reviewSubjectService.stateOpinionSave(reviewSubjectOpinionStateRequest, getApiUser());
render(Ret.ok().data(ReviewSubjectWrapper.build().entityVO(review)));
}
@ApiOperation("上传整改结果环节")
@PostMapping("state/result")
@ResponseBody
@DynamicResponseParameters(properties = {
@DynamicParameter(name = "data", value = "评议", dataTypeClass = ReviewSubjectDto.class)
})
public void stateResultSave(@Validated ReviewSubjectResultStateRequest reviewSubjectResultStateRequest) {
ReviewSubject review = reviewSubjectService.stateResultSave(reviewSubjectResultStateRequest, getApiUser());
render(Ret.ok().data(ReviewSubjectWrapper.build().entityVO(review)));
}
}

View File

@ -0,0 +1,204 @@
package com.ydool.boot.api.controller;
import cn.hutool.core.lang.Assert;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.xiaoymin.knife4j.annotations.DynamicParameter;
import com.github.xiaoymin.knife4j.annotations.DynamicResponseParameters;
import com.ydool.boot.common.result.Ret;
import com.ydool.boot.modules.rddb.entity.ReviewWork;
import com.ydool.boot.modules.rddb.entity.ReviewWorkComment;
import com.ydool.boot.modules.rddb.entity.dto.ReviewWorkDto;
import com.ydool.boot.modules.rddb.entity.request.review_work.ReviewWorkAuditRequest;
import com.ydool.boot.modules.rddb.entity.request.review_work.ReviewWorkCheckRequest;
import com.ydool.boot.modules.rddb.entity.request.review_work.ReviewWorkCommentRequest;
import com.ydool.boot.modules.rddb.entity.request.review_work.state.ReviewWorkCheckStateRequest;
import com.ydool.boot.modules.rddb.entity.request.review_work.state.ReviewWorkInReportStateRequest;
import com.ydool.boot.modules.rddb.entity.request.review_work.state.ReviewWorkOpinionStateRequest;
import com.ydool.boot.modules.rddb.entity.request.review_work.state.ReviewWorkResultStateRequest;
import com.ydool.boot.modules.rddb.service.ReviewWorkCommentService;
import com.ydool.boot.modules.rddb.service.ReviewWorkService;
import com.ydool.boot.modules.rddb.wrapper.ReviewWorkWrapper;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
/**
* @author: zhouyuan
* @date: 2022年05月16日
*/
@Controller
@RequestMapping("/api/review_work")
@Api(value = "A工作评议", tags = "A工作评议")
public class ApiReviewWorkController extends ApiBaseController {
@Autowired
ReviewWorkService reviewWorkService;
@Autowired
ReviewWorkCommentService reviewWorkCommentService;
@ApiImplicitParams({
@ApiImplicitParam(name = "page", value = "当前页"),
@ApiImplicitParam(name = "size", value = "显示条数"),
@ApiImplicitParam(name = "type", value = "类型"),
})
@DynamicResponseParameters(properties = {
@DynamicParameter(value = "评议", name = "data", dataTypeClass = ReviewWorkDto.class)
})
@ApiOperation("评议列表 (被指定的人与创建人可见)")
@GetMapping
public void reviewPage(String type) {
QueryWrapper<ReviewWork> qw = new QueryWrapper<ReviewWork>()
// .eq("type", type)
.and(_qw -> _qw
.eq("created_id", getApiUserId())
.or()
.inSql("id", "select review_id from t_review_work_user where user_id='" + getApiUserId() + "'")
.or()
.inSql("id", "select review_id from t_review_work_audit where user_id='" + getApiUserId() + "'"))
.orderByDesc("created_at");
IPage<ReviewWork> paged = reviewWorkService.page(new Page<>(getPageNum(), getPageSize()), qw);
render(Ret.ok().paged(ReviewWorkWrapper.build().pageVO(paged)));
}
@ApiImplicitParams({
@ApiImplicitParam(name = "page", value = "当前页"),
@ApiImplicitParam(name = "size", value = "显示条数"),
@ApiImplicitParam(name = "type", value = "类型"),
})
@DynamicResponseParameters(properties = {
@DynamicParameter(value = "评议", name = "data", dataTypeClass = ReviewWorkDto.class)
})
@ApiOperation("公告栏 (所有人可见)")
@GetMapping("public")
public void publicPage(String type) {
QueryWrapper<ReviewWork> qw = new QueryWrapper<ReviewWork>()
// .eq("type", type)
.ge("state", ReviewWork.STATE_PUBLIC)
.orderByDesc("created_at");
IPage<ReviewWork> paged = reviewWorkService.page(new Page<>(getPageNum(), getPageSize()), qw);
render(Ret.ok().paged(ReviewWorkWrapper.build().pageVO(paged)));
}
@ApiOperation("详情")
@GetMapping("{id}")
@ResponseBody
@ApiImplicitParam(name = "id", value = "评议id")
@DynamicResponseParameters(properties = {
@DynamicParameter(name = "data", value = "评议", dataTypeClass = ReviewWorkDto.class)
})
public void reviewDetail(@PathVariable String id) {
ReviewWork review = reviewWorkService.getById(id);
Assert.notNull(review, "未找到该记录");
render(Ret.ok().data(ReviewWorkWrapper.build().entityVO(review)));
}
@ApiOperation("评论")
@PostMapping("comment")
@ResponseBody
public void comment(@Validated ReviewWorkCommentRequest reviewWorkCommentRequest) {
Ret ret = reviewWorkService.comment(reviewWorkCommentRequest, getApiUser());
render(ret);
}
@ApiImplicitParams({
@ApiImplicitParam(name = "page", value = "当前页"),
@ApiImplicitParam(name = "size", value = "显示条数"),
@ApiImplicitParam(name = "reviewId", value = "评议id"),
@ApiImplicitParam(name = "type", value = "评议环节 1-7")
})
@DynamicResponseParameters(properties = {
@DynamicParameter(value = "评议评论", name = "data", dataTypeClass = ReviewWorkComment.class)
})
@ApiOperation("评论列表")
@GetMapping("comment")
public void commentPage(String reviewId, Integer type) {
LambdaQueryWrapper<ReviewWorkComment> qw = new LambdaQueryWrapper<ReviewWorkComment>()
.eq(StrUtil.isNotBlank(reviewId), ReviewWorkComment::getReviewId, reviewId)
.eq(type != null, ReviewWorkComment::getType, type)
.orderByDesc(ReviewWorkComment::getCreatedAt);
IPage<ReviewWorkComment> paged = reviewWorkCommentService.page(new Page<>(getPageNum(), getPageSize()), qw);
render(Ret.ok().paged(paged));
}
@ApiOperation("内部上报环节")
@PostMapping("state/in_report")
@ResponseBody
@DynamicResponseParameters(properties = {
@DynamicParameter(name = "data", value = "评议", dataTypeClass = ReviewWorkDto.class)
})
public void stateInReportSave(@Validated ReviewWorkInReportStateRequest reviewWorkInReportStateRequest) {
ReviewWork review = reviewWorkService.stateInReportSave(reviewWorkInReportStateRequest, getApiUser());
render(Ret.ok().data(ReviewWorkWrapper.build().entityVO(review)));
}
@ApiOperation("审批")
@PostMapping("audit")
@ResponseBody
public void audit(@Validated ReviewWorkAuditRequest reviewWorkAuditRequest) {
Ret ret = reviewWorkService.audit(reviewWorkAuditRequest, getApiUser());
render(ret);
}
@ApiOperation("上传自查/调查报告环节")
@PostMapping("state/check")
@ResponseBody
@DynamicResponseParameters(properties = {
@DynamicParameter(name = "data", value = "评议", dataTypeClass = ReviewWorkDto.class)
})
public void stateCheckSave(@Validated ReviewWorkCheckStateRequest reviewWorkCheckStateRequest) {
ReviewWork review = reviewWorkService.stateCheckSave(reviewWorkCheckStateRequest, getApiUser());
render(Ret.ok().data(ReviewWorkWrapper.build().entityVO(review)));
}
@ApiOperation("打分")
@PostMapping("check")
@ResponseBody
public void check(@Validated ReviewWorkCheckRequest reviewWorkCheckRequest) {
Ret ret = reviewWorkService.check(reviewWorkCheckRequest, getApiUser());
render(ret);
}
@ApiOperation("打分结束")
@PostMapping("check/end/{id}")
@ApiImplicitParam(name = "id", value = "评议id")
@ResponseBody
public void checkEnd(@PathVariable String id) {
Ret ret = reviewWorkService.checkEnd(id, getApiUser());
render(ret);
}
@ApiOperation("上传评议意见环节")
@PostMapping("state/opinion")
@ResponseBody
@DynamicResponseParameters(properties = {
@DynamicParameter(name = "data", value = "评议", dataTypeClass = ReviewWorkDto.class)
})
public void stateOpinionSave(@Validated ReviewWorkOpinionStateRequest reviewWorkOpinionStateRequest) {
ReviewWork review = reviewWorkService.stateOpinionSave(reviewWorkOpinionStateRequest, getApiUser());
render(Ret.ok().data(ReviewWorkWrapper.build().entityVO(review)));
}
@ApiOperation("上传整改结果环节")
@PostMapping("state/result")
@ResponseBody
@DynamicResponseParameters(properties = {
@DynamicParameter(name = "data", value = "评议", dataTypeClass = ReviewWorkDto.class)
})
public void stateResultSave(@Validated ReviewWorkResultStateRequest reviewWorkResultStateRequest) {
ReviewWork review = reviewWorkService.stateResultSave(reviewWorkResultStateRequest, getApiUser());
render(Ret.ok().data(ReviewWorkWrapper.build().entityVO(review)));
}
}

View File

@ -0,0 +1,154 @@
package com.ydool.boot.modules.rddb.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ydool.boot.core.entity.BaseEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
/**
* <p>
* 评议
* </p>
*
* @author zhouyuan
* @since 2022-05-12
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("t_review_officer")
public class ReviewOfficer extends BaseEntity {
private static final long serialVersionUID = 1L;
//当前环节 (内部上报拟评议部门inReport:1 上报评议部门report:2 向社会征求被评议部门意见ask:3
//调查报告check:4 评议意见opinion:5 整改结果result:6 公示public:7)
public static Integer STATE_IN_REPORT = 1;
public static Integer STATE_REPORT = 2;
public static Integer STATE_ASK = 3;
public static Integer STATE_CHECK = 4;
public static Integer STATE_OPINION = 5;
public static Integer STATE_RESULT = 6;
public static Integer STATE_PUBLIC = 7;
/**
* 创建者
*/
private String createdId;
/**
* 更新者
*/
private String updatedId;
/**
* 评议主题
*/
@ApiModelProperty(value = "评议主题(评议部门,评议专题,评议对象)")
private String reviewSubject;
/**
* 类型
*/
@ApiModelProperty(value = "类型")
private String type;
/**
* 评议描述
*/
@ApiModelProperty(value = "评议描述(评议部门描述,评议专题描述,评议对象职位)")
private String reviewDesc;
/**
* 提名上传时间
*/
@DateTimeFormat(
pattern = "yyyy-MM-dd HH:mm:ss"
)
@JsonFormat(
pattern = "yyyy-MM-dd HH:mm:ss"
)
@ApiModelProperty(value = "提名上传时间")
private LocalDateTime reviewUploadAt;
/**
* 调查备注
*/
@ApiModelProperty(value = "调查备注")
private String checkRemark;
/**
* 调查上传时间
*/
@DateTimeFormat(
pattern = "yyyy-MM-dd HH:mm:ss"
)
@JsonFormat(
pattern = "yyyy-MM-dd HH:mm:ss"
)
@ApiModelProperty(value = "调查上传时间")
private LocalDateTime checkUploadAt;
/**
* 调查分数是否公开
*/
@ApiModelProperty(value = "调查分数是否公开 0不公开 1公开")
private Integer checkScoreState;
/**
* 评议意见备注
*/
@ApiModelProperty(value = "评议意见备注")
private String opinionRemark;
/**
* 评议意见上传时间
*/
@DateTimeFormat(
pattern = "yyyy-MM-dd HH:mm:ss"
)
@JsonFormat(
pattern = "yyyy-MM-dd HH:mm:ss"
)
@ApiModelProperty(value = "评议意见上传时间")
private LocalDateTime opinionUploadAt;
/**
* 整改备注
*/
@ApiModelProperty(value = "整改备注")
private String alterRemark;
/**
* 整改上传时间
*/
@DateTimeFormat(
pattern = "yyyy-MM-dd HH:mm:ss"
)
@JsonFormat(
pattern = "yyyy-MM-dd HH:mm:ss"
)
@ApiModelProperty(value = "整改上传时间")
private LocalDateTime alterUploadAt;
/**
* 审核状态 0待审批 1已通过 2已拒绝
*/
@ApiModelProperty(value = " 审核状态 0审批中 1已通过 2已拒绝")
private Integer status;
/**
* 当前环节
*/
@ApiModelProperty(value = " 当前环节 1-7")
private Integer state;
public ReviewOfficer() {
//默认公开分数
this.checkScoreState=1;
}
}

View File

@ -0,0 +1,60 @@
package com.ydool.boot.modules.rddb.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.ydool.boot.core.entity.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* <p>
* 评议附件
* </p>
*
* @author zhouyuan
* @since 2022-05-12
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("t_review_officer_attachment")
@Accessors(chain = true)
public class ReviewOfficerAttachment extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 创建者
*/
private String createdId;
/**
* 更新者
*/
private String updatedId;
/**
* 附件类型 与评议的state环节对应
*/
private Integer type;
/**
* 评议id
*/
private String reviewId;
/**
* 附件名
*/
private String title;
/**
* 附件路径
*/
private String attachment;
/**
* 文件大小
*/
private String size;
}

View File

@ -0,0 +1,79 @@
package com.ydool.boot.modules.rddb.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ydool.boot.core.entity.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
/**
* <p>
* 评议审批
* </p>
*
* @author zhouyuan
* @since 2022-05-12
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("t_review_officer_audit")
public class ReviewOfficerAudit extends BaseEntity{
private static final long serialVersionUID = 1L;
/**
* 创建者
*/
private String createdId;
/**
* 更新者
*/
private String updatedId;
/**
* 评议id
*/
private String reviewId;
/**
* 人员id
*/
private String userId;
private String userName;
/**
* 单条状态 0待审批 1已通过 2未通过
*/
private Integer status;
/**
* 未通过原因
*/
private String reason;
/**
* 审批时间
*/
@DateTimeFormat(
pattern = "yyyy-MM-dd HH:mm:ss"
)
@JsonFormat(
pattern = "yyyy-MM-dd HH:mm:ss"
)
private LocalDateTime auditAt;
/**
* 审批顺序从1开始
*/
private Integer sortNo;
/**
* 审批级别 共2级从1开始
*/
private Integer level;
}

View File

@ -0,0 +1,57 @@
package com.ydool.boot.modules.rddb.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.ydool.boot.core.entity.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* <p>
* 工作评议评论
* </p>
*
* @author zhouyuan
* @since 2022-05-12
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("t_review_comment")
public class ReviewOfficerComment extends BaseEntity{
private static final long serialVersionUID = 1L;
/**
* 创建者
*/
private String createdId;
/**
* 更新者
*/
private String updatedId;
/**
* 评论类型 与评议的state环节对应
*/
private Integer type;
/**
* 评议id
*/
private String reviewId;
/**
* 人员id
*/
private String userId;
/**
* 内容
*/
private String content;
/**
* 用户名
*/
private String userName;
}

View File

@ -0,0 +1,68 @@
package com.ydool.boot.modules.rddb.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ydool.boot.core.entity.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;
import java.math.BigDecimal;
import java.time.LocalDateTime;
/**
* <p>
* 工作评议人员
* </p>
*
* @author zhouyuan
* @since 2022-05-12
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("t_review_officer_user")
public class ReviewOfficerUser extends BaseEntity{
private static final long serialVersionUID = 1L;
/**
* 创建者
*/
private String createdId;
/**
* 更新者
*/
private String updatedId;
/**
* 评议id
*/
private String reviewId;
/**
* 人员id
*/
private String userId;
/**
* 人员名称
*/
private String userName;
/**
* 分数 1-100
*/
private BigDecimal score;
/**
* 打分时间
*/
@DateTimeFormat(
pattern = "yyyy-MM-dd HH:mm:ss"
)
@JsonFormat(
pattern = "yyyy-MM-dd HH:mm:ss"
)
private LocalDateTime scoreAt;
}

View File

@ -0,0 +1,154 @@
package com.ydool.boot.modules.rddb.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ydool.boot.core.entity.BaseEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
/**
* <p>
* 评议
* </p>
*
* @author zhouyuan
* @since 2022-05-12
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("t_review_subject")
public class ReviewSubject extends BaseEntity {
private static final long serialVersionUID = 1L;
//当前环节 (内部上报拟评议部门inReport:1 上报评议部门report:2 向社会征求被评议部门意见ask:3
//调查报告check:4 评议意见opinion:5 整改结果result:6 公示public:7)
public static Integer STATE_IN_REPORT = 1;
public static Integer STATE_REPORT = 2;
public static Integer STATE_ASK = 3;
public static Integer STATE_CHECK = 4;
public static Integer STATE_OPINION = 5;
public static Integer STATE_RESULT = 6;
public static Integer STATE_PUBLIC = 7;
/**
* 创建者
*/
private String createdId;
/**
* 更新者
*/
private String updatedId;
/**
* 评议主题
*/
@ApiModelProperty(value = "评议主题(评议部门,评议专题,评议对象)")
private String reviewSubject;
/**
* 类型
*/
@ApiModelProperty(value = "类型")
private String type;
/**
* 评议描述
*/
@ApiModelProperty(value = "评议描述(评议部门描述,评议专题描述,评议对象职位)")
private String reviewDesc;
/**
* 提名上传时间
*/
@DateTimeFormat(
pattern = "yyyy-MM-dd HH:mm:ss"
)
@JsonFormat(
pattern = "yyyy-MM-dd HH:mm:ss"
)
@ApiModelProperty(value = "提名上传时间")
private LocalDateTime reviewUploadAt;
/**
* 调查备注
*/
@ApiModelProperty(value = "调查备注")
private String checkRemark;
/**
* 调查上传时间
*/
@DateTimeFormat(
pattern = "yyyy-MM-dd HH:mm:ss"
)
@JsonFormat(
pattern = "yyyy-MM-dd HH:mm:ss"
)
@ApiModelProperty(value = "调查上传时间")
private LocalDateTime checkUploadAt;
/**
* 调查分数是否公开
*/
@ApiModelProperty(value = "调查分数是否公开 0不公开 1公开")
private Integer checkScoreState;
/**
* 评议意见备注
*/
@ApiModelProperty(value = "评议意见备注")
private String opinionRemark;
/**
* 评议意见上传时间
*/
@DateTimeFormat(
pattern = "yyyy-MM-dd HH:mm:ss"
)
@JsonFormat(
pattern = "yyyy-MM-dd HH:mm:ss"
)
@ApiModelProperty(value = "评议意见上传时间")
private LocalDateTime opinionUploadAt;
/**
* 整改备注
*/
@ApiModelProperty(value = "整改备注")
private String alterRemark;
/**
* 整改上传时间
*/
@DateTimeFormat(
pattern = "yyyy-MM-dd HH:mm:ss"
)
@JsonFormat(
pattern = "yyyy-MM-dd HH:mm:ss"
)
@ApiModelProperty(value = "整改上传时间")
private LocalDateTime alterUploadAt;
/**
* 审核状态 0待审批 1已通过 2已拒绝
*/
@ApiModelProperty(value = " 审核状态 0审批中 1已通过 2已拒绝")
private Integer status;
/**
* 当前环节
*/
@ApiModelProperty(value = " 当前环节 1-7")
private Integer state;
public ReviewSubject() {
//默认公开分数
this.checkScoreState=1;
}
}

View File

@ -0,0 +1,60 @@
package com.ydool.boot.modules.rddb.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.ydool.boot.core.entity.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* <p>
* 评议附件
* </p>
*
* @author zhouyuan
* @since 2022-05-12
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("t_review_subject_attachment")
@Accessors(chain = true)
public class ReviewSubjectAttachment extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 创建者
*/
private String createdId;
/**
* 更新者
*/
private String updatedId;
/**
* 附件类型 与评议的state环节对应
*/
private Integer type;
/**
* 评议id
*/
private String reviewId;
/**
* 附件名
*/
private String title;
/**
* 附件路径
*/
private String attachment;
/**
* 文件大小
*/
private String size;
}

View File

@ -0,0 +1,79 @@
package com.ydool.boot.modules.rddb.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ydool.boot.core.entity.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
/**
* <p>
* 评议审批
* </p>
*
* @author zhouyuan
* @since 2022-05-12
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("t_review_subject_audit")
public class ReviewSubjectAudit extends BaseEntity{
private static final long serialVersionUID = 1L;
/**
* 创建者
*/
private String createdId;
/**
* 更新者
*/
private String updatedId;
/**
* 评议id
*/
private String reviewId;
/**
* 人员id
*/
private String userId;
private String userName;
/**
* 单条状态 0待审批 1已通过 2未通过
*/
private Integer status;
/**
* 未通过原因
*/
private String reason;
/**
* 审批时间
*/
@DateTimeFormat(
pattern = "yyyy-MM-dd HH:mm:ss"
)
@JsonFormat(
pattern = "yyyy-MM-dd HH:mm:ss"
)
private LocalDateTime auditAt;
/**
* 审批顺序从1开始
*/
private Integer sortNo;
/**
* 审批级别 共2级从1开始
*/
private Integer level;
}

View File

@ -0,0 +1,57 @@
package com.ydool.boot.modules.rddb.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.ydool.boot.core.entity.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* <p>
* 工作评议评论
* </p>
*
* @author zhouyuan
* @since 2022-05-12
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("t_review_subject_comment")
public class ReviewSubjectComment extends BaseEntity{
private static final long serialVersionUID = 1L;
/**
* 创建者
*/
private String createdId;
/**
* 更新者
*/
private String updatedId;
/**
* 评论类型 与评议的state环节对应
*/
private Integer type;
/**
* 评议id
*/
private String reviewId;
/**
* 人员id
*/
private String userId;
/**
* 内容
*/
private String content;
/**
* 用户名
*/
private String userName;
}

View File

@ -0,0 +1,68 @@
package com.ydool.boot.modules.rddb.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ydool.boot.core.entity.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;
import java.math.BigDecimal;
import java.time.LocalDateTime;
/**
* <p>
* 工作评议人员
* </p>
*
* @author zhouyuan
* @since 2022-05-12
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("t_review_subject_user")
public class ReviewSubjectUser extends BaseEntity{
private static final long serialVersionUID = 1L;
/**
* 创建者
*/
private String createdId;
/**
* 更新者
*/
private String updatedId;
/**
* 评议id
*/
private String reviewId;
/**
* 人员id
*/
private String userId;
/**
* 人员名称
*/
private String userName;
/**
* 分数 1-100
*/
private BigDecimal score;
/**
* 打分时间
*/
@DateTimeFormat(
pattern = "yyyy-MM-dd HH:mm:ss"
)
@JsonFormat(
pattern = "yyyy-MM-dd HH:mm:ss"
)
private LocalDateTime scoreAt;
}

View File

@ -0,0 +1,148 @@
package com.ydool.boot.modules.rddb.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ydool.boot.core.entity.BaseEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
/**
* <p>
* 评议
* </p>
*
* @author zhouyuan
* @since 2022-05-12
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("t_review_work")
public class ReviewWork extends BaseEntity {
private static final long serialVersionUID = 1L;
//当前环节 (内部上报拟评议部门inReport:1 上报评议部门report:2 向社会征求被评议部门意见ask:3
//调查报告check:4 评议意见opinion:5 整改结果result:6 公示public:7)
public static Integer STATE_IN_REPORT = 1;
public static Integer STATE_REPORT = 2;
public static Integer STATE_ASK = 3;
public static Integer STATE_CHECK = 4;
public static Integer STATE_OPINION = 5;
public static Integer STATE_RESULT = 6;
public static Integer STATE_PUBLIC = 7;
/**
* 创建者
*/
private String createdId;
/**
* 更新者
*/
private String updatedId;
/**
* 评议主题
*/
@ApiModelProperty(value = "评议主题(评议部门,评议专题,评议对象)")
private String reviewSubject;
/**
* 评议描述
*/
@ApiModelProperty(value = "评议描述(评议部门描述,评议专题描述,评议对象职位)")
private String reviewDesc;
/**
* 提名上传时间
*/
@DateTimeFormat(
pattern = "yyyy-MM-dd HH:mm:ss"
)
@JsonFormat(
pattern = "yyyy-MM-dd HH:mm:ss"
)
@ApiModelProperty(value = "提名上传时间")
private LocalDateTime reviewUploadAt;
/**
* 调查备注
*/
@ApiModelProperty(value = "调查备注")
private String checkRemark;
/**
* 调查上传时间
*/
@DateTimeFormat(
pattern = "yyyy-MM-dd HH:mm:ss"
)
@JsonFormat(
pattern = "yyyy-MM-dd HH:mm:ss"
)
@ApiModelProperty(value = "调查上传时间")
private LocalDateTime checkUploadAt;
/**
* 调查分数是否公开
*/
@ApiModelProperty(value = "调查分数是否公开 0不公开 1公开")
private Integer checkScoreState;
/**
* 评议意见备注
*/
@ApiModelProperty(value = "评议意见备注")
private String opinionRemark;
/**
* 评议意见上传时间
*/
@DateTimeFormat(
pattern = "yyyy-MM-dd HH:mm:ss"
)
@JsonFormat(
pattern = "yyyy-MM-dd HH:mm:ss"
)
@ApiModelProperty(value = "评议意见上传时间")
private LocalDateTime opinionUploadAt;
/**
* 整改备注
*/
@ApiModelProperty(value = "整改备注")
private String alterRemark;
/**
* 整改上传时间
*/
@DateTimeFormat(
pattern = "yyyy-MM-dd HH:mm:ss"
)
@JsonFormat(
pattern = "yyyy-MM-dd HH:mm:ss"
)
@ApiModelProperty(value = "整改上传时间")
private LocalDateTime alterUploadAt;
/**
* 审核状态 0待审批 1已通过 2已拒绝
*/
@ApiModelProperty(value = " 审核状态 0审批中 1已通过 2已拒绝")
private Integer status;
/**
* 当前环节
*/
@ApiModelProperty(value = " 当前环节 1-7")
private Integer state;
public ReviewWork() {
//默认公开分数
this.checkScoreState=1;
}
}

View File

@ -0,0 +1,60 @@
package com.ydool.boot.modules.rddb.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.ydool.boot.core.entity.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* <p>
* 评议附件
* </p>
*
* @author zhouyuan
* @since 2022-05-12
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("t_review_work_attachment")
@Accessors(chain = true)
public class ReviewWorkAttachment extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 创建者
*/
private String createdId;
/**
* 更新者
*/
private String updatedId;
/**
* 附件类型 与评议的state环节对应
*/
private Integer type;
/**
* 评议id
*/
private String reviewId;
/**
* 附件名
*/
private String title;
/**
* 附件路径
*/
private String attachment;
/**
* 文件大小
*/
private String size;
}

View File

@ -0,0 +1,79 @@
package com.ydool.boot.modules.rddb.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ydool.boot.core.entity.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
/**
* <p>
* 评议审批
* </p>
*
* @author zhouyuan
* @since 2022-05-12
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("t_review_work_audit")
public class ReviewWorkAudit extends BaseEntity{
private static final long serialVersionUID = 1L;
/**
* 创建者
*/
private String createdId;
/**
* 更新者
*/
private String updatedId;
/**
* 评议id
*/
private String reviewId;
/**
* 人员id
*/
private String userId;
private String userName;
/**
* 单条状态 0待审批 1已通过 2未通过
*/
private Integer status;
/**
* 未通过原因
*/
private String reason;
/**
* 审批时间
*/
@DateTimeFormat(
pattern = "yyyy-MM-dd HH:mm:ss"
)
@JsonFormat(
pattern = "yyyy-MM-dd HH:mm:ss"
)
private LocalDateTime auditAt;
/**
* 审批顺序从1开始
*/
private Integer sortNo;
/**
* 审批级别 共2级从1开始
*/
private Integer level;
}

View File

@ -0,0 +1,57 @@
package com.ydool.boot.modules.rddb.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.ydool.boot.core.entity.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* <p>
* 工作评议评论
* </p>
*
* @author zhouyuan
* @since 2022-05-12
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("t_review_work_comment")
public class ReviewWorkComment extends BaseEntity{
private static final long serialVersionUID = 1L;
/**
* 创建者
*/
private String createdId;
/**
* 更新者
*/
private String updatedId;
/**
* 评论类型 与评议的state环节对应
*/
private Integer type;
/**
* 评议id
*/
private String reviewId;
/**
* 人员id
*/
private String userId;
/**
* 内容
*/
private String content;
/**
* 用户名
*/
private String userName;
}

View File

@ -0,0 +1,68 @@
package com.ydool.boot.modules.rddb.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ydool.boot.core.entity.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;
import java.math.BigDecimal;
import java.time.LocalDateTime;
/**
* <p>
* 工作评议人员
* </p>
*
* @author zhouyuan
* @since 2022-05-12
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("t_review_work_user")
public class ReviewWorkUser extends BaseEntity{
private static final long serialVersionUID = 1L;
/**
* 创建者
*/
private String createdId;
/**
* 更新者
*/
private String updatedId;
/**
* 评议id
*/
private String reviewId;
/**
* 人员id
*/
private String userId;
/**
* 人员名称
*/
private String userName;
/**
* 分数 1-100
*/
private BigDecimal score;
/**
* 打分时间
*/
@DateTimeFormat(
pattern = "yyyy-MM-dd HH:mm:ss"
)
@JsonFormat(
pattern = "yyyy-MM-dd HH:mm:ss"
)
private LocalDateTime scoreAt;
}

View File

@ -0,0 +1,27 @@
package com.ydool.boot.modules.rddb.entity.bo;
import com.ydool.boot.modules.rddb.entity.ReviewOfficer;
import lombok.Data;
import javax.validation.constraints.NotBlank;
/**
* <p>
* 上报
* </p>
*
* @author zhouyuan
* @since 2021-07-13
*/
@Data
public class ReviewOfficerBo extends ReviewOfficer {
String inReportAttachmentArrStr;
String checkAttachmentArrStr;
String opinionAttachmentArrStr;
String resultAttachmentArrStr;
@NotBlank(message = "请选择审批人员")
String inReportAudit1Ids;
String inReportAudit2Ids;
String checkUserIds;
}

View File

@ -0,0 +1,27 @@
package com.ydool.boot.modules.rddb.entity.bo;
import com.ydool.boot.modules.rddb.entity.ReviewSubject;
import lombok.Data;
import javax.validation.constraints.NotBlank;
/**
* <p>
* 上报
* </p>
*
* @author zhouyuan
* @since 2021-07-13
*/
@Data
public class ReviewSubjectBo extends ReviewSubject {
String inReportAttachmentArrStr;
String checkAttachmentArrStr;
String opinionAttachmentArrStr;
String resultAttachmentArrStr;
@NotBlank(message = "请选择审批人员")
String inReportAudit1Ids;
String inReportAudit2Ids;
String checkUserIds;
}

View File

@ -0,0 +1,27 @@
package com.ydool.boot.modules.rddb.entity.bo;
import com.ydool.boot.modules.rddb.entity.ReviewWork;
import lombok.Data;
import javax.validation.constraints.NotBlank;
/**
* <p>
* 上报
* </p>
*
* @author zhouyuan
* @since 2021-07-13
*/
@Data
public class ReviewWorkBo extends ReviewWork {
String inReportAttachmentArrStr;
String checkAttachmentArrStr;
String opinionAttachmentArrStr;
String resultAttachmentArrStr;
@NotBlank(message = "请选择审批人员")
String inReportAudit1Ids;
String inReportAudit2Ids;
String checkUserIds;
}

View File

@ -0,0 +1,39 @@
package com.ydool.boot.modules.rddb.entity.dto;
import com.ydool.boot.modules.rddb.entity.*;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
import java.util.List;
@Data
public class ReviewOfficerDto extends ReviewOfficer {
@ApiModelProperty(value = "评议附件")
List<ReviewOfficerAttachment> inReportAttachmentList;
@ApiModelProperty(value = "自查/调查报告")
List<ReviewOfficerAttachment> checkAttachmentList;
@ApiModelProperty(value = "评议意见附件")
List<ReviewOfficerAttachment> opinionAttachmentList;
@ApiModelProperty(value = "整改结果附件")
List<ReviewOfficerAttachment> resultAttachmentList;
@ApiModelProperty(value = "一级审批人员")
List<ReviewOfficerAudit> inReportAudit1List;
@ApiModelProperty(value = "二级审批人员")
List<ReviewOfficerAudit> inReportAudit2List;
@ApiModelProperty(value = "打分人员")
List<ReviewOfficerUser> checkUserList;
@ApiModelProperty(value = "平均分")
BigDecimal averageScore;
@ApiModelProperty(value = "当前用户是否是创建人")
Boolean isCreator;
@ApiModelProperty(value = "当前用户是否可以评分")
Boolean isCanCheck;
@ApiModelProperty(value = "当前用户是否可以一级审批")
Boolean isCanAudit1;
@ApiModelProperty(value = "当前用户是否可以二级审批")
Boolean isCanAudit2;
}

View File

@ -0,0 +1,39 @@
package com.ydool.boot.modules.rddb.entity.dto;
import com.ydool.boot.modules.rddb.entity.*;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
import java.util.List;
@Data
public class ReviewSubjectDto extends ReviewSubject {
@ApiModelProperty(value = "评议附件")
List<ReviewSubjectAttachment> inReportAttachmentList;
@ApiModelProperty(value = "自查/调查报告")
List<ReviewSubjectAttachment> checkAttachmentList;
@ApiModelProperty(value = "评议意见附件")
List<ReviewSubjectAttachment> opinionAttachmentList;
@ApiModelProperty(value = "整改结果附件")
List<ReviewSubjectAttachment> resultAttachmentList;
@ApiModelProperty(value = "一级审批人员")
List<ReviewSubjectAudit> inReportAudit1List;
@ApiModelProperty(value = "二级审批人员")
List<ReviewSubjectAudit> inReportAudit2List;
@ApiModelProperty(value = "打分人员")
List<ReviewSubjectUser> checkUserList;
@ApiModelProperty(value = "平均分")
BigDecimal averageScore;
@ApiModelProperty(value = "当前用户是否是创建人")
Boolean isCreator;
@ApiModelProperty(value = "当前用户是否可以评分")
Boolean isCanCheck;
@ApiModelProperty(value = "当前用户是否可以一级审批")
Boolean isCanAudit1;
@ApiModelProperty(value = "当前用户是否可以二级审批")
Boolean isCanAudit2;
}

View File

@ -0,0 +1,39 @@
package com.ydool.boot.modules.rddb.entity.dto;
import com.ydool.boot.modules.rddb.entity.*;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
import java.util.List;
@Data
public class ReviewWorkDto extends ReviewWork {
@ApiModelProperty(value = "评议附件")
List<ReviewWorkAttachment> inReportAttachmentList;
@ApiModelProperty(value = "自查/调查报告")
List<ReviewWorkAttachment> checkAttachmentList;
@ApiModelProperty(value = "评议意见附件")
List<ReviewWorkAttachment> opinionAttachmentList;
@ApiModelProperty(value = "整改结果附件")
List<ReviewWorkAttachment> resultAttachmentList;
@ApiModelProperty(value = "一级审批人员")
List<ReviewWorkAudit> inReportAudit1List;
@ApiModelProperty(value = "二级审批人员")
List<ReviewWorkAudit> inReportAudit2List;
@ApiModelProperty(value = "打分人员")
List<ReviewWorkUser> checkUserList;
@ApiModelProperty(value = "平均分")
BigDecimal averageScore;
@ApiModelProperty(value = "当前用户是否是创建人")
Boolean isCreator;
@ApiModelProperty(value = "当前用户是否可以评分")
Boolean isCanCheck;
@ApiModelProperty(value = "当前用户是否可以一级审批")
Boolean isCanAudit1;
@ApiModelProperty(value = "当前用户是否可以二级审批")
Boolean isCanAudit2;
}

View File

@ -1,40 +1,40 @@
package com.ydool.boot.modules.rddb.entity.request.review.state;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
@Data
public class ReviewOpinionStateRequest {
@ApiModelProperty(value = "评议id", required = true)
private String reviewId;
/**
* 评议意见备注
*/
@ApiModelProperty(value = "评议意见备注")
private String opinionRemark;
/**
* 评议意见上传时间
*/
@DateTimeFormat(
pattern = "yyyy-MM-dd HH:mm:ss"
)
@JsonFormat(
pattern = "yyyy-MM-dd HH:mm:ss"
)
@ApiModelProperty(value = "评议意见上传时间")
private LocalDateTime opinionUploadAt;
@ApiModelProperty(value = "附件名 英文逗号间隔")
String opinionAttachmentName;
@ApiModelProperty(value = "附件路径 英文逗号间隔")
String opinionAttachmentPath;
}
package com.ydool.boot.modules.rddb.entity.request.review.state;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
@Data
public class ReviewOpinionStateRequest {
@ApiModelProperty(value = "评议id", required = true)
private String reviewId;
/**
* 评议意见备注
*/
@ApiModelProperty(value = "评议意见备注")
private String opinionRemark;
/**
* 评议意见上传时间
*/
@DateTimeFormat(
pattern = "yyyy-MM-dd HH:mm:ss"
)
@JsonFormat(
pattern = "yyyy-MM-dd HH:mm:ss"
)
@ApiModelProperty(value = "评议意见上传时间")
private LocalDateTime opinionUploadAt;
@ApiModelProperty(value = "附件名 英文逗号间隔")
String opinionAttachmentName;
@ApiModelProperty(value = "附件路径 英文逗号间隔")
String opinionAttachmentPath;
}

View File

@ -0,0 +1,21 @@
package com.ydool.boot.modules.rddb.entity.request.review_officer;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class ReviewOfficerAuditRequest {
@ApiModelProperty(value = "评议id", required = true)
private String reviewId;
@ApiModelProperty(value = "审批状态 1已通过 2未通过", required = true)
private int status;
@ApiModelProperty(value = "未通过原因")
private String reason;
@ApiModelProperty(value = "审批级别 共2级从1开始", required = true)
private int level;
}

View File

@ -0,0 +1,17 @@
package com.ydool.boot.modules.rddb.entity.request.review_officer;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
@Data
public class ReviewOfficerCheckRequest {
@ApiModelProperty(value = "评议id", required = true)
private String reviewId;
@ApiModelProperty(value = "分数 (1-100)", required = true)
private BigDecimal score;
}

View File

@ -0,0 +1,18 @@
package com.ydool.boot.modules.rddb.entity.request.review_officer;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class ReviewOfficerCommentRequest {
@ApiModelProperty(value = "评议id", required = true)
private String reviewId;
@ApiModelProperty(value = "评论内容", required = true)
private String content;
@ApiModelProperty(value = "环节 (1-7)", required = true)
private int type;
}

View File

@ -0,0 +1,42 @@
package com.ydool.boot.modules.rddb.entity.request.review_officer.state;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
@Data
public class ReviewOfficerCheckStateRequest {
@ApiModelProperty(value = "评议id", required = true)
private String reviewId;
/**
* 调查备注
*/
@ApiModelProperty(value = "调查备注")
private String checkRemark;
/**
* 调查上传时间
*/
@DateTimeFormat(
pattern = "yyyy-MM-dd HH:mm:ss"
)
@JsonFormat(
pattern = "yyyy-MM-dd HH:mm:ss"
)
@ApiModelProperty(value = "调查上传时间")
private LocalDateTime checkUploadAt;
@ApiModelProperty(value = "附件名 英文逗号间隔")
String checkAttachmentName;
@ApiModelProperty(value = "附件路径 英文逗号间隔")
String checkAttachmentPath;
@ApiModelProperty(value = "打分人员 英文逗号间隔")
String checkUserIds;
}

View File

@ -0,0 +1,52 @@
package com.ydool.boot.modules.rddb.entity.request.review_officer.state;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
@Data
public class ReviewOfficerInReportStateRequest {
/**
* 评议主题
*/
@ApiModelProperty(value = "评议主题(评议部门,评议专题,评议对象)",required = true)
private String reviewSubject;
/**
* 分类
*/
@ApiModelProperty(value = "分类",required = true)
private String type;
/**
* 评议描述
*/
@ApiModelProperty(value = "评议描述(评议部门描述,评议专题描述,评议对象职位)")
private String reviewDesc;
/**
* 提名上传时间
*/
@DateTimeFormat(
pattern = "yyyy-MM-dd HH:mm:ss"
)
@JsonFormat(
pattern = "yyyy-MM-dd HH:mm:ss"
)
@ApiModelProperty(value = "提名上传时间")
private LocalDateTime reviewUploadAt;
@ApiModelProperty(value = "附件名 英文逗号间隔")
String inReportAttachmentName;
@ApiModelProperty(value = "附件路径 英文逗号间隔")
String inReportAttachmentPath;
@ApiModelProperty(value = "一级审批人 英文逗号间隔")
String inReportAudit1Ids;
@ApiModelProperty(value = "二级审批人 英文逗号间隔")
String inReportAudit2Ids;
}

View File

@ -0,0 +1,40 @@
package com.ydool.boot.modules.rddb.entity.request.review_officer.state;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
@Data
public class ReviewOfficerOpinionStateRequest {
@ApiModelProperty(value = "评议id", required = true)
private String reviewId;
/**
* 评议意见备注
*/
@ApiModelProperty(value = "评议意见备注")
private String opinionRemark;
/**
* 评议意见上传时间
*/
@DateTimeFormat(
pattern = "yyyy-MM-dd HH:mm:ss"
)
@JsonFormat(
pattern = "yyyy-MM-dd HH:mm:ss"
)
@ApiModelProperty(value = "评议意见上传时间")
private LocalDateTime opinionUploadAt;
@ApiModelProperty(value = "附件名 英文逗号间隔")
String opinionAttachmentName;
@ApiModelProperty(value = "附件路径 英文逗号间隔")
String opinionAttachmentPath;
}

View File

@ -0,0 +1,40 @@
package com.ydool.boot.modules.rddb.entity.request.review_officer.state;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
@Data
public class ReviewOfficerResultStateRequest {
@ApiModelProperty(value = "评议id", required = true)
private String reviewId;
/**
* 整改备注
*/
@ApiModelProperty(value = "整改备注")
private String alterRemark;
/**
* 整改上传时间
*/
@DateTimeFormat(
pattern = "yyyy-MM-dd HH:mm:ss"
)
@JsonFormat(
pattern = "yyyy-MM-dd HH:mm:ss"
)
@ApiModelProperty(value = "整改上传时间")
private LocalDateTime alterUploadAt;
@ApiModelProperty(value = "附件名 英文逗号间隔")
String resultAttachmentName;
@ApiModelProperty(value = "附件路径 英文逗号间隔")
String resultAttachmentPath;
}

View File

@ -0,0 +1,21 @@
package com.ydool.boot.modules.rddb.entity.request.review_subject;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class ReviewSubjectAuditRequest {
@ApiModelProperty(value = "评议id", required = true)
private String reviewId;
@ApiModelProperty(value = "审批状态 1已通过 2未通过", required = true)
private int status;
@ApiModelProperty(value = "未通过原因")
private String reason;
@ApiModelProperty(value = "审批级别 共2级从1开始", required = true)
private int level;
}

View File

@ -0,0 +1,17 @@
package com.ydool.boot.modules.rddb.entity.request.review_subject;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
@Data
public class ReviewSubjectCheckRequest {
@ApiModelProperty(value = "评议id", required = true)
private String reviewId;
@ApiModelProperty(value = "分数 (1-100)", required = true)
private BigDecimal score;
}

View File

@ -0,0 +1,18 @@
package com.ydool.boot.modules.rddb.entity.request.review_subject;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class ReviewSubjectCommentRequest {
@ApiModelProperty(value = "评议id", required = true)
private String reviewId;
@ApiModelProperty(value = "评论内容", required = true)
private String content;
@ApiModelProperty(value = "环节 (1-7)", required = true)
private int type;
}

View File

@ -0,0 +1,42 @@
package com.ydool.boot.modules.rddb.entity.request.review_subject.state;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
@Data
public class ReviewSubjectCheckStateRequest {
@ApiModelProperty(value = "评议id", required = true)
private String reviewId;
/**
* 调查备注
*/
@ApiModelProperty(value = "调查备注")
private String checkRemark;
/**
* 调查上传时间
*/
@DateTimeFormat(
pattern = "yyyy-MM-dd HH:mm:ss"
)
@JsonFormat(
pattern = "yyyy-MM-dd HH:mm:ss"
)
@ApiModelProperty(value = "调查上传时间")
private LocalDateTime checkUploadAt;
@ApiModelProperty(value = "附件名 英文逗号间隔")
String checkAttachmentName;
@ApiModelProperty(value = "附件路径 英文逗号间隔")
String checkAttachmentPath;
@ApiModelProperty(value = "打分人员 英文逗号间隔")
String checkUserIds;
}

View File

@ -0,0 +1,52 @@
package com.ydool.boot.modules.rddb.entity.request.review_subject.state;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
@Data
public class ReviewSubjectInReportStateRequest {
/**
* 评议主题
*/
@ApiModelProperty(value = "评议主题(评议部门,评议专题,评议对象)",required = true)
private String reviewSubject;
/**
* 评议主题
*/
@ApiModelProperty(value = "分类",required = true)
private String type;
/**
* 评议描述
*/
@ApiModelProperty(value = "评议描述(评议部门描述,评议专题描述,评议对象职位)")
private String reviewDesc;
/**
* 提名上传时间
*/
@DateTimeFormat(
pattern = "yyyy-MM-dd HH:mm:ss"
)
@JsonFormat(
pattern = "yyyy-MM-dd HH:mm:ss"
)
@ApiModelProperty(value = "提名上传时间")
private LocalDateTime reviewUploadAt;
@ApiModelProperty(value = "附件名 英文逗号间隔")
String inReportAttachmentName;
@ApiModelProperty(value = "附件路径 英文逗号间隔")
String inReportAttachmentPath;
@ApiModelProperty(value = "一级审批人 英文逗号间隔")
String inReportAudit1Ids;
@ApiModelProperty(value = "二级审批人 英文逗号间隔")
String inReportAudit2Ids;
}

View File

@ -0,0 +1,40 @@
package com.ydool.boot.modules.rddb.entity.request.review_subject.state;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
@Data
public class ReviewSubjectOpinionStateRequest {
@ApiModelProperty(value = "评议id", required = true)
private String reviewId;
/**
* 评议意见备注
*/
@ApiModelProperty(value = "评议意见备注")
private String opinionRemark;
/**
* 评议意见上传时间
*/
@DateTimeFormat(
pattern = "yyyy-MM-dd HH:mm:ss"
)
@JsonFormat(
pattern = "yyyy-MM-dd HH:mm:ss"
)
@ApiModelProperty(value = "评议意见上传时间")
private LocalDateTime opinionUploadAt;
@ApiModelProperty(value = "附件名 英文逗号间隔")
String opinionAttachmentName;
@ApiModelProperty(value = "附件路径 英文逗号间隔")
String opinionAttachmentPath;
}

View File

@ -0,0 +1,40 @@
package com.ydool.boot.modules.rddb.entity.request.review_subject.state;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
@Data
public class ReviewSubjectResultStateRequest {
@ApiModelProperty(value = "评议id", required = true)
private String reviewId;
/**
* 整改备注
*/
@ApiModelProperty(value = "整改备注")
private String alterRemark;
/**
* 整改上传时间
*/
@DateTimeFormat(
pattern = "yyyy-MM-dd HH:mm:ss"
)
@JsonFormat(
pattern = "yyyy-MM-dd HH:mm:ss"
)
@ApiModelProperty(value = "整改上传时间")
private LocalDateTime alterUploadAt;
@ApiModelProperty(value = "附件名 英文逗号间隔")
String resultAttachmentName;
@ApiModelProperty(value = "附件路径 英文逗号间隔")
String resultAttachmentPath;
}

View File

@ -0,0 +1,21 @@
package com.ydool.boot.modules.rddb.entity.request.review_work;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class ReviewWorkAuditRequest {
@ApiModelProperty(value = "评议id", required = true)
private String reviewId;
@ApiModelProperty(value = "审批状态 1已通过 2未通过", required = true)
private int status;
@ApiModelProperty(value = "未通过原因")
private String reason;
@ApiModelProperty(value = "审批级别 共2级从1开始", required = true)
private int level;
}

View File

@ -0,0 +1,17 @@
package com.ydool.boot.modules.rddb.entity.request.review_work;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
@Data
public class ReviewWorkCheckRequest {
@ApiModelProperty(value = "评议id", required = true)
private String reviewId;
@ApiModelProperty(value = "分数 (1-100)", required = true)
private BigDecimal score;
}

View File

@ -0,0 +1,18 @@
package com.ydool.boot.modules.rddb.entity.request.review_work;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class ReviewWorkCommentRequest {
@ApiModelProperty(value = "评议id", required = true)
private String reviewId;
@ApiModelProperty(value = "评论内容", required = true)
private String content;
@ApiModelProperty(value = "环节 (1-7)", required = true)
private int type;
}

View File

@ -0,0 +1,42 @@
package com.ydool.boot.modules.rddb.entity.request.review_work.state;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
@Data
public class ReviewWorkCheckStateRequest {
@ApiModelProperty(value = "评议id", required = true)
private String reviewId;
/**
* 调查备注
*/
@ApiModelProperty(value = "调查备注")
private String checkRemark;
/**
* 调查上传时间
*/
@DateTimeFormat(
pattern = "yyyy-MM-dd HH:mm:ss"
)
@JsonFormat(
pattern = "yyyy-MM-dd HH:mm:ss"
)
@ApiModelProperty(value = "调查上传时间")
private LocalDateTime checkUploadAt;
@ApiModelProperty(value = "附件名 英文逗号间隔")
String checkAttachmentName;
@ApiModelProperty(value = "附件路径 英文逗号间隔")
String checkAttachmentPath;
@ApiModelProperty(value = "打分人员 英文逗号间隔")
String checkUserIds;
}

View File

@ -0,0 +1,46 @@
package com.ydool.boot.modules.rddb.entity.request.review_work.state;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
@Data
public class ReviewWorkInReportStateRequest {
/**
* 评议主题
*/
@ApiModelProperty(value = "评议主题(评议部门,评议专题,评议对象)",required = true)
private String reviewSubject;
/**
* 评议描述
*/
@ApiModelProperty(value = "评议描述(评议部门描述,评议专题描述,评议对象职位)")
private String reviewDesc;
/**
* 提名上传时间
*/
@DateTimeFormat(
pattern = "yyyy-MM-dd HH:mm:ss"
)
@JsonFormat(
pattern = "yyyy-MM-dd HH:mm:ss"
)
@ApiModelProperty(value = "提名上传时间")
private LocalDateTime reviewUploadAt;
@ApiModelProperty(value = "附件名 英文逗号间隔")
String inReportAttachmentName;
@ApiModelProperty(value = "附件路径 英文逗号间隔")
String inReportAttachmentPath;
@ApiModelProperty(value = "一级审批人 英文逗号间隔")
String inReportAudit1Ids;
@ApiModelProperty(value = "二级审批人 英文逗号间隔")
String inReportAudit2Ids;
}

View File

@ -0,0 +1,40 @@
package com.ydool.boot.modules.rddb.entity.request.review_work.state;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
@Data
public class ReviewWorkOpinionStateRequest {
@ApiModelProperty(value = "评议id", required = true)
private String reviewId;
/**
* 评议意见备注
*/
@ApiModelProperty(value = "评议意见备注")
private String opinionRemark;
/**
* 评议意见上传时间
*/
@DateTimeFormat(
pattern = "yyyy-MM-dd HH:mm:ss"
)
@JsonFormat(
pattern = "yyyy-MM-dd HH:mm:ss"
)
@ApiModelProperty(value = "评议意见上传时间")
private LocalDateTime opinionUploadAt;
@ApiModelProperty(value = "附件名 英文逗号间隔")
String opinionAttachmentName;
@ApiModelProperty(value = "附件路径 英文逗号间隔")
String opinionAttachmentPath;
}

View File

@ -0,0 +1,40 @@
package com.ydool.boot.modules.rddb.entity.request.review_work.state;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
@Data
public class ReviewWorkResultStateRequest {
@ApiModelProperty(value = "评议id", required = true)
private String reviewId;
/**
* 整改备注
*/
@ApiModelProperty(value = "整改备注")
private String alterRemark;
/**
* 整改上传时间
*/
@DateTimeFormat(
pattern = "yyyy-MM-dd HH:mm:ss"
)
@JsonFormat(
pattern = "yyyy-MM-dd HH:mm:ss"
)
@ApiModelProperty(value = "整改上传时间")
private LocalDateTime alterUploadAt;
@ApiModelProperty(value = "附件名 英文逗号间隔")
String resultAttachmentName;
@ApiModelProperty(value = "附件路径 英文逗号间隔")
String resultAttachmentPath;
}

View File

@ -0,0 +1,16 @@
package com.ydool.boot.modules.rddb.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ydool.boot.modules.rddb.entity.ReviewOfficerAttachment;
/**
* <p>
* 任免督职附件 Mapper 接口
* </p>
*
* @author zhouyuan
* @since 2022-05-12
*/
public interface ReviewOfficerAttachmentMapper extends BaseMapper<ReviewOfficerAttachment> {
}

View File

@ -0,0 +1,16 @@
package com.ydool.boot.modules.rddb.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ydool.boot.modules.rddb.entity.ReviewOfficerAudit;
/**
* <p>
* 评议审批 Mapper 接口
* </p>
*
* @author zhouyuan
* @since 2022-05-12
*/
public interface ReviewOfficerAuditMapper extends BaseMapper<ReviewOfficerAudit> {
}

View File

@ -0,0 +1,16 @@
package com.ydool.boot.modules.rddb.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ydool.boot.modules.rddb.entity.ReviewOfficerComment;
/**
* <p>
* 工作评议评论 Mapper 接口
* </p>
*
* @author zhouyuan
* @since 2022-05-12
*/
public interface ReviewOfficerCommentMapper extends BaseMapper<ReviewOfficerComment> {
}

View File

@ -0,0 +1,16 @@
package com.ydool.boot.modules.rddb.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ydool.boot.modules.rddb.entity.ReviewOfficer;
/**
* <p>
* 评议 Mapper 接口
* </p>
*
* @author zhouyuan
* @since 2022-05-12
*/
public interface ReviewOfficerMapper extends BaseMapper<ReviewOfficer> {
}

View File

@ -0,0 +1,16 @@
package com.ydool.boot.modules.rddb.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ydool.boot.modules.rddb.entity.ReviewOfficerUser;
/**
* <p>
* 工作评议人员 Mapper 接口
* </p>
*
* @author zhouyuan
* @since 2022-05-12
*/
public interface ReviewOfficerUserMapper extends BaseMapper<ReviewOfficerUser> {
}

View File

@ -0,0 +1,16 @@
package com.ydool.boot.modules.rddb.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ydool.boot.modules.rddb.entity.ReviewSubjectAttachment;
/**
* <p>
* 任免督职附件 Mapper 接口
* </p>
*
* @author zhouyuan
* @since 2022-05-12
*/
public interface ReviewSubjectAttachmentMapper extends BaseMapper<ReviewSubjectAttachment> {
}

View File

@ -0,0 +1,16 @@
package com.ydool.boot.modules.rddb.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ydool.boot.modules.rddb.entity.ReviewSubjectAudit;
/**
* <p>
* 评议审批 Mapper 接口
* </p>
*
* @author zhouyuan
* @since 2022-05-12
*/
public interface ReviewSubjectAuditMapper extends BaseMapper<ReviewSubjectAudit> {
}

View File

@ -0,0 +1,16 @@
package com.ydool.boot.modules.rddb.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ydool.boot.modules.rddb.entity.ReviewSubjectComment;
/**
* <p>
* 工作评议评论 Mapper 接口
* </p>
*
* @author zhouyuan
* @since 2022-05-12
*/
public interface ReviewSubjectCommentMapper extends BaseMapper<ReviewSubjectComment> {
}

View File

@ -0,0 +1,16 @@
package com.ydool.boot.modules.rddb.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ydool.boot.modules.rddb.entity.ReviewSubject;
/**
* <p>
* 评议 Mapper 接口
* </p>
*
* @author zhouyuan
* @since 2022-05-12
*/
public interface ReviewSubjectMapper extends BaseMapper<ReviewSubject> {
}

View File

@ -0,0 +1,16 @@
package com.ydool.boot.modules.rddb.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ydool.boot.modules.rddb.entity.ReviewSubjectUser;
/**
* <p>
* 工作评议人员 Mapper 接口
* </p>
*
* @author zhouyuan
* @since 2022-05-12
*/
public interface ReviewSubjectUserMapper extends BaseMapper<ReviewSubjectUser> {
}

View File

@ -0,0 +1,16 @@
package com.ydool.boot.modules.rddb.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ydool.boot.modules.rddb.entity.ReviewWorkAttachment;
/**
* <p>
* 任免督职附件 Mapper 接口
* </p>
*
* @author zhouyuan
* @since 2022-05-12
*/
public interface ReviewWorkAttachmentMapper extends BaseMapper<ReviewWorkAttachment> {
}

View File

@ -0,0 +1,16 @@
package com.ydool.boot.modules.rddb.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ydool.boot.modules.rddb.entity.ReviewWorkAudit;
/**
* <p>
* 评议审批 Mapper 接口
* </p>
*
* @author zhouyuan
* @since 2022-05-12
*/
public interface ReviewWorkAuditMapper extends BaseMapper<ReviewWorkAudit> {
}

View File

@ -0,0 +1,16 @@
package com.ydool.boot.modules.rddb.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ydool.boot.modules.rddb.entity.ReviewWorkComment;
/**
* <p>
* 工作评议评论 Mapper 接口
* </p>
*
* @author zhouyuan
* @since 2022-05-12
*/
public interface ReviewWorkCommentMapper extends BaseMapper<ReviewWorkComment> {
}

View File

@ -0,0 +1,16 @@
package com.ydool.boot.modules.rddb.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ydool.boot.modules.rddb.entity.ReviewWork;
/**
* <p>
* 评议 Mapper 接口
* </p>
*
* @author zhouyuan
* @since 2022-05-12
*/
public interface ReviewWorkMapper extends BaseMapper<ReviewWork> {
}

View File

@ -0,0 +1,16 @@
package com.ydool.boot.modules.rddb.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ydool.boot.modules.rddb.entity.ReviewWorkUser;
/**
* <p>
* 工作评议人员 Mapper 接口
* </p>
*
* @author zhouyuan
* @since 2022-05-12
*/
public interface ReviewWorkUserMapper extends BaseMapper<ReviewWorkUser> {
}

View File

@ -0,0 +1,19 @@
package com.ydool.boot.modules.rddb.service;
import com.ydool.boot.core.service.BaseService;
import com.ydool.boot.modules.rddb.entity.ReviewOfficerAttachment;
import com.ydool.boot.modules.rddb.mapper.ReviewOfficerAttachmentMapper;
import org.springframework.stereotype.Service;
/**
* <p>
* 任免督职附件 服务实现类
* </p>
*
* @author zhouyuan
* @since 2022-05-12
*/
@Service
public class ReviewOfficerAttachmentService extends BaseService<ReviewOfficerAttachmentMapper, ReviewOfficerAttachment> {
}

View File

@ -0,0 +1,19 @@
package com.ydool.boot.modules.rddb.service;
import com.ydool.boot.core.service.BaseService;
import com.ydool.boot.modules.rddb.entity.ReviewOfficerAudit;
import com.ydool.boot.modules.rddb.mapper.ReviewOfficerAuditMapper;
import org.springframework.stereotype.Service;
/**
* <p>
* 评议审批 服务实现类
* </p>
*
* @author zhouyuan
* @since 2022-05-12
*/
@Service
public class ReviewOfficerAuditService extends BaseService<ReviewOfficerAuditMapper, ReviewOfficerAudit> {
}

View File

@ -0,0 +1,19 @@
package com.ydool.boot.modules.rddb.service;
import com.ydool.boot.core.service.BaseService;
import com.ydool.boot.modules.rddb.entity.ReviewOfficerComment;
import com.ydool.boot.modules.rddb.mapper.ReviewOfficerCommentMapper;
import org.springframework.stereotype.Service;
/**
* <p>
* 工作评议评论 服务实现类
* </p>
*
* @author zhouyuan
* @since 2022-05-12
*/
@Service
public class ReviewOfficerCommentService extends BaseService<ReviewOfficerCommentMapper, ReviewOfficerComment> {
}

View File

@ -0,0 +1,418 @@
package com.ydool.boot.modules.rddb.service;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.lang.Assert;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ydool.boot.common.result.Ret;
import com.ydool.boot.core.exception.ResultException;
import com.ydool.boot.core.service.BaseService;
import com.ydool.boot.modules.rddb.entity.*;
import com.ydool.boot.modules.rddb.entity.bo.ReviewOfficerBo;
import com.ydool.boot.modules.rddb.entity.request.review_officer.ReviewOfficerAuditRequest;
import com.ydool.boot.modules.rddb.entity.request.review_officer.ReviewOfficerCheckRequest;
import com.ydool.boot.modules.rddb.entity.request.review_officer.ReviewOfficerCommentRequest;
import com.ydool.boot.modules.rddb.entity.request.review_officer.state.ReviewOfficerCheckStateRequest;
import com.ydool.boot.modules.rddb.entity.request.review_officer.state.ReviewOfficerInReportStateRequest;
import com.ydool.boot.modules.rddb.entity.request.review_officer.state.ReviewOfficerOpinionStateRequest;
import com.ydool.boot.modules.rddb.entity.request.review_officer.state.ReviewOfficerResultStateRequest;
import com.ydool.boot.modules.rddb.mapper.ReviewOfficerMapper;
import com.ydool.boot.modules.rddb.wrapper.ReviewOfficerWrapper;
import com.ydool.boot.modules.sys.entity.User;
import com.ydool.boot.modules.sys.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
/**
* <p>
* 评议 服务实现类
* </p>
*
* @author zhouyuan
* @since 2022-05-12
*/
@Service
public class ReviewOfficerService extends BaseService<ReviewOfficerMapper, ReviewOfficer> {
@Autowired
ReviewOfficerAttachmentService reviewOfficerAttachmentService;
@Autowired
ReviewOfficerCommentService reviewOfficerCommentService;
@Autowired
ReviewOfficerAuditService reviewOfficerAuditService;
@Autowired
ReviewOfficerUserService reviewOfficerUserService;
@Autowired
UserService userService;
/*后台*/
@Transactional
public boolean del(String id) {
reviewOfficerAttachmentService.remove(new LambdaQueryWrapper<ReviewOfficerAttachment>()
.eq(ReviewOfficerAttachment::getReviewId, id));
reviewOfficerCommentService.remove(new LambdaQueryWrapper<ReviewOfficerComment>()
.eq(ReviewOfficerComment::getReviewId, id));
reviewOfficerAuditService.remove(new LambdaQueryWrapper<ReviewOfficerAudit>()
.eq(ReviewOfficerAudit::getReviewId, id));
reviewOfficerUserService.remove(new LambdaQueryWrapper<ReviewOfficerUser>()
.eq(ReviewOfficerUser::getReviewId, id));
return removeById(id);
}
@Transactional
public Ret adminSaveOrUpdate(ReviewOfficerBo reviewOfficerBo, User loginUser) {
Boolean isNew = false;
ReviewOfficer reviewOfficer = BeanUtil.copyProperties(reviewOfficerBo, ReviewOfficer.class);
if (StrUtil.isNotBlank(reviewOfficer.getId())) {
reviewOfficer.setUpdatedId(loginUser.getId());
} else {
reviewOfficer.setState(ReviewOfficer.STATE_IN_REPORT);
reviewOfficer.setStatus(0);
reviewOfficer.setCreatedId(loginUser.getId());
isNew = true;
}
saveOrUpdate(reviewOfficer);
reviewOfficerBo.setId(reviewOfficer.getId());
//指定人员
String checkUserIds = reviewOfficerBo.getCheckUserIds();
String inReportAudit1Ids = reviewOfficerBo.getInReportAudit1Ids();
String inReportAudit2Ids = reviewOfficerBo.getInReportAudit2Ids();
saveReviewOfficerUser(reviewOfficerBo.getId(), checkUserIds, loginUser);
saveReviewOfficerAudit(reviewOfficerBo.getId(), inReportAudit1Ids, loginUser, 1);
saveReviewOfficerAudit(reviewOfficerBo.getId(), inReportAudit2Ids, loginUser, 2);
//保存附件
saveReviewOfficerAttachment(reviewOfficerBo.getId(), reviewOfficerBo.getInReportAttachmentArrStr(), loginUser, ReviewOfficer.STATE_IN_REPORT);
saveReviewOfficerAttachment(reviewOfficerBo.getId(), reviewOfficerBo.getCheckAttachmentArrStr(), loginUser, ReviewOfficer.STATE_CHECK);
saveReviewOfficerAttachment(reviewOfficerBo.getId(), reviewOfficerBo.getOpinionAttachmentArrStr(), loginUser, ReviewOfficer.STATE_OPINION);
saveReviewOfficerAttachment(reviewOfficerBo.getId(), reviewOfficerBo.getResultAttachmentArrStr(), loginUser, ReviewOfficer.STATE_RESULT);
// if (isNew) {
// sendMsg(reviewOfficer, loginUser, reviewOfficerBo.getInReportAudit1Ids().split(",")[0]);
// }
return Ret.ok();
}
// private void sendMsg(ReviewOfficer reviewOfficer, User loginUser, String userId) {
// //一个人一个人审核当手机端有通过操作时找到下一个人发消息
// if (StringUtils.isNotBlank(userId)) {
// Message message = new Message();
// message.setActionId(reviewOfficer.getId());
// message.setTitle("您有一个评议需审批,请前往查看!");
// message.setContent(reviewOfficer.getReviewSubject());
// message.setType(Message.TYPE_REVIEW);
// message.setCreatedId(loginUser != null ? loginUser.getId() : "");
// message.setStatus(Message.STATUS_UNREAD);
// message.setUserId(userId);
// messageService.save(message);
// }
// }
/*接口*/
public Ret comment(ReviewOfficerCommentRequest reviewCommentRequest, User loginUser) {
ReviewOfficer reviewOfficer = getById(reviewCommentRequest.getReviewId());
Assert.notNull(reviewOfficer, "未找到该记录");
ReviewOfficerComment reviewComment = BeanUtil.copyProperties(reviewCommentRequest, ReviewOfficerComment.class);
reviewComment.setCreatedId(loginUser.getId());
reviewComment.setUserId(loginUser.getId());
reviewComment.setUserName(loginUser.getUserName());
boolean flag = reviewOfficerCommentService.saveOrUpdate(reviewComment);
return !flag ? Ret.fail("操作失败") : Ret.ok().data(ReviewOfficerWrapper.build().entityVO(reviewOfficer));
}
@Transactional
public ReviewOfficer stateInReportSave(ReviewOfficerInReportStateRequest reviewOfficerInReportStateRequest, User loginUser) {
ReviewOfficer reviewOfficer = BeanUtil.copyProperties(reviewOfficerInReportStateRequest, ReviewOfficer.class);
reviewOfficer.setState(ReviewOfficer.STATE_IN_REPORT);
reviewOfficer.setStatus(0);
reviewOfficer.setCreatedId(loginUser.getId());
saveOrUpdate(reviewOfficer);
saveReviewOfficerAttachment(reviewOfficer.getId(), reviewOfficerInReportStateRequest.getInReportAttachmentName(), reviewOfficerInReportStateRequest.getInReportAttachmentPath(), loginUser, ReviewOfficer.STATE_IN_REPORT);
saveReviewOfficerAudit(reviewOfficer.getId(), reviewOfficerInReportStateRequest.getInReportAudit1Ids(), loginUser, 1);
saveReviewOfficerAudit(reviewOfficer.getId(), reviewOfficerInReportStateRequest.getInReportAudit2Ids(), loginUser, 2);
return reviewOfficer;
}
public Ret audit(ReviewOfficerAuditRequest reviewOfficerAuditRequest, User loginUser) {
ReviewOfficerAudit reviewOfficerAudit = reviewOfficerAuditService.getOne(new LambdaQueryWrapper<ReviewOfficerAudit>()
.eq(ReviewOfficerAudit::getReviewId, reviewOfficerAuditRequest.getReviewId())
.eq(ReviewOfficerAudit::getLevel, reviewOfficerAuditRequest.getLevel())
.eq(ReviewOfficerAudit::getUserId, loginUser.getId()));
if (reviewOfficerAudit == null) return Ret.fail("未找到该记录");
if (reviewOfficerAudit.getStatus() != 0) return Ret.fail("您已审核过");
ReviewOfficer reviewOfficer = getById(reviewOfficerAuditRequest.getReviewId());
if (reviewOfficer == null) return Ret.fail("未找到该记录");
if (reviewOfficer.getStatus() != 0) return Ret.fail("该评议不是已不是待审批状态");
//本人前面还有待审批的
int beforeWaitCount = reviewOfficerAuditService.count(new LambdaQueryWrapper<ReviewOfficerAudit>()
.eq(ReviewOfficerAudit::getReviewId, reviewOfficerAuditRequest.getReviewId())
.lt(ReviewOfficerAudit::getSortNo, reviewOfficerAudit.getSortNo())
.eq(ReviewOfficerAudit::getStatus, 0));
if (beforeWaitCount != 0) return Ret.fail("还未轮到您审批");
reviewOfficerAudit.setStatus(reviewOfficerAuditRequest.getStatus());
reviewOfficerAudit.setReason(reviewOfficerAuditRequest.getReason());
reviewOfficerAudit.setAuditAt(LocalDateTime.now());
boolean flag = reviewOfficerAuditService.saveOrUpdate(reviewOfficerAudit);
//如果拒绝就整个拒绝
if (reviewOfficerAudit.getStatus() == 2) {
reviewOfficer.setStatus(2);
saveOrUpdate(reviewOfficer);
}
//如果没有待审批的,进入下一阶段
List<ReviewOfficerAudit> waitAuditList = reviewOfficerAuditService.list(new LambdaQueryWrapper<ReviewOfficerAudit>()
.eq(ReviewOfficerAudit::getReviewId, reviewOfficerAuditRequest.getReviewId())
.eq(ReviewOfficerAudit::getStatus, 0)
.orderByAsc(ReviewOfficerAudit::getSortNo));
if (CollectionUtil.isEmpty(waitAuditList)) {
reviewOfficer.setStatus(1);
// reviewOfficer.setState(ReviewOfficer.STATE_REPORT); 直接跳过
// reviewOfficer.setState(ReviewOfficer.STATE_ASK); 直接跳过
reviewOfficer.setState(ReviewOfficer.STATE_CHECK);
saveOrUpdate(reviewOfficer);
} else {
ReviewOfficerAudit nextReviewOfficerAudit = waitAuditList.get(0);
// sendMsg(reviewOfficer, null, nextReviewOfficerAudit.getUserId());
}
return !flag ? Ret.fail("操作失败") : Ret.ok();
}
public ReviewOfficer stateCheckSave(ReviewOfficerCheckStateRequest reviewOfficerCheckStateRequest, User loginUser) {
ReviewOfficer reviewOfficer = getById(reviewOfficerCheckStateRequest.getReviewId());
Assert.notNull(reviewOfficer, "未找到该记录");
if (ReviewOfficer.STATE_CHECK != reviewOfficer.getState()) throw new ResultException(Ret.fail("当前环节不能提交该信息"));
BeanUtil.copyProperties(reviewOfficerCheckStateRequest, reviewOfficer);
saveOrUpdate(reviewOfficer);
saveReviewOfficerAttachment(reviewOfficer.getId(), reviewOfficerCheckStateRequest.getCheckAttachmentName(), reviewOfficerCheckStateRequest.getCheckAttachmentPath(), loginUser, ReviewOfficer.STATE_CHECK);
saveReviewOfficerUser(reviewOfficer.getId(), reviewOfficerCheckStateRequest.getCheckUserIds(), loginUser);
return reviewOfficer;
}
public Ret check(ReviewOfficerCheckRequest reviewOfficerCheckRequest, User loginUser) {
ReviewOfficer reviewOfficer = getById(reviewOfficerCheckRequest.getReviewId());
Assert.notNull(reviewOfficer, "未找到该记录");
ReviewOfficerUser reviewUser = reviewOfficerUserService.getOne(new LambdaQueryWrapper<ReviewOfficerUser>()
.eq(ReviewOfficerUser::getReviewId, reviewOfficerCheckRequest.getReviewId())
.eq(ReviewOfficerUser::getUserId, loginUser.getId()));
if (reviewUser == null) return Ret.fail("您没有打分的权限");
if (reviewUser.getScore() != null) return Ret.fail("您已打过分");
if (reviewOfficer.getState() > ReviewOfficer.STATE_CHECK) return Ret.fail("打分已结束,不能操作");
reviewUser.setScore(reviewOfficerCheckRequest.getScore());
reviewUser.setScoreAt(LocalDateTime.now());
boolean flag = reviewOfficerUserService.saveOrUpdate(reviewUser);
//全部打分完进入下一环节
int nullCount = reviewOfficerUserService.count(Wrappers.lambdaQuery(ReviewOfficerUser.class)
.eq(ReviewOfficerUser::getReviewId, reviewOfficerCheckRequest.getReviewId())
.isNull(ReviewOfficerUser::getScore));
if (nullCount == 0) {
reviewOfficer.setState(ReviewOfficer.STATE_OPINION);
saveOrUpdate(reviewOfficer);
}
return !flag ? Ret.fail("操作失败") : Ret.ok();
}
public Ret checkEnd(String id, User loginUser) {
ReviewOfficer reviewOfficer = getById(id);
Assert.notNull(reviewOfficer, "未找到该记录");
if (ReviewOfficer.STATE_CHECK != reviewOfficer.getState()) throw new ResultException(Ret.fail("当前环节不能提交该信息"));
if (!loginUser.getId().equals(reviewOfficer.getCreatedId())) return Ret.fail("您不是创建人,不能操作");
reviewOfficer.setState(ReviewOfficer.STATE_OPINION);
boolean flag = saveOrUpdate(reviewOfficer);
return !flag ? Ret.fail("操作失败") : Ret.ok().data(ReviewOfficerWrapper.build().entityVO(reviewOfficer));
}
public ReviewOfficer stateOpinionSave(ReviewOfficerOpinionStateRequest reviewOfficerOpinionStateRequest, User loginUser) {
ReviewOfficer reviewOfficer = getById(reviewOfficerOpinionStateRequest.getReviewId());
Assert.notNull(reviewOfficer, "未找到该记录");
if (ReviewOfficer.STATE_OPINION != reviewOfficer.getState()) throw new ResultException(Ret.fail("当前环节不能提交该信息"));
BeanUtil.copyProperties(reviewOfficerOpinionStateRequest, reviewOfficer);
reviewOfficer.setState(ReviewOfficer.STATE_RESULT);
saveOrUpdate(reviewOfficer);
saveReviewOfficerAttachment(reviewOfficer.getId(), reviewOfficerOpinionStateRequest.getOpinionAttachmentName(), reviewOfficerOpinionStateRequest.getOpinionAttachmentPath(), loginUser, ReviewOfficer.STATE_OPINION);
return reviewOfficer;
}
public ReviewOfficer stateResultSave(ReviewOfficerResultStateRequest reviewOfficerResultStateRequest, User loginUser) {
ReviewOfficer reviewOfficer = getById(reviewOfficerResultStateRequest.getReviewId());
Assert.notNull(reviewOfficer, "未找到该记录");
if (ReviewOfficer.STATE_RESULT != reviewOfficer.getState()) throw new ResultException(Ret.fail("当前环节不能提交该信息"));
BeanUtil.copyProperties(reviewOfficerResultStateRequest, reviewOfficer);
reviewOfficer.setState(ReviewOfficer.STATE_PUBLIC);
saveOrUpdate(reviewOfficer);
saveReviewOfficerAttachment(reviewOfficer.getId(), reviewOfficerResultStateRequest.getResultAttachmentName(), reviewOfficerResultStateRequest.getResultAttachmentPath(), loginUser, ReviewOfficer.STATE_RESULT);
return reviewOfficer;
}
/*公用*/
/**
* @param reviewId
* @param userIds
* @param loginUser
*/
private void saveReviewOfficerUser(String reviewId, String userIds, User loginUser) {
if (StrUtil.isNotBlank(userIds)) {
List<String> userIdList = Arrays.asList(userIds.split(","));
List<ReviewOfficerUser> userList = new ArrayList<>();
userIdList.forEach(userId -> {
//1.已存在的不管
int count = reviewOfficerUserService.count(new LambdaQueryWrapper<ReviewOfficerUser>()
.eq(ReviewOfficerUser::getReviewId, reviewId)
.eq(ReviewOfficerUser::getUserId, userId)
);
if (count == 0) {
//2.只插入新的
User user = userService.getById(userId);
ReviewOfficerUser item = new ReviewOfficerUser();
item.setUserId(userId);
item.setUserName(user != null ? user.getUserName() : "");
item.setReviewId(reviewId);
item.setCreatedId(loginUser.getId());
item.setCreatedAt(LocalDateTime.now());
userList.add(item);
}
});
//3.删除本来有而现在没有的
reviewOfficerUserService.remove(new LambdaQueryWrapper<ReviewOfficerUser>()
.eq(ReviewOfficerUser::getReviewId, reviewId)
.notIn(ReviewOfficerUser::getUserId, userIdList)
);
reviewOfficerUserService.saveBatch(userList);
} else {
//4.删除全部
reviewOfficerUserService.remove(new LambdaQueryWrapper<ReviewOfficerUser>()
.eq(ReviewOfficerUser::getReviewId, reviewId)
);
}
}
/**
* @param reviewId
* @param userIds
* @param loginUser
* @param level
*/
private void saveReviewOfficerAudit(String reviewId, String userIds, User loginUser, Integer level) {
if (StrUtil.isNotBlank(userIds)) {
List<String> userIdList = Arrays.asList(userIds.split(","));
List<ReviewOfficerAudit> userList = new ArrayList<>();
Iterator<String> iterator = userIdList.iterator();
int sortNo;
if (level == 1) {
sortNo = 1;
} else {
int level1Count = reviewOfficerAuditService.count(new LambdaQueryWrapper<ReviewOfficerAudit>()
.eq(ReviewOfficerAudit::getReviewId, reviewId)
.eq(ReviewOfficerAudit::getLevel, 1));
sortNo = level1Count + 1;
}
while (iterator.hasNext()) {
String userId = iterator.next();
//1.已存在的不管
int count = reviewOfficerAuditService.count(new LambdaQueryWrapper<ReviewOfficerAudit>()
.eq(ReviewOfficerAudit::getReviewId, reviewId)
.eq(ReviewOfficerAudit::getLevel, level)
.eq(ReviewOfficerAudit::getUserId, userId)
);
if (count == 0) {
//2.只插入新的
User user = userService.getById(userId);
ReviewOfficerAudit item = new ReviewOfficerAudit();
item.setUserId(userId);
item.setUserName(user != null ? user.getUserName() : "");
item.setReviewId(reviewId);
item.setStatus(0);
item.setLevel(level);
item.setSortNo(sortNo++);
item.setCreatedId(loginUser.getId());
item.setCreatedAt(LocalDateTime.now());
userList.add(item);
}
}
//3.删除本来有而现在没有的
reviewOfficerAuditService.remove(new LambdaQueryWrapper<ReviewOfficerAudit>()
.eq(ReviewOfficerAudit::getReviewId, reviewId)
.eq(ReviewOfficerAudit::getLevel, level)
.notIn(ReviewOfficerAudit::getUserId, userIdList)
);
reviewOfficerAuditService.saveBatch(userList);
} else {
//4.删除全部
reviewOfficerAuditService.remove(new LambdaQueryWrapper<ReviewOfficerAudit>()
.eq(ReviewOfficerAudit::getReviewId, reviewId)
.eq(ReviewOfficerAudit::getLevel, level)
);
}
}
/**
* @param reviewId
* @param reviewAttachmentArrStr
* @param loginUser
* @param state
*/
private void saveReviewOfficerAttachment(String reviewId, String reviewAttachmentArrStr, User loginUser, Integer state) {
reviewOfficerAttachmentService.remove(new LambdaQueryWrapper<ReviewOfficerAttachment>()
.eq(ReviewOfficerAttachment::getReviewId, reviewId)
.eq(ReviewOfficerAttachment::getType, state));
if (StrUtil.isNotBlank(reviewAttachmentArrStr)) {
List<ReviewOfficerAttachment> reviewAttachmentList = JSONObject.parseArray(reviewAttachmentArrStr, ReviewOfficerAttachment.class);
reviewAttachmentList.forEach(item -> {
item.setReviewId(reviewId);
item.setType(state);
item.setCreatedId(loginUser.getId());
item.setCreatedAt(LocalDateTime.now());
});
reviewOfficerAttachmentService.saveBatch(reviewAttachmentList);
}
}
/**
* @param reviewId
* @param attachmentName
* @param attachmentPath
* @param loginUser
* @param state
*/
private void saveReviewOfficerAttachment(String reviewId, String attachmentName, String attachmentPath, User loginUser, Integer state) {
reviewOfficerAttachmentService.remove(new LambdaQueryWrapper<ReviewOfficerAttachment>()
.eq(ReviewOfficerAttachment::getReviewId, reviewId)
.eq(ReviewOfficerAttachment::getType, state));
if (StrUtil.isNotBlank(attachmentName)) {
String[] nameArr = attachmentName.split(",");
String[] pathArr = attachmentPath.split(",");
for (int i = 0; i < nameArr.length; i++) {
ReviewOfficerAttachment reviewAttachment = new ReviewOfficerAttachment();
reviewAttachment.setType(state)
.setReviewId(reviewId)
.setTitle(nameArr[i])
.setAttachment(pathArr[i])
.setCreatedId(loginUser.getId())
.setCreatedAt(LocalDateTime.now());
reviewOfficerAttachmentService.save(reviewAttachment);
}
}
}
}

View File

@ -0,0 +1,19 @@
package com.ydool.boot.modules.rddb.service;
import com.ydool.boot.core.service.BaseService;
import com.ydool.boot.modules.rddb.entity.ReviewOfficerUser;
import com.ydool.boot.modules.rddb.mapper.ReviewOfficerUserMapper;
import org.springframework.stereotype.Service;
/**
* <p>
* 工作评议人员 服务实现类
* </p>
*
* @author zhouyuan
* @since 2022-05-12
*/
@Service
public class ReviewOfficerUserService extends BaseService<ReviewOfficerUserMapper, ReviewOfficerUser> {
}

View File

@ -0,0 +1,19 @@
package com.ydool.boot.modules.rddb.service;
import com.ydool.boot.core.service.BaseService;
import com.ydool.boot.modules.rddb.entity.ReviewSubjectAttachment;
import com.ydool.boot.modules.rddb.mapper.ReviewSubjectAttachmentMapper;
import org.springframework.stereotype.Service;
/**
* <p>
* 任免督职附件 服务实现类
* </p>
*
* @author zhouyuan
* @since 2022-05-12
*/
@Service
public class ReviewSubjectAttachmentService extends BaseService<ReviewSubjectAttachmentMapper, ReviewSubjectAttachment> {
}

View File

@ -0,0 +1,19 @@
package com.ydool.boot.modules.rddb.service;
import com.ydool.boot.core.service.BaseService;
import com.ydool.boot.modules.rddb.entity.ReviewSubjectAudit;
import com.ydool.boot.modules.rddb.mapper.ReviewSubjectAuditMapper;
import org.springframework.stereotype.Service;
/**
* <p>
* 评议审批 服务实现类
* </p>
*
* @author zhouyuan
* @since 2022-05-12
*/
@Service
public class ReviewSubjectAuditService extends BaseService<ReviewSubjectAuditMapper, ReviewSubjectAudit> {
}

View File

@ -0,0 +1,19 @@
package com.ydool.boot.modules.rddb.service;
import com.ydool.boot.core.service.BaseService;
import com.ydool.boot.modules.rddb.entity.ReviewSubjectComment;
import com.ydool.boot.modules.rddb.mapper.ReviewSubjectCommentMapper;
import org.springframework.stereotype.Service;
/**
* <p>
* 工作评议评论 服务实现类
* </p>
*
* @author zhouyuan
* @since 2022-05-12
*/
@Service
public class ReviewSubjectCommentService extends BaseService<ReviewSubjectCommentMapper, ReviewSubjectComment> {
}

View File

@ -0,0 +1,418 @@
package com.ydool.boot.modules.rddb.service;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.lang.Assert;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ydool.boot.common.result.Ret;
import com.ydool.boot.core.exception.ResultException;
import com.ydool.boot.core.service.BaseService;
import com.ydool.boot.modules.rddb.entity.*;
import com.ydool.boot.modules.rddb.entity.bo.ReviewSubjectBo;
import com.ydool.boot.modules.rddb.entity.request.review_subject.ReviewSubjectAuditRequest;
import com.ydool.boot.modules.rddb.entity.request.review_subject.ReviewSubjectCheckRequest;
import com.ydool.boot.modules.rddb.entity.request.review_subject.ReviewSubjectCommentRequest;
import com.ydool.boot.modules.rddb.entity.request.review_subject.state.ReviewSubjectCheckStateRequest;
import com.ydool.boot.modules.rddb.entity.request.review_subject.state.ReviewSubjectInReportStateRequest;
import com.ydool.boot.modules.rddb.entity.request.review_subject.state.ReviewSubjectOpinionStateRequest;
import com.ydool.boot.modules.rddb.entity.request.review_subject.state.ReviewSubjectResultStateRequest;
import com.ydool.boot.modules.rddb.mapper.ReviewSubjectMapper;
import com.ydool.boot.modules.rddb.wrapper.ReviewSubjectWrapper;
import com.ydool.boot.modules.sys.entity.User;
import com.ydool.boot.modules.sys.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
/**
* <p>
* 评议 服务实现类
* </p>
*
* @author zhouyuan
* @since 2022-05-12
*/
@Service
public class ReviewSubjectService extends BaseService<ReviewSubjectMapper, ReviewSubject> {
@Autowired
ReviewSubjectAttachmentService reviewSubjectAttachmentService;
@Autowired
ReviewSubjectCommentService reviewSubjectCommentService;
@Autowired
ReviewSubjectAuditService reviewSubjectAuditService;
@Autowired
ReviewSubjectUserService reviewSubjectUserService;
@Autowired
UserService userService;
/*后台*/
@Transactional
public boolean del(String id) {
reviewSubjectAttachmentService.remove(new LambdaQueryWrapper<ReviewSubjectAttachment>()
.eq(ReviewSubjectAttachment::getReviewId, id));
reviewSubjectCommentService.remove(new LambdaQueryWrapper<ReviewSubjectComment>()
.eq(ReviewSubjectComment::getReviewId, id));
reviewSubjectAuditService.remove(new LambdaQueryWrapper<ReviewSubjectAudit>()
.eq(ReviewSubjectAudit::getReviewId, id));
reviewSubjectUserService.remove(new LambdaQueryWrapper<ReviewSubjectUser>()
.eq(ReviewSubjectUser::getReviewId, id));
return removeById(id);
}
@Transactional
public Ret adminSaveOrUpdate(ReviewSubjectBo reviewSubjectBo, User loginUser) {
Boolean isNew = false;
ReviewSubject reviewSubject = BeanUtil.copyProperties(reviewSubjectBo, ReviewSubject.class);
if (StrUtil.isNotBlank(reviewSubject.getId())) {
reviewSubject.setUpdatedId(loginUser.getId());
} else {
reviewSubject.setState(ReviewSubject.STATE_IN_REPORT);
reviewSubject.setStatus(0);
reviewSubject.setCreatedId(loginUser.getId());
isNew = true;
}
saveOrUpdate(reviewSubject);
reviewSubjectBo.setId(reviewSubject.getId());
//指定人员
String checkUserIds = reviewSubjectBo.getCheckUserIds();
String inReportAudit1Ids = reviewSubjectBo.getInReportAudit1Ids();
String inReportAudit2Ids = reviewSubjectBo.getInReportAudit2Ids();
saveReviewSubjectUser(reviewSubjectBo.getId(), checkUserIds, loginUser);
saveReviewSubjectAudit(reviewSubjectBo.getId(), inReportAudit1Ids, loginUser, 1);
saveReviewSubjectAudit(reviewSubjectBo.getId(), inReportAudit2Ids, loginUser, 2);
//保存附件
saveReviewSubjectAttachment(reviewSubjectBo.getId(), reviewSubjectBo.getInReportAttachmentArrStr(), loginUser, ReviewSubject.STATE_IN_REPORT);
saveReviewSubjectAttachment(reviewSubjectBo.getId(), reviewSubjectBo.getCheckAttachmentArrStr(), loginUser, ReviewSubject.STATE_CHECK);
saveReviewSubjectAttachment(reviewSubjectBo.getId(), reviewSubjectBo.getOpinionAttachmentArrStr(), loginUser, ReviewSubject.STATE_OPINION);
saveReviewSubjectAttachment(reviewSubjectBo.getId(), reviewSubjectBo.getResultAttachmentArrStr(), loginUser, ReviewSubject.STATE_RESULT);
// if (isNew) {
// sendMsg(reviewSubject, loginUser, reviewSubjectBo.getInReportAudit1Ids().split(",")[0]);
// }
return Ret.ok();
}
// private void sendMsg(ReviewSubject reviewSubject, User loginUser, String userId) {
// //一个人一个人审核当手机端有通过操作时找到下一个人发消息
// if (StringUtils.isNotBlank(userId)) {
// Message message = new Message();
// message.setActionId(reviewSubject.getId());
// message.setTitle("您有一个评议需审批,请前往查看!");
// message.setContent(reviewSubject.getReviewSubject());
// message.setType(Message.TYPE_REVIEW);
// message.setCreatedId(loginUser != null ? loginUser.getId() : "");
// message.setStatus(Message.STATUS_UNREAD);
// message.setUserId(userId);
// messageService.save(message);
// }
// }
/*接口*/
public Ret comment(ReviewSubjectCommentRequest reviewCommentRequest, User loginUser) {
ReviewSubject reviewSubject = getById(reviewCommentRequest.getReviewId());
Assert.notNull(reviewSubject, "未找到该记录");
ReviewSubjectComment reviewComment = BeanUtil.copyProperties(reviewCommentRequest, ReviewSubjectComment.class);
reviewComment.setCreatedId(loginUser.getId());
reviewComment.setUserId(loginUser.getId());
reviewComment.setUserName(loginUser.getUserName());
boolean flag = reviewSubjectCommentService.saveOrUpdate(reviewComment);
return !flag ? Ret.fail("操作失败") : Ret.ok().data(ReviewSubjectWrapper.build().entityVO(reviewSubject));
}
@Transactional
public ReviewSubject stateInReportSave(ReviewSubjectInReportStateRequest reviewSubjectInReportStateRequest, User loginUser) {
ReviewSubject reviewSubject = BeanUtil.copyProperties(reviewSubjectInReportStateRequest, ReviewSubject.class);
reviewSubject.setState(ReviewSubject.STATE_IN_REPORT);
reviewSubject.setStatus(0);
reviewSubject.setCreatedId(loginUser.getId());
saveOrUpdate(reviewSubject);
saveReviewSubjectAttachment(reviewSubject.getId(), reviewSubjectInReportStateRequest.getInReportAttachmentName(), reviewSubjectInReportStateRequest.getInReportAttachmentPath(), loginUser, ReviewSubject.STATE_IN_REPORT);
saveReviewSubjectAudit(reviewSubject.getId(), reviewSubjectInReportStateRequest.getInReportAudit1Ids(), loginUser, 1);
saveReviewSubjectAudit(reviewSubject.getId(), reviewSubjectInReportStateRequest.getInReportAudit2Ids(), loginUser, 2);
return reviewSubject;
}
public Ret audit(ReviewSubjectAuditRequest reviewSubjectAuditRequest, User loginUser) {
ReviewSubjectAudit reviewSubjectAudit = reviewSubjectAuditService.getOne(new LambdaQueryWrapper<ReviewSubjectAudit>()
.eq(ReviewSubjectAudit::getReviewId, reviewSubjectAuditRequest.getReviewId())
.eq(ReviewSubjectAudit::getLevel, reviewSubjectAuditRequest.getLevel())
.eq(ReviewSubjectAudit::getUserId, loginUser.getId()));
if (reviewSubjectAudit == null) return Ret.fail("未找到该记录");
if (reviewSubjectAudit.getStatus() != 0) return Ret.fail("您已审核过");
ReviewSubject reviewSubject = getById(reviewSubjectAuditRequest.getReviewId());
if (reviewSubject == null) return Ret.fail("未找到该记录");
if (reviewSubject.getStatus() != 0) return Ret.fail("该评议不是已不是待审批状态");
//本人前面还有待审批的
int beforeWaitCount = reviewSubjectAuditService.count(new LambdaQueryWrapper<ReviewSubjectAudit>()
.eq(ReviewSubjectAudit::getReviewId, reviewSubjectAuditRequest.getReviewId())
.lt(ReviewSubjectAudit::getSortNo, reviewSubjectAudit.getSortNo())
.eq(ReviewSubjectAudit::getStatus, 0));
if (beforeWaitCount != 0) return Ret.fail("还未轮到您审批");
reviewSubjectAudit.setStatus(reviewSubjectAuditRequest.getStatus());
reviewSubjectAudit.setReason(reviewSubjectAuditRequest.getReason());
reviewSubjectAudit.setAuditAt(LocalDateTime.now());
boolean flag = reviewSubjectAuditService.saveOrUpdate(reviewSubjectAudit);
//如果拒绝就整个拒绝
if (reviewSubjectAudit.getStatus() == 2) {
reviewSubject.setStatus(2);
saveOrUpdate(reviewSubject);
}
//如果没有待审批的,进入下一阶段
List<ReviewSubjectAudit> waitAuditList = reviewSubjectAuditService.list(new LambdaQueryWrapper<ReviewSubjectAudit>()
.eq(ReviewSubjectAudit::getReviewId, reviewSubjectAuditRequest.getReviewId())
.eq(ReviewSubjectAudit::getStatus, 0)
.orderByAsc(ReviewSubjectAudit::getSortNo));
if (CollectionUtil.isEmpty(waitAuditList)) {
reviewSubject.setStatus(1);
// reviewSubject.setState(ReviewSubject.STATE_REPORT); 直接跳过
// reviewSubject.setState(ReviewSubject.STATE_ASK); 直接跳过
reviewSubject.setState(ReviewSubject.STATE_CHECK);
saveOrUpdate(reviewSubject);
} else {
ReviewSubjectAudit nextReviewSubjectAudit = waitAuditList.get(0);
// sendMsg(reviewSubject, null, nextReviewSubjectAudit.getUserId());
}
return !flag ? Ret.fail("操作失败") : Ret.ok();
}
public ReviewSubject stateCheckSave(ReviewSubjectCheckStateRequest reviewSubjectCheckStateRequest, User loginUser) {
ReviewSubject reviewSubject = getById(reviewSubjectCheckStateRequest.getReviewId());
Assert.notNull(reviewSubject, "未找到该记录");
if (ReviewSubject.STATE_CHECK != reviewSubject.getState()) throw new ResultException(Ret.fail("当前环节不能提交该信息"));
BeanUtil.copyProperties(reviewSubjectCheckStateRequest, reviewSubject);
saveOrUpdate(reviewSubject);
saveReviewSubjectAttachment(reviewSubject.getId(), reviewSubjectCheckStateRequest.getCheckAttachmentName(), reviewSubjectCheckStateRequest.getCheckAttachmentPath(), loginUser, ReviewSubject.STATE_CHECK);
saveReviewSubjectUser(reviewSubject.getId(), reviewSubjectCheckStateRequest.getCheckUserIds(), loginUser);
return reviewSubject;
}
public Ret check(ReviewSubjectCheckRequest reviewSubjectCheckRequest, User loginUser) {
ReviewSubject reviewSubject = getById(reviewSubjectCheckRequest.getReviewId());
Assert.notNull(reviewSubject, "未找到该记录");
ReviewSubjectUser reviewUser = reviewSubjectUserService.getOne(new LambdaQueryWrapper<ReviewSubjectUser>()
.eq(ReviewSubjectUser::getReviewId, reviewSubjectCheckRequest.getReviewId())
.eq(ReviewSubjectUser::getUserId, loginUser.getId()));
if (reviewUser == null) return Ret.fail("您没有打分的权限");
if (reviewUser.getScore() != null) return Ret.fail("您已打过分");
if (reviewSubject.getState() > ReviewSubject.STATE_CHECK) return Ret.fail("打分已结束,不能操作");
reviewUser.setScore(reviewSubjectCheckRequest.getScore());
reviewUser.setScoreAt(LocalDateTime.now());
boolean flag = reviewSubjectUserService.saveOrUpdate(reviewUser);
//全部打分完进入下一环节
int nullCount = reviewSubjectUserService.count(Wrappers.lambdaQuery(ReviewSubjectUser.class)
.eq(ReviewSubjectUser::getReviewId, reviewSubjectCheckRequest.getReviewId())
.isNull(ReviewSubjectUser::getScore));
if (nullCount == 0) {
reviewSubject.setState(ReviewSubject.STATE_OPINION);
saveOrUpdate(reviewSubject);
}
return !flag ? Ret.fail("操作失败") : Ret.ok();
}
public Ret checkEnd(String id, User loginUser) {
ReviewSubject reviewSubject = getById(id);
Assert.notNull(reviewSubject, "未找到该记录");
if (ReviewSubject.STATE_CHECK != reviewSubject.getState()) throw new ResultException(Ret.fail("当前环节不能提交该信息"));
if (!loginUser.getId().equals(reviewSubject.getCreatedId())) return Ret.fail("您不是创建人,不能操作");
reviewSubject.setState(ReviewSubject.STATE_OPINION);
boolean flag = saveOrUpdate(reviewSubject);
return !flag ? Ret.fail("操作失败") : Ret.ok().data(ReviewSubjectWrapper.build().entityVO(reviewSubject));
}
public ReviewSubject stateOpinionSave(ReviewSubjectOpinionStateRequest reviewSubjectOpinionStateRequest, User loginUser) {
ReviewSubject reviewSubject = getById(reviewSubjectOpinionStateRequest.getReviewId());
Assert.notNull(reviewSubject, "未找到该记录");
if (ReviewSubject.STATE_OPINION != reviewSubject.getState()) throw new ResultException(Ret.fail("当前环节不能提交该信息"));
BeanUtil.copyProperties(reviewSubjectOpinionStateRequest, reviewSubject);
reviewSubject.setState(ReviewSubject.STATE_RESULT);
saveOrUpdate(reviewSubject);
saveReviewSubjectAttachment(reviewSubject.getId(), reviewSubjectOpinionStateRequest.getOpinionAttachmentName(), reviewSubjectOpinionStateRequest.getOpinionAttachmentPath(), loginUser, ReviewSubject.STATE_OPINION);
return reviewSubject;
}
public ReviewSubject stateResultSave(ReviewSubjectResultStateRequest reviewSubjectResultStateRequest, User loginUser) {
ReviewSubject reviewSubject = getById(reviewSubjectResultStateRequest.getReviewId());
Assert.notNull(reviewSubject, "未找到该记录");
if (ReviewSubject.STATE_RESULT != reviewSubject.getState()) throw new ResultException(Ret.fail("当前环节不能提交该信息"));
BeanUtil.copyProperties(reviewSubjectResultStateRequest, reviewSubject);
reviewSubject.setState(ReviewSubject.STATE_PUBLIC);
saveOrUpdate(reviewSubject);
saveReviewSubjectAttachment(reviewSubject.getId(), reviewSubjectResultStateRequest.getResultAttachmentName(), reviewSubjectResultStateRequest.getResultAttachmentPath(), loginUser, ReviewSubject.STATE_RESULT);
return reviewSubject;
}
/*公用*/
/**
* @param reviewId
* @param userIds
* @param loginUser
*/
private void saveReviewSubjectUser(String reviewId, String userIds, User loginUser) {
if (StrUtil.isNotBlank(userIds)) {
List<String> userIdList = Arrays.asList(userIds.split(","));
List<ReviewSubjectUser> userList = new ArrayList<>();
userIdList.forEach(userId -> {
//1.已存在的不管
int count = reviewSubjectUserService.count(new LambdaQueryWrapper<ReviewSubjectUser>()
.eq(ReviewSubjectUser::getReviewId, reviewId)
.eq(ReviewSubjectUser::getUserId, userId)
);
if (count == 0) {
//2.只插入新的
User user = userService.getById(userId);
ReviewSubjectUser item = new ReviewSubjectUser();
item.setUserId(userId);
item.setUserName(user != null ? user.getUserName() : "");
item.setReviewId(reviewId);
item.setCreatedId(loginUser.getId());
item.setCreatedAt(LocalDateTime.now());
userList.add(item);
}
});
//3.删除本来有而现在没有的
reviewSubjectUserService.remove(new LambdaQueryWrapper<ReviewSubjectUser>()
.eq(ReviewSubjectUser::getReviewId, reviewId)
.notIn(ReviewSubjectUser::getUserId, userIdList)
);
reviewSubjectUserService.saveBatch(userList);
} else {
//4.删除全部
reviewSubjectUserService.remove(new LambdaQueryWrapper<ReviewSubjectUser>()
.eq(ReviewSubjectUser::getReviewId, reviewId)
);
}
}
/**
* @param reviewId
* @param userIds
* @param loginUser
* @param level
*/
private void saveReviewSubjectAudit(String reviewId, String userIds, User loginUser, Integer level) {
if (StrUtil.isNotBlank(userIds)) {
List<String> userIdList = Arrays.asList(userIds.split(","));
List<ReviewSubjectAudit> userList = new ArrayList<>();
Iterator<String> iterator = userIdList.iterator();
int sortNo;
if (level == 1) {
sortNo = 1;
} else {
int level1Count = reviewSubjectAuditService.count(new LambdaQueryWrapper<ReviewSubjectAudit>()
.eq(ReviewSubjectAudit::getReviewId, reviewId)
.eq(ReviewSubjectAudit::getLevel, 1));
sortNo = level1Count + 1;
}
while (iterator.hasNext()) {
String userId = iterator.next();
//1.已存在的不管
int count = reviewSubjectAuditService.count(new LambdaQueryWrapper<ReviewSubjectAudit>()
.eq(ReviewSubjectAudit::getReviewId, reviewId)
.eq(ReviewSubjectAudit::getLevel, level)
.eq(ReviewSubjectAudit::getUserId, userId)
);
if (count == 0) {
//2.只插入新的
User user = userService.getById(userId);
ReviewSubjectAudit item = new ReviewSubjectAudit();
item.setUserId(userId);
item.setUserName(user != null ? user.getUserName() : "");
item.setReviewId(reviewId);
item.setStatus(0);
item.setLevel(level);
item.setSortNo(sortNo++);
item.setCreatedId(loginUser.getId());
item.setCreatedAt(LocalDateTime.now());
userList.add(item);
}
}
//3.删除本来有而现在没有的
reviewSubjectAuditService.remove(new LambdaQueryWrapper<ReviewSubjectAudit>()
.eq(ReviewSubjectAudit::getReviewId, reviewId)
.eq(ReviewSubjectAudit::getLevel, level)
.notIn(ReviewSubjectAudit::getUserId, userIdList)
);
reviewSubjectAuditService.saveBatch(userList);
} else {
//4.删除全部
reviewSubjectAuditService.remove(new LambdaQueryWrapper<ReviewSubjectAudit>()
.eq(ReviewSubjectAudit::getReviewId, reviewId)
.eq(ReviewSubjectAudit::getLevel, level)
);
}
}
/**
* @param reviewId
* @param reviewAttachmentArrStr
* @param loginUser
* @param state
*/
private void saveReviewSubjectAttachment(String reviewId, String reviewAttachmentArrStr, User loginUser, Integer state) {
reviewSubjectAttachmentService.remove(new LambdaQueryWrapper<ReviewSubjectAttachment>()
.eq(ReviewSubjectAttachment::getReviewId, reviewId)
.eq(ReviewSubjectAttachment::getType, state));
if (StrUtil.isNotBlank(reviewAttachmentArrStr)) {
List<ReviewSubjectAttachment> reviewAttachmentList = JSONObject.parseArray(reviewAttachmentArrStr, ReviewSubjectAttachment.class);
reviewAttachmentList.forEach(item -> {
item.setReviewId(reviewId);
item.setType(state);
item.setCreatedId(loginUser.getId());
item.setCreatedAt(LocalDateTime.now());
});
reviewSubjectAttachmentService.saveBatch(reviewAttachmentList);
}
}
/**
* @param reviewId
* @param attachmentName
* @param attachmentPath
* @param loginUser
* @param state
*/
private void saveReviewSubjectAttachment(String reviewId, String attachmentName, String attachmentPath, User loginUser, Integer state) {
reviewSubjectAttachmentService.remove(new LambdaQueryWrapper<ReviewSubjectAttachment>()
.eq(ReviewSubjectAttachment::getReviewId, reviewId)
.eq(ReviewSubjectAttachment::getType, state));
if (StrUtil.isNotBlank(attachmentName)) {
String[] nameArr = attachmentName.split(",");
String[] pathArr = attachmentPath.split(",");
for (int i = 0; i < nameArr.length; i++) {
ReviewSubjectAttachment reviewAttachment = new ReviewSubjectAttachment();
reviewAttachment.setType(state)
.setReviewId(reviewId)
.setTitle(nameArr[i])
.setAttachment(pathArr[i])
.setCreatedId(loginUser.getId())
.setCreatedAt(LocalDateTime.now());
reviewSubjectAttachmentService.save(reviewAttachment);
}
}
}
}

View File

@ -0,0 +1,19 @@
package com.ydool.boot.modules.rddb.service;
import com.ydool.boot.core.service.BaseService;
import com.ydool.boot.modules.rddb.entity.ReviewSubjectUser;
import com.ydool.boot.modules.rddb.mapper.ReviewSubjectUserMapper;
import org.springframework.stereotype.Service;
/**
* <p>
* 工作评议人员 服务实现类
* </p>
*
* @author zhouyuan
* @since 2022-05-12
*/
@Service
public class ReviewSubjectUserService extends BaseService<ReviewSubjectUserMapper, ReviewSubjectUser> {
}

View File

@ -0,0 +1,19 @@
package com.ydool.boot.modules.rddb.service;
import com.ydool.boot.core.service.BaseService;
import com.ydool.boot.modules.rddb.entity.ReviewWorkAttachment;
import com.ydool.boot.modules.rddb.mapper.ReviewWorkAttachmentMapper;
import org.springframework.stereotype.Service;
/**
* <p>
* 任免督职附件 服务实现类
* </p>
*
* @author zhouyuan
* @since 2022-05-12
*/
@Service
public class ReviewWorkAttachmentService extends BaseService<ReviewWorkAttachmentMapper, ReviewWorkAttachment> {
}

View File

@ -0,0 +1,19 @@
package com.ydool.boot.modules.rddb.service;
import com.ydool.boot.core.service.BaseService;
import com.ydool.boot.modules.rddb.entity.ReviewWorkAudit;
import com.ydool.boot.modules.rddb.mapper.ReviewWorkAuditMapper;
import org.springframework.stereotype.Service;
/**
* <p>
* 评议审批 服务实现类
* </p>
*
* @author zhouyuan
* @since 2022-05-12
*/
@Service
public class ReviewWorkAuditService extends BaseService<ReviewWorkAuditMapper, ReviewWorkAudit> {
}

View File

@ -0,0 +1,19 @@
package com.ydool.boot.modules.rddb.service;
import com.ydool.boot.core.service.BaseService;
import com.ydool.boot.modules.rddb.entity.ReviewWorkComment;
import com.ydool.boot.modules.rddb.mapper.ReviewWorkCommentMapper;
import org.springframework.stereotype.Service;
/**
* <p>
* 工作评议评论 服务实现类
* </p>
*
* @author zhouyuan
* @since 2022-05-12
*/
@Service
public class ReviewWorkCommentService extends BaseService<ReviewWorkCommentMapper, ReviewWorkComment> {
}

View File

@ -0,0 +1,419 @@
package com.ydool.boot.modules.rddb.service;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.lang.Assert;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ydool.boot.common.result.Ret;
import com.ydool.boot.core.exception.ResultException;
import com.ydool.boot.core.service.BaseService;
import com.ydool.boot.modules.rddb.entity.*;
import com.ydool.boot.modules.rddb.entity.bo.ReviewWorkBo;
import com.ydool.boot.modules.rddb.entity.request.review_work.ReviewWorkAuditRequest;
import com.ydool.boot.modules.rddb.entity.request.review_work.ReviewWorkCheckRequest;
import com.ydool.boot.modules.rddb.entity.request.review_work.ReviewWorkCommentRequest;
import com.ydool.boot.modules.rddb.entity.request.review_work.state.ReviewWorkCheckStateRequest;
import com.ydool.boot.modules.rddb.entity.request.review_work.state.ReviewWorkInReportStateRequest;
import com.ydool.boot.modules.rddb.entity.request.review_work.state.ReviewWorkOpinionStateRequest;
import com.ydool.boot.modules.rddb.entity.request.review_work.state.ReviewWorkResultStateRequest;
import com.ydool.boot.modules.rddb.mapper.ReviewWorkMapper;
import com.ydool.boot.modules.rddb.wrapper.ReviewWorkWrapper;
import com.ydool.boot.modules.sys.entity.User;
import com.ydool.boot.modules.sys.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
/**
* <p>
* 评议 服务实现类
* </p>
*
* @author zhouyuan
* @since 2022-05-12
*/
@Service
public class ReviewWorkService extends BaseService<ReviewWorkMapper, ReviewWork> {
@Autowired
ReviewWorkAttachmentService reviewWorkAttachmentService;
@Autowired
ReviewWorkCommentService reviewWorkCommentService;
@Autowired
ReviewWorkAuditService reviewWorkAuditService;
@Autowired
ReviewWorkUserService reviewWorkUserService;
@Autowired
UserService userService;
/*后台*/
@Transactional
public boolean del(String id) {
reviewWorkAttachmentService.remove(new LambdaQueryWrapper<ReviewWorkAttachment>()
.eq(ReviewWorkAttachment::getReviewId, id));
reviewWorkCommentService.remove(new LambdaQueryWrapper<ReviewWorkComment>()
.eq(ReviewWorkComment::getReviewId, id));
reviewWorkAuditService.remove(new LambdaQueryWrapper<ReviewWorkAudit>()
.eq(ReviewWorkAudit::getReviewId, id));
reviewWorkUserService.remove(new LambdaQueryWrapper<ReviewWorkUser>()
.eq(ReviewWorkUser::getReviewId, id));
return removeById(id);
}
@Transactional
public Ret adminSaveOrUpdate(ReviewWorkBo reviewWorkBo, User loginUser) {
Boolean isNew = false;
ReviewWork reviewWork = BeanUtil.copyProperties(reviewWorkBo, ReviewWork.class);
if (StrUtil.isNotBlank(reviewWork.getId())) {
reviewWork.setUpdatedId(loginUser.getId());
} else {
reviewWork.setState(ReviewWork.STATE_IN_REPORT);
reviewWork.setStatus(0);
reviewWork.setCreatedId(loginUser.getId());
isNew = true;
}
saveOrUpdate(reviewWork);
reviewWorkBo.setId(reviewWork.getId());
//指定人员
String checkUserIds = reviewWorkBo.getCheckUserIds();
String inReportAudit1Ids = reviewWorkBo.getInReportAudit1Ids();
String inReportAudit2Ids = reviewWorkBo.getInReportAudit2Ids();
saveReviewWorkUser(reviewWorkBo.getId(), checkUserIds, loginUser);
saveReviewWorkAudit(reviewWorkBo.getId(), inReportAudit1Ids, loginUser, 1);
saveReviewWorkAudit(reviewWorkBo.getId(), inReportAudit2Ids, loginUser, 2);
//保存附件
saveReviewWorkAttachment(reviewWorkBo.getId(), reviewWorkBo.getInReportAttachmentArrStr(), loginUser, ReviewWork.STATE_IN_REPORT);
saveReviewWorkAttachment(reviewWorkBo.getId(), reviewWorkBo.getCheckAttachmentArrStr(), loginUser, ReviewWork.STATE_CHECK);
saveReviewWorkAttachment(reviewWorkBo.getId(), reviewWorkBo.getOpinionAttachmentArrStr(), loginUser, ReviewWork.STATE_OPINION);
saveReviewWorkAttachment(reviewWorkBo.getId(), reviewWorkBo.getResultAttachmentArrStr(), loginUser, ReviewWork.STATE_RESULT);
// if (isNew) {
// sendMsg(reviewWork, loginUser, reviewWorkBo.getInReportAudit1Ids().split(",")[0]);
// }
return Ret.ok();
}
// private void sendMsg(ReviewWork reviewWork, User loginUser, String userId) {
// //一个人一个人审核当手机端有通过操作时找到下一个人发消息
// if (StringUtils.isNotBlank(userId)) {
// Message message = new Message();
// message.setActionId(reviewWork.getId());
// message.setTitle("您有一个评议需审批,请前往查看!");
// message.setContent(reviewWork.getReviewSubject());
// message.setType(Message.TYPE_REVIEW);
// message.setCreatedId(loginUser != null ? loginUser.getId() : "");
// message.setStatus(Message.STATUS_UNREAD);
// message.setUserId(userId);
// messageService.save(message);
// }
// }
/*接口*/
public Ret comment(ReviewWorkCommentRequest reviewCommentRequest, User loginUser) {
ReviewWork reviewWork = getById(reviewCommentRequest.getReviewId());
Assert.notNull(reviewWork, "未找到该记录");
ReviewWorkComment reviewComment = BeanUtil.copyProperties(reviewCommentRequest, ReviewWorkComment.class);
reviewComment.setCreatedId(loginUser.getId());
reviewComment.setUserId(loginUser.getId());
reviewComment.setUserName(loginUser.getUserName());
boolean flag = reviewWorkCommentService.saveOrUpdate(reviewComment);
return !flag ? Ret.fail("操作失败") : Ret.ok().data(ReviewWorkWrapper.build().entityVO(reviewWork));
}
@Transactional
public ReviewWork stateInReportSave(ReviewWorkInReportStateRequest reviewWorkInReportStateRequest, User loginUser) {
ReviewWork reviewWork = BeanUtil.copyProperties(reviewWorkInReportStateRequest, ReviewWork.class);
reviewWork.setState(ReviewWork.STATE_IN_REPORT);
reviewWork.setStatus(0);
reviewWork.setCreatedId(loginUser.getId());
saveOrUpdate(reviewWork);
saveReviewWorkAttachment(reviewWork.getId(), reviewWorkInReportStateRequest.getInReportAttachmentName(), reviewWorkInReportStateRequest.getInReportAttachmentPath(), loginUser, ReviewWork.STATE_IN_REPORT);
saveReviewWorkAudit(reviewWork.getId(), reviewWorkInReportStateRequest.getInReportAudit1Ids(), loginUser, 1);
saveReviewWorkAudit(reviewWork.getId(), reviewWorkInReportStateRequest.getInReportAudit2Ids(), loginUser, 2);
return reviewWork;
}
public Ret audit(ReviewWorkAuditRequest reviewWorkAuditRequest, User loginUser) {
ReviewWorkAudit reviewWorkAudit = reviewWorkAuditService.getOne(new LambdaQueryWrapper<ReviewWorkAudit>()
.eq(ReviewWorkAudit::getReviewId, reviewWorkAuditRequest.getReviewId())
.eq(ReviewWorkAudit::getLevel, reviewWorkAuditRequest.getLevel())
.eq(ReviewWorkAudit::getUserId, loginUser.getId()));
if (reviewWorkAudit == null) return Ret.fail("未找到该记录");
if (reviewWorkAudit.getStatus() != 0) return Ret.fail("您已审核过");
ReviewWork reviewWork = getById(reviewWorkAuditRequest.getReviewId());
if (reviewWork == null) return Ret.fail("未找到该记录");
if (reviewWork.getStatus() != 0) return Ret.fail("该评议不是已不是待审批状态");
//本人前面还有待审批的
int beforeWaitCount = reviewWorkAuditService.count(new LambdaQueryWrapper<ReviewWorkAudit>()
.eq(ReviewWorkAudit::getReviewId, reviewWorkAuditRequest.getReviewId())
.lt(ReviewWorkAudit::getSortNo, reviewWorkAudit.getSortNo())
.eq(ReviewWorkAudit::getStatus, 0));
if (beforeWaitCount != 0) return Ret.fail("还未轮到您审批");
reviewWorkAudit.setStatus(reviewWorkAuditRequest.getStatus());
reviewWorkAudit.setReason(reviewWorkAuditRequest.getReason());
reviewWorkAudit.setAuditAt(LocalDateTime.now());
boolean flag = reviewWorkAuditService.saveOrUpdate(reviewWorkAudit);
//如果拒绝就整个拒绝
if (reviewWorkAudit.getStatus() == 2) {
reviewWork.setStatus(2);
saveOrUpdate(reviewWork);
}
//如果没有待审批的,进入下一阶段
List<ReviewWorkAudit> waitAuditList = reviewWorkAuditService.list(new LambdaQueryWrapper<ReviewWorkAudit>()
.eq(ReviewWorkAudit::getReviewId, reviewWorkAuditRequest.getReviewId())
.eq(ReviewWorkAudit::getStatus, 0)
.orderByAsc(ReviewWorkAudit::getSortNo));
if (CollectionUtil.isEmpty(waitAuditList)) {
reviewWork.setStatus(1);
// reviewWork.setState(ReviewWork.STATE_REPORT); 直接跳过
// reviewWork.setState(ReviewWork.STATE_ASK); 直接跳过
reviewWork.setState(ReviewWork.STATE_CHECK);
saveOrUpdate(reviewWork);
} else {
ReviewWorkAudit nextReviewWorkAudit = waitAuditList.get(0);
// sendMsg(reviewWork, null, nextReviewWorkAudit.getUserId());
}
return !flag ? Ret.fail("操作失败") : Ret.ok();
}
public ReviewWork stateCheckSave(ReviewWorkCheckStateRequest reviewWorkCheckStateRequest, User loginUser) {
ReviewWork reviewWork = getById(reviewWorkCheckStateRequest.getReviewId());
Assert.notNull(reviewWork, "未找到该记录");
if (ReviewWork.STATE_CHECK != reviewWork.getState()) throw new ResultException(Ret.fail("当前环节不能提交该信息"));
BeanUtil.copyProperties(reviewWorkCheckStateRequest, reviewWork);
saveOrUpdate(reviewWork);
saveReviewWorkAttachment(reviewWork.getId(), reviewWorkCheckStateRequest.getCheckAttachmentName(), reviewWorkCheckStateRequest.getCheckAttachmentPath(), loginUser, ReviewWork.STATE_CHECK);
saveReviewWorkUser(reviewWork.getId(), reviewWorkCheckStateRequest.getCheckUserIds(), loginUser);
return reviewWork;
}
public Ret check(ReviewWorkCheckRequest reviewWorkCheckRequest, User loginUser) {
ReviewWork reviewWork = getById(reviewWorkCheckRequest.getReviewId());
Assert.notNull(reviewWork, "未找到该记录");
ReviewWorkUser reviewUser = reviewWorkUserService.getOne(new LambdaQueryWrapper<ReviewWorkUser>()
.eq(ReviewWorkUser::getReviewId, reviewWorkCheckRequest.getReviewId())
.eq(ReviewWorkUser::getUserId, loginUser.getId()));
if (reviewUser == null) return Ret.fail("您没有打分的权限");
if (reviewUser.getScore() != null) return Ret.fail("您已打过分");
if (reviewWork.getState() > ReviewWork.STATE_CHECK) return Ret.fail("打分已结束,不能操作");
reviewUser.setScore(reviewWorkCheckRequest.getScore());
reviewUser.setScoreAt(LocalDateTime.now());
boolean flag = reviewWorkUserService.saveOrUpdate(reviewUser);
//全部打分完进入下一环节
int nullCount = reviewWorkUserService.count(Wrappers.lambdaQuery(ReviewWorkUser.class)
.eq(ReviewWorkUser::getReviewId, reviewWorkCheckRequest.getReviewId())
.isNull(ReviewWorkUser::getScore));
if (nullCount == 0) {
reviewWork.setState(ReviewWork.STATE_OPINION);
saveOrUpdate(reviewWork);
}
return !flag ? Ret.fail("操作失败") : Ret.ok();
}
public Ret checkEnd(String id, User loginUser) {
ReviewWork reviewWork = getById(id);
Assert.notNull(reviewWork, "未找到该记录");
if (ReviewWork.STATE_CHECK != reviewWork.getState()) throw new ResultException(Ret.fail("当前环节不能提交该信息"));
if (!loginUser.getId().equals(reviewWork.getCreatedId())) return Ret.fail("您不是创建人,不能操作");
reviewWork.setState(ReviewWork.STATE_OPINION);
boolean flag = saveOrUpdate(reviewWork);
return !flag ? Ret.fail("操作失败") : Ret.ok().data(ReviewWorkWrapper.build().entityVO(reviewWork));
}
public ReviewWork stateOpinionSave(ReviewWorkOpinionStateRequest reviewWorkOpinionStateRequest, User loginUser) {
ReviewWork reviewWork = getById(reviewWorkOpinionStateRequest.getReviewId());
Assert.notNull(reviewWork, "未找到该记录");
if (ReviewWork.STATE_OPINION != reviewWork.getState()) throw new ResultException(Ret.fail("当前环节不能提交该信息"));
BeanUtil.copyProperties(reviewWorkOpinionStateRequest, reviewWork);
reviewWork.setState(ReviewWork.STATE_RESULT);
saveOrUpdate(reviewWork);
saveReviewWorkAttachment(reviewWork.getId(), reviewWorkOpinionStateRequest.getOpinionAttachmentName(), reviewWorkOpinionStateRequest.getOpinionAttachmentPath(), loginUser, ReviewWork.STATE_OPINION);
return reviewWork;
}
public ReviewWork stateResultSave(ReviewWorkResultStateRequest reviewWorkResultStateRequest, User loginUser) {
ReviewWork reviewWork = getById(reviewWorkResultStateRequest.getReviewId());
Assert.notNull(reviewWork, "未找到该记录");
if (ReviewWork.STATE_RESULT != reviewWork.getState()) throw new ResultException(Ret.fail("当前环节不能提交该信息"));
BeanUtil.copyProperties(reviewWorkResultStateRequest, reviewWork);
reviewWork.setState(ReviewWork.STATE_PUBLIC);
saveOrUpdate(reviewWork);
saveReviewWorkAttachment(reviewWork.getId(), reviewWorkResultStateRequest.getResultAttachmentName(), reviewWorkResultStateRequest.getResultAttachmentPath(), loginUser, ReviewWork.STATE_RESULT);
return reviewWork;
}
/*公用*/
/**
* @param reviewId
* @param userIds
* @param loginUser
*/
private void saveReviewWorkUser(String reviewId, String userIds, User loginUser) {
if (StrUtil.isNotBlank(userIds)) {
List<String> userIdList = Arrays.asList(userIds.split(","));
List<ReviewWorkUser> userList = new ArrayList<>();
userIdList.forEach(userId -> {
//1.已存在的不管
int count = reviewWorkUserService.count(new LambdaQueryWrapper<ReviewWorkUser>()
.eq(ReviewWorkUser::getReviewId, reviewId)
.eq(ReviewWorkUser::getUserId, userId)
);
if (count == 0) {
//2.只插入新的
User user = userService.getById(userId);
ReviewWorkUser item = new ReviewWorkUser();
item.setUserId(userId);
item.setUserName(user != null ? user.getUserName() : "");
item.setReviewId(reviewId);
item.setCreatedId(loginUser.getId());
item.setCreatedAt(LocalDateTime.now());
userList.add(item);
}
});
//3.删除本来有而现在没有的
reviewWorkUserService.remove(new LambdaQueryWrapper<ReviewWorkUser>()
.eq(ReviewWorkUser::getReviewId, reviewId)
.notIn(ReviewWorkUser::getUserId, userIdList)
);
reviewWorkUserService.saveBatch(userList);
} else {
//4.删除全部
reviewWorkUserService.remove(new LambdaQueryWrapper<ReviewWorkUser>()
.eq(ReviewWorkUser::getReviewId, reviewId)
);
}
}
/**
* @param reviewId
* @param userIds
* @param loginUser
* @param level
*/
private void saveReviewWorkAudit(String reviewId, String userIds, User loginUser, Integer level) {
if (StrUtil.isNotBlank(userIds)) {
List<String> userIdList = Arrays.asList(userIds.split(","));
List<ReviewWorkAudit> userList = new ArrayList<>();
Iterator<String> iterator = userIdList.iterator();
int sortNo;
if (level == 1) {
sortNo = 1;
} else {
int level1Count = reviewWorkAuditService.count(new LambdaQueryWrapper<ReviewWorkAudit>()
.eq(ReviewWorkAudit::getReviewId, reviewId)
.eq(ReviewWorkAudit::getLevel, 1));
sortNo = level1Count + 1;
}
while (iterator.hasNext()) {
String userId = iterator.next();
//1.已存在的不管
int count = reviewWorkAuditService.count(new LambdaQueryWrapper<ReviewWorkAudit>()
.eq(ReviewWorkAudit::getReviewId, reviewId)
.eq(ReviewWorkAudit::getLevel, level)
.eq(ReviewWorkAudit::getUserId, userId)
);
if (count == 0) {
//2.只插入新的
User user = userService.getById(userId);
ReviewWorkAudit item = new ReviewWorkAudit();
item.setUserId(userId);
item.setUserName(user != null ? user.getUserName() : "");
item.setReviewId(reviewId);
item.setStatus(0);
item.setLevel(level);
item.setSortNo(sortNo++);
item.setCreatedId(loginUser.getId());
item.setCreatedAt(LocalDateTime.now());
userList.add(item);
}
}
//3.删除本来有而现在没有的
reviewWorkAuditService.remove(new LambdaQueryWrapper<ReviewWorkAudit>()
.eq(ReviewWorkAudit::getReviewId, reviewId)
.eq(ReviewWorkAudit::getLevel, level)
.notIn(ReviewWorkAudit::getUserId, userIdList)
);
reviewWorkAuditService.saveBatch(userList);
} else {
//4.删除全部
reviewWorkAuditService.remove(new LambdaQueryWrapper<ReviewWorkAudit>()
.eq(ReviewWorkAudit::getReviewId, reviewId)
.eq(ReviewWorkAudit::getLevel, level)
);
}
}
/**
* @param reviewId
* @param reviewAttachmentArrStr
* @param loginUser
* @param state
*/
private void saveReviewWorkAttachment(String reviewId, String reviewAttachmentArrStr, User loginUser, Integer state) {
reviewWorkAttachmentService.remove(new LambdaQueryWrapper<ReviewWorkAttachment>()
.eq(ReviewWorkAttachment::getReviewId, reviewId)
.eq(ReviewWorkAttachment::getType, state));
if (StrUtil.isNotBlank(reviewAttachmentArrStr)) {
List<ReviewWorkAttachment> reviewAttachmentList = JSONObject.parseArray(reviewAttachmentArrStr, ReviewWorkAttachment.class);
reviewAttachmentList.forEach(item -> {
item.setReviewId(reviewId);
item.setType(state);
item.setCreatedId(loginUser.getId());
item.setCreatedAt(LocalDateTime.now());
});
reviewWorkAttachmentService.saveBatch(reviewAttachmentList);
}
}
/**
* @param reviewId
* @param attachmentName
* @param attachmentPath
* @param loginUser
* @param state
*/
private void saveReviewWorkAttachment(String reviewId, String attachmentName, String attachmentPath, User loginUser, Integer state) {
reviewWorkAttachmentService.remove(new LambdaQueryWrapper<ReviewWorkAttachment>()
.eq(ReviewWorkAttachment::getReviewId, reviewId)
.eq(ReviewWorkAttachment::getType, state));
if (StrUtil.isNotBlank(attachmentName)) {
String[] nameArr = attachmentName.split(",");
String[] pathArr = attachmentPath.split(",");
for (int i = 0; i < nameArr.length; i++) {
ReviewWorkAttachment reviewAttachment = new ReviewWorkAttachment();
reviewAttachment.setType(state)
.setReviewId(reviewId)
.setTitle(nameArr[i])
.setAttachment(pathArr[i])
.setCreatedId(loginUser.getId())
.setCreatedAt(LocalDateTime.now());
reviewWorkAttachmentService.save(reviewAttachment);
}
}
}
}

View File

@ -0,0 +1,19 @@
package com.ydool.boot.modules.rddb.service;
import com.ydool.boot.core.service.BaseService;
import com.ydool.boot.modules.rddb.entity.ReviewWorkUser;
import com.ydool.boot.modules.rddb.mapper.ReviewWorkUserMapper;
import org.springframework.stereotype.Service;
/**
* <p>
* 工作评议人员 服务实现类
* </p>
*
* @author zhouyuan
* @since 2022-05-12
*/
@Service
public class ReviewWorkUserService extends BaseService<ReviewWorkUserMapper, ReviewWorkUser> {
}

View File

@ -1,21 +0,0 @@
package com.ydool.boot.modules.rddb.web;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.stereotype.Controller;
import com.ydool.boot.core.web.BaseController;
/**
* <p>
* 任免督职附件 前端控制器
* </p>
*
* @author zhouyuan
* @since 2022-05-12
*/
@Controller
@RequestMapping("/rddb/reviewAttachment")
public class ReviewAttachmentController extends BaseController {
}

View File

@ -1,125 +1,125 @@
package com.ydool.boot.modules.rddb.web;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ydool.boot.common.json.JsonMapper;
import com.ydool.boot.common.result.Ret;
import com.ydool.boot.core.auth.PreAuth;
import com.ydool.boot.modules.rddb.entity.Review;
import com.ydool.boot.modules.rddb.entity.ReviewAttachment;
import com.ydool.boot.modules.rddb.entity.bo.ReviewBo;
import com.ydool.boot.modules.rddb.service.ReviewAttachmentService;
import com.ydool.boot.modules.rddb.service.ReviewAuditService;
import com.ydool.boot.modules.rddb.service.ReviewService;
import com.ydool.boot.modules.rddb.service.ReviewUserService;
import com.ydool.boot.modules.sys.web.BaseAdminController;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.List;
/**
* <p>
* 评议 前端控制器
* </p>
*
* @author zhouyuan
* @since 2022-05-12
*/
@Controller
@RequestMapping("${ydool.path}/rddb/review")
public class ReviewController extends BaseAdminController {
@Autowired
ReviewService reviewService;
@Autowired
ReviewUserService reviewUserService;
@Autowired
ReviewAuditService reviewAuditService;
@Autowired
ReviewAttachmentService reviewAttachmentService;
@GetMapping
public String index(String type) {
request.setAttribute("type", type);
return "modules/rddb/review/index.html";
}
@GetMapping("audit")
public String vote(String id) {
request.setAttribute("id",id);
return "modules/rddb/review/audit.html";
}
@GetMapping("comment")
public String comment(String id) {
request.setAttribute("id",id);
return "modules/rddb/review/comment.html";
}
@GetMapping("check")
public String check(String id) {
request.setAttribute("id",id);
return "modules/rddb/review/check.html";
}
@PostMapping("list")
@ResponseBody
public void list(Review review) {
LambdaQueryWrapper<Review> wrapper = new LambdaQueryWrapper<Review>();
if (StringUtils.isNotBlank(review.getType())) wrapper.eq(Review::getType, review.getType());
if (StringUtils.isNotBlank(review.getReviewSubject()))
wrapper.like(Review::getReviewSubject, review.getReviewSubject());
if (review.getState() != null) wrapper.eq(Review::getState, review.getState());
if (review.getStatus() != null) wrapper.eq(Review::getStatus, review.getStatus());
wrapper.orderByDesc(Review::getCreatedAt);
Page page = reviewService.page(new Page(getPageNum(), getPageSize()), wrapper);
render(Ret.ok().paged(page));
}
@PreAuth("rddb:review:form")
@GetMapping("form")
public String form(String id, String type, Model model) throws Exception {
Review review = new Review();
if (ObjectUtil.isNotEmpty(id)) {
review = reviewService.getById(id);
List<ReviewAttachment> inReportAttachmentList = reviewAttachmentService.list(new LambdaQueryWrapper<ReviewAttachment>()
.eq(ReviewAttachment::getReviewId, id)
.eq(ReviewAttachment::getType, Review.STATE_IN_REPORT));
List<ReviewAttachment> checkAttachmentList = reviewAttachmentService.list(new LambdaQueryWrapper<ReviewAttachment>()
.eq(ReviewAttachment::getReviewId, id)
.eq(ReviewAttachment::getType, Review.STATE_CHECK));
List<ReviewAttachment> opinionAttachmentList = reviewAttachmentService.list(new LambdaQueryWrapper<ReviewAttachment>()
.eq(ReviewAttachment::getReviewId, id)
.eq(ReviewAttachment::getType, Review.STATE_OPINION));
List<ReviewAttachment> resultAttachmentList = reviewAttachmentService.list(new LambdaQueryWrapper<ReviewAttachment>()
.eq(ReviewAttachment::getReviewId, id)
.eq(ReviewAttachment::getType, Review.STATE_RESULT));
model.addAttribute("inReportAttachmentListStr", JsonMapper.getInstance().writeValueAsString(inReportAttachmentList));
model.addAttribute("checkAttachmentListStr", JsonMapper.getInstance().writeValueAsString(checkAttachmentList));
model.addAttribute("opinionAttachmentListStr", JsonMapper.getInstance().writeValueAsString(opinionAttachmentList));
model.addAttribute("resultAttachmentListStr", JsonMapper.getInstance().writeValueAsString(resultAttachmentList));
}
model.addAttribute("review", review);
model.addAttribute("type", type);
return "modules/rddb/review/form.html";
}
@PostMapping("save")
@ResponseBody
public void save(@Validated ReviewBo reviewBo) {
render(reviewService.adminSaveOrUpdate(reviewBo, getLoginUser()));
}
@PostMapping("/delete")
public void delete(String id) {
boolean flag = reviewService.del(id);
renderJson(!flag ? Ret.fail("操作失败") : Ret.ok());
}
}
//package com.ydool.boot.modules.rddb.web;
//
//
//import cn.hutool.core.util.ObjectUtil;
//import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
//import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
//import com.ydool.boot.common.json.JsonMapper;
//import com.ydool.boot.common.result.Ret;
//import com.ydool.boot.core.auth.PreAuth;
//import com.ydool.boot.modules.rddb.entity.Review;
//import com.ydool.boot.modules.rddb.entity.ReviewAttachment;
//import com.ydool.boot.modules.rddb.entity.bo.ReviewBo;
//import com.ydool.boot.modules.rddb.service.ReviewAttachmentService;
//import com.ydool.boot.modules.rddb.service.ReviewAuditService;
//import com.ydool.boot.modules.rddb.service.ReviewService;
//import com.ydool.boot.modules.rddb.service.ReviewUserService;
//import com.ydool.boot.modules.sys.web.BaseAdminController;
//import org.apache.commons.lang3.StringUtils;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.stereotype.Controller;
//import org.springframework.ui.Model;
//import org.springframework.validation.annotation.Validated;
//import org.springframework.web.bind.annotation.GetMapping;
//import org.springframework.web.bind.annotation.PostMapping;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.ResponseBody;
//
//import java.util.List;
//
///**
// * <p>
// * 评议 前端控制器
// * </p>
// *
// * @author zhouyuan
// * @since 2022-05-12
// */
//@Controller
//@RequestMapping("${ydool.path}/rddb/review")
//public class ReviewController extends BaseAdminController {
// @Autowired
// ReviewService reviewService;
// @Autowired
// ReviewUserService reviewUserService;
// @Autowired
// ReviewAuditService reviewAuditService;
// @Autowired
// ReviewAttachmentService reviewAttachmentService;
//
// @GetMapping
// public String index(String type) {
// request.setAttribute("type", type);
// return "modules/rddb/review/index.html";
// }
// @GetMapping("audit")
// public String vote(String id) {
// request.setAttribute("id",id);
// return "modules/rddb/review/audit.html";
// }
// @GetMapping("comment")
// public String comment(String id) {
// request.setAttribute("id",id);
// return "modules/rddb/review/comment.html";
// }
// @GetMapping("check")
// public String check(String id) {
// request.setAttribute("id",id);
// return "modules/rddb/review/check.html";
// }
//
// @PostMapping("list")
// @ResponseBody
// public void list(Review review) {
// LambdaQueryWrapper<Review> wrapper = new LambdaQueryWrapper<Review>();
// if (StringUtils.isNotBlank(review.getType())) wrapper.eq(Review::getType, review.getType());
// if (StringUtils.isNotBlank(review.getReviewSubject()))
// wrapper.like(Review::getReviewSubject, review.getReviewSubject());
// if (review.getState() != null) wrapper.eq(Review::getState, review.getState());
// if (review.getStatus() != null) wrapper.eq(Review::getStatus, review.getStatus());
// wrapper.orderByDesc(Review::getCreatedAt);
// Page page = reviewService.page(new Page(getPageNum(), getPageSize()), wrapper);
// render(Ret.ok().paged(page));
// }
//
// @PreAuth("rddb:review:form")
// @GetMapping("form")
// public String form(String id, String type, Model model) throws Exception {
// Review review = new Review();
// if (ObjectUtil.isNotEmpty(id)) {
// review = reviewService.getById(id);
// List<ReviewAttachment> inReportAttachmentList = reviewAttachmentService.list(new LambdaQueryWrapper<ReviewAttachment>()
// .eq(ReviewAttachment::getReviewId, id)
// .eq(ReviewAttachment::getType, Review.STATE_IN_REPORT));
// List<ReviewAttachment> checkAttachmentList = reviewAttachmentService.list(new LambdaQueryWrapper<ReviewAttachment>()
// .eq(ReviewAttachment::getReviewId, id)
// .eq(ReviewAttachment::getType, Review.STATE_CHECK));
// List<ReviewAttachment> opinionAttachmentList = reviewAttachmentService.list(new LambdaQueryWrapper<ReviewAttachment>()
// .eq(ReviewAttachment::getReviewId, id)
// .eq(ReviewAttachment::getType, Review.STATE_OPINION));
// List<ReviewAttachment> resultAttachmentList = reviewAttachmentService.list(new LambdaQueryWrapper<ReviewAttachment>()
// .eq(ReviewAttachment::getReviewId, id)
// .eq(ReviewAttachment::getType, Review.STATE_RESULT));
// model.addAttribute("inReportAttachmentListStr", JsonMapper.getInstance().writeValueAsString(inReportAttachmentList));
// model.addAttribute("checkAttachmentListStr", JsonMapper.getInstance().writeValueAsString(checkAttachmentList));
// model.addAttribute("opinionAttachmentListStr", JsonMapper.getInstance().writeValueAsString(opinionAttachmentList));
// model.addAttribute("resultAttachmentListStr", JsonMapper.getInstance().writeValueAsString(resultAttachmentList));
// }
// model.addAttribute("review", review);
// model.addAttribute("type", type);
// return "modules/rddb/review/form.html";
// }
//
// @PostMapping("save")
// @ResponseBody
// public void save(@Validated ReviewBo reviewBo) {
// render(reviewService.adminSaveOrUpdate(reviewBo, getLoginUser()));
// }
//
// @PostMapping("/delete")
// public void delete(String id) {
// boolean flag = reviewService.del(id);
// renderJson(!flag ? Ret.fail("操作失败") : Ret.ok());
// }
//
//}

View File

@ -0,0 +1,76 @@
package com.ydool.boot.modules.rddb.web;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ydool.boot.api.util.CodecUtils;
import com.ydool.boot.common.result.Ret;
import com.ydool.boot.common.utils.WebUtils;
import com.ydool.boot.modules.rddb.entity.ReviewOfficerAudit;
import com.ydool.boot.modules.rddb.service.ReviewOfficerAuditService;
import com.ydool.boot.modules.rddb.wrapper.UserDtoWrapper;
import com.ydool.boot.modules.sys.entity.User;
import com.ydool.boot.modules.sys.service.UserService;
import com.ydool.boot.modules.sys.web.BaseAdminController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
/**
* <p>
* 评议审批 前端控制器
* </p>
*
* @author zhouyuan
* @since 2022-05-12
*/
@Controller
@RequestMapping("${ydool.path}/rddb/review_officer_audit")
public class ReviewOfficerAuditController extends BaseAdminController {
@Autowired
private ReviewOfficerAuditService ReviewOfficerAuditService;
@Autowired
private UserService userService;
@RequestMapping("list")
@ResponseBody
public void list(String id, String type) {
QueryWrapper<ReviewOfficerAudit> wrapper = new QueryWrapper<>();
wrapper.eq("review_id", id);
wrapper.eq(StrUtil.isNotBlank(type), "level", type);
wrapper.orderByAsc("sort_no");
Page page = ReviewOfficerAuditService.page(new Page(getPageNum(), getPageSize()), wrapper);
render(Ret.ok().paged(page));
}
@GetMapping("to_assign")
public String toAssign( Model model) {
model.addAllAttributes(WebUtils.getParameters(request));
return "modules/rddb/assign.html";
}
/**
* 选择user列表过滤已选中人员
*
* @param userIds
*/
@RequestMapping("assign_list")
@ResponseBody
public void assignList(String userIds, String userName, String loginName) {
QueryWrapper<User> userQueryWrapper = new QueryWrapper<>();
userQueryWrapper.notIn("id", userIds.split(","));
if (StrUtil.isNotBlank(userName)) userQueryWrapper.like("user_name", userName);
//县级工作人员
userQueryWrapper.eq("account_type", "admin");
userQueryWrapper.like(StrUtil.isNotBlank(loginName), "AES_DECRYPT(from_base64 (login_name),'" + CodecUtils.KEY + "')", loginName);
Page page = userService.page(new Page(getPageNum(), getPageSize()), userQueryWrapper);
render(Ret.ok().paged(UserDtoWrapper.build().pageVO(page)));
}
}

View File

@ -0,0 +1,40 @@
package com.ydool.boot.modules.rddb.web;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ydool.boot.common.result.Ret;
import com.ydool.boot.core.web.BaseController;
import com.ydool.boot.modules.rddb.entity.ReviewOfficerComment;
import com.ydool.boot.modules.rddb.service.ReviewOfficerCommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
/**
* <p>
* 评议评论 前端控制器
* </p>
*
* @author zhouyuan
* @since 2022-05-12
*/
@Controller
@RequestMapping("${ydool.path}/rddb/review_officer_comment")
public class ReviewOfficerCommentController extends BaseController {
@Autowired
private ReviewOfficerCommentService reviewOfficerCommentService;
@RequestMapping("list")
@ResponseBody
public void list(String id) {
QueryWrapper<ReviewOfficerComment> wrapper = new QueryWrapper<>();
wrapper.eq("review_id", id);
wrapper.orderByDesc("created_at");
Page page = reviewOfficerCommentService.page(new Page(getPageNum(), getPageSize()), wrapper);
render(Ret.ok().paged(page));
}
}

View File

@ -0,0 +1,121 @@
package com.ydool.boot.modules.rddb.web;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ydool.boot.common.json.JsonMapper;
import com.ydool.boot.common.result.Ret;
import com.ydool.boot.core.auth.PreAuth;
import com.ydool.boot.modules.rddb.entity.ReviewOfficer;
import com.ydool.boot.modules.rddb.entity.ReviewOfficerAttachment;
import com.ydool.boot.modules.rddb.entity.bo.ReviewOfficerBo;
import com.ydool.boot.modules.rddb.service.ReviewOfficerAttachmentService;
import com.ydool.boot.modules.rddb.service.ReviewOfficerService;
import com.ydool.boot.modules.sys.web.BaseAdminController;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.List;
/**
* <p>
* 评议 前端控制器
* </p>
*
* @author zhouyuan
* @since 2022-05-12
*/
@Controller
@RequestMapping("${ydool.path}/rddb/review_officer")
public class ReviewOfficerController extends BaseAdminController {
@Autowired
ReviewOfficerService reviewOfficerService;
@Autowired
ReviewOfficerAttachmentService reviewOfficerAttachmentService;
@GetMapping
public String index(String type) {
request.setAttribute("type", type);
return "modules/rddb/review_officer/index.html";
}
@GetMapping("audit")
public String vote(String id) {
request.setAttribute("id", id);
return "modules/rddb/review_officer/audit.html";
}
@GetMapping("comment")
public String comment(String id) {
request.setAttribute("id", id);
return "modules/rddb/review_officer/comment.html";
}
@GetMapping("check")
public String check(String id) {
request.setAttribute("id", id);
return "modules/rddb/review_officer/check.html";
}
@PostMapping("list")
@ResponseBody
public void list(ReviewOfficer reviewOfficer) {
LambdaQueryWrapper<ReviewOfficer> wrapper = new LambdaQueryWrapper<ReviewOfficer>();
if (StringUtils.isNotBlank(reviewOfficer.getReviewSubject()))
wrapper.like(ReviewOfficer::getReviewSubject, reviewOfficer.getReviewSubject());
if (reviewOfficer.getState() != null) wrapper.eq(ReviewOfficer::getState, reviewOfficer.getState());
if (reviewOfficer.getStatus() != null) wrapper.eq(ReviewOfficer::getStatus, reviewOfficer.getStatus());
wrapper.orderByDesc(ReviewOfficer::getCreatedAt);
Page page = reviewOfficerService.page(new Page(getPageNum(), getPageSize()), wrapper);
render(Ret.ok().paged(page));
}
@PreAuth("rddb:reviewOfficer:form")
@GetMapping("form")
public String form(String id, String type, Model model) throws Exception {
ReviewOfficer reviewOfficer = new ReviewOfficer();
if (ObjectUtil.isNotEmpty(id)) {
reviewOfficer = reviewOfficerService.getById(id);
List<ReviewOfficerAttachment> inReportAttachmentList = reviewOfficerAttachmentService.list(new LambdaQueryWrapper<ReviewOfficerAttachment>()
.eq(ReviewOfficerAttachment::getReviewId, id)
.eq(ReviewOfficerAttachment::getType, ReviewOfficer.STATE_IN_REPORT));
List<ReviewOfficerAttachment> checkAttachmentList = reviewOfficerAttachmentService.list(new LambdaQueryWrapper<ReviewOfficerAttachment>()
.eq(ReviewOfficerAttachment::getReviewId, id)
.eq(ReviewOfficerAttachment::getType, ReviewOfficer.STATE_CHECK));
List<ReviewOfficerAttachment> opinionAttachmentList = reviewOfficerAttachmentService.list(new LambdaQueryWrapper<ReviewOfficerAttachment>()
.eq(ReviewOfficerAttachment::getReviewId, id)
.eq(ReviewOfficerAttachment::getType, ReviewOfficer.STATE_OPINION));
List<ReviewOfficerAttachment> resultAttachmentList = reviewOfficerAttachmentService.list(new LambdaQueryWrapper<ReviewOfficerAttachment>()
.eq(ReviewOfficerAttachment::getReviewId, id)
.eq(ReviewOfficerAttachment::getType, ReviewOfficer.STATE_RESULT));
model.addAttribute("inReportAttachmentListStr", JsonMapper.getInstance().writeValueAsString(inReportAttachmentList));
model.addAttribute("checkAttachmentListStr", JsonMapper.getInstance().writeValueAsString(checkAttachmentList));
model.addAttribute("opinionAttachmentListStr", JsonMapper.getInstance().writeValueAsString(opinionAttachmentList));
model.addAttribute("resultAttachmentListStr", JsonMapper.getInstance().writeValueAsString(resultAttachmentList));
}
model.addAttribute("reviewOfficer", reviewOfficer);
model.addAttribute("type", type);
return "modules/rddb/review_officer/form.html";
}
@PostMapping("save")
@ResponseBody
public void save(@Validated ReviewOfficerBo reviewOfficerBo) {
render(reviewOfficerService.adminSaveOrUpdate(reviewOfficerBo, getLoginUser()));
}
@PostMapping("/delete")
public void delete(String id) {
boolean flag = reviewOfficerService.del(id);
renderJson(!flag ? Ret.fail("操作失败") : Ret.ok());
}
}

View File

@ -0,0 +1,75 @@
package com.ydool.boot.modules.rddb.web;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ydool.boot.api.util.CodecUtils;
import com.ydool.boot.common.result.Ret;
import com.ydool.boot.common.utils.WebUtils;
import com.ydool.boot.modules.rddb.entity.ReviewOfficerUser;
import com.ydool.boot.modules.rddb.service.ReviewOfficerUserService;
import com.ydool.boot.modules.rddb.wrapper.UserDtoWrapper;
import com.ydool.boot.modules.sys.entity.User;
import com.ydool.boot.modules.sys.service.UserService;
import com.ydool.boot.modules.sys.web.BaseAdminController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
/**
* <p>
* 评议人员 前端控制器
* </p>
*
* @author zhouyuan
* @since 2022-05-12
*/
@Controller
@RequestMapping("${ydool.path}/rddb/review_officer_user")
public class ReviewOfficerUserController extends BaseAdminController {
@Autowired
private ReviewOfficerUserService reviewOfficerUserService;
@Autowired
private UserService userService;
@RequestMapping("list")
@ResponseBody
public void list(String id) {
QueryWrapper<ReviewOfficerUser> wrapper = new QueryWrapper<>();
wrapper.eq("review_id", id);
wrapper.orderByDesc("created_at");
Page page = reviewOfficerUserService.page(new Page(getPageNum(), getPageSize()), wrapper);
render(Ret.ok().paged(page));
}
@GetMapping("to_assign")
public String toAssign(Model model) {
model.addAllAttributes(WebUtils.getParameters(request));
return "modules/rddb/assign.html";
}
/**
* 选择user列表过滤已选中人员
*
* @param userIds
*/
@RequestMapping("assign_list")
@ResponseBody
public void assignList(String userIds, String userName, String loginName) {
QueryWrapper<User> userQueryWrapper = new QueryWrapper<>();
userQueryWrapper.notIn("id", userIds.split(","));
if (StrUtil.isNotBlank(userName)) userQueryWrapper.like("user_name", userName);
//县级工作人员
userQueryWrapper.eq("account_type", "admin");
userQueryWrapper.like(StrUtil.isNotBlank(loginName), "AES_DECRYPT(from_base64 (login_name),'" + CodecUtils.KEY + "')", loginName);
Page page = userService.page(new Page(getPageNum(), getPageSize()), userQueryWrapper);
render(Ret.ok().paged(UserDtoWrapper.build().pageVO(page)));
}
}

View File

@ -0,0 +1,76 @@
package com.ydool.boot.modules.rddb.web;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ydool.boot.api.util.CodecUtils;
import com.ydool.boot.common.result.Ret;
import com.ydool.boot.common.utils.WebUtils;
import com.ydool.boot.modules.rddb.entity.ReviewSubjectAudit;
import com.ydool.boot.modules.rddb.service.ReviewSubjectAuditService;
import com.ydool.boot.modules.rddb.wrapper.UserDtoWrapper;
import com.ydool.boot.modules.sys.entity.User;
import com.ydool.boot.modules.sys.service.UserService;
import com.ydool.boot.modules.sys.web.BaseAdminController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
/**
* <p>
* 评议审批 前端控制器
* </p>
*
* @author zhouyuan
* @since 2022-05-12
*/
@Controller
@RequestMapping("${ydool.path}/rddb/review_subject_audit")
public class ReviewSubjectAuditController extends BaseAdminController {
@Autowired
private ReviewSubjectAuditService ReviewSubjectAuditService;
@Autowired
private UserService userService;
@RequestMapping("list")
@ResponseBody
public void list(String id, String type) {
QueryWrapper<ReviewSubjectAudit> wrapper = new QueryWrapper<>();
wrapper.eq("review_id", id);
wrapper.eq(StrUtil.isNotBlank(type), "level", type);
wrapper.orderByAsc("sort_no");
Page page = ReviewSubjectAuditService.page(new Page(getPageNum(), getPageSize()), wrapper);
render(Ret.ok().paged(page));
}
@GetMapping("to_assign")
public String toAssign( Model model) {
model.addAllAttributes(WebUtils.getParameters(request));
return "modules/rddb/assign.html";
}
/**
* 选择user列表过滤已选中人员
*
* @param userIds
*/
@RequestMapping("assign_list")
@ResponseBody
public void assignList(String userIds, String userName, String loginName) {
QueryWrapper<User> userQueryWrapper = new QueryWrapper<>();
userQueryWrapper.notIn("id", userIds.split(","));
if (StrUtil.isNotBlank(userName)) userQueryWrapper.like("user_name", userName);
//县级工作人员
userQueryWrapper.eq("account_type", "admin");
userQueryWrapper.like(StrUtil.isNotBlank(loginName), "AES_DECRYPT(from_base64 (login_name),'" + CodecUtils.KEY + "')", loginName);
Page page = userService.page(new Page(getPageNum(), getPageSize()), userQueryWrapper);
render(Ret.ok().paged(UserDtoWrapper.build().pageVO(page)));
}
}

View File

@ -0,0 +1,40 @@
package com.ydool.boot.modules.rddb.web;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ydool.boot.common.result.Ret;
import com.ydool.boot.core.web.BaseController;
import com.ydool.boot.modules.rddb.entity.ReviewSubjectComment;
import com.ydool.boot.modules.rddb.service.ReviewSubjectCommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
/**
* <p>
* 评议评论 前端控制器
* </p>
*
* @author zhouyuan
* @since 2022-05-12
*/
@Controller
@RequestMapping("${ydool.path}/rddb/review_subject_comment")
public class ReviewSubjectCommentController extends BaseController {
@Autowired
private ReviewSubjectCommentService reviewSubjectCommentService;
@RequestMapping("list")
@ResponseBody
public void list(String id) {
QueryWrapper<ReviewSubjectComment> wrapper = new QueryWrapper<>();
wrapper.eq("review_id", id);
wrapper.orderByDesc("created_at");
Page page = reviewSubjectCommentService.page(new Page(getPageNum(), getPageSize()), wrapper);
render(Ret.ok().paged(page));
}
}

View File

@ -0,0 +1,121 @@
package com.ydool.boot.modules.rddb.web;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ydool.boot.common.json.JsonMapper;
import com.ydool.boot.common.result.Ret;
import com.ydool.boot.core.auth.PreAuth;
import com.ydool.boot.modules.rddb.entity.ReviewSubject;
import com.ydool.boot.modules.rddb.entity.ReviewSubjectAttachment;
import com.ydool.boot.modules.rddb.entity.bo.ReviewSubjectBo;
import com.ydool.boot.modules.rddb.service.ReviewSubjectAttachmentService;
import com.ydool.boot.modules.rddb.service.ReviewSubjectService;
import com.ydool.boot.modules.sys.web.BaseAdminController;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.List;
/**
* <p>
* 评议 前端控制器
* </p>
*
* @author zhouyuan
* @since 2022-05-12
*/
@Controller
@RequestMapping("${ydool.path}/rddb/review_subject")
public class ReviewSubjectController extends BaseAdminController {
@Autowired
ReviewSubjectService reviewSubjectService;
@Autowired
ReviewSubjectAttachmentService reviewSubjectAttachmentService;
@GetMapping
public String index(String type) {
request.setAttribute("type", type);
return "modules/rddb/review_subject/index.html";
}
@GetMapping("audit")
public String vote(String id) {
request.setAttribute("id", id);
return "modules/rddb/review_subject/audit.html";
}
@GetMapping("comment")
public String comment(String id) {
request.setAttribute("id", id);
return "modules/rddb/review_subject/comment.html";
}
@GetMapping("check")
public String check(String id) {
request.setAttribute("id", id);
return "modules/rddb/review_subject/check.html";
}
@PostMapping("list")
@ResponseBody
public void list(ReviewSubject reviewSubject) {
LambdaQueryWrapper<ReviewSubject> wrapper = new LambdaQueryWrapper<ReviewSubject>();
if (StringUtils.isNotBlank(reviewSubject.getReviewSubject()))
wrapper.like(ReviewSubject::getReviewSubject, reviewSubject.getReviewSubject());
if (reviewSubject.getState() != null) wrapper.eq(ReviewSubject::getState, reviewSubject.getState());
if (reviewSubject.getStatus() != null) wrapper.eq(ReviewSubject::getStatus, reviewSubject.getStatus());
wrapper.orderByDesc(ReviewSubject::getCreatedAt);
Page page = reviewSubjectService.page(new Page(getPageNum(), getPageSize()), wrapper);
render(Ret.ok().paged(page));
}
@PreAuth("rddb:reviewSubject:form")
@GetMapping("form")
public String form(String id, String type, Model model) throws Exception {
ReviewSubject reviewSubject = new ReviewSubject();
if (ObjectUtil.isNotEmpty(id)) {
reviewSubject = reviewSubjectService.getById(id);
List<ReviewSubjectAttachment> inReportAttachmentList = reviewSubjectAttachmentService.list(new LambdaQueryWrapper<ReviewSubjectAttachment>()
.eq(ReviewSubjectAttachment::getReviewId, id)
.eq(ReviewSubjectAttachment::getType, ReviewSubject.STATE_IN_REPORT));
List<ReviewSubjectAttachment> checkAttachmentList = reviewSubjectAttachmentService.list(new LambdaQueryWrapper<ReviewSubjectAttachment>()
.eq(ReviewSubjectAttachment::getReviewId, id)
.eq(ReviewSubjectAttachment::getType, ReviewSubject.STATE_CHECK));
List<ReviewSubjectAttachment> opinionAttachmentList = reviewSubjectAttachmentService.list(new LambdaQueryWrapper<ReviewSubjectAttachment>()
.eq(ReviewSubjectAttachment::getReviewId, id)
.eq(ReviewSubjectAttachment::getType, ReviewSubject.STATE_OPINION));
List<ReviewSubjectAttachment> resultAttachmentList = reviewSubjectAttachmentService.list(new LambdaQueryWrapper<ReviewSubjectAttachment>()
.eq(ReviewSubjectAttachment::getReviewId, id)
.eq(ReviewSubjectAttachment::getType, ReviewSubject.STATE_RESULT));
model.addAttribute("inReportAttachmentListStr", JsonMapper.getInstance().writeValueAsString(inReportAttachmentList));
model.addAttribute("checkAttachmentListStr", JsonMapper.getInstance().writeValueAsString(checkAttachmentList));
model.addAttribute("opinionAttachmentListStr", JsonMapper.getInstance().writeValueAsString(opinionAttachmentList));
model.addAttribute("resultAttachmentListStr", JsonMapper.getInstance().writeValueAsString(resultAttachmentList));
}
model.addAttribute("reviewSubject", reviewSubject);
model.addAttribute("type", type);
return "modules/rddb/review_subject/form.html";
}
@PostMapping("save")
@ResponseBody
public void save(@Validated ReviewSubjectBo reviewSubjectBo) {
render(reviewSubjectService.adminSaveOrUpdate(reviewSubjectBo, getLoginUser()));
}
@PostMapping("/delete")
public void delete(String id) {
boolean flag = reviewSubjectService.del(id);
renderJson(!flag ? Ret.fail("操作失败") : Ret.ok());
}
}

View File

@ -0,0 +1,75 @@
package com.ydool.boot.modules.rddb.web;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ydool.boot.api.util.CodecUtils;
import com.ydool.boot.common.result.Ret;
import com.ydool.boot.common.utils.WebUtils;
import com.ydool.boot.modules.rddb.entity.ReviewSubjectUser;
import com.ydool.boot.modules.rddb.service.ReviewSubjectUserService;
import com.ydool.boot.modules.rddb.wrapper.UserDtoWrapper;
import com.ydool.boot.modules.sys.entity.User;
import com.ydool.boot.modules.sys.service.UserService;
import com.ydool.boot.modules.sys.web.BaseAdminController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
/**
* <p>
* 评议人员 前端控制器
* </p>
*
* @author zhouyuan
* @since 2022-05-12
*/
@Controller
@RequestMapping("${ydool.path}/rddb/review_subject_user")
public class ReviewSubjectUserController extends BaseAdminController {
@Autowired
private ReviewSubjectUserService reviewSubjectUserService;
@Autowired
private UserService userService;
@RequestMapping("list")
@ResponseBody
public void list(String id) {
QueryWrapper<ReviewSubjectUser> wrapper = new QueryWrapper<>();
wrapper.eq("review_id", id);
wrapper.orderByDesc("created_at");
Page page = reviewSubjectUserService.page(new Page(getPageNum(), getPageSize()), wrapper);
render(Ret.ok().paged(page));
}
@GetMapping("to_assign")
public String toAssign(Model model) {
model.addAllAttributes(WebUtils.getParameters(request));
return "modules/rddb/assign.html";
}
/**
* 选择user列表过滤已选中人员
*
* @param userIds
*/
@RequestMapping("assign_list")
@ResponseBody
public void assignList(String userIds, String userName, String loginName) {
QueryWrapper<User> userQueryWrapper = new QueryWrapper<>();
userQueryWrapper.notIn("id", userIds.split(","));
if (StrUtil.isNotBlank(userName)) userQueryWrapper.like("user_name", userName);
//县级工作人员
userQueryWrapper.eq("account_type", "admin");
userQueryWrapper.like(StrUtil.isNotBlank(loginName), "AES_DECRYPT(from_base64 (login_name),'" + CodecUtils.KEY + "')", loginName);
Page page = userService.page(new Page(getPageNum(), getPageSize()), userQueryWrapper);
render(Ret.ok().paged(UserDtoWrapper.build().pageVO(page)));
}
}

View File

@ -0,0 +1,75 @@
package com.ydool.boot.modules.rddb.web;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ydool.boot.api.util.CodecUtils;
import com.ydool.boot.common.result.Ret;
import com.ydool.boot.common.utils.WebUtils;
import com.ydool.boot.modules.rddb.entity.ReviewWorkAudit;
import com.ydool.boot.modules.rddb.service.ReviewWorkAuditService;
import com.ydool.boot.modules.rddb.wrapper.UserDtoWrapper;
import com.ydool.boot.modules.sys.entity.User;
import com.ydool.boot.modules.sys.service.UserService;
import com.ydool.boot.modules.sys.web.BaseAdminController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
/**
* <p>
* 评议审批 前端控制器
* </p>
*
* @author zhouyuan
* @since 2022-05-12
*/
@Controller
@RequestMapping("${ydool.path}/rddb/review_work_audit")
public class ReviewWorkAuditController extends BaseAdminController {
@Autowired
private ReviewWorkAuditService ReviewWorkAuditService;
@Autowired
private UserService userService;
@RequestMapping("list")
@ResponseBody
public void list(String id, String type) {
QueryWrapper<ReviewWorkAudit> wrapper = new QueryWrapper<>();
wrapper.eq("review_id", id);
wrapper.eq(StrUtil.isNotBlank(type), "level", type);
wrapper.orderByAsc("sort_no");
Page page = ReviewWorkAuditService.page(new Page(getPageNum(), getPageSize()), wrapper);
render(Ret.ok().paged(page));
}
@GetMapping("to_assign")
public String toAssign( Model model) {
model.addAllAttributes(WebUtils.getParameters(request));
return "modules/rddb/assign.html";
}
/**
* 选择user列表过滤已选中人员
*
* @param userIds
*/
@RequestMapping("assign_list")
@ResponseBody
public void assignList(String userIds, String userName, String loginName) {
QueryWrapper<User> userQueryWrapper = new QueryWrapper<>();
userQueryWrapper.notIn("id", userIds.split(","));
if (StrUtil.isNotBlank(userName)) userQueryWrapper.like("user_name", userName);
//县级工作人员
userQueryWrapper.eq("account_type", "admin");
userQueryWrapper.like(StrUtil.isNotBlank(loginName), "AES_DECRYPT(from_base64 (login_name),'" + CodecUtils.KEY + "')", loginName);
Page page = userService.page(new Page(getPageNum(), getPageSize()), userQueryWrapper);
render(Ret.ok().paged(UserDtoWrapper.build().pageVO(page)));
}
}

View File

@ -0,0 +1,40 @@
package com.ydool.boot.modules.rddb.web;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ydool.boot.common.result.Ret;
import com.ydool.boot.core.web.BaseController;
import com.ydool.boot.modules.rddb.entity.ReviewWorkComment;
import com.ydool.boot.modules.rddb.service.ReviewWorkCommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
/**
* <p>
* 评议评论 前端控制器
* </p>
*
* @author zhouyuan
* @since 2022-05-12
*/
@Controller
@RequestMapping("${ydool.path}/rddb/review_work_comment")
public class ReviewWorkCommentController extends BaseController {
@Autowired
private ReviewWorkCommentService reviewWorkCommentService;
@RequestMapping("list")
@ResponseBody
public void list(String id) {
QueryWrapper<ReviewWorkComment> wrapper = new QueryWrapper<>();
wrapper.eq("review_id", id);
wrapper.orderByDesc("created_at");
Page page = reviewWorkCommentService.page(new Page(getPageNum(), getPageSize()), wrapper);
render(Ret.ok().paged(page));
}
}

View File

@ -0,0 +1,121 @@
package com.ydool.boot.modules.rddb.web;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ydool.boot.common.json.JsonMapper;
import com.ydool.boot.common.result.Ret;
import com.ydool.boot.core.auth.PreAuth;
import com.ydool.boot.modules.rddb.entity.ReviewWork;
import com.ydool.boot.modules.rddb.entity.ReviewWorkAttachment;
import com.ydool.boot.modules.rddb.entity.bo.ReviewWorkBo;
import com.ydool.boot.modules.rddb.service.ReviewWorkAttachmentService;
import com.ydool.boot.modules.rddb.service.ReviewWorkService;
import com.ydool.boot.modules.sys.web.BaseAdminController;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.List;
/**
* <p>
* 评议 前端控制器
* </p>
*
* @author zhouyuan
* @since 2022-05-12
*/
@Controller
@RequestMapping("${ydool.path}/rddb/review_work")
public class ReviewWorkController extends BaseAdminController {
@Autowired
ReviewWorkService reviewWorkService;
@Autowired
ReviewWorkAttachmentService reviewWorkAttachmentService;
@GetMapping
public String index(String type) {
request.setAttribute("type", type);
return "modules/rddb/review_work/index.html";
}
@GetMapping("audit")
public String vote(String id) {
request.setAttribute("id", id);
return "modules/rddb/review_work/audit.html";
}
@GetMapping("comment")
public String comment(String id) {
request.setAttribute("id", id);
return "modules/rddb/review_work/comment.html";
}
@GetMapping("check")
public String check(String id) {
request.setAttribute("id", id);
return "modules/rddb/review_work/check.html";
}
@PostMapping("list")
@ResponseBody
public void list(ReviewWork reviewWork) {
LambdaQueryWrapper<ReviewWork> wrapper = new LambdaQueryWrapper<ReviewWork>();
if (StringUtils.isNotBlank(reviewWork.getReviewSubject()))
wrapper.like(ReviewWork::getReviewSubject, reviewWork.getReviewSubject());
if (reviewWork.getState() != null) wrapper.eq(ReviewWork::getState, reviewWork.getState());
if (reviewWork.getStatus() != null) wrapper.eq(ReviewWork::getStatus, reviewWork.getStatus());
wrapper.orderByDesc(ReviewWork::getCreatedAt);
Page page = reviewWorkService.page(new Page(getPageNum(), getPageSize()), wrapper);
render(Ret.ok().paged(page));
}
@PreAuth("rddb:reviewWork:form")
@GetMapping("form")
public String form(String id, String type, Model model) throws Exception {
ReviewWork reviewWork = new ReviewWork();
if (ObjectUtil.isNotEmpty(id)) {
reviewWork = reviewWorkService.getById(id);
List<ReviewWorkAttachment> inReportAttachmentList = reviewWorkAttachmentService.list(new LambdaQueryWrapper<ReviewWorkAttachment>()
.eq(ReviewWorkAttachment::getReviewId, id)
.eq(ReviewWorkAttachment::getType, ReviewWork.STATE_IN_REPORT));
List<ReviewWorkAttachment> checkAttachmentList = reviewWorkAttachmentService.list(new LambdaQueryWrapper<ReviewWorkAttachment>()
.eq(ReviewWorkAttachment::getReviewId, id)
.eq(ReviewWorkAttachment::getType, ReviewWork.STATE_CHECK));
List<ReviewWorkAttachment> opinionAttachmentList = reviewWorkAttachmentService.list(new LambdaQueryWrapper<ReviewWorkAttachment>()
.eq(ReviewWorkAttachment::getReviewId, id)
.eq(ReviewWorkAttachment::getType, ReviewWork.STATE_OPINION));
List<ReviewWorkAttachment> resultAttachmentList = reviewWorkAttachmentService.list(new LambdaQueryWrapper<ReviewWorkAttachment>()
.eq(ReviewWorkAttachment::getReviewId, id)
.eq(ReviewWorkAttachment::getType, ReviewWork.STATE_RESULT));
model.addAttribute("inReportAttachmentListStr", JsonMapper.getInstance().writeValueAsString(inReportAttachmentList));
model.addAttribute("checkAttachmentListStr", JsonMapper.getInstance().writeValueAsString(checkAttachmentList));
model.addAttribute("opinionAttachmentListStr", JsonMapper.getInstance().writeValueAsString(opinionAttachmentList));
model.addAttribute("resultAttachmentListStr", JsonMapper.getInstance().writeValueAsString(resultAttachmentList));
}
model.addAttribute("reviewWork", reviewWork);
model.addAttribute("type", type);
return "modules/rddb/review_work/form.html";
}
@PostMapping("save")
@ResponseBody
public void save(@Validated ReviewWorkBo reviewWorkBo) {
render(reviewWorkService.adminSaveOrUpdate(reviewWorkBo, getLoginUser()));
}
@PostMapping("/delete")
public void delete(String id) {
boolean flag = reviewWorkService.del(id);
renderJson(!flag ? Ret.fail("操作失败") : Ret.ok());
}
}

View File

@ -0,0 +1,74 @@
package com.ydool.boot.modules.rddb.web;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ydool.boot.api.util.CodecUtils;
import com.ydool.boot.common.result.Ret;
import com.ydool.boot.common.utils.WebUtils;
import com.ydool.boot.modules.rddb.entity.ReviewWorkUser;
import com.ydool.boot.modules.rddb.service.ReviewWorkUserService;
import com.ydool.boot.modules.rddb.wrapper.UserDtoWrapper;
import com.ydool.boot.modules.sys.entity.User;
import com.ydool.boot.modules.sys.service.UserService;
import com.ydool.boot.modules.sys.web.BaseAdminController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
/**
* <p>
* 评议人员 前端控制器
* </p>
*
* @author zhouyuan
* @since 2022-05-12
*/
@Controller
@RequestMapping("${ydool.path}/rddb/review_work_user")
public class ReviewWorkUserController extends BaseAdminController {
@Autowired
private ReviewWorkUserService reviewWorkUserService;
@Autowired
private UserService userService;
@RequestMapping("list")
@ResponseBody
public void list(String id) {
QueryWrapper<ReviewWorkUser> wrapper = new QueryWrapper<>();
wrapper.eq("review_id", id);
wrapper.orderByDesc("created_at");
Page page = reviewWorkUserService.page(new Page(getPageNum(), getPageSize()), wrapper);
render(Ret.ok().paged(page));
}
@GetMapping("to_assign")
public String toAssign(Model model) {
model.addAllAttributes(WebUtils.getParameters(request));
return "modules/rddb/assign.html";
}
/**
* 选择user列表过滤已选中人员
*
* @param userIds
*/
@RequestMapping("assign_list")
@ResponseBody
public void assignList(String userIds, String userName, String loginName) {
QueryWrapper<User> userQueryWrapper = new QueryWrapper<>();
userQueryWrapper.notIn("id", userIds.split(","));
if (StrUtil.isNotBlank(userName)) userQueryWrapper.like("user_name", userName);
//县级工作人员
userQueryWrapper.eq("account_type", "admin");
userQueryWrapper.like(StrUtil.isNotBlank(loginName), "AES_DECRYPT(from_base64 (login_name),'" + CodecUtils.KEY + "')", loginName);
Page page = userService.page(new Page(getPageNum(), getPageSize()), userQueryWrapper);
render(Ret.ok().paged(UserDtoWrapper.build().pageVO(page)));
}
}

View File

@ -0,0 +1,148 @@
package com.ydool.boot.modules.rddb.wrapper;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollectionUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.ydool.boot.api.util.TokenUtil;
import com.ydool.boot.api.util.UserInfo;
import com.ydool.boot.common.utils.SpringUtils;
import com.ydool.boot.core.wrapper.BaseWrapper;
import com.ydool.boot.modules.rddb.entity.ReviewOfficer;
import com.ydool.boot.modules.rddb.entity.ReviewOfficerAttachment;
import com.ydool.boot.modules.rddb.entity.ReviewOfficerAudit;
import com.ydool.boot.modules.rddb.entity.ReviewOfficerUser;
import com.ydool.boot.modules.rddb.entity.dto.ReviewOfficerDto;
import com.ydool.boot.modules.rddb.service.ReviewOfficerAttachmentService;
import com.ydool.boot.modules.rddb.service.ReviewOfficerAuditService;
import com.ydool.boot.modules.rddb.service.ReviewOfficerUserService;
import org.springframework.jdbc.core.JdbcTemplate;
import java.math.BigDecimal;
import java.util.List;
import java.util.stream.Collectors;
/**
* @author zhouyuan
* @date 2022年05月16日
*/
public class ReviewOfficerWrapper extends BaseWrapper<ReviewOfficer, ReviewOfficerDto> {
public static ReviewOfficerWrapper build() {
return new ReviewOfficerWrapper();
}
@Override
public ReviewOfficerDto entityVO(ReviewOfficer reviewOfficer) {
ReviewOfficerDto ReviewOfficerDto = BeanUtil.copyProperties(reviewOfficer, ReviewOfficerDto.class);
ReviewOfficerAttachmentService reviewOfficerAttachmentService = SpringUtils.getBean(ReviewOfficerAttachmentService.class);
ReviewOfficerUserService reviewOfficerUserService = SpringUtils.getBean(ReviewOfficerUserService.class);
ReviewOfficerAuditService reviewOfficerAuditService = SpringUtils.getBean(ReviewOfficerAuditService.class);
JdbcTemplate jdbcTemplate = SpringUtils.getBean(JdbcTemplate.class);
List<ReviewOfficerAttachment> inReportAttachmentList = reviewOfficerAttachmentService.list(new LambdaQueryWrapper<ReviewOfficerAttachment>()
.eq(ReviewOfficerAttachment::getReviewId, reviewOfficer.getId())
.eq(ReviewOfficerAttachment::getType, ReviewOfficer.STATE_IN_REPORT)
.orderByDesc(ReviewOfficerAttachment::getCreatedAt));
List<ReviewOfficerAttachment> checkAttachmentList = reviewOfficerAttachmentService.list(new LambdaQueryWrapper<ReviewOfficerAttachment>()
.eq(ReviewOfficerAttachment::getReviewId, reviewOfficer.getId())
.eq(ReviewOfficerAttachment::getType, ReviewOfficer.STATE_CHECK)
.orderByDesc(ReviewOfficerAttachment::getCreatedAt));
List<ReviewOfficerAttachment> opinionAttachmentList = reviewOfficerAttachmentService.list(new LambdaQueryWrapper<ReviewOfficerAttachment>()
.eq(ReviewOfficerAttachment::getReviewId, reviewOfficer.getId())
.eq(ReviewOfficerAttachment::getType, ReviewOfficer.STATE_OPINION)
.orderByDesc(ReviewOfficerAttachment::getCreatedAt));
List<ReviewOfficerAttachment> resultAttachmentList = reviewOfficerAttachmentService.list(new LambdaQueryWrapper<ReviewOfficerAttachment>()
.eq(ReviewOfficerAttachment::getReviewId, reviewOfficer.getId())
.eq(ReviewOfficerAttachment::getType, ReviewOfficer.STATE_RESULT)
.orderByDesc(ReviewOfficerAttachment::getCreatedAt));
List<ReviewOfficerAudit> inReportAudit1List = reviewOfficerAuditService.list(new LambdaQueryWrapper<ReviewOfficerAudit>()
.eq(ReviewOfficerAudit::getReviewId, reviewOfficer.getId())
.eq(ReviewOfficerAudit::getLevel, 1)
.orderByDesc(ReviewOfficerAudit::getCreatedAt));
List<ReviewOfficerAudit> inReportAudit2List = reviewOfficerAuditService.list(new LambdaQueryWrapper<ReviewOfficerAudit>()
.eq(ReviewOfficerAudit::getReviewId, reviewOfficer.getId())
.eq(ReviewOfficerAudit::getLevel, 2)
.orderByDesc(ReviewOfficerAudit::getCreatedAt));
List<ReviewOfficerUser> checkUserList = reviewOfficerUserService.list(new LambdaQueryWrapper<ReviewOfficerUser>()
.eq(ReviewOfficerUser::getReviewId, reviewOfficer.getId())
.orderByDesc(ReviewOfficerUser::getCreatedAt));
ReviewOfficerDto.setInReportAttachmentList(inReportAttachmentList);
ReviewOfficerDto.setCheckAttachmentList(checkAttachmentList);
ReviewOfficerDto.setOpinionAttachmentList(opinionAttachmentList);
ReviewOfficerDto.setResultAttachmentList(resultAttachmentList);
ReviewOfficerDto.setInReportAudit1List(inReportAudit1List);
ReviewOfficerDto.setInReportAudit2List(inReportAudit2List);
ReviewOfficerDto.setCheckUserList(checkUserList);
//打分结束算平均分
if (ReviewOfficer.STATE_CHECK < reviewOfficer.getState()) {
//没打分的不算
List<ReviewOfficerUser> scoredReviewUserList = checkUserList.stream().filter(item -> item.getScore() != null).collect(Collectors.toList());
if (CollectionUtil.isNotEmpty(scoredReviewUserList)) {
BigDecimal averageScore = scoredReviewUserList.stream().map(item -> item.getScore())
.reduce(BigDecimal.ZERO, BigDecimal::add)
.divide(new BigDecimal(scoredReviewUserList.size()), BigDecimal.ROUND_HALF_UP);
ReviewOfficerDto.setAverageScore(averageScore);
} else {
ReviewOfficerDto.setAverageScore(new BigDecimal("0"));
}
}
UserInfo userInfo = TokenUtil.getUserInfo();
//当期用户是否是创建人 (创建人可操作 打分结束的按钮)
//当期用户是否可投票
//当期用户是否可打分
//是否待我审批
ReviewOfficerDto.setIsCreator(false);
ReviewOfficerDto.setIsCanCheck(false);
ReviewOfficerDto.setIsCanAudit1(false);
ReviewOfficerDto.setIsCanAudit2(false);
if (userInfo != null) {
if (userInfo.getId().equals(reviewOfficer.getCreatedId())) ReviewOfficerDto.setIsCreator(true);
ReviewOfficerAudit myReviewAudit1 = reviewOfficerAuditService.getOne(new LambdaQueryWrapper<ReviewOfficerAudit>()
.eq(ReviewOfficerAudit::getReviewId, reviewOfficer.getId())
.eq(ReviewOfficerAudit::getLevel, 1)
.eq(ReviewOfficerAudit::getUserId, userInfo.getId()));
ReviewOfficerAudit myReviewAudit2 = reviewOfficerAuditService.getOne(new LambdaQueryWrapper<ReviewOfficerAudit>()
.eq(ReviewOfficerAudit::getReviewId, reviewOfficer.getId())
.eq(ReviewOfficerAudit::getLevel, 2)
.eq(ReviewOfficerAudit::getUserId, userInfo.getId()));
if (myReviewAudit1 != null) {
//是否轮到我审批
int beforeWaitCount1 = reviewOfficerAuditService.count(new LambdaQueryWrapper<ReviewOfficerAudit>()
.eq(ReviewOfficerAudit::getReviewId, myReviewAudit1.getReviewId())
.lt(ReviewOfficerAudit::getSortNo, myReviewAudit1.getSortNo())
.eq(ReviewOfficerAudit::getStatus, 0)
.eq(ReviewOfficerAudit::getLevel, 1)
);
if (beforeWaitCount1 == 0 && myReviewAudit1.getStatus() == 0) ReviewOfficerDto.setIsCanAudit1(true);
}
if (myReviewAudit2 != null) {
int beforeWaitCount2 = reviewOfficerAuditService.count(new LambdaQueryWrapper<ReviewOfficerAudit>()
.eq(ReviewOfficerAudit::getReviewId, myReviewAudit2.getReviewId())
.lt(ReviewOfficerAudit::getSortNo, myReviewAudit2.getSortNo())
.eq(ReviewOfficerAudit::getStatus, 0)
.eq(ReviewOfficerAudit::getLevel, 2)
);
if (beforeWaitCount2 == 0 && myReviewAudit2.getStatus() == 0 && !ReviewOfficerDto.getIsCanAudit1())
ReviewOfficerDto.setIsCanAudit2(true);
}
//我是否可以打分(打过分后也不可以再打)
ReviewOfficerUser checkUser = reviewOfficerUserService.getOne(new LambdaQueryWrapper<ReviewOfficerUser>()
.eq(ReviewOfficerUser::getReviewId, reviewOfficer.getId())
.eq(ReviewOfficerUser::getUserId, userInfo.getId())
.isNull(ReviewOfficerUser::getScore)
);
if (checkUser != null) ReviewOfficerDto.setIsCanCheck(true);
}
return ReviewOfficerDto;
}
}

View File

@ -0,0 +1,146 @@
package com.ydool.boot.modules.rddb.wrapper;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollectionUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.ydool.boot.api.util.TokenUtil;
import com.ydool.boot.api.util.UserInfo;
import com.ydool.boot.common.utils.SpringUtils;
import com.ydool.boot.core.wrapper.BaseWrapper;
import com.ydool.boot.modules.rddb.entity.ReviewSubject;
import com.ydool.boot.modules.rddb.entity.ReviewSubjectAttachment;
import com.ydool.boot.modules.rddb.entity.ReviewSubjectAudit;
import com.ydool.boot.modules.rddb.entity.ReviewSubjectUser;
import com.ydool.boot.modules.rddb.entity.dto.ReviewSubjectDto;
import com.ydool.boot.modules.rddb.service.ReviewSubjectAttachmentService;
import com.ydool.boot.modules.rddb.service.ReviewSubjectAuditService;
import com.ydool.boot.modules.rddb.service.ReviewSubjectUserService;
import java.math.BigDecimal;
import java.util.List;
import java.util.stream.Collectors;
/**
* @author zhouyuan
* @date 2022年05月16日
*/
public class ReviewSubjectWrapper extends BaseWrapper<ReviewSubject, ReviewSubjectDto> {
public static ReviewSubjectWrapper build() {
return new ReviewSubjectWrapper();
}
@Override
public ReviewSubjectDto entityVO(ReviewSubject reviewSubject) {
ReviewSubjectDto ReviewSubjectDto = BeanUtil.copyProperties(reviewSubject, ReviewSubjectDto.class);
ReviewSubjectAttachmentService reviewSubjectAttachmentService = SpringUtils.getBean(ReviewSubjectAttachmentService.class);
ReviewSubjectUserService reviewSubjectUserService = SpringUtils.getBean(ReviewSubjectUserService.class);
ReviewSubjectAuditService reviewSubjectAuditService = SpringUtils.getBean(ReviewSubjectAuditService.class);
List<ReviewSubjectAttachment> inReportAttachmentList = reviewSubjectAttachmentService.list(new LambdaQueryWrapper<ReviewSubjectAttachment>()
.eq(ReviewSubjectAttachment::getReviewId, reviewSubject.getId())
.eq(ReviewSubjectAttachment::getType, ReviewSubject.STATE_IN_REPORT)
.orderByDesc(ReviewSubjectAttachment::getCreatedAt));
List<ReviewSubjectAttachment> checkAttachmentList = reviewSubjectAttachmentService.list(new LambdaQueryWrapper<ReviewSubjectAttachment>()
.eq(ReviewSubjectAttachment::getReviewId, reviewSubject.getId())
.eq(ReviewSubjectAttachment::getType, ReviewSubject.STATE_CHECK)
.orderByDesc(ReviewSubjectAttachment::getCreatedAt));
List<ReviewSubjectAttachment> opinionAttachmentList = reviewSubjectAttachmentService.list(new LambdaQueryWrapper<ReviewSubjectAttachment>()
.eq(ReviewSubjectAttachment::getReviewId, reviewSubject.getId())
.eq(ReviewSubjectAttachment::getType, ReviewSubject.STATE_OPINION)
.orderByDesc(ReviewSubjectAttachment::getCreatedAt));
List<ReviewSubjectAttachment> resultAttachmentList = reviewSubjectAttachmentService.list(new LambdaQueryWrapper<ReviewSubjectAttachment>()
.eq(ReviewSubjectAttachment::getReviewId, reviewSubject.getId())
.eq(ReviewSubjectAttachment::getType, ReviewSubject.STATE_RESULT)
.orderByDesc(ReviewSubjectAttachment::getCreatedAt));
List<ReviewSubjectAudit> inReportAudit1List = reviewSubjectAuditService.list(new LambdaQueryWrapper<ReviewSubjectAudit>()
.eq(ReviewSubjectAudit::getReviewId, reviewSubject.getId())
.eq(ReviewSubjectAudit::getLevel, 1)
.orderByDesc(ReviewSubjectAudit::getCreatedAt));
List<ReviewSubjectAudit> inReportAudit2List = reviewSubjectAuditService.list(new LambdaQueryWrapper<ReviewSubjectAudit>()
.eq(ReviewSubjectAudit::getReviewId, reviewSubject.getId())
.eq(ReviewSubjectAudit::getLevel, 2)
.orderByDesc(ReviewSubjectAudit::getCreatedAt));
List<ReviewSubjectUser> checkUserList = reviewSubjectUserService.list(new LambdaQueryWrapper<ReviewSubjectUser>()
.eq(ReviewSubjectUser::getReviewId, reviewSubject.getId())
.orderByDesc(ReviewSubjectUser::getCreatedAt));
ReviewSubjectDto.setInReportAttachmentList(inReportAttachmentList);
ReviewSubjectDto.setCheckAttachmentList(checkAttachmentList);
ReviewSubjectDto.setOpinionAttachmentList(opinionAttachmentList);
ReviewSubjectDto.setResultAttachmentList(resultAttachmentList);
ReviewSubjectDto.setInReportAudit1List(inReportAudit1List);
ReviewSubjectDto.setInReportAudit2List(inReportAudit2List);
ReviewSubjectDto.setCheckUserList(checkUserList);
//打分结束算平均分
if (ReviewSubject.STATE_CHECK < reviewSubject.getState()) {
//没打分的不算
List<ReviewSubjectUser> scoredReviewUserList = checkUserList.stream().filter(item -> item.getScore() != null).collect(Collectors.toList());
if(CollectionUtil.isNotEmpty(scoredReviewUserList)){
BigDecimal averageScore = scoredReviewUserList.stream().map(item -> item.getScore())
.reduce(BigDecimal.ZERO, BigDecimal::add)
.divide(new BigDecimal(scoredReviewUserList.size()), BigDecimal.ROUND_HALF_UP);
ReviewSubjectDto.setAverageScore(averageScore);
}else{
ReviewSubjectDto.setAverageScore(new BigDecimal("0"));
}
}
UserInfo userInfo = TokenUtil.getUserInfo();
//当期用户是否是创建人 (创建人可操作 打分结束的按钮)
//当期用户是否可投票
//当期用户是否可打分
//是否待我审批
ReviewSubjectDto.setIsCreator(false);
ReviewSubjectDto.setIsCanCheck(false);
ReviewSubjectDto.setIsCanAudit1(false);
ReviewSubjectDto.setIsCanAudit2(false);
if (userInfo != null) {
if (userInfo.getId().equals(reviewSubject.getCreatedId())) ReviewSubjectDto.setIsCreator(true);
ReviewSubjectAudit myReviewAudit1 = reviewSubjectAuditService.getOne(new LambdaQueryWrapper<ReviewSubjectAudit>()
.eq(ReviewSubjectAudit::getReviewId, reviewSubject.getId())
.eq(ReviewSubjectAudit::getLevel, 1)
.eq(ReviewSubjectAudit::getUserId, userInfo.getId()));
ReviewSubjectAudit myReviewAudit2 = reviewSubjectAuditService.getOne(new LambdaQueryWrapper<ReviewSubjectAudit>()
.eq(ReviewSubjectAudit::getReviewId, reviewSubject.getId())
.eq(ReviewSubjectAudit::getLevel, 2)
.eq(ReviewSubjectAudit::getUserId, userInfo.getId()));
if (myReviewAudit1 != null) {
//是否轮到我审批
int beforeWaitCount1 = reviewSubjectAuditService.count(new LambdaQueryWrapper<ReviewSubjectAudit>()
.eq(ReviewSubjectAudit::getReviewId, myReviewAudit1.getReviewId())
.lt(ReviewSubjectAudit::getSortNo, myReviewAudit1.getSortNo())
.eq(ReviewSubjectAudit::getStatus, 0)
.eq(ReviewSubjectAudit::getLevel, 1)
);
if (beforeWaitCount1 == 0 && myReviewAudit1.getStatus() == 0) ReviewSubjectDto.setIsCanAudit1(true);
}
if (myReviewAudit2 != null) {
int beforeWaitCount2 = reviewSubjectAuditService.count(new LambdaQueryWrapper<ReviewSubjectAudit>()
.eq(ReviewSubjectAudit::getReviewId, myReviewAudit2.getReviewId())
.lt(ReviewSubjectAudit::getSortNo, myReviewAudit2.getSortNo())
.eq(ReviewSubjectAudit::getStatus, 0)
.eq(ReviewSubjectAudit::getLevel, 2)
);
if (beforeWaitCount2 == 0 && myReviewAudit2.getStatus() == 0 && !ReviewSubjectDto.getIsCanAudit1())
ReviewSubjectDto.setIsCanAudit2(true);
}
//我是否可以打分(打过分后也不可以再打)
ReviewSubjectUser checkUser = reviewSubjectUserService.getOne(new LambdaQueryWrapper<ReviewSubjectUser>()
.eq(ReviewSubjectUser::getReviewId, reviewSubject.getId())
.eq(ReviewSubjectUser::getUserId, userInfo.getId())
.isNull(ReviewSubjectUser::getScore)
);
if (checkUser != null) ReviewSubjectDto.setIsCanCheck(true);
}
return ReviewSubjectDto;
}
}

View File

@ -0,0 +1,148 @@
package com.ydool.boot.modules.rddb.wrapper;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollectionUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.ydool.boot.api.util.TokenUtil;
import com.ydool.boot.api.util.UserInfo;
import com.ydool.boot.common.utils.SpringUtils;
import com.ydool.boot.core.wrapper.BaseWrapper;
import com.ydool.boot.modules.rddb.entity.ReviewWork;
import com.ydool.boot.modules.rddb.entity.ReviewWorkAttachment;
import com.ydool.boot.modules.rddb.entity.ReviewWorkAudit;
import com.ydool.boot.modules.rddb.entity.ReviewWorkUser;
import com.ydool.boot.modules.rddb.entity.dto.ReviewWorkDto;
import com.ydool.boot.modules.rddb.service.ReviewWorkAttachmentService;
import com.ydool.boot.modules.rddb.service.ReviewWorkAuditService;
import com.ydool.boot.modules.rddb.service.ReviewWorkUserService;
import org.springframework.jdbc.core.JdbcTemplate;
import java.math.BigDecimal;
import java.util.List;
import java.util.stream.Collectors;
/**
* @author zhouyuan
* @date 2022年05月16日
*/
public class ReviewWorkWrapper extends BaseWrapper<ReviewWork, ReviewWorkDto> {
public static ReviewWorkWrapper build() {
return new ReviewWorkWrapper();
}
@Override
public ReviewWorkDto entityVO(ReviewWork reviewWork) {
ReviewWorkDto ReviewWorkDto = BeanUtil.copyProperties(reviewWork, ReviewWorkDto.class);
ReviewWorkAttachmentService reviewWorkAttachmentService = SpringUtils.getBean(ReviewWorkAttachmentService.class);
ReviewWorkUserService reviewWorkUserService = SpringUtils.getBean(ReviewWorkUserService.class);
ReviewWorkAuditService reviewWorkAuditService = SpringUtils.getBean(ReviewWorkAuditService.class);
JdbcTemplate jdbcTemplate = SpringUtils.getBean(JdbcTemplate.class);
List<ReviewWorkAttachment> inReportAttachmentList = reviewWorkAttachmentService.list(new LambdaQueryWrapper<ReviewWorkAttachment>()
.eq(ReviewWorkAttachment::getReviewId, reviewWork.getId())
.eq(ReviewWorkAttachment::getType, ReviewWork.STATE_IN_REPORT)
.orderByDesc(ReviewWorkAttachment::getCreatedAt));
List<ReviewWorkAttachment> checkAttachmentList = reviewWorkAttachmentService.list(new LambdaQueryWrapper<ReviewWorkAttachment>()
.eq(ReviewWorkAttachment::getReviewId, reviewWork.getId())
.eq(ReviewWorkAttachment::getType, ReviewWork.STATE_CHECK)
.orderByDesc(ReviewWorkAttachment::getCreatedAt));
List<ReviewWorkAttachment> opinionAttachmentList = reviewWorkAttachmentService.list(new LambdaQueryWrapper<ReviewWorkAttachment>()
.eq(ReviewWorkAttachment::getReviewId, reviewWork.getId())
.eq(ReviewWorkAttachment::getType, ReviewWork.STATE_OPINION)
.orderByDesc(ReviewWorkAttachment::getCreatedAt));
List<ReviewWorkAttachment> resultAttachmentList = reviewWorkAttachmentService.list(new LambdaQueryWrapper<ReviewWorkAttachment>()
.eq(ReviewWorkAttachment::getReviewId, reviewWork.getId())
.eq(ReviewWorkAttachment::getType, ReviewWork.STATE_RESULT)
.orderByDesc(ReviewWorkAttachment::getCreatedAt));
List<ReviewWorkAudit> inReportAudit1List = reviewWorkAuditService.list(new LambdaQueryWrapper<ReviewWorkAudit>()
.eq(ReviewWorkAudit::getReviewId, reviewWork.getId())
.eq(ReviewWorkAudit::getLevel, 1)
.orderByDesc(ReviewWorkAudit::getCreatedAt));
List<ReviewWorkAudit> inReportAudit2List = reviewWorkAuditService.list(new LambdaQueryWrapper<ReviewWorkAudit>()
.eq(ReviewWorkAudit::getReviewId, reviewWork.getId())
.eq(ReviewWorkAudit::getLevel, 2)
.orderByDesc(ReviewWorkAudit::getCreatedAt));
List<ReviewWorkUser> checkUserList = reviewWorkUserService.list(new LambdaQueryWrapper<ReviewWorkUser>()
.eq(ReviewWorkUser::getReviewId, reviewWork.getId())
.orderByDesc(ReviewWorkUser::getCreatedAt));
ReviewWorkDto.setInReportAttachmentList(inReportAttachmentList);
ReviewWorkDto.setCheckAttachmentList(checkAttachmentList);
ReviewWorkDto.setOpinionAttachmentList(opinionAttachmentList);
ReviewWorkDto.setResultAttachmentList(resultAttachmentList);
ReviewWorkDto.setInReportAudit1List(inReportAudit1List);
ReviewWorkDto.setInReportAudit2List(inReportAudit2List);
ReviewWorkDto.setCheckUserList(checkUserList);
//打分结束算平均分
if (ReviewWork.STATE_CHECK < reviewWork.getState()) {
//没打分的不算
List<ReviewWorkUser> scoredReviewUserList = checkUserList.stream().filter(item -> item.getScore() != null).collect(Collectors.toList());
if(CollectionUtil.isNotEmpty(scoredReviewUserList)){
BigDecimal averageScore = scoredReviewUserList.stream().map(item -> item.getScore())
.reduce(BigDecimal.ZERO, BigDecimal::add)
.divide(new BigDecimal(scoredReviewUserList.size()), BigDecimal.ROUND_HALF_UP);
ReviewWorkDto.setAverageScore(averageScore);
}else{
ReviewWorkDto.setAverageScore(new BigDecimal("0"));
}
}
UserInfo userInfo = TokenUtil.getUserInfo();
//当期用户是否是创建人 (创建人可操作 打分结束的按钮)
//当期用户是否可投票
//当期用户是否可打分
//是否待我审批
ReviewWorkDto.setIsCreator(false);
ReviewWorkDto.setIsCanCheck(false);
ReviewWorkDto.setIsCanAudit1(false);
ReviewWorkDto.setIsCanAudit2(false);
if (userInfo != null) {
if (userInfo.getId().equals(reviewWork.getCreatedId())) ReviewWorkDto.setIsCreator(true);
ReviewWorkAudit myReviewAudit1 = reviewWorkAuditService.getOne(new LambdaQueryWrapper<ReviewWorkAudit>()
.eq(ReviewWorkAudit::getReviewId, reviewWork.getId())
.eq(ReviewWorkAudit::getLevel, 1)
.eq(ReviewWorkAudit::getUserId, userInfo.getId()));
ReviewWorkAudit myReviewAudit2 = reviewWorkAuditService.getOne(new LambdaQueryWrapper<ReviewWorkAudit>()
.eq(ReviewWorkAudit::getReviewId, reviewWork.getId())
.eq(ReviewWorkAudit::getLevel, 2)
.eq(ReviewWorkAudit::getUserId, userInfo.getId()));
if (myReviewAudit1 != null) {
//是否轮到我审批
int beforeWaitCount1 = reviewWorkAuditService.count(new LambdaQueryWrapper<ReviewWorkAudit>()
.eq(ReviewWorkAudit::getReviewId, myReviewAudit1.getReviewId())
.lt(ReviewWorkAudit::getSortNo, myReviewAudit1.getSortNo())
.eq(ReviewWorkAudit::getStatus, 0)
.eq(ReviewWorkAudit::getLevel, 1)
);
if (beforeWaitCount1 == 0 && myReviewAudit1.getStatus() == 0) ReviewWorkDto.setIsCanAudit1(true);
}
if (myReviewAudit2 != null) {
int beforeWaitCount2 = reviewWorkAuditService.count(new LambdaQueryWrapper<ReviewWorkAudit>()
.eq(ReviewWorkAudit::getReviewId, myReviewAudit2.getReviewId())
.lt(ReviewWorkAudit::getSortNo, myReviewAudit2.getSortNo())
.eq(ReviewWorkAudit::getStatus, 0)
.eq(ReviewWorkAudit::getLevel, 2)
);
if (beforeWaitCount2 == 0 && myReviewAudit2.getStatus() == 0 && !ReviewWorkDto.getIsCanAudit1())
ReviewWorkDto.setIsCanAudit2(true);
}
//我是否可以打分(打过分后也不可以再打)
ReviewWorkUser checkUser = reviewWorkUserService.getOne(new LambdaQueryWrapper<ReviewWorkUser>()
.eq(ReviewWorkUser::getReviewId, reviewWork.getId())
.eq(ReviewWorkUser::getUserId, userInfo.getId())
.isNull(ReviewWorkUser::getScore)
);
if (checkUser != null) ReviewWorkDto.setIsCanCheck(true);
}
return ReviewWorkDto;
}
}

View File

@ -105,11 +105,6 @@ public class ReviewWrapper extends BaseWrapper<Review, ReviewDto> {
if (userInfo != null) {
if (userInfo.getId().equals(review.getCreatedId())) reviewDto.setIsCreator(true);
// List<String> checkedAudit1List = inReportAudit1List.stream().map(ReviewAudit::getUserId).collect(Collectors.toList());
// if (checkedAudit1List.contains(userInfo.getId())) reviewDto.setIsCanAudit1(true);
// List<String> checkedAudit2List = inReportAudit2List.stream().map(ReviewAudit::getUserId).collect(Collectors.toList());
// if (checkedAudit2List.contains(userInfo.getId())) reviewDto.setIsCanAudit2(true);
ReviewAudit myReviewAudit1 = reviewAuditService.getOne(new LambdaQueryWrapper<ReviewAudit>()
.eq(ReviewAudit::getReviewId, review.getId())
.eq(ReviewAudit::getLevel, 1)

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
.van-pagination[data-v-02e319eb]{position:fixed;bottom:0;width:100%;z-index:999;background:#fff}.van-tag[data-v-02e319eb]{margin-right:.42667rem}.box[data-v-02e319eb]{display:flex;flex-direction:column;height:100%;font-size:.42667rem}.box .add[data-v-02e319eb]{width:2.13333rem;height:2.13333rem;position:fixed;right:.32rem;bottom:20%}.box[data-v-02e319eb] .van-tab.van-tab--active{font-size:.42667rem;font-weight:800}.box .tab-contain[data-v-02e319eb]{padding:.32rem}.box .tab-contain .van-cell[data-v-02e319eb]{margin-bottom:.37333rem}.box .tab-contain .van-cell .custom-title[data-v-02e319eb]{font-size:.42667rem}.box .tab-contain .van-cell .van-icon[data-v-02e319eb]{color:#333}

View File

@ -1 +0,0 @@
.van-pagination[data-v-02d498a0]{position:fixed;bottom:0;width:100%;z-index:999;background:#fff}.van-tag[data-v-02d498a0]{margin-right:.42667rem}.box[data-v-02d498a0]{display:flex;flex-direction:column;height:100%;font-size:.42667rem}.box .add[data-v-02d498a0]{width:2.13333rem;height:2.13333rem;position:fixed;right:.32rem;bottom:20%}.box[data-v-02d498a0] .van-tab.van-tab--active{font-size:.42667rem;font-weight:800}.box .tab-contain[data-v-02d498a0]{padding:.32rem}.box .tab-contain .van-cell[data-v-02d498a0]{margin-bottom:.37333rem}.box .tab-contain .van-cell .custom-title[data-v-02d498a0]{font-size:.42667rem}.box .tab-contain .van-cell .van-icon[data-v-02d498a0]{color:#333}

File diff suppressed because one or more lines are too long

Some files were not shown because too many files have changed in this diff Show More