From 3fbfdefe98e5d35e32d74138ce73a1b4e2fe5465 Mon Sep 17 00:00:00 2001
From: Mr.Zhang <710666463@qq.com>
Date: 星期四, 21 九月 2023 13:57:56 +0800
Subject: [PATCH] 平台端
---
server/service/src/main/java/com/doumee/service/business/impl/GoodsServiceImpl.java | 20 ++++++++++++++++----
1 files changed, 16 insertions(+), 4 deletions(-)
diff --git a/server/service/src/main/java/com/doumee/service/business/impl/GoodsServiceImpl.java b/server/service/src/main/java/com/doumee/service/business/impl/GoodsServiceImpl.java
index f5de5ee..02cde3d 100644
--- a/server/service/src/main/java/com/doumee/service/business/impl/GoodsServiceImpl.java
+++ b/server/service/src/main/java/com/doumee/service/business/impl/GoodsServiceImpl.java
@@ -66,6 +66,8 @@
@Autowired
private CategoryMapper categoryMapper;
@Autowired
+ private BaseCategoryMapper baseCategoryMapper;
+ @Autowired
private CateAttrMapper cateAttrMapper;
@Autowired
private CateParamMapper cateParamMapper;
@@ -158,6 +160,11 @@
if(category.getPlatCateId() == null){
throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"瀵逛笉璧凤紝璇峰墠寰�銆愮被鍒鐞嗐�戝厛鍏宠仈骞冲彴绫诲埆锛�");
}
+ BaseCategory baseCategory = baseCategoryMapper.selectById(category.getPlatCateId());
+ if(baseCategory == null){
+ throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"瀵逛笉璧凤紝璇峰墠寰�銆愮被鍒鐞嗐�戝厛鍏宠仈骞冲彴绫诲埆锛�");
+ }
+
BaseGoods bp = new BaseGoods();
bp.setCategoryId(category.getPlatCateId());
bp.setIsdeleted(Constants.ZERO);
@@ -185,6 +192,9 @@
try{
for(BaseGoods model : goodsList){
//閬嶅巻骞冲彴鍟嗗搧淇℃伅锛岃繘琛屽晢鍝佷俊鎭悓姝�
+ //鍒嗙被鍔犱环绯绘暟
+
+ model.setCateRatePrice(baseCategory.getPriceRate());
Goods goods = initGoodsPlatParam(user,model,param);
if(goods == null){
continue;
@@ -310,11 +320,11 @@
throw new BusinessException(ResponseStatus.DATA_ERRO.getCode(),"鏁版嵁寮傚父璇峰埛鏂伴噸璇�");
}
//濡傛灉娌℃湁閰嶇疆鍏ユ墜浠凤紝瀹夎鍔犱环绯绘暟鏉ヨ绠�
-// if(model.getCateRatePrice()==null){
-// model.setCateRatePrice(systemDictDataBiz.getGoodsPriceRate());
-// }
+ if(model.getCateRatePrice()==null){
+ model.setCateRatePrice(systemDictDataBiz.getGoodsPriceRate());
+ }
//杩斿洖 .multiply(model.getCateRatePrice())
- return (Constants.formatBigdecimal(model.getPrice()).multiply(param.getRate())).setScale(0,BigDecimal.ROUND_CEILING);
+ return (Constants.formatBigdecimal(model.getPrice()).multiply(model.getCateRatePrice()).multiply(param.getRate())).setScale(0,BigDecimal.ROUND_CEILING);
}
@@ -1129,6 +1139,8 @@
String prefixUrl = systemDictDataBiz.queryByCode(Constants.OSS, Constants.RESOURCE_PATH).getCode()
+ systemDictDataBiz.queryByCode(Constants.OSS, Constants.GOODS_IMG).getCode();
goodsList.forEach(i->{
+ i.setCategoryImgurl(systemDictDataBiz.queryByCode(Constants.OSS, Constants.RESOURCE_PATH).getCode()
+ + systemDictDataBiz.queryByCode(Constants.OSS, Constants.CATEGORY_IMG).getCode() + i.getCategoryImgurl());
i.setPrefixUrl(prefixUrl);
i.setMultifileList(multifileMapper.selectList(new QueryWrapper<Multifile>().eq("OBJ_ID",i.getId()).orderByAsc(" SORTNUM ")));
i.setGoodsParamList(goodsParamMapper.selectList(
--
Gitblit v1.9.3