| | |
| | | package com.zy.asrs.wms.asrs.controller;
|
| | |
|
| | | import com.alibaba.fastjson.JSON;
|
| | | import com.alibaba.fastjson.JSONObject;
|
| | | import com.alibaba.fastjson.parser.Feature;
|
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
| | |
| | | import com.zy.asrs.wms.asrs.service.LocDetlService;
|
| | | import com.zy.asrs.wms.system.controller.BaseController;
|
| | | import com.zy.asrs.wms.utils.ExcelUtil;
|
| | | import com.zy.asrs.wms.utils.Utils;
|
| | | import org.springframework.beans.BeanUtils;
|
| | | import org.springframework.beans.factory.annotation.Autowired;
|
| | | import org.springframework.security.access.prepost.PreAuthorize;
|
| | | import org.springframework.web.bind.annotation.*;
|
| | |
| | |
|
| | | @PreAuthorize("hasAuthority('asrs:locDetl:list')")
|
| | | @PostMapping("/locDetl/page")
|
| | | @CacheData(tableName = {"man_loc_detl"})
|
| | | public R page(@RequestBody Map<String, Object> map) {
|
| | | Map<String, String> order = new HashMap<>();
|
| | | if (!Objects.isNull(map.get("orderBy"))) {
|
| | | order = JSONObject.parseObject(JSON.toJSONString(map.get("orderBy")), Map.class);
|
| | | }
|
| | | BaseParam baseParam = buildParam(map, BaseParam.class);
|
| | | PageParam<ViewLocDetl, BaseParam> pageParam = new PageParam<>(baseParam, ViewLocDetl.class);
|
| | | PageParam<ViewLocDetl, BaseParam> data = locDetlService.getPage(pageParam, pageParam.buildWrapper(true));
|
| | | QueryWrapper<ViewLocDetl> wrapper = pageParam.ignoreWrapper(true);
|
| | | if (!Cools.isEmpty(order)) {
|
| | | String fileds = Utils.toSymbolCase(order.get("field"), '_');
|
| | | if (order.get("order").equals("asc")) {
|
| | | wrapper.orderByAsc(fileds);
|
| | | } else {
|
| | | wrapper.orderByDesc(fileds);
|
| | | }
|
| | | } else {
|
| | | wrapper.orderByDesc("create_time");
|
| | | }
|
| | | PageParam<ViewLocDetl, BaseParam> data = locDetlService.getPage(pageParam, wrapper);
|
| | |
|
| | | return R.ok().add(data);
|
| | | }
|
| | |
|
| | |
|
| | | @PreAuthorize("hasAuthority('asrs:locDetl:list')")
|
| | | @PostMapping("/locDetl/all/Qty")
|
| | | public R getAllStock() {
|
| | | return locDetlService.getAllStockQty();
|
| | | }
|
| | |
|
| | | @PreAuthorize("hasAuthority('asrs:locDetl:list')")
|
| | | @PostMapping("/locDetl/outPage")
|
| | | @CacheData(tableName = {"man_loc_detl"})
|
| | | public R outPage(@RequestBody Map<String, Object> map) {
|
| | | BaseParam baseParam = buildParam(map, BaseParam.class);
|
| | | PageParam<ViewLocDetl, BaseParam> pageParam = new PageParam<>(baseParam, ViewLocDetl.class);
|
| | |
|
| | | QueryWrapper<ViewLocDetl> queryWrapper = pageParam.buildWrapper(true);
|
| | | List<Long> locIds = locService.listBySts(LocStsType.F.val());
|
| | | if (locIds.isEmpty()) {
|
| | | locIds.add(-1L);
|
| | | }
|
| | | queryWrapper.in("loc_id", locIds);
|
| | | // List<Long> locIds = locService.listBySts(LocStsType.F.val());
|
| | | // if (locIds.isEmpty()) {
|
| | | // locIds.add(-1L);
|
| | | // }
|
| | | // queryWrapper.in("loc_id", locIds);
|
| | | PageParam<ViewLocDetl, BaseParam> data = locDetlService.getPage(pageParam, queryWrapper);
|
| | | return R.ok().add(data);
|
| | | }
|