Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
car-database-api
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
中汽研标准应用数据库
car-database-api
Commits
71418e09
Commit
71418e09
authored
Sep 02, 2024
by
宋源硕
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'songyuanshuo' into 'master'
标准内容库添加接口/getReviewStandardList 用于获取数据 See merge request
!1
parents
1a8c04b5
860507cf
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
172 additions
and
14 deletions
+172
-14
ReviewStandardMapper.java
.../src/main/java/com/ruoyi/mapper/ReviewStandardMapper.java
+12
-3
ReviewStandardService.java
...rc/main/java/com/ruoyi/service/ReviewStandardService.java
+6
-4
ReviewStandardServiceImpl.java
...ava/com/ruoyi/service/impl/ReviewStandardServiceImpl.java
+32
-7
ReviewStandardController.java
...src/main/java/com/ruoyi/web/ReviewStandardController.java
+11
-0
StandardListNewRequest.java
...in/java/com/ruoyi/web/request/StandardListNewRequest.java
+45
-0
ReviewStandardChapterListResponse.java
...ruoyi/web/response/ReviewStandardChapterListResponse.java
+21
-0
ReviewStandardListNewResponse.java
...com/ruoyi/web/response/ReviewStandardListNewResponse.java
+15
-0
StandardTypeListResponse.java
...java/com/ruoyi/web/response/StandardTypeListResponse.java
+17
-0
ReviewStandardMapper.xml
...review/src/main/resources/mapper/ReviewStandardMapper.xml
+13
-0
No files found.
quality-review/src/main/java/com/ruoyi/mapper/ReviewStandardMapper.java
View file @
71418e09
...
@@ -6,9 +6,8 @@ import com.ruoyi.domain.ReviewStandard;
...
@@ -6,9 +6,8 @@ import com.ruoyi.domain.ReviewStandard;
import
com.ruoyi.web.request.ReviewFindListRequest
;
import
com.ruoyi.web.request.ReviewFindListRequest
;
import
com.ruoyi.web.request.ReviewStandardListByPageRequest
;
import
com.ruoyi.web.request.ReviewStandardListByPageRequest
;
import
com.ruoyi.web.request.ReviewStandardListRequest
;
import
com.ruoyi.web.request.ReviewStandardListRequest
;
import
com.ruoyi.web.response.ReviewStandardListResponse
;
import
com.ruoyi.web.request.StandardListNewRequest
;
import
com.ruoyi.web.response.ReviewStandardResponse
;
import
com.ruoyi.web.response.*
;
import
com.ruoyi.web.response.ReviewStandardTestInspectionContentResponse
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Param
;
import
org.springframework.stereotype.Repository
;
import
org.springframework.stereotype.Repository
;
...
@@ -39,4 +38,14 @@ public interface ReviewStandardMapper extends BaseMapper<ReviewStandard> {
...
@@ -39,4 +38,14 @@ public interface ReviewStandardMapper extends BaseMapper<ReviewStandard> {
// 根据要点列表查询标准列表
// 根据要点列表查询标准列表
List
<
ReviewStandard
>
findByKeyPointList
(
@Param
(
"keyPointList"
)
List
<
ReviewKeyPoint
>
keyPointList
,
@Param
(
"request"
)
ReviewFindListRequest
request
);
List
<
ReviewStandard
>
findByKeyPointList
(
@Param
(
"keyPointList"
)
List
<
ReviewKeyPoint
>
keyPointList
,
@Param
(
"request"
)
ReviewFindListRequest
request
);
/*
* 标准内容库新界面接口
* */
List
<
StandardTypeListResponse
>
findTypeByStandard
(
@Param
(
"request"
)
StandardListNewRequest
request
);
/*
* 标准内容库新界面接口
* */
List
<
ReviewStandardChapterListResponse
>
findChaptersByStandard
(
@Param
(
"request"
)
StandardListNewRequest
request
);
}
}
quality-review/src/main/java/com/ruoyi/service/ReviewStandardService.java
View file @
71418e09
...
@@ -2,10 +2,7 @@ package com.ruoyi.service;
...
@@ -2,10 +2,7 @@ package com.ruoyi.service;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.ruoyi.domain.ReviewStandard
;
import
com.ruoyi.domain.ReviewStandard
;
import
com.ruoyi.web.request.ReviewFindListRequest
;
import
com.ruoyi.web.request.*
;
import
com.ruoyi.web.request.ReviewStandardListByPageRequest
;
import
com.ruoyi.web.request.ReviewStandardListRequest
;
import
com.ruoyi.web.request.ReviewStandardSaveStandardUsecaseRequest
;
import
com.ruoyi.web.response.*
;
import
com.ruoyi.web.response.*
;
import
java.io.IOException
;
import
java.io.IOException
;
...
@@ -85,4 +82,9 @@ public interface ReviewStandardService extends IService<ReviewStandard> {
...
@@ -85,4 +82,9 @@ public interface ReviewStandardService extends IService<ReviewStandard> {
* @return
* @return
*/
*/
List
<
UseCaseListResponse
>
getUseCaseList
(
String
request
)
throws
IOException
;
List
<
UseCaseListResponse
>
getUseCaseList
(
String
request
)
throws
IOException
;
/*
* 标准内容库新界面接口
* */
ReviewStandardListNewResponse
getListNew
(
StandardListNewRequest
request
);
}
}
quality-review/src/main/java/com/ruoyi/service/impl/ReviewStandardServiceImpl.java
View file @
71418e09
...
@@ -12,10 +12,7 @@ import com.ruoyi.domain.vo.OptionalUseCasesVO;
...
@@ -12,10 +12,7 @@ import com.ruoyi.domain.vo.OptionalUseCasesVO;
import
com.ruoyi.domain.vo.UseCaseUrlVO
;
import
com.ruoyi.domain.vo.UseCaseUrlVO
;
import
com.ruoyi.mapper.*
;
import
com.ruoyi.mapper.*
;
import
com.ruoyi.service.*
;
import
com.ruoyi.service.*
;
import
com.ruoyi.web.request.ReviewFindListRequest
;
import
com.ruoyi.web.request.*
;
import
com.ruoyi.web.request.ReviewStandardListByPageRequest
;
import
com.ruoyi.web.request.ReviewStandardListRequest
;
import
com.ruoyi.web.request.ReviewStandardSaveStandardUsecaseRequest
;
import
com.ruoyi.web.response.*
;
import
com.ruoyi.web.response.*
;
import
okhttp3.*
;
import
okhttp3.*
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -23,9 +20,7 @@ import org.springframework.stereotype.Service;
...
@@ -23,9 +20,7 @@ import org.springframework.stereotype.Service;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.util.ArrayList
;
import
java.util.*
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
@Transactional
@Transactional
...
@@ -458,5 +453,35 @@ public class ReviewStandardServiceImpl extends ServiceImpl<ReviewStandardMapper,
...
@@ -458,5 +453,35 @@ public class ReviewStandardServiceImpl extends ServiceImpl<ReviewStandardMapper,
return
reviewStandardList
;
return
reviewStandardList
;
}
}
/*
* 标准内容库新界面接口
* */
@Override
public
ReviewStandardListNewResponse
getListNew
(
StandardListNewRequest
request
)
{
// 获取标准类型列表
List
<
StandardTypeListResponse
>
typeListResponses
=
reviewStandardMapper
.
findTypeByStandard
(
request
);
// 获取章节列表
List
<
ReviewStandardChapterListResponse
>
chapterList
=
reviewStandardMapper
.
findChaptersByStandard
(
request
);
// 去重类型列表,并为每种类型分配章节列表
Set
<
String
>
uniqueTypes
=
new
HashSet
<>();
List
<
StandardTypeListResponse
>
uniqueTypeList
=
typeListResponses
.
stream
()
.
filter
(
type
->
uniqueTypes
.
add
(
type
.
getType
()))
// 去重 type
.
peek
(
type
->
{
// 过滤并设置对应的章节列表
List
<
ReviewStandardChapterListResponse
>
filteredChapters
=
chapterList
.
stream
()
.
filter
(
chapter
->
chapter
.
getType
().
equals
(
type
.
getType
()))
// 这里使用 getType 方法
.
collect
(
Collectors
.
toList
());
type
.
setReviewStandardChapterListResponses
(
filteredChapters
);
})
.
collect
(
Collectors
.
toList
());
// 构建响应对象
ReviewStandardListNewResponse
response
=
new
ReviewStandardListNewResponse
();
response
.
setTypeList
(
uniqueTypeList
);
return
response
;
}
}
}
quality-review/src/main/java/com/ruoyi/web/ReviewStandardController.java
View file @
71418e09
...
@@ -152,4 +152,15 @@ public class ReviewStandardController extends BaseController {
...
@@ -152,4 +152,15 @@ public class ReviewStandardController extends BaseController {
return
getDataTable
(
reviewStandardService
.
getUseCaseList
(
request
));
return
getDataTable
(
reviewStandardService
.
getUseCaseList
(
request
));
}
}
/*
* 标准内容库新界面接口
* */
@ApiOperation
(
"标准内容库新界面接口"
)
@Trace
@Tags
({
@Tag
(
key
=
"param"
,
value
=
"arg[0]"
),
@Tag
(
key
=
"result"
,
value
=
"returnedObj"
)})
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/getReviewStandardList"
,
produces
=
"application/json;charset=UTF-8"
)
public
R
<
ReviewStandardListNewResponse
>
getReviewStandardList
(
@RequestBody
StandardListNewRequest
request
){
ReviewStandardListNewResponse
response
=
reviewStandardService
.
getListNew
(
request
);
return
R
.
ok
(
response
);
}
}
}
quality-review/src/main/java/com/ruoyi/web/request/StandardListNewRequest.java
0 → 100644
View file @
71418e09
package
com
.
ruoyi
.
web
.
request
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
@ApiModel
(
value
=
"StandardListNewRequest"
,
description
=
"标准内容库新界面接口"
)
public
class
StandardListNewRequest
{
@ApiModelProperty
(
"标准id"
)
private
String
standardId
;
@ApiModelProperty
(
"标准编号"
)
private
String
standardNo
;
public
String
getStandardId
()
{
return
standardId
;
}
public
void
setStandardId
(
String
standardId
)
{
this
.
standardId
=
standardId
;
}
public
String
getStandardNo
()
{
return
standardNo
;
}
public
void
setStandardNo
(
String
standardNo
)
{
this
.
standardNo
=
standardNo
;
}
public
StandardListNewRequest
()
{
}
public
StandardListNewRequest
(
String
standardId
,
String
standardNo
)
{
this
.
standardId
=
standardId
;
this
.
standardNo
=
standardNo
;
}
@Override
public
String
toString
()
{
return
"StandardListNewRequest{"
+
"standardId='"
+
standardId
+
'\''
+
", standardNo='"
+
standardNo
+
'\''
+
'}'
;
}
}
quality-review/src/main/java/com/ruoyi/web/response/ReviewStandardChapterListResponse.java
0 → 100644
View file @
71418e09
package
com
.
ruoyi
.
web
.
response
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
@Data
@ApiModel
(
value
=
"ReviewStandardChapterListResponse"
,
description
=
"标准内容库新界面接口"
)
public
class
ReviewStandardChapterListResponse
{
@ApiModelProperty
(
"标准号id"
)
private
String
standardId
;
@ApiModelProperty
(
"章节"
)
private
String
chapter
;
@ApiModelProperty
(
"章节内容"
)
private
String
text
;
@ApiModelProperty
(
"标准分类"
)
private
String
type
;
}
quality-review/src/main/java/com/ruoyi/web/response/ReviewStandardListNewResponse.java
0 → 100644
View file @
71418e09
package
com
.
ruoyi
.
web
.
response
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.util.List
;
@Data
@ApiModel
(
value
=
"ReviewStandardListNewResponse"
,
description
=
"标准内容库新界面接口"
)
public
class
ReviewStandardListNewResponse
{
@ApiModelProperty
(
"标准分类集合"
)
private
List
<
StandardTypeListResponse
>
typeList
;
}
quality-review/src/main/java/com/ruoyi/web/response/StandardTypeListResponse.java
0 → 100644
View file @
71418e09
package
com
.
ruoyi
.
web
.
response
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.util.List
;
@Data
@ApiModel
(
value
=
"StandardTypeList"
,
description
=
"标准内容库新界面接口"
)
public
class
StandardTypeListResponse
{
@ApiModelProperty
(
"标准分类"
)
private
String
type
;
@ApiModelProperty
(
"章节集合"
)
private
List
<
ReviewStandardChapterListResponse
>
reviewStandardChapterListResponses
;
}
quality-review/src/main/resources/mapper/ReviewStandardMapper.xml
View file @
71418e09
...
@@ -98,6 +98,19 @@
...
@@ -98,6 +98,19 @@
and type = #{request.type}
and type = #{request.type}
</select>
</select>
<select
id=
"findTypeByStandard"
resultType=
"com.ruoyi.web.response.StandardTypeListResponse"
>
SELECT DISTINCT type
FROM t_review_standard
WHERE standard_no = #{request.standardNo}
AND standard_id = #{request.standardId}
</select>
<select
id=
"findChaptersByStandard"
resultType=
"com.ruoyi.web.response.ReviewStandardChapterListResponse"
>
SELECT chapter, text, type ,standard_id as standardId
<!-- 添加 type 字段 -->
FROM t_review_standard
WHERE standard_no = #{request.standardNo}
AND standard_id = #{request.standardId}
</select>
</mapper>
</mapper>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment