ソースを参照

20230509 08:38

wangzhuo 2 年 前
コミット
36b33a067b
18 ファイル変更843 行追加245 行削除
  1. 34 0
      blade-service-api/blade-sales-part-api/src/main/java/org/springblade/salesPart/dto/ProductLaunchFilesDTO.java
  2. 1 97
      blade-service-api/blade-sales-part-api/src/main/java/org/springblade/salesPart/entity/PjGoodsDesc.java
  3. 121 5
      blade-service-api/blade-sales-part-api/src/main/java/org/springblade/salesPart/entity/PjProductLaunch.java
  4. 131 0
      blade-service-api/blade-sales-part-api/src/main/java/org/springblade/salesPart/entity/PjProductLaunchFiles.java
  5. 0 6
      blade-service-api/blade-sales-part-api/src/main/java/org/springblade/salesPart/excel/GoodsDescExportExcel.java
  6. 0 99
      blade-service-api/blade-sales-part-api/src/main/java/org/springblade/salesPart/excel/GoodsExcel.java
  7. 86 3
      blade-service-api/blade-sales-part-api/src/main/java/org/springblade/salesPart/excel/ProductLaunchImportExcel.java
  8. 36 0
      blade-service-api/blade-sales-part-api/src/main/java/org/springblade/salesPart/vo/ProductLaunchFilesVO.java
  9. 0 10
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/goods/mapper/GoodsDescMapper.xml
  10. 0 10
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/goods/service/impl/GoodsDescServiceImpl.java
  11. 23 1
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/productLaunch/controller/ProductLaunchController.java
  12. 130 0
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/productLaunch/controller/ProductLaunchFilesController.java
  13. 43 0
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/productLaunch/mapper/ProductLaunchFilesMapper.java
  14. 30 0
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/productLaunch/mapper/ProductLaunchFilesMapper.xml
  15. 10 2
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/productLaunch/mapper/ProductLaunchMapper.xml
  16. 41 0
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/productLaunch/service/IProductLaunchFilesService.java
  17. 41 0
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/productLaunch/service/impl/ProductLaunchFilesServiceImpl.java
  18. 116 12
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/productLaunch/service/impl/ProductLaunchServiceImpl.java

+ 34 - 0
blade-service-api/blade-sales-part-api/src/main/java/org/springblade/salesPart/dto/ProductLaunchFilesDTO.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.dto;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.salesPart.entity.PjProductLaunchFiles;
+
+/**
+ * 配件批发上架管理附件数据传输对象实体类
+ *
+ * @author BladeX
+ * @since 2023-05-08
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class ProductLaunchFilesDTO extends PjProductLaunchFiles {
+	private static final long serialVersionUID = 1L;
+
+}

+ 1 - 97
blade-service-api/blade-sales-part-api/src/main/java/org/springblade/salesPart/entity/PjGoodsDesc.java

@@ -160,56 +160,7 @@ public class PjGoodsDesc implements Serializable {
 	*/
 		@ApiModelProperty(value = "产品名称提取数字")
 		private String cnameInt;
-	/**
-	* 采购价
-	*/
-		@ApiModelProperty(value = "采购价")
-		private BigDecimal purchasePrice;
-	/**
-	* 销售价
-	*/
-		@ApiModelProperty(value = "销售价")
-		private BigDecimal salesPrice;
-	/**
-	* 售价1
-	*/
-		@ApiModelProperty(value = "售价1")
-		private BigDecimal priceOne;
-	/**
-	* 售价2
-	*/
-		@ApiModelProperty(value = "售价2")
-		private BigDecimal priceTwo;
-	/**
-	* 售价3
-	*/
-		@ApiModelProperty(value = "售价3")
-		private BigDecimal priceThree;
-	/**
-	* 售价4
-	*/
-		@ApiModelProperty(value = "售价4")
-		private BigDecimal priceFour;
-	/**
-	* 售价5
-	*/
-		@ApiModelProperty(value = "售价5")
-		private BigDecimal priceFive;
-	/**
-	* 售价6
-	*/
-		@ApiModelProperty(value = "售价6")
-		private BigDecimal priceSix;
-	/**
-	* 售价7
-	*/
-		@ApiModelProperty(value = "售价7")
-		private BigDecimal priceSeven;
-	/**
-	* 售价8
-	*/
-		@ApiModelProperty(value = "售价8")
-		private BigDecimal priceEight;
+
 	/**
 	* 是否启用(0启用,1停用)
 	*/
@@ -254,53 +205,6 @@ public class PjGoodsDesc implements Serializable {
 	@ApiModelProperty(value = "自修补")
 	private String selfRecovery;
 
-	/**
-	 * 次日达售价1
-	 */
-	@ApiModelProperty(value = "次日达售价1")
-	private BigDecimal nextDayDeliveryPriceOne;
-
-	/**
-	 * 次日达售价2
-	 */
-	@ApiModelProperty(value = "次日达售价2")
-	private BigDecimal nextDayDeliveryPriceTwo;
-
-	/**
-	 * 次日达售价3
-	 */
-	@ApiModelProperty(value = "次日达售价3")
-	private BigDecimal nextDayDeliveryPriceThree;
-
-	/**
-	 * 次日达售价4
-	 */
-	@ApiModelProperty(value = "次日达售价4")
-	private BigDecimal nextDayDeliveryPriceFour;
-
-	/**
-	 * 次日达售价5
-	 */
-	@ApiModelProperty(value = "次日达售价5")
-	private BigDecimal nextDayDeliveryPriceFive;
-
-	/**
-	 * 次日达售价6
-	 */
-	@ApiModelProperty(value = "次日达售价6")
-	private BigDecimal nextDayDeliveryPriceSix;
-
-	/**
-	 * 次日达售价7
-	 */
-	@ApiModelProperty(value = "次日达售价7")
-	private BigDecimal nextDayDeliveryPriceSeven;
-
-	/**
-	 * 次日达售价8
-	 */
-	@ApiModelProperty(value = "次日达售价8")
-	private BigDecimal nextDayDeliveryPriceEight;
 
 	/**
 	 * 商品分类名称

+ 121 - 5
blade-service-api/blade-sales-part-api/src/main/java/org/springblade/salesPart/entity/PjProductLaunch.java

@@ -23,6 +23,7 @@ import com.baomidou.mybatisplus.annotation.TableName;
 import java.time.LocalDateTime;
 import java.io.Serializable;
 import java.util.Date;
+import java.util.List;
 
 import lombok.Data;
 import lombok.EqualsAndHashCode;
@@ -92,6 +93,12 @@ public class PjProductLaunch implements Serializable {
 	*/
 		@ApiModelProperty(value = "订单状态")
 		private String status;
+
+	/**
+	 * 类型(0 本地,1 共享)
+	 */
+	private Integer billType;
+
 	/**
 	* 所属公司id
 	*/
@@ -119,11 +126,7 @@ public class PjProductLaunch implements Serializable {
 	*/
 		@ApiModelProperty(value = "规格型号")
 		private String specificationAndModel;
-	/**
-	* 商城价格
-	*/
-		@ApiModelProperty(value = "商城价格")
-		private BigDecimal salesPrice;
+
 	/**
 	* 库存
 	*/
@@ -148,5 +151,118 @@ public class PjProductLaunch implements Serializable {
 	@TableField(exist = false)
 	private Integer flag;
 
+	/**
+	 * 售价1
+	 */
+	@ApiModelProperty(value = "售价1")
+	private BigDecimal priceOne;
+	/**
+	 * 售价2
+	 */
+	@ApiModelProperty(value = "售价2")
+	private BigDecimal priceTwo;
+	/**
+	 * 售价3
+	 */
+	@ApiModelProperty(value = "售价3")
+	private BigDecimal priceThree;
+	/**
+	 * 售价4
+	 */
+	@ApiModelProperty(value = "售价4")
+	private BigDecimal priceFour;
+	/**
+	 * 售价5
+	 */
+	@ApiModelProperty(value = "售价5")
+	private BigDecimal priceFive;
+	/**
+	 * 售价6
+	 */
+	@ApiModelProperty(value = "售价6")
+	private BigDecimal priceSix;
+	/**
+	 * 售价7
+	 */
+	@ApiModelProperty(value = "售价7")
+	private BigDecimal priceSeven;
+	/**
+	 * 售价8
+	 */
+	@ApiModelProperty(value = "售价8")
+	private BigDecimal priceEight;
+
+	/**
+	 * 次日达售价1
+	 */
+	@ApiModelProperty(value = "次日达售价1")
+	private BigDecimal nextDayDeliveryPriceOne;
+
+	/**
+	 * 次日达售价2
+	 */
+	@ApiModelProperty(value = "次日达售价2")
+	private BigDecimal nextDayDeliveryPriceTwo;
+
+	/**
+	 * 次日达售价3
+	 */
+	@ApiModelProperty(value = "次日达售价3")
+	private BigDecimal nextDayDeliveryPriceThree;
+
+	/**
+	 * 次日达售价4
+	 */
+	@ApiModelProperty(value = "次日达售价4")
+	private BigDecimal nextDayDeliveryPriceFour;
+
+	/**
+	 * 次日达售价5
+	 */
+	@ApiModelProperty(value = "次日达售价5")
+	private BigDecimal nextDayDeliveryPriceFive;
+
+	/**
+	 * 次日达售价6
+	 */
+	@ApiModelProperty(value = "次日达售价6")
+	private BigDecimal nextDayDeliveryPriceSix;
+
+	/**
+	 * 次日达售价7
+	 */
+	@ApiModelProperty(value = "次日达售价7")
+	private BigDecimal nextDayDeliveryPriceSeven;
+
+	/**
+	 * 次日达售价8
+	 */
+	@ApiModelProperty(value = "次日达售价8")
+	private BigDecimal nextDayDeliveryPriceEight;
+
+	/**
+	 * 来源id
+	 */
+	@ApiModelProperty(value = "来源id")
+	private Long sourceId;
+
+	/**
+	 * 来源公司id
+	 */
+	@ApiModelProperty(value = "来源公司id")
+	private Long sourceCompanyId;
+
+	/**
+	 * 共享公司
+	 */
+	@ApiModelProperty(value = "共享公司")
+	private String sharedCompany;
+
+	/**
+	 * 附件明细集合
+	 */
+	@TableField(exist = false)
+	private List<PjProductLaunchFiles> filesList;
+
 
 }

+ 131 - 0
blade-service-api/blade-sales-part-api/src/main/java/org/springblade/salesPart/entity/PjProductLaunchFiles.java

@@ -0,0 +1,131 @@
+/*
+ *      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.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import java.time.LocalDateTime;
+import java.io.Serializable;
+import java.util.Date;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * 配件批发上架管理附件实体类
+ *
+ * @author BladeX
+ * @since 2023-05-08
+ */
+@Data
+@TableName("pjpf_product_launch_files")
+@ApiModel(value = "ProductLaunchFiles对象", description = "ProductLaunchFiles对象")
+public class PjProductLaunchFiles implements Serializable {
+
+	private static final long serialVersionUID = 1L;
+
+	/**
+	* 主键
+	*/
+		@ApiModelProperty(value = "主键")
+		private Long id;
+
+	/**
+	 * 租户id
+	 */
+	@ApiModelProperty(value = "租户id")
+	private String tenantId;
+
+	/**
+	* 主表id
+	*/
+		@ApiModelProperty(value = "主表id")
+		private Long pid;
+	/**
+	* 排序
+	*/
+		@ApiModelProperty(value = "排序")
+		private Integer sort;
+	/**
+	* 文件名
+	*/
+		@ApiModelProperty(value = "文件名")
+		private String fileName;
+	/**
+	* 文件地址
+	*/
+		@ApiModelProperty(value = "文件地址")
+		private String url;
+	/**
+	* 备注
+	*/
+		@ApiModelProperty(value = "备注")
+		private String remarks;
+	/**
+	* 版本
+	*/
+		@ApiModelProperty(value = "版本")
+		private String version;
+	/**
+	* 创建人
+	*/
+		@ApiModelProperty(value = "创建人")
+		private Long createUser;
+	/**
+	* 创建部门
+	*/
+		@ApiModelProperty(value = "创建部门")
+		private Long createDept;
+	/**
+	* 创建时间
+	*/
+		@ApiModelProperty(value = "创建时间")
+		private Date createTime;
+	/**
+	* 修改人
+	*/
+		@ApiModelProperty(value = "修改人")
+		private Long updateUser;
+	/**
+	* 修改时间
+	*/
+		@ApiModelProperty(value = "修改时间")
+		private Date updateTime;
+	/**
+	* 状态(0 正常 1停用)
+	*/
+		@ApiModelProperty(value = "状态(0 正常 1停用)")
+		private Integer status;
+	/**
+	* 是否已删除(0 否 1是)
+	*/
+		@ApiModelProperty(value = "是否已删除(0 否 1是)")
+		private Integer isDeleted;
+	/**
+	* 分类(1 主表  2 明细)
+	*/
+		@ApiModelProperty(value = "分类(1 主表  2 明细)")
+		private String type;
+	/**
+	* 是否主图(0 否,1 是)
+	*/
+		@ApiModelProperty(value = "是否主图(0 否,1 是)")
+		private Integer mainImage;
+
+
+}

+ 0 - 6
blade-service-api/blade-sales-part-api/src/main/java/org/springblade/salesPart/excel/GoodsDescExportExcel.java

@@ -51,12 +51,6 @@ public class GoodsDescExportExcel implements Serializable {
 	private BigDecimal purchasePrice;
 
 	/**
-	 * 销售价
-	 */
-	@ExcelProperty(value = "销售价")
-	private BigDecimal salesPrice;
-
-	/**
 	 * 库存预警
 	 */
 	@ExcelProperty(value = "库存预警")

+ 0 - 99
blade-service-api/blade-sales-part-api/src/main/java/org/springblade/salesPart/excel/GoodsExcel.java

@@ -94,105 +94,6 @@ public class GoodsExcel implements Serializable {
 	private String goodsDescription;
 
 	/**
-	 * 采购价
-	 */
-	@ExcelProperty(value = "采购价")
-	private BigDecimal purchasePrice;
-	/**
-	 * 销售价
-	 */
-	@ExcelProperty(value = "销售价")
-	private BigDecimal salesPrice;
-	/**
-	 * 售价1
-	 */
-	@ExcelProperty(value = "售价1")
-	private BigDecimal priceOne;
-	/**
-	 * 售价2
-	 */
-	@ExcelProperty(value = "售价2")
-	private BigDecimal priceTwo;
-	/**
-	 * 售价3
-	 */
-	@ExcelProperty(value = "售价3")
-	private BigDecimal priceThree;
-	/**
-	 * 售价4
-	 */
-	@ExcelProperty(value = "售价4")
-	private BigDecimal priceFour;
-	/**
-	 * 售价5
-	 */
-	@ExcelProperty(value = "售价5")
-	private BigDecimal priceFive;
-	/**
-	 * 售价6
-	 */
-	@ExcelProperty(value = "售价6")
-	private BigDecimal priceSix;
-	/**
-	 * 售价7
-	 */
-	@ExcelProperty(value = "售价7")
-	private BigDecimal priceSeven;
-	/**
-	 * 售价8
-	 */
-	@ExcelProperty(value = "售价8")
-	private BigDecimal priceEight;
-
-	/**
-	 * 次日达售价1
-	 */
-	@ExcelProperty(value = "次日达售价1")
-	private BigDecimal nextDayDeliveryPriceOne;
-
-	/**
-	 * 次日达售价2
-	 */
-	@ExcelProperty(value = "次日达售价2")
-	private BigDecimal nextDayDeliveryPriceTwo;
-
-	/**
-	 * 次日达售价3
-	 */
-	@ExcelProperty(value = "次日达售价3")
-	private BigDecimal nextDayDeliveryPriceThree;
-
-	/**
-	 * 次日达售价4
-	 */
-	@ExcelProperty(value = "次日达售价4")
-	private BigDecimal nextDayDeliveryPriceFour;
-
-	/**
-	 * 次日达售价5
-	 */
-	@ExcelProperty(value = "次日达售价5")
-	private BigDecimal nextDayDeliveryPriceFive;
-
-	/**
-	 * 次日达售价6
-	 */
-	@ExcelProperty(value = "次日达售价6")
-	private BigDecimal nextDayDeliveryPriceSix;
-
-	/**
-	 * 次日达售价7
-	 */
-	@ExcelProperty(value = "次日达售价7")
-	private BigDecimal nextDayDeliveryPriceSeven;
-
-	/**
-	 * 次日达售价8
-	 */
-	@ExcelProperty(value = "次日达售价8")
-	private BigDecimal nextDayDeliveryPriceEight;
-
-	/**
 	 * 是否管理批次号  0否1是
 	 */
 	@ExcelProperty(value = "是否管理批次号 0否1是")

+ 86 - 3
blade-service-api/blade-sales-part-api/src/main/java/org/springblade/salesPart/excel/ProductLaunchImportExcel.java

@@ -46,9 +46,92 @@ public class ProductLaunchImportExcel implements Serializable {
 	private BigDecimal inventory;
 
 	/**
-	 * 商城价格
+	 * 售价1
 	 */
-	@ExcelProperty(value = "商城价格")
-	private BigDecimal salesPrice;
+	@ExcelProperty(value = "售价1")
+	private BigDecimal priceOne;
+	/**
+	 * 售价2
+	 */
+	@ExcelProperty(value = "售价2")
+	private BigDecimal priceTwo;
+	/**
+	 * 售价3
+	 */
+	@ExcelProperty(value = "售价3")
+	private BigDecimal priceThree;
+	/**
+	 * 售价4
+	 */
+	@ExcelProperty(value = "售价4")
+	private BigDecimal priceFour;
+	/**
+	 * 售价5
+	 */
+	@ExcelProperty(value = "售价5")
+	private BigDecimal priceFive;
+	/**
+	 * 售价6
+	 */
+	@ExcelProperty(value = "售价6")
+	private BigDecimal priceSix;
+	/**
+	 * 售价7
+	 */
+	@ExcelProperty(value = "售价7")
+	private BigDecimal priceSeven;
+	/**
+	 * 售价8
+	 */
+	@ExcelProperty(value = "售价8")
+	private BigDecimal priceEight;
+
+	/**
+	 * 次日达售价1
+	 */
+	@ExcelProperty(value = "次日达售价1")
+	private BigDecimal nextDayDeliveryPriceOne;
+
+	/**
+	 * 次日达售价2
+	 */
+	@ExcelProperty(value = "次日达售价2")
+	private BigDecimal nextDayDeliveryPriceTwo;
+
+	/**
+	 * 次日达售价3
+	 */
+	@ExcelProperty(value = "次日达售价3")
+	private BigDecimal nextDayDeliveryPriceThree;
+
+	/**
+	 * 次日达售价4
+	 */
+	@ExcelProperty(value = "次日达售价4")
+	private BigDecimal nextDayDeliveryPriceFour;
+
+	/**
+	 * 次日达售价5
+	 */
+	@ExcelProperty(value = "次日达售价5")
+	private BigDecimal nextDayDeliveryPriceFive;
+
+	/**
+	 * 次日达售价6
+	 */
+	@ExcelProperty(value = "次日达售价6")
+	private BigDecimal nextDayDeliveryPriceSix;
+
+	/**
+	 * 次日达售价7
+	 */
+	@ExcelProperty(value = "次日达售价7")
+	private BigDecimal nextDayDeliveryPriceSeven;
+
+	/**
+	 * 次日达售价8
+	 */
+	@ExcelProperty(value = "次日达售价8")
+	private BigDecimal nextDayDeliveryPriceEight;
 
 }

+ 36 - 0
blade-service-api/blade-sales-part-api/src/main/java/org/springblade/salesPart/vo/ProductLaunchFilesVO.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.vo;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import io.swagger.annotations.ApiModel;
+import org.springblade.salesPart.entity.PjProductLaunchFiles;
+
+/**
+ * 配件批发上架管理附件视图实体类
+ *
+ * @author BladeX
+ * @since 2023-05-08
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ApiModel(value = "ProductLaunchFilesVO对象", description = "ProductLaunchFilesVO对象")
+public class ProductLaunchFilesVO extends PjProductLaunchFiles {
+	private static final long serialVersionUID = 1L;
+
+}

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

@@ -26,16 +26,6 @@
         <result column="corp_id" property="corpId"/>
         <result column="corp_name" property="corpName"/>
         <result column="cname_int" property="cnameInt"/>
-        <result column="purchase_price" property="purchasePrice"/>
-        <result column="sales_price" property="salesPrice"/>
-        <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="price_five" property="priceFive"/>
-        <result column="price_six" property="priceSix"/>
-        <result column="price_seven" property="priceSeven"/>
-        <result column="price_eight" property="priceEight"/>
         <result column="enable_or_not" property="enableOrNot"/>
         <result column="goods_description" property="goodsDescription"/>
         <result column="inventory_alert" property="inventoryAlert"/>

+ 0 - 10
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/goods/service/impl/GoodsDescServiceImpl.java

@@ -238,16 +238,6 @@ public class GoodsDescServiceImpl extends ServiceImpl<GoodsDescMapper, PjGoodsDe
 				}
 
 				goodsDesc.setGoodsDescription(e.getGoodsDescription());
-				goodsDesc.setPurchasePrice(e.getPurchasePrice());
-				goodsDesc.setSalesPrice(e.getSalesPrice());
-				goodsDesc.setPriceOne(e.getPriceOne());
-				goodsDesc.setPriceTwo(e.getPriceTwo());
-				goodsDesc.setPriceThree(e.getPriceThree());
-				goodsDesc.setPriceFour(e.getPriceFour());
-				goodsDesc.setPriceFive(e.getPriceFive());
-				goodsDesc.setPriceSix(e.getPriceSix());
-				goodsDesc.setPriceSeven(e.getPriceSeven());
-				goodsDesc.setPriceEight(e.getPriceEight());
 				goodsDesc.setWhether(e.getWhether());
 				goodsDesc.setInventoryAlert(e.getInventoryAlert());
 				goodsDesc.setExplosionProof(e.getExplosionProof());

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

@@ -86,6 +86,7 @@ public class ProductLaunchController extends BladeController {
 		LambdaQueryWrapper<PjProductLaunch> lambdaQueryWrapper = new LambdaQueryWrapper<>();
 		lambdaQueryWrapper.eq(PjProductLaunch::getTenantId, AuthUtil.getTenantId())
 			.eq(PjProductLaunch::getIsDeleted, 0)
+			.eq(PjProductLaunch::getBillType, productLaunch.getBillType())
 			.like(ObjectUtils.isNotEmpty(productLaunch.getCname()), PjProductLaunch::getCname, productLaunch.getCname())//名称
 			.like(ObjectUtils.isNotEmpty(productLaunch.getSpecificationAndModel()), PjProductLaunch::getSpecificationAndModel, productLaunch.getSpecificationAndModel())//规格型号
 			.eq(ObjectUtils.isNotEmpty(productLaunch.getSalesCompanyId()), PjProductLaunch::getSalesCompanyId, productLaunch.getSalesCompanyId())//公司
@@ -97,10 +98,13 @@ public class ProductLaunchController extends BladeController {
 	/**
 	 * 自定义分页 配件批发产品上架
 	 */
-	@GetMapping("/page")
+	@GetMapping("/appPage")
 	@ApiOperationSupport(order = 3)
 	@ApiOperation(value = "分页", notes = "传入productLaunch")
 	public R<IPage<ProductLaunchVO>> page(ProductLaunchVO productLaunch, Query query) {
+		if (ObjectUtils.isNotNull(productLaunch.getTenantId())){
+			productLaunch.setTenantId(AuthUtil.getTenantId());
+		}
 		IPage<ProductLaunchVO> pages = productLaunchService.selectProductLaunchPage(Condition.getPage(query), productLaunch);
 		return R.data(pages);
 	}
@@ -206,4 +210,22 @@ public class ProductLaunchController extends BladeController {
 		return R.success("操作成功");
 	}
 
+	/**
+	 * 分页 小程序配件批发产品上架
+	 */
+	@GetMapping("/appList")
+	@ApiOperationSupport(order = 2)
+	@ApiOperation(value = "小程序配件批发产品上架", notes = "传入productLaunch")
+	public R<IPage<PjProductLaunch>> appList(PjProductLaunch productLaunch, Query query) {
+		LambdaQueryWrapper<PjProductLaunch> lambdaQueryWrapper = new LambdaQueryWrapper<>();
+		lambdaQueryWrapper.eq(PjProductLaunch::getTenantId, AuthUtil.getTenantId())
+			.eq(PjProductLaunch::getIsDeleted, 0)
+			.like(ObjectUtils.isNotEmpty(productLaunch.getCname()), PjProductLaunch::getCname, productLaunch.getCname())//名称
+			.like(ObjectUtils.isNotEmpty(productLaunch.getSpecificationAndModel()), PjProductLaunch::getSpecificationAndModel, productLaunch.getSpecificationAndModel())//规格型号
+			.eq(ObjectUtils.isNotEmpty(productLaunch.getSalesCompanyId()), PjProductLaunch::getSalesCompanyId, productLaunch.getSalesCompanyId())//公司
+			.like(ObjectUtils.isNotEmpty(productLaunch.getSalesCompanyName()), PjProductLaunch::getSalesCompanyName, productLaunch.getSalesCompanyName());
+		IPage<PjProductLaunch> pages = productLaunchService.page(Condition.getPage(query), lambdaQueryWrapper);
+		return R.data(pages);
+	}
+
 }

+ 130 - 0
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/productLaunch/controller/ProductLaunchFilesController.java

@@ -0,0 +1,130 @@
+/*
+ *      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 io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import lombok.AllArgsConstructor;
+import javax.validation.Valid;
+
+import org.springblade.core.mp.support.Condition;
+import org.springblade.core.mp.support.Query;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.Func;
+import org.springblade.salesPart.entity.PjProductLaunchFiles;
+import org.springblade.salesPart.vo.ProductLaunchFilesVO;
+import org.springframework.web.bind.annotation.*;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.salesPart.productLaunch.service.IProductLaunchFilesService;
+import org.springblade.core.boot.ctrl.BladeController;
+
+/**
+ *  配件批发上架管理附件控制器
+ *
+ * @author BladeX
+ * @since 2023-05-08
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping("/productLaunchFiles")
+@Api(value = "配件批发上架管理附件控制器", tags = "接口")
+public class ProductLaunchFilesController extends BladeController {
+
+	private final IProductLaunchFilesService productLaunchFilesService;
+
+	/**
+	 * 详情
+	 */
+	@GetMapping("/detail")
+	@ApiOperationSupport(order = 1)
+	@ApiOperation(value = "详情", notes = "传入productLaunchFiles")
+	public R<PjProductLaunchFiles> detail(PjProductLaunchFiles productLaunchFiles) {
+		PjProductLaunchFiles detail = productLaunchFilesService.getOne(Condition.getQueryWrapper(productLaunchFiles));
+		return R.data(detail);
+	}
+
+	/**
+	 * 分页
+	 */
+	@GetMapping("/list")
+	@ApiOperationSupport(order = 2)
+	@ApiOperation(value = "分页", notes = "传入productLaunchFiles")
+	public R<IPage<PjProductLaunchFiles>> list(PjProductLaunchFiles productLaunchFiles, Query query) {
+		IPage<PjProductLaunchFiles> pages = productLaunchFilesService.page(Condition.getPage(query), Condition.getQueryWrapper(productLaunchFiles));
+		return R.data(pages);
+	}
+
+	/**
+	 * 自定义分页
+	 */
+	@GetMapping("/page")
+	@ApiOperationSupport(order = 3)
+	@ApiOperation(value = "分页", notes = "传入productLaunchFiles")
+	public R<IPage<ProductLaunchFilesVO>> page(ProductLaunchFilesVO productLaunchFiles, Query query) {
+		IPage<ProductLaunchFilesVO> pages = productLaunchFilesService.selectProductLaunchFilesPage(Condition.getPage(query), productLaunchFiles);
+		return R.data(pages);
+	}
+
+	/**
+	 * 新增
+	 */
+	@PostMapping("/save")
+	@ApiOperationSupport(order = 4)
+	@ApiOperation(value = "新增", notes = "传入productLaunchFiles")
+	public R save(@Valid @RequestBody PjProductLaunchFiles productLaunchFiles) {
+		return R.status(productLaunchFilesService.save(productLaunchFiles));
+	}
+
+	/**
+	 * 修改
+	 */
+	@PostMapping("/update")
+	@ApiOperationSupport(order = 5)
+	@ApiOperation(value = "修改", notes = "传入productLaunchFiles")
+	public R update(@Valid @RequestBody PjProductLaunchFiles productLaunchFiles) {
+		if (productLaunchFiles.getId() == null) {
+			return R.data(500, "请选择要删除的数据", "error");
+		}
+		productLaunchFiles.setIsDeleted(1);
+		return R.status(productLaunchFilesService.updateById(productLaunchFiles));
+	}
+
+	/**
+	 * 新增或修改
+	 */
+	@PostMapping("/submit")
+	@ApiOperationSupport(order = 6)
+	@ApiOperation(value = "新增或修改", notes = "传入productLaunchFiles")
+	public R submit(@Valid @RequestBody PjProductLaunchFiles productLaunchFiles) {
+		return R.status(productLaunchFilesService.saveOrUpdate(productLaunchFiles));
+	}
+
+
+	/**
+	 * 删除
+	 */
+	@PostMapping("/remove")
+	@ApiOperationSupport(order = 8)
+	@ApiOperation(value = "删除", notes = "传入ids")
+	public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
+		return R.status(productLaunchFilesService.removeByIds(Func.toLongList(ids)));
+	}
+
+
+}

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

@@ -0,0 +1,43 @@
+/*
+ *      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.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.salesPart.entity.PjProductLaunchFiles;
+import org.springblade.salesPart.vo.ProductLaunchFilesVO;
+
+import java.util.List;
+
+/**
+ *  配件批发上架管理附件Mapper 接口
+ *
+ * @author BladeX
+ * @since 2023-05-08
+ */
+public interface ProductLaunchFilesMapper extends BaseMapper<PjProductLaunchFiles> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param productLaunchFiles
+	 * @return
+	 */
+	List<ProductLaunchFilesVO> selectProductLaunchFilesPage(IPage page, ProductLaunchFilesVO productLaunchFiles);
+
+}

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

@@ -0,0 +1,30 @@
+<?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.productLaunch.mapper.ProductLaunchFilesMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="productLaunchFilesResultMap" type="org.springblade.salesPart.entity.PjProductLaunchFiles">
+        <id column="id" property="id"/>
+        <result column="pid" property="pid"/>
+        <result column="sort" property="sort"/>
+        <result column="file_name" property="fileName"/>
+        <result column="url" property="url"/>
+        <result column="remarks" property="remarks"/>
+        <result column="version" property="version"/>
+        <result column="create_user" property="createUser"/>
+        <result column="create_dept" property="createDept"/>
+        <result column="create_time" property="createTime"/>
+        <result column="update_user" property="updateUser"/>
+        <result column="update_time" property="updateTime"/>
+        <result column="status" property="status"/>
+        <result column="is_deleted" property="isDeleted"/>
+        <result column="type" property="type"/>
+        <result column="main_image" property="mainImage"/>
+    </resultMap>
+
+
+    <select id="selectProductLaunchFilesPage" resultMap="productLaunchFilesResultMap">
+        select * from pjpf_product_launch_files where is_deleted = 0
+    </select>
+
+</mapper>

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

@@ -17,14 +17,22 @@
         <result column="sales_company_name" property="salesCompanyName"/>
         <result column="cname" property="cname"/>
         <result column="specification_and_model" property="specificationAndModel"/>
-        <result column="sales_price" property="salesPrice"/>
         <result column="inventory" property="inventory"/>
         <result column="up_and_down_shelves" property="upAndDownShelves"/>
+        <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="price_five" property="priceFive"/>
+        <result column="price_six" property="priceSix"/>
+        <result column="price_seven" property="priceSeven"/>
+        <result column="price_eight" property="priceEight"/>
     </resultMap>
 
 
     <select id="selectProductLaunchPage" resultMap="productLaunchResultMap">
-        select * from pjpf_product_launch where is_deleted = 0
+        select * from pjpf_product_launch
+        where is_deleted = 0
     </select>
 
 </mapper>

+ 41 - 0
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/productLaunch/service/IProductLaunchFilesService.java

@@ -0,0 +1,41 @@
+/*
+ *      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.extension.service.IService;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.salesPart.entity.PjProductLaunchFiles;
+import org.springblade.salesPart.vo.ProductLaunchFilesVO;
+
+/**
+ *  配件批发上架管理附件服务类
+ *
+ * @author BladeX
+ * @since 2023-05-08
+ */
+public interface IProductLaunchFilesService extends IService<PjProductLaunchFiles> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param productLaunchFiles
+	 * @return
+	 */
+	IPage<ProductLaunchFilesVO> selectProductLaunchFilesPage(IPage<ProductLaunchFilesVO> page, ProductLaunchFilesVO productLaunchFiles);
+
+}

+ 41 - 0
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/productLaunch/service/impl/ProductLaunchFilesServiceImpl.java

@@ -0,0 +1,41 @@
+/*
+ *      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 org.springblade.salesPart.entity.PjProductLaunchFiles;
+import org.springblade.salesPart.productLaunch.mapper.ProductLaunchFilesMapper;
+import org.springblade.salesPart.productLaunch.service.IProductLaunchFilesService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springblade.salesPart.vo.ProductLaunchFilesVO;
+import org.springframework.stereotype.Service;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+/**
+ *  配件批发上架管理附件服务实现类
+ *
+ * @author BladeX
+ * @since 2023-05-08
+ */
+@Service
+public class ProductLaunchFilesServiceImpl extends ServiceImpl<ProductLaunchFilesMapper, PjProductLaunchFiles> implements IProductLaunchFilesService {
+
+	@Override
+	public IPage<ProductLaunchFilesVO> selectProductLaunchFilesPage(IPage<ProductLaunchFilesVO> page, ProductLaunchFilesVO productLaunchFiles) {
+		return page.setRecords(baseMapper.selectProductLaunchFilesPage(page, productLaunchFiles));
+	}
+
+}

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

@@ -16,6 +16,7 @@
  */
 package org.springblade.salesPart.productLaunch.service.impl;
 
+import com.alibaba.csp.sentinel.util.StringUtil;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
@@ -23,21 +24,22 @@ import lombok.AllArgsConstructor;
 import org.springblade.core.secure.utils.AuthUtil;
 import org.springblade.core.tool.api.R;
 import org.springblade.core.tool.utils.ObjectUtil;
-import org.springblade.salesPart.entity.PjBrandDesc;
-import org.springblade.salesPart.entity.PjBrandFiles;
-import org.springblade.salesPart.entity.PjGoodsDesc;
-import org.springblade.salesPart.entity.PjProductLaunch;
+import org.springblade.salesPart.entity.*;
 import org.springblade.salesPart.excel.ProductLaunchImportExcel;
 import org.springblade.salesPart.goods.mapper.GoodsDescMapper;
+import org.springblade.salesPart.productLaunch.service.IProductLaunchFilesService;
 import org.springblade.salesPart.vo.ProductLaunchVO;
 import org.springblade.salesPart.productLaunch.mapper.ProductLaunchMapper;
 import org.springblade.salesPart.productLaunch.service.IProductLaunchService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springblade.system.entity.Dept;
+import org.springblade.system.feign.ISysClient;
 import org.springframework.beans.BeanUtils;
 import org.springframework.stereotype.Service;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import org.springframework.transaction.annotation.Transactional;
 
+import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
 
@@ -52,10 +54,14 @@ import java.util.List;
 public class ProductLaunchServiceImpl extends ServiceImpl<ProductLaunchMapper, PjProductLaunch> implements IProductLaunchService {
 
 	private final GoodsDescMapper goodsDescMapper;
+	private final ISysClient iSysClient;
+	private final IProductLaunchFilesService productLaunchFilesService;
 
 	@Override
 	public PjProductLaunch getMessageById(PjProductLaunch productLaunch) {
 		PjProductLaunch detail = baseMapper.selectById(productLaunch.getId());
+
+		detail.setFilesList(productLaunchFilesService.list(new QueryWrapper<PjProductLaunchFiles>().eq("pid", productLaunch.getId()).eq("is_deleted", 0)));
 		return detail;
 	}
 
@@ -72,6 +78,7 @@ public class ProductLaunchServiceImpl extends ServiceImpl<ProductLaunchMapper, P
 	 */
 	@Override
 	public PjProductLaunch saveMessage(PjProductLaunch productLaunch) {
+
 		if (productLaunch.getId() != null) {
 			productLaunch.setUpdateUser(AuthUtil.getUserId());
 			productLaunch.setUpdateTime(new Date());
@@ -84,6 +91,78 @@ public class ProductLaunchServiceImpl extends ServiceImpl<ProductLaunchMapper, P
 			productLaunch.setTenantId(AuthUtil.getTenantId());
 			baseMapper.insert(productLaunch);
 		}
+
+		if (CollectionUtils.isNotEmpty(productLaunch.getFilesList())) {
+			productLaunch.getFilesList().stream().forEach(files -> {
+				files.setPid(productLaunch.getId());
+				files.setTenantId(AuthUtil.getTenantId());
+				if (files.getId() == null) {
+					files.setCreateTime(new Date());
+					files.setCreateUser(AuthUtil.getUserId());
+					productLaunchFilesService.save(files);
+				} else {
+					files.setUpdateTime(new Date());
+					files.setUpdateUser(AuthUtil.getUserId());
+					productLaunchFilesService.updateById(files);
+				}
+			});
+		}
+
+		//如果有共享公司 生成共享数据
+		if (ObjectUtil.isNotEmpty(productLaunch.getSharedCompany())){
+			String[] companyIds = productLaunch.getSharedCompany().split(",");
+			for (String id : companyIds) {
+				PjProductLaunch launch = new PjProductLaunch();
+				BeanUtils.copyProperties(productLaunch, launch);
+
+				LambdaQueryWrapper<PjProductLaunch> lambdaQueryWrapper = new LambdaQueryWrapper<>();
+				lambdaQueryWrapper.eq(PjProductLaunch::getTenantId, AuthUtil.getTenantId())
+					.eq(PjProductLaunch::getBillType, 1)
+					.eq(PjProductLaunch::getGoodsId, productLaunch.getGoodsId())
+					.eq(PjProductLaunch::getSalesCompanyId, id)
+					.eq(PjProductLaunch::getSourceCompanyId, productLaunch.getSalesCompanyId());
+				PjProductLaunch selOne = baseMapper.selectOne(lambdaQueryWrapper);
+
+				if (ObjectUtil.isEmpty(selOne)){
+
+					launch.setId(null);
+					launch.setBillType(1);
+					launch.setCreateUser(AuthUtil.getUserId());
+					launch.setCreateTime(new Date());
+					launch.setCreateDept(Long.valueOf(AuthUtil.getDeptId()));
+					launch.setSourceId(productLaunch.getId());
+					launch.setSourceCompanyId(productLaunch.getSalesCompanyId());
+					R<Dept> dept = iSysClient.getDept(Long.valueOf(id));
+					if (ObjectUtil.isNotEmpty(dept)) {
+						launch.setSalesCompanyId(Long.valueOf(id));
+						launch.setSalesCompanyName(dept.getData().getDeptName());
+					} else {
+						throw new SecurityException("未找到共享公司");
+					}
+					baseMapper.insert(launch);
+
+				}else {
+					launch.setUpdateTime(new Date());
+					launch.setUpdateUser(AuthUtil.getUserId());
+					baseMapper.updateById(launch);
+				}
+			}
+		}else {
+			LambdaQueryWrapper<PjProductLaunch> lambdaQueryWrapper = new LambdaQueryWrapper<>();
+			lambdaQueryWrapper.eq(PjProductLaunch::getTenantId, AuthUtil.getTenantId())
+				.eq(PjProductLaunch::getIsDeleted, 0)
+				.eq(PjProductLaunch::getBillType, 1)
+				.eq(PjProductLaunch::getGoodsId, productLaunch.getGoodsId())
+				.eq(PjProductLaunch::getSourceCompanyId, productLaunch.getSalesCompanyId());
+			List<PjProductLaunch> selectList = baseMapper.selectList(lambdaQueryWrapper);
+
+			if (ObjectUtil.isNotEmpty(selectList)){
+				selectList.forEach(e -> {
+					e.setIsDeleted(1);
+					baseMapper.updateById(e);
+				});
+			}
+		}
 		return productLaunch;
 	}
 
@@ -113,20 +192,45 @@ public class ProductLaunchServiceImpl extends ServiceImpl<ProductLaunchMapper, P
 			if (ObjectUtil.isNotEmpty(pjGoodsDesc)){
 				//商品id
 				productLaunch.setGoodsId(pjGoodsDesc.getId());
-				//所属公司
-				if (ObjectUtil.isNotEmpty(pjGoodsDesc.getSalesCompanyId())){
-					productLaunch.setSalesCompanyId(pjGoodsDesc.getSalesCompanyId());
-					productLaunch.setSalesCompanyName(pjGoodsDesc.getSalesCompanyName());
-				}
 			}else {
 				throw new RuntimeException("商品名称错误或商品不存在");
 			}
 
+			//获得所属公司
+			if (StringUtil.isNotBlank(e.getSalesCompanyName())) {
+				R<Dept> dept = iSysClient.getDeptIByName(AuthUtil.getTenantId(), e.getSalesCompanyName());
+				if (ObjectUtil.isNotEmpty(dept)) {
+					productLaunch.setSalesCompanyId(dept.getData().getId());
+					productLaunch.setSalesCompanyName(dept.getData().getDeptName());
+				} else {
+					throw new SecurityException("请输入正确的所属公司");
+				}
+			}
+
+			productLaunch.setBillType(0);
+			productLaunch.setPriceOne(e.getPriceOne());
+			productLaunch.setPriceTwo(e.getPriceTwo());
+			productLaunch.setPriceThree(e.getPriceThree());
+			productLaunch.setPriceFour(e.getPriceFour());
+			productLaunch.setPriceFive(e.getPriceFive());
+			productLaunch.setPriceSix(e.getPriceSix());
+			productLaunch.setPriceSeven(e.getPriceSeven());
+			productLaunch.setPriceEight(e.getPriceEight());
+			productLaunch.setNextDayDeliveryPriceOne(e.getNextDayDeliveryPriceOne());
+			productLaunch.setNextDayDeliveryPriceTwo(e.getNextDayDeliveryPriceTwo());
+			productLaunch.setNextDayDeliveryPriceThree(e.getNextDayDeliveryPriceThree());
+			productLaunch.setNextDayDeliveryPriceFour(e.getNextDayDeliveryPriceFour());
+			productLaunch.setNextDayDeliveryPriceFive(e.getNextDayDeliveryPriceFive());
+			productLaunch.setNextDayDeliveryPriceSix(e.getNextDayDeliveryPriceSix());
+			productLaunch.setNextDayDeliveryPriceSeven(e.getNextDayDeliveryPriceSeven());
+			productLaunch.setNextDayDeliveryPriceEight(e.getNextDayDeliveryPriceEight());
+
 			// 如果名称相等 就认为重复
 			LambdaQueryWrapper<PjProductLaunch> queryWrapper = new LambdaQueryWrapper<>();
-			queryWrapper.eq(PjProductLaunch::getTenantId, AuthUtil.getTenantId());
-			queryWrapper.eq(PjProductLaunch::getCname, productLaunch.getCname());
-			queryWrapper.eq(PjProductLaunch::getIsDeleted, 0);
+			queryWrapper.eq(PjProductLaunch::getTenantId, AuthUtil.getTenantId())
+				.eq(PjProductLaunch::getCname, productLaunch.getCname())
+				.eq(PjProductLaunch::getIsDeleted, 0)
+				.eq(PjProductLaunch::getBillType, 0);
 			PjProductLaunch one = baseMapper.selectOne(queryWrapper);
 
 			if (one == null){