From c656c216f10230566c1fa3367ff461f2cc80cbec Mon Sep 17 00:00:00 2001 From: zhangchao <zc857179121@qq.com> Date: 星期三, 24 七月 2024 10:55:42 +0800 Subject: [PATCH] 页面调整 --- src/main/java/com/zy/asrs/controller/LocDetlController.java | 33 ++++++++++++++------------------- 1 files changed, 14 insertions(+), 19 deletions(-) diff --git a/src/main/java/com/zy/asrs/controller/LocDetlController.java b/src/main/java/com/zy/asrs/controller/LocDetlController.java index eaa6577..a202a28 100644 --- a/src/main/java/com/zy/asrs/controller/LocDetlController.java +++ b/src/main/java/com/zy/asrs/controller/LocDetlController.java @@ -13,9 +13,12 @@ import com.core.common.DateUtils; import com.core.common.R; import com.zy.asrs.entity.LocDetl; +import com.zy.asrs.entity.ManLocDetl; import com.zy.asrs.entity.Mat; +import com.zy.asrs.entity.StockStatisDTO; import com.zy.asrs.mapper.LocDetlMapper; import com.zy.asrs.service.LocDetlService; +import com.zy.asrs.service.ManLocDetlService; import com.zy.asrs.service.MatService; import com.zy.common.web.BaseController; import org.springframework.beans.factory.annotation.Autowired; @@ -31,6 +34,7 @@ @Autowired private LocDetlService locDetlService; + @Autowired private LocDetlMapper locDetlMapper; @Autowired @@ -80,25 +84,21 @@ param.remove("modi_time"); } } - return R.ok(locDetlService.getStockOut(toPage(curr, limit, param, LocDetl.class))); + Page<LocDetl> stockOut = locDetlService.getStockOut(toPage(curr, limit, param, LocDetl.class)); + if (stockOut.getRecords().size()==0){ + stockOut = locDetlService.getStockOut(toPage(1, limit, param, LocDetl.class)); + } + return R.ok(stockOut); } - @RequestMapping(value = "/locDetl/list/auth") + @RequestMapping(value = "/locDetl/list/auth")// /locDetl/list/auth 鎺ュ彛闂 @ManagerAuth public R list(@RequestParam(defaultValue = "1")Integer curr, @RequestParam(defaultValue = "10")Integer limit, @RequestParam(required = false)String orderByField, @RequestParam(required = false)String orderByType, @RequestParam(required = false)String condition, - @RequestParam Map<String, Object> param, - @RequestParam(required = false)Boolean unreason){ - if (unreason) { - - return R.ok(locDetlService.selectPage(new Page<>(curr, limit), new EntityWrapper<LocDetl>() - .where(" DATALENGTH( batch ) != 11 or\n" + - " batch LIKE '%[a-z]%'"))); - } - param.remove("unreason"); + @RequestParam Map<String, Object> param){ // String row = ""; EntityWrapper<LocDetl> wrapper = new EntityWrapper<>(); // if (param.get("row") != null) { @@ -119,9 +119,9 @@ // wrapper.and() // .where("loc_no like '" +row +"%'"); // } - return R.ok(locDetlService.selectPage(new Page<>(curr, limit), wrapper)); } + private <T> void convert(Map<String, Object> map, EntityWrapper<T> wrapper){ for (Map.Entry<String, Object> entry : map.entrySet()){ @@ -233,13 +233,8 @@ public R statis(@RequestParam(defaultValue = "1")Integer curr, @RequestParam(defaultValue = "10")Integer limit, @RequestParam Map<String, Object> param) { - Page<LocDetl> stockStatis = locDetlService.getStockStatis(toPage(curr, limit, param, LocDetl.class)); - for (LocDetl locDetl : stockStatis.getRecords()) { - Mat mat = matService.selectByMatnr(locDetl.getMatnr()); - if (mat != null) { - locDetl.sync(mat); - } - } + System.out.println(JSONObject.toJSON(param)); + Page<StockStatisDTO> stockStatis = locDetlService.getStockStatis(toPage(curr, limit, param, StockStatisDTO.class)); return R.ok().add(stockStatis); } -- Gitblit v1.9.1