Przeglądaj źródła

价目表 调整

qxy 3 miesięcy temu
rodzic
commit
67a7c55dc3

+ 2 - 2
alien-entity/src/main/java/shop/alien/entity/store/StoreCuisine.java

@@ -27,8 +27,8 @@ public class StoreCuisine {
     private Integer id;
 
     @ApiModelProperty(value = "商户id")
-    @TableField("stroe_id")
-    private Integer stroeId;
+    @TableField("store_id")
+    private Integer storeId;
 
     @ApiModelProperty(value = "菜名")
     @TableField("name")

+ 10 - 2
alien-entity/src/main/java/shop/alien/entity/store/StorePrice.java

@@ -28,8 +28,8 @@ public class StorePrice {
     private Integer id;
 
     @ApiModelProperty(value = "商户id")
-    @TableField("stroe_id")
-    private Integer stroeId;
+    @TableField("store_id")
+    private Integer storeId;
 
     @ApiModelProperty(value = "名字")
     @TableField("name")
@@ -113,6 +113,14 @@ public class StorePrice {
     @ApiModelProperty("通用套餐列表")
     @TableField(exist = false)
     private List<StorePrice> storePriceList;
+
+    @ApiModelProperty("门店电话")
+    @TableField(exist = false)
+    private String storePhone;
+
+    @ApiModelProperty("门店名称")
+    @TableField(exist = false)
+    private String storeName;
 }
 
 

+ 6 - 0
alien-entity/src/main/java/shop/alien/entity/store/dto/CuisineDetailDto.java

@@ -39,5 +39,11 @@ public class CuisineDetailDto {
 
     @ApiModelProperty("美食套餐/单品列表")
     private List<StoreCuisine> storeCuisineList;
+
+    @ApiModelProperty("门店电话")
+    private String storePhone;
+
+    @ApiModelProperty("门店名称")
+    private String storeName;
 }
 

+ 1 - 1
alien-entity/src/main/java/shop/alien/mapper/StoreImgMapper.java

@@ -75,7 +75,7 @@ public interface StoreImgMapper extends BaseMapper<StoreImg> {
             "#{albumId}" +
             "</foreach>" +
             "</if>" +
-            "ORDER BY si.img_sort ASC" +
+            "ORDER BY si.updated_time DESC" +
             "</script>")
     List<StoreImg> selectOfficialAlbumImgWithName(@Param("storeId") Integer storeId,
                                                    @Param("imgType") Integer imgType,

+ 2 - 2
alien-entity/src/main/resources/mapper/StoreCuisineMapper.xml

@@ -7,7 +7,7 @@
     <!-- 通用查询映射结果 -->
     <resultMap id="BaseResultMap" type="shop.alien.entity.store.StoreCuisine">
         <id column="id" property="id" />
-        <result column="stroe_id" property="stroeId" />
+        <result column="store_id" property="storeId" />
         <result column="name" property="name" />
         <result column="total_price" property="totalPrice" />
         <result column="images" property="images" />
@@ -31,7 +31,7 @@
 
     <!-- 通用查询结果列 -->
     <sql id="Base_Column_List">
-        id, stroe_id, name, total_price, images, image_content, raw_json, detail_content,
+        id, store_id, name, total_price, images, image_content, raw_json, detail_content,
         extra_note, need_reserve, reserve_rule, people_limit, usage_rule, status, shelf_status,
         rejection_reason, delete_flag, created_user_id, updated_user_id, created_time, updated_time
     </sql>

+ 7 - 7
alien-store/src/main/java/shop/alien/store/controller/StoreCuisineController.java

@@ -130,7 +130,7 @@ public class StoreCuisineController {
     @ApiImplicitParams({
             @ApiImplicitParam(name = "pageNum", value = "页码", dataType = "int", paramType = "query", required = true),
             @ApiImplicitParam(name = "pageSize", value = "页容", dataType = "int", paramType = "query", required = true),
-            @ApiImplicitParam(name = "stroeId", value = "商户id", dataType = "Integer", paramType = "query"),
+            @ApiImplicitParam(name = "storeId", value = "商户id", dataType = "Integer", paramType = "query"),
             @ApiImplicitParam(name = "name", value = "菜名", dataType = "String", paramType = "query"),
             @ApiImplicitParam(name = "status", value = "状态:0-待审核 1-审核通过 2-审核拒绝", dataType = "Integer", paramType = "query"),
             @ApiImplicitParam(name = "type", value = "类型:1-美食 2-通用", dataType = "Integer", paramType = "query")
@@ -139,11 +139,11 @@ public class StoreCuisineController {
     public R<List<PriceListVo>> getPage(
             @RequestParam int pageNum,
             @RequestParam int pageSize,
-            @RequestParam(required = false) Integer stroeId,
+            @RequestParam(required = false) Integer storeId,
             @RequestParam(required = false) String name,
             @RequestParam(required = false) Integer status,
             @RequestParam(required = true) Integer type) {
-        log.info("StoreCuisineController.getPage?pageNum={},pageSize={},stroeId={},name={},status={},type={}", pageNum, pageSize, stroeId, name, status, type);
+        log.info("StoreCuisineController.getPage?pageNum={},pageSize={},stroeId={},name={},status={},type={}", pageNum, pageSize, storeId, name, status, type);
         List<PriceListVo> priceListVo = new ArrayList<>();
 
         if(type == 1){
@@ -151,8 +151,8 @@ public class StoreCuisineController {
             LambdaQueryWrapper<StoreCuisine> queryWrapper = new LambdaQueryWrapper<>();
             // 默认只查询已上架的菜品/套餐(shelf_status = 1)
             queryWrapper.eq(StoreCuisine::getShelfStatus, 1);
-            if (stroeId != null) {
-                queryWrapper.eq(StoreCuisine::getStroeId, stroeId);
+            if (storeId != null) {
+                queryWrapper.eq(StoreCuisine::getStoreId, storeId);
             }
             if (name != null && !name.isEmpty()) {
                 queryWrapper.like(StoreCuisine::getName, name);
@@ -176,8 +176,8 @@ public class StoreCuisineController {
         }else{
             Page<StorePrice> page = new Page<>(pageNum, pageSize);
             LambdaQueryWrapper<StorePrice> queryWrapper = new LambdaQueryWrapper<>();
-            if (stroeId != null) {
-                queryWrapper.eq(StorePrice::getStroeId, stroeId);
+            if (storeId != null) {
+                queryWrapper.eq(StorePrice::getStoreId, storeId);
             }
             if (name != null && !name.isEmpty()) {
                 queryWrapper.like(StorePrice::getName, name);

+ 22 - 12
alien-store/src/main/java/shop/alien/store/controller/StorePriceController.java

@@ -8,7 +8,9 @@ import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.web.bind.annotation.*;
 import shop.alien.entity.result.R;
+import shop.alien.entity.store.StoreInfo;
 import shop.alien.entity.store.StorePrice;
+import shop.alien.mapper.StoreInfoMapper;
 import shop.alien.store.service.StorePriceService;
 
 import java.util.List;
@@ -30,6 +32,8 @@ public class StorePriceController {
 
     private final StorePriceService storePriceService;
 
+    private final StoreInfoMapper storeInfoMapper;
+
     @ApiOperation("新增通用价目")
     @ApiOperationSupport(order = 1)
     @PostMapping("/save")
@@ -80,8 +84,14 @@ public class StorePriceController {
         log.info("StorePriceController.getById?id={}", id);
         StorePrice storePrice = storePriceService.getById(id);
         if (storePrice != null) {
-            List<StorePrice> storePrices = storePriceService.list(new LambdaQueryWrapper<StorePrice>().eq(StorePrice :: getStroeId, storePrice.getStroeId()));
+            List<StorePrice> storePrices = storePriceService.list(new LambdaQueryWrapper<StorePrice>().eq(StorePrice :: getStoreId, storePrice.getStoreId()));
             storePrice.setStorePriceList(storePrices);
+            //查询门店 获取 门店电话和门店名称
+            StoreInfo storeInfo = storeInfoMapper.selectOne(new LambdaQueryWrapper<StoreInfo>().eq(StoreInfo :: getId, storePrice.getStoreId()));
+            if(storeInfo != null){
+                storePrice.setStorePhone(storeInfo.getStoreTel());
+                storePrice.setStoreName(storeInfo.getStoreName());
+            }
             return R.data(storePrice);
         }
         return R.fail("查询失败");
@@ -117,7 +127,7 @@ public class StorePriceController {
     @ApiImplicitParams({
             @ApiImplicitParam(name = "pageNum", value = "页码", dataType = "int", paramType = "query", required = true),
             @ApiImplicitParam(name = "pageSize", value = "页容", dataType = "int", paramType = "query", required = true),
-            @ApiImplicitParam(name = "stroeId", value = "商户id", dataType = "Integer", paramType = "query"),
+            @ApiImplicitParam(name = "storeId", value = "商户id", dataType = "Integer", paramType = "query"),
             @ApiImplicitParam(name = "name", value = "名字", dataType = "String", paramType = "query"),
             @ApiImplicitParam(name = "status", value = "状态:0-待审核 1-审核通过 2-审核拒绝", dataType = "Integer", paramType = "query"),
             @ApiImplicitParam(name = "shelfStatus", value = "上下架状态:1-上架,2-下架", dataType = "Integer", paramType = "query")
@@ -126,16 +136,16 @@ public class StorePriceController {
     public R<IPage<StorePrice>> getPage(
             @RequestParam(defaultValue = "1") int pageNum,
             @RequestParam(defaultValue = "10") int pageSize,
-            @RequestParam(required = false) Integer stroeId,
+            @RequestParam(required = false) Integer storeId,
             @RequestParam(required = false) String name,
             @RequestParam(required = false) Integer status,
             @RequestParam(required = false) Integer shelfStatus) {
-        log.info("StorePriceController.getPage?pageNum={},pageSize={},stroeId={},name={},status={},shelfStatus={}",
-                pageNum, pageSize, stroeId, name, status, shelfStatus);
+        log.info("StorePriceController.getPage?pageNum={},pageSize={},storeId={},name={},status={},shelfStatus={}",
+                pageNum, pageSize, storeId, name, status, shelfStatus);
         Page<StorePrice> page = new Page<>(pageNum, pageSize);
         LambdaQueryWrapper<StorePrice> queryWrapper = new LambdaQueryWrapper<>();
-        if (stroeId != null) {
-            queryWrapper.eq(StorePrice::getStroeId, stroeId);
+        if (storeId != null) {
+            queryWrapper.eq(StorePrice::getStoreId, storeId);
         }
         if (name != null && !name.isEmpty()) {
             queryWrapper.like(StorePrice::getName, name);
@@ -154,19 +164,19 @@ public class StorePriceController {
     @ApiOperation("查询所有通用价目")
     @ApiOperationSupport(order = 7)
     @ApiImplicitParams({
-            @ApiImplicitParam(name = "stroeId", value = "商户id", dataType = "Integer", paramType = "query"),
+            @ApiImplicitParam(name = "storeId", value = "商户id", dataType = "Integer", paramType = "query"),
             @ApiImplicitParam(name = "status", value = "状态:0-待审核 1-审核通过 2-审核拒绝", dataType = "Integer", paramType = "query"),
             @ApiImplicitParam(name = "shelfStatus", value = "上下架状态:1-上架,2-下架", dataType = "Integer", paramType = "query")
     })
     @GetMapping("/list")
     public R<List<StorePrice>> list(
-            @RequestParam(required = false) Integer stroeId,
+            @RequestParam(required = false) Integer storeId,
             @RequestParam(required = false) Integer status,
             @RequestParam(required = false) Integer shelfStatus) {
-        log.info("StorePriceController.list?stroeId={},status={},shelfStatus={}", stroeId, status, shelfStatus);
+        log.info("StorePriceController.list?storeId={},status={},shelfStatus={}", storeId, status, shelfStatus);
         LambdaQueryWrapper<StorePrice> queryWrapper = new LambdaQueryWrapper<>();
-        if (stroeId != null) {
-            queryWrapper.eq(StorePrice::getStroeId, stroeId);
+        if (storeId != null) {
+            queryWrapper.eq(StorePrice::getStoreId, storeId);
         }
         if (status != null) {
             queryWrapper.eq(StorePrice::getStatus, status);

+ 12 - 1
alien-store/src/main/java/shop/alien/store/service/impl/StoreCuisineServiceImpl.java

@@ -10,11 +10,13 @@ import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import shop.alien.entity.store.StoreCuisine;
 import shop.alien.entity.store.StoreCuisineCombo;
+import shop.alien.entity.store.StoreInfo;
 import shop.alien.entity.store.dto.CategoryGroupDto;
 import shop.alien.entity.store.dto.CuisineComboDto;
 import shop.alien.entity.store.dto.CuisineDetailDto;
 import shop.alien.entity.store.dto.CuisineItemDto;
 import shop.alien.mapper.StoreCuisineMapper;
+import shop.alien.mapper.StoreInfoMapper;
 import shop.alien.store.service.StoreCuisineComboService;
 import shop.alien.store.service.StoreCuisineService;
 
@@ -42,6 +44,8 @@ public class StoreCuisineServiceImpl extends ServiceImpl<StoreCuisineMapper, Sto
 
     private final StoreCuisineMapper storeCuisineMapper;
 
+    private final StoreInfoMapper storeInfoMapper;
+
     /**
      * 新增美食(单品或套餐)
      */
@@ -129,9 +133,16 @@ public class StoreCuisineServiceImpl extends ServiceImpl<StoreCuisineMapper, Sto
         dto.setBaseInfo(base);
 
         //查询当前门店套餐/单品列表 详情头部使用
-        List<StoreCuisine> cuisineList = storeCuisineMapper.selectList(new LambdaQueryWrapper<StoreCuisine>().eq(StoreCuisine :: getStroeId, base.getStroeId()));
+        List<StoreCuisine> cuisineList = storeCuisineMapper.selectList(new LambdaQueryWrapper<StoreCuisine>().eq(StoreCuisine :: getStoreId, base.getStoreId()));
         dto.setStoreCuisineList(cuisineList);
 
+        //查询门店手机号 门店名称
+        StoreInfo storeInfo = storeInfoMapper.selectOne(new LambdaQueryWrapper<StoreInfo>().eq(StoreInfo :: getId, base.getStoreId()));
+        if(storeInfo !=null){
+            dto.setStorePhone(storeInfo.getStoreTel());
+            dto.setStoreName(storeInfo.getStoreName());
+        }
+
         // 单品:直接返回主信息,items 为空
         if (cuisineType != null && cuisineType == 1) {
             dto.setItems(Collections.emptyList());