团购相关
This commit is contained in:
		| @ -3,6 +3,7 @@ package com.sczx.car.controller; | ||||
|  | ||||
| import com.baomidou.mybatisplus.core.metadata.IPage; | ||||
| import com.sczx.car.common.Result; | ||||
| import com.sczx.car.dto.CarModelPackageDTO; | ||||
| import com.sczx.car.dto.CarModelSimpleDTO; | ||||
| import com.sczx.car.dto.req.StoreCarModelReq; | ||||
| import com.sczx.car.service.CarModelService; | ||||
| @ -41,4 +42,10 @@ public class CarModelController { | ||||
|         return Result.ok(carModelService.getCarModelByModelId(modelId)); | ||||
|     } | ||||
|  | ||||
|     @ApiOperation(value = "根据美团抖音id查询车型套餐") | ||||
|     @GetMapping("/getCarModelByThireId") | ||||
|     public Result<CarModelPackageDTO> getCarModelByThireId(@RequestParam(name = "mtId") String mtId, | ||||
|                                                            @RequestParam(name = "dyId") String dyId){ | ||||
|     return Result.ok(carModelService.getCarModelByThireId(mtId, dyId)); | ||||
|     } | ||||
| } | ||||
|  | ||||
							
								
								
									
										23
									
								
								src/main/java/com/sczx/car/dto/CarModelPackageDTO.java
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										23
									
								
								src/main/java/com/sczx/car/dto/CarModelPackageDTO.java
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,23 @@ | ||||
| package com.sczx.car.dto; | ||||
|  | ||||
| import io.swagger.annotations.ApiModel; | ||||
| import io.swagger.annotations.ApiModelProperty; | ||||
| import lombok.Data; | ||||
|  | ||||
| @Data | ||||
| @ApiModel(value = "车型套餐对象") | ||||
| public class CarModelPackageDTO { | ||||
|  | ||||
|     @ApiModelProperty("车型ID") | ||||
|     private Long carModelId; | ||||
|  | ||||
|     @ApiModelProperty("套餐ID") | ||||
|     private Long carRuleId; | ||||
|  | ||||
|     @ApiModelProperty("美团商品ID") | ||||
|     private String mtProductId; | ||||
|  | ||||
|     @ApiModelProperty("抖音商品ID") | ||||
|     private String dyProductId; | ||||
|  | ||||
| } | ||||
| @ -2,6 +2,7 @@ package com.sczx.car.mapper; | ||||
|  | ||||
| import com.baomidou.mybatisplus.core.metadata.IPage; | ||||
| import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||||
| import com.sczx.car.dto.CarModelPackageDTO; | ||||
| import com.sczx.car.dto.CarModelSimpleDTO; | ||||
| import com.sczx.car.dto.req.StoreCarModelReq; | ||||
| import com.sczx.car.po.CarModelPO; | ||||
| @ -20,4 +21,5 @@ public interface CarModelMapper extends BaseMapper<CarModelPO> { | ||||
|  | ||||
|     IPage<CarModelSimpleDTO> pageCarModelSimpleDTO(Page<CarModelSimpleDTO> page, @Param("storeCarModelReq") StoreCarModelReq storeCarModelReq); | ||||
|  | ||||
|     CarModelPackageDTO getCarModelByThireId(@Param("mtId") String mtId,@Param("dyId") String dyId); | ||||
| } | ||||
|  | ||||
| @ -1,6 +1,7 @@ | ||||
| package com.sczx.car.repository; | ||||
|  | ||||
| import com.baomidou.mybatisplus.core.metadata.IPage; | ||||
| import com.sczx.car.dto.CarModelPackageDTO; | ||||
| import com.sczx.car.dto.CarModelSimpleDTO; | ||||
| import com.sczx.car.dto.req.StoreCarModelReq; | ||||
| import com.sczx.car.po.CarModelPO; | ||||
| @ -26,4 +27,6 @@ public interface CarModelRepo extends IService<CarModelPO> { | ||||
|      */ | ||||
|     IPage<CarModelSimpleDTO> pageCarModelSimpleDTO(StoreCarModelReq storeCarModelReq, Integer pageNo, Integer pageSize); | ||||
|  | ||||
|     CarModelPackageDTO getCarModelByThireId(String mtId, String dyId); | ||||
|  | ||||
| } | ||||
|  | ||||
| @ -2,6 +2,7 @@ package com.sczx.car.repository.impl; | ||||
|  | ||||
| import com.baomidou.mybatisplus.core.metadata.IPage; | ||||
| import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||||
| import com.sczx.car.dto.CarModelPackageDTO; | ||||
| import com.sczx.car.dto.CarModelSimpleDTO; | ||||
| import com.sczx.car.dto.req.StoreCarModelReq; | ||||
| import com.sczx.car.po.CarModelPO; | ||||
| @ -26,4 +27,9 @@ public class CarModelRepoImpl extends ServiceImpl<CarModelMapper, CarModelPO> im | ||||
|         Page<CarModelSimpleDTO> page = new Page<>(pageNo, pageSize); | ||||
|         return this.getBaseMapper().pageCarModelSimpleDTO(page, storeCarModelReq); | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public CarModelPackageDTO getCarModelByThireId(String mtId, String dyId) { | ||||
|         return this.getBaseMapper().getCarModelByThireId(mtId, dyId); | ||||
|     } | ||||
| } | ||||
|  | ||||
| @ -1,6 +1,7 @@ | ||||
| package com.sczx.car.service; | ||||
|  | ||||
| import com.baomidou.mybatisplus.core.metadata.IPage; | ||||
| import com.sczx.car.dto.CarModelPackageDTO; | ||||
| import com.sczx.car.dto.CarModelSimpleDTO; | ||||
| import com.sczx.car.dto.req.StoreCarModelReq; | ||||
|  | ||||
| @ -19,4 +20,7 @@ public interface CarModelService { | ||||
|      * @return | ||||
|      */ | ||||
|     CarModelSimpleDTO getCarModelByModelId(Long modelId); | ||||
|  | ||||
|  | ||||
|     CarModelPackageDTO getCarModelByThireId(String mtId, String dyId); | ||||
| } | ||||
|  | ||||
| @ -2,8 +2,10 @@ package com.sczx.car.service.impl; | ||||
|  | ||||
| import com.baomidou.mybatisplus.core.metadata.IPage; | ||||
| import com.sczx.car.convert.CarModelConvert; | ||||
| import com.sczx.car.dto.CarModelPackageDTO; | ||||
| import com.sczx.car.dto.CarModelSimpleDTO; | ||||
| import com.sczx.car.dto.req.StoreCarModelReq; | ||||
| import com.sczx.car.mapper.CarModelMapper; | ||||
| import com.sczx.car.po.CarModelPO; | ||||
| import com.sczx.car.repository.CarModelRepo; | ||||
| import com.sczx.car.service.CarModelService; | ||||
| @ -49,4 +51,10 @@ public class CarModelServiceImpl implements CarModelService { | ||||
|         CarModelPO carModelPO = carModelRepo.getById(modelId); | ||||
|         return CarModelConvert.INSTANCE.poToSimpleDTO(carModelPO); | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public CarModelPackageDTO getCarModelByThireId(String mtId, String dyId) { | ||||
|         CarModelPackageDTO carModelPackageDTO = carModelRepo.getCarModelByThireId(mtId, dyId); | ||||
|         return carModelPackageDTO; | ||||
|     } | ||||
| } | ||||
|  | ||||
| @ -38,4 +38,20 @@ | ||||
|         cm.id, s.id, s.store_number, cm.model_name, cm.brand_name | ||||
|     </select> | ||||
|  | ||||
|     <select id="getCarModelByThireId" resultType="com.sczx.car.dto.CarModelPackageDTO"> | ||||
|         SELECT | ||||
|             car_rule_id, | ||||
|             car_model_id | ||||
|         FROM | ||||
|             zc_car_model_package | ||||
|         <where> | ||||
|             <if test="mtId != null and mtId != ''"> | ||||
|                 and mt_product_id = #{mtId} | ||||
|             </if> | ||||
|             <if test="dyId != null and dyId != ''"> | ||||
|                 and dy_product_id = #{dyId} | ||||
|             </if> | ||||
|         </where> | ||||
|     </select> | ||||
|  | ||||
| </mapper> | ||||
|  | ||||
		Reference in New Issue
	
	Block a user