Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vehicle-quality-review
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
王飞
vehicle-quality-review
Commits
419b11fe
Commit
419b11fe
authored
Feb 22, 2024
by
高滢
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
样品分页查询 联查任务
parent
d13cedd8
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
80 additions
and
11 deletions
+80
-11
Sample.java
quality-review/src/main/java/com/ruoyi/domain/Sample.java
+4
-0
SampleTaskVo.java
...eview/src/main/java/com/ruoyi/domain/vo/SampleTaskVo.java
+18
-0
TaskSampleRelationMapper.java
.../main/java/com/ruoyi/mapper/TaskSampleRelationMapper.java
+6
-0
SampleManagementServiceImpl.java
...a/com/ruoyi/service/impl/SampleManagementServiceImpl.java
+28
-1
SampleManagementController.java
...c/main/java/com/ruoyi/web/SampleManagementController.java
+3
-2
TestScenarioController.java
...w/src/main/java/com/ruoyi/web/TestScenarioController.java
+1
-1
TestTypeController.java
...eview/src/main/java/com/ruoyi/web/TestTypeController.java
+7
-7
TaskSampleRelationMapper.xml
...ew/src/main/resources/mapper/TaskSampleRelationMapper.xml
+13
-0
No files found.
quality-review/src/main/java/com/ruoyi/domain/Sample.java
View file @
419b11fe
package
com
.
ruoyi
.
domain
;
import
java.util.Date
;
import
java.util.List
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.ruoyi.common.core.domain.BaseEntity
;
import
com.ruoyi.domain.vo.SampleTaskVo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
...
...
@@ -93,4 +95,6 @@ public class Sample extends BaseEntity
/** 车企名称 */
@ApiModelProperty
(
"车企名称"
)
private
String
carCompanyName
;
private
List
<
SampleTaskVo
>
taskSampleRelation
;
}
quality-review/src/main/java/com/ruoyi/domain/vo/SampleTaskVo.java
0 → 100644
View file @
419b11fe
package
com
.
ruoyi
.
domain
.
vo
;
import
io.swagger.annotations.ApiModel
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.util.List
;
@ApiModel
(
description
=
"样品任务联查字段"
)
@AllArgsConstructor
@NoArgsConstructor
@Data
public
class
SampleTaskVo
{
private
Long
taskId
;
private
Long
SampleId
;
private
String
taskName
;
}
quality-review/src/main/java/com/ruoyi/mapper/TaskSampleRelationMapper.java
View file @
419b11fe
...
...
@@ -2,6 +2,7 @@ package com.ruoyi.mapper;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.ruoyi.domain.TaskSampleRelation
;
import
com.ruoyi.domain.vo.SampleTaskVo
;
import
org.apache.ibatis.annotations.Param
;
import
org.springframework.stereotype.Repository
;
...
...
@@ -16,4 +17,9 @@ public interface TaskSampleRelationMapper extends BaseMapper<TaskSampleRelation>
* @return
*/
List
<
TaskSampleRelation
>
selectByTaskId
(
@Param
(
"taskId"
)
Long
taskId
,
@Param
(
"flag"
)
String
flag
);
/**
* 根据样品id查询*/
List
<
SampleTaskVo
>
selectTaskBysampleId
(
@Param
(
"idList"
)
List
<
Long
>
idList
);
}
quality-review/src/main/java/com/ruoyi/service/impl/SampleManagementServiceImpl.java
View file @
419b11fe
package
com
.
ruoyi
.
service
.
impl
;
import
java.util.ArrayList
;
import
java.util.List
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
...
...
@@ -7,7 +8,9 @@ import com.ruoyi.common.exception.ServiceException;
import
com.ruoyi.common.utils.DateUtils
;
import
com.ruoyi.common.utils.SecurityUtils
;
import
com.ruoyi.domain.Sample
;
import
com.ruoyi.domain.vo.SampleTaskVo
;
import
com.ruoyi.mapper.SampleManagementMapper
;
import
com.ruoyi.mapper.TaskSampleRelationMapper
;
import
com.ruoyi.service.SampleManagementService
;
import
com.ruoyi.web.request.SampleManagementRequest
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -27,6 +30,9 @@ public class SampleManagementServiceImpl extends ServiceImpl<SampleManagementMap
@Autowired
private
SampleManagementMapper
sampleManagementMapper
;
@Autowired
private
TaskSampleRelationMapper
taskSampleRelationMapper
;
/**
* 查询样品管理
*
...
...
@@ -48,7 +54,11 @@ public class SampleManagementServiceImpl extends ServiceImpl<SampleManagementMap
@Override
public
List
<
Sample
>
selectSampleManagementList
(
SampleManagementRequest
sampleManagementRequest
)
{
return
sampleManagementMapper
.
selectSampleManagementList
(
sampleManagementRequest
);
List
<
Sample
>
list
=
sampleManagementMapper
.
selectSampleManagementList
(
sampleManagementRequest
);
if
(
list
.
size
()>
0
){
setSampleTask
(
list
);
}
return
list
;
}
/**
...
...
@@ -106,4 +116,21 @@ public class SampleManagementServiceImpl extends ServiceImpl<SampleManagementMap
public
List
<
Sample
>
selectSampleList
(
SampleManagementRequest
sampleManagementRequest
){
return
sampleManagementMapper
.
selectSampleList
(
sampleManagementRequest
);
}
public
void
setSampleTask
(
List
<
Sample
>
sampleList
){
List
<
Long
>
listId
=
new
ArrayList
<>();
for
(
Sample
sample
:
sampleList
){
listId
.
add
(
sample
.
getId
());
}
List
<
SampleTaskVo
>
sampleTaskVoList
=
taskSampleRelationMapper
.
selectTaskBysampleId
(
listId
);
for
(
Sample
sample
:
sampleList
){
List
<
SampleTaskVo
>
sampleTaskVos
=
new
ArrayList
<>();
for
(
SampleTaskVo
sampleTaskVo
:
sampleTaskVoList
){
if
(
sampleTaskVo
.
getSampleId
().
equals
(
sample
.
getId
())){
sampleTaskVos
.
add
(
sampleTaskVo
);
}
}
sample
.
setTaskSampleRelation
(
sampleTaskVos
);
}
}
}
quality-review/src/main/java/com/ruoyi/web/SampleManagementController.java
View file @
419b11fe
...
...
@@ -42,11 +42,12 @@ public class SampleManagementController extends BaseController
@Trace
@Tags
({
@Tag
(
key
=
"param"
,
value
=
"arg[0]"
),
@Tag
(
key
=
"result"
,
value
=
"returnedObj"
)})
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/list"
)
public
TableDataInfo
list
(
@Validated
@RequestBody
SampleManagementRequest
request
)
public
TableDataInfo
<
Sample
>
list
(
@Validated
@RequestBody
SampleManagementRequest
request
)
{
startPage
();
startPage
(
request
);
List
<
Sample
>
list
=
sampleManagementService
.
selectSampleManagementList
(
request
);
return
getDataTable
(
list
);
}
/**
...
...
quality-review/src/main/java/com/ruoyi/web/TestScenarioController.java
View file @
419b11fe
...
...
@@ -37,7 +37,7 @@ public class TestScenarioController extends BaseController {
@Trace
@Tags
({
@Tag
(
key
=
"param"
,
value
=
"arg[0]"
),
@Tag
(
key
=
"result"
,
value
=
"returnedObj"
)})
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/getList"
)
public
TableDataInfo
<
TestScenario
>
list
(
@Validated
TestScenarioRequest
testScenarioRequest
){
public
TableDataInfo
<
TestScenario
>
list
(
@Validated
@RequestBody
TestScenarioRequest
testScenarioRequest
){
startPage
(
testScenarioRequest
);
List
<
TestScenario
>
list
=
testScenarioService
.
selectTestScenarioList
(
testScenarioRequest
);
return
getDataTable
(
list
);
...
...
quality-review/src/main/java/com/ruoyi/web/TestTypeController.java
View file @
419b11fe
...
...
@@ -3,11 +3,10 @@ package com.ruoyi.web;
import
com.ruoyi.common.core.controller.BaseController
;
import
com.ruoyi.common.core.domain.R
;
import
com.ruoyi.common.core.page.TableDataInfo
;
import
com.ruoyi.domain.TestScenario
;
import
com.ruoyi.domain.TestType
;
import
com.ruoyi.service.ITestTypeService
;
import
com.ruoyi.web.request.TestScenarioRequest
;
import
com.ruoyi.web.request.TestTypeRequest
;
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
;
...
...
@@ -21,6 +20,7 @@ import org.springframework.web.bind.annotation.RestController;
import
java.util.List
;
@Api
(
tags
=
"测试类型"
)
@RestController
@RequestMapping
(
"/system/type"
)
public
class
TestTypeController
extends
BaseController
{
...
...
@@ -28,22 +28,22 @@ public class TestTypeController extends BaseController {
private
ITestTypeService
testTypeService
;
/**
*
测试场景
分页
*
查询测试类型
分页
*/
@ApiOperation
(
"查询测试
场景
分页查询"
)
@ApiOperation
(
"查询测试
类型
分页查询"
)
@Trace
@Tags
({
@Tag
(
key
=
"param"
,
value
=
"arg[0]"
),
@Tag
(
key
=
"result"
,
value
=
"returnedObj"
)})
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/getList"
)
public
TableDataInfo
<
TestType
>
list
(
@Validated
TestTypeRequest
testTypeRequest
){
public
TableDataInfo
<
TestType
>
list
(
@Validated
@RequestBody
TestTypeRequest
testTypeRequest
){
startPage
(
testTypeRequest
);
List
<
TestType
>
list
=
testTypeService
.
selectTestTypeList
(
testTypeRequest
);
return
getDataTable
(
list
);
}
/**
*
测试场景
列表不分页
*
查询测试类型
列表不分页
*/
@ApiOperation
(
"查询测试
场景
"
)
@ApiOperation
(
"查询测试
类型
"
)
@Trace
@Tags
({
@Tag
(
key
=
"param"
,
value
=
"arg[0]"
),
@Tag
(
key
=
"result"
,
value
=
"returnedObj"
)})
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/getListAll"
)
...
...
quality-review/src/main/resources/mapper/TaskSampleRelationMapper.xml
View file @
419b11fe
...
...
@@ -25,4 +25,17 @@
</if>
</select>
<select
id=
"selectTaskBysampleId"
resultType=
"com.ruoyi.domain.vo.SampleTaskVo"
>
SELECT
relation.sample_id,
relation.task_id,
task.NAME As taskName
FROM
t_task_sample_relation relation
LEFT JOIN t_task task ON task.id = relation.task_id
WHERE relation.sample_id IN
<foreach
item=
"id"
collection=
"idList"
open=
"("
separator=
","
close=
")"
>
#{id}
</foreach>
</select>
</mapper>
\ No newline at end of file
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