From bc8b019fc839bc8f60556802d0fad39778e71a1c Mon Sep 17 00:00:00 2001 From: ZengTao <2773468879@qq.com> Date: 星期日, 17 九月 2023 17:03:53 +0800 Subject: [PATCH] 修改理片笼使用情况显示 --- springboot-vue3/src/main/java/com/example/springboot/controller/SpianController.java | 68 ++++----------------------------- 1 files changed, 9 insertions(+), 59 deletions(-) diff --git a/springboot-vue3/src/main/java/com/example/springboot/controller/SpianController.java b/springboot-vue3/src/main/java/com/example/springboot/controller/SpianController.java index 4b1da37..8870607 100644 --- a/springboot-vue3/src/main/java/com/example/springboot/controller/SpianController.java +++ b/springboot-vue3/src/main/java/com/example/springboot/controller/SpianController.java @@ -1,20 +1,15 @@ package com.example.springboot.controller; -import com.example.springboot.common.Result; -import com.example.springboot.entity.StorageCage; import com.example.springboot.mapper.SpianMapper; import com.example.springboot.service.SpianService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; -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 java.util.List; -import java.util.HashMap; -import java.util.Map; + @RestController @RequestMapping("/spian") @@ -23,72 +18,27 @@ @Autowired SpianMapper spianMapper; - - @Autowired SpianService spianservice; //鍑虹墖浠诲姟 @GetMapping("/all2") - public Result selectdd(String orderid){ - - StorageCage cageout=spianMapper.selectOut(orderid); - //鍒ゆ柇鐜荤拑鍙洿鎺ュ嚭鐗囨椂 - //鐜荤拑鍐呭鐗� - - int cage =cageout.getCage(); - int cell =cageout.getCell(); - int tier =cageout.getTier(); - double width=cageout.getWidth(); - if(tier==2){ - return Result.success("鎵ц鍑虹墖"); - } - else{ - int state= spianMapper.selectGlassState(cage,cell); - //鍒ゆ柇鍐呯墖鏄惁闇�瑕佽皟鎷� - if(state==0){ - return Result.success("鐘舵�佷负0,鐩存帴鍑虹墖"); - }else{ - //鐜荤拑闇�瑕佽皟鎷ㄦ椂 - - return Result.success("鐘舵�佷负1,闇�瑕佽璋冩嫧"); - } - } + public void selectdd(String orderid){ + SpianService service=new SpianService(); + service.selectout(orderid); } @GetMapping("/all") //杩涚墖浠诲姟,浼犺鍗昳d //鎸夎鍗曚紭鍏堣繘鐗� - public Result selectAll(String orderid){ - //return spianMapper.selectAll(); - int cage1; - //String orderid="A001"; - //鑾峰彇璁㈠崟鐩稿叧搴︽渶楂樼殑绗煎瓙鎺掑簭 - List<StorageCage> storageCage=spianMapper.selectAll(orderid); - for (StorageCage storageCage2 : storageCage) { - //淇濆瓨璁㈠崟浼樺厛椤哄簭绗煎瓙鍙� - cage1=storageCage2.getCage(); - //鍒ゆ柇璇ョ瀛愬彿鐩搁偦鏈�澶х殑绌烘牸鏁� - int cages=spianMapper.selectCage(cage1); - //鍒ゆ柇閫変腑绗煎瓙鏄惁鏈夌┖鏍� - StorageCage cages1=spianMapper.selectCage1(cage1); - if(cages>1 &&cages1.getTier()!=null){ - return Result.success(cages1); - } - - - } - return Result.success("0"); + public void selectAll(Short glassid){ + SpianService service=new SpianService(); + service.selectAll(glassid); } - @PostMapping("/save") - public Result save(@RequestBody StorageCage spian){ - spianservice.Save(spian); - return Result.success(); - } - + -- Gitblit v1.8.0