| | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "车辆说明1胎压说明 2灯光说明 3车身标识及清洁说明 4舱内清洁及消毒 5遗失物品上报 6车辆充电说明 7车辆检测说明 8=车辆运维规则") |
| | | @ApiModelProperty(value = "车辆说明1胎压说明 2灯光说明 3车身标识及清洁说明 4舱内清洁及消毒 5遗失物品上报 6车辆充电说明 7车辆检测说明 8=车辆保险标准说明 9=车辆年检标准说明 10=车辆保养标准说明 11=车辆运营资质标准说明") |
| | | private Integer descriptionType; |
| | | |
| | | @ApiModelProperty(value = "富文本内容") |
| | |
| | | @TableField("city_id") |
| | | private Integer cityId; |
| | | |
| | | @ApiModelProperty(value = "城市名称") |
| | | @TableField(exist = false) |
| | | private String cityName; |
| | | |
| | | @ApiModelProperty(value = "备注说明") |
| | | @TableField("remark") |
| | | private String remark; |
| | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.xiaopeng.common.core.web.domain.BaseModel; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("xp_system_setting") |
| | | @ApiModel(value="XpSystemSetting对象", description="系统设置表") |
| | | @ApiModel(value = "XpSystemSetting对象", description = "系统设置表") |
| | | public class XpSystemSetting extends BaseModel { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | |
| | | @TableField("arrive_time") |
| | | private Integer arriveTime; |
| | | |
| | | |
| | | |
| | | @ApiModelProperty(value = "常见问题首页展示数") |
| | | @TableField("head_show_count") |
| | | private Integer headShowCount; |
| | | |
| | | |
| | | @ApiModelProperty(value = "附近站点距离") |
| | | @TableField("near_point_distance") |
| | | private Integer nearPointDistance; |
| | | |
| | | |
| | | @ApiModelProperty(value = "吸附距离") |
| | | @TableField("adsorption_distance") |
| | | private Integer adsorptionDistance; |
| | | |
| | | @ApiModelProperty(value = "热修复状态 0-关闭 1-开始") |
| | | @TableField("hotfix_status") |
| | | private Integer hotfixStatus; |
| | | |
| | | @ApiModelProperty(value = "热修复开始时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @TableField("hotfix_start_time") |
| | | private LocalDateTime hotfixStartTime; |
| | | |
| | | @ApiModelProperty(value = "热修复结束时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @TableField("hotfix_end_time") |
| | | private LocalDateTime hotfixEndTime; |
| | | |
| | | } |
| | |
| | | import com.xiaopeng.common.core.domain.R; |
| | | import com.xiaopeng.maintenance.service.IXpVehicleDescriptionService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.checkerframework.checker.units.qual.A; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | @Api(tags = "车辆整备、充电、检测说明") |
| | | @RestController |
| | | @RequestMapping("/xp-vehicle-description") |
| | | public class XpVehicleDescriptionController { |
| | | |
| | | private final IXpVehicleDescriptionService xpVehicleDescriptionService; |
| | |
| | | this.xpVehicleDescriptionService = xpVehicleDescriptionService; |
| | | } |
| | | |
| | | @ApiOperation(value = "获取车辆整备、充电、检测说明",notes = "车辆说明1胎压说明 2灯光说明 3车身标识及清洁说明 4舱内清洁及消毒 5遗失物品上报 6车辆充电说明 7车辆检测说明 8=车辆运维规则",tags = {"运维APP-车辆管理"}) |
| | | @ApiOperation(value = "获取车辆整备、充电、检测、保险、年检、保养、运营资质说明",notes = "车辆说明1胎压说明 2灯光说明 3车身标识及清洁说明 4舱内清洁及消毒 5遗失物品上报 6车辆充电说明 7车辆检测说明 8=车辆保险标准说明 9=车辆年检标准说明 10=车辆保养标准说明 11=车辆运营资质标准说明",tags = {"运维APP-车辆管理"}) |
| | | @GetMapping("/api/v1/vehicle/vehicleDescription") |
| | | public R<XpVehicleDescription> getVehicleDescription(@RequestParam Integer descriptionType) { |
| | | XpVehicleDescription xpVehicleDescription = xpVehicleDescriptionService.getOne(Wrappers.lambdaQuery(XpVehicleDescription.class) |
| | |
| | | return R.ok(xpVehicleDescription); |
| | | } |
| | | |
| | | @ApiOperation(value = "获取车辆整备、充电、检测、保险、年检、保养、运营资质说明",notes = "车辆说明1胎压说明 2灯光说明 3车身标识及清洁说明 4舱内清洁及消毒 5遗失物品上报 6车辆充电说明 7车辆检测说明 8=车辆保险标准说明 9=车辆年检标准说明 10=车辆保养标准说明 11=车辆运营资质标准说明",tags = {"管理后台-车辆管理"}) |
| | | @GetMapping("/api/v1/vehicle-description/vehicleDescription") |
| | | @ApiImplicitParam(name = "descriptionType", value = "车辆说明1胎压说明 2灯光说明 3车身标识及清洁说明 4舱内清洁及消毒 5遗失物品上报 6车辆充电说明 7车辆检测说明 8=车辆保险标准说明 9=车辆年检标准说明 10=车辆保养标准说明 11=车辆运营资质标准说明", required = true, paramType = "query", dataTypeClass = Integer.class) |
| | | public R<XpVehicleDescription> getVehicleDescriptionByType(@RequestParam Integer descriptionType) { |
| | | XpVehicleDescription xpVehicleDescription = xpVehicleDescriptionService.getOne(Wrappers.lambdaQuery(XpVehicleDescription.class) |
| | | .eq(XpVehicleDescription::getDescriptionType, descriptionType) |
| | | .last("LIMIT 1")); |
| | | return R.ok(xpVehicleDescription); |
| | | } |
| | | |
| | | @ApiOperation(value = "保存车辆整备、充电、检测、保险、年检、保养、运营资质说明") |
| | | @PostMapping("/api/v1/vehicle-description/save") |
| | | public R<?> saveVehicleDescription(@RequestBody XpVehicleDescription xpVehicleDescription) { |
| | | if (xpVehicleDescription.getDescriptionType() == null) { |
| | | return R.fail("descriptionType不能为空"); |
| | | } |
| | | // 先查询是否存在 |
| | | XpVehicleDescription existing = xpVehicleDescriptionService.getOne(Wrappers.lambdaQuery(XpVehicleDescription.class) |
| | | .eq(XpVehicleDescription::getDescriptionType, xpVehicleDescription.getDescriptionType()) |
| | | .last("LIMIT 1")); |
| | | if (existing != null) { |
| | | // 存在则更新 |
| | | existing.setDescriptionContent(xpVehicleDescription.getDescriptionContent()); |
| | | xpVehicleDescriptionService.updateById(existing); |
| | | } else { |
| | | // 不存在则插入 |
| | | xpVehicleDescriptionService.save(xpVehicleDescription); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | } |
| | | |
| | |
| | | package com.xiaopeng.operation.controller; |
| | | |
| | | import com.xiaopeng.api.model.operation.XpAgreement; |
| | | import com.xiaopeng.common.core.domain.R; |
| | | import com.xiaopeng.common.core.web.controller.BaseController; |
| | | import com.xiaopeng.operation.dto.XpAgreementDTO; |
| | | import com.xiaopeng.operation.service.XpAgreementService; |
| | | import com.xiaopeng.operation.vo.XpAgreementVo; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.apiguardian.api.API; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.validation.Valid; |
| | | import java.util.List; |
| | | |
| | | @Slf4j |
| | | @Validated |
| | | @RestController |
| | | public class XpAgreementController extends BaseController { |
| | | |
| | |
| | | public R<XpAgreementVo> getAppContent(@ApiParam(name = "type", value = "类型 1=用户服务协议 2=平台隐私政策 ") @PathVariable Integer type) { |
| | | return R.ok(xpAgreementService.getContentByType(type)); |
| | | } |
| | | |
| | | @ApiOperation(value = "获取协议",tags = {"管理后台-内容中心"}) |
| | | @GetMapping("/api/v1/agreement/content/{type}") |
| | | public R<XpAgreement> getAgreementContent(@ApiParam(name = "type", value = "类型 1=用户服务协议 2=平台隐私政策 3=敏感个人信息处理情况说明 4=向第三方提供个人信息情况的说明 5=乘车须知 6=计费规则说明 ") @PathVariable Integer type) { |
| | | return R.ok(xpAgreementService.getAgreementContent(type)); |
| | | } |
| | | @ApiOperation(value = "保存协议",tags = {"管理后台-内容中心"}) |
| | | @PostMapping("/api/v1/agreement/save") |
| | | public R<?> saveAgreement(@RequestBody @Valid XpAgreementDTO dto){ |
| | | xpAgreementService.saveAgreement(dto); |
| | | return R.ok(); |
| | | } |
| | | } |
| | |
| | | import com.xiaopeng.api.model.operation.XpFrequentlyAskedQuestions; |
| | | import com.xiaopeng.api.model.operation.XpSystemSetting; |
| | | import com.xiaopeng.common.core.domain.R; |
| | | import com.xiaopeng.operation.dto.XpFrequentlyAskedQuestionsDTO; |
| | | import com.xiaopeng.operation.service.IXpFrequentlyAskedQuestionsService; |
| | | import com.xiaopeng.operation.service.XpSystemSettingService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/base/v1/mini-program") |
| | | @Api(tags = "常见问题") |
| | | public class XpFrequentlyAskedQuestionsController { |
| | | |
| | | private final IXpFrequentlyAskedQuestionsService xpFrequentlyAskedQuestionsService; |
| | |
| | | } |
| | | |
| | | |
| | | @GetMapping("/frequently-asked-questions/getList") |
| | | @GetMapping("/base/v1/mini-program/frequently-asked-questions/getList") |
| | | @ApiOperation(value = "获取常见问题列表",tags = {"常见问题列表"},response = XpFrequentlyAskedQuestions.class) |
| | | public R<List<XpFrequentlyAskedQuestions>> getList() { |
| | | XpSystemSetting systemSetting = xpSystemSettingService.getOne(null); |
| | | List<XpFrequentlyAskedQuestions> list = xpFrequentlyAskedQuestionsService.list(new LambdaQueryWrapper<XpFrequentlyAskedQuestions>().last("limit "+systemSetting.getHeadShowCount())); |
| | | return R.ok(list); |
| | | } |
| | | |
| | | @GetMapping("/api/v1/frequently-asked-questions/getList") |
| | | @ApiOperation(value = "获取常见问题列表",tags = {"管理后台-内容中心"},response = XpFrequentlyAskedQuestions.class) |
| | | public R<List<XpFrequentlyAskedQuestions>> getQuestionList() { |
| | | List<XpFrequentlyAskedQuestions> list = xpFrequentlyAskedQuestionsService.list(); |
| | | return R.ok(list); |
| | | } |
| | | |
| | | @ApiOperation(value = "保存常见问题") |
| | | @PostMapping("/api/v1/frequently-asked-questions/save") |
| | | public R<?> saveQuestion(@RequestBody XpFrequentlyAskedQuestionsDTO dto) { |
| | | xpFrequentlyAskedQuestionsService.saveQuestion(dto); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @ApiOperation(value = "删除常见问题") |
| | | @DeleteMapping("/api/v1/frequently-asked-questions/delete/{id}") |
| | | public R<?> deleteQuestion(@PathVariable Long id) { |
| | | xpFrequentlyAskedQuestionsService.removeById(id); |
| | | return R.ok(); |
| | | } |
| | | } |
| | |
| | | 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.IXpWhitelistService; |
| | | import com.xiaopeng.operation.service.XpPricingService; |
| | | import com.xiaopeng.operation.service.*; |
| | | import com.xiaopeng.operation.vo.PricingPageListVO; |
| | | import com.xiaopeng.operation.vo.SaveOrderVo; |
| | | import com.xiaopeng.unifiedverification.interceptor.XpClientCheck; |
| | |
| | | private final IXpGeoQueryEntityService xpGeoQueryEntityService; |
| | | private final UserResourcesClient userResourcesClient; |
| | | private final IXpWhitelistService xpWhitelistService; |
| | | private final XpOpenCityService xpOpenCityService; |
| | | |
| | | |
| | | public XpPricingController(XpPricingService xpPricingService, IXpGeoQueryEntityService xpGeoQueryEntityService, UserResourcesClient userResourcesClient, IXpWhitelistService xpWhitelistService) { |
| | | public XpPricingController(XpPricingService xpPricingService, IXpGeoQueryEntityService xpGeoQueryEntityService, UserResourcesClient userResourcesClient, IXpWhitelistService xpWhitelistService, XpRegionService xpRegionService, XpOpenCityService xpOpenCityService) { |
| | | this.xpPricingService = xpPricingService; |
| | | this.xpGeoQueryEntityService = xpGeoQueryEntityService; |
| | | this.userResourcesClient = userResourcesClient; |
| | | this.xpWhitelistService = xpWhitelistService; |
| | | this.xpOpenCityService = xpOpenCityService; |
| | | } |
| | | |
| | | |
| | |
| | | if (pricing == null) { |
| | | throw new ServiceException("定价不存在", I18nKeyConstant.PRICING_NOT_EXIST); |
| | | } |
| | | //获取城市信息 |
| | | String cityName = xpOpenCityService.getNameWithCityName(pricing.getCityId()); |
| | | pricing.setCityName(cityName); |
| | | return R.ok(pricing); |
| | | } |
| | | |
| | |
| | | package com.xiaopeng.operation.controller; |
| | | |
| | | import com.xiaopeng.api.model.operation.XpSystemSetting; |
| | | import com.xiaopeng.common.core.constant.CacheConstants; |
| | | import com.xiaopeng.common.core.domain.R; |
| | | import com.xiaopeng.common.core.web.controller.BaseController; |
| | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | @Slf4j |
| | | @Validated |
| | | @RestController |
| | | @RequestMapping("") |
| | | @Api(tags = "系统设置模块") |
| | | public class XpSystemSettingController extends BaseController { |
| | | |
| | | // 系统设置实现类 |
| | |
| | | return R.ok(new CustomerServicePhoneVo(xpSystemSettingService.getCustomerServicePhone())); |
| | | } |
| | | } |
| | | |
| | | @ApiOperation(value = "获取系统配置、热修复", tags = {"管理后台-系统"}) |
| | | @GetMapping("/api/v1/systemSetting") |
| | | public R<XpSystemSetting> getSystemSetting(){ |
| | | return R.ok(xpSystemSettingService.lambdaQuery().last("limit 1").one()); |
| | | } |
| | | |
| | | } |
| | |
| | | package com.xiaopeng.operation.dto; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "基础价格json配置", required = true, notes = "{\n" + |
| | | " \"num3\": \"起步价数值1\",\n" + |
| | | " \"num4\": \"起步价数值2\",\n" + |
| | | " \"num5\": \"起步价数值3\",\n" + |
| | | " \"num6\": \"起步价数值4\",\n" + |
| | |
| | | " \"num7\": \"起步价数值5\"\n" + |
| | | " }\n" + |
| | | "]") |
| | | @NotBlank(message = "起步价json配置不能为空") |
| | | private String startingFareJson; |
| | | |
| | | @ApiModelProperty(value = "动态价格json配置", required = true, notes = " {\n" + |
| | |
| | | " }") |
| | | @NotBlank(message = "动态价格json配置不能为空") |
| | | private String dynamicPricingJson; |
| | | |
| | | @ApiModelProperty(value = "是否动态价格 0否 1是") |
| | | private Integer isDynamicPrice; |
| | | |
| | | } |
| New file |
| | |
| | | package com.xiaopeng.operation.dto; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | | /** |
| | | * @author MiTao |
| | | * @date 2026-02-25 14:41 |
| | | * |
| | | */ |
| | | @Data |
| | | @ApiModel("协议数据传输对象") |
| | | public class XpAgreementDTO { |
| | | @NotNull(message = "协议类型不能为空") |
| | | @ApiModelProperty(value = "类型 1=用户服务协议 2=平台隐私政策 3=敏感个人信息处理情况说明 4=向第三方提供个人信息情况的说明 5=乘车须知 6=计费规则说明") |
| | | private Integer contentType; |
| | | |
| | | @NotBlank(message = "协议内容不能为空") |
| | | @ApiModelProperty(value = "内容") |
| | | private String content; |
| | | } |
| New file |
| | |
| | | package com.xiaopeng.operation.dto; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.xiaopeng.api.model.operation.XpFrequentlyAskedQuestions; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author MiTao |
| | | * @date 2026-02-25 15:12 |
| | | * |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "常见问题数据传输对象") |
| | | public class XpFrequentlyAskedQuestionsDTO { |
| | | @ApiModelProperty(value = "常见问题列表") |
| | | private List<XpFrequentlyAskedQuestions> frequentlyAskedQuestionsList; |
| | | |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.xiaopeng.api.model.operation.XpFrequentlyAskedQuestions; |
| | | import com.xiaopeng.operation.dto.XpFrequentlyAskedQuestionsDTO; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface IXpFrequentlyAskedQuestionsService extends IService<XpFrequentlyAskedQuestions> { |
| | | |
| | | void saveQuestion(XpFrequentlyAskedQuestionsDTO dto); |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.xiaopeng.api.model.operation.XpAgreement; |
| | | import com.xiaopeng.operation.dto.XpAgreementDTO; |
| | | import com.xiaopeng.operation.vo.XpAgreementVo; |
| | | |
| | | import javax.validation.Valid; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | */ |
| | | List<XpAgreementVo> getContentByTypeAll(); |
| | | |
| | | /** |
| | | * 根据类型获取配置 |
| | | * @param type |
| | | * @return |
| | | */ |
| | | XpAgreement getAgreementContent(Integer type); |
| | | |
| | | |
| | | /** |
| | | * 保存协议 |
| | | * @param dto |
| | | */ |
| | | void saveAgreement(@Valid XpAgreementDTO dto); |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | void upDown(Long id, Integer status); |
| | | |
| | | /** |
| | | * 获取开通城市名称,如果开通城市层级是区级,则返回市级名称>区名称 |
| | | * @param cityId |
| | | * @return |
| | | */ |
| | | String getNameWithCityName(Integer cityId); |
| | | } |
| | |
| | | package com.xiaopeng.operation.service.impl; |
| | | |
| | | |
| | | import cn.hutool.core.bean.BeanUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.xiaopeng.operation.dto.XpAgreementDTO; |
| | | import com.xiaopeng.operation.mapper.XpAgreementMapper; |
| | | import com.xiaopeng.api.model.operation.XpAgreement; |
| | | import com.xiaopeng.operation.service.XpAgreementService; |
| | | import com.xiaopeng.operation.vo.XpAgreementVo; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | } |
| | | return xpAgreementVos; |
| | | } |
| | | |
| | | /** |
| | | * 根据类型获取配置 |
| | | * @param type |
| | | * @return |
| | | */ |
| | | @Override |
| | | public XpAgreement getAgreementContent(Integer type) { |
| | | return this.lambdaQuery().eq(XpAgreement::getContentType, type).last("limit 1").one(); |
| | | } |
| | | |
| | | @Override |
| | | public void saveAgreement(XpAgreementDTO dto) { |
| | | //根据类型查询协议 |
| | | Optional<XpAgreement> opt = this.lambdaQuery().eq(XpAgreement::getContentType, dto.getContentType()).last("limit 1").oneOpt(); |
| | | |
| | | //如果存在则更新,不存在则新增 |
| | | if (opt.isPresent()) { |
| | | XpAgreement xpAgreement = opt.get(); |
| | | xpAgreement.setContent(dto.getContent()); |
| | | updateById(xpAgreement); |
| | | } else { |
| | | XpAgreement xpAgreement = BeanUtil.copyProperties(dto, XpAgreement.class); |
| | | this.save(xpAgreement); |
| | | } |
| | | } |
| | | } |
| | |
| | | package com.xiaopeng.operation.service.impl; |
| | | |
| | | import com.xiaopeng.api.model.operation.XpFrequentlyAskedQuestions; |
| | | import com.xiaopeng.operation.dto.XpFrequentlyAskedQuestionsDTO; |
| | | import com.xiaopeng.operation.mapper.XpFrequentlyAskedQuestionsMapper; |
| | | import com.xiaopeng.operation.service.IXpFrequentlyAskedQuestionsService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.xiaopeng.operation.service.IXpFrequentlyAskedQuestionsService; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | @Service |
| | | public class XpFrequentlyAskedQuestionsServiceImpl extends ServiceImpl<XpFrequentlyAskedQuestionsMapper, XpFrequentlyAskedQuestions> implements IXpFrequentlyAskedQuestionsService { |
| | | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @Override |
| | | public void saveQuestion(XpFrequentlyAskedQuestionsDTO dto) { |
| | | List<XpFrequentlyAskedQuestions> frequentlyAskedQuestionsList = dto.getFrequentlyAskedQuestionsList(); |
| | | saveOrUpdateBatch(frequentlyAskedQuestionsList); |
| | | } |
| | | } |
| | |
| | | public void upDown(Long id, Integer status) { |
| | | lambdaUpdate().eq(XpOpenCity::getId, id).set(XpOpenCity::getStatus, status).update(); |
| | | } |
| | | |
| | | @Override |
| | | public String getNameWithCityName(Integer cityId) { |
| | | String cityName = ""; |
| | | XpOpenCity openCity = getById(cityId); |
| | | if (Objects.nonNull(openCity)) { |
| | | if (StringUtils.isNotBlank(openCity.getDistrictCode())) { |
| | | cityName = openCity.getCityName() + ">" + openCity.getDistrictName(); |
| | | } else { |
| | | cityName = openCity.getCityName(); |
| | | } |
| | | } |
| | | return cityName; |
| | | } |
| | | } |
| | |
| | | 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); |
| | | } |
| | | |
| | |
| | | public class PricingPageListVO implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value = "id") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "创建时间") |
| | | private Date createTime; |
| | | |
| | |
| | | |
| | | <select id="pageList" resultType="com.xiaopeng.operation.vo.PricingPageListVO"> |
| | | SELECT |
| | | p.id, |
| | | p.create_time AS createTime, |
| | | p.vehicle_model AS vehicleModel, |
| | | CASE |
| | |
| | | id, vehicle_code, vehicle_vin, plate_number, vehicle_model, vehicle_color, vehicle_pictures, |
| | | procurement_source, remarks, annual_inspection_date, insurance_company, insurance_phone, |
| | | insurance_end_time, inspection_attachments, policy_information, electronic_id, |
| | | operation_qualification, qualification_expire_time, status, operating_status,mileageRange, |
| | | operation_qualification, qualification_expire_time, status, operating_status,mileage_range, |
| | | warehousing_time, vehicle_type, accept_or_test, accept_or_test_status, current_electricity, |
| | | is_deleted, create_time, update_time, create_by, update_by |
| | | </sql> |