| | |
| | | EntityWrapper<LocMast> wrapper = new EntityWrapper<>(); |
| | | convert(param, wrapper); |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));} |
| | | return R.ok(locMastService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | return R.ok(locMastService.selectPage(new Page<>(curr, limit), wrapper.eq("status",0))); |
| | | } |
| | | |
| | | private <T> void convert(Map<String, Object> map, EntityWrapper<T> wrapper){ |
| | |
| | | @Transactional |
| | | public R update(LocMast locMast){ |
| | | if (Cools.isEmpty(locMast) || null==locMast.getLocNo()){ |
| | | return R.error(); |
| | | return R.error("参数缺失"); |
| | | } |
| | | |
| | | WrkMast wrkMast = wrkMastService.selectOne(new EntityWrapper<WrkMast>() |
| | |
| | | adjDetl.setAppeTime(now); |
| | | adjDetl.setAppeUser(getUserId()); |
| | | if (!adjDetlService.insert(adjDetl)) { |
| | | throw new CoolException("服务器错误,请联系管理员"); |
| | | throw new CoolException("调整记录修改失败"); |
| | | } |
| | | } |
| | | if (!locDetlService.delete(new EntityWrapper<LocDetl>().eq("loc_no", locMast.getLocNo()))) { |
| | | throw new CoolException("服务器错误,请联系管理员"); |
| | | throw new CoolException("库位明细修改失败"); |
| | | } |
| | | } |
| | | } |
| | | locMast.setModiUser(getUserId()); |
| | | locMast.setModiTime(now); |
| | | if(!locMastService.updateById(locMast)) { |
| | | throw new CoolException("服务器错误,请联系管理员"); |
| | | throw new CoolException("库位状态修改失败"); |
| | | } |
| | | return R.ok(); |
| | | } |
| | |
| | | public R delete(@RequestParam String param){ |
| | | List<LocMast> list = JSONArray.parseArray(param, LocMast.class); |
| | | if (Cools.isEmpty(list)){ |
| | | return R.error(); |
| | | return R.error("参数缺失"); |
| | | } |
| | | for (LocMast entity : list){ |
| | | locMastService.delete(new EntityWrapper<>(entity)); |