package com.mes.md.controller;
import com.mes.md.service.TaskingLogService;
import com.mes.utils.Result;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.Map;
/**
*
* 前端控制器
*
*
* @author wu
* @since 2024-08-28
*/
@RestController
@RequestMapping("/taskingLog")
public class TaskingLogController {
@Autowired
TaskingLogService taskingLogService;
@ApiOperation("提交日志以及报工数据到九牧数据库")
@PostMapping("/reportTaskingLog")
@ResponseBody
public Result reportTaskingLog(@RequestBody Map map) {
try {
taskingLogService.reportTaskingLog();
return Result.build(200,"提交成功",map);
}catch (Exception e) {
return Result.build(199,"提交异常",map);
}
}
@ApiOperation("提交 设备联机记录到九牧数据库")
@PostMapping("/reportOnLine")
@ResponseBody
public Result reportOnLine(@RequestBody Map map) {
try {
taskingLogService.reportTaskingLog();
return Result.build(200,"提交成功",map);
}catch (Exception e) {
return Result.build(199,"提交异常",map);
}
}
@ApiOperation("提交 设备开机记录到九牧数据库")
@PostMapping("/reportPowerOn")
@ResponseBody
public Result reportPowerOn(@RequestBody Map map) {
try {
taskingLogService.reportTaskingLog();
return Result.build(200,"提交成功",map);
}catch (Exception e) {
return Result.build(199,"提交异常",map);
}
}
}