|  | @@ -2,10 +2,13 @@ package com.xunmei.iot.controller;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  import com.xunmei.common.core.web.domain.AjaxResult;
 | 
	
		
			
				|  |  | -import com.xunmei.iot.dto.work.WorkDayDto;
 | 
	
		
			
				|  |  | +import com.xunmei.common.core.domain.work.dto.OperationPassDto;
 | 
	
		
			
				|  |  | +import com.xunmei.common.core.domain.work.dto.WorkDayDto;
 | 
	
		
			
				|  |  |  import com.xunmei.iot.service.IotDayWorkService;
 | 
	
		
			
				|  |  | -import com.xunmei.iot.vo.work.WorkVo;
 | 
	
		
			
				|  |  | +import com.xunmei.iot.service.IotServerInfoService;
 | 
	
		
			
				|  |  | +import com.xunmei.common.core.domain.work.vo.WorkVo;
 | 
	
		
			
				|  |  |  import io.swagger.annotations.ApiOperation;
 | 
	
		
			
				|  |  | +import org.springframework.beans.factory.annotation.Autowired;
 | 
	
		
			
				|  |  |  import org.springframework.web.bind.annotation.PostMapping;
 | 
	
		
			
				|  |  |  import org.springframework.web.bind.annotation.RequestBody;
 | 
	
		
			
				|  |  |  import org.springframework.web.bind.annotation.RequestMapping;
 | 
	
	
		
			
				|  | @@ -27,6 +30,8 @@ public class IotDayWorkController {
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      @Resource
 | 
	
		
			
				|  |  |      IotDayWorkService workService;
 | 
	
		
			
				|  |  | +    @Autowired
 | 
	
		
			
				|  |  | +    private IotServerInfoService serverInfoService;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      @ApiOperation(value = "轮询获取巡检数据")
 | 
	
	
		
			
				|  | @@ -40,5 +45,33 @@ public class IotDayWorkController {
 | 
	
		
			
				|  |  |              return AjaxResult.error(e.getMessage());
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    /**
 | 
	
		
			
				|  |  | +     * 对比操作密码
 | 
	
		
			
				|  |  | +     * @param operationPassDto
 | 
	
		
			
				|  |  | +     * @return
 | 
	
		
			
				|  |  | +     */
 | 
	
		
			
				|  |  | +    @PostMapping("/operationPass")
 | 
	
		
			
				|  |  | +    public AjaxResult operationPass(@RequestBody OperationPassDto operationPassDto){
 | 
	
		
			
				|  |  | +        try {
 | 
	
		
			
				|  |  | +            Integer result = serverInfoService.comparePass(operationPassDto);
 | 
	
		
			
				|  |  | +            return AjaxResult.success(null,result);
 | 
	
		
			
				|  |  | +        } catch (Exception e) {
 | 
	
		
			
				|  |  | +            e.printStackTrace();
 | 
	
		
			
				|  |  | +            return AjaxResult.error(e.getMessage());
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    @ApiOperation(value = "一键上下班")
 | 
	
		
			
				|  |  | +    @PostMapping("/startWork")
 | 
	
		
			
				|  |  | +    public AjaxResult startWork(@RequestBody WorkDayDto workDayDto){
 | 
	
		
			
				|  |  | +        try{
 | 
	
		
			
				|  |  | +            workService.startWork(workDayDto);
 | 
	
		
			
				|  |  | +            return AjaxResult.success("指令下发成功");
 | 
	
		
			
				|  |  | +        }catch (Exception e){
 | 
	
		
			
				|  |  | +            e.printStackTrace();
 | 
	
		
			
				|  |  | +            return AjaxResult.error("指令下发失败:,"+ e.getMessage());
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  |  }
 | 
	
		
			
				|  |  |  
 |