记得上下班打卡 | git大法好,push需谨慎

Commit a2a2e25e authored by 姜秀龙's avatar 姜秀龙

收钱 sql 报错问题处理

parent 3b0d7439
...@@ -9,12 +9,8 @@ import com.liquidnet.service.goblin.dto.vo.GoblinGoodsInfoVo; ...@@ -9,12 +9,8 @@ import com.liquidnet.service.goblin.dto.vo.GoblinGoodsInfoVo;
import com.liquidnet.service.goblin.dto.vo.GoblinGoodsSkuInfoVo; import com.liquidnet.service.goblin.dto.vo.GoblinGoodsSkuInfoVo;
import com.liquidnet.service.goblin.dto.vo.GoblinSqbPerfGoodsVo; import com.liquidnet.service.goblin.dto.vo.GoblinSqbPerfGoodsVo;
import com.liquidnet.service.goblin.config.properties.ShouqianbaProperties; import com.liquidnet.service.goblin.config.properties.ShouqianbaProperties;
import com.liquidnet.service.goblin.entity.GoblinGoods;
import com.liquidnet.service.goblin.entity.GoblinGoodsSku;
import com.liquidnet.service.goblin.entity.GoblinSqbGoodsExt; import com.liquidnet.service.goblin.entity.GoblinSqbGoodsExt;
import com.liquidnet.service.goblin.entity.GoblinSqbPerformanceGoods; import com.liquidnet.service.goblin.entity.GoblinSqbPerformanceGoods;
import com.liquidnet.service.goblin.mapper.GoblinGoodsMapper;
import com.liquidnet.service.goblin.mapper.GoblinGoodsSkuMapper;
import com.liquidnet.service.goblin.mapper.GoblinSqbGoodsExtMapper; import com.liquidnet.service.goblin.mapper.GoblinSqbGoodsExtMapper;
import com.liquidnet.service.goblin.mapper.GoblinSqbPerformanceGoodsMapper; import com.liquidnet.service.goblin.mapper.GoblinSqbPerformanceGoodsMapper;
import com.liquidnet.service.goblin.mapper.GoblinSqbPerformanceConfigMapper; import com.liquidnet.service.goblin.mapper.GoblinSqbPerformanceConfigMapper;
...@@ -45,7 +41,6 @@ import com.liquidnet.service.goblin.util.ObjectUtil; ...@@ -45,7 +41,6 @@ import com.liquidnet.service.goblin.util.ObjectUtil;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.*; import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
...@@ -58,12 +53,6 @@ public class GoblinSqbGoodsServiceImpl implements IGoblinSqbGoodsService { ...@@ -58,12 +53,6 @@ public class GoblinSqbGoodsServiceImpl implements IGoblinSqbGoodsService {
@Autowired @Autowired
private ShouqianbaProperties shouqianbaProperties; private ShouqianbaProperties shouqianbaProperties;
@Autowired
private GoblinGoodsMapper goblinGoodsMapper;
@Autowired
private GoblinGoodsSkuMapper goblinGoodsSkuMapper;
@Autowired @Autowired
private GoblinSqbGoodsExtMapper goblinSqbGoodsExtMapper; private GoblinSqbGoodsExtMapper goblinSqbGoodsExtMapper;
...@@ -229,6 +218,7 @@ public class GoblinSqbGoodsServiceImpl implements IGoblinSqbGoodsService { ...@@ -229,6 +218,7 @@ public class GoblinSqbGoodsServiceImpl implements IGoblinSqbGoodsService {
goodsInfoVo.setCreatedAt(now); goodsInfoVo.setCreatedAt(now);
goodsInfoVo.setSpuType(33); goodsInfoVo.setSpuType(33);
goodsInfoVo.setVirtualFlg("1"); goodsInfoVo.setVirtualFlg("1");
goodsInfoVo.setSpuNo(goodsInfoVo.getSpuId());
ArrayList<GoblinGoodsSpecVo> goodsSpecVoList = ObjectUtil.getGoblinGoodsSpecVoArrayList(); ArrayList<GoblinGoodsSpecVo> goodsSpecVoList = ObjectUtil.getGoblinGoodsSpecVoArrayList();
List<GoblinGoodsSkuInfoVo> goodsSkuInfoVoList = ObjectUtil.getGoblinGoodsSkuInfoVoArrayList(); List<GoblinGoodsSkuInfoVo> goodsSkuInfoVoList = ObjectUtil.getGoblinGoodsSkuInfoVoArrayList();
...@@ -301,6 +291,7 @@ public class GoblinSqbGoodsServiceImpl implements IGoblinSqbGoodsService { ...@@ -301,6 +291,7 @@ public class GoblinSqbGoodsServiceImpl implements IGoblinSqbGoodsService {
GoblinStoreMgtGoodsAddParam addParam = buildMgtGoodsAddParam(storeId, perfGoodsVo); GoblinStoreMgtGoodsAddParam addParam = buildMgtGoodsAddParam(storeId, perfGoodsVo);
addParam.setSpuId(spuId); addParam.setSpuId(spuId);
addParam.setSpuNo(spuId);
goblinstoreMgtGoodsService.goodsEditSpu(currentUid, addParam, mgtGoodsInfoVo); goblinstoreMgtGoodsService.goodsEditSpu(currentUid, addParam, mgtGoodsInfoVo);
// 3. 编辑 SKU // 3. 编辑 SKU
...@@ -407,6 +398,9 @@ public class GoblinSqbGoodsServiceImpl implements IGoblinSqbGoodsService { ...@@ -407,6 +398,9 @@ public class GoblinSqbGoodsServiceImpl implements IGoblinSqbGoodsService {
editSkuParam.setSkuAppear("0"); editSkuParam.setSkuAppear("0");
editSkuParam.setBuyFactor("0"); editSkuParam.setBuyFactor("0");
editSkuParam.setSkuValidity(DateUtil.Formatter.yyyyMMddHHmmss.format(mgtGoodsSkuInfoVo.getSkuValidity())); editSkuParam.setSkuValidity(DateUtil.Formatter.yyyyMMddHHmmss.format(mgtGoodsSkuInfoVo.getSkuValidity()));
// 设置库存,用户要求不修改之前的库存
editSkuParam.setStock(mgtGoodsSkuInfoVo.getStock());
editSkuParam.setSkuStock(mgtGoodsSkuInfoVo.getSkuStock());
// 库存增量逻辑 // 库存增量逻辑
/* /*
...@@ -484,7 +478,14 @@ public class GoblinSqbGoodsServiceImpl implements IGoblinSqbGoodsService { ...@@ -484,7 +478,14 @@ public class GoblinSqbGoodsServiceImpl implements IGoblinSqbGoodsService {
GoblinStoreMgtGoodsAddParam param = new GoblinStoreMgtGoodsAddParam(); GoblinStoreMgtGoodsAddParam param = new GoblinStoreMgtGoodsAddParam();
param.setStoreId(storeId); param.setStoreId(storeId);
param.setName(productsData.getTitle()); param.setName(productsData.getTitle());
// param.setIntro(productsData.getProductIntroduction()); String intro = productsData.getProductIntroduction();
if (StringUtils.isNotBlank(intro)) {
// 简单的截断处理,防止数据库过长报错,同时优先保留文本部分(如果有的话)
if (intro.length() > 250) {
intro = intro.substring(0, 250);
}
}
param.setIntro(intro);
param.setImageList(productsData.getConverImages()); param.setImageList(productsData.getConverImages());
param.setDetails(productsData.getProductIntroduction()); param.setDetails(productsData.getProductIntroduction());
param.setSpecMode("1"); param.setSpecMode("1");
...@@ -556,34 +557,9 @@ public class GoblinSqbGoodsServiceImpl implements IGoblinSqbGoodsService { ...@@ -556,34 +557,9 @@ public class GoblinSqbGoodsServiceImpl implements IGoblinSqbGoodsService {
goblinSqbRedisUtils.setPerfGoods(performancesId, empty); goblinSqbRedisUtils.setPerfGoods(performancesId, empty);
return ResponseDto.success(empty); return ResponseDto.success(empty);
} }
List<String> skuIds = relations.stream().map(GoblinSqbPerformanceGoods::getSkuId)
.collect(Collectors.toList());
List<String> spuIds = relations.stream().map(GoblinSqbPerformanceGoods::getSpuId).distinct()
.collect(Collectors.toList());
List<GoblinGoodsSku> skuList = goblinGoodsSkuMapper
.selectList(new LambdaQueryWrapper<GoblinGoodsSku>().in(GoblinGoodsSku::getSkuId, skuIds));
Map<String, GoblinGoodsSku> skuMap = skuList.stream()
.collect(Collectors.toMap(GoblinGoodsSku::getSkuId, Function.identity(), (a, b) -> a));
List<GoblinGoods> spuList = goblinGoodsMapper
.selectList(new LambdaQueryWrapper<GoblinGoods>().in(GoblinGoods::getSpuId, spuIds));
Map<String, GoblinGoods> spuMap = spuList.stream()
.collect(Collectors.toMap(GoblinGoods::getSpuId, Function.identity(), (a, b) -> a));
List<GoblinSqbPerfGoodsVo> result = new ArrayList<>(); List<GoblinSqbPerfGoodsVo> result = new ArrayList<>();
for (GoblinSqbPerformanceGoods rel : relations) { for (GoblinSqbPerformanceGoods rel : relations) {
GoblinSqbPerfGoodsVo vo = new GoblinSqbPerfGoodsVo(); GoblinSqbPerfGoodsVo vo = new GoblinSqbPerfGoodsVo();
// vo.setSkuId(rel.getSkuId());
// vo.setSpuId(rel.getSpuId());
// vo.setSort(rel.getSort());
// GoblinGoodsSku sku = skuMap.get(rel.getSkuId());
// if (sku != null) {
// vo.setSkuName(sku.getName());
// vo.setPrice(sku.getPrice() != null ? sku.getPrice().longValue() : null);
// }
// GoblinGoods spu = spuMap.get(rel.getSpuId());
// if (spu != null) {
// vo.setSpuName(spu.getName());
// vo.setCoverPic(spu.getCoverPic());
// }
result.add(vo); result.add(vo);
} }
goblinSqbRedisUtils.setPerfGoods(performancesId, result); goblinSqbRedisUtils.setPerfGoods(performancesId, result);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment