| | |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.xiaopeng.api.dto.operation.LonLatDto; |
| | | import com.xiaopeng.api.model.operation.XpGeoQueryEntity; |
| | | import com.xiaopeng.api.model.operation.XpPricing; |
| | | import com.xiaopeng.common.core.domain.R; |
| | | import com.xiaopeng.common.core.web.controller.BaseController; |
| | | import com.xiaopeng.common.core.web.domain.AjaxResult; |
| | | import com.xiaopeng.api.dto.map.RouteAndFareDto; |
| | | import com.xiaopeng.api.dto.operation.LonLatDto; |
| | | import com.xiaopeng.api.model.operation.XpPricing; |
| | | import com.xiaopeng.api.vo.operation.RouteAndFareVo; |
| | | import com.xiaopeng.common.core.domain.R; |
| | | import com.xiaopeng.common.core.exception.ServiceException; |
| | | import com.xiaopeng.common.core.web.controller.BaseController; |
| | | import com.xiaopeng.common.core.web.page.PageInfo; |
| | | import com.xiaopeng.operation.constant.I18nKeyConstant; |
| | | import com.xiaopeng.operation.dto.PricingAddDTO; |
| | | import com.xiaopeng.operation.dto.PricingSetPriceDTO; |
| | | import com.xiaopeng.operation.dto.PricingSetRuleDTO; |
| | | import com.xiaopeng.operation.dto.XpOrderDto; |
| | | import com.xiaopeng.operation.query.PricingPageListQuery; |
| | | import com.xiaopeng.operation.service.IXpGeoQueryEntityService; |
| | | import com.xiaopeng.operation.service.XpPricingService; |
| | | import com.xiaopeng.api.vo.operation.RouteAndFareVo; |
| | | import com.xiaopeng.operation.vo.PricingPageListVO; |
| | | import com.xiaopeng.operation.vo.SaveOrderVo; |
| | | import com.xiaopeng.unifiedverification.interceptor.XpClientCheck; |
| | | import io.swagger.annotations.Api; |
| | |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.validation.Valid; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | return R.ok(saveOrderVo); |
| | | } |
| | | |
| | | @PostMapping("/api/v1/pricing/pageList") |
| | | @ApiOperation(value = "管理后台-定价管理分页列表", tags = {"管理后台-定价管理"}) |
| | | public R<PageInfo<PricingPageListVO>> pageList(@RequestBody PricingPageListQuery query) { |
| | | return R.ok(xpPricingService.pageList(query)); |
| | | } |
| | | |
| | | @GetMapping("/api/v1/pricing/queryById") |
| | | @ApiOperation(value = "管理后台-定价管理-详情", tags = {"管理后台-定价管理"}, response = XpPricing.class) |
| | | public R<XpPricing> queryById(@RequestParam Long id) { |
| | | XpPricing pricing = xpPricingService.getById(id); |
| | | if (pricing == null) { |
| | | throw new ServiceException("定价不存在", I18nKeyConstant.PRICING_NOT_EXIST); |
| | | } |
| | | return R.ok(pricing); |
| | | } |
| | | |
| | | @PostMapping("/api/v1/pricing/add") |
| | | @ApiOperation(value = "管理后台-新增定价", tags = {"管理后台-定价管理"}) |
| | | public R<?> add(@Valid @RequestBody PricingAddDTO dto) { |
| | | xpPricingService.add(dto); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @PostMapping("/api/v1/pricing/setPrice") |
| | | @ApiOperation(value = "管理后台-定价管理-设置价格", tags = {"管理后台-定价管理"}) |
| | | public R<?> setPrice(@Valid @RequestBody PricingSetPriceDTO dto) { |
| | | xpPricingService.setPrice(dto); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @PostMapping("/api/v1/pricing/setRule") |
| | | @ApiOperation(value = "管理后台-计费规则富文本配置", tags = {"管理后台-定价管理"}) |
| | | public R<?> setRule(@Valid @RequestBody PricingSetRuleDTO dto) { |
| | | xpPricingService.setRule(dto); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @DeleteMapping("/api/v1/pricing/deleteById") |
| | | @ApiOperation(value = "管理后台-定价管理-删除", tags = {"管理后台-定价管理"}) |
| | | public R<?> deleteById(@RequestParam Long id) { |
| | | XpPricing pricing = xpPricingService.getById(id); |
| | | if (pricing == null) { |
| | | throw new ServiceException("定价不存在", I18nKeyConstant.PRICING_NOT_EXIST); |
| | | } |
| | | xpPricingService.removeById(id); |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | } |