Commit 84e535cc authored by yuanshuo's avatar yuanshuo

修改接口和添加新接口

1.修改/review/scene/change/task/cancel接口 当点击取消的时候将taskStatus设置为null
2.添加/review/scene/change/task/getKeypointListAllNew和/review/scene/change/task/deleteKeypointListAllNew接口用于原型中添加场景、删除细则、删除要点界面按钮
parent 86593b5c
......@@ -6,6 +6,7 @@ import com.ruoyi.domain.ReviewDetails;
import com.ruoyi.domain.ReviewKeyPoint;
import com.ruoyi.domain.SystemReviewTask;
import com.ruoyi.web.request.ReviewFindListRequest;
import com.ruoyi.web.response.DeleteDetails;
import com.ruoyi.web.response.ResultCountResponse;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
......@@ -37,4 +38,8 @@ public interface ReviewDetailsMapper extends BaseMapper<ReviewDetails> {
// 根据检验要点ID查询细则(Details)列表
List<ReviewDetails> selectDetailsListByKeypointId(Long keypointId);
/*
* 删除细则按钮2
* */
List<DeleteDetails> selectDetailsList(@Param("keypointId") Long keypointId, @Param("text") String text);
}
......@@ -5,9 +5,7 @@ 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 com.ruoyi.web.response.ReviewKeyPointNew;
import com.ruoyi.web.response.*;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
......@@ -32,4 +30,12 @@ public interface ReviewKeyPointMapper extends BaseMapper<ReviewKeyPoint> {
List<ReviewKeyPointNew> selectKeypointListByStandardId(Long standardId);
ReviewKeyPointNew selectKeypointById(Long id);
/*
* 新增细则按钮2
* */
List<KeypointList> selectKeypointList(@Param("id") Long id, @Param("text") String text);
/*
* 删除细则按钮2
* */
List<DeleteDetailsList> selectKeypointListNew(@Param("id") Long id);
}
......@@ -72,6 +72,8 @@ public interface ReviewSceneChangeTaskMapper extends BaseMapper<ReviewSceneChang
List<ReviewOpinionResponse> getReviewerOpinion(@Param("id") Long id,@Param("userId") Long userId);
Long getinspectStandardIdByTaskId(@Param("taskId") Long taskId);
void updateByIdNew(@Param("task") ReviewSceneChangeTask task);
}
......
......@@ -21,8 +21,8 @@ public interface ReviewSceneMapper extends BaseMapper<ReviewScene> {
// 查询场景列表
List<ReviewScene> findList(ReviewSceneFindListRequest request);
List<GetSceneListResponse> getSceneListById(@Param("id") Long id);
List<GetSceneListResponse> getSceneListById(@Param("id") Long id,@Param("text")String text);
// 根据细则ID查询审核场景(Scene)列表
List<ReviewScene> selectSceneListByDetailsId(Long detailsId);
List<ReviewScene> selectSceneListByDetailsId(@Param("detailsId") Long detailsId);
}
......@@ -67,7 +67,7 @@ public interface ReviewStandardMapper extends BaseMapper<ReviewStandard> {
/*
* 获取要点id列表
* */
List<KeypointList> getKeypointListByIdList(@Param("idList") List<Long> idList);
List<KeypointList> getKeypointListByIdList(@Param("idList") List<Long> idList,@Param("text") String text);
List<Long> getDetailsIdList(@Param("deleteDetailsRequest") DeleteDetailsRequest deleteDetailsRequest);
......@@ -92,5 +92,12 @@ public interface ReviewStandardMapper extends BaseMapper<ReviewStandard> {
List<ReviewStandardResponse> selectReviewStandardListBySystemType();
List<ReviewStandardResponse> selectReviewStandardListByCarType();
/*
* 新增细则按钮2
* */
List<AddDetailsResponse> getKeypointList(@Param("getKeypointListRequest") GetKeypointListRequest getKeypointListRequest);
/*
* 删除细则按钮2
* */
List<DeleteDetailsResponse> selectStandardList(@Param("deleteDetailsRequest") DeleteDetailsRequest deleteDetailsRequest);
}
......@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.domain.ReviewDetails;
import com.ruoyi.domain.ReviewKeyPoint;
import com.ruoyi.web.request.DeleteDetailsRequest;
import com.ruoyi.web.request.GetKeypointListRequest;
import com.ruoyi.web.response.DeleteDetailsResponse;
import java.util.List;
......@@ -16,4 +17,9 @@ public interface ReviewDetailsService extends IService<ReviewDetails> {
* 删除细则按钮
* */
List<DeleteDetailsResponse> getDeleteDetailsResponseList(DeleteDetailsRequest deleteDetailsRequest);
/*
* 删除细则按钮2
* */
List<DeleteDetailsResponse> selectDetailsList(DeleteDetailsRequest deleteDetailsRequest);
}
......@@ -35,5 +35,5 @@ public interface ReviewSceneService extends IService<ReviewScene> {
/*
* 获取所有场景列表
* */
List<GetSceneListResponse> getSceneListById(Long id);
List<GetSceneListResponse> getSceneListById(Long id,String text);
}
......@@ -126,7 +126,7 @@ public interface ReviewStandardService extends IService<ReviewStandard> {
/*
* 新增细则按钮
* */
List<AddDetailsResponse> getKeypointListByIds(List<Long> idList);
List<AddDetailsResponse> getKeypointListByIds(List<Long> idList,String text);
/*
* 删除细则按钮
......@@ -134,6 +134,8 @@ public interface ReviewStandardService extends IService<ReviewStandard> {
List<Long> getDetailsIdList(DeleteDetailsRequest deleteDetailsRequest);
ReviewStandardListNewResponse getListAll(String standardId);
/*
* 新增细则按钮2
* */
List<AddDetailsResponse> getKeypointListNew(GetKeypointListRequest getKeypointListRequest);
}
......@@ -4,9 +4,11 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.domain.ReviewDetails;
import com.ruoyi.domain.ReviewKeyPoint;
import com.ruoyi.mapper.ReviewDetailsMapper;
import com.ruoyi.mapper.ReviewKeyPointMapper;
import com.ruoyi.mapper.ReviewStandardMapper;
import com.ruoyi.service.ReviewDetailsService;
import com.ruoyi.web.request.DeleteDetailsRequest;
import com.ruoyi.web.request.GetKeypointListRequest;
import com.ruoyi.web.response.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -25,6 +27,9 @@ public class ReviewDetailsServiceImpl extends ServiceImpl<ReviewDetailsMapper, R
@Autowired
private ReviewStandardMapper reviewStandardMapper;
@Autowired
private ReviewKeyPointMapper reviewKeyPointMapper;
@Override
public List<ReviewDetails> findByKeyPointsList(List<ReviewKeyPoint> reviewKeyPointList) {
return reviewDetailsMapper.findByKeyPointList(reviewKeyPointList);
......@@ -38,8 +43,9 @@ public class ReviewDetailsServiceImpl extends ServiceImpl<ReviewDetailsMapper, R
// 获取所有要点ID列表
List<Long> idList = reviewStandardMapper.getDelKeypointIdList(deleteDetailsRequest);
String s = "";
// 获取所有的细则列表
List<KeypointList> keypointLists = reviewStandardMapper.getKeypointListByIdList(idList);
List<KeypointList> keypointLists = reviewStandardMapper.getKeypointListByIdList(idList,s);
// 将要点列表按reviewStandardId分组
Map<String, List<KeypointList>> groupKeypoint = keypointLists.stream()
......@@ -87,4 +93,22 @@ public class ReviewDetailsServiceImpl extends ServiceImpl<ReviewDetailsMapper, R
return deleteDetailsResponseList;
}
/*
* 删除细则按钮2
* */
@Override
public List<DeleteDetailsResponse> selectDetailsList(DeleteDetailsRequest deleteDetailsRequest) {
List<DeleteDetailsResponse> deleteDetailsResponseList = reviewStandardMapper.selectStandardList(deleteDetailsRequest);
for (DeleteDetailsResponse deleteDetailsResponse : deleteDetailsResponseList){
Long id = Long.parseLong(deleteDetailsResponse.getId());
List<DeleteDetailsList> deleteDetailsLists = reviewKeyPointMapper.selectKeypointListNew(id);
for (DeleteDetailsList deleteDetailsList : deleteDetailsLists){
Long keypointId = Long.parseLong(deleteDetailsList.getId());
List<DeleteDetails> deleteDetails = reviewDetailsMapper.selectDetailsList(keypointId,deleteDetailsRequest.getText());
deleteDetailsList.setDeleteDetailsList(deleteDetails);
}
deleteDetailsResponse.setDeleteDetailsLists(deleteDetailsLists);
}
return deleteDetailsResponseList;
}
}
......@@ -14,6 +14,7 @@ import com.ruoyi.domain.ReviewSceneChangeTaskUserRelation;
import com.ruoyi.domain.Standard;
import com.ruoyi.framework.web.domain.server.Sys;
import com.ruoyi.mapper.ReviewKeyPointMapper;
import com.ruoyi.mapper.ReviewSceneChangeTaskUserRelationMapper;
import com.ruoyi.mapper.StandardMapper;
import com.ruoyi.service.*;
import com.ruoyi.mapper.ReviewSceneChangeTaskMapper;
......@@ -70,6 +71,9 @@ public class ReviewSceneChangeTaskServiceImpl extends ServiceImpl<ReviewSceneCha
@Autowired
private StandardMapper standardMapper;
@Autowired
ReviewSceneChangeTaskUserRelationMapper reviewSceneChangeTaskUserRelationMapper;
@Override
public void create(ReviewSceneChangeTask reviewSceneChangeTask) throws IOException {
......@@ -620,8 +624,11 @@ public class ReviewSceneChangeTaskServiceImpl extends ServiceImpl<ReviewSceneCha
@Override
public void cancel(ReviewSceneChangeTaskCancelRequest request) {
ReviewSceneChangeTask task = getById(request.getId());
task.setTaskResult(null);
task.setTaskStatus(ReviewSceneChangeTask.STATUS_CLOSE);
updateById(task);
System.out.println(task+"==========");
reviewSceneChangeTaskMapper.updateByIdNew(task);
}
}
......
......@@ -53,8 +53,8 @@ public class ReviewSceneServiceImpl extends ServiceImpl<ReviewSceneMapper, Revie
* 获取所有场景列表
* */
@Override
public List<GetSceneListResponse> getSceneListById(Long id) {
return reviewSceneMapper.getSceneListById(id);
public List<GetSceneListResponse> getSceneListById(Long id,String text) {
return reviewSceneMapper.getSceneListById(id,text);
}
}
......@@ -639,9 +639,9 @@ public class ReviewStandardServiceImpl extends ServiceImpl<ReviewStandardMapper,
}
@Override
public List<AddDetailsResponse> getKeypointListByIds(List<Long> idList) {
public List<AddDetailsResponse> getKeypointListByIds(List<Long> idList ,String text) {
//获取所有要点
List<KeypointList> keypointLists = reviewStandardMapper.getKeypointListByIdList(idList);
List<KeypointList> keypointLists = reviewStandardMapper.getKeypointListByIdList(idList,text);
//按reviewStandard 分组
Map<String,List<KeypointList>> groupKeypoint = keypointLists.stream()
......@@ -706,7 +706,16 @@ public class ReviewStandardServiceImpl extends ServiceImpl<ReviewStandardMapper,
return response;
}
@Override
public List<AddDetailsResponse> getKeypointListNew(GetKeypointListRequest getKeypointListRequest) {
List<AddDetailsResponse> addDetailsResponseList = reviewStandardMapper.getKeypointList(getKeypointListRequest);
for (AddDetailsResponse addDetailsResponse : addDetailsResponseList){
Long id = Long.parseLong(addDetailsResponse.getId());
List<KeypointList> keypointListList = reviewKeyPointMapper.selectKeypointList(id,getKeypointListRequest.getText());
addDetailsResponse.setKeypointList(keypointListList);
}
return addDetailsResponseList;
}
}
......@@ -256,7 +256,20 @@ public class ReviewSceneChangeTaskController extends BaseController {
@RequestMapping(method = RequestMethod.POST, value = "/getKeypointListAll")
public R<List<AddDetailsResponse>> getDetailsListNew(@RequestBody GetKeypointListRequest getKeypointListRequest){
List<Long> idList = reviewStandardService.getKeypointIdList(getKeypointListRequest);
List<AddDetailsResponse> addDetailsResponseList = reviewStandardService.getKeypointListByIds(idList);
List<AddDetailsResponse> addDetailsResponseList = reviewStandardService.getKeypointListByIds(idList,getKeypointListRequest.getText());
return R.ok(addDetailsResponseList);
}
/*
* 新增细则按钮2
* */
@ApiOperation("新增细则按钮")
@Trace
@Tags({@Tag(key = "param", value = "arg[0]"), @Tag(key = "result", value = "returnedObj")})
@Log(title = "新增细则按钮", businessType = BusinessType.UPDATE)
@RequestMapping(method = RequestMethod.POST, value = "/getKeypointListAllNew")
public R<List<AddDetailsResponse>> getKeypointListAllNew(@RequestBody GetKeypointListRequest getKeypointListRequest){
List<AddDetailsResponse> addDetailsResponseList = reviewStandardService.getKeypointListNew(getKeypointListRequest);
return R.ok(addDetailsResponseList);
}
......@@ -273,6 +286,19 @@ public class ReviewSceneChangeTaskController extends BaseController {
return R.ok(responseList);
}
/*
* 删除细则按钮2
* */
@ApiOperation("删除细则按钮")
@Trace
@Tags({@Tag(key = "param", value = "arg[0]"), @Tag(key = "result", value = "returnedObj")})
@Log(title = "删除细则按钮", businessType = BusinessType.UPDATE)
@RequestMapping(method = RequestMethod.POST, value = "/deleteKeypointListAllNew")
public R<List<DeleteDetailsResponse>> deleteKeypointListAllNew(@RequestBody DeleteDetailsRequest deleteDetailsRequest){
List<DeleteDetailsResponse> responseList = reviewDetailsService.selectDetailsList(deleteDetailsRequest);
return R.ok(responseList);
}
/*
* 获取所有场景列表
* */
......@@ -283,7 +309,7 @@ public class ReviewSceneChangeTaskController extends BaseController {
@RequestMapping(method = RequestMethod.POST, value = "/getSceneListAll")
public R<List<GetSceneListResponse>> getSceneListAll(@RequestBody GetSceneListRequest getSceneListRequest){
Long id = Long.parseLong(getSceneListRequest.getDetailsId());
List<GetSceneListResponse> getSceneListResponses = reviewSceneService.getSceneListById(id);
List<GetSceneListResponse> getSceneListResponses = reviewSceneService.getSceneListById(id,getSceneListRequest.getText());
return R.ok(getSceneListResponses);
}
......
......@@ -11,4 +11,5 @@ public class DeleteDetailsRequest {
private String standardNo;
private String type;
private String text;
}
......@@ -11,4 +11,6 @@ public class GetKeypointListRequest {
private String standardNo;
private String type;
private String text;
}
......@@ -10,4 +10,6 @@ public class GetSceneListRequest {
@ApiModelProperty("细则id")
private String detailsId;
private String text;
}
......@@ -86,4 +86,12 @@
<select id="selectDetailsListByKeypointId" resultType="com.ruoyi.domain.ReviewDetails">
select * from t_review_details where review_keypoint_id = #{keypointId}
</select>
<select id="selectDetailsList" resultType="com.ruoyi.web.response.DeleteDetails">
select *
from t_review_details
where review_keypoint_id = #{keypointId}
<if test="text !=null and text != ''">
and t_review_details.text like concat('%',#{text},'%')
</if>
</select>
</mapper>
......@@ -42,5 +42,18 @@
from t_review_keypoint
where id = #{id}
</select>
<select id="selectKeypointList" resultType="com.ruoyi.web.response.KeypointList">
select id,text,review_standard_id
from t_review_keypoint
where review_standard_id = #{id}
<if test="text != null and text != ''">
and t_review_keypoint.text like concat('%', #{text}, '%')
</if>
</select>
<select id="selectKeypointListNew" resultType="com.ruoyi.web.response.DeleteDetailsList">
select *
from t_review_keypoint
where review_standard_id = #{id}
</select>
</mapper>
......@@ -50,6 +50,12 @@
<result property="inspectStandardNo" column="inspect_standard_no" jdbcType="VARCHAR"/>
<result property="innovationBaseResult" column="innovation_base_result" jdbcType="VARCHAR"/>
</resultMap>
<update id="updateByIdNew">
update t_review_scene_change_task
set task_status = #{task.taskStatus},
task_result = #{task.taskResult}
where id = #{task.id}
</update>
<select id="findLastChangeByTaskId" resultType="com.ruoyi.domain.ReviewSceneChangeTask">
SELECT * FROM t_review_scene_change_task WHERE id IN
......
......@@ -30,6 +30,9 @@
select id,text,review_details_id
from t_review_scene
where review_details_id = #{id}
<if test="text != null and text != ''">
and text like concat('%', #{text}, '%')
</if>
</select>
<select id="selectSceneListByDetailsId" resultType="com.ruoyi.domain.ReviewScene">
select * from t_review_scene where review_details_id = #{detailsId}
......
......@@ -158,13 +158,17 @@
</select>
<select id="getKeypointListByIdList" resultType="com.ruoyi.web.response.KeypointList">
select
id,text,review_standard_id
id, text, review_standard_id
from t_review_keypoint
where t_review_keypoint.review_standard_id IN
<foreach item="id" collection="idList" open="(" separator="," close=")">
#{id}
</foreach>
<if test="text != null and text != ''">
and t_review_keypoint.text like concat('%', #{text}, '%')
</if>
</select>
<select id="getDetailsIdList" resultType="java.lang.Long">
select review_keypoint_id
from t_review_details
......@@ -184,6 +188,10 @@
select id,standard_id,standard_no,text,chapter
from t_review_standard
where id = #{key}
order by
CAST(SUBSTRING_INDEX(chapter, '.', 1) AS UNSIGNED) ASC, -- 第一层数字
CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(chapter, '.', 2), '.', -1) AS UNSIGNED) ASC, -- 第二层数字
CAST(SUBSTRING_INDEX(chapter, '.', -1) AS UNSIGNED) ASC -- 第三层数字(如果有)
</select>
<select id="findTypeByStandardNew" resultType="com.ruoyi.web.response.StandardTypeListResponse">
SELECT DISTINCT type
......@@ -214,6 +222,16 @@
<select id="selectReviewStandardListByCarType" resultType="com.ruoyi.web.response.ReviewStandardResponse">
select * from t_review_standard where type = 'car'
</select>
<select id="getKeypointList" resultType="com.ruoyi.web.response.AddDetailsResponse">
select id,text,chapter,standard_id,standard_no
from t_review_standard
where standard_id = #{getKeypointListRequest.standardId} and standard_no = #{getKeypointListRequest.standardNo} and type = #{getKeypointListRequest.type}
</select>
<select id="selectStandardList" resultType="com.ruoyi.web.response.DeleteDetailsResponse">
select id,text,chapter,standard_id,standard_no
from t_review_standard
where standard_id = #{deleteDetailsRequest.standardId} and standard_no = #{deleteDetailsRequest.standardNo} and type = #{deleteDetailsRequest.type}
</select>
</mapper>
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