| | |
| | | import com.whyc.dto.ExperimentConditionDTO; |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.pojo.Experiment; |
| | | import com.whyc.pojo.ExperimentBaseData; |
| | | import com.whyc.pojo.ExperimentBaseDataKZ; |
| | | import com.whyc.pojo.ExperimentPoint; |
| | | import com.whyc.service.ExperimentService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | |
| | | @Autowired |
| | | private ExperimentService service; |
| | | |
| | | @GetMapping("exist") |
| | | @ApiOperation(value = "查询当前是否有正在进行的试验",notes = "如果有,code=1,返回试验的基础数据;如果没有,code=-1") |
| | | public Response exist(){ |
| | | return service.exist(); |
| | | } |
| | | |
| | | @GetMapping("experimentId") |
| | | @ApiOperation(value = "查询当前试验编号",notes = "传入的type选择其一:" + |
| | | "绕组:rz,\n" + |
| | | "空载:kz,\n" + |
| | | "负载:fz,\n" + |
| | | "升温:sw,\n" + |
| | | "超速:cs,\n" + |
| | | "空载反电动势:kzfdds,\n" + |
| | | "振动:zd,\n" + |
| | | "耐压:ny,\n" + |
| | | "转动惯量:zdgl,\n") |
| | | public Response getExperimentId(@RequestParam String type){ |
| | | return service.getExperimentId(type); |
| | | } |
| | | |
| | | @PostMapping("kzfz") |
| | | @ApiOperation(value = "新增试验-空载/负载") |
| | | public Response addKZFZ(@RequestBody Experiment<ExperimentBaseDataKZ, ExperimentPoint> experiment){ |
| | | return service.addKZFZ(experiment); |
| | | } |
| | | |
| | | @GetMapping("checkPrecondition") |
| | | @ApiOperation(value = "检查前置条件",notes = "传入的type选择其一:" + |
| | | "绕组:rz,\n" + |
| | | "空载:kz,\n" + |
| | | "负载:fz,\n" + |
| | | "升温:sw,\n" + |
| | | "超速:cs,\n" + |
| | | "空载反电动势:kzfdds,\n" + |
| | | "振动:zd,\n" + |
| | | "耐压:ny,\n" + |
| | | "转动惯量:zdgl,\n") |
| | | public Response checkPrecondition(@RequestParam String type){ |
| | | return service.checkPrecondition(type); |
| | | } |
| | | |
| | | @PutMapping("precondition") |
| | | @ApiOperation(value = "设置前置条件",notes = "id:进线屏开关状态-1,大功率整流电源-2,..." + |
| | | "value:开关信号:关-0,开-1,数值信号:电源-开-500-关-400,A排-开-500-关-400,B排-开-0-关-100") |
| | | public Response setPrecondition(@RequestParam Integer id,@RequestParam Integer value){ |
| | | return service.setPrecondition(id,value); |
| | | } |
| | | |
| | | /** |
| | | * 开始试验,请求接口1,获取试验测试点 |
| | | */ |
| | | @GetMapping("point") |
| | | @ApiOperation(value = "查询测试点列表") |
| | | public Response getPoint(@RequestParam String experimentId){ |
| | | return service.getPoint(experimentId); |
| | | } |
| | | |
| | | /** |
| | | * 开始试验,检查中置条件 |
| | | * @return |
| | | */ |
| | | @GetMapping("checkPreconditionStep1") |
| | | @ApiOperation(value = "步骤1,检查升温情况") |
| | | public Response checkPreconditionStep1(@RequestParam String experimentId){ |
| | | return service.checkPreconditionStep1(experimentId); |
| | | } |
| | | |
| | | @PostMapping("startExperimentPoint") |
| | | @ApiOperation(value = "启动测试点",notes = "传入id,duration") |
| | | public Response StartExperimentPoint(@RequestBody ExperimentPoint point){ |
| | | return service.startExperimentPoint(point); |
| | | } |
| | | |
| | | @PostMapping("finishExperiment") |
| | | @ApiOperation(value = "完成实验") |
| | | public Response finishExperiment(@RequestParam String experimentId){ |
| | | return service.finishExperiment(experimentId); |
| | | } |
| | | |
| | | @PostMapping("finishExperimentPoint") |
| | | @ApiOperation(value = "结束测试点") |
| | | public Response finishExperimentPoint(@RequestParam Integer id){ |
| | | return service.finishExperimentPoint(id); |
| | | } |
| | | |
| | | @PostMapping("restartExperimentPoint") |
| | | @ApiOperation(value = "重做测试点") |
| | | public Response restartExperimentPoint(@RequestParam Integer id){ |
| | | return service.restartExperimentPoint(id); |
| | | } |
| | | |
| | | /*======History======*/ |
| | | |
| | | @PostMapping("page") |
| | | @ApiOperation(value = "查询分页-根据条件筛选") |
| | | @ApiOperation(value = "查询历史分页-根据条件筛选") |
| | | public Response<PageInfo<Experiment>> getPage(@RequestParam Integer pageNum, |
| | | @RequestParam Integer pageSize, |
| | | @RequestBody ExperimentConditionDTO condition){ |