| | |
| | | @NotNull(groups = UpdateStoreDeliveryFeeGroup.class) |
| | | private BigDecimal deliveryFee; |
| | | |
| | | public interface UpdateStorePackagingFeeGroup{} |
| | | |
| | | @NotNull(groups = UpdateStorePackagingFeeGroup.class) |
| | | private BigDecimal packagingFee; |
| | | |
| | | public interface UpdateStoreDeliveryMinimumGroup{} |
| | | |
| | | @NotNull(groups = UpdateStoreDeliveryMinimumGroup.class) |
| | |
| | | } |
| | | |
| | | /** |
| | | * 修改包装费用 |
| | | */ |
| | | @PatchMapping(value = "/{storeId}/packagingFee") |
| | | @ApiOperation("修改包装费用") |
| | | /*@PreAuthorize("@el.check('merchant:store:deliveryFee')" + |
| | | " and @storeMerchantOwnershipService.check(#storeId)")*/ |
| | | public ResponseEntity<?> updatePackagingFee(@PathVariable("storeId") Long storeId, |
| | | @Validated(value = StoreFieldUpdateRequest.UpdateStorePackagingFeeGroup.class) |
| | | @RequestBody StoreFieldUpdateRequest request) { |
| | | storeService.updatePackagingFee(storeId, request.getPackagingFee(), request.getVersion()); |
| | | return ResponseEntity.noContent().build(); |
| | | } |
| | | |
| | | /** |
| | | * 修改状态 |
| | | */ |
| | | @PatchMapping(value = "/{storeId}/businessStatus") |
| | |
| | | |
| | | boolean updateDeliveryFee(Long storeId, BigDecimal deliveryFee, Long version); |
| | | |
| | | boolean updatePackagingFee(Long storeId, BigDecimal packagingFee, Long version); |
| | | |
| | | boolean updateStatus(Long storeId, Integer status, Long version); |
| | | |
| | | boolean existsByIdAndMerchantId(Long storeId, Long merchantId); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public boolean updatePackagingFee(Long storeId, BigDecimal packagingFee, Long version) { |
| | | Store existingStore = this.getOrThrow(storeId, version); |
| | | LambdaUpdateWrapper<Store> wrapper = this.createLambdaUpdateWrapper(storeId, existingStore.getVersion()) |
| | | .set(Store::getPackagingFee, packagingFee); |
| | | return update(wrapper); |
| | | } |
| | | |
| | | @Override |
| | | public boolean updateStatus(Long storeId, Integer status, Long version) { |
| | | Store existingStore = this.getOrThrow(storeId, version); |
| | | LambdaUpdateWrapper<Store> wrapper = this.createLambdaUpdateWrapper(storeId, existingStore.getVersion()) |