严智鑫
2024-04-18 ad28331c1e3ed456b72765874b41b83b49dc279f
hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/downworkstation/controller/DownWorkstationController.java
@@ -15,7 +15,7 @@
/**
 * <p>
 *  前端控制器
 * 前端控制器
 * </p>
 *
 * @author zhoush
@@ -23,7 +23,7 @@
 */
@RestController
@RequestMapping("/api/downWorkstation")
@RequestMapping("/api/unLoadGlass")
public class DownWorkstationController {
    @Autowired
@@ -34,7 +34,7 @@
    @GetMapping("/getone")
    public ResponseEntity<?> getOneDownWorkstations() {
        try {
            List<DownWorkstation> data = downWorkstationService.getoneDownWorkstations();
            List<DownWorkstation> data = downWorkstationService.getoneDownWorkstations(1, 5);
            // 构建符合预期格式的响应数据
            Map<String, Object> responseData = new HashMap<>();
            responseData.put("code", 200);
@@ -54,13 +54,14 @@
    @GetMapping("/gettwo")
    public List<DownWorkstation> gettwoDownWorkstations() {
        return downWorkstationService.gettwoDownWorkstations();
        return downWorkstationService.getoneDownWorkstations(6, 10);
    }
    @GetMapping("/getflowCardId")
    public ResponseEntity<Map<String, Object>> getflowCardId() {
        Map<String, Object> responseData = new HashMap<>();
        try {
            List<Map<String, Object>> data = downWorkstationService.getflowCardId();
            List<Map<String, Object>> data = glassInfoService.getFlowCardId();
            responseData.put("code", 200);
            responseData.put("msg", "成功");
            responseData.put("data", data);
@@ -74,8 +75,7 @@
    }
    //绑定架子
    @PostMapping("/updateFlowCardId")
    public ResponseEntity<Map<String, Object>> updateFlowCardId(@RequestBody Map<String, Object> requestData) {
        // 从 requestData 中获取传入的 flowCardId
@@ -86,7 +86,7 @@
        int glassInfoCount = glassInfoService.getGlassInfoCountByFlowCardId(flowCardId);
        // 更新 down_workstation 表中的总数量
        glassInfoService.updateFlowCardIdAndCount(flowCardId, glassInfoCount, workstationId);
        downWorkstationService.updateFlowCardIdAndCount(flowCardId, glassInfoCount, workstationId);
        // 构建响应数据
        Map<String, Object> responseData = new HashMap<>();
@@ -113,8 +113,7 @@
            responseData.put("code", 200);
            // 返回处理结果
            return ResponseEntity.ok(responseData);
        }
        else {
        } else {
            // 如果总数量和落架数量不一致,返回错误响应
            Map<String, Object> errorResponse = new HashMap<>();
            errorResponse.put("message", "Total workstations count does not match down workstations count.");
@@ -126,10 +125,6 @@
        // 构建响应数据
    }
}