From 14901b7b990ae38fa4f2e4d57324b6d5e1189c63 Mon Sep 17 00:00:00 2001 From: ZengTao <2773468879@qq.com> Date: 星期四, 08 八月 2024 14:50:48 +0800 Subject: [PATCH] Merge branch 'master' of http://bore.pub:10439/r/HangZhouMes --- hangzhoumesParent/moduleService/TemperingGlassModule/src/main/java/com/mes/temperingglass/controller/TemperingGlassInfoController.java | 70 ++++++++++++++++++++++++++-------- 1 files changed, 53 insertions(+), 17 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..4d0abc8 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,63 @@ package com.mes.temperingglass.controller; - +import com.mes.damage.entity.Damage; +import com.mes.damage.service.DamageService; +import com.mes.temperingglass.service.TemperingGlassInfoService; +import com.mes.temperingglass.entity.TemperingGlassInfo; +import com.mes.utils.Result; 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 */ @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("鏌ヨ杩涚倝涓殑閽㈠寲绛夌墖涓殑鐗堝浘淇℃伅,鐘舵�佸叏涓�1鐨勪负宸插埌銆�") +// @GetMapping("/selectIntoGlass") // 鏌ヨ杩涚倝涓殑閽㈠寲绛夌墖涓殑鐗堝浘淇℃伅,鐘舵�佸叏涓�1鐨勪负宸插埌銆� +// public Result <List<TemperingGlassInfo>> selectIntoGlass() { +// List<TemperingGlassInfo> glass = temperingAgoService.selectIntoGlass(); +// 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) { + damageService.insertDamage(damage); + TemperingGlassInfo temperingGlassInfo=new TemperingGlassInfo(); + temperingGlassInfo.setState(damage.getStatus()); + temperingGlassInfo.setGlassId(damage.getGlassId()); + int result=temperingGlassInfoService.updateTemperingState(temperingGlassInfo); + return Result.build(200, "鐮存崯鎴愬姛", result); + } + + +} -- Gitblit v1.8.0