Commit 4ffea6b0 authored by 盖献康's avatar 盖献康

Merge branch 'dev' of...

Merge branch 'dev' of ssh://gitlab.91isoft.com:10022/wangfei/vehicle-quality-review into gaixiankang
parents 04558298 f84a5ddb
...@@ -2,6 +2,10 @@ package com.ruoyi.mapper; ...@@ -2,6 +2,10 @@ package com.ruoyi.mapper;
import com.ruoyi.domain.ReviewTaskInbox; import com.ruoyi.domain.ReviewTaskInbox;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.util.List;
/** /**
* @author wangfei * @author wangfei
...@@ -9,8 +13,13 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; ...@@ -9,8 +13,13 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
* @createDate 2023-12-26 09:55:39 * @createDate 2023-12-26 09:55:39
* @Entity com.ruoyi.domain.SystemReviewTaskInbox * @Entity com.ruoyi.domain.SystemReviewTaskInbox
*/ */
@Repository
public interface ReviewTaskInboxMapper extends BaseMapper<ReviewTaskInbox> { public interface ReviewTaskInboxMapper extends BaseMapper<ReviewTaskInbox> {
List<ReviewTaskInbox> findConfirmListByTaskId(@Param("taskId") Long taskId);
List<ReviewTaskInbox> findConfirmList(@Param("reviewTaskId") Long reviewTaskId, @Param("detailsId") Long detailsId);
} }
......
...@@ -2,6 +2,7 @@ package com.ruoyi.service; ...@@ -2,6 +2,7 @@ package com.ruoyi.service;
import com.ruoyi.domain.ReviewTaskInbox; import com.ruoyi.domain.ReviewTaskInbox;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.web.request.ReviewTaskInboxConfirmRequest;
/** /**
* @author wangfei * @author wangfei
...@@ -16,4 +17,6 @@ public interface ReviewTaskInboxService extends IService<ReviewTaskInbox> { ...@@ -16,4 +17,6 @@ public interface ReviewTaskInboxService extends IService<ReviewTaskInbox> {
*/ */
void saveNotify(Long reviewSceneChangeTaskId, String type); void saveNotify(Long reviewSceneChangeTaskId, String type);
void confirm(ReviewTaskInboxConfirmRequest request);
} }
...@@ -11,6 +11,7 @@ import com.ruoyi.service.CarReviewTaskService; ...@@ -11,6 +11,7 @@ import com.ruoyi.service.CarReviewTaskService;
import com.ruoyi.service.ReviewTaskInboxService; import com.ruoyi.service.ReviewTaskInboxService;
import com.ruoyi.mapper.ReviewTaskInboxMapper; import com.ruoyi.mapper.ReviewTaskInboxMapper;
import com.ruoyi.service.SystemReviewTaskService; import com.ruoyi.service.SystemReviewTaskService;
import com.ruoyi.web.request.ReviewTaskInboxConfirmRequest;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
...@@ -33,6 +34,9 @@ public class ReviewTaskInboxServiceImpl extends ServiceImpl<ReviewTaskInboxMappe ...@@ -33,6 +34,9 @@ public class ReviewTaskInboxServiceImpl extends ServiceImpl<ReviewTaskInboxMappe
@Autowired @Autowired
private CarReviewTaskService carReviewTaskService; private CarReviewTaskService carReviewTaskService;
@Autowired
private ReviewTaskInboxMapper reviewTaskInboxMapper;
/** /**
* 保存场景变更对进行中的问卷产生的影响,用于提醒问卷使用者场景发生了变更。 * 保存场景变更对进行中的问卷产生的影响,用于提醒问卷使用者场景发生了变更。
* 体系审查任务、侧性审查任务分别查询不同的表 * 体系审查任务、侧性审查任务分别查询不同的表
...@@ -54,6 +58,17 @@ public class ReviewTaskInboxServiceImpl extends ServiceImpl<ReviewTaskInboxMappe ...@@ -54,6 +58,17 @@ public class ReviewTaskInboxServiceImpl extends ServiceImpl<ReviewTaskInboxMappe
} }
@Override
public void confirm(ReviewTaskInboxConfirmRequest request) {
List<ReviewTaskInbox> inboxList = reviewTaskInboxMapper.findConfirmList(request.getReviewTaskId(),request.getDetailsId());
for (ReviewTaskInbox inbox : inboxList) {
inbox.setIsConfirm(1);
reviewTaskInboxMapper.updateById(inbox);
}
}
public void doSaveNotifyByCarReview(Long reviewSceneChangeTaskId) { public void doSaveNotifyByCarReview(Long reviewSceneChangeTaskId) {
// 查找所有受变更影响的体系审查任务(所有PENDING状态的任务) // 查找所有受变更影响的体系审查任务(所有PENDING状态的任务)
......
...@@ -5,10 +5,7 @@ import com.ruoyi.common.core.domain.entity.SysUser; ...@@ -5,10 +5,7 @@ import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.exception.ServiceException; import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.SecurityUtils; import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.domain.*; import com.ruoyi.domain.*;
import com.ruoyi.mapper.CarReviewTaskMapper; import com.ruoyi.mapper.*;
import com.ruoyi.mapper.ReviewDetailsMapper;
import com.ruoyi.mapper.ReviewDetailsResultMapper;
import com.ruoyi.mapper.SystemReviewTaskMapper;
import com.ruoyi.service.ReviewDetailsResultService; import com.ruoyi.service.ReviewDetailsResultService;
import com.ruoyi.service.ReviewSceneChangeTaskService; import com.ruoyi.service.ReviewSceneChangeTaskService;
import com.ruoyi.service.ReviewStandardService; import com.ruoyi.service.ReviewStandardService;
...@@ -53,6 +50,9 @@ public class StrategyCarReviewTaskPending implements StrategyCarReviewTask, Init ...@@ -53,6 +50,9 @@ public class StrategyCarReviewTaskPending implements StrategyCarReviewTask, Init
@Autowired @Autowired
private ReviewDetailsMapper reviewDetailsMapper; private ReviewDetailsMapper reviewDetailsMapper;
@Autowired
private ReviewTaskInboxMapper reviewTaskInboxMapper;
// PENDING状态下 // PENDING状态下
// 1.standard字段查询当前最新问卷 // 1.standard字段查询当前最新问卷
// 2.查询场景变更任务 // 2.查询场景变更任务
...@@ -91,10 +91,12 @@ public class StrategyCarReviewTaskPending implements StrategyCarReviewTask, Init ...@@ -91,10 +91,12 @@ public class StrategyCarReviewTaskPending implements StrategyCarReviewTask, Init
@Override @Override
public void doConfirmReview(CarReviewTask carReviewTask) { public void doConfirmReview(CarReviewTask carReviewTask) {
List<ReviewDetails> detailsList = reviewDetailsMapper.findNoResult(carReviewTask.getId()); List<ReviewDetails> detailsList = reviewDetailsMapper.findNoResult(carReviewTask.getId());
List<ReviewTaskInbox> inboxList = reviewTaskInboxMapper.findConfirmListByTaskId(carReviewTask.getId());
if (detailsList != null) { if (detailsList != null) {
throw new ServiceException("存在未填写的问卷,请填写完整", HttpStatus.ERROR, detailsList); throw new ServiceException("存在未填写的问卷,请填写完整", HttpStatus.ERROR, detailsList);
} else { }else if (inboxList != null ) {
throw new ServiceException("存在未确认的场景变更信息,请确认", HttpStatus.ERROR);
}else {
// 1. 获取最新问卷 // 1. 获取最新问卷
List<ReviewStandard> standardTree = reviewStandardService.findTree(carReviewTask.getStandardId(), ReviewStandard.TYPE_CAR); List<ReviewStandard> standardTree = reviewStandardService.findTree(carReviewTask.getStandardId(), ReviewStandard.TYPE_CAR);
......
...@@ -7,6 +7,7 @@ import com.ruoyi.common.utils.SecurityUtils; ...@@ -7,6 +7,7 @@ import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.domain.*; import com.ruoyi.domain.*;
import com.ruoyi.mapper.ReviewDetailsMapper; import com.ruoyi.mapper.ReviewDetailsMapper;
import com.ruoyi.mapper.ReviewDetailsResultMapper; import com.ruoyi.mapper.ReviewDetailsResultMapper;
import com.ruoyi.mapper.ReviewTaskInboxMapper;
import com.ruoyi.mapper.SystemReviewTaskMapper; import com.ruoyi.mapper.SystemReviewTaskMapper;
import com.ruoyi.service.*; import com.ruoyi.service.*;
import com.ruoyi.web.response.SystemReviewTaskViewResponse; import com.ruoyi.web.response.SystemReviewTaskViewResponse;
...@@ -49,6 +50,9 @@ public class StrategySystemReviewTaskPending implements StrategySystemReviewTask ...@@ -49,6 +50,9 @@ public class StrategySystemReviewTaskPending implements StrategySystemReviewTask
@Autowired @Autowired
private ReviewDetailsMapper reviewDetailsMapper; private ReviewDetailsMapper reviewDetailsMapper;
@Autowired
private ReviewTaskInboxMapper reviewTaskInboxMapper;
@Override @Override
public void doStart(SystemReviewTask systemReviewTask) { public void doStart(SystemReviewTask systemReviewTask) {
throw new ServiceException("不能开始一个已经开始的任务", HttpStatus.ERROR); throw new ServiceException("不能开始一个已经开始的任务", HttpStatus.ERROR);
...@@ -70,8 +74,11 @@ public class StrategySystemReviewTaskPending implements StrategySystemReviewTask ...@@ -70,8 +74,11 @@ public class StrategySystemReviewTaskPending implements StrategySystemReviewTask
public void doConfirm(SystemReviewTask systemReviewTask) { public void doConfirm(SystemReviewTask systemReviewTask) {
// TODO // TODO
List<ReviewDetails> detailsList = reviewDetailsMapper.findNoResult(systemReviewTask.getId()); List<ReviewDetails> detailsList = reviewDetailsMapper.findNoResult(systemReviewTask.getId());
List<ReviewTaskInbox> inboxList = reviewTaskInboxMapper.findConfirmListByTaskId(systemReviewTask.getId());
if (detailsList != null) { if (detailsList != null) {
throw new ServiceException("存在未填写的问卷,请填写完整", HttpStatus.ERROR, detailsList); throw new ServiceException("存在未填写的问卷,请填写完整", HttpStatus.ERROR, detailsList);
} else if (inboxList != null){
throw new ServiceException("存在未确认的场景变更信息,请确认", HttpStatus.ERROR);
} else { } else {
// 1. 获取最新问卷 // 1. 获取最新问卷
List<ReviewStandard> standardTree = reviewStandardService.findTree(systemReviewTask.getStandardId(), ReviewStandard.TYPE_SYSTEM); List<ReviewStandard> standardTree = reviewStandardService.findTree(systemReviewTask.getStandardId(), ReviewStandard.TYPE_SYSTEM);
......
package com.ruoyi.web;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.service.ReviewTaskInboxService;
import com.ruoyi.web.request.ReviewTaskInboxConfirmRequest;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.skywalking.apm.toolkit.trace.Tag;
import org.apache.skywalking.apm.toolkit.trace.Tags;
import org.apache.skywalking.apm.toolkit.trace.Trace;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
@Api(tags = "审查问卷收件箱")
@RestController
@RequestMapping("/review/task/inbox")
public class ReviewTaskInboxController extends BaseController {
@Autowired
private ReviewTaskInboxService reviewTaskInboxService;
@ApiOperation("确认信息")
@Trace
@Tags({@Tag(key = "param", value = "arg[0]"), @Tag(key = "result", value = "returnedObj")})
@Log(title = "确认多条信息", businessType = BusinessType.UPDATE)
@RequestMapping(method = RequestMethod.POST, value = "/confirm")
public R<String> confirm(@Validated @RequestBody ReviewTaskInboxConfirmRequest request) {
reviewTaskInboxService.confirm(request);
return R.ok();
}
}
package com.ruoyi.web.request;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ApiModel(value = "ReviewTaskInboxConfirmRequest", description = "确认信息")
@Data
public class ReviewTaskInboxConfirmRequest {
@ApiModelProperty(value = "审查任务id")
private Long reviewTaskId;
@ApiModelProperty("细则Id")
private Long detailsId;
}
...@@ -12,6 +12,17 @@ ...@@ -12,6 +12,17 @@
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id,review_task_id,review_scene_change_task_id,is_confirm select id,review_task_id,review_scene_change_task_id,is_confirm from t_review_task_inbox
</sql> </sql>
<select id="findConfirmListByTaskId" resultType="com.ruoyi.domain.ReviewTaskInbox">
select id,review_task_id,review_scene_change_task_id,is_confirm from t_review_task_inbox
where review_task_id = #{taskId} and is_confirm = 0
</select>
<select id="findConfirmList" resultType="com.ruoyi.domain.ReviewTaskInbox">
SELECT inbox.id, inbox.review_task_id, inbox.is_confirm, inbox.review_scene_change_task_id, task.details_id FROM t_review_task_inbox inbox
LEFT JOIN t_review_scene_change_task task ON inbox.review_scene_change_task_id = task.id
WHERE review_task_id = #{reviewTaskId} AND task.details_id = #{detailsId} and inbox.is_confirm = 0
</select>
</mapper> </mapper>
...@@ -93,7 +93,7 @@ public class GlobalExceptionHandler ...@@ -93,7 +93,7 @@ public class GlobalExceptionHandler
{ {
String requestURI = request.getRequestURI(); String requestURI = request.getRequestURI();
log.error("请求地址'{}',发生未知异常.", requestURI, e); log.error("请求地址'{}',发生未知异常.", requestURI, e);
return AjaxResult.error(e.getMessage()); return AjaxResult.error("发生未知系统异常请与管理员联系"); // 修改统一异常返回的信息,避免暴露服务端细节
} }
/** /**
...@@ -104,7 +104,7 @@ public class GlobalExceptionHandler ...@@ -104,7 +104,7 @@ public class GlobalExceptionHandler
{ {
String requestURI = request.getRequestURI(); String requestURI = request.getRequestURI();
log.error("请求地址'{}',发生系统异常.", requestURI, e); log.error("请求地址'{}',发生系统异常.", requestURI, e);
return AjaxResult.error(e.getMessage()); return AjaxResult.error("发生未知系统异常请与管理员联系"); // 修改统一异常返回的信息,避免暴露服务端细节
} }
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment