Browse Source

产品相关功能

lishiqiang 3 weeks ago
parent
commit
0a2733800a

+ 3 - 0
ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/controller/admin/category/vo/CategoryListReqVO.java

@@ -32,4 +32,7 @@ public class CategoryListReqVO {
 
     @Schema(description = "小程序产品分类id")
     private Long typeId;
+
+    @Schema(description = "是否销售端显示")
+    private Integer isShow;
 }

+ 3 - 0
ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/controller/admin/category/vo/CategoryPageReqVO.java

@@ -46,4 +46,7 @@ public class CategoryPageReqVO extends PageParam {
     @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
     private LocalDateTime[] createTime;
 
+    @Schema(description = "是否销售端显示")
+    private Integer isShow;
+
 }

+ 3 - 0
ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/controller/admin/category/vo/CategoryRespVO.java

@@ -61,4 +61,7 @@ public class CategoryRespVO {
 
     @Schema(description = "产品类型", example = "2")
     private Long typeId;
+
+    @Schema(description = "是否销售端显示")
+    private Integer isShow;
 }

+ 3 - 0
ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/controller/admin/category/vo/CategorySaveReqVO.java

@@ -37,4 +37,7 @@ public class CategorySaveReqVO {
     @Schema(description = "小程序产品信息")
     private CategoryExtraSaveReqVO extraInfo;
 
+    @Schema(description = "是否销售端显示")
+    private Integer isShow;
+
 }

+ 4 - 0
ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/dal/dataobject/category/CategoryDO.java

@@ -58,5 +58,9 @@ public class CategoryDO extends TenantBaseDO {
      * 使用状态
      */
     private Integer useStatus;
+    /**
+     * 是否销售端显示
+     */
+    private Integer isShow;
 
 }

+ 39 - 36
ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/service/category/CategoryServiceImpl.java

@@ -69,23 +69,26 @@ public class CategoryServiceImpl implements CategoryService {
         categoryMapper.insert(category);
 
         // 全路径名称
-//        List<CategoryRespVO> list = categoryMapper.getAllUpCategoryById(id, category.getType());
-//        List<CategoryDO> list = categoryMapper.selectList();
-//        String fullPathName = list.stream().map(CategoryRespVO::getCateName).collect(Collectors.joining("/"));
-//        category.setFullPathName(fullPathName);
-//        categoryMapper.updateById(category);
-
-        if (category.getType() == 2) {
-            CategoryExtraDO categoryExtra;
-            if (createReqVO.getExtraInfo() == null) {
-                categoryExtra = new CategoryExtraDO();
-            } else {
-                categoryExtra = BeanUtils.toBean(createReqVO.getExtraInfo(), CategoryExtraDO.class);
-            }
-            categoryExtra.setId(category.getId());
-            categoryExtra.setDeleted(false);
-            categoryExtraMapper.insert(categoryExtra);
+        try {
+            List<CategoryRespVO> list = categoryMapper.getAllUpCategoryById(id, category.getType());
+            String fullPathName = list.stream().map(CategoryRespVO::getCateName).collect(Collectors.joining("/"));
+            category.setFullPathName(fullPathName);
+            categoryMapper.updateById(category);
+        }catch (Exception e){
+
         }
+
+//        if (category.getType() == 2) {
+//            CategoryExtraDO categoryExtra;
+//            if (createReqVO.getExtraInfo() == null) {
+//                categoryExtra = new CategoryExtraDO();
+//            } else {
+//                categoryExtra = BeanUtils.toBean(createReqVO.getExtraInfo(), CategoryExtraDO.class);
+//            }
+//            categoryExtra.setId(category.getId());
+//            categoryExtra.setDeleted(false);
+//            categoryExtraMapper.insert(categoryExtra);
+//        }
         if (category.getType() == 1) {
             // 将父级分类的产品移动到为当前分类下
             categoryMapper.updateProductCategoryId(category.getId(), category.getParentId());
@@ -120,26 +123,26 @@ public class CategoryServiceImpl implements CategoryService {
             });
         }
         categoryMapper.updateById(updateObj);
-        if (updateReqVO.getType() == 2) {
-            CategoryExtraDO categoryExtraDO = categoryExtraMapper.selectById(updateReqVO.getId());
-            if (ObjectUtil.isEmpty(categoryExtraDO)) {
-                categoryExtraDO = BeanUtils.toBean(updateReqVO.getExtraInfo(), CategoryExtraDO.class);
-                categoryExtraDO.setId(updateReqVO.getId());
-                categoryExtraDO.setDeleted(false);
-                categoryExtraMapper.insert(categoryExtraDO);
-            } else {
-                if (StringUtils.equals("1", updateReqVO.getExtraInfo().getOperationType())) {
-                    updateReqVO.getExtraInfo().setId(categoryExtraDO.getId());
-                    UpdateWrapper<CategoryExtraDO> updateWrapper = new UpdateWrapper<>();
-                    updateWrapper.eq("id", categoryExtraDO.getId());
-                    updateWrapper.set("applet_products", updateReqVO.getExtraInfo().getAppletProducts());
-                    categoryExtraMapper.update(updateWrapper);
-                } else {
-                    categoryExtraDO = BeanUtils.toBean(updateReqVO.getExtraInfo(), CategoryExtraDO.class);
-                    categoryExtraMapper.updateById(categoryExtraDO);
-                }
-            }
-        }
+//        if (updateReqVO.getType() == 2) {
+//            CategoryExtraDO categoryExtraDO = categoryExtraMapper.selectById(updateReqVO.getId());
+//            if (ObjectUtil.isEmpty(categoryExtraDO)) {
+//                categoryExtraDO = BeanUtils.toBean(updateReqVO.getExtraInfo(), CategoryExtraDO.class);
+//                categoryExtraDO.setId(updateReqVO.getId());
+//                categoryExtraDO.setDeleted(false);
+//                categoryExtraMapper.insert(categoryExtraDO);
+//            } else {
+//                if (StringUtils.equals("1", updateReqVO.getExtraInfo().getOperationType())) {
+//                    updateReqVO.getExtraInfo().setId(categoryExtraDO.getId());
+//                    UpdateWrapper<CategoryExtraDO> updateWrapper = new UpdateWrapper<>();
+//                    updateWrapper.eq("id", categoryExtraDO.getId());
+//                    updateWrapper.set("applet_products", updateReqVO.getExtraInfo().getAppletProducts());
+//                    categoryExtraMapper.update(updateWrapper);
+//                } else {
+//                    categoryExtraDO = BeanUtils.toBean(updateReqVO.getExtraInfo(), CategoryExtraDO.class);
+//                    categoryExtraMapper.updateById(categoryExtraDO);
+//                }
+//            }
+//        }
     }
 
     @Override

+ 0 - 3
ship-module-resource/ship-module-resource-biz/src/main/java/com/yc/ship/module/resource/service/project/ProjectServiceImpl.java

@@ -10,15 +10,12 @@ import com.yc.ship.module.resource.controller.admin.vo.SimpleListReqVO;
 import com.yc.ship.module.resource.dal.dataobject.project.ProjectDO;
 import com.yc.ship.module.resource.dal.mysql.project.ProjectMapper;
 import com.yc.ship.module.resource.enums.ErrorCodeConstants;
-import com.yc.ship.module.resource.enums.ProjectTypeEnum;
-import com.yc.ship.module.resource.enums.UseStatusEnum;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.validation.annotation.Validated;
 
 import javax.annotation.Resource;
 import java.util.List;
-import java.util.Objects;
 
 import static com.yc.ship.framework.common.exception.util.ServiceExceptionUtil.exception;
 

+ 0 - 19
ship-module-resource/ship-module-resource-biz/src/main/resources/mapper/category/CategoryMapper.xml

@@ -56,25 +56,6 @@
         AND pr.is_use = 1 AND pr.deleted = 0 GROUP BY pc.id
     </select>
 
-    <select id="getCategoryExtraList" resultType="java.util.Map">
-        WITH RECURSIVE cte AS (
-            SELECT
-                t1.id,t1.cate_name cateName,t1.type,t1.use_status useStatus,
-                t0.tags,t0.description,IFNULL(t0.enable_hot_ads,0) enableHotAds,t1.tenant_id
-            FROM product_category t1
-                INNER JOIN product_category_extra t0 ON t1.id = t0.id
-            WHERE t1.id = #{reqVO.id} AND t1.type = #{reqVO.type} AND t1.use_status = #{reqVO.useStatus}
-            UNION ALL
-            SELECT
-                t2.id,t2.cate_name cateName,t2.type,t2.use_status useStatus,
-                t0.tags,t0.description,IFNULL(t0.enable_hot_ads,0) enableHotAds,t2.tenant_id
-            FROM product_category t2
-                INNER JOIN product_category_extra t0 ON t2.id = t0.id
-                INNER JOIN cte ON t2.parent_id = cte.id AND t2.type = #{reqVO.type} AND t2.use_status = #{reqVO.useStatus}
-        )
-        SELECT * FROM cte;
-    </select>
-
     <select id="getPlatTenantId" resultType="java.util.Map">
         select tenant_id from ota_distributor where account_tenant_id = #{currentTenantId} limit 1
     </select>

+ 1 - 1
ship-server-web/src/main/resources/application.yaml

@@ -337,7 +337,7 @@ debug: true
 # 插件配置 TODO 芋艿:【IOT】需要处理下
 pf4j:
   pluginsDir: /Users/anhaohao/code/gitee/ruoyi-vue-pro/plugins # 插件目录
-
+clientCode:
 xxl:
   job:
     executor: