Jelajahi Sumber

2025年1月17日17:35:59

纪新园 11 bulan lalu
induk
melakukan
617902ab5d
16 mengubah file dengan 934 tambahan dan 16 penghapusan
  1. 34 0
      blade-service-api/blade-sales-part-api/src/main/java/org/springblade/salesPart/shopping/dto/ShoppingMallDetailDTO.java
  2. 90 0
      blade-service-api/blade-sales-part-api/src/main/java/org/springblade/salesPart/shopping/entity/ShoppingMallDetail.java
  3. 36 0
      blade-service-api/blade-sales-part-api/src/main/java/org/springblade/salesPart/shopping/vo/ShoppingMallDetailVO.java
  4. 1 0
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/corps/mapper/CorpsDescMapper.xml
  5. 1 1
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/goods/mapper/GoodsDescMapper.xml
  6. 3 1
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/order/mapper/OrderItemsMapper.xml
  7. 7 1
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/order/mapper/OrderMapper.xml
  8. 13 11
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/order/service/impl/OrderServiceImpl.java
  9. 0 1
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/share/controller/SharePutOnShelvesController.java
  10. 2 0
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/ship/service/impl/ShipServiceImpl.java
  11. 415 0
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/shopping/controller/ShoppingMallDetailController.java
  12. 42 0
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/shopping/mapper/ShoppingMallDetailMapper.java
  13. 38 0
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/shopping/mapper/ShoppingMallDetailMapper.xml
  14. 45 0
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/shopping/service/IShoppingMallDetailService.java
  15. 206 0
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/shopping/service/impl/ShoppingMallDetailServiceImpl.java
  16. 1 1
      blade-service/blade-system/src/main/java/org/springblade/system/mapper/DeptMapper.xml

+ 34 - 0
blade-service-api/blade-sales-part-api/src/main/java/org/springblade/salesPart/shopping/dto/ShoppingMallDetailDTO.java

@@ -0,0 +1,34 @@
+/*
+ *      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.dto;
+
+import org.springblade.salesPart.shopping.entity.ShoppingMallDetail;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * VIEW数据传输对象实体类
+ *
+ * @author BladeX
+ * @since 2025-01-17
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class ShoppingMallDetailDTO extends ShoppingMallDetail {
+	private static final long serialVersionUID = 1L;
+
+}

+ 90 - 0
blade-service-api/blade-sales-part-api/src/main/java/org/springblade/salesPart/shopping/entity/ShoppingMallDetail.java

@@ -0,0 +1,90 @@
+/*
+ *      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.entity;
+
+import java.math.BigDecimal;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import java.io.Serializable;
+import java.util.List;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import org.springblade.salesPart.entity.PjProductLaunchFiles;
+
+/**
+ * VIEW实体类
+ *
+ * @author BladeX
+ * @since 2025-01-17
+ */
+@Data
+@TableName("pjpf_shopping_mall_detail")
+@ApiModel(value = "ShoppingMallDetail对象", description = "VIEW")
+public class ShoppingMallDetail implements Serializable {
+
+	private static final long serialVersionUID = 1L;
+
+	private Long id;
+	private Long salesCompanyId;
+	private String salesCompanyName;
+	private Long brandId;
+	private String brandName;
+	private Integer explosionProof;
+	private String originalFactory;
+	private String selfRecovery;
+	private Long goodsId;
+	private String goodsName;
+	private String goodsCode;
+	private String goodsSize;
+	private String cnameInt;
+	private String brandItem;
+	private String specificationAndModel;
+	private BigDecimal inventory;
+	private BigDecimal priceOne;
+	private BigDecimal priceTwo;
+	private BigDecimal priceThree;
+	private BigDecimal priceFour;
+	private String detailsText;
+	private Integer isDeleted;
+	private BigDecimal shareCost;
+	private Long billType;
+	private String tenantId;
+
+	/**
+	 * 附件明细集合
+	 */
+	@TableField(exist = false)
+	private List<PjProductLaunchFiles> filesList;
+
+	/**
+	 * app用于显示价格字段
+	 */
+	@TableField(exist = false)
+	private BigDecimal mallPrice;
+
+	/**
+	 * 数量
+	 */
+	@TableField(exist = false)
+	private BigDecimal goodsNum;
+
+
+}

+ 36 - 0
blade-service-api/blade-sales-part-api/src/main/java/org/springblade/salesPart/shopping/vo/ShoppingMallDetailVO.java

@@ -0,0 +1,36 @@
+/*
+ *      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.vo;
+
+import org.springblade.salesPart.shopping.entity.ShoppingMallDetail;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import io.swagger.annotations.ApiModel;
+
+/**
+ * VIEW视图实体类
+ *
+ * @author BladeX
+ * @since 2025-01-17
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ApiModel(value = "ShoppingMallDetailVO对象", description = "VIEW")
+public class ShoppingMallDetailVO extends ShoppingMallDetail {
+	private static final long serialVersionUID = 1L;
+
+}

+ 1 - 0
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/corps/mapper/CorpsDescMapper.xml

@@ -332,6 +332,7 @@
         select *
         from pjpf_corps_desc
         where is_deleted = '0'
+          and corp_type = 'KH'
           and cname = #{deptName}
           and tenant_id = #{tenantId}
     </select>

+ 1 - 1
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/goods/mapper/GoodsDescMapper.xml

@@ -53,7 +53,7 @@
         from pjpf_goods_desc
         where is_deleted = 0
           and tenant_id = #{tenantId}
-          and find_in_set(id, #{goodsNo})
+          and find_in_set(code, #{goodsNo})
     </select>
 
 </mapper>

+ 3 - 1
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/order/mapper/OrderItemsMapper.xml

@@ -37,8 +37,9 @@
         <result column="inventory" property="inventory"/>
     </resultMap>
     <insert id="insertOrderItems" parameterType="org.springblade.salesPart.entity.PjOrderItems" useGeneratedKeys="true" keyProperty="id">
-        insert into pjpf_order
+        insert into pjpf_order_items
         <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="id != null">id,</if>
             <if test="pid != null">pid,</if>
             <if test="tenantId != null">tenant_id,</if>
             <if test="createUser != null">create_user,</if>
@@ -67,6 +68,7 @@
             <if test="rebateProfit != null">rebate_profit,</if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="id != null">#{id},</if>
             <if test="pid != null">#{pid},</if>
             <if test="tenantId != null">#{tenantId},</if>
             <if test="createUser != null">#{createUser},</if>

+ 7 - 1
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/order/mapper/OrderMapper.xml

@@ -83,6 +83,7 @@
     <insert id="insertOrder"  parameterType="org.springblade.salesPart.entity.PjOrder" useGeneratedKeys="true" keyProperty="id">
         insert into pjpf_order
         <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="id != null">id,</if>
             <if test="customerId != null">customer_id,</if>
             <if test="customerName != null">customer_name,</if>
             <if test="bsType != null">bs_type,</if>
@@ -101,8 +102,11 @@
             <if test="createTime != null">create_time,</if>
             <if test="tenantId != null">tenant_id,</if>
             <if test="remarks != null">remarks,</if>
+            <if test="salesCompanyId != null">sales_company_id,</if>
+            <if test="salesCompanyName != null">sales_company_name,</if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="id != null">#{id},</if>
             <if test="customerId != null">#{customerId},</if>
             <if test="customerName != null">#{customerName},</if>
             <if test="bsType != null">#{bsType},</if>
@@ -121,6 +125,8 @@
             <if test="createTime != null">#{createTime},</if>
             <if test="tenantId != null">#{tenantId},</if>
             <if test="remarks != null">#{remarks},</if>
+            <if test="salesCompanyId != null">#{salesCompanyId},</if>
+            <if test="salesCompanyName != null">#{salesCompanyName},</if>
         </trim>
     </insert>
 
@@ -946,7 +952,7 @@
         WHERE
             is_deleted = '0'
           AND bs_type = 'XS'
-        and src_no = #{ordNo}
+          and src_no like concat('%', #{ordNo}, '%')
         and sales_company_name = #{sharedCompanyName}
     </select>
 </mapper>

+ 13 - 11
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/order/service/impl/OrderServiceImpl.java

@@ -22,6 +22,7 @@ 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.IdWorker;
 import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
 import com.baomidou.mybatisplus.core.toolkit.StringUtils;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@@ -4106,7 +4107,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, PjOrder> implemen
 			shareSalesItemsService.saveBatch(shareSalesItemsList);
 		}
 		if (!order.getOrderItemsList().isEmpty()) {
-			orderItemsService.saveBatch(order.getOrderItemsList());
+			orderItemsService.updateBatchById(order.getOrderItemsList());
 		}
 		if (ObjectUtils.isNull(pjOrder.getOldTrxId())) {
 			if (!sharePutOnShelvesListNew.isEmpty()) {
@@ -4137,6 +4138,8 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, PjOrder> implemen
 			}
 		}
 		PjOrder sharePjOrder = new PjOrder();
+		Long sharePjOrderId = IdWorker.getId();
+		sharePjOrder.setId(sharePjOrderId);
 		sharePjOrder.setTenantId(dept.getTenantId());
 		sharePjOrder.setCustomerId(corpsDesc.getId());
 		sharePjOrder.setCustomerName(corpsDesc.getCname());
@@ -4163,7 +4166,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, PjOrder> implemen
 		}
 		String goodsNo = orderItemsList.stream().map(PjOrderItems::getGoodsNo).distinct().collect(Collectors.joining(","));
 		List<PjGoodsDesc> goodsDescList = goodsDescMapper.selectListGoods(goodsNo, dept.getTenantId());
-		if (!goodsDescList.isEmpty()) {
+		if (goodsDescList.isEmpty()) {
 			throw new RuntimeException("未查到对应商品信息");
 		}
 		List<PjOrderItems> itemsList = new ArrayList<>();
@@ -4184,7 +4187,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, PjOrder> implemen
 				orderItems.setGoodsDescription(goodsDesc.getGoodsDescription());
 				orderItems.setUnits(goodsDesc.getUnit());
 			} else {
-				throw new RuntimeException("商品:" + goodsDesc.getCname() + "未查到");
+				throw new RuntimeException("商品编号:" + items.getGoodsNo() + "未查到");
 			}
 			orderItems.setDot(items.getDot());
 			orderItems.setSalesCompanyId(dept.getId());
@@ -4199,6 +4202,12 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, PjOrder> implemen
 			orderItems.setRebatePrice(items.getCostpriePrice());
 			orderItems.setRebateCostprie(orderItems.getSubTotalMoney());
 			orderItems.setRebateProfit(new BigDecimal("0.00"));
+			orderItems.setId(IdWorker.getId());
+			orderItems.setPid(sharePjOrderId);
+			int counts = orderItemsService.insertOrderItems(orderItems);
+			if (counts == 0) {
+				throw new RuntimeException("保存销售单明细失败,请联系管理员");
+			}
 			itemsList.add(orderItems);
 		}
 		BigDecimal amount = itemsList.stream().map(PjOrderItems::getSubTotalMoney).reduce(BigDecimal.ZERO, BigDecimal::add);
@@ -4211,13 +4220,6 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, PjOrder> implemen
 		if (count == 0) {
 			throw new RuntimeException("保存销售单失败,请联系管理员");
 		}
-		for (PjOrderItems items : itemsList) {
-			items.setPid(sharePjOrder.getId());
-			int counts = orderItemsService.insertOrderItems(items);
-			if (counts == 0) {
-				throw new RuntimeException("保存销售单明细失败,请联系管理员");
-			}
-		}
 		return true;
 	}
 
@@ -4242,7 +4244,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, PjOrder> implemen
 			.eq(ShareSalesItems::getTenantId, AuthUtil.getTenantId())
 			.eq(ShareSalesItems::getIsDeleted, 0)
 			.eq(ShareSalesItems::getPid, order.getId())
-			.apply("find_in_set(sec_pid , '" + itemIds + "')"));
+			.apply("find_in_set(src_pid , '" + itemIds + "')"));
 		if (shareSalesItemsList.isEmpty()) {
 			throw new RuntimeException("未查到对应派发明细信息");
 		}

+ 0 - 1
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/share/controller/SharePutOnShelvesController.java

@@ -144,7 +144,6 @@ public class SharePutOnShelvesController extends BladeController {
 		LambdaQueryWrapper<SharePutOnShelves> lambdaQueryWrapper = new LambdaQueryWrapper<>();
 		lambdaQueryWrapper.eq(SharePutOnShelves::getTenantId, AuthUtil.getTenantId())
 			.eq(SharePutOnShelves::getIsDeleted, 0)
-			.eq(SharePutOnShelves::getSalesCompanyId, AuthUtil.getDeptId())
 			.eq(ObjectUtils.isNotNull(sharePutOnShelves.getGoodsId()), SharePutOnShelves::getGoodsId, sharePutOnShelves.getGoodsId())
 			.eq( SharePutOnShelves::getBillType,1)
 			.eq( SharePutOnShelves::getShareStatus, "已确认");

+ 2 - 0
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/ship/service/impl/ShipServiceImpl.java

@@ -5035,6 +5035,8 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
 					stockDesc.setStoreInventory(item.getSendNum());
 					stockDesc.setInventoryAmount(item.getSendNum().multiply(item.getPrice()));
 					stockDesc.setRebateInventoryAmount(item.getSendNum().multiply(item.getRebatePrice()));
+					stockDesc.setInventoryCostPrice(item.getPrice());
+					stockDesc.setRebatePrice(item.getRebatePrice());
 					/*if (stockDesc.getBalanceQuantity().compareTo(new BigDecimal("0")) != 0) {
 						stockDesc.setInventoryCostPrice(stockDesc.getInventoryAmount().divide(stockDesc.getBalanceQuantity(), MathContext.DECIMAL32).setScale(2, RoundingMode.HALF_UP));
 						stockDesc.setRebatePrice(stockDesc.getRebateInventoryAmount().divide(stockDesc.getBalanceQuantity(), MathContext.DECIMAL32).setScale(2, RoundingMode.HALF_UP));

+ 415 - 0
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/shopping/controller/ShoppingMallDetailController.java

@@ -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);
+	}
+
+
+}

+ 42 - 0
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/shopping/mapper/ShoppingMallDetailMapper.java

@@ -0,0 +1,42 @@
+/*
+ *      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.mapper;
+
+import org.springblade.salesPart.shopping.entity.ShoppingMallDetail;
+import org.springblade.salesPart.shopping.vo.ShoppingMallDetailVO;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import java.util.List;
+
+/**
+ * VIEW Mapper 接口
+ *
+ * @author BladeX
+ * @since 2025-01-17
+ */
+public interface ShoppingMallDetailMapper extends BaseMapper<ShoppingMallDetail> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param shoppingMallDetail
+	 * @return
+	 */
+	List<ShoppingMallDetailVO> selectShoppingMallDetailPage(IPage page, ShoppingMallDetailVO shoppingMallDetail);
+
+}

+ 38 - 0
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/shopping/mapper/ShoppingMallDetailMapper.xml

@@ -0,0 +1,38 @@
+<?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">
+<mapper namespace="org.springblade.salesPart.shopping.mapper.ShoppingMallDetailMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="shoppingMallDetailResultMap" type="org.springblade.salesPart.shopping.entity.ShoppingMallDetail">
+        <result column="id" property="id"/>
+        <result column="sales_company_id" property="salesCompanyId"/>
+        <result column="sales_company_name" property="salesCompanyName"/>
+        <result column="brand_id" property="brandId"/>
+        <result column="brand_name" property="brandName"/>
+        <result column="explosion_proof" property="explosionProof"/>
+        <result column="original_factory" property="originalFactory"/>
+        <result column="self_recovery" property="selfRecovery"/>
+        <result column="goods_id" property="goodsId"/>
+        <result column="goods_name" property="goodsName"/>
+        <result column="goods_code" property="goodsCode"/>
+        <result column="goods_size" property="goodsSize"/>
+        <result column="cname_int" property="cnameInt"/>
+        <result column="brand_item" property="brandItem"/>
+        <result column="specification_and_model" property="specificationAndModel"/>
+        <result column="inventory" property="inventory"/>
+        <result column="price_one" property="priceOne"/>
+        <result column="price_two" property="priceTwo"/>
+        <result column="price_three" property="priceThree"/>
+        <result column="price_four" property="priceFour"/>
+        <result column="details_text" property="detailsText"/>
+        <result column="is_deleted" property="isDeleted"/>
+        <result column="share_cost" property="shareCost"/>
+        <result column="bill_type" property="billType"/>
+    </resultMap>
+
+
+    <select id="selectShoppingMallDetailPage" resultMap="shoppingMallDetailResultMap">
+        select * from pjpf_shopping_mall_detail where is_deleted = 0
+    </select>
+
+</mapper>

+ 45 - 0
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/shopping/service/IShoppingMallDetailService.java

@@ -0,0 +1,45 @@
+/*
+ *      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.service;
+
+import org.springblade.salesPart.entity.PjProductLaunch;
+import org.springblade.salesPart.shopping.entity.ShoppingMallDetail;
+import org.springblade.salesPart.shopping.vo.ShoppingMallDetailVO;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+import java.util.Map;
+
+/**
+ * VIEW 服务类
+ *
+ * @author BladeX
+ * @since 2025-01-17
+ */
+public interface IShoppingMallDetailService extends IService<ShoppingMallDetail> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param shoppingMallDetail
+	 * @return
+	 */
+	IPage<ShoppingMallDetailVO> selectShoppingMallDetailPage(IPage<ShoppingMallDetailVO> page, ShoppingMallDetailVO shoppingMallDetail);
+
+    Map<String, Object> getAppMessageById(PjProductLaunch productLaunch);
+}

+ 206 - 0
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/shopping/service/impl/ShoppingMallDetailServiceImpl.java

@@ -0,0 +1,206 @@
+/*
+ *      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.service.impl;
+
+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.ObjectUtils;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import lombok.AllArgsConstructor;
+import org.springblade.core.secure.utils.AuthUtil;
+import org.springblade.core.tool.utils.BeanUtil;
+import org.springblade.core.tool.utils.ObjectUtil;
+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.productLaunch.service.IProductLaunchFilesService;
+import org.springblade.salesPart.shopping.entity.ShoppingMallDetail;
+import org.springblade.salesPart.shopping.mapper.ShoppingMallDetailMapper;
+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.stereotype.Service;
+
+import java.math.BigDecimal;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+/**
+ * VIEW 服务实现类
+ *
+ * @author BladeX
+ * @since 2025-01-17
+ */
+@Service
+@AllArgsConstructor
+public class ShoppingMallDetailServiceImpl extends ServiceImpl<ShoppingMallDetailMapper, ShoppingMallDetail> implements IShoppingMallDetailService {
+
+
+	private final ISysClient iSysClient;
+	private final IProductLaunchFilesService productLaunchFilesService;
+	private final ICorpsAttnService corpsAttnService;//客户联系人
+	private final ICorpsDescService corpsDescService;//客户
+	private final IBrandFilesService brandFilesService;
+	private final IBrandFigureService brandFigureService;
+	private final StockDescMapper stockDescMapper;
+
+	@Override
+	public IPage<ShoppingMallDetailVO> selectShoppingMallDetailPage(IPage<ShoppingMallDetailVO> page, ShoppingMallDetailVO shoppingMallDetail) {
+		return page.setRecords(baseMapper.selectShoppingMallDetailPage(page, shoppingMallDetail));
+	}
+
+	@Override
+	public Map<String, Object> getAppMessageById(PjProductLaunch productLaunch) {
+		Map<String, Object> map = new HashMap<>();
+
+		ShoppingMallDetail detail = baseMapper.selectById(productLaunch.getId());
+		if (0 == detail.getBillType()) {
+			List<ShoppingMallDetail> shoppingMallDetailShareList = baseMapper.selectList(new LambdaQueryWrapper<ShoppingMallDetail>()
+				.eq(ShoppingMallDetail::getTenantId, AuthUtil.getTenantId())
+				.eq(ShoppingMallDetail::getIsDeleted, 0)
+				.eq(ShoppingMallDetail::getBillType, 1)
+				.eq(ShoppingMallDetail::getGoodsCode, detail.getGoodsCode()));
+			if (!shoppingMallDetailShareList.isEmpty()) {
+				BigDecimal inventory = shoppingMallDetailShareList.stream().map(ShoppingMallDetail::getInventory)
+					.reduce(BigDecimal.ZERO, BigDecimal::add);
+				detail.setInventory(detail.getInventory().add(inventory));
+			}
+		}
+		detail.setGoodsNum(new BigDecimal(1));
+		List<PjProductLaunchFiles> pjProductLaunchFilesList = productLaunchFilesService.list(new QueryWrapper<PjProductLaunchFiles>()
+			.eq("pid", detail.getId()).eq("is_deleted", 0));
+		List<PjBrandFiles> pjBrandFilesList = brandFilesService.list(new QueryWrapper<PjBrandFiles>()
+			.in("pid", detail.getBrandId()).eq("is_deleted", 0));
+		List<BrandFigure> brandFigureList = brandFigureService.list(new QueryWrapper<BrandFigure>()
+			.in("pid", detail.getBrandId()).eq("is_deleted", 0));
+		//获得附件
+		if (!pjProductLaunchFilesList.isEmpty()) {
+			List<PjProductLaunchFiles> list = pjProductLaunchFilesList.stream().filter(e -> e.getPid().equals(detail.getId())).collect(Collectors.toList());
+			if (!list.isEmpty()) {
+				detail.setFilesList(list);
+			} else {
+				if (ObjectUtils.isNotNull(detail.getBrandId())) {
+					if (!brandFigureList.isEmpty()) {
+						List<BrandFigure> brandFigureList1 = brandFigureList.stream()
+							.filter(e -> e.getPid().equals(detail.getBrandId()) && e.getFigure().equals(detail.getBrandItem()))
+							.collect(Collectors.toList());
+						if (!brandFigureList1.isEmpty()) {
+							detail.setFilesList(BeanUtil.copy(brandFigureList1, PjProductLaunchFiles.class));
+						} else {
+							if (!pjBrandFilesList.isEmpty()) {
+								List<PjBrandFiles> pjBarndFilesList1 = pjBrandFilesList.stream()
+									.filter(e -> e.getPid().equals(detail.getBrandId()))
+									.collect(Collectors.toList());
+								if (!pjBarndFilesList1.isEmpty()) {
+									detail.setFilesList(BeanUtil.copy(pjBarndFilesList1, PjProductLaunchFiles.class));
+								}
+							}
+						}
+					} else {
+						if (!pjBrandFilesList.isEmpty()) {
+							List<PjBrandFiles> pjBarndFilesList1 = pjBrandFilesList.stream()
+								.filter(e -> e.getPid().equals(detail.getBrandId()))
+								.collect(Collectors.toList());
+							if (!pjBarndFilesList1.isEmpty()) {
+								detail.setFilesList(BeanUtil.copy(pjBarndFilesList1, PjProductLaunchFiles.class));
+							}
+						}
+					}
+				}
+			}
+		} else {
+			if (ObjectUtils.isNotNull(detail.getBrandId())) {
+				if (!brandFigureList.isEmpty()) {
+					List<BrandFigure> brandFigureList1 = brandFigureList.stream()
+						.filter(e -> e.getPid().equals(detail.getBrandId()) && e.getFigure().equals(detail.getBrandItem()))
+						.collect(Collectors.toList());
+					if (!brandFigureList1.isEmpty()) {
+						detail.setFilesList(BeanUtil.copy(brandFigureList1, PjProductLaunchFiles.class));
+					} else {
+						if (!pjBrandFilesList.isEmpty()) {
+							List<PjBrandFiles> pjBarndFilesList1 = pjBrandFilesList.stream()
+								.filter(e -> e.getPid().equals(detail.getBrandId()))
+								.collect(Collectors.toList());
+							if (!pjBarndFilesList1.isEmpty()) {
+								detail.setFilesList(BeanUtil.copy(pjBarndFilesList1, PjProductLaunchFiles.class));
+							}
+						}
+					}
+				} else {
+					if (!pjBrandFilesList.isEmpty()) {
+						List<PjBrandFiles> pjBarndFilesList1 = pjBrandFilesList.stream()
+							.filter(e -> e.getPid().equals(detail.getBrandId()))
+							.collect(Collectors.toList());
+						if (!pjBarndFilesList1.isEmpty()) {
+							detail.setFilesList(BeanUtil.copy(pjBarndFilesList1, PjProductLaunchFiles.class));
+						}
+					}
+				}
+			}
+		}
+		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 {
+				if (ObjectUtil.isNotEmpty(corpsDesc.getPriceSystem())) {
+					if ("售价1".equals(corpsDesc.getPriceSystem())) {
+						detail.setMallPrice(detail.getPriceOne());
+					} else if ("售价2".equals(corpsDesc.getPriceSystem())) {
+						detail.setMallPrice(detail.getPriceTwo());
+					} else if ("售价3".equals(corpsDesc.getPriceSystem())) {
+						detail.setMallPrice(detail.getPriceThree());
+					} else if ("售价4".equals(corpsDesc.getPriceSystem())) {
+						detail.setMallPrice(detail.getPriceFour());
+					}
+				} else {
+					detail.setMallPrice(detail.getPriceOne());
+				}
+			}
+		} else {
+			throw new RuntimeException("未查到用户信息");
+		}
+		String status = iSysClient.getParamService("whether.branch.management");
+		if (ObjectUtils.isNotNull(status) && "1".equals(status)) {
+			if (ObjectUtils.isNotNull(corpsDesc.getDeliveryWarehouseId())) {
+				List<PjStockDesc> stockDescList = stockDescMapper.selectList(new LambdaQueryWrapper<PjStockDesc>()
+					.eq(PjStockDesc::getTenantId, AuthUtil.getTenantId())
+					.eq(PjStockDesc::getIsDeleted, 0)
+					.eq(PjStockDesc::getStorageId, corpsDesc.getDeliveryWarehouseId())
+					.eq(PjStockDesc::getGoodsId, detail.getGoodsId())
+				);
+				if (!stockDescList.isEmpty()) {
+					detail.setInventory(stockDescList.stream().map(PjStockDesc::getBalanceQuantity).reduce(BigDecimal.ZERO, BigDecimal::add));
+				}
+			}
+		}
+		map.put("type", 0);
+		map.put("thisLocality", detail);
+		map.put("offsite", null);
+		return map;
+	}
+
+}

+ 1 - 1
blade-service/blade-system/src/main/java/org/springblade/system/mapper/DeptMapper.xml

@@ -178,6 +178,6 @@
         select *
         from blade_dept
         where is_deleted = '0'
-        id = #{sharedCompanyId}
+        and id = #{sharedCompanyId}
     </select>
 </mapper>