| | |
| | | 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.utils.SensitiveDataCryptoUtil; |
| | | import com.xiaopeng.common.core.web.controller.BaseController; |
| | | import com.xiaopeng.common.core.web.page.PageInfo; |
| | | import com.xiaopeng.operation.constant.I18nKeyConstant; |
| | |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.validation.Valid; |
| | | import com.xiaopeng.common.log.annotation.AdminOperationLog; |
| | | import com.xiaopeng.common.log.enums.AdminBusinessType; |
| | | import com.xiaopeng.common.log.enums.AdminOperationType; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | if (baseUserByUid != null) { |
| | | try { |
| | | String phone = baseUserByUid.getMobile(); |
| | | long count = xpWhitelistService.count(new LambdaQueryWrapper<XpWhitelist>().eq(XpWhitelist::getAccount, phone).eq(XpWhitelist::getStatus, 1)); |
| | | long count = xpWhitelistService.count(new LambdaQueryWrapper<XpWhitelist>() |
| | | .in(XpWhitelist::getAccount, SensitiveDataCryptoUtil.queryValues(phone)) |
| | | .eq(XpWhitelist::getStatus, 1)); |
| | | return R.ok(count > 0); |
| | | } catch (Exception e) { |
| | | log.error("获取用户信息失败: {}", e.getMessage()); |
| | |
| | | |
| | | @PostMapping("/api/v1/pricing/add") |
| | | @ApiOperation(value = "管理后台-新增定价", tags = {"管理后台-定价管理"}) |
| | | @AdminOperationLog( |
| | | businessType = AdminBusinessType.PRICING_MANAGEMENT, |
| | | operationType = AdminOperationType.ADD, |
| | | content = "新增定价", |
| | | appendRequestData = true |
| | | ) |
| | | public R<Long> add(@Valid @RequestBody PricingAddDTO dto) { |
| | | return R.ok(xpPricingService.add(dto)); |
| | | } |
| | | |
| | | @PostMapping("/api/v1/pricing/edit") |
| | | @ApiOperation(value = "管理后台-编辑定价", tags = {"管理后台-定价管理"}) |
| | | @AdminOperationLog( |
| | | businessType = AdminBusinessType.PRICING_MANAGEMENT, |
| | | operationType = AdminOperationType.EDIT, |
| | | content = "编辑定价", |
| | | appendRequestData = true |
| | | ) |
| | | public R<?> edit(@Valid @RequestBody PricingEditDTO dto) { |
| | | return R.ok(xpPricingService.edit(dto)); |
| | | } |
| | | |
| | | @PostMapping("/api/v1/pricing/setPrice") |
| | | @ApiOperation(value = "管理后台-定价管理-设置价格", tags = {"管理后台-定价管理"}) |
| | | @AdminOperationLog( |
| | | businessType = AdminBusinessType.PRICING_MANAGEMENT, |
| | | operationType = AdminOperationType.EDIT, |
| | | content = "设置价格", |
| | | appendRequestData = true |
| | | ) |
| | | public R<?> setPrice(@Valid @RequestBody PricingSetPriceDTO dto) { |
| | | xpPricingService.setPrice(dto); |
| | | return R.ok(); |
| | |
| | | |
| | | @PostMapping("/api/v1/pricing/setRule") |
| | | @ApiOperation(value = "管理后台-计费规则富文本配置", tags = {"管理后台-定价管理"}) |
| | | @AdminOperationLog( |
| | | businessType = AdminBusinessType.PRICING_MANAGEMENT, |
| | | operationType = AdminOperationType.EDIT, |
| | | content = "配置计费规则", |
| | | appendRequestData = true |
| | | ) |
| | | public R<?> setRule(@Valid @RequestBody PricingSetRuleDTO dto) { |
| | | xpPricingService.setRule(dto); |
| | | return R.ok(); |
| | |
| | | |
| | | @DeleteMapping("/api/v1/pricing/deleteById") |
| | | @ApiOperation(value = "管理后台-定价管理-删除", tags = {"管理后台-定价管理"}) |
| | | @AdminOperationLog( |
| | | businessType = AdminBusinessType.PRICING_MANAGEMENT, |
| | | operationType = AdminOperationType.DELETE, |
| | | contentExpression = "'删除定价,id=' + #p0", |
| | | appendRequestData = false |
| | | ) |
| | | public R<?> deleteById(@RequestParam Long id) { |
| | | XpPricing pricing = xpPricingService.getById(id); |
| | | if (pricing == null) { |