| | |
| | | import com.whyc.mapper.TestPlanMapper; |
| | | import com.whyc.pojo.DeviceManage; |
| | | import com.whyc.pojo.TestPlan; |
| | | import io.swagger.models.auth.In; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Random; |
| | | |
| | | @Service |
| | | @Slf4j |
| | |
| | | } |
| | | public Response stopPlan(Integer num){ |
| | | TestPlan testPlan = mapper.selectById(num); |
| | | testPlan.setState(2); |
| | | //获取计划重复次数 |
| | | int planCount = testPlan.getPlanCount(); |
| | | int testCount = testPlan.getTestCount(); |
| | | if (planCount!=0 && testCount==planCount){ |
| | | testPlan.setState(3);//已结束 |
| | | int k = (int)Math.random()*2; |
| | | if (k==1){ |
| | | testPlan.setConclusion("通过"); |
| | | }else{ |
| | | testPlan.setConclusion("不通过"); |
| | | } |
| | | }else { |
| | | testPlan.setState(2);//已停止 |
| | | } |
| | | mapper.updateById(testPlan); |
| | | return new Response().setMsg(1,"停止成功"); |
| | | } |
| | | |
| | | public Response verifiedPlan(Integer num,String verifier){ |
| | | TestPlan testPlan = mapper.selectById(num); |
| | | testPlan.setState(6); |