whyczh
2021-04-07 1d2fde65447c074dc555e74e088b15826be0d8c8
更新试验计划接口
2个文件已修改
19 ■■■■■ 已修改文件
src/main/java/com/whyc/pojo/TestPlan.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/service/TestPlanService.java 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/pojo/TestPlan.java
@@ -40,8 +40,8 @@
    private String creator;//创建人
    private Integer state;//状态:0:未开始,1:进行中,2:已结束,3:作废;审核状态:2(已结束时):未审核,6:已审核,8:已归档
    private String verifier;//审核人
    private int planCount;//计划次数
    private int testCount;//实际次数
    private Integer planCount;//计划次数
    private Integer testCount;//实际次数
    private String conclusion;//试验结论
    public TestPlan() {
src/main/java/com/whyc/service/TestPlanService.java
@@ -13,6 +13,7 @@
import com.whyc.pojo.TestPlan;
import io.swagger.models.auth.In;
import lombok.extern.slf4j.Slf4j;
import lombok.val;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@@ -51,8 +52,14 @@
    public Response startPlan(Integer num){
        TestPlan testPlan = mapper.selectById(num);
        //获取计划重复次数
        int planCount = testPlan.getPlanCount();
        int testCount = testPlan.getTestCount();
        int planCount = 0;
        int testCount = 0;
        if (testPlan.getPlanCount()!=null){
            planCount = testPlan.getPlanCount();
        }
        if (testPlan.getTestCount()!=null){
            testCount= testPlan.getTestCount();
        }
        if (planCount!=0 && testCount==planCount){
            return new Response().setMsg(0,"已达到计划重复次数最大值");
        }
@@ -106,7 +113,7 @@
    public Response<IPage<TestPlan>> getPageByCondition(int pageNum, int pageSize, TestPlan testPlan){
        QueryWrapper<TestPlan> queryWrapper = new QueryWrapper<>(testPlan);
        //去除已废止的计划
        queryWrapper.in("state",0,1,2,6,8);
        queryWrapper.in("state",0,1,2,3,6,8);
        IPage<TestPlan> page = mapper.selectPage(new Page<>(pageNum,pageSize),queryWrapper);
        return new Response<IPage<TestPlan>>().set(1,page);
@@ -115,7 +122,7 @@
    public Response<IPage<TestPlan>> getConclusion(int pageNum, int pageSize, TestPlan testPlan){
        QueryWrapper<TestPlan> queryWrapper = new QueryWrapper<>(testPlan);
        //6、8为结果审核状态,2:计划已结束,结论未审核
        queryWrapper.in("state",2,6,8);
        queryWrapper.in("state",3,6,8);
        IPage<TestPlan> page = mapper.selectPage(new Page<>(pageNum,pageSize),queryWrapper);
        return new Response<IPage<TestPlan>>().set(1,page);