From c2d456b74202d5b2b375ea8c4912dcfbd70c972b Mon Sep 17 00:00:00 2001
From: jiaosong <jiaosong6760@dingtalk.com>
Date: 星期二, 12 九月 2023 18:20:36 +0800
Subject: [PATCH] #自测修改

---
 server/service/src/main/java/com/doumee/service/business/impl/BaseGoodsServiceImpl.java |   18 +++++++++++-------
 1 files changed, 11 insertions(+), 7 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..28dcfe1 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()

--
Gitblit v1.9.3