Merge branch 'cc_20251103_open_api' into 'master'
fix:获取门店信息开放接口新增门店状态字段 See merge request hangzhou/java/custom_zxjp!181
This commit is contained in:
@@ -0,0 +1,77 @@
|
|||||||
|
package com.cool.store.enums;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Administrator on 2020/1/20.
|
||||||
|
*/
|
||||||
|
public enum StoreStatusEnum {
|
||||||
|
|
||||||
|
//营业
|
||||||
|
OPEN("open","在营"),
|
||||||
|
//闭店
|
||||||
|
CLOSED("closed","闭店解约"),
|
||||||
|
//未开业
|
||||||
|
NOT_OPEN("not_open","未开业"),
|
||||||
|
//迁址
|
||||||
|
CHANGE_ADDRESS("change_address","迁址"),
|
||||||
|
//退单
|
||||||
|
CHARGEBACK("chargeback","退单"),
|
||||||
|
//暂停营业
|
||||||
|
CLOSE_UP("close_up","暂停营业");
|
||||||
|
;
|
||||||
|
|
||||||
|
|
||||||
|
private final String value;
|
||||||
|
|
||||||
|
private final String name;
|
||||||
|
|
||||||
|
StoreStatusEnum(String value, String name) {
|
||||||
|
this.value = value;
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getValue() {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static StoreStatusEnum parse(String value) {
|
||||||
|
for (StoreStatusEnum storeStatusEnum : StoreStatusEnum.values()) {
|
||||||
|
if (storeStatusEnum.getValue().equals(value)) {
|
||||||
|
return storeStatusEnum;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getName(String value) {
|
||||||
|
for (StoreStatusEnum storeStatusEnum : StoreStatusEnum.values()) {
|
||||||
|
if (storeStatusEnum.getValue().equals(value)) {
|
||||||
|
return storeStatusEnum.name;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getCode(String flag) {
|
||||||
|
switch (flag) {
|
||||||
|
case "营业":
|
||||||
|
case "在营":
|
||||||
|
return "open";
|
||||||
|
case "闭店":
|
||||||
|
case "闭店解约":
|
||||||
|
return "closed";
|
||||||
|
case "未开业":
|
||||||
|
return "not_open";
|
||||||
|
case "迁址":
|
||||||
|
return "change_address";
|
||||||
|
case "退单":
|
||||||
|
return "chargeback";
|
||||||
|
case "暂停营业":
|
||||||
|
return "close_up";
|
||||||
|
}
|
||||||
|
return "open";
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -40,4 +40,8 @@ public class OldShopDAO {
|
|||||||
List<OldShopDO> list = oldShopMapper.selectByExample(example);
|
List<OldShopDO> list = oldShopMapper.selectByExample(example);
|
||||||
return list.isEmpty() ? null : list.get(0);
|
return list.isEmpty() ? null : list.get(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void insertSelective(OldShopDO oldShopDO) {
|
||||||
|
oldShopMapper.insertSelective(oldShopDO);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -56,4 +56,7 @@ public class StoreDTO {
|
|||||||
private String managerSupervisionName;
|
private String managerSupervisionName;
|
||||||
@ApiModelProperty("所属大区/分部")
|
@ApiModelProperty("所属大区/分部")
|
||||||
private String branchName;
|
private String branchName;
|
||||||
|
|
||||||
|
@ApiModelProperty("门店状态")
|
||||||
|
private String status;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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,13 +1,19 @@
|
|||||||
package com.cool.store.entity;
|
package com.cool.store.entity;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
import javax.persistence.*;
|
import javax.persistence.*;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@Table(name = "xfsg_old_shop")
|
@Table(name = "xfsg_old_shop")
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Builder
|
||||||
public class OldShopDO {
|
public class OldShopDO {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -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);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -59,6 +59,8 @@ public class ShopAccountServiceImpl implements ShopAccountService {
|
|||||||
ThirdXinGuanJiaService thirdXinGuanJiaService;
|
ThirdXinGuanJiaService thirdXinGuanJiaService;
|
||||||
@Resource
|
@Resource
|
||||||
private LineInfoDAO lineInfoDAO;
|
private LineInfoDAO lineInfoDAO;
|
||||||
|
@Resource
|
||||||
|
private StoreDao storeDao;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<ShopAccountDTO> getShopAccountByShopId(Long shopId) {
|
public List<ShopAccountDTO> getShopAccountByShopId(Long shopId) {
|
||||||
@@ -311,7 +313,17 @@ public class ShopAccountServiceImpl implements ShopAccountService {
|
|||||||
//查询老店关联表数据
|
//查询老店关联表数据
|
||||||
OldShopDO oldShopDO = oldShopDAO.getByCode(shopCode);
|
OldShopDO oldShopDO = oldShopDAO.getByCode(shopCode);
|
||||||
if (Objects.isNull(oldShopDO)) {
|
if (Objects.isNull(oldShopDO)) {
|
||||||
throw new ServiceException(ErrorCodeEnum.GET_YLS_CODE_FAIL);
|
StoreDO storeDO = storeDao.getByStoreNum(shopCode);
|
||||||
|
if (Objects.isNull(storeDO)) {
|
||||||
|
throw new ServiceException(ErrorCodeEnum.GET_YLS_CODE_FAIL);
|
||||||
|
}
|
||||||
|
oldShopDO = OldShopDO.builder()
|
||||||
|
.shopCode(shopCode)
|
||||||
|
.shopName(storeDO.getStoreName())
|
||||||
|
.mobile(storeDO.getTelephone())
|
||||||
|
.ylsShopCode("ZXA8_" + shopCode)
|
||||||
|
.build();
|
||||||
|
oldShopDAO.insertSelective(oldShopDO);
|
||||||
}
|
}
|
||||||
return oldShopDO.getYlsShopCode();
|
return oldShopDO.getYlsShopCode();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -399,6 +399,7 @@ public class StoreServiceImpl implements StoreService {
|
|||||||
dto.setJoinMode(JoinModeEnum.getByCode(store.getJoinModel()));
|
dto.setJoinMode(JoinModeEnum.getByCode(store.getJoinModel()));
|
||||||
dto.setBrand(FranchiseBrandEnum.getDescByCode(store.getJoinBrand()));
|
dto.setBrand(FranchiseBrandEnum.getDescByCode(store.getJoinBrand()));
|
||||||
dto.setOrderMiniProgramName(store.getMiniProgramOrderStoreName());
|
dto.setOrderMiniProgramName(store.getMiniProgramOrderStoreName());
|
||||||
|
dto.setStatus(StoreStatusEnum.getName(store.getStoreStatus()));
|
||||||
if (store.getRegionId() != null){
|
if (store.getRegionId() != null){
|
||||||
dto.setManagerSupervisionName(regionMap.get(store.getRegionId()));
|
dto.setManagerSupervisionName(regionMap.get(store.getRegionId()));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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