Browse Source

20230506 10:19

wangzhuo 2 years ago
parent
commit
40dcb5ce43
33 changed files with 1498 additions and 41 deletions
  1. 34 0
      blade-service-api/blade-sales-part-api/src/main/java/org/springblade/salesPart/dto/PaymentDTO.java
  2. 36 0
      blade-service-api/blade-sales-part-api/src/main/java/org/springblade/salesPart/dto/ShoppingCartDTO.java
  3. 14 2
      blade-service-api/blade-sales-part-api/src/main/java/org/springblade/salesPart/entity/PjOrder.java
  4. 7 1
      blade-service-api/blade-sales-part-api/src/main/java/org/springblade/salesPart/entity/PjOrderItems.java
  5. 132 0
      blade-service-api/blade-sales-part-api/src/main/java/org/springblade/salesPart/entity/PjPayment.java
  6. 27 0
      blade-service-api/blade-sales-part-api/src/main/java/org/springblade/salesPart/entity/PjProductLaunch.java
  7. 243 0
      blade-service-api/blade-sales-part-api/src/main/java/org/springblade/salesPart/entity/PjShoppingCart.java
  8. 4 7
      blade-service-api/blade-sales-part-api/src/main/java/org/springblade/salesPart/excel/CorpsDescImportExcel.java
  9. 36 0
      blade-service-api/blade-sales-part-api/src/main/java/org/springblade/salesPart/vo/PaymentVO.java
  10. 37 0
      blade-service-api/blade-sales-part-api/src/main/java/org/springblade/salesPart/vo/ShoppingCartVO.java
  11. 0 11
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/corps/service/impl/CorpsDescServiceImpl.java
  12. 75 1
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/goods/controller/GoodsDescController.java
  13. 1 3
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/goods/controller/GoodsTypeController.java
  14. 7 7
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/goods/mapper/GoodsTypeMapper.xml
  15. 36 1
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/goods/service/impl/GoodsDescServiceImpl.java
  16. 2 2
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/goods/service/impl/GoodsTypeServiceImpl.java
  17. 2 1
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/order/mapper/OrderItemsMapper.xml
  18. 1 0
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/order/mapper/OrderMapper.xml
  19. 32 3
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/order/service/impl/OrderServiceImpl.java
  20. 126 0
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/payment/controller/PaymentController.java
  21. 42 0
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/payment/mapper/PaymentMapper.java
  22. 30 0
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/payment/mapper/PaymentMapper.xml
  23. 41 0
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/payment/service/IPaymentService.java
  24. 41 0
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/payment/service/impl/PaymentServiceImpl.java
  25. 35 2
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/productLaunch/controller/ProductLaunchController.java
  26. 1 0
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/productLaunch/mapper/ProductLaunchMapper.xml
  27. 22 0
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/productLaunch/service/IProductLaunchService.java
  28. 78 0
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/productLaunch/service/impl/ProductLaunchServiceImpl.java
  29. 153 0
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/shoppingCart/controller/ShoppingCartController.java
  30. 44 0
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/shoppingCart/mapper/ShoppingCartMapper.java
  31. 46 0
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/shoppingCart/mapper/ShoppingCartMapper.xml
  32. 52 0
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/shoppingCart/service/IShoppingCartService.java
  33. 61 0
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/shoppingCart/service/impl/ShoppingCartServiceImpl.java

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

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

+ 14 - 2
blade-service-api/blade-sales-part-api/src/main/java/org/springblade/salesPart/entity/PjOrder.java

@@ -71,7 +71,7 @@ public class PjOrder implements Serializable {
 	/**
 	 * 创建人名称
 	 */
-	@ApiModelProperty(value = "创建人名称")
+	@TableField(exist = false)
 	private String createUserName;
 
 	/**
@@ -93,7 +93,7 @@ public class PjOrder implements Serializable {
 	/**
 	 * 修改人名称
 	 */
-	@ApiModelProperty(value = "修改人名称")
+	@TableField(exist = false)
 	private String updateUserName;
 
 	/**
@@ -252,8 +252,20 @@ public class PjOrder implements Serializable {
 	private String businessSource;
 
 	/**
+	 * 应收类别
+	 */
+	@ApiModelProperty(value = "应收类别")
+	private String receivableType;
+
+	/**
 	 * 销售明细list
 	 */
 	@TableField(exist = false)
 	private List<PjOrderItems> orderItemsList;
+
+	/**
+	 * 支付记录集合
+	 */
+	@TableField(exist = false)
+	private List<PjPayment> paymentRecordsList;
 }

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

@@ -119,7 +119,7 @@ public class PjOrderItems implements Serializable {
 	* 品牌
 	*/
 		@ApiModelProperty(value = "品牌")
-		private String band;
+		private String brand;
 	/**
 	* 规格型号
 	*/
@@ -193,4 +193,10 @@ public class PjOrderItems implements Serializable {
 	@ApiModelProperty(value = "所属公司名称")
 	private String salesCompanyName;
 
+	/**
+	 * 返利
+	 */
+	@ApiModelProperty(value = "返利")
+	private BigDecimal thisUsedProfit;
+
 }

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

@@ -0,0 +1,132 @@
+/*
+ *      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 java.math.BigDecimal;
+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-05
+ */
+@Data
+@TableName("pjpf_payment")
+@ApiModel(value = "Payment对象", description = "配件批发支付记录")
+public class PjPayment implements Serializable {
+
+	private static final long serialVersionUID = 1L;
+
+	/**
+	* 主键
+	*/
+		@ApiModelProperty(value = "主键")
+		private Long id;
+
+	/**
+	 * 租户id
+	 */
+	@ApiModelProperty(value = "租户id")
+	private String tenantId;
+
+	/**
+	* 创建人
+	*/
+		@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 isDeleted;
+	/**
+	* 备注
+	*/
+		@ApiModelProperty(value = "备注")
+		private String remarks;
+	/**
+	* 订单状态
+	*/
+		@ApiModelProperty(value = "订单状态")
+		private String status;
+	/**
+	* 支付编号
+	*/
+		@ApiModelProperty(value = "支付编号")
+		private String paymentNumber;
+	/**
+	* 金额
+	*/
+		@ApiModelProperty(value = "金额")
+		private BigDecimal amount;
+	/**
+	* 类型
+	*/
+		@ApiModelProperty(value = "类型")
+		private String paymentType;
+	/**
+	* 支付时间
+	*/
+		@ApiModelProperty(value = "支付时间")
+		private Date paymentTime;
+	/**
+	* 所属公司id
+	*/
+		@ApiModelProperty(value = "所属公司id")
+		private Long salesCompanyId;
+	/**
+	* 所属公司名称
+	*/
+		@ApiModelProperty(value = "所属公司名称")
+		private String salesCompanyName;
+	/**
+	* 销售id
+	*/
+		@ApiModelProperty(value = "销售id")
+		private Long orderId;
+
+
+}

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

@@ -17,6 +17,8 @@
 package org.springblade.salesPart.entity;
 
 import java.math.BigDecimal;
+
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableName;
 import java.time.LocalDateTime;
 import java.io.Serializable;
@@ -100,6 +102,13 @@ public class PjProductLaunch implements Serializable {
 	*/
 		@ApiModelProperty(value = "所属公司名称")
 		private String salesCompanyName;
+
+	/**
+	* 商品id
+	*/
+		@ApiModelProperty(value = "商品id")
+		private Long goodsId;
+
 	/**
 	* 名称
 	*/
@@ -121,5 +130,23 @@ public class PjProductLaunch implements Serializable {
 		@ApiModelProperty(value = "库存")
 		private BigDecimal inventory;
 
+	/**
+	 * 是否上下架(0:下架 1:上架)
+	 */
+	@ApiModelProperty(value = "是否上下架(0:下架 1:上架)")
+	private Integer upAndDownShelves;
+
+	/**
+	 * 主键集合
+	 */
+	@TableField(exist = false)
+	private String ids;
+
+	/**
+	 * 0:下架 1:上架
+	 */
+	@TableField(exist = false)
+	private Integer flag;
+
 
 }

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

@@ -0,0 +1,243 @@
+/*
+ *      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 java.math.BigDecimal;
+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-06
+ */
+@Data
+@TableName("pjpf_shopping_cart")
+@ApiModel(value = "ShoppingCart对象", description = "ShoppingCart对象")
+public class PjShoppingCart implements Serializable {
+
+	private static final long serialVersionUID = 1L;
+
+	/**
+	* 主键
+	*/
+		@ApiModelProperty(value = "主键")
+		private Long id;
+
+	/**
+	 * 租户id
+	 */
+		@ApiModelProperty(value = "租户id")
+		private String tenantId;
+
+	/**
+	* 单据编号
+	*/
+		@ApiModelProperty(value = "单据编号")
+		private String billNo;
+
+	/**
+	* 创建人
+	*/
+		@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 isDeleted;
+
+	/**
+	* 备注
+	*/
+		@ApiModelProperty(value = "备注")
+		private String remarks;
+
+	/**
+	* 订单状态
+	*/
+		@ApiModelProperty(value = "订单状态")
+		private String status;
+
+	/**
+	* 仓库id
+	*/
+		@ApiModelProperty(value = "仓库id")
+		private Long storageId;
+
+	/**
+	* 仓库名称
+	*/
+		@ApiModelProperty(value = "仓库名称")
+		private String storageName;
+
+	/**
+	* 物料编号
+	*/
+		@ApiModelProperty(value = "物料编号")
+		private String goodsNo;
+
+	/**
+	* 商品名称
+	*/
+		@ApiModelProperty(value = "商品名称")
+		private String goodsName;
+
+	/**
+	* 商品id
+	*/
+		@ApiModelProperty(value = "商品id")
+		private Long goodsId;
+
+	/**
+	* 品牌
+	*/
+		@ApiModelProperty(value = "品牌")
+		private String brand;
+
+	/**
+	* 规格型号
+	*/
+		@ApiModelProperty(value = "规格型号")
+		private String propertyName;
+
+	/**
+	* 花纹
+	*/
+		@ApiModelProperty(value = "花纹")
+		private String pattern;
+
+	/**
+	* 商品描述
+	*/
+		@ApiModelProperty(value = "商品描述")
+		private String goodsDescription;
+
+	/**
+	* 数量
+	*/
+		@ApiModelProperty(value = "数量")
+		private BigDecimal goodsNum;
+
+	/**
+	* 单位
+	*/
+		@ApiModelProperty(value = "单位")
+		private String units;
+
+	/**
+	* 价格
+	*/
+		@ApiModelProperty(value = "价格")
+		private BigDecimal price;
+
+	/**
+	* 小计
+	*/
+		@ApiModelProperty(value = "小计")
+		private BigDecimal subTotalMoney;
+
+	/**
+	* 成本价
+	*/
+		@ApiModelProperty(value = "成本价")
+		private BigDecimal costprie;
+
+	/**
+	* 利润
+	*/
+		@ApiModelProperty(value = "利润")
+		private BigDecimal profit;
+
+	/**
+	* 发货数
+	*/
+		@ApiModelProperty(value = "发货数")
+		private BigDecimal sendNum;
+
+	/**
+	* 批次号
+	*/
+		@ApiModelProperty(value = "批次号")
+		private String dot;
+
+	/**
+	* 单据类型
+	*/
+		@ApiModelProperty(value = "单据类型")
+		private String bizType;
+
+	/**
+	* 所属公司id
+	*/
+		@ApiModelProperty(value = "所属公司id")
+		private Long salesCompanyId;
+
+	/**
+	* 所属公司名称
+	*/
+		@ApiModelProperty(value = "所属公司名称")
+		private String salesCompanyName;
+
+	/**
+	* 返利
+	*/
+		@ApiModelProperty(value = "返利")
+		private BigDecimal thisUsedProfit;
+
+	/**
+	* 图片
+	*/
+		@ApiModelProperty(value = "图片")
+		private String picture;
+
+
+}

+ 4 - 7
blade-service-api/blade-sales-part-api/src/main/java/org/springblade/salesPart/excel/CorpsDescImportExcel.java

@@ -21,9 +21,12 @@ public class CorpsDescImportExcel implements Serializable {
 	/**
 	 * 客户名称
 	 */
-	@ExcelProperty(value = "客户名称")
+	@ExcelProperty(value = "客户名称(必填)")
 	private String cname;
 
+	/**
+	 * 客户分类
+	 */
 	@ExcelProperty(value = "客户分类(必填)")
 	private String type;
 
@@ -57,12 +60,6 @@ public class CorpsDescImportExcel implements Serializable {
 	private String salesmanName;
 
 	/**
-	 * 所属公司名称
-	 */
-	@ExcelProperty(value = "所属公司")
-	private String salesCompanyName;
-
-	/**
 	 * 信用额度
 	 */
 	@ExcelProperty(value = "信用额度")

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

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

@@ -0,0 +1,37 @@
+/*
+ *      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.PjShoppingCart;
+
+/**
+ *
+ * 配件批发购物车视图实体类
+ *
+ * @author BladeX
+ * @since 2023-05-06
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ApiModel(value = "ShoppingCartVO对象", description = "ShoppingCartVO对象")
+public class ShoppingCartVO extends PjShoppingCart {
+	private static final long serialVersionUID = 1L;
+
+}

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

@@ -231,17 +231,6 @@ public class CorpsDescServiceImpl extends ServiceImpl<CorpsDescMapper, PjCorpsDe
 					corpsDesc.setCreditLimit(e.getCreditLimit());
 					corpsDesc.setUseCreditLimit(e.getUseCreditLimit());
 
-					//获得所属公司
-					if (StringUtil.isNotBlank(e.getSalesCompanyName())) {
-						R<Dept> dept = iSysClient.getDeptIByName(AuthUtil.getTenantId(), e.getSalesCompanyName());
-						if (ObjectUtil.isNotEmpty(dept)) {
-							corpsDesc.setSalesCompanyId(dept.getData().getId());
-							corpsDesc.setSalesCompanyName(dept.getData().getDeptName());
-						} else {
-							throw new SecurityException("请输入正确的所属公司");
-						}
-					}
-
 					//获得仓库
 					if (StringUtils.isNotBlank(e.getDeliveryWarehouseName())){
 						PjStorageDesc storageDesc = storageDescService.getMessageByName(e.getDeliveryWarehouseName());

+ 75 - 1
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/goods/controller/GoodsDescController.java

@@ -16,6 +16,7 @@
  */
 package org.springblade.salesPart.goods.controller;
 
+import com.alibaba.csp.sentinel.util.StringUtil;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
@@ -29,6 +30,8 @@ import lombok.AllArgsConstructor;
 import javax.servlet.http.HttpServletResponse;
 import javax.validation.Valid;
 
+import org.springblade.client.entity.GoodsDesc;
+import org.springblade.client.entity.GoodsType;
 import org.springblade.core.excel.util.ExcelUtil;
 import org.springblade.core.mp.support.Condition;
 import org.springblade.core.mp.support.Query;
@@ -37,12 +40,16 @@ import org.springblade.core.secure.utils.SecureUtil;
 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.entity.PjBrandDesc;
 import org.springblade.salesPart.entity.PjGoodsType;
+import org.springblade.salesPart.entity.PjShoppingCart;
 import org.springblade.salesPart.excel.CorpsDescExportExcel;
 import org.springblade.salesPart.excel.GoodsDescExportExcel;
 import org.springblade.salesPart.excel.GoodsExcel;
 import org.springblade.salesPart.goods.service.IGoodsTypeService;
+import org.springblade.system.entity.Dept;
+import org.springblade.system.feign.ISysClient;
 import org.springframework.web.bind.annotation.*;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import org.springblade.salesPart.entity.PjGoodsDesc;
@@ -72,6 +79,8 @@ public class GoodsDescController extends BladeController {
 	private final IGoodsTypeService goodsDescType;
 	private final IGoodsDescService goodsDescService;
 
+	private final ISysClient iSysClient;
+
 	/**
 	 * 详情
 	 */
@@ -92,6 +101,17 @@ public class GoodsDescController extends BladeController {
 	@ApiOperation(value = "分页", notes = "传入goods")
 	public R<IPage<PjGoodsDesc>> list(PjGoodsDesc goods, Query query) {
 		LambdaQueryWrapper<PjGoodsDesc> lambdaQueryWrapper = new LambdaQueryWrapper<>();
+
+		//指定分类为一级分类,查询此分类所有二级分类的商品
+		if (StringUtils.isNotBlank(goods.getGoodsTypeId())) {
+			Long goodsId = Long.parseLong(goods.getGoodsTypeId());
+			List<Long> goodsIdList = new ArrayList<>();
+			selectChildById(goodsId, goodsIdList);
+			goodsIdList.add(goodsId);
+
+			lambdaQueryWrapper.in(PjGoodsDesc::getGoodsTypeId, goodsIdList);
+		}
+
 		lambdaQueryWrapper.eq(PjGoodsDesc::getTenantId, AuthUtil.getTenantId())
 			.eq(PjGoodsDesc::getIsDeleted, 0)
 			.like(StringUtils.isNotBlank(goods.getSpecificationAndModel()), PjGoodsDesc::getSpecificationAndModel, goods.getSpecificationAndModel())//规格型号
@@ -103,6 +123,7 @@ public class GoodsDescController extends BladeController {
 			.eq(ObjectUtils.isNotEmpty(goods.getWhether()), PjGoodsDesc::getWhether, goods.getWhether())//是否管理到批次号
 			.eq(ObjectUtils.isNotEmpty(goods.getExplosionProof()), PjGoodsDesc::getExplosionProof, goods.getExplosionProof());//是否防爆
 		IPage<PjGoodsDesc> pages = goodsService.page(Condition.getPage(query),lambdaQueryWrapper);
+
 		pages.getRecords().forEach(e -> {
 			String typeId = e.getGoodsTypeId();
 			String[] split = typeId.split(",");
@@ -114,6 +135,17 @@ public class GoodsDescController extends BladeController {
 				List<String> typeStr = types.stream().map(PjGoodsType::getCname).collect(Collectors.toList());
 				e.setGoodsTypeName(typeStr.toString().replace("[", "").replace("]", ""));
 			}
+
+			//获得所属公司
+			if (StringUtil.isNotBlank(e.getSalesCompanyName())) {
+				R<Dept> dept = iSysClient.getDept(e.getSalesCompanyId());
+				if (ObjectUtil.isNotEmpty(dept)) {
+					e.setSalesCompanyName(dept.getData().getDeptName());
+				} else {
+					throw new SecurityException("请输入正确的所属公司");
+				}
+			}
+
 		});
 		return R.data(pages);
 	}
@@ -226,6 +258,17 @@ public class GoodsDescController extends BladeController {
 	@ApiOperation(value = "导出商品", notes = "传入goods")
 	public void exportGoodsList(PjGoodsDesc goods, HttpServletResponse response) {
 		LambdaQueryWrapper<PjGoodsDesc> lambdaQueryWrapper = new LambdaQueryWrapper<>();
+
+		//指定分类为一级分类,查询此分类所有二级分类的商品
+		if (StringUtils.isNotBlank(goods.getGoodsTypeId())) {
+			Long goodsId = Long.parseLong(goods.getGoodsTypeId());
+			List<Long> goodsIdList = new ArrayList<>();
+			selectChildById(goodsId, goodsIdList);
+			goodsIdList.add(goodsId);
+
+			lambdaQueryWrapper.in(PjGoodsDesc::getGoodsTypeId, goodsIdList);
+		}
+
 		lambdaQueryWrapper.eq(PjGoodsDesc::getTenantId, AuthUtil.getTenantId())
 			.eq(PjGoodsDesc::getIsDeleted, 0)
 			.like(StringUtils.isNotBlank(goods.getSpecificationAndModel()), PjGoodsDesc::getSpecificationAndModel, goods.getSpecificationAndModel())//规格型号
@@ -236,6 +279,7 @@ public class GoodsDescController extends BladeController {
 			.eq(ObjectUtils.isNotEmpty(goods.getSalesCompanyId()), PjGoodsDesc::getSalesCompanyId, goods.getSalesCompanyId())//所属公司
 			.eq(ObjectUtils.isNotEmpty(goods.getWhether()), PjGoodsDesc::getWhether, goods.getWhether())//是否管理到批次号
 			.eq(ObjectUtils.isNotEmpty(goods.getExplosionProof()), PjGoodsDesc::getExplosionProof, goods.getExplosionProof());//是否防爆
+
 		List<PjGoodsDesc> list = goodsService.list(lambdaQueryWrapper);
 		list.forEach(e -> {
 			String typeId = e.getGoodsTypeId();
@@ -256,7 +300,7 @@ public class GoodsDescController extends BladeController {
 	 * 启用禁用
 	 */
 	@GetMapping("/updateEnableOrNot")
-	@ApiOperationSupport(order = 9)
+	@ApiOperationSupport(order = 11)
 	@ApiOperation(value = "启用禁用", notes = "传入goodsDesc")
 	public R updateEnableOrNot(PjGoodsDesc goodsDesc){
 		if (goodsDesc.getId() == null){
@@ -265,4 +309,34 @@ public class GoodsDescController extends BladeController {
 		boolean status = goodsDescService.updateById(goodsDesc);
 		return R.status(status);
 	}
+
+	/**
+	 * 商品下拉 配件批发商品表
+	 */
+	@GetMapping("/goodsListAll")
+	@ApiOperationSupport(order = 12)
+	@ApiOperation(value = "商品下拉", notes = "传入goods")
+	public R<List<PjGoodsDesc>> goodsListAll(PjGoodsDesc goods) {
+		LambdaQueryWrapper<PjGoodsDesc> lambdaQueryWrapper = new LambdaQueryWrapper<>();
+		lambdaQueryWrapper.eq(PjGoodsDesc::getTenantId, AuthUtil.getTenantId())
+			.eq(PjGoodsDesc::getIsDeleted, 0)
+			.like(StringUtils.isNotBlank(goods.getCname()), PjGoodsDesc::getCname, goods.getCname());//商品名称
+		List<PjGoodsDesc> list = goodsService.list(lambdaQueryWrapper);
+
+		return R.data(list);
+	}
+
+	/**
+	 * 递归查询ID
+	 */
+	private void selectChildById(Long id, List<Long> idList) {
+		LambdaQueryWrapper<PjGoodsType> idListWrapper = new LambdaQueryWrapper<>();
+		idListWrapper.select(PjGoodsType::getId);
+		idListWrapper.eq(PjGoodsType::getParentId, id);
+		List<PjGoodsType> childIdList = goodsDescType.list(idListWrapper);
+		childIdList.forEach(item -> {
+			idList.add(item.getId());
+			this.selectChildById(item.getId(), idList);
+		});
+	}
 }

+ 1 - 3
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/goods/controller/GoodsTypeController.java

@@ -53,7 +53,7 @@ import java.util.List;
  */
 @RestController
 @AllArgsConstructor
-@RequestMapping("/goodstype")
+@RequestMapping("/goodsType")
 @Api(value = "商品类别表", tags = "商品类别表接口")
 public class GoodsTypeController extends BladeController {
 
@@ -164,10 +164,8 @@ public class GoodsTypeController extends BladeController {
 		}
 		if (StringUtils.isBlank(goodsType.getCname())) {
 			throw new ServiceException("名称不能为空!");
-//			return R.fail(500, "名称不能为空");
 		}
 
-		//goodsTypeService.selectGoodsTypeCname(goodsType);
 		goodsType.setType(GoodsTypeEnum.GOODS.getType());
 		return R.data(goodsTypeService.saveMessage(goodsType));
 	}

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

@@ -30,7 +30,7 @@
     </resultMap>
 
 
-    <select id="selectGoodsTypePage" resultType="org.springblade.client.vo.GoodsTypeVO">
+    <select id="selectGoodsTypePage" resultType="org.springblade.salesPart.vo.GoodsTypeVO">
         SELECT
 	    dept.id,
         dept.cname,
@@ -55,12 +55,12 @@
                 SELECT
                     CASE WHEN count(1) > 0 THEN 1 ELSE 0 END
                 FROM
-                    basic_goods_type
+                    pjpf_goods_type
                 WHERE
                     parent_id = dept.id and is_deleted = 0
             ) AS hasChildren
 FROM
-	basic_goods_type dept
+    pjpf_goods_type dept
 WHERE
 	dept.is_deleted = 0
         <if test="GoodsType.id!=null">
@@ -118,7 +118,7 @@ WHERE
         id AS "value",
         id AS "key"
         FROM
-        basic_goods_type
+        pjpf_goods_type
         WHERE
         is_deleted = 0
         and status = 0
@@ -139,12 +139,12 @@ WHERE
         SELECT
         CASE WHEN count(1) > 0 THEN 1 ELSE 0 END
         FROM
-        basic_goods_type
+        pjpf_goods_type
         WHERE
         parent_id = dept.id and is_deleted = 0 and status = 0
         ) AS "has_children"
         FROM
-        basic_goods_type dept
+        pjpf_goods_type dept
         WHERE
         dept.parent_id = #{param2} AND dept.is_deleted = 0
         and dept.status = 0
@@ -155,7 +155,7 @@ WHERE
         ORDER BY dept.sort
     </select>
     <select id="selectGoodsTypeCname" resultMap="goodsTypeResultMap">
-        select id,cname from basic_goods_type where is_deleted = 0 and cname =#{cname} and tenant_id = #{tenantId}
+        select id,cname from pjpf_goods_type where is_deleted = 0 and cname =#{cname} and tenant_id = #{tenantId}
     </select>
 
 </mapper>

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

@@ -16,10 +16,12 @@
  */
 package org.springblade.salesPart.goods.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.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.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@@ -28,6 +30,7 @@ import org.springblade.core.log.exception.ServiceException;
 import org.springblade.core.secure.utils.AuthUtil;
 import org.springblade.core.secure.utils.SecureUtil;
 import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.ObjectUtil;
 import org.springblade.salesPart.brand.mapper.BrandDescMapper;
 import org.springblade.salesPart.corps.service.ICorpsDescService;
 import org.springblade.salesPart.entity.*;
@@ -38,6 +41,8 @@ import org.springblade.salesPart.goods.mapper.GoodsTypeMapper;
 import org.springblade.salesPart.goods.service.IGoodsDescService;
 import org.springblade.salesPart.goods.service.IGoodsFilesService;
 import org.springblade.salesPart.vo.GoodsDescVO;
+import org.springblade.system.entity.Dept;
+import org.springblade.system.feign.ISysClient;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
@@ -65,6 +70,8 @@ public class GoodsDescServiceImpl extends ServiceImpl<GoodsDescMapper, PjGoodsDe
 	private final IGoodsFilesService goodsFilesService;
 	private final BrandDescMapper brandDescMapper;
 
+	private final ISysClient iSysClient;
+
 	@Override
 	public PjGoodsDesc getMessageById(PjGoodsDesc goodsDesc) {
 		// 获取商品详情
@@ -183,7 +190,22 @@ public class GoodsDescServiceImpl extends ServiceImpl<GoodsDescMapper, PjGoodsDe
 				goodsDesc.setGoodsTypeId(String.valueOf(goodsType.getId()));
 				goodsDesc.setGoodsTypeName(e.getGoodsTypeName());
 				goodsDesc.setUnit(e.getUnit());
-				goodsDesc.setBrandName(e.getBrand());
+
+				//获得品牌
+				if (ObjectUtils.isNotNull(e.getBrand())){
+					PjBrandDesc brandDesc = brandDescMapper.selectOne(new LambdaQueryWrapper<PjBrandDesc>()
+						.eq(PjBrandDesc::getIsDeleted, 0)
+						.eq(PjBrandDesc::getTenantId, AuthUtil.getTenantId())
+						.eq(PjBrandDesc::getCname, e.getBrand()));
+
+					if (ObjectUtils.isNotNull(brandDesc)){
+						goodsDesc.setBrandId(brandDesc.getId());
+						goodsDesc.setBrandName(e.getBrand());
+					}else {
+						throw new RuntimeException("品牌名称错误或品牌不存在");
+					}
+				}
+
 				goodsDesc.setSpecificationAndModel(e.getSpecificationAndModel());
 				goodsDesc.setBrandItem(e.getBrandItem());
 				goodsDesc.setPlaceProduction(e.getPlaceProduction());
@@ -193,6 +215,19 @@ public class GoodsDescServiceImpl extends ServiceImpl<GoodsDescMapper, PjGoodsDe
 				if (corpByName != null) {
 					goodsDesc.setCorpId(corpByName.getId());
 					goodsDesc.setCorpName(corpByName.getCname());
+				}else {
+					throw new RuntimeException("供应商名称错误或供应商不存在");
+				}
+
+				//获得所属公司
+				if (StringUtil.isNotBlank(e.getSalesCompanyName())) {
+					R<Dept> dept = iSysClient.getDeptIByName(AuthUtil.getTenantId(), e.getSalesCompanyName());
+					if (ObjectUtil.isNotEmpty(dept)) {
+						goodsDesc.setSalesCompanyId(dept.getData().getId());
+						goodsDesc.setSalesCompanyName(dept.getData().getDeptName());
+					} else {
+						throw new SecurityException("请输入正确的所属公司");
+					}
 				}
 
 				goodsDesc.setCnameInt(e.getCnameInt());

+ 2 - 2
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/goods/service/impl/GoodsTypeServiceImpl.java

@@ -25,6 +25,7 @@ import org.springblade.core.log.exception.ServiceException;
 import org.springblade.core.secure.utils.AuthUtil;
 import org.springblade.core.secure.utils.SecureUtil;
 import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.node.ForestNodeMerger;
 import org.springblade.core.tool.utils.Func;
 import org.springblade.core.tool.utils.StringPool;
 import org.springblade.salesPart.entity.PjGoodsType;
@@ -85,8 +86,7 @@ public class GoodsTypeServiceImpl extends ServiceImpl<GoodsTypeMapper, PjGoodsTy
 		if (StringUtils.isBlank(tenantId)) {
 			tenantId = SecureUtil.getTenantId();
 		}
-		return null;
-		//return ForestNodeMerger.merge(baseMapper.tree(tenantId, type));
+		return ForestNodeMerger.merge(baseMapper.tree(tenantId, type));
 	}
 
 	@Override

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

@@ -17,7 +17,7 @@
         <result column="goods_no" property="goodsNo"/>
         <result column="goods_name" property="goodsName"/>
         <result column="goods_id" property="goodsId"/>
-        <result column="band" property="band"/>
+        <result column="brand" property="brand"/>
         <result column="property_name" property="propertyName"/>
         <result column="pattern" property="pattern"/>
         <result column="goods_description" property="goodsDescription"/>
@@ -32,6 +32,7 @@
         <result column="biz_type" property="bizType"/>
         <result column="sales_company_id" property="salesCompanyId"/>
         <result column="sales_company_name" property="salesCompanyName"/>
+        <result column="this_used_profit" property="thisUsedProfit"/>
     </resultMap>
 
 

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

@@ -39,6 +39,7 @@
         <result column="due_date" property="dueDate"/>
         <result column="sales_company_id" property="salesCompanyId"/>
         <result column="sales_company_name" property="salesCompanyName"/>
+        <result column="receivable_type" property="receivableType"/>
     </resultMap>
 
 

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

@@ -23,21 +23,26 @@ import org.springblade.client.feign.ISerialClient;
 import org.springblade.core.secure.utils.AuthUtil;
 import org.springblade.core.tool.api.R;
 import org.springblade.core.tool.utils.BeanUtil;
+import org.springblade.salesPart.corps.mapper.CorpsDescMapper;
 import org.springblade.salesPart.entity.PjOrder;
 import org.springblade.salesPart.entity.PjOrderItems;
+import org.springblade.salesPart.entity.PjPayment;
 import org.springblade.salesPart.entity.PjShip;
 import org.springblade.salesPart.enums.OrderTypeEnum;
 import org.springblade.salesPart.order.mapper.OrderItemsMapper;
 import org.springblade.salesPart.order.mapper.OrderMapper;
 import org.springblade.salesPart.order.service.IOrderService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springblade.salesPart.payment.mapper.PaymentMapper;
 import org.springblade.salesPart.ship.mapper.ShipMapper;
+import org.springblade.salesPart.storage.mapper.StorageDescMapper;
 import org.springblade.salesPart.vo.OrderVO;
 import org.springframework.stereotype.Service;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.transaction.interceptor.TransactionAspectSupport;
 
+import java.math.BigDecimal;
 import java.util.Date;
 
 /**
@@ -57,6 +62,9 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, PjOrder> implemen
 
 	private final OrderItemsMapper orderItemsMapper;
 	private final ShipMapper shipMapper;
+	private final CorpsDescMapper corpsDescMapper;
+	private final StorageDescMapper storageDescMapper;
+	private final PaymentMapper paymentMapper;
 
 	/**
 	 * 获取销售订单详情
@@ -68,12 +76,19 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, PjOrder> implemen
 	public PjOrder getMessageById(PjOrder order) {
 		PjOrder detail = baseMapper.selectById(order.getId());
 
+		//获得销售明细
 		LambdaQueryWrapper<PjOrderItems> itemsLambdaQueryWrapper = new LambdaQueryWrapper<>();
 		itemsLambdaQueryWrapper.eq(PjOrderItems::getTenantId, AuthUtil.getTenantId())
 			.eq(PjOrderItems::getIsDeleted, 0)
 			.eq(PjOrderItems::getPid, detail.getId());
-
 		detail.setOrderItemsList(orderItemsMapper.selectList(itemsLambdaQueryWrapper));
+
+		//获得支付记录
+		LambdaQueryWrapper<PjPayment> paymentLambdaQueryWrapper = new LambdaQueryWrapper<>();
+		paymentLambdaQueryWrapper.eq(PjPayment::getTenantId, AuthUtil.getTenantId())
+			.eq(PjPayment::getIsDeleted, 0)
+			.eq(PjPayment::getOrderId, detail.getId());
+		detail.setPaymentRecordsList(paymentMapper.selectList(paymentLambdaQueryWrapper));
 		return detail;
 	}
 
@@ -98,6 +113,12 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, PjOrder> implemen
 	@Override
 	@Transactional
 	public R saveOrderMessage(PjOrder order) {
+
+		//客户名称
+		order.setCustomerName(corpsDescMapper.selectById(order.getCustomerId()).getCname());
+		//仓库名称
+		order.setStorageName(storageDescMapper.selectById(order.getStorageId()).getCname());
+
 		if (order.getId() == null){
 			// 获取系统编号
 			R billNo = serialClient.getBillNo(order.getBsType(), order.getBsType(), order.getBsType());
@@ -137,9 +158,17 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, PjOrder> implemen
 					orderItemsMapper.updateById(item);
 				}
 			});
-			order.setOrderItemsList(order.getOrderItemsList());
-			order.setNumberRows(order.getOrderItemsList().size());
+
+			order.setNumberRows(order.getOrderItemsList().size());//行数
+			//明细总数量
+			order.setGoodsTotalNum(order.getOrderItemsList().stream().filter(e ->e.getGoodsNum() != null).map(PjOrderItems::getGoodsNum).reduce(BigDecimal.ZERO,BigDecimal::add));
+			//明细总金额
+			order.setTotalMoney(order.getOrderItemsList().stream().reduce(BigDecimal.ZERO, (x, y) -> {
+				return x.add(y.getGoodsNum().multiply(y.getPrice()));
+			},BigDecimal::add).setScale(2,BigDecimal.ROUND_HALF_UP));
 		}
+		baseMapper.updateById(order);
+
 		return R.data(order);
 	}
 

+ 126 - 0
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/payment/controller/PaymentController.java

@@ -0,0 +1,126 @@
+/*
+ *      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.payment.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.springframework.web.bind.annotation.*;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.salesPart.entity.PjPayment;
+import org.springblade.salesPart.vo.PaymentVO;
+import org.springblade.salesPart.payment.service.IPaymentService;
+import org.springblade.core.boot.ctrl.BladeController;
+
+/**
+ * 配件批发支付记录 控制器
+ *
+ * @author BladeX
+ * @since 2023-05-05
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping("/payment")
+@Api(value = "配件批发支付记录", tags = "配件批发支付记录接口")
+public class PaymentController extends BladeController {
+
+	private final IPaymentService paymentService;
+
+	/**
+	 * 详情
+	 */
+	@GetMapping("/detail")
+	@ApiOperationSupport(order = 1)
+	@ApiOperation(value = "详情", notes = "传入payment")
+	public R<PjPayment> detail(PjPayment payment) {
+		PjPayment detail = paymentService.getOne(Condition.getQueryWrapper(payment));
+		return R.data(detail);
+	}
+
+	/**
+	 * 分页 配件批发支付记录
+	 */
+	@GetMapping("/list")
+	@ApiOperationSupport(order = 2)
+	@ApiOperation(value = "分页", notes = "传入payment")
+	public R<IPage<PjPayment>> list(PjPayment payment, Query query) {
+		IPage<PjPayment> pages = paymentService.page(Condition.getPage(query), Condition.getQueryWrapper(payment));
+		return R.data(pages);
+	}
+
+	/**
+	 * 自定义分页 配件批发支付记录
+	 */
+	@GetMapping("/page")
+	@ApiOperationSupport(order = 3)
+	@ApiOperation(value = "分页", notes = "传入payment")
+	public R<IPage<PaymentVO>> page(PaymentVO payment, Query query) {
+		IPage<PaymentVO> pages = paymentService.selectPaymentPage(Condition.getPage(query), payment);
+		return R.data(pages);
+	}
+
+	/**
+	 * 新增 配件批发支付记录
+	 */
+	@PostMapping("/save")
+	@ApiOperationSupport(order = 4)
+	@ApiOperation(value = "新增", notes = "传入payment")
+	public R save(@Valid @RequestBody PjPayment payment) {
+		return R.status(paymentService.save(payment));
+	}
+
+	/**
+	 * 修改 配件批发支付记录
+	 */
+	@PostMapping("/update")
+	@ApiOperationSupport(order = 5)
+	@ApiOperation(value = "修改", notes = "传入payment")
+	public R update(@Valid @RequestBody PjPayment payment) {
+		return R.status(paymentService.updateById(payment));
+	}
+
+	/**
+	 * 新增或修改 配件批发支付记录
+	 */
+	@PostMapping("/submit")
+	@ApiOperationSupport(order = 6)
+	@ApiOperation(value = "新增或修改", notes = "传入payment")
+	public R submit(@Valid @RequestBody PjPayment payment) {
+		return R.status(paymentService.saveOrUpdate(payment));
+	}
+
+
+	/**
+	 * 删除 配件批发支付记录
+	 */
+	@PostMapping("/remove")
+	@ApiOperationSupport(order = 8)
+	@ApiOperation(value = "删除", notes = "传入ids")
+	public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
+		return R.status(paymentService.removeByIds(Func.toLongList(ids)));
+	}
+
+
+}

+ 42 - 0
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/payment/mapper/PaymentMapper.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.payment.mapper;
+
+import org.springblade.salesPart.entity.PjPayment;
+import org.springblade.salesPart.vo.PaymentVO;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import java.util.List;
+
+/**
+ * 配件批发支付记录 Mapper 接口
+ *
+ * @author BladeX
+ * @since 2023-05-05
+ */
+public interface PaymentMapper extends BaseMapper<PjPayment> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param payment
+	 * @return
+	 */
+	List<PaymentVO> selectPaymentPage(IPage page, PaymentVO payment);
+
+}

+ 30 - 0
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/payment/mapper/PaymentMapper.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.payment.mapper.PaymentMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="paymentResultMap" type="org.springblade.salesPart.entity.PjPayment">
+        <id column="id" property="id"/>
+        <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="is_deleted" property="isDeleted"/>
+        <result column="remarks" property="remarks"/>
+        <result column="status" property="status"/>
+        <result column="payment_number" property="paymentNumber"/>
+        <result column="amount" property="amount"/>
+        <result column="payment_type" property="paymentType"/>
+        <result column="payment_time" property="paymentTime"/>
+        <result column="sales_company_id" property="salesCompanyId"/>
+        <result column="sales_company_name" property="salesCompanyName"/>
+        <result column="order_id" property="orderId"/>
+    </resultMap>
+
+
+    <select id="selectPaymentPage" resultMap="paymentResultMap">
+        select * from pjpf_payment where is_deleted = 0
+    </select>
+
+</mapper>

+ 41 - 0
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/payment/service/IPaymentService.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.payment.service;
+
+import org.springblade.salesPart.entity.PjPayment;
+import org.springblade.salesPart.vo.PaymentVO;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+/**
+ * 配件批发支付记录 服务类
+ *
+ * @author BladeX
+ * @since 2023-05-05
+ */
+public interface IPaymentService extends IService<PjPayment> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param payment
+	 * @return
+	 */
+	IPage<PaymentVO> selectPaymentPage(IPage<PaymentVO> page, PaymentVO payment);
+
+}

+ 41 - 0
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/payment/service/impl/PaymentServiceImpl.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.payment.service.impl;
+
+import org.springblade.salesPart.entity.PjPayment;
+import org.springblade.salesPart.vo.PaymentVO;
+import org.springblade.salesPart.payment.mapper.PaymentMapper;
+import org.springblade.salesPart.payment.service.IPaymentService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+/**
+ * 配件批发支付记录 服务实现类
+ *
+ * @author BladeX
+ * @since 2023-05-05
+ */
+@Service
+public class PaymentServiceImpl extends ServiceImpl<PaymentMapper, PjPayment> implements IPaymentService {
+
+	@Override
+	public IPage<PaymentVO> selectPaymentPage(IPage<PaymentVO> page, PaymentVO payment) {
+		return page.setRecords(baseMapper.selectPaymentPage(page, payment));
+	}
+
+}

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

@@ -19,6 +19,7 @@ package org.springblade.salesPart.productLaunch.controller;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
+import com.baomidou.mybatisplus.core.toolkit.StringUtils;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiParam;
@@ -34,6 +35,7 @@ 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.Func;
+import org.springblade.salesPart.entity.PjBrandDesc;
 import org.springblade.salesPart.entity.PjProductLaunch;
 import org.springblade.salesPart.excel.GoodsExcel;
 import org.springblade.salesPart.excel.ProductLaunchImportExcel;
@@ -46,6 +48,7 @@ import org.springframework.web.multipart.MultipartFile;
 
 import java.util.ArrayList;
 import java.util.List;
+import java.util.stream.Collectors;
 
 /**
  * 配件批发产品上架 控制器
@@ -68,7 +71,8 @@ public class ProductLaunchController extends BladeController {
 	@ApiOperationSupport(order = 1)
 	@ApiOperation(value = "详情", notes = "传入productLaunch")
 	public R<PjProductLaunch> detail(PjProductLaunch productLaunch) {
-		PjProductLaunch detail = productLaunchService.getOne(Condition.getQueryWrapper(productLaunch));
+		productLaunch.setTenantId(AuthUtil.getTenantId());
+		PjProductLaunch detail = productLaunchService.getMessageById(productLaunch);
 		return R.data(detail);
 	}
 
@@ -134,7 +138,11 @@ public class ProductLaunchController extends BladeController {
 	@ApiOperationSupport(order = 6)
 	@ApiOperation(value = "新增或修改", notes = "传入productLaunch")
 	public R submit(@Valid @RequestBody PjProductLaunch productLaunch) {
-		return R.status(productLaunchService.saveOrUpdate(productLaunch));
+		if (StringUtils.isNotBlank(productLaunch.getTenantId())){
+			productLaunch.setTenantId(AuthUtil.getTenantId());
+		}
+		PjProductLaunch desc = productLaunchService.saveMessage(productLaunch);
+		return R.data(desc);
 	}
 
 
@@ -173,4 +181,29 @@ public class ProductLaunchController extends BladeController {
 		ExcelUtil.export(response, "导出模板-产品上架", "导入数据表", list, ProductLaunchImportExcel.class);
 	}
 
+	/**
+	 * 批量上下架
+	 */
+	@PostMapping("/batchOperationProductLaunch")
+	@ApiOperationSupport(order = 11)
+	@ApiOperation(value = "批量上下架", notes = "传入ids")
+	public R batchOperationProductLaunch(@Valid @RequestBody PjProductLaunch productLaunch)
+	{
+		if (ObjectUtils.isEmpty(productLaunch.getIds())){
+			throw new RuntimeException("缺少必要参数");
+		}
+
+		List<Long> longs = Func.toLongList(productLaunch.getIds());
+
+		if(CollectionUtils.isEmpty(longs))
+		{
+			throw new SecurityException("传入ids不能为空");
+		}
+		LambdaQueryWrapper<PjProductLaunch> lambdaQueryWrapper=new LambdaQueryWrapper<>();
+		lambdaQueryWrapper.in(PjProductLaunch::getId,longs).eq(PjProductLaunch::getIsDeleted,0);
+		List<Long> collect = productLaunchService.list(lambdaQueryWrapper).stream().map(PjProductLaunch::getId).collect(Collectors.toList());
+		productLaunchService.batchOperationProductLaunch(collect,productLaunch.getFlag());
+		return R.success("操作成功");
+	}
+
 }

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

@@ -19,6 +19,7 @@
         <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"/>
     </resultMap>
 
 

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

@@ -17,6 +17,7 @@
 package org.springblade.salesPart.productLaunch.service;
 
 import org.springblade.core.tool.api.R;
+import org.springblade.salesPart.entity.PjBrandDesc;
 import org.springblade.salesPart.entity.PjProductLaunch;
 import org.springblade.salesPart.excel.GoodsExcel;
 import org.springblade.salesPart.excel.ProductLaunchImportExcel;
@@ -35,6 +36,14 @@ import java.util.List;
 public interface IProductLaunchService extends IService<PjProductLaunch> {
 
 	/**
+	 * 获取详情
+	 *
+	 * @param productLaunch
+	 * @return
+	 */
+	PjProductLaunch getMessageById(PjProductLaunch productLaunch);
+
+	/**
 	 * 自定义分页
 	 *
 	 * @param page
@@ -44,6 +53,14 @@ public interface IProductLaunchService extends IService<PjProductLaunch> {
 	IPage<ProductLaunchVO> selectProductLaunchPage(IPage<ProductLaunchVO> page, ProductLaunchVO productLaunch);
 
 	/**
+	 * 保存上下架信息
+	 *
+	 * @param productLaunch
+	 * @return
+	 */
+	PjProductLaunch saveMessage(PjProductLaunch productLaunch);
+
+	/**
 	 * 导入产品上架
 	 *
 	 * @param data
@@ -52,4 +69,9 @@ public interface IProductLaunchService extends IService<PjProductLaunch> {
 	 */
 	R importProductLaunch(List<ProductLaunchImportExcel> data, Boolean isCovered);
 
+	/**
+	 * 批量操作上下架
+	 * */
+	void batchOperationProductLaunch(List<Long> ids,int flag);
+
 }

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

@@ -17,12 +17,18 @@
 package org.springblade.salesPart.productLaunch.service.impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
+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.excel.ProductLaunchImportExcel;
+import org.springblade.salesPart.goods.mapper.GoodsDescMapper;
 import org.springblade.salesPart.vo.ProductLaunchVO;
 import org.springblade.salesPart.productLaunch.mapper.ProductLaunchMapper;
 import org.springblade.salesPart.productLaunch.service.IProductLaunchService;
@@ -30,6 +36,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 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.Date;
 import java.util.List;
@@ -41,14 +48,46 @@ import java.util.List;
  * @since 2023-04-26
  */
 @Service
+@AllArgsConstructor
 public class ProductLaunchServiceImpl extends ServiceImpl<ProductLaunchMapper, PjProductLaunch> implements IProductLaunchService {
 
+	private final GoodsDescMapper goodsDescMapper;
+
+	@Override
+	public PjProductLaunch getMessageById(PjProductLaunch productLaunch) {
+		PjProductLaunch detail = baseMapper.selectById(productLaunch.getId());
+		return detail;
+	}
+
 	@Override
 	public IPage<ProductLaunchVO> selectProductLaunchPage(IPage<ProductLaunchVO> page, ProductLaunchVO productLaunch) {
 		return page.setRecords(baseMapper.selectProductLaunchPage(page, productLaunch));
 	}
 
 	/**
+	 * 保存上下架信息
+	 *
+	 * @param productLaunch
+	 * @return
+	 */
+	@Override
+	public PjProductLaunch saveMessage(PjProductLaunch productLaunch) {
+		if (productLaunch.getId() != null) {
+			productLaunch.setUpdateUser(AuthUtil.getUserId());
+			productLaunch.setUpdateTime(new Date());
+			productLaunch.setTenantId(AuthUtil.getTenantId());
+			baseMapper.updateById(productLaunch);
+		} else {
+			productLaunch.setCreateUser(AuthUtil.getUserId());
+			productLaunch.setCreateDept(Long.valueOf(AuthUtil.getDeptId()));
+			productLaunch.setCreateTime(new Date());
+			productLaunch.setTenantId(AuthUtil.getTenantId());
+			baseMapper.insert(productLaunch);
+		}
+		return productLaunch;
+	}
+
+	/**
 	 * 导入产品上架
 	 *
 	 * @param data
@@ -65,6 +104,24 @@ public class ProductLaunchServiceImpl extends ServiceImpl<ProductLaunchMapper, P
 			PjProductLaunch productLaunch = new PjProductLaunch();
 			BeanUtils.copyProperties(e, productLaunch);
 
+			//获得商品信息
+			PjGoodsDesc pjGoodsDesc = goodsDescMapper.selectOne(new LambdaQueryWrapper<PjGoodsDesc>()
+				.eq(PjGoodsDesc::getIsDeleted, 0)
+				.eq(PjGoodsDesc::getTenantId, AuthUtil.getTenantId())
+				.eq(PjGoodsDesc::getCname, e.getCname()));
+
+			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("商品名称错误或商品不存在");
+			}
+
 			// 如果名称相等 就认为重复
 			LambdaQueryWrapper<PjProductLaunch> queryWrapper = new LambdaQueryWrapper<>();
 			queryWrapper.eq(PjProductLaunch::getTenantId, AuthUtil.getTenantId());
@@ -87,4 +144,25 @@ public class ProductLaunchServiceImpl extends ServiceImpl<ProductLaunchMapper, P
 		return R.success("ok");
 	}
 
+	/**
+	 * 批量操作上下架
+	 * */
+	@Override
+	@Transactional
+	public void batchOperationProductLaunch(List<Long> ids, int flag)
+	{
+
+		List<PjProductLaunch> list = baseMapper.selectBatchIds(ids);
+		if(CollectionUtils.isEmpty(list))
+		{
+			throw new SecurityException("未查到相关物品信息,操作失败");
+		}
+		list.forEach(e->{
+			e.setUpAndDownShelves(flag);
+			baseMapper.updateById(e);
+		});
+
+
+	}
+
 }

+ 153 - 0
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/shoppingCart/controller/ShoppingCartController.java

@@ -0,0 +1,153 @@
+/*
+ *      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.shoppingCart.controller;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+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.secure.utils.AuthUtil;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.Func;
+import org.springblade.salesPart.entity.PjGoodsDesc;
+import org.springblade.salesPart.entity.PjShoppingCart;
+import org.springblade.salesPart.vo.ShoppingCartVO;
+import org.springframework.web.bind.annotation.*;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.salesPart.shoppingCart.service.IShoppingCartService;
+import org.springblade.core.boot.ctrl.BladeController;
+
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+/**
+ *
+ * 配件批发购物车控制器
+ *
+ * @author BladeX
+ * @since 2023-05-06
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping("/shoppingCart")
+@Api(value = "配件批发购物车", tags = "接口")
+public class ShoppingCartController extends BladeController {
+
+	private final IShoppingCartService shoppingCartService;
+
+	/**
+	 * 详情
+	 */
+	@GetMapping("/detail")
+	@ApiOperationSupport(order = 1)
+	@ApiOperation(value = "详情", notes = "传入shoppingCart")
+	public R<PjShoppingCart> detail(PjShoppingCart shoppingCart) {
+		PjShoppingCart detail = shoppingCartService.getOne(Condition.getQueryWrapper(shoppingCart));
+		return R.data(detail);
+	}
+
+	/**
+	 * 购物车列表不分页查询
+	 */
+	@GetMapping("/list")
+	@ApiOperationSupport(order = 2)
+	@ApiOperation(value = "购物车列表不分页查询", notes = "传入shoppingCart")
+	public R<Map<String, List<PjShoppingCart>>> list(PjShoppingCart shoppingCart) {
+		LambdaQueryWrapper<PjShoppingCart> lambdaQueryWrapper = new LambdaQueryWrapper<>();
+		lambdaQueryWrapper.eq(PjShoppingCart::getTenantId, AuthUtil.getTenantId())
+			.eq(PjShoppingCart::getIsDeleted, 0)
+			.eq(PjShoppingCart::getCreateUser, AuthUtil.getUserId());
+		List<PjShoppingCart> list = shoppingCartService.list(lambdaQueryWrapper);
+
+		//按照仓库分组
+		Map<String, List<PjShoppingCart>> map = list.stream().collect(Collectors.groupingBy(PjShoppingCart::getStorageName));
+		return R.data(map);
+	}
+
+	/**
+	 * 自定义分页
+	 */
+	@GetMapping("/page")
+	@ApiOperationSupport(order = 3)
+	@ApiOperation(value = "分页", notes = "传入shoppingCart")
+	public R<IPage<ShoppingCartVO>> page(ShoppingCartVO shoppingCart, Query query) {
+		IPage<ShoppingCartVO> pages = shoppingCartService.selectShoppingCartPage(Condition.getPage(query), shoppingCart);
+		return R.data(pages);
+	}
+
+	/**
+	 * 新增
+	 */
+	@PostMapping("/save")
+	@ApiOperationSupport(order = 4)
+	@ApiOperation(value = "新增", notes = "传入shoppingCart")
+	public R save(@Valid @RequestBody PjShoppingCart shoppingCart) {
+		return R.status(shoppingCartService.save(shoppingCart));
+	}
+
+	/**
+	 * 修改
+	 */
+	@PostMapping("/update")
+	@ApiOperationSupport(order = 5)
+	@ApiOperation(value = "修改", notes = "传入shoppingCart")
+	public R update(@Valid @RequestBody PjShoppingCart shoppingCart) {
+		shoppingCart.setIsDeleted(1);
+		shoppingCartService.updateById(shoppingCart);
+		return R.success("操作成功");
+	}
+
+	/**
+	 * 新增或修改
+	 */
+	@PostMapping("/submit")
+	@ApiOperationSupport(order = 6)
+	@ApiOperation(value = "新增或修改", notes = "传入shoppingCart")
+	public R submit(@Valid @RequestBody PjShoppingCart shoppingCart) {
+		return R.status(shoppingCartService.saveOrUpdate(shoppingCart));
+	}
+
+
+	/**
+	 * 删除
+	 */
+	@PostMapping("/remove")
+	@ApiOperationSupport(order = 8)
+	@ApiOperation(value = "删除", notes = "传入ids")
+	public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
+		return R.status(shoppingCartService.removeByIds(Func.toLongList(ids)));
+	}
+
+	/**
+	 * 加入购物车
+	 */
+	@GetMapping("/addToCart")
+	@ApiOperationSupport(order = 9)
+	@ApiOperation(value = "加入购物车", notes = "传入shoppingCart")
+	public R addToCart(PjShoppingCart shoppingCart){
+		shoppingCartService.addToCart(shoppingCart);
+		return null;
+	}
+
+}

+ 44 - 0
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/shoppingCart/mapper/ShoppingCartMapper.java

@@ -0,0 +1,44 @@
+/*
+ *      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.shoppingCart.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.salesPart.entity.PjShoppingCart;
+import org.springblade.salesPart.vo.ShoppingCartVO;
+
+import java.util.List;
+
+/**
+ *
+ * 配件批发购物车Mapper 接口
+ *
+ * @author BladeX
+ * @since 2023-05-06
+ */
+public interface ShoppingCartMapper extends BaseMapper<PjShoppingCart> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param shoppingCart
+	 * @return
+	 */
+	List<ShoppingCartVO> selectShoppingCartPage(IPage page, ShoppingCartVO shoppingCart);
+
+}

+ 46 - 0
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/shoppingCart/mapper/ShoppingCartMapper.xml

@@ -0,0 +1,46 @@
+<?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.shoppingCart.mapper.ShoppingCartMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="shoppingCartResultMap" type="org.springblade.salesPart.entity.PjShoppingCart">
+        <id column="id" property="id"/>
+        <result column="bill_no" property="billNo"/>
+        <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="is_deleted" property="isDeleted"/>
+        <result column="remarks" property="remarks"/>
+        <result column="status" property="status"/>
+        <result column="storage_id" property="storageId"/>
+        <result column="storage_name" property="storageName"/>
+        <result column="goods_no" property="goodsNo"/>
+        <result column="goods_name" property="goodsName"/>
+        <result column="goods_id" property="goodsId"/>
+        <result column="brand" property="brand"/>
+        <result column="property_name" property="propertyName"/>
+        <result column="pattern" property="pattern"/>
+        <result column="goods_description" property="goodsDescription"/>
+        <result column="goods_num" property="goodsNum"/>
+        <result column="units" property="units"/>
+        <result column="price" property="price"/>
+        <result column="sub_total_money" property="subTotalMoney"/>
+        <result column="costprie" property="costprie"/>
+        <result column="profit" property="profit"/>
+        <result column="send_num" property="sendNum"/>
+        <result column="dot" property="dot"/>
+        <result column="biz_type" property="bizType"/>
+        <result column="sales_company_id" property="salesCompanyId"/>
+        <result column="sales_company_name" property="salesCompanyName"/>
+        <result column="this_used_profit" property="thisUsedProfit"/>
+        <result column="picture" property="picture"/>
+    </resultMap>
+
+
+    <select id="selectShoppingCartPage" resultMap="shoppingCartResultMap">
+        select * from pjpf_shopping_cart where is_deleted = 0
+    </select>
+
+</mapper>

+ 52 - 0
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/shoppingCart/service/IShoppingCartService.java

@@ -0,0 +1,52 @@
+/*
+ *      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.shoppingCart.service;
+
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.core.tool.api.R;
+import org.springblade.salesPart.entity.PjShoppingCart;
+import org.springblade.salesPart.vo.ShoppingCartVO;
+
+/**
+ *
+ * 配件批发购物车服务类
+ *
+ * @author BladeX
+ * @since 2023-05-06
+ */
+public interface IShoppingCartService extends IService<PjShoppingCart> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param shoppingCart
+	 * @return
+	 */
+	IPage<ShoppingCartVO> selectShoppingCartPage(IPage<ShoppingCartVO> page, ShoppingCartVO shoppingCart);
+
+	/**
+	 * 加入购物车
+	 *
+	 * @param shoppingCart
+	 * @return
+	 */
+	R addToCart(PjShoppingCart shoppingCart);
+
+}

+ 61 - 0
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/shoppingCart/service/impl/ShoppingCartServiceImpl.java

@@ -0,0 +1,61 @@
+/*
+ *      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.shoppingCart.service.impl;
+
+import lombok.AllArgsConstructor;
+import org.springblade.client.feign.ISerialClient;
+import org.springblade.core.tool.api.R;
+import org.springblade.salesPart.entity.PjShoppingCart;
+import org.springblade.salesPart.shoppingCart.mapper.ShoppingCartMapper;
+import org.springblade.salesPart.shoppingCart.service.IShoppingCartService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springblade.salesPart.vo.ShoppingCartVO;
+import org.springframework.stereotype.Service;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springframework.transaction.interceptor.TransactionAspectSupport;
+
+/**
+ *
+ * 配件批发购物车服务实现类
+ *
+ * @author BladeX
+ * @since 2023-05-06
+ */
+@Service
+@AllArgsConstructor
+public class ShoppingCartServiceImpl extends ServiceImpl<ShoppingCartMapper, PjShoppingCart> implements IShoppingCartService {
+
+	private ISerialClient serialClient;//生成系统编号
+
+	@Override
+	public IPage<ShoppingCartVO> selectShoppingCartPage(IPage<ShoppingCartVO> page, ShoppingCartVO shoppingCart) {
+		return page.setRecords(baseMapper.selectShoppingCartPage(page, shoppingCart));
+	}
+
+	@Override
+	public R addToCart(PjShoppingCart shoppingCart) {
+		// 获取系统编号
+		R billNo = serialClient.getBillNo("GWC", "GWC", "GWC");
+		if (billNo.getCode() != 200) {
+			TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
+			return R.fail(500, "生成系统编号失败");
+		}
+		shoppingCart.setBillNo((String) billNo.getData());
+		return null;
+	}
+
+}