| | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.parser.Feature; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.zy.asrs.framework.common.Cools; |
| | | import com.zy.asrs.framework.common.R; |
| | | import com.zy.asrs.wms.asrs.entity.*; |
| | | import com.zy.asrs.wms.asrs.entity.enums.LocStsType; |
| | | import com.zy.asrs.wms.asrs.mapper.LocDetlMapper; |
| | | import com.zy.asrs.wms.asrs.service.LocDetlFieldService; |
| | | import com.zy.asrs.wms.asrs.service.LocService; |
| | | import com.zy.asrs.wms.asrs.service.MatFieldService; |
| | |
| | | @PreAuthorize("hasAuthority('asrs:locDetl:list')") |
| | | @PostMapping("/locDetl/page") |
| | | public R page(@RequestBody Map<String, Object> map) { |
| | | // BaseParam baseParam = buildParam(map, BaseParam.class); |
| | | // PageParam<LocDetl, BaseParam> pageParam = new PageParam<>(baseParam, LocDetl.class); |
| | | // |
| | | // PageParam<LocDetl, BaseParam> page = locDetlService.page(pageParam, pageParam.buildWrapper(true)); |
| | | // JSONObject data = JSON.parseObject(JSON.toJSONString(page)); |
| | | // |
| | | // List<LocDetl> records = page.getRecords(); |
| | | // data.put("records", records); |
| | | // for (LocDetl locDetl : records) { |
| | | // List<LocDetlField> list = locDetlFieldService.list(new LambdaQueryWrapper<LocDetlField>().eq(LocDetlField::getDetlId, locDetl.getId())); |
| | | // locDetl.syncField(list); |
| | | // } |
| | | |
| | | 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)); |
| | | return R.ok().add(data); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('asrs:locDetl:list')") |
| | | @PostMapping("/locDetl/outPage") |
| | | 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); |
| | | PageParam<ViewLocDetl, BaseParam> data = locDetlService.getPage(pageParam, queryWrapper); |
| | | return R.ok().add(data); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('asrs:locDetl:list')") |
| | | @PostMapping("/locDetl/listByIds") |
| | | public R listByIds(@RequestBody List<Long> ids) { |
| | | List<LocDetl> list = locDetlService.listByIds(ids); |
| | | List<LocDetl> locDetls = locDetlService.parseLocDetl(list); |
| | | return R.ok().add(locDetls); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('asrs:locDetl:list')") |
| | | @GetMapping("/locDetl/locId/{locId}") |
| | | public R list(@PathVariable("locId") Long locId) { |
| | | List<LocDetl> list = locDetlService.list(new LambdaQueryWrapper<LocDetl>().eq(LocDetl::getLocId, locId)); |