测试报告倒序及分页修复
This commit is contained in:
@@ -12,7 +12,7 @@ import com.test.test.service.ITestReportService;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
@@ -37,7 +37,7 @@ public class TestReportController extends BaseController {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@PostMapping("/reportList")
|
@PostMapping("/reportList")
|
||||||
public TableDataInfo list(@RequestBody IDQO qo) {
|
public TableDataInfo list(@Validated IDQO qo) {
|
||||||
startPage();
|
startPage();
|
||||||
List<TestReportVo> list = testReportService.selectTestReportList(qo.getId());
|
List<TestReportVo> list = testReportService.selectTestReportList(qo.getId());
|
||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
|
|||||||
@@ -3,6 +3,6 @@ package com.test.test.domain.qo;
|
|||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
public class IDQO {
|
public class IDQO extends InheritQO{
|
||||||
private Long id;
|
private Long id;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,14 @@
|
|||||||
|
package com.test.test.domain.qo;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class InheritQO implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = -6405523005491017445L;
|
||||||
|
|
||||||
|
private Integer pageNum;
|
||||||
|
|
||||||
|
private Integer pageSize;
|
||||||
|
}
|
||||||
@@ -43,5 +43,6 @@
|
|||||||
LEFT JOIN test_report tr ON tr.id = tpr.report_id
|
LEFT JOIN test_report tr ON tr.id = tpr.report_id
|
||||||
WHERE tpr.plan_id = #{planId}
|
WHERE tpr.plan_id = #{planId}
|
||||||
AND tpr.del_flag = '0'
|
AND tpr.del_flag = '0'
|
||||||
|
ORDER BY tr.create_time DESC
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -67,10 +67,10 @@ export function addTestReport(data) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getTestReportList(id) {
|
export function getTestReportList(data) {
|
||||||
return request({
|
return request({
|
||||||
url: api.getTestReportList,
|
url: api.getTestReportList,
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: {id}
|
params: data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ export default {
|
|||||||
planId: '',
|
planId: '',
|
||||||
},
|
},
|
||||||
queryParams: {
|
queryParams: {
|
||||||
planId: '',
|
id: '',
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
},
|
},
|
||||||
@@ -107,8 +107,8 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
getList() {
|
getList() {
|
||||||
this.loading = true
|
this.loading = true
|
||||||
this.queryParams.planId = this.planId
|
this.queryParams.id = Number(this.planId)
|
||||||
getTestReportList(this.queryParams.planId).then(res => {
|
getTestReportList(this.queryParams).then(res => {
|
||||||
this.list = res.rows
|
this.list = res.rows
|
||||||
this.total = res.total
|
this.total = res.total
|
||||||
this.loading = false
|
this.loading = false
|
||||||
|
|||||||
Reference in New Issue
Block a user