Pārlūkot izejas kodu

云仓模式查询接口、客户提交查询增加资源仓字段

liyuan 3 mēneši atpakaļ
vecāks
revīzija
0a2b21133f

+ 11 - 0
blade-service-api/blade-sales-part-api/src/main/java/org/springblade/salesPart/vo/ResourceWarehouseVo.java

@@ -116,4 +116,15 @@ public class ResourceWarehouseVo {
 	 */
 	private String url;
 
+
+	/**
+	 * 发货仓库存
+	 */
+	private BigDecimal inventoryLocal;
+
+	/**
+	 * 资源仓库存
+	 */
+	private BigDecimal inventoryShare;
+
 }

+ 7 - 0
blade-service-api/blade-sales-part-api/src/main/java/org/springblade/salesPart/vo/WxAppGoodsParamsVo.java

@@ -82,4 +82,11 @@ public class WxAppGoodsParamsVo {
 	 */
 	private String whetherIntegral;
 
+	/**
+	 * 仓库id集合
+	 */
+	private List<Long> storageIdList;
+
+	private Long storageId;
+
 }

+ 7 - 16
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/corps/service/impl/CorpsDescServiceImpl.java

@@ -1,21 +1,6 @@
-/*
- *      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.corps.service.impl;
 
+import com.alibaba.fastjson.JSONArray;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -107,6 +92,9 @@ public class CorpsDescServiceImpl extends ServiceImpl<CorpsDescMapper, PjCorpsDe
 			desc.setCorpsAddrList(corpsAddrService.list(new QueryWrapper<PjCorpsAddr>().eq("pid", corpsDesc.getId()).eq("is_deleted", 0)));
 			//获取客户附件
 			desc.setCorpsFilesList(corpsFilesService.list(new QueryWrapper<PjCorpsFiles>().eq("pid", corpsDesc.getId()).eq("is_deleted", 0)));
+			if(org.springframework.util.StringUtils.hasText(desc.getResourceWarehouse())) {
+				desc.setResourceWarehouseList(JSONArray.parseArray(desc.getResourceWarehouse(), Long.class));
+			}
 			//获取客户类别
 			List<String> longs = corpsTypeDescMapper.selectTypeId(corpsDesc.getId());
 			desc.setCorpsTypeId(String.join(",", longs));
@@ -202,6 +190,9 @@ public class CorpsDescServiceImpl extends ServiceImpl<CorpsDescMapper, PjCorpsDe
 			.eq(PjCorpsDesc::getSalesCompanyId, AuthUtil.getTenantId())
 			.eq(PjCorpsDesc::getCname, corpsDesc.getCname()));
 		//保存客户信息
+		if(!org.springframework.util.CollectionUtils.isEmpty(corpsDesc.getResourceWarehouseList())) {
+			corpsDesc.setResourceWarehouse(JSONArray.toJSONString(corpsDesc.getResourceWarehouseList()));
+		}
 		if (corpsDesc.getId() == null) {
 			if (!pjCorpsDesc.isEmpty()) {
 				throw new RuntimeException("客户" + corpsDesc.getCname() + "已存在,请勿重复添加!");

+ 6 - 17
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/productLaunch/controller/ProductLaunchController.java

@@ -1,19 +1,3 @@
-/*
- *      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.productLaunch.controller;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
@@ -51,6 +35,7 @@ import org.springblade.salesPart.productLaunch.service.IProductLaunchFilesServic
 import org.springblade.salesPart.productLaunch.service.IProductLaunchService;
 import org.springblade.salesPart.stock.mapper.StockDescMapper;
 import org.springblade.salesPart.vo.ProductLaunchVO;
+import org.springblade.salesPart.vo.ResourceWarehouseVo;
 import org.springblade.system.entity.Dept;
 import org.springblade.system.feign.ISysClient;
 import org.springframework.web.bind.annotation.*;
@@ -58,7 +43,6 @@ import org.springframework.web.multipart.MultipartFile;
 
 import javax.servlet.http.HttpServletResponse;
 import javax.validation.Valid;
-import java.math.BigDecimal;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
@@ -929,4 +913,9 @@ public class ProductLaunchController extends BladeController {
 		return R.data(pages);
 	}
 
+	@PostMapping("/cloudWarehouseList")
+	public R<IPage<ResourceWarehouseVo>> cloudWarehouseList(PjProductLaunch productLaunch, Query query) {
+		return productLaunchService.selectCloudWarehouseList(productLaunch, query);
+	}
+
 }

+ 10 - 0
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/productLaunch/mapper/ProductLaunchMapper.java

@@ -24,6 +24,7 @@ import org.springblade.core.tenant.annotation.TenantIgnore;
 import org.springblade.salesPart.entity.PjProductLaunch;
 import org.springblade.salesPart.excel.PjShipStockDetails;
 import org.springblade.salesPart.vo.ProductLaunchVO;
+import org.springblade.salesPart.vo.ResourceWarehouseVo;
 import org.springblade.salesPart.vo.WxAppGoodsParamsVo;
 
 import java.util.List;
@@ -60,4 +61,13 @@ public interface ProductLaunchMapper extends BaseMapper<PjProductLaunch> {
 	 * @return 结果
 	 */
     List<PjProductLaunch> selectWxAppIndexPageList(WxAppGoodsParamsVo wxAppGoodsParamsVo);
+
+
+	/**
+	 * 云仓查询
+	 *
+	 * @param wxAppGoodsParamsVo 参数
+	 * @return 结果
+	 */
+	List<ResourceWarehouseVo> selectCloudWarehouseList(WxAppGoodsParamsVo wxAppGoodsParamsVo);
 }

+ 133 - 0
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/productLaunch/mapper/ProductLaunchMapper.xml

@@ -26,6 +26,30 @@
         <result column="price_four" property="priceFour"/>
         <result column="version" property="version"/>
     </resultMap>
+
+    <resultMap id="ResourceWarehouseVoResultMap" type="org.springblade.salesPart.vo.ResourceWarehouseVo">
+        <id property="id" column="id"/>
+        <result property="tenantId" column="tenant_id"/>
+        <result property="code" column="code"/>
+        <result property="cname" column="cname"/>
+        <result property="brandId" column="brand_id"/>
+        <result property="specificationAndModel" column="specification_and_model"/>
+        <result property="brandItem" column="brand_item"/>
+        <result property="placeProduction" column="place_production"/>
+        <result property="cnameInt" column="cname_int"/>
+        <result property="explosionProof" column="explosion_proof"/>
+        <result property="originalFactory" column="original_factory"/>
+        <result property="selfRecovery" column="self_recovery"/>
+        <result property="brandName" column="brand_name"/>
+        <result property="suggestedRetailPrice" column="suggested_retail_price"/>
+        <result property="priceOne" column="price_one"/>
+        <result property="priceTwo" column="price_two"/>
+        <result property="priceThree" column="price_three"/>
+        <result property="priceFour" column="price_four"/>
+        <result property="inventoryLocal" column="inventoryLocal"/>
+        <result property="inventoryShare" column="inventoryShare"/>
+    </resultMap>
+
     <update id="updateProductLaunch">
         UPDATE pjpf_product_launch SET inventory = #{inventory} WHERE id = #{id} And tenant_id = #{tenantId}
     </update>
@@ -215,5 +239,114 @@
             ORDER BY sort DESC, inventoryLocal desc
         </if>
     </select>
+    <select id="selectCloudWarehouseList" resultMap="ResourceWarehouseVoResultMap"
+            parameterType="org.springblade.salesPart.vo.WxAppGoodsParamsVo">
+        SELECT
+        pgd.id,
+        pgd.tenant_id,
+        pgd.goods_code as  code,
+        pgd.goods_name as cname,
+        pgd.brand_id,
+        pgd.specification_and_model,
+        pgd.brand_item,
+        pgd.cname_int,
+        pgd.explosion_proof,
+        pgd.original_factory,
+        pgd.self_recovery,
+        pgd.brand_name,
+        pgd.suggested_retail_price,
+        pgd.price_one,
+        pgd.price_two,
+        pgd.price_three,
+        pgd.price_four,
+        SUM(CASE WHEN psd.storage_id = #{storageId} THEN psd.balance_quantity ELSE 0 END) AS inventoryLocal,
+        SUM(CASE WHEN psd.storage_id IN
+        <foreach collection="storageIdList" item="storageId" open="(" close=")" separator=",">
+            #{storageId}
+        </foreach>
+        THEN psd.balance_quantity ELSE 0 END) AS inventoryShare
+        FROM
+        pjpf_shopping_mall_detail pgd
+        INNER JOIN pjpf_stock_desc psd ON psd.tenant_id = pgd.tenant_id
+        AND psd.goods_id = pgd.goods_id
+        AND psd.is_deleted = 0
+        AND pgd.is_deleted = 0
+        AND psd.tenant_id = '883868'
+        WHERE
+        psd.tenant_id = #{tenantId}
+        <if test="storageIdList != null and storageIdList.size > 0">
+            and psd.storage_id in
+            <foreach collection="storageIdList" item="storageId" open="(" close="," separator=",">
+                #{storageId}
+            </foreach>
+          #{storageId})
+        </if>
+        <if test="brandId != null">
+            and pgd.brand_id = #{brandId}
+        </if>
+        <if test="brandId == null and userBrandIdList != null and userBrandIdList.size > 0">
+            and pgd.brand_id in
+            <foreach collection="userBrandIdList" item="userBrandId" open="(" close=")" separator=",">
+                #{userBrandId}
+            </foreach>
+        </if>
+        <if test="explosionProof != null">
+            and pgd.explosion_proof = #{explosionProof}
+        </if>
+        <if test="originalFactory != null and originalFactory != ''">
+            and pgd.original_factory = #{originalFactory}
+        </if>
+        <if test="selfRecovery != null  and selfRecovery != ''">
+            and pgd.self_recovery = #{selfRecovery}
+        </if>
+        <if test="cnameStatus == 1">
+            and (pgd.cname like concat('%', #{cname}, '%') or pgd.cname_int like concat('%', #{cname}, '%')
+            or pgd.brand_item like concat('%', #{cname}, '%') or pgd.specification_and_model like concat('%', #{cname},
+            '%'))
+            and pgd.brand_name like concat('%', #{brandName}, '%')
+        </if>
+        <if test="cnameStatus == 2">
+            and (pgd.cname like concat('%', #{cname}, '%') or pgd.cname_int like concat('%', #{cname}, '%')
+            or pgd.brand_item like concat('%', #{cname}, '%') or pgd.specification_and_model like concat('%', #{cname},
+            '%')
+            <if test="brandName != null  and brandName != ''">
+                or pgd.brand_name like concat('%', #{brandName}, '%')
+            </if>
+            )
+        </if>
+        <if test="cnameStatus == 3">
+            and (pgd.cname like concat('%', #{cname}, '%') or pgd.cname_int like concat('%', #{cname}, '%')
+            or pgd.brand_item like concat('%', #{cname}, '%') or pgd.specification_and_model like concat('%', #{cname},
+            '%'))
+        </if>
+        <if test="goodsIds != null and goodsIds.size > 0">
+            and pgd.goods_id in
+            <foreach collection="goodsIds" item="goodsId" open="(" close=")" separator=",">
+                #{goodsId}
+            </foreach>
+        </if>
+        <if test="inventoryStatus != null">
+            and psd.balance_quantity > #{inventoryStatus}
+        </if>
+        GROUP BY
+        pgd.id,
+        pgd.tenant_id,
+        pgd.goods_code,
+        pgd.goods_name,
+        pgd.brand_id,
+        pgd.specification_and_model,
+        pgd.brand_item,
+        pgd.cname_int,
+        pgd.explosion_proof,
+        pgd.original_factory,
+        pgd.self_recovery,
+        pgd.brand_name,
+        pgd.suggested_retail_price,
+        pgd.price_one,
+        pgd.price_two,
+        pgd.price_three,
+        pgd.price_four
+        ORDER BY inventoryLocal desc
+    </select>
 
 </mapper>

+ 10 - 16
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/productLaunch/service/IProductLaunchService.java

@@ -1,19 +1,3 @@
-/*
- *      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.productLaunch.service;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -25,6 +9,7 @@ import org.springblade.salesPart.excel.PjShipStockDetails;
 import org.springblade.salesPart.excel.ProductLaunchImportCodeExcel;
 import org.springblade.salesPart.excel.ProductLaunchImportExcel;
 import org.springblade.salesPart.vo.ProductLaunchVO;
+import org.springblade.salesPart.vo.ResourceWarehouseVo;
 
 import java.util.List;
 import java.util.Map;
@@ -126,4 +111,13 @@ public interface IProductLaunchService extends IService<PjProductLaunch> {
 	 * @return 结果
 	 */
     R<IPage<PjProductLaunch>> selectWxAppIndexPageList(PjProductLaunch productLaunch, Query query);
+
+	/**
+	 * 云仓模式查询
+	 *
+	 * @param productLaunch 参数
+	 * @param query         分页
+	 * @return 结果
+	 */
+	R<IPage<ResourceWarehouseVo>> selectCloudWarehouseList(PjProductLaunch productLaunch, Query query);
 }

+ 32 - 110
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/productLaunch/service/impl/ProductLaunchServiceImpl.java

@@ -1,33 +1,15 @@
-/*
- *      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.productLaunch.service.impl;
 
 import com.alibaba.csp.sentinel.util.StringUtil;
+import com.alibaba.fastjson.JSONArray;
 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.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.github.pagehelper.PageHelper;
-import com.github.pagehelper.PageInfo;
 import lombok.AllArgsConstructor;
-import org.springblade.common.enums.CommonEnum;
 import org.springblade.core.mp.support.Query;
 import org.springblade.core.secure.BladeUser;
 import org.springblade.core.secure.utils.AuthUtil;
@@ -40,8 +22,6 @@ 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.enums.PriceSystem;
-import org.springblade.salesPart.enums.ProductLaunchPriceSystem;
 import org.springblade.salesPart.excel.PjShipStockDetails;
 import org.springblade.salesPart.excel.ProductLaunchImportCodeExcel;
 import org.springblade.salesPart.excel.ProductLaunchImportExcel;
@@ -51,12 +31,15 @@ import org.springblade.salesPart.productLaunch.mapper.ProductLaunchMapper;
 import org.springblade.salesPart.productLaunch.service.IProductLaunchFilesService;
 import org.springblade.salesPart.productLaunch.service.IProductLaunchService;
 import org.springblade.salesPart.serial.service.IPjpfSerialService;
-import org.springblade.salesPart.shopping.entity.ShoppingMallDetail;
 import org.springblade.salesPart.shopping.mapper.ShoppingMallDetailMapper;
 import org.springblade.salesPart.shoppingCart.mapper.ShoppingCartMapper;
 import org.springblade.salesPart.stock.mapper.StockDescMapper;
 import org.springblade.salesPart.stock.service.IStockDescService;
+import org.springblade.salesPart.util.PageHelperUtil;
+import org.springblade.salesPart.util.UserUtils;
+import org.springblade.salesPart.util.WxParamUtil;
 import org.springblade.salesPart.vo.ProductLaunchVO;
+import org.springblade.salesPart.vo.ResourceWarehouseVo;
 import org.springblade.salesPart.vo.WxAppGoodsImgVo;
 import org.springblade.salesPart.vo.WxAppGoodsParamsVo;
 import org.springblade.system.entity.Dept;
@@ -1200,74 +1183,9 @@ public class ProductLaunchServiceImpl extends ServiceImpl<ProductLaunchMapper, P
 
 	@Override
 	public R<IPage<PjProductLaunch>> selectWxAppIndexPageList(PjProductLaunch productLaunch, Query query) {
+		PjCorpsDesc corpsDesc = UserUtils.getUserCorpsDesc();
 		BladeUser bladeUser = AuthUtil.getUser();
-		PjCorpsAttn corpsAttn = corpsAttnService.getAttn(bladeUser.getUserId());
-		if (ObjectUtil.isEmpty(corpsAttn)) {
-			throw new RuntimeException("未查到用户信息");
-		}
-		PjCorpsDesc corpsDesc = corpsDescService.getCorpsDesc(corpsAttn.getPid());
-		if (ObjectUtil.isEmpty(corpsDesc)) {
-			throw new RuntimeException("未查到用户信息");
-		}
-		WxAppGoodsParamsVo wxAppGoodsParamsVo = new WxAppGoodsParamsVo();
-		wxAppGoodsParamsVo.setTenantId(bladeUser.getTenantId());
-		wxAppGoodsParamsVo.setSalesCompanyId(bladeUser.getDeptId());
-		wxAppGoodsParamsVo.setBrandId(productLaunch.getBrandId());
-		brandIf:if (ObjectUtils.isNull(productLaunch.getBrandId())) {
-			// 如果
-			List<PjBrandDesc> pjBrandDescList = brandDescMapper.selectList(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()) {
-				break brandIf;
-			}
-			wxAppGoodsParamsVo.setUserBrandIdList(pjBrandDescList.stream().map(PjBrandDesc::getId).distinct().collect(Collectors.toList()));
-		}
-		wxAppGoodsParamsVo.setExplosionProof(productLaunch.getExplosionProof());
-		wxAppGoodsParamsVo.setOriginalFactory(productLaunch.getOriginalFactory());
-		wxAppGoodsParamsVo.setSelfRecovery(productLaunch.getSelfRecovery());
-		cNameIf:if (ObjectUtil.isNotEmpty(productLaunch.getCname())) {
-			if (productLaunch.getCname().contains(",")) {
-				int index = productLaunch.getCname().indexOf(",");
-				String brandName = productLaunch.getCname().substring(0, index);
-				String cname = productLaunch.getCname().substring(index + 1);
-				wxAppGoodsParamsVo.setCname(cname);
-				wxAppGoodsParamsVo.setBrandName(brandName);
-				wxAppGoodsParamsVo.setCnameStatus(1);
-				break cNameIf;
-			}
-			String[] chineseWords = productLaunch.getCname().split("[^一-龥]");
-			if (chineseWords.length > 0) {
-				String cname = productLaunch.getCname().substring(chineseWords[0].length());
-				wxAppGoodsParamsVo.setCname(ObjectUtils.isNotNull(cname) ? cname : productLaunch.getCname());
-				wxAppGoodsParamsVo.setBrandName(chineseWords[0]);
-				wxAppGoodsParamsVo.setCnameStatus(ObjectUtils.isNotNull(cname) ? 1 : 2);
-				break cNameIf;
-			}
-			wxAppGoodsParamsVo.setCname(productLaunch.getCname());
-			wxAppGoodsParamsVo.setCnameStatus(3);
-		}
-		wxAppGoodsParamsVo.setWhetherIntegral(productLaunch.getWhetherIntegral());
-		if (!CommonEnum.ONE.info.equals(productLaunch.getWhetherIntegral())) {
-			String status = iSysClient.getParamService(CommonEnum.WHETHER_BRANCH_MANAGEMENT.info);
-			managementIf: if (CommonEnum.ONE.info.equals(status) && ObjectUtils.isNotNull(corpsDesc.getDeliveryWarehouseId())) {
-				List<PjStockDesc> stockDescList = stockDescMapper.selectList(new LambdaQueryWrapper<PjStockDesc>()
-					.eq(PjStockDesc::getTenantId, bladeUser.getTenantId())
-					.eq(PjStockDesc::getIsDeleted, 0)
-					.eq(PjStockDesc::getStorageId, corpsDesc.getDeliveryWarehouseId()));
-				if (stockDescList.isEmpty()) {
-					break managementIf;
-				}
-				wxAppGoodsParamsVo.setGoodsIds(stockDescList.stream().map(PjStockDesc::getGoodsId).collect(Collectors.toList()));
-			}
-		}
-		String inventoryStatus = iSysClient.getParamService(CommonEnum.WHETHER_ZERO_INVENTORY.info);
-		if (ObjectUtils.isNull(inventoryStatus) || CommonEnum.ZERO.info.equals(inventoryStatus)) {
-			wxAppGoodsParamsVo.setInventoryStatus(0);
-		}
+		WxAppGoodsParamsVo wxAppGoodsParamsVo = WxParamUtil.parseWxAppGoodsParamsVoByProductLaunch(productLaunch, bladeUser, corpsDesc, iSysClient);
 		PageHelper.startPage(query.getCurrent(), query.getSize());
 		List<PjProductLaunch> pjProductLaunchList = productLaunchMapper.selectWxAppIndexPageList(wxAppGoodsParamsVo);
 		if (!org.springframework.util.CollectionUtils.isEmpty(pjProductLaunchList)) {
@@ -1275,28 +1193,32 @@ public class ProductLaunchServiceImpl extends ServiceImpl<ProductLaunchMapper, P
  			List<Long> brandIds = pjProductLaunchList.stream().map(PjProductLaunch::getBrandId).distinct().collect(Collectors.toList());
 			// 查询商品的所有图片并根据匹配度与优先级显示
 			List<WxAppGoodsImgVo> wxAppGoodsImgVoList = shoppingMallDetailMapper.selectWxAppGoodsImgVoList(ids, brandIds);
-			for (PjProductLaunch item : pjProductLaunchList) {
-				ProductLaunchPriceSystem priceSystem = ProductLaunchPriceSystem.fromValue(corpsDesc.getPriceSystem());
-				priceSystem.setMallPrice(item);
-				WxAppGoodsImgVo wxAppGoodsImgVo = wxAppGoodsImgVoList.stream().filter(wxImg ->
-					1 == wxImg.getType() && wxImg.getPid().equals(item.getId()) ||
-						2 == wxImg.getType() && wxImg.getPid().equals(item.getBrandId()) && StringUtils.hasText(wxImg.getBrandItem()) && wxImg.getBrandItem().equals(item.getBrandItem()) ||
-						3 == wxImg.getType() && wxImg.getPid().equals(item.getBrandId())
-				).min(Comparator.comparing(WxAppGoodsImgVo::getType)).orElse(null);
-				if (wxAppGoodsImgVo == null) {
-					continue;
-				}
-				item.setUrl(wxAppGoodsImgVo.getUrl());
-			}
+			WxParamUtil.findGoodsImg(pjProductLaunchList, wxAppGoodsImgVoList, corpsDesc.getPriceSystem());
+		}
+		return R.data(PageHelperUtil.getPageInfo(pjProductLaunchList));
+	}
+
+	@Override
+	public R<IPage<ResourceWarehouseVo>> selectCloudWarehouseList(PjProductLaunch productLaunch, Query query) {
+		PjCorpsDesc corpsDesc = UserUtils.getUserCorpsDesc();
+		BladeUser bladeUser = AuthUtil.getUser();
+		productLaunch.setTenantId(corpsDesc.getTenantId());
+		WxAppGoodsParamsVo wxAppGoodsParamsVo = WxParamUtil.parseWxAppGoodsParamsVoByProductLaunch(productLaunch, bladeUser, corpsDesc, iSysClient);
+		if (StringUtils.hasText(corpsDesc.getResourceWarehouse())) {
+			List<Long> storageIdList = JSONArray.parseArray(corpsDesc.getResourceWarehouse(), Long.class);
+			wxAppGoodsParamsVo.setStorageIdList(storageIdList);
+		}
+		wxAppGoodsParamsVo.setStorageId(corpsDesc.getDeliveryWarehouseId());
+		PageHelper.startPage(query.getCurrent(), query.getSize());
+		List<ResourceWarehouseVo> resourceWarehouseVoList = productLaunchMapper.selectCloudWarehouseList(wxAppGoodsParamsVo);
+		if (!org.springframework.util.CollectionUtils.isEmpty(resourceWarehouseVoList)) {
+			List<Long> ids = resourceWarehouseVoList.stream().map(ResourceWarehouseVo::getId).collect(Collectors.toList());
+			List<Long> brandIds = resourceWarehouseVoList.stream().map(ResourceWarehouseVo::getBrandId).distinct().collect(Collectors.toList());
+			// 查询商品的所有图片并根据匹配度与优先级显示
+			List<WxAppGoodsImgVo> wxAppGoodsImgVoList = shoppingMallDetailMapper.selectWxAppGoodsImgVoList(ids, brandIds);
+			WxParamUtil.findResourceWarehouseImg(resourceWarehouseVoList, wxAppGoodsImgVoList, corpsDesc.getPriceSystem());
 		}
-		// TODO: 此处可优化
-		PageInfo<PjProductLaunch> pageInfo = new PageInfo<>(pjProductLaunchList);
-		IPage<PjProductLaunch> page = new Page<>();
-		page.setRecords(pageInfo.getList());
-		page.setTotal(pageInfo.getTotal());
-		page.setCurrent(pageInfo.getPageNum());
-		page.setSize(pageInfo.getPageSize());
-		return R.data(page);
+		return R.data(PageHelperUtil.getPageInfo(resourceWarehouseVoList));
 	}
 
 }

+ 2 - 1
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/share/mapper/SharePutOnShelvesMapper.xml

@@ -1,5 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<!--suppress ALL -->
 <mapper namespace="org.springblade.salesPart.share.mapper.SharePutOnShelvesMapper">
 
     <!-- 通用查询映射结果 -->
@@ -57,7 +58,7 @@
           and find_in_set(src_shared_id, #{ids})
     </update>
     <update id="updateSharePutOnShelves">
-        UPDATE pjpf_share_put_on_shelves SET inventory = #{inventory} WHERE id = #{id} And tenant_id = #{tenantId}
+        UPDATE pjpf_share_put_on_shelves SET inventory = #{inventory}, update_user = #{updateUser}, update_time = now() WHERE id = #{id} And tenant_id = #{tenantId}
     </update>
     <update id="updateShareCost">
         UPDATE pjpf_share_put_on_shelves SET share_cost = #{shareCost} WHERE product_launch_id = #{productLaunchId}

+ 0 - 2
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/util/WxParamUtil.java

@@ -5,7 +5,6 @@ import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
 import org.springblade.common.enums.CommonEnum;
 import org.springblade.core.secure.BladeUser;
 import org.springblade.core.secure.utils.AuthUtil;
-import org.springblade.core.tool.api.R;
 import org.springblade.core.tool.utils.ObjectUtil;
 import org.springblade.core.tool.utils.SpringUtil;
 import org.springblade.salesPart.brand.service.IBrandDescService;
@@ -18,7 +17,6 @@ import org.springblade.salesPart.vo.ResourceWarehouseVo;
 import org.springblade.salesPart.vo.WxAppGoodsImgVo;
 import org.springblade.salesPart.vo.WxAppGoodsParamsVo;
 import org.springblade.system.feign.ISysClient;
-import org.springblade.system.user.entity.User;
 import org.springframework.beans.BeanUtils;
 import org.springframework.util.CollectionUtils;
 import org.springframework.util.StringUtils;