| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.api.business; |
| | | |
| | | import com.doumee.api.BaseController; |
| | | import com.doumee.core.annotation.excel.ExcelExporter; |
| | | import com.doumee.core.annotation.pr.PreventRepeat; |
| | | import com.doumee.core.model.ApiResponse; |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.dao.business.model.PricingRule; |
| | | import com.doumee.dao.dto.LocalStoragePricingSaveDTO; |
| | | import com.doumee.dao.dto.RemoteDeliveryPricingSaveDTO; |
| | | import com.doumee.dao.dto.EstimatedDeliverySaveDTO; |
| | | import com.doumee.dao.dto.StoreDepositSaveDTO; |
| | | import com.doumee.dao.dto.RevenueShareSaveDTO; |
| | | import com.doumee.dao.vo.LocalStoragePricingVO; |
| | | import com.doumee.dao.vo.RemoteDeliveryPricingVO; |
| | | import com.doumee.dao.vo.EstimatedDeliveryVO; |
| | | import com.doumee.dao.vo.StoreDepositVO; |
| | | import com.doumee.dao.vo.RevenueShareVO; |
| | | import com.doumee.service.business.PricingRuleService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.apache.shiro.authz.annotation.RequiresPermissions; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 计价è§åé
ç½® |
| | | * @author rk |
| | | * @date 2026/04/08 |
| | | */ |
| | | @Api(tags = "计价è§åé
ç½®") |
| | | @RestController |
| | | @RequestMapping("/business/pricingRule") |
| | | public class PricingRuleController extends BaseController { |
| | | |
| | | @Autowired |
| | | private PricingRuleService pricingRuleService; |
| | | |
| | | @PreventRepeat |
| | | @ApiOperation("æ°å»º") |
| | | @PostMapping("/create") |
| | | @RequiresPermissions("business:pricingRule:create") |
| | | public ApiResponse create(@RequestBody PricingRule pricingRule) { |
| | | return ApiResponse.success(pricingRuleService.create(pricingRule)); |
| | | } |
| | | |
| | | @ApiOperation("æ ¹æ®IDå é¤") |
| | | @GetMapping("/delete/{id}") |
| | | @RequiresPermissions("business:pricingRule:delete") |
| | | public ApiResponse deleteById(@PathVariable Integer id) { |
| | | pricingRuleService.deleteById(id); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | @ApiOperation("æ¹éå é¤") |
| | | @GetMapping("/delete/batch") |
| | | @RequiresPermissions("business:pricingRule:delete") |
| | | public ApiResponse deleteByIdInBatch(@RequestParam String ids) { |
| | | String[] idArray = ids.split(","); |
| | | List<Integer> idList = new ArrayList<>(); |
| | | for (String id : idArray) { |
| | | idList.add(Integer.valueOf(id)); |
| | | } |
| | | pricingRuleService.deleteByIdInBatch(idList); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | @ApiOperation("æ ¹æ®IDä¿®æ¹") |
| | | @PostMapping("/updateById") |
| | | @RequiresPermissions("business:pricingRule:update") |
| | | public ApiResponse updateById(@RequestBody PricingRule pricingRule) { |
| | | pricingRuleService.updateById(pricingRule); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | @ApiOperation("å页æ¥è¯¢") |
| | | @PostMapping("/page") |
| | | @RequiresPermissions("business:pricingRule:query") |
| | | public ApiResponse<PageData<PricingRule>> findPage(@RequestBody PageWrap<PricingRule> pageWrap) { |
| | | return ApiResponse.success(pricingRuleService.findPage(pageWrap)); |
| | | } |
| | | |
| | | @ApiOperation("导åºExcel") |
| | | @PostMapping("/exportExcel") |
| | | @RequiresPermissions("business:pricingRule:exportExcel") |
| | | public void exportExcel(@RequestBody PageWrap<PricingRule> pageWrap, HttpServletResponse response) { |
| | | List<PricingRule> pricingRuleList = pricingRuleService.findPage(pageWrap).getRecords(); |
| | | ExcelExporter.build(PricingRule.class).export(pricingRuleList, "计价è§åé
ç½®", response); |
| | | } |
| | | |
| | | @ApiOperation("æ ¹æ®IDæ¥è¯¢") |
| | | @GetMapping("/{id}") |
| | | @RequiresPermissions("business:pricingRule:query") |
| | | public ApiResponse findById(@PathVariable Integer id) { |
| | | return ApiResponse.success(pricingRuleService.findById(id)); |
| | | } |
| | | |
| | | @PreventRepeat |
| | | @ApiOperation("æ¹éä¿åå°±å°ååè§å") |
| | | @PostMapping("/localStorage/batchSave") |
| | | @RequiresPermissions("business:pricingRule:create") |
| | | public ApiResponse batchSaveLocalStoragePricing(@RequestBody @Validated LocalStoragePricingSaveDTO request) { |
| | | pricingRuleService.batchSaveLocalStoragePricing(request); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | @ApiOperation("æ¥è¯¢å°±å°ååè§åå表") |
| | | @GetMapping("/localStorage/list") |
| | | @RequiresPermissions("business:pricingRule:query") |
| | | public ApiResponse<List<LocalStoragePricingVO>> listLocalStoragePricing(@RequestParam Integer cityId) { |
| | | return ApiResponse.success(pricingRuleService.listLocalStoragePricing(cityId)); |
| | | } |
| | | |
| | | @PreventRepeat |
| | | @ApiOperation("æ¹éä¿åå¼å°å¯éè§å") |
| | | @PostMapping("/remoteDelivery/batchSave") |
| | | @RequiresPermissions("business:pricingRule:create") |
| | | public ApiResponse batchSaveRemoteDeliveryPricing(@RequestBody @Validated RemoteDeliveryPricingSaveDTO request) { |
| | | pricingRuleService.batchSaveRemoteDeliveryPricing(request); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | @ApiOperation("æ¥è¯¢å¼å°å¯éè§åå表") |
| | | @GetMapping("/remoteDelivery/list") |
| | | @RequiresPermissions("business:pricingRule:query") |
| | | public ApiResponse<List<RemoteDeliveryPricingVO>> listRemoteDeliveryPricing(@RequestParam Integer cityId) { |
| | | return ApiResponse.success(pricingRuleService.listRemoteDeliveryPricing(cityId)); |
| | | } |
| | | |
| | | @PreventRepeat |
| | | @ApiOperation("ä¿åé¢è®¡æ¶æé
ç½®") |
| | | @PostMapping("/estimatedDelivery/save") |
| | | @RequiresPermissions("business:pricingRule:create") |
| | | public ApiResponse saveEstimatedDelivery(@RequestBody @Validated EstimatedDeliverySaveDTO request) { |
| | | pricingRuleService.saveEstimatedDelivery(request); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | @ApiOperation("æ¥è¯¢é¢è®¡æ¶æé
ç½®") |
| | | @GetMapping("/estimatedDelivery/list") |
| | | @RequiresPermissions("business:pricingRule:query") |
| | | public ApiResponse<EstimatedDeliveryVO> listEstimatedDelivery(@RequestParam Integer cityId) { |
| | | return ApiResponse.success(pricingRuleService.getEstimatedDelivery(cityId)); |
| | | } |
| | | |
| | | @PreventRepeat |
| | | @ApiOperation("æ¹éä¿åé¨åºæ³¨åæ¼é") |
| | | @PostMapping("/storeDeposit/batchSave") |
| | | @RequiresPermissions("business:pricingRule:create") |
| | | public ApiResponse batchSaveStoreDeposit(@RequestBody @Validated StoreDepositSaveDTO request) { |
| | | pricingRuleService.batchSaveStoreDeposit(request); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | @ApiOperation("æ¥è¯¢é¨åºæ³¨åæ¼éå表") |
| | | @GetMapping("/storeDeposit/list") |
| | | @RequiresPermissions("business:pricingRule:query") |
| | | public ApiResponse<List<StoreDepositVO>> listStoreDeposit(@RequestParam Integer cityId) { |
| | | return ApiResponse.success(pricingRuleService.listStoreDeposit(cityId)); |
| | | } |
| | | |
| | | @PreventRepeat |
| | | @ApiOperation("æ¹éä¿ååææ¯ä¾") |
| | | @PostMapping("/revenueShare/batchSave") |
| | | @RequiresPermissions("business:pricingRule:create") |
| | | public ApiResponse batchSaveRevenueShare(@RequestBody @Validated RevenueShareSaveDTO request) { |
| | | pricingRuleService.batchSaveRevenueShare(request); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | @ApiOperation("æ¥è¯¢åææ¯ä¾å表") |
| | | @GetMapping("/revenueShare/list") |
| | | @RequiresPermissions("business:pricingRule:query") |
| | | public ApiResponse<List<RevenueShareVO>> listRevenueShare(@RequestParam Integer cityId) { |
| | | return ApiResponse.success(pricingRuleService.listRevenueShare(cityId)); |
| | | } |
| | | |
| | | } |