zepengdev
6 hours ago b44306c69e6dff053e048da0bb8f3355cfda1256
feat: 增加店铺包装费用修改接口
4 files modified
29 ■■■■■ changed files
oying-system/src/main/java/com/oying/modules/pc/store/domain/dto/StoreFieldUpdateRequest.java 5 ●●●●● patch | view | raw | blame | history
oying-system/src/main/java/com/oying/modules/pc/store/rest/StoreMerchantController.java 14 ●●●●● patch | view | raw | blame | history
oying-system/src/main/java/com/oying/modules/pc/store/service/StoreService.java 2 ●●●●● patch | view | raw | blame | history
oying-system/src/main/java/com/oying/modules/pc/store/service/impl/StoreServiceImpl.java 8 ●●●●● patch | view | raw | blame | history
oying-system/src/main/java/com/oying/modules/pc/store/domain/dto/StoreFieldUpdateRequest.java
@@ -61,6 +61,11 @@
    @NotNull(groups = UpdateStoreDeliveryFeeGroup.class)
    private BigDecimal deliveryFee;
    public interface UpdateStorePackagingFeeGroup{}
    @NotNull(groups = UpdateStorePackagingFeeGroup.class)
    private BigDecimal packagingFee;
    public interface UpdateStoreDeliveryMinimumGroup{}
    @NotNull(groups = UpdateStoreDeliveryMinimumGroup.class)
oying-system/src/main/java/com/oying/modules/pc/store/rest/StoreMerchantController.java
@@ -277,6 +277,20 @@
    }
    /**
     * 修改包装费用
     */
    @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")
oying-system/src/main/java/com/oying/modules/pc/store/service/StoreService.java
@@ -64,6 +64,8 @@
    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);
oying-system/src/main/java/com/oying/modules/pc/store/service/impl/StoreServiceImpl.java
@@ -225,6 +225,14 @@
    }
    @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())