From 64f45c75ea93911b9841bf00bb4c436cd294be3a Mon Sep 17 00:00:00 2001
From: k94314517 <8417338+k94314517@user.noreply.gitee.com>
Date: 星期五, 15 九月 2023 18:30:47 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/dev' into dev
---
server/service/src/main/java/com/doumee/service/business/impl/BaseGoodsServiceImpl.java | 27 +++++++++++++++++++--------
1 files changed, 19 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 8a62b1f..f5c34f2 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
@@ -168,12 +168,15 @@
wrapper.lambda()
.eq(BaseGoods::getId,baseGoods.getId())
.set(BaseGoods::getName,baseGoods.getName())
- .set(BaseGoods::getName,baseGoods.getName())
- .set(BaseGoods::getName,baseGoods.getName())
- .set(BaseGoods::getName,baseGoods.getName());
+ .set(BaseGoods::getBrandId,baseGoods.getBrandId())
+ .set(BaseGoods::getCategoryId,baseGoods.getCategoryId())
+ .set(BaseGoods::getImgurl,baseGoods.getImgurl())
+ .set(BaseGoods::getPrice,baseGoods.getPrice())
+ .set(BaseGoods::getZdPrice,baseGoods.getZdPrice());
baseGoodsMapper.update(null,wrapper);
- multifileMapper.delete(new QueryWrapper<Multifile>().eq("OBJ_ID",baseGoods.getId()));
+ multifileMapper.delete(new QueryWrapper<Multifile>().eq("OBJ_ID",baseGoods.getId())
+ .eq("OBJ_TYPE",Constants.ONE));
List<Multifile> multifileList = baseGoods.getMultifileList();
if(!Objects.isNull(multifileList)&&multifileList.size()>Constants.ZERO){
for (int i = 0; i < multifileList.size(); i++) {
@@ -217,13 +220,13 @@
if (CollectionUtils.isEmpty(idList)){
throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"鍟嗗搧鐘舵�佷笉鑳戒负绌�");
}
- idList.forEach(s->updateStatusByIds(s,status));
+ idList.forEach(s->updateStatusById(s,status));
}
@Transactional(rollbackFor = {Exception.class,BusinessException.class})
@Override
- public void updateStatusByIds(Integer id, Integer status) {
+ public void updateStatusById(Integer id, Integer status) {
if (Objects.isNull(status)){
throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"鍟嗗搧鐘舵�佷笉鑳戒负绌�");
@@ -277,7 +280,8 @@
.leftJoin(BaseCategory.class,BaseCategory::getId,BaseGoods::getBaseDataId)
.selectAll(BaseGoods.class)
.selectAs(Brand::getName,BaseGoodsDTO::getBrandName)
- .selectAs(BaseCategory::getSortnum,BaseGoodsDTO::getCategoryName);
+ .selectAs(BaseCategory::getSortnum,BaseGoodsDTO::getCategoryName)
+ .eq(BaseGoods::getId,id);
BaseGoodsDTO baseGoodsDTO = baseGoodsJoinMapper.selectJoinOne(BaseGoodsDTO.class, queryWrapper);
String prefixUrl = systemDictDataBiz.queryByCode(Constants.SYSTEM, Constants.FILE_DIR).getCode()
@@ -338,10 +342,17 @@
}
queryWrapper.leftJoin(Brand.class,Brand::getId,BaseGoods::getBrandId)
.leftJoin(BaseCategory.class,BaseCategory::getId,BaseGoods::getBaseDataId)
+ .selectAll(BaseGoods.class)
.selectAs(Brand::getName,BaseGoods::getBrandName)
.selectAs(BaseCategory::getSortnum,BaseGoods::getCategoryName);
queryWrapper.orderByDesc(Goods::getId);
- return PageData.from(baseGoodsJoinMapper.selectJoinPage(page,BaseGoods.class,queryWrapper));
+ PageData<BaseGoods> pageData =PageData.from(baseGoodsJoinMapper.selectJoinPage(page,BaseGoods.class,queryWrapper));
+ 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());
+ });
+ return pageData;
}
@Override
--
Gitblit v1.9.3