| | |
| | | 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; |
| | |
| | | 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,"已达到计划重复次数最大值"); |
| | | } |
| | |
| | | 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); |
| | | |
| | |
| | | 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); |
| | | |