| | |
| | | } |
| | | |
| | | @PutMapping("precondition") |
| | | @ApiOperation(value = "设置前置条件",notes = "进线屏开关状态-1,大功率整流电源-2,...") |
| | | public Response setPrecondition(@RequestParam Integer id){ |
| | | return service.setPrecondition(id); |
| | | @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); |
| | | } |
| | | |
| | | /** |
| | |
| | | private String value; |
| | | @ApiModelProperty("阈值描述") |
| | | private String valueDescription; |
| | | @ApiModelProperty("使用标识") |
| | | private Integer flag; |
| | | @TableField(exist = false) |
| | | private Integer status; |
| | | @TableField(exist = false) |
| | |
| | | this.value = value; |
| | | } |
| | | |
| | | public Integer getFlag() { |
| | | return flag; |
| | | } |
| | | |
| | | public void setFlag(Integer flag) { |
| | | this.flag = flag; |
| | | } |
| | | |
| | | public String getValueDescription() { |
| | | return valueDescription; |
| | | } |
| | |
| | | //2种方式 |
| | | //m1 |
| | | QueryWrapper<ExperimentPrecondition> wrapper = Wrappers.query(); |
| | | wrapper.eq("type",type); |
| | | wrapper.eq("type",type).eq("flag",1); |
| | | List<ExperimentPrecondition> preconditions = preconditionMapper.selectList(wrapper); |
| | | preconditions.stream().forEach(precondition->{ |
| | | //获取对应的值 |
| | |
| | | return new Response().setMsg(1,"测试点中断信号更新成功"); |
| | | } |
| | | |
| | | public Response setPrecondition(Integer id) { |
| | | public Response setPrecondition(Integer id,Integer value) { |
| | | switch (id){ |
| | | case 1:{ |
| | | commonMapper.setPrecondition("`db_3.5mw_motor`.tb_central_monitor_sys_rt","10001","switch_close","0"); |
| | | commonMapper.setPrecondition("`db_3.5mw_motor`.tb_central_monitor_sys_rt","10001","switch_close",value.toString()); |
| | | break; |
| | | } |
| | | case 2:{ |
| | | |
| | | commonMapper.setPrecondition("`db_3.5mw_motor`.tb_rectifier_power_rt","30001","rectifier_vol",value.toString()); |
| | | break; |
| | | } |
| | | case 3:{ |
| | | |
| | | commonMapper.setPrecondition("`db_3.5mw_motor`.tb_central_monitor_sys_st","10005","vol_a",value.toString()); |
| | | break; |
| | | } |
| | | case 4:{ |
| | | |
| | | commonMapper.setPrecondition("`db_3.5mw_motor`.tb_central_monitor_sys_st","10005","vol_b",value.toString()); |
| | | break; |
| | | } |
| | | case 5:{ |
| | | |
| | | commonMapper.setPrecondition("`db_3.5mw_motor`.tb_device_state","40001","comm_status",value.toString()); |
| | | break; |
| | | } |
| | | case 6:{ |
| | | |
| | | commonMapper.setPrecondition("`db_3.5mw_motor`.tb_device_state","40002","comm_status",value.toString()); |
| | | break; |
| | | } |
| | | case 7:{ |
| | | |
| | | commonMapper.setPrecondition("`db_3.5mw_motor`.tb_device_state","50001","comm_status",value.toString()); |
| | | break; |
| | | } |
| | | } |
| | | return new Response().setMsg(1,"设置完成"); |