From c7e6ef17c73feb1a3bf4bf0d6762d46f26fd4709 Mon Sep 17 00:00:00 2001 From: wu <731351411@qq.com> Date: 星期二, 13 八月 2024 08:27:32 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/controller/BigStorageCageDetailsController.java | 44 +++++++++++++++++++++++++++++++++++++++----- 1 files changed, 39 insertions(+), 5 deletions(-) diff --git a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/controller/BigStorageCageDetailsController.java b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/controller/BigStorageCageDetailsController.java index bca9539..223343a 100644 --- a/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/controller/BigStorageCageDetailsController.java +++ b/hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/controller/BigStorageCageDetailsController.java @@ -1,13 +1,19 @@ package com.mes.bigstorage.controller; + import com.mes.bigstorage.entity.BigStorageCageDetails; import com.mes.bigstorage.service.BigStorageCageDetailsService; import com.mes.bigstorage.service.BigStorageCageService; +import com.mes.common.utils.RedisUtil; import com.mes.utils.Result; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import javax.annotation.Resource; import java.util.List; import java.util.Map; @@ -28,27 +34,33 @@ private BigStorageCageDetailsService bigStorageCageDetailsService; @Autowired private BigStorageCageService bigStorageCageService; + @Resource + private RedisUtil redisUtil; @ApiOperation("鐜荤拑璇︽儏鏌ヨ") @PostMapping("/selectBigStorageCageDetails") public Result selectBigStorageCageDetails(@RequestBody Map map) { List<BigStorageCageDetails> bigStorageCageDetails=bigStorageCageDetailsService.selectBigStorageCageDetails(map.get("glassId").toString()); - return Result.build(200,"鏌ヨ鎴愬姛",bigStorageCageDetails); + if (bigStorageCageDetails.size()>0){ + return Result.build(200,"鏌ヨ鎴愬姛",bigStorageCageDetails); + }else{ + return Result.build(200,"鏌ヨ澶辫触锛屾棤姝ょ幓鐠僫d",bigStorageCageDetails); + } } @ApiOperation("鐞嗙墖绗艰鎯呮坊鍔�") @PostMapping("/insertBigStorageCageDetails") public Result insertBigStorageCageDetails(@RequestBody BigStorageCageDetails bigStorageCageDetails) { bigStorageCageDetailsService.insertBigStorageCageDetails(bigStorageCageDetails); - return Result.build(200,"娣诲姞鎴愬姛",bigStorageCageService.querybigStorageCageDetail(0)); + return Result.build(200,"娣诲姞鎴愬姛",bigStorageCageService.querybigStorageCageDetail()); } @ApiOperation("鐞嗙墖绗艰鎯呭垹闄�") @PostMapping("/deleteBigStorageCageDetails") public Result deleteBigStorageCageDetails(@RequestBody BigStorageCageDetails bigStorageCageDetails) { bigStorageCageDetailsService.deleteBigStorageCageDetails(bigStorageCageDetails); - return Result.build(200,"鍒犻櫎鎴愬姛",bigStorageCageService.querybigStorageCageDetail(0)); + return Result.build(200,"鍒犻櫎鎴愬姛",bigStorageCageService.querybigStorageCageDetail()); } @ApiOperation("鐞嗙墖绗间换鍔$牬鎹�0/鎷胯蛋1") @@ -68,10 +80,32 @@ @ApiOperation("鐞嗙墖绗间换鍔″嚭鐗�") @PostMapping("/outBigStorageCageDetails") public Result outBigStorageCageDetails(@RequestBody BigStorageCageDetails bigStorageCageDetails) { - bigStorageCageDetailsService.outBigStorageCageDetails(bigStorageCageDetails); return Result.build(200,"鍑虹墖娣诲姞鎴愬姛",1); } + @ApiOperation("鎸囧畾閽㈠寲") + @PostMapping("/TemperingGlass") + public Result temperingGlass(@RequestBody BigStorageCageDetails bigStorageCageDetails) { + boolean result = bigStorageCageDetailsService.temperingGlass(bigStorageCageDetails.getTemperingLayoutId().toString(), bigStorageCageDetails.getEngineerId()); + if (result == true) { + return Result.build(200, "鎸囧畾閽㈠寲鎴愬姛", 1); + } else { + return Result.build(200, "宸插瓨鍦ㄩ挗鍖栦换鍔★紝璇风瓑寰呴挗鍖栧畬鎴愬啀鎸囧畾閽㈠寲", 1); + } + } + + @ApiOperation("閽㈠寲鏌ヨ") + @PostMapping("/selectTemperingGlass") + public Result selectTemperingGlass() { + return Result.build(200, "鏌ヨ鎴愬姛", bigStorageCageDetailsService.selectTemperingGlass()); + } + + @ApiOperation("鏄惁閽㈠寲寮�鍏�") + @PostMapping("/temperingSwitch") + public Result temperingSwitch(Boolean flag) { + bigStorageCageDetailsService.temperingSwitch(flag); + return Result.build(200, "淇敼鎴愬姛", redisUtil.getCacheObject("temperingSwitch")); + } } -- Gitblit v1.8.0