|
@@ -551,6 +551,7 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
|
|
|
orderBusinessConfigQueryBo.setStatus(1);
|
|
|
List<CompanyOrderBusinessConfigGoodsVo> orderBusinessConfigGoodsVos = iOrderBusinessConfigGoodsService.selectCompanyMergeList(orderBusinessConfigQueryBo);
|
|
|
orderBusinessConfigGoodsVos.forEach(item -> {
|
|
|
+ item.setGoodsType(10L);
|
|
|
List<String> goodIds = Arrays.stream(item.getGoodsIds().split(",")).distinct().collect(Collectors.toList());
|
|
|
String goodsIds = goodIds.stream().collect(Collectors.joining(","));
|
|
|
item.setGoodsIds(goodsIds);
|
|
@@ -675,15 +676,16 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
|
|
|
@Override
|
|
|
public GoodsVo selectDetail(Long goodsId) {
|
|
|
GoodsVo goodsVo = baseMapper.selectDetail(goodsId);
|
|
|
- BsUserGoodsCollectionQueryBo bsUserGoodsCollection = new BsUserGoodsCollectionQueryBo();
|
|
|
- bsUserGoodsCollection.setGoodsId(goodsId);
|
|
|
- bsUserGoodsCollection.setStatus(1);
|
|
|
- BsUserGoodsCollection bsUserGoodsCollectionVo = iBsUserGoodsCollectionService.selectById(bsUserGoodsCollection);
|
|
|
- if (ObjectUtil.isEmpty(bsUserGoodsCollectionVo)) {
|
|
|
- goodsVo.setCollectStatus(0);
|
|
|
- } else {
|
|
|
- goodsVo.setCollectStatus(bsUserGoodsCollectionVo.getCollectStatus());
|
|
|
- }
|
|
|
+ if (ObjectUtil.isNotEmpty(goodsVo)){
|
|
|
+ BsUserGoodsCollectionQueryBo bsUserGoodsCollection = new BsUserGoodsCollectionQueryBo();
|
|
|
+ bsUserGoodsCollection.setGoodsId(goodsId);
|
|
|
+ bsUserGoodsCollection.setStatus(1);
|
|
|
+ BsUserGoodsCollection bsUserGoodsCollectionVo = iBsUserGoodsCollectionService.selectById(bsUserGoodsCollection);
|
|
|
+ if (ObjectUtil.isEmpty(bsUserGoodsCollectionVo)) {
|
|
|
+ goodsVo.setCollectStatus(0);
|
|
|
+ } else {
|
|
|
+ goodsVo.setCollectStatus(bsUserGoodsCollectionVo.getCollectStatus());
|
|
|
+ }
|
|
|
// if (ObjectUtils.isNull(goodsVo.getSpecTemplateId()) ||
|
|
|
// goodsSpecTemplateService.count(new LambdaQueryWrapper<GoodsSpecTemplate>()
|
|
|
// .eq(GoodsSpecTemplate::getSpecTemplateId,goodsVo.getSpecTemplateId())
|
|
@@ -701,31 +703,32 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
|
|
|
// goodsVo.setSpecTemplateId(relation.getSpecTemplateId());
|
|
|
// }
|
|
|
// }
|
|
|
- //多规格下的价格区间
|
|
|
- if (ObjectUtils.isNotNull(goodsVo.getSpecTemplateId())) {
|
|
|
- List<GoodsSpecAttributeRelation> list = goodsSpecAttributeRelationService
|
|
|
- .list(new LambdaQueryWrapper<GoodsSpecAttributeRelation>()
|
|
|
- .eq(GoodsSpecAttributeRelation::getSpecTemplateId, goodsVo.getSpecTemplateId()));
|
|
|
- if (CollectionUtils.isNotEmpty(list)) {
|
|
|
- List<Long> goodsIds = list.stream().filter(x -> ObjectUtils.isNotNull(x.getGoodsId())).map(GoodsSpecAttributeRelation::getGoodsId).collect(Collectors.toList());
|
|
|
- List<Goods> goodsList = listByIds(goodsIds);
|
|
|
- //从小到大排序
|
|
|
- List<Goods> collect = goodsList.stream().filter(x -> ObjectUtils.isNotNull(x.getStandPrice())).sorted(Comparator.comparing(Goods::getStandPrice)).collect(Collectors.toList());
|
|
|
- goodsVo.setMinPrice(collect.get(0).getStandPrice());
|
|
|
- goodsVo.setMaxPrice(collect.get(collect.size() - 1).getStandPrice());
|
|
|
- }
|
|
|
- }
|
|
|
- CourseBusinessQueryBo queryBo = new CourseBusinessQueryBo();
|
|
|
- queryBo.setId(goodsVo.getBusinessId());
|
|
|
- String fullName = iCourseBusinessService.queryFullName(queryBo);
|
|
|
- goodsVo.setErJianErZao(false);
|
|
|
- goodsVo.setJjShiGongYuan(false);
|
|
|
- if (Validator.isNotEmpty(fullName)) {
|
|
|
- if (fullName.equals("继续教育二级建造师") || fullName.equals("继续教育二级造价师")) {
|
|
|
- goodsVo.setErJianErZao(true);
|
|
|
+ //多规格下的价格区间
|
|
|
+ if (ObjectUtils.isNotNull(goodsVo.getSpecTemplateId())) {
|
|
|
+ List<GoodsSpecAttributeRelation> list = goodsSpecAttributeRelationService
|
|
|
+ .list(new LambdaQueryWrapper<GoodsSpecAttributeRelation>()
|
|
|
+ .eq(GoodsSpecAttributeRelation::getSpecTemplateId, goodsVo.getSpecTemplateId()));
|
|
|
+ if (CollectionUtils.isNotEmpty(list)) {
|
|
|
+ List<Long> goodsIds = list.stream().filter(x -> ObjectUtils.isNotNull(x.getGoodsId())).map(GoodsSpecAttributeRelation::getGoodsId).collect(Collectors.toList());
|
|
|
+ List<Goods> goodsList = listByIds(goodsIds);
|
|
|
+ //从小到大排序
|
|
|
+ List<Goods> collect = goodsList.stream().filter(x -> ObjectUtils.isNotNull(x.getStandPrice())).sorted(Comparator.comparing(Goods::getStandPrice)).collect(Collectors.toList());
|
|
|
+ goodsVo.setMinPrice(collect.get(0).getStandPrice());
|
|
|
+ goodsVo.setMaxPrice(collect.get(collect.size() - 1).getStandPrice());
|
|
|
+ }
|
|
|
}
|
|
|
- if (fullName.contains("继续教育") && fullName.contains("施工现场专业人员")) {
|
|
|
- goodsVo.setJjShiGongYuan(true);
|
|
|
+ CourseBusinessQueryBo queryBo = new CourseBusinessQueryBo();
|
|
|
+ queryBo.setId(goodsVo.getBusinessId());
|
|
|
+ String fullName = iCourseBusinessService.queryFullName(queryBo);
|
|
|
+ goodsVo.setErJianErZao(false);
|
|
|
+ goodsVo.setJjShiGongYuan(false);
|
|
|
+ if (Validator.isNotEmpty(fullName)) {
|
|
|
+ if (fullName.equals("继续教育二级建造师") || fullName.equals("继续教育二级造价师")) {
|
|
|
+ goodsVo.setErJianErZao(true);
|
|
|
+ }
|
|
|
+ if (fullName.contains("继续教育") && fullName.contains("施工现场专业人员")) {
|
|
|
+ goodsVo.setJjShiGongYuan(true);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
return goodsVo;
|