Merge #3 into master from cc_20251114_minor_req
fix:门店日营销数据 * cc_20251114_minor_req: (3 commits squashed) - fix:门店日营销数据 - fix:jackson反序列化配置忽略未定义字段 - fix:菜品市场数据新增字段 Signed-off-by: 王非凡 <accounts_67eba0c5fee9c49c80c8e2b4@mail.teambition.com> Reviewed-by: 苏竹红 <accounts_68551bf01395375227aee211@mail.teambition.com> Merged-by: 苏竹红 <accounts_68551bf01395375227aee211@mail.teambition.com> CR-link: https://codeup.aliyun.com/692ea314dec569489f6f167c/hangzhou/java/custom_zxjp/change/3
This commit is contained in:
@@ -18,4 +18,7 @@ public class LaunchDataDTO {
|
||||
|
||||
@ApiModelProperty("上新时间,yyyy-MM-dd")
|
||||
private String upSaleDate;
|
||||
|
||||
@ApiModelProperty("")
|
||||
private String upSaleTime;
|
||||
}
|
||||
|
||||
@@ -40,5 +40,8 @@ public class RevenueDataDTO {
|
||||
@ApiModelProperty("菜品列表")
|
||||
private List<LaunchDataDTO> otherRecipeLaunchDates;
|
||||
|
||||
@ApiModelProperty("下架")
|
||||
private List<LaunchDataDTO> otherDownDates;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.cool.store.dto.recipe;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 门店日销量查询DTO
|
||||
* </p>
|
||||
*
|
||||
* @author wangff
|
||||
* @since 2025/12/3
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class SalesVolumeDayQueryDTO {
|
||||
@ApiModelProperty("日期,yyyy-MM-dd")
|
||||
private String businessDate;
|
||||
|
||||
@ApiModelProperty("门店编码")
|
||||
private String storeCode;
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.cool.store.request.recipe;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 门店日销量Request
|
||||
* </p>
|
||||
*
|
||||
* @author wangff
|
||||
* @since 2025/12/3
|
||||
*/
|
||||
@Data
|
||||
public class SalesVolumeDayRequest {
|
||||
@ApiModelProperty("日期,yyyy-MM-dd")
|
||||
@NotBlank(message = "日期不能为空")
|
||||
private String businessDate;
|
||||
|
||||
@ApiModelProperty("门店id")
|
||||
@NotBlank(message = "门店id不能为空")
|
||||
private String storeId;
|
||||
}
|
||||
@@ -18,4 +18,7 @@ public class LaunchDataVO {
|
||||
|
||||
@ApiModelProperty("上新时间,yyyy-MM-dd")
|
||||
private String upSaleDate;
|
||||
|
||||
@ApiModelProperty("")
|
||||
private String upSaleTime;
|
||||
}
|
||||
|
||||
@@ -34,6 +34,9 @@ public class RevenueDataVO {
|
||||
@ApiModelProperty("菜品列表")
|
||||
private List<LaunchDataVO> otherRecipeLaunchDates;
|
||||
|
||||
@ApiModelProperty("下架")
|
||||
private List<LaunchDataVO> otherDownDates;
|
||||
|
||||
@ApiModelProperty("外卖实收")
|
||||
private BigDecimal takeoutReceivedAmt;
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.cool.store.config.rest;
|
||||
|
||||
import com.fasterxml.jackson.databind.DeserializationFeature;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
@@ -15,6 +16,7 @@ public class JacksonConfig {
|
||||
@Bean
|
||||
public ObjectMapper objectMapper() {
|
||||
ObjectMapper mapper = new ObjectMapper();
|
||||
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
|
||||
return mapper;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import com.cool.store.dto.FoodTokenDTO;
|
||||
import com.cool.store.dto.recipe.RecipeSpLaunchDTO;
|
||||
import com.cool.store.dto.store.StoreUserUpdateDTO;
|
||||
import com.cool.store.request.recipe.RevenueDataRequest;
|
||||
import com.cool.store.request.recipe.SalesVolumeDayRequest;
|
||||
import com.cool.store.response.caipin.StoreUserResponse;
|
||||
import com.cool.store.vo.recipe.RevenueDataVO;
|
||||
|
||||
@@ -45,4 +46,12 @@ public interface ThirdFoodService {
|
||||
* @return 服务包菜品上新DTO
|
||||
*/
|
||||
RecipeSpLaunchDTO getRecipeServiceLaunch(RevenueDataRequest request);
|
||||
|
||||
|
||||
/**
|
||||
* 门店销量日视图
|
||||
* @param request 请求request
|
||||
* @return 营收数据VO列表
|
||||
*/
|
||||
List<RevenueDataVO> storeSalesVolumeDay(SalesVolumeDayRequest request);
|
||||
}
|
||||
|
||||
@@ -7,11 +7,13 @@ 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.RevenueDataQueryDTO;
|
||||
import com.cool.store.dto.recipe.SalesVolumeDayQueryDTO;
|
||||
import com.cool.store.dto.store.StoreUserUpdateDTO;
|
||||
import com.cool.store.entity.StoreDO;
|
||||
import com.cool.store.enums.ErrorCodeEnum;
|
||||
import com.cool.store.exception.ServiceException;
|
||||
import com.cool.store.request.recipe.RevenueDataRequest;
|
||||
import com.cool.store.request.recipe.SalesVolumeDayRequest;
|
||||
import com.cool.store.response.caipin.StoreUserResponse;
|
||||
import com.cool.store.response.oppty.OpportunityApiResponse;
|
||||
import com.cool.store.service.ThirdFoodService;
|
||||
@@ -91,6 +93,17 @@ public class ThirdFoodServiceImpl implements ThirdFoodService {
|
||||
return executeApiCall(url, queryDTO, RecipeSpLaunchDTO.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<RevenueDataVO> storeSalesVolumeDay(SalesVolumeDayRequest request) {
|
||||
StoreDO storeDO = storeDao.getByStoreId(request.getStoreId());
|
||||
if (Objects.isNull(storeDO)) {
|
||||
throw new ServiceException(ErrorCodeEnum.STORE_NOT_FIND);
|
||||
}
|
||||
SalesVolumeDayQueryDTO queryDTO = new SalesVolumeDayQueryDTO(request.getBusinessDate(), storeDO.getStoreNum());
|
||||
String url = "/v1/store/business/day";
|
||||
List<RevenueDataDTO> list = executeApiCall(url, queryDTO, List.class);
|
||||
return BeanUtil.toList(list, RevenueDataVO.class, CopyOptions.create().setFieldMapping(Collections.singletonMap("storeCode", "storeNum")));
|
||||
}
|
||||
|
||||
private <T> T executeApiCall(String url, Object requestBody, Class<T> responseType) {
|
||||
// 1. 打印请求前日志
|
||||
|
||||
@@ -2,6 +2,7 @@ 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.SalesVolumeDayRequest;
|
||||
import com.cool.store.response.ResponseResult;
|
||||
import com.cool.store.service.ThirdFoodService;
|
||||
import com.cool.store.vo.recipe.RevenueDataVO;
|
||||
@@ -44,4 +45,10 @@ public class MiniDataBoardController {
|
||||
public ResponseResult<RecipeSpLaunchDTO> getRecipeSpLaunchData(@RequestBody @Valid RevenueDataRequest request) {
|
||||
return ResponseResult.success(thirdFoodService.getRecipeServiceLaunch(request));
|
||||
}
|
||||
|
||||
@ApiOperation("门店日销量")
|
||||
@PostMapping("/storeSalesVolumeDay")
|
||||
public ResponseResult<List<RevenueDataVO>> getStoreSalesVolumeDay(@RequestBody @Valid SalesVolumeDayRequest request) {
|
||||
return ResponseResult.success(thirdFoodService.storeSalesVolumeDay(request));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user