From 597694f4d57a16aeb1bdccdebfcb5375abc1fce9 Mon Sep 17 00:00:00 2001 From: wu <731351411@qq.com> Date: 星期四, 27 二月 2025 09:22:38 +0800 Subject: [PATCH] 修正破损接口,指定版图查询更新 --- hangzhoumesParent/moduleService/TemperingGlassModule/src/main/java/com/mes/temperingglass/controller/TemperingGlassInfoController.java | 84 ++++++++++++++++++++++++++++++++++-------- 1 files changed, 68 insertions(+), 16 deletions(-) diff --git a/hangzhoumesParent/moduleService/TemperingGlassModule/src/main/java/com/mes/temperingglass/controller/TemperingGlassInfoController.java b/hangzhoumesParent/moduleService/TemperingGlassModule/src/main/java/com/mes/temperingglass/controller/TemperingGlassInfoController.java index 30648bf..1e97e4c 100644 --- a/hangzhoumesParent/moduleService/TemperingGlassModule/src/main/java/com/mes/temperingglass/controller/TemperingGlassInfoController.java +++ b/hangzhoumesParent/moduleService/TemperingGlassModule/src/main/java/com/mes/temperingglass/controller/TemperingGlassInfoController.java @@ -1,27 +1,79 @@ package com.mes.temperingglass.controller; +import com.mes.damage.entity.Damage; +import com.mes.damage.service.DamageService; +import com.mes.glassinfo.entity.GlassInfo; +import com.mes.temperingglass.entity.TemperingGlassInfo; +import com.mes.temperingglass.service.TemperingGlassInfoService; +import com.mes.utils.Result; +import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + /** - * <p> - * 鍓嶇鎺у埗鍣� - * </p> - * - * @author zhoush - * @since 2024-04-07 + * @author SNG-010 */ +@Api(tags = "閽㈠寲鏄剧ず") @RestController @RequestMapping("/temperingGlassInfo") +@Slf4j +// TidyUpGlassModule 閽㈠寲妯″潡 public class TemperingGlassInfoController { - //todo: 瀹炰緥浠g爜 寰呭垹闄� - @ApiOperation("娴嬭瘯") - @GetMapping("/index") - public String index() { - return "hello world"; - } -} + @Autowired + private TemperingGlassInfoService temperingGlassInfoService; + @Autowired + private DamageService damageService; + + @ApiOperation("鏌ヨ閽㈠寲绛夌墖涓殑鐗堝浘淇℃伅,鐘舵�佷负1鐨勪负宸插埌,鐘舵�佷负0鐨勪负绛夊緟涓�") + @GetMapping("/selectWaitingGlass") // 鏌ヨ閽㈠寲绛夌墖涓殑鐗堝浘淇℃伅,鐘舵�佷负1鐨勪负宸插埌,鐘舵�佷负0鐨勪负绛夊緟涓� + public Result <List<TemperingGlassInfo>> selectWaitingGlass() { + List<TemperingGlassInfo> glass = temperingGlassInfoService.selectWaitingGlass(); + log.info("绛夊緟涓殑鐜荤拑淇℃伅{}",glass); + return Result.build(200, "", glass); + } + + @ApiOperation("//閽㈠寲鍚庢樉绀哄嚭鐐夌殑鐗堝浘淇℃伅銆�") + @GetMapping("/selectOutGlass") //閽㈠寲鍚庢樉绀哄嚭鐐夌殑鐗堝浘淇℃伅 + public Result <List<TemperingGlassInfo>> selectOutGlass() { + List<TemperingGlassInfo> glass = temperingGlassInfoService.selectOutGlass(); + log.info("閽㈠寲鍑虹倝鍚庣殑鐜荤拑淇℃伅{}",glass); + return Result.build(200, "", glass); + } + + @ApiOperation("//閽㈠寲鐮存崯鎷胯蛋鏀惧洖") + @PostMapping("/updateTemperingState") //閽㈠寲鍚庢樉绀哄嚭鐐夌殑鐗堝浘淇℃伅 + public Result <Integer> updateTemperingState(@RequestBody Damage damage) { + TemperingGlassInfo temperingGlassInfo=new TemperingGlassInfo(); + temperingGlassInfo.setState(damage.getStatus()); + temperingGlassInfo.setGlassId(damage.getGlassId()); + int result=temperingGlassInfoService.updateTemperingState(temperingGlassInfo); + if (damage.getStatus() > 5) { + damageService.autoSubmitReport(damage.getGlassId(), damage.getLine() + , damage.getWorkingProcedure(), "閽㈠寲鐐�", damage.getStatus()); + } + return Result.build(200, "鐮存崯鎴愬姛", result); + } + + @ApiOperation("//鏌ヨ褰撳墠宸ョ▼鍙锋墍鏈夌殑鐐夊彿") + @PostMapping("/selectTempering") //鏌ヨ褰撳墠宸ョ▼鍙锋墍鏈夌殑鐐夊彿 + public Result<GlassInfo> selectTempering(@RequestBody GlassInfo glassInfo) { + GlassInfo glass = temperingGlassInfoService.selectTempering(glassInfo); + return Result.build(200, "鏌ヨ鎴愬姛", glass); + } + + @ApiOperation("//鏌ヨ褰撳墠宸ョ▼鍙风殑閽㈠寲鐗堝浘") + @PostMapping("/selectTemperingGlass") //鏌ヨ褰撳墠宸ョ▼鍙锋墍鏈夌殑鐐夊彿 + public Result<List<GlassInfo>> selectTemperingGlass(@RequestBody GlassInfo glassInfo) { + List<GlassInfo> glass = temperingGlassInfoService.selectTemperingGlass(glassInfo); + return Result.build(200, "鏌ヨ鎴愬姛", glass); + } + + +} -- Gitblit v1.8.0