package com.mes.downworkstation.controller;
import com.mes.downworkstation.entity.DownWorkstation;
import com.mes.downworkstation.entity.request.DownWorkRequest;
import com.mes.downworkstation.service.DownWorkstationService;
import com.mes.glassinfo.service.GlassInfoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
*
* 前端控制器
*
*
* @author zhoush
* @since 2024-03-27
*/
@RestController
@Api(description = "工位")
@RequestMapping("/downWorkStation")
public class DownWorkstationController {
@Autowired
private DownWorkstationService downWorkstationService;
@Autowired
private GlassInfoService glassInfoService;
@ApiOperation("获取工位信息")
@GetMapping("/getone")
public ResponseEntity> getOneDownWorkstations() {
try {
List data = downWorkstationService.getoneDownWorkstations(1,6);
// 构建符合预期格式的响应数据
Map responseData = new HashMap<>();
responseData.put("code", 200);
responseData.put("msg", "成功");
responseData.put("data", data);
// 返回 ResponseEntity 对象,包含响应数据和状态码
return ResponseEntity.ok(responseData);
} catch (Exception e) {
e.printStackTrace();
// 如果出现异常,返回错误信息
Map errorResponse = new HashMap<>();
errorResponse.put("code", 500);
errorResponse.put("msg", "服务器内部错误");
return ResponseEntity.status(500).body(errorResponse);
}
}
@ApiOperation("获取流程卡号")
@GetMapping("/getflowCardId")
public ResponseEntity