Commit b003423c authored by yuanshuo's avatar yuanshuo

新增细则、要点代码补充

parent 69afec74
......@@ -5,6 +5,8 @@ import com.ruoyi.domain.ReviewDetails;
import com.ruoyi.domain.ReviewKeyPoint;
import com.ruoyi.domain.ReviewStandard;
import com.ruoyi.web.request.ReviewFindListRequest;
import com.ruoyi.web.response.ReviewDetailsListResponse;
import com.ruoyi.web.response.ReviewKeyPointListResponse;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
......@@ -20,4 +22,8 @@ public interface ReviewKeyPointMapper extends BaseMapper<ReviewKeyPoint> {
// 根据细则列表查询要点列表
List<ReviewKeyPoint> findByDetailsList(@Param("detailsList") List<ReviewDetails> detailsList);
List<ReviewKeyPointListResponse> getKeyPointList(@Param("standardId") Long standardId);
List<ReviewDetailsListResponse> getDetailsList(@Param("keyPointId") Long keyPointId);
}
......@@ -6,6 +6,8 @@ import com.ruoyi.web.request.ReviewSceneChangeTaskFindCreateRequest;
import com.ruoyi.web.request.ReviewSceneChangeTaskFindFinishRequest;
import com.ruoyi.web.request.ReviewSceneChangeTaskFindPendingRequest;
import com.ruoyi.web.request.ReviewSceneChangeTaskPassRequest;
import com.ruoyi.web.response.ReviewDetailsListResponse;
import com.ruoyi.web.response.ReviewKeyPointListResponse;
import com.ruoyi.web.response.ReviewSceneChangeTaskResponse;
import java.util.Date;
......@@ -102,4 +104,15 @@ public interface ReviewSceneChangeTaskService extends IService<ReviewSceneChange
* @return
*/
void innovationBaseAudit(ReviewSceneChangeTaskPassRequest request);
/*
* 发起评审-新增审查场景-获取要点列表
* */
List<ReviewKeyPointListResponse> getKeyPointList(Long standardId);
/*
* 发起评审-新增审查场景-获取细则列表
* */
List<ReviewDetailsListResponse> getDetailsList(Long keyPointId);
}
......@@ -38,7 +38,6 @@ public interface ReviewStandardService extends IService<ReviewStandard> {
* @return
*/
ReviewStandardInspectionContentResponse selectInspectionContent(Long id);
/**
* 根据标准主键ID查询车型试验的检验内容
* @param id
......
......@@ -9,6 +9,7 @@ import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.domain.ReviewSceneChangeTask;
import com.ruoyi.domain.ReviewSceneChangeTaskUserRelation;
import com.ruoyi.framework.web.domain.server.Sys;
import com.ruoyi.mapper.ReviewKeyPointMapper;
import com.ruoyi.service.ReviewSceneChangeTaskService;
import com.ruoyi.mapper.ReviewSceneChangeTaskMapper;
import com.ruoyi.service.ReviewSceneChangeTaskUserRelationService;
......@@ -20,6 +21,8 @@ import com.ruoyi.web.request.ReviewSceneChangeTaskFindCreateRequest;
import com.ruoyi.web.request.ReviewSceneChangeTaskFindFinishRequest;
import com.ruoyi.web.request.ReviewSceneChangeTaskFindPendingRequest;
import com.ruoyi.web.request.ReviewSceneChangeTaskPassRequest;
import com.ruoyi.web.response.ReviewDetailsListResponse;
import com.ruoyi.web.response.ReviewKeyPointListResponse;
import com.ruoyi.web.response.ReviewSceneChangeTaskResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -57,6 +60,8 @@ public class ReviewSceneChangeTaskServiceImpl extends ServiceImpl<ReviewSceneCha
@Autowired
private SysUserRoleMapper sysUserRoleMapper;
@Autowired
private ReviewKeyPointMapper reviewKeyPointMapper;
@Override
public void create(ReviewSceneChangeTask reviewSceneChangeTask) {
......@@ -406,7 +411,6 @@ public class ReviewSceneChangeTaskServiceImpl extends ServiceImpl<ReviewSceneCha
throw new ServiceException("审核状态不正确",HttpStatus.ERROR);
}
}
/**
* 创新基地评审任务
* @param taskId
......@@ -450,6 +454,21 @@ public class ReviewSceneChangeTaskServiceImpl extends ServiceImpl<ReviewSceneCha
}
/*
* 发起评审-新增审查场景-获取要点列表
* */
@Override
public List<ReviewKeyPointListResponse> getKeyPointList(Long standardId) {
return reviewKeyPointMapper.getKeyPointList(standardId);
}
/*
* 发起评审-新增审查场景-获取细则列表
* */
@Override
public List<ReviewDetailsListResponse> getDetailsList(Long keyPointId) {
return reviewKeyPointMapper.getDetailsList(keyPointId);
}
}
......
......@@ -68,11 +68,20 @@ public class StrategyReviewSceneChangeAdd implements StrategyReviewSceneChange,
.setReviewStandardId(reviewSceneChangeTask.getStandardId());
reviewKeyPointMapper.insert(reviewKeyPoint);
//为新增细则变更任务的细则关联id字段赋值
reviewSceneChangeTask.setKeypointId(reviewKeyPoint.getId());
reviewSceneChangeTaskService.updateById(reviewSceneChangeTask);
// 细则
ReviewDetails reviewDetails = new ReviewDetails()
.setText(reviewSceneChangeTask.getDetails())
.setReviewKeypointId(reviewKeyPoint.getId());
reviewDetailsMapper.insert(reviewDetails);
//为新增细则变更任务的细则关联id字段赋值
reviewSceneChangeTask.setDetailsId(reviewDetails.getId());
reviewSceneChangeTaskService.updateById(reviewSceneChangeTask);
}
// 保存新增的细则
......@@ -82,6 +91,10 @@ public class StrategyReviewSceneChangeAdd implements StrategyReviewSceneChange,
.setText(reviewSceneChangeTask.getDetails())
.setReviewKeypointId(reviewSceneChangeTask.getKeypointId());
reviewDetailsMapper.insert(reviewDetails);
//为新增细则变更任务的细则关联id字段赋值
reviewSceneChangeTask.setDetailsId(reviewDetails.getId());
reviewSceneChangeTaskService.updateById(reviewSceneChangeTask);
}
......
......@@ -6,12 +6,16 @@ import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.bean.BeanUtils;
import com.ruoyi.domain.ReviewKeyPoint;
import com.ruoyi.domain.ReviewSceneChangeTask;
import com.ruoyi.service.ReviewSceneChangeTaskService;
import com.ruoyi.web.request.ReviewSceneChangeTaskCreateRequest;
import com.ruoyi.web.request.ReviewSceneChangeTaskPassRequest;
import com.ruoyi.web.response.ReviewDetailsListResponse;
import com.ruoyi.web.response.ReviewKeyPointListResponse;
import com.ruoyi.web.response.ReviewSceneChangeTaskResponse;
import com.ruoyi.web.request.*;
import com.ruoyi.web.response.ReviewStandardListResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.skywalking.apm.toolkit.trace.Tag;
......@@ -22,6 +26,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@Api(tags = "场景变更任务")
@RestController
@RequestMapping("/review/scene/change/task")
......@@ -100,7 +106,8 @@ public class ReviewSceneChangeTaskController extends BaseController {
@Tags({@Tag(key = "param", value = "arg[0]"), @Tag(key = "result", value = "returnedObj")})
@RequestMapping(method = RequestMethod.POST, value = "/getById")
public R<ReviewSceneChangeTask> getInfo(@Validated @RequestBody ReviewSceneChangeTaskGetInfoRequest request) {
return R.ok(reviewSceneChangeTaskService.getBySceneChangeTaskId(request.getId()));
Long id = Long.parseLong(request.getId());
return R.ok(reviewSceneChangeTaskService.getBySceneChangeTaskId(id));
}
/**
......@@ -138,7 +145,8 @@ public class ReviewSceneChangeTaskController extends BaseController {
@Tags({@Tag(key = "param", value = "arg[0]"), @Tag(key = "result", value = "returnedObj")})
@RequestMapping(method = RequestMethod.POST, value = "/innovationBaseGetById")
public R<ReviewSceneChangeTask> innovationBaseGetById(@Validated @RequestBody ReviewSceneChangeTaskGetInfoRequest request) {
return R.ok(reviewSceneChangeTaskService.getBySceneChange(request.getId()));
Long id = Long.parseLong(request.getId());
return R.ok(reviewSceneChangeTaskService.getBySceneChange(id));
}
/**
......@@ -155,4 +163,30 @@ public class ReviewSceneChangeTaskController extends BaseController {
return R.ok();
}
/*
* 发起评审-新增审查场景-获取要点列表
* */
@ApiOperation("发起评审-新增审查场景-获取要点列表")
@Trace
@Tags({@Tag(key = "param", value = "arg[0]"), @Tag(key = "result", value = "returnedObj")})
@Log(title = "发起评审-新增审查场景-获取要点列表", businessType = BusinessType.UPDATE)
@RequestMapping(method = RequestMethod.POST, value = "/getKeyPointList")
public R<List<ReviewKeyPointListResponse>> getKeyPointList(@Validated @RequestBody ReviewKeyPointListRequest request){
List<ReviewKeyPointListResponse> list = reviewSceneChangeTaskService.getKeyPointList(request.getStandardId());
return R.ok(list);
}
/*
* 发起评审-新增审查场景-获取细则列表
* */
@ApiOperation("发起评审-新增审查场景-获取细则列表")
@Trace
@Tags({@Tag(key = "param", value = "arg[0]"), @Tag(key = "result", value = "returnedObj")})
@Log(title = "发起评审-新增审查场景-获取细则列表", businessType = BusinessType.UPDATE)
@RequestMapping(method = RequestMethod.POST, value = "/getDetailsList")
public R<List<ReviewDetailsListResponse>> getKeyPointList(@Validated @RequestBody ReviewDetailsListRequest request){
List<ReviewDetailsListResponse> list = reviewSceneChangeTaskService.getDetailsList(request.getKeyPointId());
return R.ok(list);
}
}
......@@ -45,7 +45,6 @@ public class ReviewStandardController extends BaseController {
List<ReviewStandardResponse> list = reviewStandardService.listByPage(request);
return getDataTable(list);
}
/**
* 根据标准主键ID查询树状结构
* @param request
......
......@@ -8,6 +8,10 @@ import lombok.Data;
@ApiModel
public class ReviewSceneChangeTaskGetInfoRequest {
/*
* 由于Long类型的id太长,前端接受数据时会产生差错,这里将Long改为String确保id正常传递
* */
@ApiModelProperty("ID")
private Long id;
private String id;
}
package com.ruoyi.web.request;
import com.ruoyi.common.core.page.PageDomain;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
......@@ -44,4 +45,10 @@ public class ReviewStandardListByPageRequest extends PageDomain {
@ApiModelProperty("测试方法")
private String testMethod;
@ApiModelProperty("标准名称")
private String name;
@ApiModelProperty("标准号")
private String standardNo;
}
......@@ -13,10 +13,10 @@ import java.util.Date;
public class ReviewSceneChangeTaskResponse {
/**
* 主键
* 主键 由于主键太长返回给前端时会造成数据不对问题,这里将id改为String类型。
*/
@ApiModelProperty("主键")
private Long id;
private String id;
/**
* 任务编号
......
......@@ -35,4 +35,10 @@ public class ReviewStandardResponse {
@ApiModelProperty("测试方法(车型试验专有)")
private String testMethod;
@ApiModelProperty("标准名称")
private String name;
@ApiModelProperty("标准号")
private String standardNo;
}
......@@ -26,5 +26,13 @@
#{detail.reviewKeypointId}
</foreach>
</select>
<select id="getKeyPointList" resultType="com.ruoyi.web.response.ReviewKeyPointListResponse">
select id, text from t_review_keypoint
where review_standard_id = #{standardId}
</select>
<select id="getDetailsList" resultType="com.ruoyi.web.response.ReviewDetailsListResponse">
select id, text from t_review_details
where review_keypoint_id = #{keyPointId}
</select>
</mapper>
......@@ -98,7 +98,7 @@
<select id="findCreateListByUserId" resultType="com.ruoyi.domain.ReviewSceneChangeTask">
SELECT * FROM t_review_scene_change_task
WHERE task_initiator_id = #{userId}
WHERE task_initiator_id = #{userId} and innovation_base_result = 'PASS'
<if test="request.operationSort != null and request.operationSort != ''">
and operation_sort = #{request.operationSort}
</if>
......
......@@ -44,7 +44,9 @@
id,
chapter,
text,
test_method AS testMethod
test_method AS testMethod,
name,
standard_no AS standardNo
from
t_review_standard
<where>
......@@ -53,6 +55,8 @@
<if test="chapter != null and chapter != ''"> and chapter like concat('%', #{chapter}, '%') </if>
<if test="text != null and text != ''"> and text like concat('%', #{text}, '%') </if>
<if test="testMethod != null and testMethod != ''"> and test_method like concat('%', #{testMethod}, '%') </if>
<if test="name != null and text != ''">and name like concat('%',#{name}, '%')</if>
<if test="standardNo != null and standardNo != ''">and standard_no like concat('%',#{standardNo},'%')</if>
</where>
ORDER BY
chapter
......@@ -95,4 +99,5 @@
</select>
</mapper>
......@@ -3,12 +3,14 @@ package com.ruoyi.system.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.ruoyi.system.domain.SysUserRole;
import org.springframework.stereotype.Repository;
/**
* 用户与角色关联表 数据层
*
* @author ruoyi
*/
@Repository
public interface SysUserRoleMapper
{
/**
......
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