Compare commits
3 Commits
2d4e8a497b
...
5011984747
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5011984747 | ||
|
|
1d180d33a9 | ||
|
|
ad2776df97 |
@@ -52,9 +52,9 @@ spring:
|
|||||||
# url: jdbc:mysql://localhost:3306/jcs?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
|
# url: jdbc:mysql://localhost:3306/jcs?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
|
||||||
# username: root
|
# username: root
|
||||||
# password: root
|
# password: root
|
||||||
url: jdbc:mysql://erp9.52o.site:13308/jcs20250106?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
|
url: jdbc:mysql://erp9.52o.site:13308/jcs20250512?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
|
||||||
username: jcs20250106
|
username: jcs20250512
|
||||||
password: esXkafdSMsxRAkNe
|
password: rdnGT3TFYFnMzstX
|
||||||
# 从库数据源
|
# 从库数据源
|
||||||
slave:
|
slave:
|
||||||
lazy: false
|
lazy: false
|
||||||
|
|||||||
@@ -55,9 +55,9 @@ spring:
|
|||||||
# url: jdbc:mysql://localhost:3306/cailiao?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
|
# url: jdbc:mysql://localhost:3306/cailiao?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
|
||||||
# username: root
|
# username: root
|
||||||
# password: root
|
# password: root
|
||||||
url: jdbc:mysql://124.223.56.113:13306/cailiao1?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
|
url: jdbc:mysql://erp9.52o.site:13308/jcs20250512?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
|
||||||
username: cailiao1
|
username: jcs20250512
|
||||||
password: j5RcfMwRG2WMHyAC
|
password: rdnGT3TFYFnMzstX
|
||||||
# 从库数据源
|
# 从库数据源
|
||||||
slave:
|
slave:
|
||||||
lazy: false
|
lazy: false
|
||||||
|
|||||||
@@ -8,6 +8,9 @@ import com.aspose.words.SaveFormat;
|
|||||||
|
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Maosw
|
||||||
|
*/
|
||||||
public class PdfUtil {
|
public class PdfUtil {
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -215,13 +215,21 @@ public class ApiProdController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/categoryInfo")
|
@GetMapping("/categoryInfo")
|
||||||
@Operation(summary = "分类信息列表", description = "获取所有的产品分类信息,顶级分类的parentId为0,默认为顶级分类")
|
@Operation(summary = "根据父级ID获取分类信息列表", description = "获取所有的产品分类信息,顶级分类的parentId为0,默认为顶级分类")
|
||||||
@Parameter(name = "parentId", description = "分类ID")
|
@Parameter(name = "parentId", description = "分类ID")
|
||||||
public ServerResponseEntity<List<TzCategoryVo>> categoryInfo(@RequestParam(value = "parentId", defaultValue = "0") Long parentId) {
|
public ServerResponseEntity<List<TzCategoryVo>> categoryInfo(@RequestParam(value = "parentId", defaultValue = "0") Long parentId) {
|
||||||
List<TzCategoryVo> categories = categoryService.listByParentId(parentId);
|
List<TzCategoryVo> categories = categoryService.listByParentId(parentId);
|
||||||
return ServerResponseEntity.success(categories);
|
return ServerResponseEntity.success(categories);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/categoryByAncestors")
|
||||||
|
@Operation(summary = "根据祖级ID获取分类信息列表", description = "获取所有的产品分类信息,顶级分类的ancestors为0,默认为顶级分类")
|
||||||
|
@Parameter(name = "ancestors", description = "祖级ID")
|
||||||
|
public ServerResponseEntity<List<TzCategoryVo>> categoryByAncestors(@RequestParam(value = "ancestors", defaultValue = "0") Long ancestors) {
|
||||||
|
List<TzCategoryVo> categories = categoryService.listByAncestors(ancestors);
|
||||||
|
return ServerResponseEntity.success(categories);
|
||||||
|
}
|
||||||
|
|
||||||
@PostMapping("/searchProdPage")
|
@PostMapping("/searchProdPage")
|
||||||
@Operation(summary = "分页排序搜索商品", description = "根据商品名搜索")
|
@Operation(summary = "分页排序搜索商品", description = "根据商品名搜索")
|
||||||
@Parameters({@Parameter(name = "categoryId", description = "分类ID"),@Parameter(name = "prodName", description = "商品名"), @Parameter(name = "floor", description = "是否特价 1:是 2:否", required = true),@Parameter(name = "sort", description = "排序(0综合 1价格排序 2热门 3新品)", required = true), @Parameter(name = "orderBy", description = "排序(0升序 1降序)--sort选择1时必传")})
|
@Parameters({@Parameter(name = "categoryId", description = "分类ID"),@Parameter(name = "prodName", description = "商品名"), @Parameter(name = "floor", description = "是否特价 1:是 2:否", required = true),@Parameter(name = "sort", description = "排序(0综合 1价格排序 2热门 3新品)", required = true), @Parameter(name = "orderBy", description = "排序(0升序 1降序)--sort选择1时必传")})
|
||||||
|
|||||||
@@ -52,9 +52,9 @@ spring:
|
|||||||
# url: jdbc:mysql://localhost:3306/jcs?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
|
# url: jdbc:mysql://localhost:3306/jcs?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
|
||||||
# username: root
|
# username: root
|
||||||
# password: root
|
# password: root
|
||||||
url: jdbc:mysql://erp9.52o.site:13308/jcs20250106?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
|
url: jdbc:mysql://erp9.52o.site:13308/jcs20250512?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
|
||||||
username: jcs20250106
|
username: jcs20250512
|
||||||
password: esXkafdSMsxRAkNe
|
password: rdnGT3TFYFnMzstX
|
||||||
# 从库数据源
|
# 从库数据源
|
||||||
slave:
|
slave:
|
||||||
lazy: false
|
lazy: false
|
||||||
|
|||||||
@@ -55,9 +55,9 @@ spring:
|
|||||||
# url: jdbc:mysql://localhost:3306/cailiao?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
|
# url: jdbc:mysql://localhost:3306/cailiao?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
|
||||||
# username: root
|
# username: root
|
||||||
# password: root
|
# password: root
|
||||||
url: jdbc:mysql://localhost:3306/jcs?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
|
url: jdbc:mysql://erp9.52o.site:13308/jcs20250512?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
|
||||||
username: root
|
username: jcs20250512
|
||||||
password: root
|
password: rdnGT3TFYFnMzstX
|
||||||
# 从库数据源
|
# 从库数据源
|
||||||
slave:
|
slave:
|
||||||
lazy: false
|
lazy: false
|
||||||
|
|||||||
@@ -30,9 +30,9 @@ public class TzCategory extends BaseEntity {
|
|||||||
private Long categoryId;
|
private Long categoryId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 店铺ID
|
* 祖级列表
|
||||||
*/
|
*/
|
||||||
private Long shopId;
|
private String ancestors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 父节点
|
* 父节点
|
||||||
|
|||||||
@@ -30,9 +30,9 @@ public class TzCategoryBo extends BaseEntity {
|
|||||||
private Long categoryId;
|
private Long categoryId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 店铺ID
|
* 祖级列表
|
||||||
*/
|
*/
|
||||||
private Long shopId;
|
private String ancestors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 父节点
|
* 父节点
|
||||||
|
|||||||
@@ -33,10 +33,10 @@ public class TzCategoryVo implements Serializable {
|
|||||||
private Long categoryId;
|
private Long categoryId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 店铺ID
|
* 祖级列表
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "店铺ID")
|
@ExcelProperty(value = "祖级列表")
|
||||||
private Long shopId;
|
private String ancestors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 父节点
|
* 父节点
|
||||||
|
|||||||
@@ -68,4 +68,11 @@ public interface ITzCategoryService {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<TzCategoryVo> categoryAll();
|
List<TzCategoryVo> categoryAll();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分类信息列表
|
||||||
|
* @param ancestors
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<TzCategoryVo> listByAncestors(Long ancestors);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -75,14 +75,14 @@ public class TzCategoryServiceImpl implements ITzCategoryService {
|
|||||||
bo.setGrade(category.getGrade()+1);
|
bo.setGrade(category.getGrade()+1);
|
||||||
category.setSubset(1);
|
category.setSubset(1);
|
||||||
baseMapper.updateById(category);
|
baseMapper.updateById(category);
|
||||||
|
|
||||||
|
bo.setAncestors(category.getAncestors()+StringUtils.SEPARATOR+category.getCategoryId());
|
||||||
|
}else{
|
||||||
|
bo.setAncestors("0");
|
||||||
}
|
}
|
||||||
bo.setRecTime(new Date());
|
bo.setRecTime(new Date());
|
||||||
TzCategory add = MapstructUtils.convert(bo, TzCategory.class);
|
TzCategory add = MapstructUtils.convert(bo, TzCategory.class);
|
||||||
boolean flag = baseMapper.insert(add) > 0;
|
return baseMapper.insert(add) > 0;
|
||||||
if (flag) {
|
|
||||||
bo.setCategoryId(add.getCategoryId());
|
|
||||||
}
|
|
||||||
return flag;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -98,13 +98,15 @@ public class TzCategoryServiceImpl implements ITzCategoryService {
|
|||||||
bo.setGrade(category.getGrade()+1);
|
bo.setGrade(category.getGrade()+1);
|
||||||
category.setSubset(1);
|
category.setSubset(1);
|
||||||
baseMapper.updateById(category);
|
baseMapper.updateById(category);
|
||||||
|
|
||||||
|
bo.setAncestors(category.getAncestors()+StringUtils.SEPARATOR+category.getCategoryId());
|
||||||
|
}else{
|
||||||
|
bo.setAncestors("0");
|
||||||
}
|
}
|
||||||
TzCategory update = MapstructUtils.convert(bo, TzCategory.class);
|
TzCategory update = MapstructUtils.convert(bo, TzCategory.class);
|
||||||
return baseMapper.updateById(update) > 0;
|
return baseMapper.updateById(update) > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 校验并批量删除产品类目信息
|
* 校验并批量删除产品类目信息
|
||||||
*
|
*
|
||||||
@@ -117,15 +119,26 @@ public class TzCategoryServiceImpl implements ITzCategoryService {
|
|||||||
return baseMapper.deleteByIds(ids) > 0;
|
return baseMapper.deleteByIds(ids) > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据父级ID查询子类信息
|
||||||
|
* @param parentId
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<TzCategoryVo> listByParentId(Long parentId) {
|
public List<TzCategoryVo> listByParentId(Long parentId) {
|
||||||
return baseMapper.selectVoList(new LambdaQueryWrapper<TzCategory>().eq(TzCategory::getParentId, parentId).eq(TzCategory::getStatus,1));
|
return baseMapper.selectVoList(new LambdaQueryWrapper<TzCategory>().eq(TzCategory::getParentId, parentId).eq(TzCategory::getStatus,1).eq(TzCategory::getSubset,1));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分类信息列表
|
||||||
|
* @param ancestors
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<TzCategoryVo> listByAncestors(Long ancestors) {
|
||||||
|
return baseMapper.selectVoList(new LambdaQueryWrapper<TzCategory>().like(TzCategory::getAncestors, ancestors).eq(TzCategory::getStatus,1).eq(TzCategory::getSubset,1));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 全部分类信息列表
|
* 全部分类信息列表
|
||||||
*
|
|
||||||
* @return
|
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<TzCategoryVo> categoryAll() {
|
public List<TzCategoryVo> categoryAll() {
|
||||||
|
|||||||
Reference in New Issue
Block a user