From e50954f0708ecbbc672352102ae3b24279d40cc1 Mon Sep 17 00:00:00 2001
From: MrShi <1878285526@qq.com>
Date: 星期四, 16 四月 2026 20:12:50 +0800
Subject: [PATCH] Merge branch 'master' of http://139.186.142.91:10010/r/productDev/gtzxinglijicun
---
server/services/src/main/java/com/doumee/service/business/impl/CategoryServiceImpl.java | 50 +++++++++++++++++++++++++++++++++++++++++++++++---
1 files changed, 47 insertions(+), 3 deletions(-)
diff --git a/server/services/src/main/java/com/doumee/service/business/impl/CategoryServiceImpl.java b/server/services/src/main/java/com/doumee/service/business/impl/CategoryServiceImpl.java
index 5fb7a02..46ee50f 100644
--- a/server/services/src/main/java/com/doumee/service/business/impl/CategoryServiceImpl.java
+++ b/server/services/src/main/java/com/doumee/service/business/impl/CategoryServiceImpl.java
@@ -11,7 +11,9 @@
import com.doumee.core.model.PageWrap;
import com.doumee.core.utils.Utils;
import com.doumee.dao.business.CategoryMapper;
+import com.doumee.dao.business.PricingRuleMapper;
import com.doumee.dao.business.model.Category;
+import com.doumee.dao.business.model.PricingRule;
import com.doumee.dao.system.model.SystemUser;
import com.doumee.service.business.CategoryService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@@ -42,6 +44,9 @@
@Autowired
private CategoryMapper categoryMapper;
+
+ @Autowired
+ private PricingRuleMapper pricingRuleMapper;
@Autowired
private SystemDictDataBiz systemDictDataBiz;
@@ -134,7 +139,7 @@
throw new BusinessException(ResponseStatus.DATA_EMPTY);
}
if(StringUtils.isNotBlank(category.getIcon())){
- String path = systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.RESOURCE_PATH).getCode()
+ String path = systemDictDataBiz.queryByCode(Constants.OSS,Constants.RESOURCE_PATH).getCode()
+systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.CATEGORY_FILES).getCode();
category.setIconFull(path + category.getIcon());
}
@@ -203,7 +208,7 @@
queryWrapper.orderByAsc(Category::getSortnum);
PageData<Category> result =PageData.from(categoryMapper.selectJoinPage(page, Category.class,queryWrapper));
if(result!=null && result.getRecords()!=null){
- String path = systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.RESOURCE_PATH).getCode()
+ String path = systemDictDataBiz.queryByCode(Constants.OSS,Constants.RESOURCE_PATH).getCode()
+systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.CATEGORY_FILES).getCode();
for(Category cate : result.getRecords()){
try {
@@ -231,7 +236,7 @@
.orderByAsc(Category::getSortnum)
);
if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(categoryList)){
- String path = systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.RESOURCE_PATH).getCode()
+ String path = systemDictDataBiz.queryByCode(Constants.OSS,Constants.RESOURCE_PATH).getCode()
+systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.CATEGORY_FILES).getCode();
for (Category category:categoryList) {
if(StringUtils.isNotBlank(category.getIcon())){
@@ -242,6 +247,45 @@
return categoryList;
}
+ @Override
+ public List<Category> getCitySizeList(Integer cityId) {
+ // 1. 鏌ヨ璇ュ煄甯傚凡閰嶇疆鐨勫紓鍦板瘎閫佽鍒�(pricing_rule type=1)锛岃幏鍙杅ieldA(鐗╁搧灏哄涓婚敭)
+ List<PricingRule> rules = pricingRuleMapper.selectList(new QueryWrapper<PricingRule>().lambda()
+ .eq(PricingRule::getDeleted, Constants.ZERO)
+ .eq(PricingRule::getType, Constants.ONE)
+ .eq(PricingRule::getCityId, cityId));
+ if (CollectionUtils.isEmpty(rules)) {
+ return java.util.Collections.emptyList();
+ }
+ List<Integer> sizeIds = new java.util.ArrayList<>();
+ for (PricingRule rule : rules) {
+ if (StringUtils.isNotBlank(rule.getFieldA())) {
+ sizeIds.add(Integer.parseInt(rule.getFieldA()));
+ }
+ }
+ if (sizeIds.isEmpty()) {
+ return java.util.Collections.emptyList();
+ }
+ // 2. 鏌ヨ瀵瑰簲鐨勭墿鍝佸昂瀵�(category type=4)
+ List<Category> sizeList = categoryMapper.selectList(new QueryWrapper<Category>().lambda()
+ .eq(Category::getDeleted, Constants.ZERO)
+ .eq(Category::getStatus, Constants.ZERO)
+ .eq(Category::getType, Constants.FOUR)
+ .in(Category::getId, sizeIds)
+ .orderByAsc(Category::getSortnum));
+ // 3. 鎷兼帴鍥炬爣鍏ㄨ矾寰�
+ if (!CollectionUtils.isEmpty(sizeList)) {
+ String path = systemDictDataBiz.queryByCode(Constants.SYSTEM, Constants.RESOURCE_PATH).getCode()
+ + systemDictDataBiz.queryByCode(Constants.SYSTEM, Constants.CATEGORY_FILES).getCode();
+ for (Category cate : sizeList) {
+ if (StringUtils.isNotBlank(cate.getIcon())) {
+ cate.setIconFull(path + cate.getIcon());
+ }
+ }
+ }
+ return sizeList;
+ }
+
private void validateByType(Category category) {
if (Constants.equalsInteger(category.getType(), Constants.ONE)) {
if (StringUtils.isBlank(category.getOtherField())) {
--
Gitblit v1.9.3