Bläddra i källkod

feat(system): 增加商品关联门店和服务类型信息

- 在 PhysicalProductServiceImpl 中引入门店和标签服务依赖
- 查询商品列表时补充门店名称和服务类型名称
- 更新 PhysicalProductVo 增加 storeName 和 typeName 字段
- 调整导出 Excel 的列标题并隐藏部分字段
- 修改服务标签控制器及其实现类的注释为服务类型
- 定时任务增加查询类目和标签 ID 并设置赛事相关属性
fugui001 4 dagar sedan
förälder
incheckning
b2736a8fcb

+ 25 - 6
ruoyi-modules/ruoyi-system/src/main/java/org/dromara/job/business/ScheduleTask.java

@@ -65,6 +65,8 @@ public class ScheduleTask {
     @Autowired
     IScheduleConfigService scheduleConfigService;
 
+    @Autowired
+    TournamentCategoryTagTemplateMapper tournamentCategoryTagTemplateMapper;
 
     /**
      * 生成 schedule_execution  查询所有的配置schedule_config  根据生成天数进行生成
@@ -377,12 +379,29 @@ public class ScheduleTask {
 
                 bo.setItemsPrizeList(prizeList);
                 bo.setCompetitionBg(tournamentsVo.getCompetitionBg());
-                // 调用已有的插入方法
-                if (!iTournamentsService.insertByBo(bo)) {
-                    log.error("赛事插入失败");
-                    scheduleExecutionMapper.updateSelective(execId, "FAILED");
-                    return false;
-                }
+
+
+       /*     private  List<Long> tagId;
+            private  List<Long> categoryId;
+
+            // 重复买入:<0不可重复买入,0-不限制,>0限制次数
+            private Integer rebuy;
+            //0-默认不开启延迟看牌,1-开启
+            private Integer delayShow;*/
+
+            //查询类目和标签ID
+            List<Long> categoryList = tournamentCategoryTagTemplateMapper.selectCategoryOrTagId("CATEGORY", tournamentsVo.getId());
+            bo.setCategoryId(categoryList);
+            List<Long> tagList = tournamentCategoryTagTemplateMapper.selectCategoryOrTagId("TAG", tournamentsVo.getId());
+            bo.setTagId(tagList);
+            bo.setRebuy(tournamentsVo.getRebuy());
+            bo.setDelayShow(tournamentsVo.getDelayShow());
+            // 调用已有的插入方法
+            if (!iTournamentsService.insertByBo(bo)) {
+                log.error("赛事插入失败");
+                scheduleExecutionMapper.updateSelective(execId, "FAILED");
+                return false;
+            }
 
             ScheduleTournamentsReletion scheduleTournamentsReletion=new ScheduleTournamentsReletion();
             scheduleTournamentsReletion.setTournamentsId(bo.getId());

+ 11 - 12
ruoyi-modules/ruoyi-system/src/main/java/org/dromara/physical/controller/PhysicalTagController.java

@@ -7,7 +7,6 @@ import jakarta.servlet.http.HttpServletResponse;
 import jakarta.validation.constraints.*;
 import cn.dev33.satoken.annotation.SaCheckPermission;
 import org.dromara.physical.domain.bo.PhysicalTagBo;
-import org.dromara.physical.domain.vo.PhysicalBlindLevelsVo;
 import org.dromara.physical.domain.vo.PhysicalTagVo;
 import org.dromara.physical.service.IPhysicalTagService;
 import org.springframework.web.bind.annotation.*;
@@ -24,7 +23,7 @@ import org.dromara.common.excel.utils.ExcelUtil;
 import org.dromara.common.mybatis.core.page.TableDataInfo;
 
 /**
- * 服务标签
+ * 服务类型
  *
  * @author Lion Li
  * @date 2025-12-02
@@ -38,7 +37,7 @@ public class PhysicalTagController extends BaseController {
     private final IPhysicalTagService physicalTagService;
 
     /**
-     * 查询服务标签列表
+     * 查询服务服务类型
      */
     @SaCheckPermission("physical:tag:list")
     @GetMapping("/list")
@@ -47,10 +46,10 @@ public class PhysicalTagController extends BaseController {
     }
 
     /**
-     * 导出服务标签列表
+     * 导出服务类型列表
      */
     @SaCheckPermission("physical:tag:export")
-    @Log(title = "服务标签", businessType = BusinessType.EXPORT)
+    @Log(title = "服务类型", businessType = BusinessType.EXPORT)
     @PostMapping("/export")
     public void export(PhysicalTagBo bo, HttpServletResponse response) {
         List<PhysicalTagVo> list = physicalTagService.queryList(bo);
@@ -58,7 +57,7 @@ public class PhysicalTagController extends BaseController {
     }
 
     /**
-     * 获取服务标签详细信息
+     * 获取服务类型详细信息
      *
      * @param id 主键
      */
@@ -70,10 +69,10 @@ public class PhysicalTagController extends BaseController {
     }
 
     /**
-     * 新增服务标签
+     * 新增服务类型
      */
     @SaCheckPermission("physical:tag:add")
-    @Log(title = "服务标签", businessType = BusinessType.INSERT)
+    @Log(title = "服务类型", businessType = BusinessType.INSERT)
     @RepeatSubmit()
     @PostMapping()
     public R<Void> add(@Validated(AddGroup.class) @RequestBody PhysicalTagBo bo) {
@@ -81,10 +80,10 @@ public class PhysicalTagController extends BaseController {
     }
 
     /**
-     * 修改服务标签
+     * 修改服务类型
      */
     @SaCheckPermission("physical:tag:edit")
-    @Log(title = "服务标签", businessType = BusinessType.UPDATE)
+    @Log(title = "服务类型", businessType = BusinessType.UPDATE)
     @RepeatSubmit()
     @PutMapping()
     public R<Void> edit(@Validated(EditGroup.class) @RequestBody PhysicalTagBo bo) {
@@ -92,12 +91,12 @@ public class PhysicalTagController extends BaseController {
     }
 
     /**
-     * 删除服务标签
+     * 删除服务类型
      *
      * @param ids 主键串
      */
     @SaCheckPermission("physical:tag:remove")
-    @Log(title = "服务标签", businessType = BusinessType.DELETE)
+    @Log(title = "服务类型", businessType = BusinessType.DELETE)
     @DeleteMapping("/{ids}")
     public R<Void> remove(@NotEmpty(message = "主键不能为空")
                           @PathVariable Long[] ids) {

+ 15 - 7
ruoyi-modules/ruoyi-system/src/main/java/org/dromara/physical/domain/vo/PhysicalProductVo.java

@@ -30,43 +30,49 @@ public class PhysicalProductVo implements Serializable {
     /**
      * 主键ID
      */
-    @ExcelProperty(value = "主键ID")
+    @ExcelProperty(value = "编号")
     private Long id;
 
     /**
      * 商品名称,最多50字
      */
-    @ExcelProperty(value = "商品名称,最多50字")
+    @ExcelProperty(value = "商品名称")
     private String name;
 
+    @ExcelProperty(value = "服务类型")
+    private String typeName;
+
+    @ExcelProperty(value = "门店")
+    private String storeName;
+
     /**
      * 商品类型ID,外键关联product_type
      */
-    @ExcelProperty(value = "商品类型ID,外键关联product_type")
+    //@ExcelProperty(value = "商品类型ID,外键关联product_type")
     private Long typeId;
 
     /**
      * 门店ID,外键关联store
      */
-    @ExcelProperty(value = "门店ID,外键关联store")
+    //@ExcelProperty(value = "门店ID,外键关联store")
     private Long storeId;
 
     /**
      * 商品说明,最多200字
      */
-    @ExcelProperty(value = "商品说明,最多200字")
+    @ExcelProperty(value = "商品说明")
     private String description;
 
     /**
      * 剩余库存,最大9999
      */
-    @ExcelProperty(value = "剩余库存,最大9999")
+    @ExcelProperty(value = "剩余库存")
     private Long stock;
 
     /**
      * 商品价值,最大999
      */
-    @ExcelProperty(value = "商品价值,最大999")
+    @ExcelProperty(value = "商品价值")
     private BigDecimal price;
 
     /**
@@ -86,4 +92,6 @@ public class PhysicalProductVo implements Serializable {
      */
     private List<PhysicalProductImageVo> productDetailImg;
 
+
+
 }

+ 31 - 1
ruoyi-modules/ruoyi-system/src/main/java/org/dromara/physical/service/impl/PhysicalProductServiceImpl.java

@@ -14,8 +14,12 @@ import org.dromara.physical.domain.bo.PhysicalProductBo;
 import org.dromara.physical.domain.bo.PhysicalProductImageBo;
 import org.dromara.physical.domain.vo.PhysicalProductImageVo;
 import org.dromara.physical.domain.vo.PhysicalProductVo;
+import org.dromara.physical.domain.vo.PhysicalStoreVo;
+import org.dromara.physical.domain.vo.PhysicalTagVo;
 import org.dromara.physical.mapper.PhysicalProductMapper;
 import org.dromara.physical.service.IPhysicalProductService;
+import org.dromara.physical.service.IPhysicalStoreService;
+import org.dromara.physical.service.IPhysicalTagService;
 import org.dromara.system.service.ISysOssService;
 import org.springframework.stereotype.Service;
 
@@ -37,6 +41,8 @@ public class PhysicalProductServiceImpl implements IPhysicalProductService {
     private final PhysicalProductMapper baseMapper;
     private final PhysicalProductImageServiceImpl physicalProductImageService;
     private final ISysOssService ossService;
+    private final IPhysicalStoreService iPhysicalStoreService;
+    private final IPhysicalTagService physicalTagService;
     /**
      * 查询商品
      *
@@ -66,6 +72,19 @@ public class PhysicalProductServiceImpl implements IPhysicalProductService {
     public TableDataInfo<PhysicalProductVo> queryPageList(PhysicalProductBo bo, PageQuery pageQuery) {
         LambdaQueryWrapper<PhysicalProduct> lqw = buildQueryWrapper(bo);
         Page<PhysicalProductVo> result = baseMapper.selectPhysicalProductPage(pageQuery.build(), lqw);
+        List<PhysicalProductVo> physicalProductVoList = result.getRecords();
+        for (PhysicalProductVo physicalProductVo : physicalProductVoList) {
+            Long storeId = physicalProductVo.getStoreId();
+            PhysicalStoreVo physicalStoreVo = iPhysicalStoreService.queryById(storeId);
+            if(physicalStoreVo!=null){
+                physicalProductVo.setStoreName(physicalStoreVo.getName());
+            }
+            PhysicalTagVo physicalTagVo = physicalTagService.queryById(physicalProductVo.getTypeId());
+            if(physicalTagVo!=null){
+                physicalProductVo.setTypeName(physicalTagVo.getServiceName());
+            }
+        }
+
         return TableDataInfo.build(result);
     }
 
@@ -78,7 +97,18 @@ public class PhysicalProductServiceImpl implements IPhysicalProductService {
     @Override
     public List<PhysicalProductVo> queryList(PhysicalProductBo bo) {
         LambdaQueryWrapper<PhysicalProduct> lqw = buildQueryWrapper(bo);
-        return baseMapper.selectPhysicalProductList(lqw);
+        List<PhysicalProductVo> physicalProductVoList = baseMapper.selectPhysicalProductList(lqw);
+        for (PhysicalProductVo physicalProductVo : physicalProductVoList) {
+            PhysicalStoreVo physicalStoreVo = iPhysicalStoreService.queryById(physicalProductVo.getStoreId());
+            if(physicalStoreVo!=null){
+                physicalProductVo.setStoreName(physicalStoreVo.getName());
+            }
+            PhysicalTagVo physicalTagVo = physicalTagService.queryById(physicalProductVo.getTypeId());
+            if(physicalTagVo!=null){
+                physicalProductVo.setTypeName(physicalTagVo.getServiceName());
+            }
+        }
+        return physicalProductVoList;
     }
 
     private LambdaQueryWrapper<PhysicalProduct> buildQueryWrapper(PhysicalProductBo bo) {

+ 1 - 1
ruoyi-modules/ruoyi-system/src/main/java/org/dromara/physical/service/impl/PhysicalTagServiceImpl.java

@@ -22,7 +22,7 @@ import java.util.Map;
 import java.util.Collection;
 
 /**
- * 服务标签Service业务层处理
+ * 服务类型Service业务层处理
  *
  * @author Lion Li
  * @date 2025-12-02