| | |
| | | if (!Objects.isNull(loc.getTypeIds()) && !loc.getTypeIds().isEmpty()) { |
| | | join = StringUtils.join(loc.getTypeIds(), ","); |
| | | } |
| | | boolean update = this.update(new LambdaUpdateWrapper<Loc>() |
| | | List<Loc> existsLocs = this.list(new LambdaQueryWrapper<Loc>() |
| | | .in(Loc::getId, locs.getId()) |
| | | .eq(Loc::getStatus, 1) |
| | | .set(!Objects.isNull(loc.getAreaId()), Loc::getAreaId, loc.getAreaId()) |
| | | .set(!Objects.isNull(loc.getWarehouseId()), Loc::getWarehouseId, loc.getWarehouseId()) |
| | | .set(!Objects.isNull(loc.getUseStatus()), Loc::getUseStatus, loc.getUseStatus()) |
| | | .set(!Objects.isNull(loc.getTypeIds()) && !loc.getTypeIds().isEmpty(), Loc::getType, join) |
| | | .set(!Objects.isNull(loc.getLength()), Loc::getLength, loc.getLength()) |
| | | .set(!Objects.isNull(loc.getWidth()), Loc::getWidth, loc.getWidth()) |
| | | .set(!Objects.isNull(loc.getHeight()), Loc::getHeight, loc.getHeight()) |
| | | .set(!Objects.isNull(loc.getChannel()), Loc::getChannel, loc.getChannel()) |
| | | .set(!Objects.isNull(loc.getFlagLabelMange()), Loc::getFlagLabelMange, loc.getFlagLabelMange()) |
| | | .set(!Objects.isNull(loc.getStatus()), Loc::getStatus, loc.getStatus())); |
| | | if (!update) { |
| | | .eq(Loc::getStatus, 1)); |
| | | if (existsLocs.isEmpty()) { |
| | | throw new CoolException("库位信息修改失败!!"); |
| | | } |
| | | for (Loc currentLoc : existsLocs) { |
| | | if (!Objects.isNull(loc.getAreaId())) { |
| | | currentLoc.setAreaId(loc.getAreaId()); |
| | | } |
| | | if (!Objects.isNull(loc.getWarehouseId())) { |
| | | currentLoc.setWarehouseId(loc.getWarehouseId()); |
| | | } |
| | | if (!Objects.isNull(loc.getUseStatus())) { |
| | | currentLoc.setUseStatus(loc.getUseStatus()); |
| | | } |
| | | if (!Objects.isNull(loc.getTypeIds()) && !loc.getTypeIds().isEmpty()) { |
| | | currentLoc.setType(join); |
| | | } |
| | | if (!Objects.isNull(loc.getLength())) { |
| | | currentLoc.setLength(loc.getLength()); |
| | | } |
| | | if (!Objects.isNull(loc.getWidth())) { |
| | | currentLoc.setWidth(loc.getWidth()); |
| | | } |
| | | if (!Objects.isNull(loc.getHeight())) { |
| | | currentLoc.setHeight(loc.getHeight()); |
| | | } |
| | | if (!Objects.isNull(loc.getChannel())) { |
| | | currentLoc.setChannel(loc.getChannel()); |
| | | } |
| | | if (!Objects.isNull(loc.getFlagLabelMange())) { |
| | | currentLoc.setFlagLabelMange(loc.getFlagLabelMange()); |
| | | } |
| | | if (!Objects.isNull(loc.getStatus())) { |
| | | currentLoc.setStatus(loc.getStatus()); |
| | | } |
| | | if (!this.updateById(currentLoc)) { |
| | | throw new CoolException("库位信息修改失败!!"); |
| | | } |
| | | } |
| | | |
| | | return R.ok(loc); |
| | | } |