Browse Source

Merge remote-tracking branch 'origin/dev' into dev

lazhaoqian 4 years ago
parent
commit
e3975f0db2
22 changed files with 604 additions and 11 deletions
  1. 30 0
      blade-service-api/blade-client-api/src/main/java/org/springblade/client/feign/IStorageClient.java
  2. 3 0
      blade-service-api/blade-deliver-goods-api/src/main/java/org/springblade/deliver/goods/entity/Delivery.java
  3. 34 0
      blade-service-api/store-goods-api/src/main/java/com/store/goods/dto/GoodsRecordDTO.java
  4. 79 0
      blade-service-api/store-goods-api/src/main/java/com/store/goods/entity/GoodsRecord.java
  5. 3 0
      blade-service-api/store-goods-api/src/main/java/com/store/goods/entity/OrderAddress.java
  6. 36 0
      blade-service-api/store-goods-api/src/main/java/com/store/goods/vo/GoodsRecordVO.java
  7. 45 0
      blade-service/blade-client/src/main/java/org/springblade/client/storage/feign/StorageClient.java
  8. 6 0
      blade-service/blade-deliver-goods/pom.xml
  9. 37 0
      blade-service/blade-deliver-goods/src/main/java/org/springblade/deliver/goods/receiving/ExportReCeVingController.java
  10. 37 0
      blade-service/blade-deliver-goods/src/main/java/org/springblade/deliver/goods/receiving/ImportReCeVingController.java
  11. 39 0
      blade-service/blade-deliver-goods/src/main/java/org/springblade/deliver/goods/receiving/ReCeVingController.java
  12. 20 0
      blade-service/store-goods/src/main/java/com/store/goods/controller/GoodsDescController.java
  13. 9 0
      blade-service/store-goods/src/main/java/com/store/goods/controller/OrderAddressController.java
  14. 42 0
      blade-service/store-goods/src/main/java/com/store/goods/mapper/GoodsRecordMapper.java
  15. 21 0
      blade-service/store-goods/src/main/java/com/store/goods/mapper/GoodsRecordMapper.xml
  16. 5 0
      blade-service/store-goods/src/main/java/com/store/goods/service/IGoodsDescService.java
  17. 41 0
      blade-service/store-goods/src/main/java/com/store/goods/service/IGoodsRecordService.java
  18. 50 0
      blade-service/store-goods/src/main/java/com/store/goods/service/impl/GoodsDescServiceImpl.java
  19. 41 0
      blade-service/store-goods/src/main/java/com/store/goods/service/impl/GoodsRecordServiceImpl.java
  20. 1 0
      blade-service/store-goods/src/main/java/com/store/goods/service/impl/OrderServiceImpl.java
  21. 6 0
      blade-service/trade-purchase/pom.xml
  22. 19 11
      blade-service/trade-purchase/src/main/java/com/trade/purchase/order/controller/PurchaseOrderController.java

+ 30 - 0
blade-service-api/blade-client-api/src/main/java/org/springblade/client/feign/IStorageClient.java

@@ -0,0 +1,30 @@
+package org.springblade.client.feign;
+
+import org.springblade.client.entity.CorpsDesc;
+import org.springblade.client.entity.StorageDesc;
+import org.springblade.client.vo.CorpsDescVO;
+import org.springblade.common.constant.LauncherConstant;
+import org.springblade.core.mp.support.BladePage;
+import org.springblade.core.tool.api.R;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+
+import java.util.List;
+import java.util.Map;
+
+@FeignClient(
+	value = LauncherConstant.APPLICATION_CLIENT_NAME
+)
+/**
+ * 仓库信息对外访问API
+ */
+public interface IStorageClient {
+	String API_PREFIX = "/client";
+	String FIND_BY_ID = API_PREFIX + "/findById";
+
+    @GetMapping(FIND_BY_ID)
+	public StorageDesc findById(@RequestParam(value = "id",required = true) Long id);
+
+
+}

+ 3 - 0
blade-service-api/blade-deliver-goods-api/src/main/java/org/springblade/deliver/goods/entity/Delivery.java

@@ -329,4 +329,7 @@ public class Delivery implements Serializable {
 	 */
 	@TableField(exist = false)
 	private Integer deliveryType;
+
+	@TableField(exist = false)
+	private String storageName;
 }

+ 34 - 0
blade-service-api/store-goods-api/src/main/java/com/store/goods/dto/GoodsRecordDTO.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 com.store.goods.dto;
+
+import com.store.goods.entity.GoodsRecord;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 用户浏览/收藏商品记录表数据传输对象实体类
+ *
+ * @author BladeX
+ * @since 2021-11-25
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class GoodsRecordDTO extends GoodsRecord {
+	private static final long serialVersionUID = 1L;
+
+}

+ 79 - 0
blade-service-api/store-goods-api/src/main/java/com/store/goods/entity/GoodsRecord.java

@@ -0,0 +1,79 @@
+/*
+ *      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 com.store.goods.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 2021-11-25
+ */
+@Data
+@TableName("store_goods_record")
+@ApiModel(value = "GoodsRecord对象", description = "用户浏览/收藏商品记录表")
+public class GoodsRecord implements Serializable {
+
+	private static final long serialVersionUID = 1L;
+
+	/**
+	* 收藏/浏览表id
+	*/
+		@ApiModelProperty(value = "收藏/浏览表id")
+		private Long id;
+	/**
+	* 用户id
+	*/
+		@ApiModelProperty(value = "用户id")
+		private Long userId;
+	/**
+	* 商品主id
+	*/
+		@ApiModelProperty(value = "商品主id")
+		private Long goodsDescId;
+	/**
+	* 1.收藏关注记录 2.浏览记录
+	*/
+		@ApiModelProperty(value = "1.收藏关注记录 2.浏览记录")
+		private Integer category;
+	/**
+	* 创建人
+	*/
+		@ApiModelProperty(value = "创建人")
+		private Long createUser;
+	/**
+	* 创建部门
+	*/
+		@ApiModelProperty(value = "创建部门")
+		private Long createDept;
+	/**
+	* 创建时间
+	*/
+		@ApiModelProperty(value = "创建时间")
+		private Date createTime;
+
+
+}

+ 3 - 0
blade-service-api/store-goods-api/src/main/java/com/store/goods/entity/OrderAddress.java

@@ -116,5 +116,8 @@ public class OrderAddress implements Serializable {
 	@ApiModelProperty(value = "租户id")
 	private String tenantId;
 
+	@ApiModelProperty(value = "省市县")
+	private String area;
+
 
 }

+ 36 - 0
blade-service-api/store-goods-api/src/main/java/com/store/goods/vo/GoodsRecordVO.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 com.store.goods.vo;
+
+import com.store.goods.entity.GoodsRecord;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import io.swagger.annotations.ApiModel;
+
+/**
+ * 用户浏览/收藏商品记录表视图实体类
+ *
+ * @author BladeX
+ * @since 2021-11-25
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ApiModel(value = "GoodsRecordVO对象", description = "用户浏览/收藏商品记录表")
+public class GoodsRecordVO extends GoodsRecord {
+	private static final long serialVersionUID = 1L;
+
+}

+ 45 - 0
blade-service/blade-client/src/main/java/org/springblade/client/storage/feign/StorageClient.java

@@ -0,0 +1,45 @@
+package org.springblade.client.storage.feign;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import lombok.AllArgsConstructor;
+import org.springblade.client.corps.assemble.mapstruct.CorpsDescMapstructMapper;
+import org.springblade.client.corps.service.ICorpsDescService;
+import org.springblade.client.entity.CorpsDesc;
+import org.springblade.client.entity.StorageDesc;
+import org.springblade.client.feign.ICorpsDescClient;
+import org.springblade.client.feign.IStorageClient;
+import org.springblade.client.serial.service.IStorageDescService;
+import org.springblade.client.vo.CorpsDescVO;
+import org.springblade.core.mp.support.BladePage;
+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.tenant.annotation.NonDS;
+import org.springblade.core.tool.api.R;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+import springfox.documentation.annotations.ApiIgnore;
+
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+@NonDS
+@ApiIgnore()
+@RestController
+@AllArgsConstructor
+public class StorageClient implements IStorageClient {
+	private final IStorageDescService storageDescService;
+
+	@GetMapping("findById")
+   	public StorageDesc findById(@RequestParam(value = "id",required = true) Long id)
+	{
+		return  storageDescService.getById(id);
+	}
+
+
+
+}

+ 6 - 0
blade-service/blade-deliver-goods/pom.xml

@@ -60,6 +60,12 @@
             <version>2.8.2.RELEASE</version>
             <scope>compile</scope>
         </dependency>
+        <dependency>
+            <groupId>org.springblade</groupId>
+            <artifactId>blade-client</artifactId>
+            <version>2.8.2.RELEASE</version>
+            <scope>compile</scope>
+        </dependency>
     </dependencies>
 
 </project>

+ 37 - 0
blade-service/blade-deliver-goods/src/main/java/org/springblade/deliver/goods/receiving/ExportReCeVingController.java

@@ -17,12 +17,17 @@
 package org.springblade.deliver.goods.receiving;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
 import com.trade.purchase.order.enums.OrderTypeEnum;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiParam;
 import lombok.AllArgsConstructor;
+import org.springblade.client.entity.CorpsDesc;
+import org.springblade.client.entity.StorageDesc;
+import org.springblade.client.feign.ICorpsDescClient;
+import org.springblade.client.feign.IStorageClient;
 import org.springblade.core.boot.ctrl.BladeController;
 import org.springblade.core.mp.support.Condition;
 import org.springblade.core.mp.support.Query;
@@ -35,6 +40,7 @@ import org.springblade.deliver.goods.vo.DeliveryVO;
 import org.springframework.web.bind.annotation.*;
 
 import javax.validation.Valid;
+import java.util.List;
 
 /**
  * 出口收货通知单 控制器
@@ -50,6 +56,10 @@ public class ExportReCeVingController extends BladeController {
 
 	private final IDeliveryService deliveryService;
 
+	private ICorpsDescClient corpsDescClient;//获取客户信息
+
+	private IStorageClient iStorageClient;//库存信息
+
 	/**
 	 * 详情
 	 */
@@ -73,6 +83,33 @@ public class ExportReCeVingController extends BladeController {
 		delivery.setBillType(OrderTypeEnum.RECEIPT.getType());
 		delivery.setTradeType(OrderTypeEnum.EXPORT.getType());
 		IPage<Delivery> pages = deliveryService.page(Condition.getPage(query), Condition.getQueryWrapper(delivery));
+		//解决回显字段问题
+		List<Delivery> records = pages.getRecords();
+		if(CollectionUtils.isNotEmpty(records))
+		{
+			records.forEach(e->{
+				//供应商信息
+				R<CorpsDesc> corps = corpsDescClient.getCorpMessage(e.getCorpId());
+				if(corps.getData()!=null)
+				{
+					e.setCorpsName(corps.getData().getCname());
+				}
+				//所属公司信息
+				R<CorpsDesc> company = corpsDescClient.getCorpMessage(e.getSalesCompany());
+				if(company.getData()!=null)
+				{
+					e.setSalesCompanyName(company.getData().getCname());
+				}
+				//仓库信息
+				StorageDesc storageDesc = iStorageClient.findById(e.getStorageId());
+				if(storageDesc!=null)
+				{
+					e.setStorageName(storageDesc.getCname());
+				}
+
+			});
+		}
+		pages.setRecords(records);
 		return R.data(pages);
 	}
 	/**

+ 37 - 0
blade-service/blade-deliver-goods/src/main/java/org/springblade/deliver/goods/receiving/ImportReCeVingController.java

@@ -17,12 +17,17 @@
 package org.springblade.deliver.goods.receiving;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
 import com.trade.purchase.order.enums.OrderTypeEnum;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiParam;
 import lombok.AllArgsConstructor;
+import org.springblade.client.entity.CorpsDesc;
+import org.springblade.client.entity.StorageDesc;
+import org.springblade.client.feign.ICorpsDescClient;
+import org.springblade.client.feign.IStorageClient;
 import org.springblade.core.boot.ctrl.BladeController;
 import org.springblade.core.mp.support.Condition;
 import org.springblade.core.mp.support.Query;
@@ -35,6 +40,7 @@ import org.springblade.deliver.goods.vo.DeliveryVO;
 import org.springframework.web.bind.annotation.*;
 
 import javax.validation.Valid;
+import java.util.List;
 
 /**
  * 进口收货通知单 控制器
@@ -50,6 +56,10 @@ public class ImportReCeVingController extends BladeController {
 
 	private final IDeliveryService deliveryService;
 
+	private ICorpsDescClient corpsDescClient;//获取客户信息
+
+	private IStorageClient iStorageClient;//库存信息
+
 	/**
 	 * 详情
 	 */
@@ -73,6 +83,33 @@ public class ImportReCeVingController extends BladeController {
 		delivery.setBillType(OrderTypeEnum.RECEIPT.getType());
 		delivery.setTradeType(OrderTypeEnum.IMPORT.getType());
 		IPage<Delivery> pages = deliveryService.page(Condition.getPage(query), Condition.getQueryWrapper(delivery));
+		//解决回显字段问题
+		List<Delivery> records = pages.getRecords();
+		if(CollectionUtils.isNotEmpty(records))
+		{
+			records.forEach(e->{
+				//供应商信息
+				R<CorpsDesc> corps = corpsDescClient.getCorpMessage(e.getCorpId());
+				if(corps.getData()!=null)
+				{
+					e.setCorpsName(corps.getData().getCname());
+				}
+				//所属公司信息
+				R<CorpsDesc> company = corpsDescClient.getCorpMessage(e.getSalesCompany());
+				if(company.getData()!=null)
+				{
+					e.setSalesCompanyName(company.getData().getCname());
+				}
+				//仓库信息
+				StorageDesc storageDesc = iStorageClient.findById(e.getStorageId());
+				if(storageDesc!=null)
+				{
+					e.setStorageName(storageDesc.getCname());
+				}
+
+			});
+		}
+		pages.setRecords(records);
 		return R.data(pages);
 	}
 	/**

+ 39 - 0
blade-service/blade-deliver-goods/src/main/java/org/springblade/deliver/goods/receiving/ReCeVingController.java

@@ -18,6 +18,7 @@ package org.springblade.deliver.goods.receiving;
 
 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.StringUtils;
 import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
 import com.trade.purchase.order.enums.OrderTypeEnum;
@@ -25,6 +26,11 @@ import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiParam;
 import lombok.AllArgsConstructor;
+import org.springblade.client.entity.CorpsDesc;
+import org.springblade.client.entity.StorageDesc;
+import org.springblade.client.feign.ICorpsDescClient;
+import org.springblade.client.feign.IStorageClient;
+import org.springblade.client.storage.feign.StorageClient;
 import org.springblade.core.boot.ctrl.BladeController;
 import org.springblade.core.mp.support.Condition;
 import org.springblade.core.mp.support.Query;
@@ -38,6 +44,7 @@ import org.springblade.deliver.goods.vo.DeliveryVO;
 import org.springframework.web.bind.annotation.*;
 
 import javax.validation.Valid;
+import java.util.List;
 
 /**
  * 国内收货通知单 控制器
@@ -53,6 +60,11 @@ public class ReCeVingController extends BladeController {
 
 	private final IDeliveryService deliveryService;
 
+	private ICorpsDescClient corpsDescClient;//获取客户信息
+
+	private IStorageClient iStorageClient;//库存信息
+
+
 	/**
 	 * 详情
 	 */
@@ -78,6 +90,33 @@ public class ReCeVingController extends BladeController {
 		.between(StringUtils.isNotBlank(delivery.getCreateStartTime())&&StringUtils.isNotBlank(delivery.getCreateEndTime()),"create_time",delivery.getCreateStartTime(),delivery.getCreateEndTime())
 		.between(StringUtils.isNotBlank(delivery.getBusinessStartDate())&&StringUtils.isNotBlank(delivery.getBusinessEndDate()),"business_date",delivery.getBusinessStartDate(),delivery.getBusinessEndDate());
 		IPage<Delivery> pages = deliveryService.page(Condition.getPage(query), queryWrapper);
+		//解决回显字段问题
+		List<Delivery> records = pages.getRecords();
+		if(CollectionUtils.isNotEmpty(records))
+		{
+			records.forEach(e->{
+				//供应商信息
+				R<CorpsDesc> corps = corpsDescClient.getCorpMessage(e.getCorpId());
+				if(corps.getData()!=null)
+				{
+					e.setCorpsName(corps.getData().getCname());
+				}
+                //所属公司信息
+				R<CorpsDesc> company = corpsDescClient.getCorpMessage(e.getSalesCompany());
+				if(company.getData()!=null)
+				{
+					e.setSalesCompanyName(company.getData().getCname());
+				}
+				//仓库信息
+				StorageDesc storageDesc = iStorageClient.findById(e.getStorageId());
+				if(storageDesc!=null)
+				{
+					e.setStorageName(storageDesc.getCname());
+				}
+
+			});
+		}
+		pages.setRecords(records);
 		return R.data(pages);
 	}
 	/**

+ 20 - 0
blade-service/store-goods/src/main/java/com/store/goods/controller/GoodsDescController.java

@@ -19,7 +19,9 @@ package com.store.goods.controller;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.store.goods.entity.GoodsItems;
+import com.store.goods.entity.GoodsRecord;
 import com.store.goods.service.IGoodsItemsService;
+import com.store.goods.service.IGoodsRecordService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiParam;
@@ -58,6 +60,8 @@ public class GoodsDescController extends BladeController {
 	private final IGoodsDescService goodsDescService;
 
 	private final IGoodsItemsService goodsItemsService;
+
+	private final IGoodsRecordService goodsRecordService;
 	/**
 	 * 详情
 	 */
@@ -96,6 +100,8 @@ public class GoodsDescController extends BladeController {
 		}
 
 		detail.setItemsList(itemsList);
+	    //添加浏览记录
+		goodsDescService.submitRecords(detail.getId(),2);
 		return R.data(detail);
 	}
 
@@ -240,4 +246,18 @@ public class GoodsDescController extends BladeController {
 		return R.success("操作成功");
 	}
 
+	/**
+	 *  添加取消-收藏记录,添加更新-浏览记录
+	 *
+	 * */
+	@PostMapping("/submitRecords")
+	@ApiOperationSupport(order = 8)
+	@ApiOperation(value = "添加取消-收藏记录,添加更新-浏览记录", notes = "传入商品主表id和记录类型")
+	public R submitRecords(@ApiParam(value = "商品主表id", required = true) @RequestParam Long goodDescId,
+						   @ApiParam(value = "类型:1.收藏 2.浏览", required = true) @RequestParam Integer category)
+	{
+		goodsDescService.submitRecords(goodDescId,category);
+		return R.success("操作成功");
+	}
+
 }

+ 9 - 0
blade-service/store-goods/src/main/java/com/store/goods/controller/OrderAddressController.java

@@ -25,6 +25,7 @@ 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.springframework.web.bind.annotation.*;
@@ -34,6 +35,8 @@ import com.store.goods.vo.OrderAddressVO;
 import com.store.goods.service.IOrderAddressService;
 import org.springblade.core.boot.ctrl.BladeController;
 
+import java.util.Date;
+
 /**
  * 订单收货地址表 控制器
  *
@@ -88,6 +91,10 @@ public class OrderAddressController extends BladeController {
 	@ApiOperationSupport(order = 4)
 	@ApiOperation(value = "新增收货单地址", notes = "传入orderAddress")
 	public R save(@Valid @RequestBody OrderAddress orderAddress) {
+		orderAddress.setUserId(AuthUtil.getUserId());
+		orderAddress.setTenantId(AuthUtil.getTenantId());
+		orderAddress.setCreateTime(new Date());
+		orderAddress.setCreateUser(AuthUtil.getUserId());
 		return R.status(orderAddressService.save(orderAddress));
 	}
 
@@ -98,6 +105,8 @@ public class OrderAddressController extends BladeController {
 	@ApiOperationSupport(order = 5)
 	@ApiOperation(value = "修改收货单地址", notes = "传入orderAddress")
 	public R update(@Valid @RequestBody OrderAddress orderAddress) {
+		orderAddress.setUpdateTime(new Date());
+		orderAddress.setUpdateUser(AuthUtil.getUserId());
 		return R.status(orderAddressService.updateById(orderAddress));
 	}
 

+ 42 - 0
blade-service/store-goods/src/main/java/com/store/goods/mapper/GoodsRecordMapper.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 com.store.goods.mapper;
+
+import com.store.goods.entity.GoodsRecord;
+import com.store.goods.vo.GoodsRecordVO;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import java.util.List;
+
+/**
+ * 用户浏览/收藏商品记录表 Mapper 接口
+ *
+ * @author BladeX
+ * @since 2021-11-25
+ */
+public interface GoodsRecordMapper extends BaseMapper<GoodsRecord> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param goodsRecord
+	 * @return
+	 */
+	List<GoodsRecordVO> selectGoodsRecordPage(IPage page, GoodsRecordVO goodsRecord);
+
+}

+ 21 - 0
blade-service/store-goods/src/main/java/com/store/goods/mapper/GoodsRecordMapper.xml

@@ -0,0 +1,21 @@
+<?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="com.store.goods.mapper.GoodsRecordMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="goodsRecordResultMap" type="com.store.goods.entity.GoodsRecord">
+        <id column="id" property="id"/>
+        <result column="user_id" property="userId"/>
+        <result column="goods_desc_id" property="goodsDescId"/>
+        <result column="category" property="category"/>
+        <result column="create_user" property="createUser"/>
+        <result column="create_dept" property="createDept"/>
+        <result column="create_time" property="createTime"/>
+    </resultMap>
+
+
+    <select id="selectGoodsRecordPage" resultMap="goodsRecordResultMap">
+        select * from store_goods_record where is_deleted = 0
+    </select>
+
+</mapper>

+ 5 - 0
blade-service/store-goods/src/main/java/com/store/goods/service/IGoodsDescService.java

@@ -49,4 +49,9 @@ public interface IGoodsDescService extends IService<GoodsDesc> {
 	 * 提交主表信息
 	 * */
     void modify(GoodsDesc goodsDesc);
+
+	/**
+	 * 添加取消-收藏记录,添加更新-浏览记录
+	 * */
+    void submitRecords(Long goodDescId,Integer category);
 }

+ 41 - 0
blade-service/store-goods/src/main/java/com/store/goods/service/IGoodsRecordService.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 com.store.goods.service;
+
+import com.store.goods.entity.GoodsRecord;
+import com.store.goods.vo.GoodsRecordVO;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+/**
+ * 用户浏览/收藏商品记录表 服务类
+ *
+ * @author BladeX
+ * @since 2021-11-25
+ */
+public interface IGoodsRecordService extends IService<GoodsRecord> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param goodsRecord
+	 * @return
+	 */
+	IPage<GoodsRecordVO> selectGoodsRecordPage(IPage<GoodsRecordVO> page, GoodsRecordVO goodsRecord);
+
+}

+ 50 - 0
blade-service/store-goods/src/main/java/com/store/goods/service/impl/GoodsDescServiceImpl.java

@@ -19,11 +19,14 @@ package com.store.goods.service.impl;
 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.store.goods.entity.GoodsDesc;
 import com.store.goods.entity.GoodsItems;
+import com.store.goods.entity.GoodsRecord;
 import com.store.goods.mapper.GoodsItemsMapper;
+import com.store.goods.mapper.GoodsRecordMapper;
 import com.store.goods.vo.GoodsDescVO;
 import com.store.goods.mapper.GoodsDescMapper;
 import com.store.goods.service.IGoodsDescService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springblade.core.mp.support.Condition;
 import org.springblade.core.secure.utils.AuthUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -44,6 +47,8 @@ public class GoodsDescServiceImpl extends ServiceImpl<GoodsDescMapper, GoodsDesc
 {
 	@Autowired
 	private  GoodsItemsMapper goodsItemsMapper;
+	@Autowired
+	private GoodsRecordMapper goodsRecordMapper;
 
 
 	@Override
@@ -126,4 +131,49 @@ public class GoodsDescServiceImpl extends ServiceImpl<GoodsDescMapper, GoodsDesc
 
 	}
 
+	@Override
+	@Transactional
+	public void submitRecords(Long goodDescId, Integer category)
+	{
+		GoodsRecord model=new GoodsRecord();
+		model.setUserId(AuthUtil.getUserId());
+		model.setGoodsDescId(goodDescId);
+		model.setCategory(category);
+		GoodsRecord record = goodsRecordMapper.selectOne(Condition.getQueryWrapper(model));
+		//收藏逻辑
+		if(category==1)
+		{
+			//新增收藏记录
+			if(record==null)
+			{
+				model.setCreateTime(new Date());
+				model.setCreateUser(AuthUtil.getUserId());
+				goodsRecordMapper.insert(model);
+			}
+			//取消收藏记录
+			{
+				goodsRecordMapper.deleteById(record.getId());
+			}
+
+		}
+		//浏览逻辑
+		else if(category==2)
+		{
+			//新增浏览记录
+			if(record==null)
+			{
+				model.setCreateTime(new Date());
+				model.setCreateUser(AuthUtil.getUserId());
+				goodsRecordMapper.insert(model);
+			}
+			//更新浏览记录
+			else
+			{
+				record.setCreateTime(new Date());
+				goodsRecordMapper.updateById(record);
+			}
+
+		}
+	}
+
 }

+ 41 - 0
blade-service/store-goods/src/main/java/com/store/goods/service/impl/GoodsRecordServiceImpl.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 com.store.goods.service.impl;
+
+import com.store.goods.entity.GoodsRecord;
+import com.store.goods.vo.GoodsRecordVO;
+import com.store.goods.mapper.GoodsRecordMapper;
+import com.store.goods.service.IGoodsRecordService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+/**
+ * 用户浏览/收藏商品记录表 服务实现类
+ *
+ * @author BladeX
+ * @since 2021-11-25
+ */
+@Service
+public class GoodsRecordServiceImpl extends ServiceImpl<GoodsRecordMapper, GoodsRecord> implements IGoodsRecordService {
+
+	@Override
+	public IPage<GoodsRecordVO> selectGoodsRecordPage(IPage<GoodsRecordVO> page, GoodsRecordVO goodsRecord) {
+		return page.setRecords(baseMapper.selectGoodsRecordPage(page, goodsRecord));
+	}
+
+}

+ 1 - 0
blade-service/store-goods/src/main/java/com/store/goods/service/impl/OrderServiceImpl.java

@@ -81,6 +81,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
 			throw new SecurityException("地址信息不正确");
 		}
 		//新增订单
+		order.setUserId(AuthUtil.getUserId());
 		order.setCreateTime(new Date());
 		order.setTenantId(AuthUtil.getTenantId());
 		order.setCreateUser(AuthUtil.getUserId());

+ 6 - 0
blade-service/trade-purchase/pom.xml

@@ -81,6 +81,12 @@
             <version>2.8.2.RELEASE</version>
             <scope>compile</scope>
         </dependency>
+        <dependency>
+            <groupId>org.springblade</groupId>
+            <artifactId>blade-client</artifactId>
+            <version>2.8.2.RELEASE</version>
+            <scope>compile</scope>
+        </dependency>
 
     </dependencies>
 

+ 19 - 11
blade-service/trade-purchase/src/main/java/com/trade/purchase/order/controller/PurchaseOrderController.java

@@ -67,7 +67,7 @@ public class PurchaseOrderController extends BladeController {
 
 	private ICorpsDescClient corpsDescClient;//获取客户信息
 
-	private IGoodsDescClient goodsDescClient;//获取商品信息
+    private IGoodsDescClient goodsDescClient;
 
 
 	/**
@@ -91,16 +91,23 @@ public class PurchaseOrderController extends BladeController {
 					 			 @RequestParam(value = "billNo",required = false) String billNo,//提单号
 								 @RequestParam(value = "strCorpName",required = false) String strCorpName,//供应商名称
 								 @RequestParam(value = "strPurchaserName",required = false) String strPurchaserName,//采购商名称
-								 @RequestParam(value = "businesStartDate",required = false) String businesStartDate,//订单开始时间
+
+								 @RequestParam(value = "businesStartDate",required = false) String businesStartDate,//订单开始时间  busines_date
 								 @RequestParam(value = "businesEndDate",required = false) String businesEndDate,//订单结束时间
-								 @RequestParam(value = "accountsCollectionStartDate",required = false) String accountsCollectionStartDate,//付款开始时间
-								 @RequestParam(value = "accountsCollectionEndDate",required = false) String accountsCollectionEndDate,//付款结束时间
-								 @RequestParam(value = "dateOfStartArrival",required = false) String dateOfStartArrival,//付款开始时间
-								 @RequestParam(value = "dateOfEndArrival",required = false) String dateOfEndArrival,//付款开始时间,
-								 @RequestParam(value = "requiredDeliveryStartDate",required = false) String requiredDeliveryStartDate,//付款开始时间
-								 @RequestParam(value = "requiredDeliveryEndDate",required = false) String requiredDeliveryEndDate,//付款开始时间
-								 @RequestParam(value = "requiredArrivalStartDate",required = false) String requiredArrivalStartDate,//付款开始时间
-								 @RequestParam(value = "requiredArrivalEndDate",required = false) String requiredArrivalEndDate,//付款开始时间
+								 @RequestParam(value = "accountsCollectionStartDate",required = false) String accountsCollectionStartDate,//应收(付)款开始时间  accounts_collection_date
+								 @RequestParam(value = "accountsCollectionEndDate",required = false) String accountsCollectionEndDate,//应收(付)款结束时间
+
+								 @RequestParam(value = "dateOfStartArrival",required = false) String dateOfStartArrival,//实际到港开始日期 date_of_arrival
+								 @RequestParam(value = "dateOfEndArrival",required = false) String dateOfEndArrival,//实际到港结束时间,
+
+								 @RequestParam(value = "requiredDeliveryStartDate",required = false) String requiredDeliveryStartDate,//要求发货开始日期  required_delivery_date
+								 @RequestParam(value = "requiredDeliveryEndDate",required = false) String requiredDeliveryEndDate,//要求发货结束时间
+
+								 @RequestParam(value = "requiredArrivalStartDate",required = false) String requiredArrivalStartDate,//要求到货开始日期  required_arrival_date
+								 @RequestParam(value = "requiredArrivalEndDate",required = false) String requiredArrivalEndDate,//要求到货结束日期
+
+					             @RequestParam(value = "creditStartDate",required = false) String creditStartDate,//信用证到期日-开始日期  credit_date
+					             @RequestParam(value = "creditEndDate",required = false) String creditEndDate,//信用证到期日-结束时间
 								 Order order
 								)
 	{
@@ -144,9 +151,10 @@ public class PurchaseOrderController extends BladeController {
 		queryWrapper.apply(StringUtils.isNotBlank(billNo),"find_in_set('"+billNo+"',bill_no)");
 		queryWrapper.between(StringUtils.isNotBlank(businesStartDate)&&StringUtils.isNotBlank(businesEndDate),"busines_date",businesStartDate,businesEndDate);
 		queryWrapper.between(StringUtils.isNotBlank(accountsCollectionStartDate)&&StringUtils.isNotBlank(accountsCollectionEndDate),"accounts_collection_date",accountsCollectionStartDate,accountsCollectionEndDate);
-		queryWrapper.between(StringUtils.isNotBlank(dateOfStartArrival)&&StringUtils.isNotBlank(dateOfEndArrival),"arrival_date",dateOfStartArrival,dateOfEndArrival);
+		queryWrapper.between(StringUtils.isNotBlank(dateOfStartArrival)&&StringUtils.isNotBlank(dateOfEndArrival),"date_of_arrival",dateOfStartArrival,dateOfEndArrival);
 		queryWrapper.between(StringUtils.isNotBlank(requiredDeliveryStartDate)&&StringUtils.isNotBlank(requiredDeliveryEndDate),"required_delivery_date",requiredDeliveryStartDate,requiredDeliveryEndDate);
 		queryWrapper.between(StringUtils.isNotBlank(requiredArrivalStartDate)&&StringUtils.isNotBlank(requiredArrivalEndDate),"required_arrival_date",requiredArrivalStartDate,requiredArrivalEndDate);
+		queryWrapper.between(StringUtils.isNotBlank(creditStartDate)&&StringUtils.isNotBlank(creditEndDate),"credit_date",creditStartDate,creditEndDate);
 		Page<Order> page=new Page<>(current,size);
 		IPage<Order> pages = orderService.page(page,queryWrapper);
 		List<Order> records = pages.getRecords();