| | |
| | | * @return com.core.common.R |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R releaseLock(ReceviceTaskParams params) { |
| | | if (Objects.isNull(params) || Objects.isNull(params.getDeviceNo())) { |
| | | return R.error("参数不能为空!!"); |
| | |
| | | } |
| | | Set<String> locs = binds.stream().map(LocAroundBind::getBLocNo).collect(Collectors.toSet()); |
| | | |
| | | List<LocMast> locMasts = locMastService.selectList(new EntityWrapper<LocMast>().in("loc_no", locs).eq("loc_sts", LocStsType.LOC_STS_TYPE_X.type)); |
| | | if (Objects.isNull(locMasts) || locMasts.isEmpty()) { |
| | | throw new CoolException("没有禁用库位,不需要释放!!"); |
| | | } |
| | | |
| | | return null; |
| | | locMasts.forEach(loc -> { |
| | | loc.setLocSts(LocStsType.LOC_STS_TYPE_O.type); |
| | | if (!locMastService.updateById(loc)) { |
| | | throw new CoolException("库位释放失败,请检查后再操作!!"); |
| | | } |
| | | }); |
| | | |
| | | return R.ok(); |
| | | } |
| | | } |