三审相关代码
This commit is contained in:
parent
0330592c7c
commit
0df4a277dd
|
|
@ -123,7 +123,7 @@ public class NewsController {
|
||||||
return ResultObject.failed("该资讯正在审核中,请勿重复操作!");
|
return ResultObject.failed("该资讯正在审核中,请勿重复操作!");
|
||||||
}
|
}
|
||||||
log.info("path: /news/revoke, method: POST, request user id: {}, news id: {}", adminUserId, id);
|
log.info("path: /news/revoke, method: POST, request user id: {}, news id: {}", adminUserId, id);
|
||||||
return newsService.revoke(id, adminUserId, adminUser.isReviewer());
|
return newsService.revoke(id, adminUserId, adminUser.isReviewer(), adminUser.isSecondReviewer());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("解析登陆Token出错!", e);
|
log.error("解析登陆Token出错!", e);
|
||||||
return ResultObject.failed(500, "服务端错误,请联系系统管理员!");
|
return ResultObject.failed(500, "服务端错误,请联系系统管理员!");
|
||||||
|
|
@ -152,6 +152,9 @@ public class NewsController {
|
||||||
log.warn("当前用户已被封禁! id = {}", adminUserId);
|
log.warn("当前用户已被封禁! id = {}", adminUserId);
|
||||||
return ResultObject.failed("当前用户已被封禁!请联系系统管理员!");
|
return ResultObject.failed("当前用户已被封禁!请联系系统管理员!");
|
||||||
}
|
}
|
||||||
|
if (!adminUser.isReviewer()) {
|
||||||
|
return ResultObject.failed("无此权限,非法操作!");
|
||||||
|
}
|
||||||
|
|
||||||
Long id = publishNewsDTO.getId();
|
Long id = publishNewsDTO.getId();
|
||||||
if (id == null) {
|
if (id == null) {
|
||||||
|
|
@ -280,6 +283,7 @@ public class NewsController {
|
||||||
log.warn("当前用户已被封禁! id = {}", adminUserId);
|
log.warn("当前用户已被封禁! id = {}", adminUserId);
|
||||||
return ResultObject.failed("当前用户已被封禁!请联系系统管理员!");
|
return ResultObject.failed("当前用户已被封禁!请联系系统管理员!");
|
||||||
}
|
}
|
||||||
|
|
||||||
log.info("path: /news/create/publish, method: POST, request user id: {}, param: {}",
|
log.info("path: /news/create/publish, method: POST, request user id: {}, param: {}",
|
||||||
adminUserId, objectMapper.writeValueAsString(saveNewsDTO));
|
adminUserId, objectMapper.writeValueAsString(saveNewsDTO));
|
||||||
boolean isSuccessed = setEditingFlag(saveNewsDTO.getId());
|
boolean isSuccessed = setEditingFlag(saveNewsDTO.getId());
|
||||||
|
|
@ -366,13 +370,19 @@ public class NewsController {
|
||||||
adminUser.getId(), keyword, columnList, status, page, size, last, current, orderBy, tag, industry);
|
adminUser.getId(), keyword, columnList, status, page, size, last, current, orderBy, tag, industry);
|
||||||
|
|
||||||
boolean isReviewRange = false;
|
boolean isReviewRange = false;
|
||||||
|
boolean isSecondReviewRange = false;
|
||||||
if ("review".equals(range)) {
|
if ("review".equals(range)) {
|
||||||
if (!adminUser.isReviewer()) {
|
if (!adminUser.isReviewer()) {
|
||||||
return PageObject.failedPage(500, "非审核员用户查看范围权限!");
|
return PageObject.failedPage(500, "非审核员用户查看范围权限!");
|
||||||
}
|
}
|
||||||
isReviewRange = true;
|
isReviewRange = true;
|
||||||
|
} else if ("secondReview".equals(range)) {
|
||||||
|
if (!adminUser.isSecondReviewer()) {
|
||||||
|
return PageObject.failedPage(500, "非二审用户无查看此范围权限!");
|
||||||
|
}
|
||||||
|
isSecondReviewRange = true;
|
||||||
}
|
}
|
||||||
return newsService.queryNews(keyword, columnList, status, page, size, last, current, orderBy, minScore, maxScore, tag, industry, mediaId, datelineFrom, datelineTo, deleted, rating, isReviewRange);
|
return newsService.queryNews(keyword, columnList, status, page, size, last, current, orderBy, minScore, maxScore, tag, industry, mediaId, datelineFrom, datelineTo, deleted, rating, isReviewRange, isSecondReviewRange);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("解析登陆Token出错!", e);
|
log.error("解析登陆Token出错!", e);
|
||||||
return PageObject.failedPage(500, "服务端错误,请联系系统管理员!");
|
return PageObject.failedPage(500, "服务端错误,请联系系统管理员!");
|
||||||
|
|
@ -466,6 +476,91 @@ public class NewsController {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("/check")
|
||||||
|
@OperationInfo(behavior = "复审", type = "news")
|
||||||
|
public ResultObject<Void> check(@RequestHeader("auth-token") String token,
|
||||||
|
@RequestBody PublishNewsDTO publishNewsDTO) {
|
||||||
|
if (!StringUtils.hasText(token)) {
|
||||||
|
return ResultObject.failed("登陆Token为空!");
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
AdminUser adminUser = AdminJwtService.parseToken(token);
|
||||||
|
if (adminUser == null) {
|
||||||
|
log.warn("解析token {}拿不到AdminUser对象!", token);
|
||||||
|
return ResultObject.failed("登陆Token有误,请联系系统管理员!");
|
||||||
|
}
|
||||||
|
|
||||||
|
Long adminUserId = adminUser.getId();
|
||||||
|
if (!adminUser.isActive()) {
|
||||||
|
log.warn("当前用户已被封禁! id = {}", adminUserId);
|
||||||
|
return ResultObject.failed("当前用户已被封禁!请联系系统管理员!");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!adminUser.isSecondReviewer()) {
|
||||||
|
return ResultObject.failed("无相关权限,非法操作!");
|
||||||
|
}
|
||||||
|
|
||||||
|
Long id = publishNewsDTO.getId();
|
||||||
|
if (id == null) {
|
||||||
|
return ResultObject.failed("要复审的新闻ID不可为空!");
|
||||||
|
}
|
||||||
|
boolean isSuccessed = setEditingFlag(id);
|
||||||
|
if (!isSuccessed) {
|
||||||
|
return ResultObject.failed("该资讯正在复审中,请勿重复操作!");
|
||||||
|
}
|
||||||
|
log.info("path: /news/check, method: POST, request user id: {}, news id: {}", adminUserId, id);
|
||||||
|
return newsService.check(id, adminUserId);
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("解析登陆Token出错!", e);
|
||||||
|
return ResultObject.failed(500, "服务端错误,请联系系统管理员!");
|
||||||
|
} finally {
|
||||||
|
unsetEditingFlag(publishNewsDTO.getId());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/return")
|
||||||
|
@OperationInfo(behavior = "退改", type = "news")
|
||||||
|
public ResultObject<Void> sendback(@RequestHeader("auth-token") String token,
|
||||||
|
@RequestBody PublishNewsDTO publishNewsDTO) {
|
||||||
|
if (!StringUtils.hasText(token)) {
|
||||||
|
return ResultObject.failed("登陆Token为空!");
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
AdminUser adminUser = AdminJwtService.parseToken(token);
|
||||||
|
if (adminUser == null) {
|
||||||
|
log.warn("解析token {}拿不到AdminUser对象!", token);
|
||||||
|
return ResultObject.failed("登陆Token有误,请联系系统管理员!");
|
||||||
|
}
|
||||||
|
|
||||||
|
Long adminUserId = adminUser.getId();
|
||||||
|
if (!adminUser.isActive()) {
|
||||||
|
log.warn("当前用户已被封禁! id = {}", adminUserId);
|
||||||
|
return ResultObject.failed("当前用户已被封禁!请联系系统管理员!");
|
||||||
|
}
|
||||||
|
|
||||||
|
Long id = publishNewsDTO.getId();
|
||||||
|
if (id == null) {
|
||||||
|
return ResultObject.failed("要送审的新闻ID不可为空!");
|
||||||
|
}
|
||||||
|
if (!(adminUser.isReviewer()||adminUser.isSecondReviewer())) {
|
||||||
|
return ResultObject.failed("无相关权限,非法操作");
|
||||||
|
}
|
||||||
|
boolean isSuccessed = setEditingFlag(id);
|
||||||
|
if (!isSuccessed) {
|
||||||
|
return ResultObject.failed("该资讯正在审核中,请勿重复操作!");
|
||||||
|
}
|
||||||
|
log.info("path: /news/sendback, method: POST, request user id: {}, news id: {}", adminUserId, id);
|
||||||
|
return newsService.sendback(id, adminUserId, adminUser.isReviewer(), adminUser.isSecondReviewer());
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("解析登陆Token出错!", e);
|
||||||
|
return ResultObject.failed(500, "服务端错误,请联系系统管理员!");
|
||||||
|
} finally {
|
||||||
|
unsetEditingFlag(publishNewsDTO.getId());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param newsId
|
* @param newsId
|
||||||
|
|
|
||||||
|
|
@ -154,4 +154,8 @@ public class AdminUser {
|
||||||
public boolean isReviewer() {
|
public boolean isReviewer() {
|
||||||
return Objects.equals(userType, "01");
|
return Objects.equals(userType, "01");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isSecondReviewer() {
|
||||||
|
return Objects.equals(userType, "02");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,6 @@
|
||||||
|
logging:
|
||||||
|
level:
|
||||||
|
root: DEBUG
|
||||||
server:
|
server:
|
||||||
port: 13579
|
port: 13579
|
||||||
compression:
|
compression:
|
||||||
|
|
@ -22,21 +25,21 @@ spring:
|
||||||
# url: jdbc:mysql://192.168.0.142:3306/reference?autoReconnect=true&useUnicode=true&useSSL=false&allowMultiQueries=true&characterEncoding=utf8&serverTimezone=Asia/Shanghai
|
# url: jdbc:mysql://192.168.0.142:3306/reference?autoReconnect=true&useUnicode=true&useSSL=false&allowMultiQueries=true&characterEncoding=utf8&serverTimezone=Asia/Shanghai
|
||||||
# username: financial_prod
|
# username: financial_prod
|
||||||
# password: mmTFncqmDal5HLRGY0BV
|
# password: mmTFncqmDal5HLRGY0BV
|
||||||
url: jdbc:mysql://10.127.2.207:3306/reference?autoReconnect=true&useUnicode=true&useSSL=false&allowMultiQueries=true&characterEncoding=utf8&serverTimezone=Asia/Shanghai
|
url: jdbc:mysql://121.37.185.246:3306/reference?autoReconnect=true&useUnicode=true&useSSL=false&allowMultiQueries=true&characterEncoding=utf8&serverTimezone=Asia/Shanghai
|
||||||
username: financial_prod
|
username: root
|
||||||
password: mmTFncqmDal5HLRGY0BV
|
password: Xgf_8000
|
||||||
redis:
|
redis:
|
||||||
# host: 192.168.0.172
|
# host: 192.168.0.172
|
||||||
# port: 6379
|
# port: 6379
|
||||||
# password: Xgf_redis
|
# password: Xgf_redis
|
||||||
host: 10.127.2.209
|
host: 123.60.153.169
|
||||||
port: 6379
|
port: 6379
|
||||||
password: dMrt4kmwiW6LDJXy
|
password: Xgf_redis
|
||||||
elasticsearch:
|
elasticsearch:
|
||||||
scheme: http
|
scheme: http
|
||||||
# 111.13.176.3 部署地址
|
# 111.13.176.3 部署地址
|
||||||
# 10.127.2.194 本地测试地址
|
# 10.127.2.194 本地测试地址
|
||||||
host: 10.127.2.194
|
host: 111.13.176.3
|
||||||
port: 9200
|
port: 9200
|
||||||
enable: true
|
enable: true
|
||||||
username: elastic
|
username: elastic
|
||||||
|
|
|
||||||
|
|
@ -144,7 +144,10 @@ public interface NewsMapper {
|
||||||
"and news.id > #{last}" +
|
"and news.id > #{last}" +
|
||||||
"</if>" +
|
"</if>" +
|
||||||
"<if test=\"isReviewer == true\">" +
|
"<if test=\"isReviewer == true\">" +
|
||||||
"and news.status in (2, 3) " +
|
"and news.status in (-1, 2, 4) " +
|
||||||
|
"</if>" +
|
||||||
|
"<if test=\"isSecondReviewRange == true\">" +
|
||||||
|
"and news.status in (-1, 2, 3, 4) " +
|
||||||
"</if>" +
|
"</if>" +
|
||||||
"</where>" +
|
"</where>" +
|
||||||
"<if test=\"orderBy != null\">" +
|
"<if test=\"orderBy != null\">" +
|
||||||
|
|
@ -167,7 +170,8 @@ public interface NewsMapper {
|
||||||
@Param("datelineTo") Date datelineTo,
|
@Param("datelineTo") Date datelineTo,
|
||||||
@Param("deleted") Integer deleted,
|
@Param("deleted") Integer deleted,
|
||||||
@Param("rating") Byte rating,
|
@Param("rating") Byte rating,
|
||||||
@Param("isReviewer") boolean isReviewer);
|
@Param("isReviewer") boolean isReviewer,
|
||||||
|
@Param("isSecondReviewRange") boolean isSecondReviewRange);
|
||||||
|
|
||||||
@Select("<script>" +
|
@Select("<script>" +
|
||||||
"select count(*) from (select distinct news.* from news " +
|
"select count(*) from (select distinct news.* from news " +
|
||||||
|
|
@ -224,7 +228,10 @@ public interface NewsMapper {
|
||||||
"and news.rating = #{rating} " +
|
"and news.rating = #{rating} " +
|
||||||
"</if>" +
|
"</if>" +
|
||||||
"<if test=\"isReviewer == true\">" +
|
"<if test=\"isReviewer == true\">" +
|
||||||
"and news.status in (2, 3) " +
|
"and news.status in (-1, 2, 4) " +
|
||||||
|
"</if>" +
|
||||||
|
"<if test=\"isSecondReviewRange == true\">" +
|
||||||
|
"and news.status in (-1, 2, 3, 4) " +
|
||||||
"</if>" +
|
"</if>" +
|
||||||
"</where>) tmp" +
|
"</where>) tmp" +
|
||||||
"</script>")
|
"</script>")
|
||||||
|
|
@ -239,7 +246,8 @@ public interface NewsMapper {
|
||||||
@Param("datelineTo") Date datelineTo,
|
@Param("datelineTo") Date datelineTo,
|
||||||
@Param("deleted") Integer deleted,
|
@Param("deleted") Integer deleted,
|
||||||
@Param("rating") Byte rating,
|
@Param("rating") Byte rating,
|
||||||
@Param("isReviewer") boolean isReviewer);
|
@Param("isReviewer") boolean isReviewer,
|
||||||
|
@Param("isSecondReviewRange") boolean isSecondReviewRange);
|
||||||
|
|
||||||
@Select("select id, llm_title as title, summary, picture, llm_content as content, status, " +
|
@Select("select id, llm_title as title, summary, picture, llm_content as content, status, " +
|
||||||
"create_time as createTime, " +
|
"create_time as createTime, " +
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,7 @@ public class News {
|
||||||
private String contentText;
|
private String contentText;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新闻状态 0-草稿 | 1-未发布 | 2-已发布 | 3-送审
|
* 新闻状态 0-草稿 | 1-未发布 | 2-已发布 | 3-送审 | 4-已二审 | -1-退改中
|
||||||
*/
|
*/
|
||||||
private Integer status;
|
private Integer status;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@ import java.util.HashMap;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Objects;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
|
|
@ -122,9 +123,8 @@ public class NewsService {
|
||||||
if (oldStatus == 1) {
|
if (oldStatus == 1) {
|
||||||
return ResultObject.failed("资讯已被撤稿,请刷新列表页面!");
|
return ResultObject.failed("资讯已被撤稿,请刷新列表页面!");
|
||||||
}
|
}
|
||||||
if (oldStatus == 2) {
|
if (oldStatus != 4) {
|
||||||
newsMapper.changeFrom(id, oldStatus, 3, editorId);
|
return ResultObject.failed("该资讯正在审核中,请勿重复操作!");
|
||||||
return ResultObject.success();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Long draftId = news.getDraftId();
|
Long draftId = news.getDraftId();
|
||||||
|
|
@ -376,8 +376,8 @@ public class NewsService {
|
||||||
public ResultObject<Void> createPublish(Long editorId, SaveNewsDTO saveNewsDTO, boolean isReviewer) {
|
public ResultObject<Void> createPublish(Long editorId, SaveNewsDTO saveNewsDTO, boolean isReviewer) {
|
||||||
Long id = saveNewsDTO.getId();
|
Long id = saveNewsDTO.getId();
|
||||||
Long newsId = saveNewsDTO.getId();
|
Long newsId = saveNewsDTO.getId();
|
||||||
Integer newStatus = (isReviewer ? 2: 3);
|
Integer newStatus = (isReviewer ? 2: 4);
|
||||||
Integer oldStatus = (isReviewer ? 3: 1);
|
Integer oldStatus = (isReviewer ? 4: 1);
|
||||||
News news;
|
News news;
|
||||||
Long draftId = null;
|
Long draftId = null;
|
||||||
String newsInfoId = null;
|
String newsInfoId = null;
|
||||||
|
|
@ -803,7 +803,9 @@ public class NewsService {
|
||||||
public PageObject<NewsVO> queryNews(String keyword, String columnParam, Integer status, int page, int size,
|
public PageObject<NewsVO> queryNews(String keyword, String columnParam, Integer status, int page, int size,
|
||||||
Integer last, Integer current, String orderBy, Double minScore, Double maxScore,
|
Integer last, Integer current, String orderBy, Double minScore, Double maxScore,
|
||||||
String tag, String industry, Long mediaId,
|
String tag, String industry, Long mediaId,
|
||||||
Date datelineFrom, Date datelineTo, Integer deleted, Byte rating,boolean isReviewer) {
|
Date datelineFrom, Date datelineTo, Integer deleted, Byte rating,
|
||||||
|
boolean isReviewer,
|
||||||
|
boolean isSecondReviewRange) {
|
||||||
String orderByClause = null;
|
String orderByClause = null;
|
||||||
if (StringUtils.hasText(orderBy)) {
|
if (StringUtils.hasText(orderBy)) {
|
||||||
String orderByStr = orderBy;
|
String orderByStr = orderBy;
|
||||||
|
|
@ -868,7 +870,7 @@ public class NewsService {
|
||||||
|
|
||||||
List<News> newsList;
|
List<News> newsList;
|
||||||
try {
|
try {
|
||||||
newsList = newsMapper.queryNews(keywords, minScore, maxScore, columnParam, status, last, orderByClause, size, offset, tags, industries, datelineFrom, datelineTo, deleted, rating, isReviewer);
|
newsList = newsMapper.queryNews(keywords, minScore, maxScore, columnParam, status, last, orderByClause, size, offset, tags, industries, datelineFrom, datelineTo, deleted, rating, isReviewer, isSecondReviewRange);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("搜索新闻异常!", e);
|
log.error("搜索新闻异常!", e);
|
||||||
return PageObject.failedPage(500, "服务器错误,请联系系统管理员!");
|
return PageObject.failedPage(500, "服务器错误,请联系系统管理员!");
|
||||||
|
|
@ -877,7 +879,7 @@ public class NewsService {
|
||||||
PageObject<NewsVO> pageObject = new PageObject<>();
|
PageObject<NewsVO> pageObject = new PageObject<>();
|
||||||
if (page == 1) {
|
if (page == 1) {
|
||||||
try {
|
try {
|
||||||
int total = newsMapper.queryTotal(keywords,minScore, maxScore, columnParam, status, tags, industries, datelineFrom, datelineTo, deleted, rating, isReviewer);
|
int total = newsMapper.queryTotal(keywords,minScore, maxScore, columnParam, status, tags, industries, datelineFrom, datelineTo, deleted, rating, isReviewer, isSecondReviewRange);
|
||||||
pageObject.setTotal(total);
|
pageObject.setTotal(total);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("获取新闻总数异常!", e);
|
log.error("获取新闻总数异常!", e);
|
||||||
|
|
@ -1107,15 +1109,30 @@ public class NewsService {
|
||||||
return ResultObject.failed("找不到ID为" + id + "的新闻!");
|
return ResultObject.failed("找不到ID为" + id + "的新闻!");
|
||||||
}
|
}
|
||||||
Integer oldStatus = news.getStatus();
|
Integer oldStatus = news.getStatus();
|
||||||
if (oldStatus != 1||news.getDeleted()) {
|
if (!Objects.equals(oldStatus, 1)||news.getDeleted()||Objects.equals(oldStatus, -1)) {
|
||||||
return ResultObject.failed("该资讯正在审核中,请勿重复操作");
|
return ResultObject.failed("该资讯正在审核中,请勿重复操作");
|
||||||
}
|
}
|
||||||
|
|
||||||
newsMapper.changeFrom(id, oldStatus, 3, editorId);
|
newsMapper.changeFrom(id, oldStatus, 3, editorId);
|
||||||
return ResultObject.success();
|
return ResultObject.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ResultObject<Void> check(long id, long editorId) {
|
||||||
|
News news = newsMapper.getById(id);
|
||||||
|
if (news == null) {
|
||||||
|
log.warn("找不到ID为{}的新闻!", id);
|
||||||
|
return ResultObject.failed("找不到ID为" + id + "的新闻!");
|
||||||
|
}
|
||||||
|
Integer oldStatus = news.getStatus();
|
||||||
|
if (oldStatus != 3||news.getDeleted()) {
|
||||||
|
return ResultObject.failed("该资讯正在审核中,请勿重复操作");
|
||||||
|
}
|
||||||
|
|
||||||
public ResultObject<Void> revoke(Long id, Long editorId, boolean isReviewer) {
|
newsMapper.changeFrom(id, oldStatus, 4, editorId);
|
||||||
|
return ResultObject.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
public ResultObject<Void> revoke(Long id, Long editorId, boolean isReviewer, boolean isSecondReviewer) {
|
||||||
News news = newsMapper.getById(id);
|
News news = newsMapper.getById(id);
|
||||||
if (news == null) {
|
if (news == null) {
|
||||||
log.warn("找不到ID为{}的新闻!", id);
|
log.warn("找不到ID为{}的新闻!", id);
|
||||||
|
|
@ -1126,6 +1143,13 @@ public class NewsService {
|
||||||
if (oldStatus != 2||news.getDeleted()) {
|
if (oldStatus != 2||news.getDeleted()) {
|
||||||
return ResultObject.failed("该资讯正在审核中,请勿重复操作");
|
return ResultObject.failed("该资讯正在审核中,请勿重复操作");
|
||||||
}
|
}
|
||||||
|
newsMapper.changeFrom(id, oldStatus, 4, editorId);
|
||||||
|
return ResultObject.success();
|
||||||
|
}
|
||||||
|
if (isSecondReviewer) {
|
||||||
|
if (oldStatus != 4||news.getDeleted()) {
|
||||||
|
return ResultObject.failed("该资讯正在审核中,请勿重复操作");
|
||||||
|
}
|
||||||
newsMapper.changeFrom(id, oldStatus, 3, editorId);
|
newsMapper.changeFrom(id, oldStatus, 3, editorId);
|
||||||
return ResultObject.success();
|
return ResultObject.success();
|
||||||
}
|
}
|
||||||
|
|
@ -1137,6 +1161,30 @@ public class NewsService {
|
||||||
newsMapper.changeFrom(id, oldStatus, 1, editorId);
|
newsMapper.changeFrom(id, oldStatus, 1, editorId);
|
||||||
return ResultObject.success();
|
return ResultObject.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ResultObject<Void> sendback(Long id, Long editorId, boolean isReviewer, boolean isSecondReviewer) {
|
||||||
|
News news = newsMapper.getById(id);
|
||||||
|
if (news == null) {
|
||||||
|
log.warn("找不到ID为{}的新闻!", id);
|
||||||
|
return ResultObject.failed("找不到ID为" + id + "的新闻!");
|
||||||
|
}
|
||||||
|
Integer oldStatus = news.getStatus();
|
||||||
|
if (isReviewer) {
|
||||||
|
if (oldStatus != 4||news.getDeleted()) {
|
||||||
|
return ResultObject.failed("该资讯正在审核中,请勿重复操作");
|
||||||
|
}
|
||||||
|
newsMapper.changeFrom(id, oldStatus, -1, editorId);
|
||||||
|
return ResultObject.success();
|
||||||
|
}
|
||||||
|
if (isSecondReviewer) {
|
||||||
|
if (oldStatus != 3||news.getDeleted()) {
|
||||||
|
return ResultObject.failed("该资讯正在审核中,请勿重复操作");
|
||||||
|
}
|
||||||
|
newsMapper.changeFrom(id, oldStatus, -1, editorId);
|
||||||
|
return ResultObject.success();
|
||||||
|
}
|
||||||
|
return ResultObject.failed("无相关权限,非法操作");
|
||||||
|
}
|
||||||
|
|
||||||
public PageObject<NewsLogVO> getLog(Long id, int page, int size, Integer current) {
|
public PageObject<NewsLogVO> getLog(Long id, int page, int size, Integer current) {
|
||||||
int offset = 0;
|
int offset = 0;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue