| | |
| | | import com.xiaopeng.common.core.domain.R; |
| | | import com.xiaopeng.common.core.exception.ServiceException; |
| | | import com.xiaopeng.common.core.utils.DateUtils; |
| | | import com.xiaopeng.common.core.utils.StringUtils; |
| | | import com.xiaopeng.common.core.utils.uuid.UUID; |
| | | import com.xiaopeng.common.core.web.page.PageInfo; |
| | | import com.xiaopeng.common.redis.service.RedisService; |
| | |
| | | if (pricing == null) { |
| | | throw new ServiceException("定价不存在", I18nKeyConstant.PRICING_NOT_EXIST); |
| | | } |
| | | |
| | | try { |
| | | JSONObject.parseObject(dto.getBasicPricingJson()); |
| | | JSONArray.parseArray(dto.getStartingFareJson()); |
| | | JSONObject.parseObject(dto.getDynamicPricingJson()); |
| | | if (StringUtils.isNotBlank(dto.getBasicPricingJson())) { |
| | | JSONObject.parseObject(dto.getBasicPricingJson()); |
| | | } |
| | | if (StringUtils.isNotBlank(dto.getStartingFareJson())) { |
| | | JSONArray.parseArray(dto.getStartingFareJson()); |
| | | } |
| | | if (StringUtils.isNotBlank(dto.getDynamicPricingJson())) { |
| | | JSONObject.parseObject(dto.getDynamicPricingJson()); |
| | | } |
| | | } catch (Exception e) { |
| | | throw new ServiceException("价格配置JSON格式不正确", I18nKeyConstant.PRICING_JSON_INVALID); |
| | | } |
| | |
| | | XpPricing update = new XpPricing(); |
| | | update.setId(dto.getId()); |
| | | update.setBasicPricingJson(dto.getBasicPricingJson()); |
| | | update.setStartingFareJson(dto.getStartingFareJson()); |
| | | update.setStartingFareJson(StringUtils.isNotBlank(dto.getStartingFareJson()) ? dto.getStartingFareJson() : null); |
| | | update.setDynamicPricingJson(dto.getDynamicPricingJson()); |
| | | update.setIsDynamicPrice(dto.getIsDynamicPrice()); |
| | | this.updateById(update); |
| | | } |
| | | |