|
|
@@ -0,0 +1,415 @@
|
|
|
+/*
|
|
|
+ * Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
|
|
|
+ *
|
|
|
+ * Redistribution and use in source and binary forms, with or without
|
|
|
+ * modification, are permitted provided that the following conditions are met:
|
|
|
+ *
|
|
|
+ * Redistributions of source code must retain the above copyright notice,
|
|
|
+ * this list of conditions and the following disclaimer.
|
|
|
+ * Redistributions in binary form must reproduce the above copyright
|
|
|
+ * notice, this list of conditions and the following disclaimer in the
|
|
|
+ * documentation and/or other materials provided with the distribution.
|
|
|
+ * Neither the name of the dreamlu.net developer nor the names of its
|
|
|
+ * contributors may be used to endorse or promote products derived from
|
|
|
+ * this software without specific prior written permission.
|
|
|
+ * Author: Chill 庄骞 (smallchill@163.com)
|
|
|
+ */
|
|
|
+package org.springblade.salesPart.shopping.controller;
|
|
|
+
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
+import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
+import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
|
|
+import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
|
|
+import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
|
|
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
|
|
+import io.swagger.annotations.Api;
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
+import io.swagger.annotations.ApiParam;
|
|
|
+import lombok.AllArgsConstructor;
|
|
|
+import org.springblade.core.boot.ctrl.BladeController;
|
|
|
+import org.springblade.core.mp.support.Condition;
|
|
|
+import org.springblade.core.mp.support.Query;
|
|
|
+import org.springblade.core.secure.utils.AuthUtil;
|
|
|
+import org.springblade.core.tool.api.R;
|
|
|
+import org.springblade.core.tool.utils.BeanUtil;
|
|
|
+import org.springblade.core.tool.utils.Func;
|
|
|
+import org.springblade.core.tool.utils.ObjectUtil;
|
|
|
+import org.springblade.salesPart.brand.service.IBrandDescService;
|
|
|
+import org.springblade.salesPart.brand.service.IBrandFigureService;
|
|
|
+import org.springblade.salesPart.brand.service.IBrandFilesService;
|
|
|
+import org.springblade.salesPart.corps.service.ICorpsAttnService;
|
|
|
+import org.springblade.salesPart.corps.service.ICorpsDescService;
|
|
|
+import org.springblade.salesPart.entity.*;
|
|
|
+import org.springblade.salesPart.goods.service.IGoodsDescService;
|
|
|
+import org.springblade.salesPart.productLaunch.service.IProductLaunchFilesService;
|
|
|
+import org.springblade.salesPart.productLaunch.service.IProductLaunchService;
|
|
|
+import org.springblade.salesPart.shopping.entity.ShoppingMallDetail;
|
|
|
+import org.springblade.salesPart.shopping.service.IShoppingMallDetailService;
|
|
|
+import org.springblade.salesPart.shopping.vo.ShoppingMallDetailVO;
|
|
|
+import org.springblade.salesPart.stock.mapper.StockDescMapper;
|
|
|
+import org.springblade.system.feign.ISysClient;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+
|
|
|
+import javax.validation.Valid;
|
|
|
+import java.math.BigDecimal;
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
+import java.util.Objects;
|
|
|
+import java.util.stream.Collectors;
|
|
|
+
|
|
|
+/**
|
|
|
+ * VIEW 控制器
|
|
|
+ *
|
|
|
+ * @author BladeX
|
|
|
+ * @since 2025-01-17
|
|
|
+ */
|
|
|
+@RestController
|
|
|
+@AllArgsConstructor
|
|
|
+@RequestMapping("/shoppingmalldetail")
|
|
|
+@Api(value = "VIEW", tags = "VIEW接口")
|
|
|
+public class ShoppingMallDetailController extends BladeController {
|
|
|
+
|
|
|
+ private final IShoppingMallDetailService shoppingMallDetailService;
|
|
|
+ private final IProductLaunchService productLaunchService;
|
|
|
+ private final IBrandFilesService brandFilesService;
|
|
|
+ private final IBrandDescService brandDescService;
|
|
|
+ private final IProductLaunchFilesService productLaunchFilesService;
|
|
|
+ private final ICorpsAttnService corpsAttnService;//客户联系人
|
|
|
+ private final ICorpsDescService corpsDescService;//客户
|
|
|
+ private final ISysClient iSysClient;
|
|
|
+ private final IBrandFigureService brandFigureService;
|
|
|
+ private final IGoodsDescService goodsDescService;
|
|
|
+ private final StockDescMapper stockDescMapper;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 详情
|
|
|
+ */
|
|
|
+ @GetMapping("/detail")
|
|
|
+ @ApiOperationSupport(order = 1)
|
|
|
+ @ApiOperation(value = "详情", notes = "传入shoppingMallDetail")
|
|
|
+ public R<ShoppingMallDetail> detail(ShoppingMallDetail shoppingMallDetail) {
|
|
|
+ ShoppingMallDetail detail = shoppingMallDetailService.getOne(Condition.getQueryWrapper(shoppingMallDetail));
|
|
|
+ return R.data(detail);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 分页 VIEW
|
|
|
+ */
|
|
|
+ @GetMapping("/list")
|
|
|
+ @ApiOperationSupport(order = 2)
|
|
|
+ @ApiOperation(value = "分页", notes = "传入shoppingMallDetail")
|
|
|
+ public R<IPage<ShoppingMallDetail>> list(ShoppingMallDetail shoppingMallDetail, Query query) {
|
|
|
+ IPage<ShoppingMallDetail> pages = shoppingMallDetailService.page(Condition.getPage(query), Condition.getQueryWrapper(shoppingMallDetail));
|
|
|
+ return R.data(pages);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 自定义分页 VIEW
|
|
|
+ */
|
|
|
+ @GetMapping("/page")
|
|
|
+ @ApiOperationSupport(order = 3)
|
|
|
+ @ApiOperation(value = "分页", notes = "传入shoppingMallDetail")
|
|
|
+ public R<IPage<ShoppingMallDetailVO>> page(ShoppingMallDetailVO shoppingMallDetail, Query query) {
|
|
|
+ IPage<ShoppingMallDetailVO> pages = shoppingMallDetailService.selectShoppingMallDetailPage(Condition.getPage(query), shoppingMallDetail);
|
|
|
+ return R.data(pages);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 新增 VIEW
|
|
|
+ */
|
|
|
+ @PostMapping("/save")
|
|
|
+ @ApiOperationSupport(order = 4)
|
|
|
+ @ApiOperation(value = "新增", notes = "传入shoppingMallDetail")
|
|
|
+ public R save(@Valid @RequestBody ShoppingMallDetail shoppingMallDetail) {
|
|
|
+ return R.status(shoppingMallDetailService.save(shoppingMallDetail));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 修改 VIEW
|
|
|
+ */
|
|
|
+ @PostMapping("/update")
|
|
|
+ @ApiOperationSupport(order = 5)
|
|
|
+ @ApiOperation(value = "修改", notes = "传入shoppingMallDetail")
|
|
|
+ public R update(@Valid @RequestBody ShoppingMallDetail shoppingMallDetail) {
|
|
|
+ return R.status(shoppingMallDetailService.updateById(shoppingMallDetail));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 新增或修改 VIEW
|
|
|
+ */
|
|
|
+ @PostMapping("/submit")
|
|
|
+ @ApiOperationSupport(order = 6)
|
|
|
+ @ApiOperation(value = "新增或修改", notes = "传入shoppingMallDetail")
|
|
|
+ public R submit(@Valid @RequestBody ShoppingMallDetail shoppingMallDetail) {
|
|
|
+ return R.status(shoppingMallDetailService.saveOrUpdate(shoppingMallDetail));
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 删除 VIEW
|
|
|
+ */
|
|
|
+ @PostMapping("/remove")
|
|
|
+ @ApiOperationSupport(order = 8)
|
|
|
+ @ApiOperation(value = "删除", notes = "传入ids")
|
|
|
+ public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
|
|
|
+ return R.status(shoppingMallDetailService.removeByIds(Func.toLongList(ids)));
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 分页 小程序配件批发产品上架
|
|
|
+ */
|
|
|
+ @GetMapping("/appList")
|
|
|
+ @ApiOperationSupport(order = 12)
|
|
|
+ @ApiOperation(value = "小程序配件批发产品上架", notes = "传入productLaunch")
|
|
|
+ public R<IPage<ShoppingMallDetail>> appList(PjProductLaunch productLaunch, Query query) {
|
|
|
+ PjCorpsDesc corpsDesc = null;
|
|
|
+ //根据当前登录人获得客户
|
|
|
+ PjCorpsAttn corpsAttn = corpsAttnService.getAttn(AuthUtil.getUserId());
|
|
|
+ if (ObjectUtil.isNotEmpty(corpsAttn)) {
|
|
|
+ corpsDesc = corpsDescService.getCorpsDesc(corpsAttn.getPid());
|
|
|
+ if (ObjectUtil.isEmpty(corpsDesc)) {
|
|
|
+ throw new RuntimeException("未查到用户信息");
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ throw new RuntimeException("未查到用户信息");
|
|
|
+ }
|
|
|
+ LambdaQueryWrapper<ShoppingMallDetail> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ lambdaQueryWrapper.select(ShoppingMallDetail::getGoodsCode);
|
|
|
+ lambdaQueryWrapper.eq(ShoppingMallDetail::getTenantId, AuthUtil.getTenantId())
|
|
|
+ .eq(ShoppingMallDetail::getIsDeleted, 0)
|
|
|
+ .eq(ShoppingMallDetail::getSalesCompanyId, AuthUtil.getDeptId())//公司
|
|
|
+ .eq(ObjectUtils.isNotEmpty(productLaunch.getBrandId()), ShoppingMallDetail::getBrandId, productLaunch.getBrandId());//品牌
|
|
|
+ if (ObjectUtils.isNotNull(corpsDesc.getBrandId())) {
|
|
|
+ List<PjBrandDesc> pjBrandDescList = brandDescService.list(new LambdaQueryWrapper<PjBrandDesc>()
|
|
|
+ .eq(PjBrandDesc::getTenantId, AuthUtil.getTenantId())
|
|
|
+ .eq(PjBrandDesc::getIsDeleted, 0)
|
|
|
+ .eq(PjBrandDesc::getType, "PP")
|
|
|
+ .eq(PjBrandDesc::getEnableOrNot, 1)
|
|
|
+ .apply("find_in_set(id,'" + corpsDesc.getBrandId() + "')"));
|
|
|
+ if (!pjBrandDescList.isEmpty()) {
|
|
|
+ lambdaQueryWrapper.in(ShoppingMallDetail::getBrandId, pjBrandDescList.stream().map(PjBrandDesc::getId).collect(Collectors.toList()));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (ObjectUtils.isNotEmpty(productLaunch.getExplosionProof())
|
|
|
+ || ObjectUtils.isNotEmpty(productLaunch.getOriginalFactory())
|
|
|
+ || ObjectUtils.isNotEmpty(productLaunch.getSelfRecovery())) {
|
|
|
+ lambdaQueryWrapper.and(i -> i.eq(ObjectUtils.isNotEmpty(productLaunch.getExplosionProof()), ShoppingMallDetail::getExplosionProof, productLaunch.getExplosionProof())//防爆
|
|
|
+ .or().eq(ObjectUtils.isNotEmpty(productLaunch.getOriginalFactory()), ShoppingMallDetail::getOriginalFactory, productLaunch.getOriginalFactory())//原厂
|
|
|
+ .or().eq(ObjectUtils.isNotEmpty(productLaunch.getSelfRecovery()), ShoppingMallDetail::getSelfRecovery, productLaunch.getSelfRecovery())//自修补
|
|
|
+ );
|
|
|
+ }
|
|
|
+ if (ObjectUtil.isNotEmpty(productLaunch.getCname())) {
|
|
|
+ if (productLaunch.getCname().contains(",")) {
|
|
|
+ String brandName = productLaunch.getCname().substring(0, productLaunch.getCname().indexOf(","));
|
|
|
+ String cname = productLaunch.getCname().substring(productLaunch.getCname().indexOf(",") + 1);
|
|
|
+ lambdaQueryWrapper.and(i -> i.like(ShoppingMallDetail::getGoodsName, cname)
|
|
|
+ .or().like(ShoppingMallDetail::getCnameInt, cname)
|
|
|
+ .or().like(ShoppingMallDetail::getBrandItem, cname)
|
|
|
+ .or().like(ShoppingMallDetail::getSpecificationAndModel, cname)
|
|
|
+ );
|
|
|
+ lambdaQueryWrapper.like(ShoppingMallDetail::getBrandName, brandName);
|
|
|
+ } else {
|
|
|
+ String[] chineseWords = productLaunch.getCname().split("[^一-龥]");
|
|
|
+ if (chineseWords.length > 0) {
|
|
|
+ String cname = productLaunch.getCname().substring(chineseWords[0].length());
|
|
|
+ if (ObjectUtils.isNotNull(cname)) {
|
|
|
+ lambdaQueryWrapper.and(i -> i.like(ShoppingMallDetail::getGoodsName, cname)
|
|
|
+ .or().like(ShoppingMallDetail::getCnameInt, cname)
|
|
|
+ .or().like(ShoppingMallDetail::getBrandItem, cname)
|
|
|
+ .or().like(ShoppingMallDetail::getSpecificationAndModel, cname)
|
|
|
+ );
|
|
|
+ lambdaQueryWrapper.like(ShoppingMallDetail::getBrandName, chineseWords[0]);
|
|
|
+ } else {
|
|
|
+ lambdaQueryWrapper.and(i -> i.like(ShoppingMallDetail::getGoodsName, productLaunch.getCname())
|
|
|
+ .or().like(ShoppingMallDetail::getCnameInt, productLaunch.getCname())
|
|
|
+ .or().like(ShoppingMallDetail::getBrandItem, productLaunch.getCname())
|
|
|
+ .or().like(ShoppingMallDetail::getSpecificationAndModel, productLaunch.getCname())
|
|
|
+ .or().like(ShoppingMallDetail::getBrandName, chineseWords[0])
|
|
|
+ );
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ lambdaQueryWrapper.and(i -> i.like(ShoppingMallDetail::getGoodsName, productLaunch.getCname())
|
|
|
+ .or().like(ShoppingMallDetail::getCnameInt, productLaunch.getCname())
|
|
|
+ .or().like(ShoppingMallDetail::getBrandItem, productLaunch.getCname())
|
|
|
+ .or().like(ShoppingMallDetail::getSpecificationAndModel, productLaunch.getCname())
|
|
|
+ );
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ List<PjStockDesc> stockDescList = new ArrayList<>();
|
|
|
+ String status = iSysClient.getParamService("whether.branch.management");
|
|
|
+ if (ObjectUtils.isNotNull(status) && "1".equals(status)) {
|
|
|
+ if (ObjectUtils.isNotNull(corpsDesc.getDeliveryWarehouseId())) {
|
|
|
+ stockDescList = stockDescMapper.selectList(new LambdaQueryWrapper<PjStockDesc>()
|
|
|
+ .eq(PjStockDesc::getTenantId, AuthUtil.getTenantId())
|
|
|
+ .eq(PjStockDesc::getIsDeleted, 0)
|
|
|
+ .eq(PjStockDesc::getStorageId, corpsDesc.getDeliveryWarehouseId()));
|
|
|
+ if (!stockDescList.isEmpty()) {
|
|
|
+ List<Long> goodsId = stockDescList.stream().map(PjStockDesc::getGoodsId).collect(Collectors.toList());
|
|
|
+ lambdaQueryWrapper.in(ShoppingMallDetail::getGoodsId, goodsId);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ String status1 = iSysClient.getParamService("whether.zero.inventory");
|
|
|
+ if (ObjectUtils.isNull(status1) || "0".equals(status1)) {
|
|
|
+ lambdaQueryWrapper.gt(ShoppingMallDetail::getInventory, 0);
|
|
|
+ }
|
|
|
+ lambdaQueryWrapper.orderByAsc(ShoppingMallDetail::getCnameInt);
|
|
|
+ lambdaQueryWrapper.orderByDesc(ShoppingMallDetail::getInventory);
|
|
|
+ IPage<ShoppingMallDetail> pages = shoppingMallDetailService.page(Condition.getPage(query), lambdaQueryWrapper);
|
|
|
+
|
|
|
+ if (CollectionUtils.isNotEmpty(pages.getRecords())) {
|
|
|
+ List<String> codeList = pages.getRecords().stream().map(ShoppingMallDetail::getGoodsCode).filter(Objects::nonNull).collect(Collectors.toList());
|
|
|
+ List<ShoppingMallDetail> shoppingMallDetailList = new ArrayList<>();
|
|
|
+ List<ShoppingMallDetail> shoppingMallDetailShareList = new ArrayList<>();
|
|
|
+ if (!codeList.isEmpty()) {
|
|
|
+ shoppingMallDetailList = shoppingMallDetailService.list(new LambdaQueryWrapper<ShoppingMallDetail>()
|
|
|
+ .eq(ShoppingMallDetail::getTenantId, AuthUtil.getTenantId())
|
|
|
+ .eq(ShoppingMallDetail::getIsDeleted, 0)
|
|
|
+ .eq(ShoppingMallDetail::getBillType, 0)
|
|
|
+ .in(ShoppingMallDetail::getGoodsCode, codeList));
|
|
|
+ shoppingMallDetailShareList = shoppingMallDetailService.list(new LambdaQueryWrapper<ShoppingMallDetail>()
|
|
|
+ .eq(ShoppingMallDetail::getTenantId, AuthUtil.getTenantId())
|
|
|
+ .eq(ShoppingMallDetail::getIsDeleted, 0)
|
|
|
+ .eq(ShoppingMallDetail::getBillType, 1)
|
|
|
+ .in(ShoppingMallDetail::getGoodsCode, codeList));
|
|
|
+ }
|
|
|
+ for (ShoppingMallDetail item : pages.getRecords()) {
|
|
|
+ if (!shoppingMallDetailList.isEmpty()) {
|
|
|
+ ShoppingMallDetail shoppingMallDetail = shoppingMallDetailList.stream()
|
|
|
+ .filter(e -> e.getGoodsCode().equals(item.getGoodsCode())).findFirst().orElse(null);
|
|
|
+ if (shoppingMallDetail != null) {
|
|
|
+ BeanUtil.copyProperties(shoppingMallDetail, item);
|
|
|
+ if (!shoppingMallDetailShareList.isEmpty()) {
|
|
|
+ BigDecimal inventory = shoppingMallDetailShareList.stream().map(ShoppingMallDetail::getInventory)
|
|
|
+ .reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
+ item.setInventory(item.getInventory().add(inventory));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (!shoppingMallDetailShareList.isEmpty()) {
|
|
|
+ ShoppingMallDetail shoppingMallShareDetail = shoppingMallDetailShareList.stream()
|
|
|
+ .filter(e -> e.getGoodsCode().equals(item.getGoodsCode())).findFirst().orElse(null);
|
|
|
+ if (shoppingMallShareDetail != null) {
|
|
|
+ BeanUtil.copyProperties(shoppingMallShareDetail, item);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotBlank(corpsDesc.getPriceSystem())) {
|
|
|
+ if ("售价1".equals(corpsDesc.getPriceSystem())) {
|
|
|
+ item.setMallPrice(item.getPriceOne());
|
|
|
+ } else if ("售价2".equals(corpsDesc.getPriceSystem())) {
|
|
|
+ item.setMallPrice(item.getPriceTwo());
|
|
|
+ } else if ("售价3".equals(corpsDesc.getPriceSystem())) {
|
|
|
+ item.setMallPrice(item.getPriceThree());
|
|
|
+ } else if ("售价4".equals(corpsDesc.getPriceSystem())) {
|
|
|
+ item.setMallPrice(item.getPriceFour());
|
|
|
+ } else {
|
|
|
+ item.setMallPrice(item.getPriceOne());
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ item.setMallPrice(item.getPriceOne());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ List<PjProductLaunchFiles> pjProductLaunchFilesList = new ArrayList<>();
|
|
|
+ List<PjBrandFiles> pjBrandFilesList = new ArrayList<>();
|
|
|
+ List<BrandFigure> brandFigureList = new ArrayList<>();
|
|
|
+ List<Long> ids = shoppingMallDetailList.stream().map(ShoppingMallDetail::getId).collect(Collectors.toList());
|
|
|
+ List<Long> brandIds = pages.getRecords().stream().map(ShoppingMallDetail::getBrandId).collect(Collectors.toList());
|
|
|
+ if (!ids.isEmpty()) {
|
|
|
+ pjProductLaunchFilesList = productLaunchFilesService.list(new QueryWrapper<PjProductLaunchFiles>()
|
|
|
+ .in("pid", ids).eq("is_deleted", 0));
|
|
|
+ }
|
|
|
+ if (!brandIds.isEmpty()) {
|
|
|
+ pjBrandFilesList = brandFilesService.list(new QueryWrapper<PjBrandFiles>()
|
|
|
+ .in("pid", brandIds).eq("is_deleted", 0));
|
|
|
+ brandFigureList = brandFigureService.list(new QueryWrapper<BrandFigure>()
|
|
|
+ .in("pid", brandIds).eq("is_deleted", 0));
|
|
|
+ }
|
|
|
+ for (ShoppingMallDetail item : pages.getRecords()) {
|
|
|
+ if (!pjProductLaunchFilesList.isEmpty()) {
|
|
|
+ List<PjProductLaunchFiles> list = pjProductLaunchFilesList.stream().filter(e -> e.getPid().equals(item.getId())).collect(Collectors.toList());
|
|
|
+ if (!list.isEmpty()) {
|
|
|
+ item.setFilesList(list);
|
|
|
+ } else {
|
|
|
+ if (ObjectUtils.isNotNull(item.getBrandId())) {
|
|
|
+ if (!brandFigureList.isEmpty()) {
|
|
|
+ List<BrandFigure> brandFigureList1 = brandFigureList.stream()
|
|
|
+ .filter(e -> e.getPid().equals(item.getBrandId()) && e.getFigure().equals(item.getBrandItem()))
|
|
|
+ .collect(Collectors.toList());
|
|
|
+ if (!brandFigureList1.isEmpty()) {
|
|
|
+ item.setFilesList(BeanUtil.copy(brandFigureList1, PjProductLaunchFiles.class));
|
|
|
+ } else {
|
|
|
+ if (!pjBrandFilesList.isEmpty()) {
|
|
|
+ List<PjBrandFiles> pjBarndFilesList1 = pjBrandFilesList.stream()
|
|
|
+ .filter(e -> e.getPid().equals(item.getBrandId()))
|
|
|
+ .collect(Collectors.toList());
|
|
|
+ if (!pjBarndFilesList1.isEmpty()) {
|
|
|
+ item.setFilesList(BeanUtil.copy(pjBarndFilesList1, PjProductLaunchFiles.class));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (!pjBrandFilesList.isEmpty()) {
|
|
|
+ List<PjBrandFiles> pjBarndFilesList1 = pjBrandFilesList.stream()
|
|
|
+ .filter(e -> e.getPid().equals(item.getBrandId()))
|
|
|
+ .collect(Collectors.toList());
|
|
|
+ if (!pjBarndFilesList1.isEmpty()) {
|
|
|
+ item.setFilesList(BeanUtil.copy(pjBarndFilesList1, PjProductLaunchFiles.class));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (ObjectUtils.isNotNull(item.getBrandId())) {
|
|
|
+ if (!brandFigureList.isEmpty()) {
|
|
|
+ List<BrandFigure> brandFigureList1 = brandFigureList.stream()
|
|
|
+ .filter(e -> e.getPid().equals(item.getBrandId()) && e.getFigure().equals(item.getBrandItem()))
|
|
|
+ .collect(Collectors.toList());
|
|
|
+ if (!brandFigureList1.isEmpty()) {
|
|
|
+ item.setFilesList(BeanUtil.copy(brandFigureList1, PjProductLaunchFiles.class));
|
|
|
+ } else {
|
|
|
+ if (!pjBrandFilesList.isEmpty()) {
|
|
|
+ List<PjBrandFiles> pjBarndFilesList1 = pjBrandFilesList.stream()
|
|
|
+ .filter(e -> e.getPid().equals(item.getBrandId()))
|
|
|
+ .collect(Collectors.toList());
|
|
|
+ if (!pjBarndFilesList1.isEmpty()) {
|
|
|
+ item.setFilesList(BeanUtil.copy(pjBarndFilesList1, PjProductLaunchFiles.class));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (!pjBrandFilesList.isEmpty()) {
|
|
|
+ List<PjBrandFiles> pjBarndFilesList1 = pjBrandFilesList.stream()
|
|
|
+ .filter(e -> e.getPid().equals(item.getBrandId()))
|
|
|
+ .collect(Collectors.toList());
|
|
|
+ if (!pjBarndFilesList1.isEmpty()) {
|
|
|
+ item.setFilesList(BeanUtil.copy(pjBarndFilesList1, PjProductLaunchFiles.class));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return R.data(pages);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 小程序详情
|
|
|
+ */
|
|
|
+ @GetMapping("/appDetail")
|
|
|
+ @ApiOperationSupport(order = 13)
|
|
|
+ @ApiOperation(value = "小程序详情", notes = "传入productLaunch")
|
|
|
+ public R<Map<String, Object>> appDetail(PjProductLaunch productLaunch) {
|
|
|
+ productLaunch.setTenantId(AuthUtil.getTenantId());
|
|
|
+ Map<String, Object> map = shoppingMallDetailService.getAppMessageById(productLaunch);
|
|
|
+ return R.data(map);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+}
|