| | |
| | | |
| | | @RequestMapping(value = "/locDetl/forlocNo/auth/v1") |
| | | @ManagerAuth |
| | | public R forlocNoV1(@RequestParam String locNo,@RequestParam String matnr) { |
| | | public R forlocNoV1(@RequestParam String locNo) { |
| | | LambdaQueryWrapper<LocDetl> locDetlLambdaQueryWrapper = new LambdaQueryWrapper<LocDetl>() |
| | | .eq(LocDetl::getLocNo, locNo) |
| | | .eq(LocDetl::getHostId, getHostId()); |
| | | if (!Cools.isEmpty(matnr)) { |
| | | locDetlLambdaQueryWrapper.eq(LocDetl::getMatnr, matnr); |
| | | } |
| | | List<LocDetl> detls = locDetlService.list(locDetlLambdaQueryWrapper); |
| | | if (Cools.isEmpty(detls)){ |
| | | return R.error("未查询到库存数据"); |
| | |
| | | @ManagerAuth |
| | | public R stockOutList(@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(required = false) String timeRange, |
| | | @RequestParam Map<String, Object> param) { |
| | | QueryWrapper<LocDetl> wrapper = new QueryWrapper<>(); |
| | | |
| | | if (!Cools.isEmpty(param.get("decrees"))) { |
| | | ArrayList<String> mats = new ArrayList<>(); |
| | | List<Mat> decrees = matService.list(new LambdaQueryWrapper<Mat>().like(Mat::getDecrees, param.get("decrees"))); |
| | | if (decrees.isEmpty()) { |
| | | mats.add("-1"); |
| | | }else { |
| | | for (Mat mat : decrees) { |
| | | mats.add(mat.getMatnr()); |
| | | if (!Cools.isEmpty(param.get("modi_time"))){ |
| | | String val = String.valueOf(param.get("modi_time")); |
| | | if (val.contains(RANGE_TIME_LINK)) { |
| | | String[] dates = val.split(RANGE_TIME_LINK); |
| | | param.put("startTime", DateUtils.convert(dates[0])); |
| | | param.put("endTime", DateUtils.convert(dates[1])); |
| | | param.remove("modi_time"); |
| | | } |
| | | } |
| | | wrapper.in("matnr", mats); |
| | | param.remove("decrees"); |
| | | } |
| | | |
| | | convert(param,wrapper); |
| | | wrapper.eq("host_id", getHostId()); |
| | | // if (!Cools.isEmpty(condition)) { |
| | | // wrapper.like(LocDetl::getLocNo, condition); |
| | | // } |
| | | if (!Cools.isEmpty(timeRange)) { |
| | | String[] range = timeRange.split(RANGE_TIME_LINK); |
| | | wrapper.ge("appe_time", DateUtils.convert(range[0])); |
| | | wrapper.le("appe_time", DateUtils.convert(range[1])); |
| | | } |
| | | if (!Cools.isEmpty(param.get("locNo"))) { |
| | | wrapper.like("loc_no", param.get("locNo")); |
| | | } |
| | | |
| | | if (!Cools.isEmpty(param.get("zpallet"))) { |
| | | wrapper.like("zpallet", param.get("zpallet")); |
| | | } |
| | | |
| | | if (!Cools.isEmpty(orderByField)){ |
| | | wrapper.orderBy(true, "asc".equals(orderByType), humpToLine(orderByField)); |
| | | } |
| | | |
| | | param.remove("locNo"); |
| | | param.remove("owner"); |
| | | param.remove("matnr"); |
| | | allLike(LocDetl.class, param.keySet(), wrapper, condition); |
| | | return R.ok(locDetlService.page(new Page<>(curr, limit), wrapper)); |
| | | param.put("hostId", getHostId()); |
| | | return R.ok(locDetlService.getStockOut(curr, limit, param)); |
| | | } |
| | | |
| | | @RequestMapping(value = "/locDetl/statis/export") |