fix:菜品市场菜品服务包上新接口
This commit is contained in:
@@ -0,0 +1,34 @@
|
|||||||
|
package com.cool.store.dto.recipe;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 菜品上新DTO
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wangff
|
||||||
|
* @since 2025/11/3
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class RecipeLaunchDTO {
|
||||||
|
@ApiModelProperty("商品编码")
|
||||||
|
private String goodsCode;
|
||||||
|
|
||||||
|
@ApiModelProperty("商品图片")
|
||||||
|
private String goodsImageUrl;
|
||||||
|
|
||||||
|
@ApiModelProperty("商品名称")
|
||||||
|
private String goodsName;
|
||||||
|
|
||||||
|
@ApiModelProperty("上新时间")
|
||||||
|
private String launchTime;
|
||||||
|
|
||||||
|
@ApiModelProperty("单日最高销量")
|
||||||
|
private Integer maxQty;
|
||||||
|
|
||||||
|
@ApiModelProperty("销量总计")
|
||||||
|
private Integer sumQty;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
package com.cool.store.dto.recipe;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 服务包菜品上新DTO
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wangff
|
||||||
|
* @since 2025/11/3
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class RecipeSpLaunchDTO {
|
||||||
|
@ApiModelProperty("菜品上新记录")
|
||||||
|
private List<RecipeLaunchDTO> recipeRecordList;
|
||||||
|
|
||||||
|
@ApiModelProperty("服务包执行记录")
|
||||||
|
private List<ServicePackageExecuteDTO> spRecordList;
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
package com.cool.store.dto.recipe;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 服务包执行DTO
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author wangff
|
||||||
|
* @since 2025/11/3
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class ServicePackageExecuteDTO {
|
||||||
|
@ApiModelProperty("服务包执行时间")
|
||||||
|
private String executeTime;
|
||||||
|
|
||||||
|
@ApiModelProperty("服务包图片")
|
||||||
|
private String spImage;
|
||||||
|
|
||||||
|
@ApiModelProperty("服务包名称")
|
||||||
|
private String spName;
|
||||||
|
}
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.cool.store.service;
|
package com.cool.store.service;
|
||||||
|
|
||||||
import com.cool.store.dto.FoodTokenDTO;
|
import com.cool.store.dto.FoodTokenDTO;
|
||||||
|
import com.cool.store.dto.recipe.RecipeSpLaunchDTO;
|
||||||
import com.cool.store.dto.store.StoreUserUpdateDTO;
|
import com.cool.store.dto.store.StoreUserUpdateDTO;
|
||||||
import com.cool.store.request.recipe.RevenueDataRequest;
|
import com.cool.store.request.recipe.RevenueDataRequest;
|
||||||
import com.cool.store.response.caipin.StoreUserResponse;
|
import com.cool.store.response.caipin.StoreUserResponse;
|
||||||
@@ -37,4 +38,11 @@ public interface ThirdFoodService {
|
|||||||
* @return 营收数据VO列表
|
* @return 营收数据VO列表
|
||||||
*/
|
*/
|
||||||
List<RevenueDataVO> getRevenueData(RevenueDataRequest request);
|
List<RevenueDataVO> getRevenueData(RevenueDataRequest request);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询菜品服务包上新数据
|
||||||
|
* @param request 请求request
|
||||||
|
* @return 服务包菜品上新DTO
|
||||||
|
*/
|
||||||
|
RecipeSpLaunchDTO getRecipeServiceLaunch(RevenueDataRequest request);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import cn.hutool.core.bean.copier.CopyOptions;
|
|||||||
import cn.hutool.core.util.RandomUtil;
|
import cn.hutool.core.util.RandomUtil;
|
||||||
import com.cool.store.dao.StoreDao;
|
import com.cool.store.dao.StoreDao;
|
||||||
import com.cool.store.dto.FoodTokenDTO;
|
import com.cool.store.dto.FoodTokenDTO;
|
||||||
|
import com.cool.store.dto.recipe.RecipeSpLaunchDTO;
|
||||||
import com.cool.store.dto.recipe.RevenueDataDTO;
|
import com.cool.store.dto.recipe.RevenueDataDTO;
|
||||||
import com.cool.store.dto.recipe.RevenueDataQueryDTO;
|
import com.cool.store.dto.recipe.RevenueDataQueryDTO;
|
||||||
import com.cool.store.dto.store.StoreUserUpdateDTO;
|
import com.cool.store.dto.store.StoreUserUpdateDTO;
|
||||||
@@ -79,6 +80,17 @@ public class ThirdFoodServiceImpl implements ThirdFoodService {
|
|||||||
return BeanUtil.toList(list, RevenueDataVO.class, CopyOptions.create().setFieldMapping(Collections.singletonMap("storeCode", "storeNum")));
|
return BeanUtil.toList(list, RevenueDataVO.class, CopyOptions.create().setFieldMapping(Collections.singletonMap("storeCode", "storeNum")));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public RecipeSpLaunchDTO getRecipeServiceLaunch(RevenueDataRequest request) {
|
||||||
|
StoreDO storeDO = storeDao.getByStoreId(request.getStoreId());
|
||||||
|
if (Objects.isNull(storeDO)) {
|
||||||
|
throw new ServiceException(ErrorCodeEnum.STORE_NOT_FIND);
|
||||||
|
}
|
||||||
|
RevenueDataQueryDTO queryDTO = new RevenueDataQueryDTO(storeDO.getStoreNum(), request.getBusinessDateFrom(), request.getBusinessDateTo());
|
||||||
|
String url = "/v1/store/business/spRecipeList";
|
||||||
|
return executeApiCall(url, queryDTO, RecipeSpLaunchDTO.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private <T> T executeApiCall(String url, Object requestBody, Class<T> responseType) {
|
private <T> T executeApiCall(String url, Object requestBody, Class<T> responseType) {
|
||||||
// 1. 打印请求前日志
|
// 1. 打印请求前日志
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.cool.store.controller.webc;
|
package com.cool.store.controller.webc;
|
||||||
|
|
||||||
|
import com.cool.store.dto.recipe.RecipeSpLaunchDTO;
|
||||||
import com.cool.store.request.recipe.RevenueDataRequest;
|
import com.cool.store.request.recipe.RevenueDataRequest;
|
||||||
import com.cool.store.response.ResponseResult;
|
import com.cool.store.response.ResponseResult;
|
||||||
import com.cool.store.service.ThirdFoodService;
|
import com.cool.store.service.ThirdFoodService;
|
||||||
@@ -37,4 +38,10 @@ public class MiniDataBoardController {
|
|||||||
public ResponseResult<List<RevenueDataVO>> getStoreRevenueData(@RequestBody @Valid RevenueDataRequest request) {
|
public ResponseResult<List<RevenueDataVO>> getStoreRevenueData(@RequestBody @Valid RevenueDataRequest request) {
|
||||||
return ResponseResult.success(thirdFoodService.getRevenueData(request));
|
return ResponseResult.success(thirdFoodService.getRevenueData(request));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation("查询菜品服务包上新数据")
|
||||||
|
@PostMapping("/recipeSpLaunch")
|
||||||
|
public ResponseResult<RecipeSpLaunchDTO> getRecipeSpLaunchData(@RequestBody @Valid RevenueDataRequest request) {
|
||||||
|
return ResponseResult.success(thirdFoodService.getRecipeServiceLaunch(request));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user