From 08e9a67dd679f311e79a27b04cd0c53a30b4bccf Mon Sep 17 00:00:00 2001
From: doum <doum>
Date: 星期四, 04 六月 2026 18:33:22 +0800
Subject: [PATCH] aaa
---
server/service/src/main/java/com/doumee/service/business/impl/BaseGoodsServiceImpl.java | 32 ++++++++++++++++++++++++--------
1 files changed, 24 insertions(+), 8 deletions(-)
diff --git a/server/service/src/main/java/com/doumee/service/business/impl/BaseGoodsServiceImpl.java b/server/service/src/main/java/com/doumee/service/business/impl/BaseGoodsServiceImpl.java
index 7dff32c..cdc04b4 100644
--- a/server/service/src/main/java/com/doumee/service/business/impl/BaseGoodsServiceImpl.java
+++ b/server/service/src/main/java/com/doumee/service/business/impl/BaseGoodsServiceImpl.java
@@ -85,7 +85,7 @@
// throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"銆�"+baseGoods.getName()+"銆戝凡瀛樺湪");
// }
- Integer integer = baseGoodsMapper.selectCount(new QueryWrapper<BaseGoods>().eq("ISDELETED", Constants.ZERO));
+ Long integer = baseGoodsMapper.selectCount(new QueryWrapper<BaseGoods>().eq("ISDELETED", Constants.ZERO));
BaseGoods insert = new BaseGoods();
insert.setCreator(user.getId());
insert.setCreateDate(new Date());
@@ -106,8 +106,6 @@
insert.setPinyin(PinYinUtil.getFullSpell(insert.getName()));
insert.setShortPinyin(PinYinUtil.getFirstSpell(insert.getName()));
baseGoodsMapper.insert(insert);
-
-
List<Multifile> multifileList = baseGoods.getMultifileList();
if(!Objects.isNull(multifileList)&&multifileList.size()>Constants.ZERO){
for (int i = 0; i < multifileList.size(); i++) {
@@ -122,8 +120,6 @@
multifileMapper.insert(multifile);
}
}
-
-
List<BaseGoodsParamCreatRequest> goodsParamList = baseGoods.getBaseGoodsParamList();
if(!Objects.isNull(goodsParamList)&&goodsParamList.size()>0){
for (int i = 0; i < goodsParamList.size(); i++) {
@@ -150,7 +146,12 @@
@Override
public void deleteById(Integer id) {
- baseGoodsMapper.deleteById(id);
+ BaseGoods model = new BaseGoods();
+ model.setId(id);
+ model.setEditDate(new Date());
+ model.setIsdeleted(Constants.ONE);
+ updateById(model);
+// baseGoodsMapper.deleteById(id);
}
@Override
@@ -164,7 +165,10 @@
if (CollectionUtils.isEmpty(ids)) {
return;
}
- baseGoodsMapper.deleteBatchIds(ids);
+ for(Integer id : ids){
+ deleteById(id);
+ }
+// baseGoodsMapper.deleteBatchIds(ids);
}
@@ -351,8 +355,11 @@
Utils.MP.blankToNull(pageWrap.getModel());
queryWrapper.leftJoin(Brand.class,Brand::getId,BaseGoods::getBrandId)
.leftJoin(BaseCategory.class,BaseCategory::getId,BaseGoods::getCategoryId)
+// .leftJoin(BaseData.class,BaseData::getId,BaseGoods::getBaseDataId)
.selectAll(BaseGoods.class)
+ .selectAs(BaseCategory::getPriceRate,BaseGoods::getCateRatePrice)
.selectAs(Brand::getName,BaseGoods::getBrandName)
+// .selectAs(BaseData::getPrice,BaseGoods::getJdPrice)
.selectAs(BaseCategory::getName,BaseGoods::getCategoryName)
.eq(BaseGoods::getIsdeleted, Constants.ZERO)
.like(StringUtils.isNotBlank(pageWrap.getModel().getName()), BaseGoods::getName,pageWrap.getModel().getName())
@@ -366,7 +373,11 @@
String prefixUrl = systemDictDataBiz.queryByCode(Constants.OSS, Constants.RESOURCE_PATH).getCode()
+ systemDictDataBiz.queryByCode(Constants.OSS, Constants.GOODS_IMG).getCode();
pageData.getRecords().forEach(i->{
- i.setFullImgUrl(prefixUrl + i.getImgurl());
+ if(StringUtils.isNotBlank(i.getImgurl())){
+ i.setFullImgUrl(prefixUrl + i.getImgurl());
+ }
+ i.setJdPrice(i.getPrice());
+ i.setPrice(Constants.formatBigdecimal(i.getPrice()).multiply(Constants.formatBigdecimal(i.getCateRatePrice())));
});
return pageData;
}
@@ -383,6 +394,7 @@
.leftJoin(BaseCategory.class,BaseCategory::getId,BaseGoods::getCategoryId)
.selectAll(BaseGoods.class)
.selectAs(Brand::getName,BaseGoods::getBrandName)
+ .selectAs(BaseCategory::getPriceRate,BaseGoods::getCateRatePrice)
.selectAs(BaseCategory::getName,BaseGoods::getCategoryName)
.eq(BaseGoods::getStatus, Constants.ZERO)
.eq(BaseGoods::getIsdeleted, Constants.ZERO)
@@ -398,6 +410,8 @@
+ systemDictDataBiz.queryByCode(Constants.OSS, Constants.GOODS_IMG).getCode();
pageData.getRecords().forEach(i->{
i.setFullImgUrl(prefixUrl + i.getImgurl());
+ //鍔犱环绯绘暟
+ i.setPrice(Constants.formatBigdecimal(i.getPrice()).multiply(Constants.formatBigdecimal(i.getCateRatePrice())));
});
return pageData;
}
@@ -508,6 +522,8 @@
// baseGoods.setImgurl();
baseGoods.setCategoryId(baseCategory.getId());
baseGoods.setBrandId(brand.getId());
+ baseGoods.setPinyin(PinYinUtil.getFullSpell(s.getName()));
+ baseGoods.setShortPinyin(PinYinUtil.getFirstSpell(s.getName()));
baseGoodsMapper.insert(baseGoods);
if(mulFiles !=null && mulFiles.size()>0){
--
Gitblit v1.9.3