Przeglądaj źródła

Merge branch 'dev' of AHX-Bid/auction into master

linhui.li 10 godzin temu
rodzic
commit
d9ea6f18bf
57 zmienionych plików z 1009 dodań i 108 usunięć
  1. 1 2
      auc/src/main/java/cn/hobbystocks/auc/app/AppClient.java
  2. 8 4
      auc/src/main/java/cn/hobbystocks/auc/web/AuctionController.java
  3. 1 1
      auc/src/main/java/cn/hobbystocks/auc/web/BidController.java
  4. 21 9
      auc/src/main/java/cn/hobbystocks/auc/web/LotController.java
  5. 60 0
      auc/src/main/java/cn/hobbystocks/auc/web/LotNoticeController.java
  6. 6 1
      auc/src/main/resources/application-local.yml
  7. 1 1
      auc/src/main/resources/application.yml
  8. 1 1
      bid/src/main/java/cn/hobbystocks/auc/app/AppClient.java
  9. 2 4
      bid/src/main/java/cn/hobbystocks/auc/listener/SoldListener.java
  10. 3 3
      bid/src/main/java/cn/hobbystocks/auc/task/BidTask.java
  11. 79 0
      bid/src/main/java/cn/hobbystocks/auc/web/AddressController.java
  12. 53 0
      bid/src/main/java/cn/hobbystocks/auc/web/AuctionController.java
  13. 8 8
      bid/src/main/java/cn/hobbystocks/auc/web/BidingController.java
  14. 31 6
      bid/src/main/java/cn/hobbystocks/auc/web/DepositOrderController.java
  15. 6 3
      bid/src/main/java/cn/hobbystocks/auc/web/LocalController.java
  16. 52 0
      bid/src/main/java/cn/hobbystocks/auc/web/LotController.java
  17. 35 0
      bid/src/main/java/cn/hobbystocks/auc/web/LotNoticeController.java
  18. 5 0
      bid/src/main/resources/application-local.yml
  19. 1 0
      bid/src/main/resources/logback-spring.xml
  20. 3 2
      lot/src/main/java/cn/hobbystocks/auc/common/constant/Constants.java
  21. 22 0
      lot/src/main/java/cn/hobbystocks/auc/domain/Auction.java
  22. 5 3
      lot/src/main/java/cn/hobbystocks/auc/domain/DepositOrder.java
  23. 55 12
      lot/src/main/java/cn/hobbystocks/auc/domain/Lot.java
  24. 2 0
      lot/src/main/java/cn/hobbystocks/auc/domain/LotFans.java
  25. 39 0
      lot/src/main/java/cn/hobbystocks/auc/domain/LotNotice.java
  26. 1 1
      lot/src/main/java/cn/hobbystocks/auc/domain/Order.java
  27. 17 3
      lot/src/main/java/cn/hobbystocks/auc/dto/DepositOrderDTO.java
  28. 66 0
      lot/src/main/java/cn/hobbystocks/auc/dto/ShippingAddressDto.java
  29. 10 0
      lot/src/main/java/cn/hobbystocks/auc/mapper/AddressMapper.java
  30. 2 0
      lot/src/main/java/cn/hobbystocks/auc/mapper/AuctionMapper.java
  31. 2 1
      lot/src/main/java/cn/hobbystocks/auc/mapper/LotFansMapper.java
  32. 5 1
      lot/src/main/java/cn/hobbystocks/auc/mapper/LotMapper.java
  33. 17 0
      lot/src/main/java/cn/hobbystocks/auc/mapper/LotNoticeMapper.java
  34. 1 1
      lot/src/main/java/cn/hobbystocks/auc/mapper/OrderMapper.java
  35. 63 0
      lot/src/main/java/cn/hobbystocks/auc/mapper/handler/JsonNodeTypeHandler.java
  36. 7 0
      lot/src/main/java/cn/hobbystocks/auc/service/AddressService.java
  37. 1 1
      lot/src/main/java/cn/hobbystocks/auc/service/DepositOrderService.java
  38. 3 1
      lot/src/main/java/cn/hobbystocks/auc/service/IAuctionService.java
  39. 2 1
      lot/src/main/java/cn/hobbystocks/auc/service/ILotFansService.java
  40. 11 0
      lot/src/main/java/cn/hobbystocks/auc/service/ILotService.java
  41. 1 1
      lot/src/main/java/cn/hobbystocks/auc/service/IOrderService.java
  42. 33 0
      lot/src/main/java/cn/hobbystocks/auc/service/LotNoticeService.java
  43. 12 0
      lot/src/main/java/cn/hobbystocks/auc/service/impl/AddressServiceImpl.java
  44. 15 3
      lot/src/main/java/cn/hobbystocks/auc/service/impl/AuctionServiceImpl.java
  45. 5 4
      lot/src/main/java/cn/hobbystocks/auc/service/impl/DepositOrderServiceImpl.java
  46. 2 1
      lot/src/main/java/cn/hobbystocks/auc/service/impl/LotFansServiceImpl.java
  47. 48 0
      lot/src/main/java/cn/hobbystocks/auc/service/impl/LotNoticeServiceImpl.java
  48. 44 0
      lot/src/main/java/cn/hobbystocks/auc/service/impl/LotServiceImpl.java
  49. 3 2
      lot/src/main/java/cn/hobbystocks/auc/service/impl/OrderServiceImpl.java
  50. 2 1
      lot/src/main/java/cn/hobbystocks/auc/vo/AuctionVO.java
  51. 30 0
      lot/src/main/java/cn/hobbystocks/auc/vo/LotNoticeVO.java
  52. 3 0
      lot/src/main/java/cn/hobbystocks/auc/vo/LotVO.java
  53. 1 1
      lot/src/main/java/cn/hobbystocks/auc/vo/OrderVO.java
  54. 9 3
      lot/src/main/resources/mapper/AuctionMapper.xml
  55. 7 7
      lot/src/main/resources/mapper/DepositOrderMapper.xml
  56. 71 15
      lot/src/main/resources/mapper/LotMapper.xml
  57. 15 0
      lot/src/main/resources/mapper/LotNoticeMapper.xml

+ 1 - 2
auc/src/main/java/cn/hobbystocks/auc/app/AppClient.java

@@ -20,8 +20,7 @@ import java.util.*;
 public class AppClient {
     @Autowired
     private CommonForestClient client;
-    @Value("${hobbystocks.host.pointUrl}")
-    private String pointUrl;
+
     @Value(("${hobbystocks.host.getSku}"))
     private String getSku;
 

+ 8 - 4
auc/src/main/java/cn/hobbystocks/auc/web/AuctionController.java

@@ -58,7 +58,7 @@ public class AuctionController extends AdminBaseController {
 	/**
 	 * 新增保存拍卖会
 	 */
-	@ApiOperation(value = "新增保存拍卖会", notes = "新增保存拍卖会", response = AjaxResult.class, responseContainer = "int")
+	@ApiOperation(value = "新增拍卖会", notes = "新增保存拍卖会", response = AjaxResult.class, responseContainer = "int")
 	@PostMapping("/add")
 	public AjaxResult addSave(@RequestBody AuctionDTO auctionDTO) {
         UserInfo simpleUserInfo = UserUtils.getSimpleUserInfo();
@@ -98,7 +98,8 @@ public class AuctionController extends AdminBaseController {
 		if (Objects.equals(Constants.PUB_STATUS_PUBLISHED, dbAuc.getPubStatus())) {
 			return AjaxResult.error("拍卖会已发布不能修改");
 		}
-		auction.setUpdateBy(getUsername());
+		//todo user服务不可用
+//		auction.setUpdateBy(getUsername());
 		return AjaxResult.success(auctionService.updateById(auction));
 	}
 
@@ -132,8 +133,11 @@ public class AuctionController extends AdminBaseController {
 			return AjaxResult.error("没有找到拍卖会");
 
 		auction.setUpdateBy(getUsername());
-		auctionService.pubAuction(auction);
-		return AjaxResult.success();
+        boolean pubAuction = auctionService.pubAuction(auction);
+        if (!pubAuction){
+            return AjaxResult.error("下架失败!当前拍卖会有竞拍中的拍品");
+        }
+        return AjaxResult.success();
 	}
 
 }

+ 1 - 1
auc/src/main/java/cn/hobbystocks/auc/web/BidController.java

@@ -27,7 +27,7 @@ public class BidController extends AdminBaseController {
      * 查询出价列表
      * foreach
      */
-    @ApiOperation(value = "list", notes = "查询出价列表", response = Bid.class, responseContainer = "List<Bid>")
+    @ApiOperation(value = "查询拍品出价列表", notes = "查询出价列表", response = Bid.class, responseContainer = "List<Bid>")
     @PostMapping("/list")
     public AjaxResult list(@RequestBody BidVO bidVO) {
         bidVO.setDelFlag(Constants.DEL_FLAG_NO_DELETE);

+ 21 - 9
auc/src/main/java/cn/hobbystocks/auc/web/LotController.java

@@ -14,6 +14,7 @@ import cn.hobbystocks.auc.domain.Bid;
 import cn.hobbystocks.auc.domain.Lot;
 import cn.hobbystocks.auc.common.constant.Constants;
 import cn.hobbystocks.auc.mapper.BidMapper;
+import cn.hobbystocks.auc.service.IAuctionService;
 import cn.hobbystocks.auc.service.SyncService;
 import cn.hobbystocks.auc.task.DynamicTaskService;
 import cn.hobbystocks.auc.vo.LotVO;
@@ -41,21 +42,21 @@ public class LotController extends AdminBaseController {
 	@Autowired
 	private SyncService syncService;
 	@Autowired
-	private AppClient appClient;
+	private IAuctionService auctionService;
 	@Autowired
 	private BidMapper bidMapper;
 
+
 	/**
 	 * 查询拍品列表
 	 */
-	@ApiOperation(value = "查询拍卖会下的拍品列表", notes = "分页查询拍品列表", response = Lot.class, responseContainer = "List<Lot>")
+	@ApiOperation(value = "查询拍品列表", notes = "分页查询拍品列表", response = Lot.class, responseContainer = "List<Lot>")
 	@PostMapping("/list")
 //	@RequireRoles({UserType.USER_ROLE_ADMIN})
 	public AjaxResult list(@RequestBody LotVO lot) {
-	    if (lot.getAuctionId()==null)
-	        return AjaxResult.error("拍卖会id不能为空");
+
 		lot.setDelFlag(Constants.DEL_FLAG_NO_DELETE);
-		lot.setAuctionId(lot.getAuctionId());
+
 		List<Lot> lotList = lotService.selectLotList(lot);
 		lotList.forEach(l -> {
 			l.setDelay(StringUtils.isEmpty(l.getDelayPublish()) ? 0 : 1);
@@ -81,9 +82,15 @@ public class LotController extends AdminBaseController {
         if (Objects.isNull(userInfo))
             return AjaxResult.error("请先登录");
         Auction dbAuction = auctionService.selectAuctionById(lot.getAuctionId());
-		if (Objects.equals(Constants.GROUP_STATUS_FINISH, dbAuction.getStatus()))
+		if (System.currentTimeMillis()> dbAuction.getEndTime().getTime())
 			return AjaxResult.error("拍卖会已经结束");
 		//拍品结束时间不能小于拍卖会结束时间
+        //拍品开始时间不能大于拍卖会开始时间
+        if (lot.getStartTime().before(dbAuction.getStartTime())){
+            return AjaxResult.error("拍品开始时间不能小于拍卖会开始时间");
+        }
+        if (dbAuction.getEndTime().after(lot.getEndTime()))
+            return AjaxResult.error("拍品结束时间不能大于拍卖会结束时间");
 		lot.setMerchantId(userInfo.getMerchantId());
 		lot.setMerchantName(userInfo.getMerchantName());
 		lot.setMerchantAvatar(userInfo.getMerchantAvatar());
@@ -103,9 +110,12 @@ public class LotController extends AdminBaseController {
 	@ApiOperation(value = "修改保存拍品", notes = "修改保存拍品", response = AjaxResult.class, responseContainer = "AjaxResult.success")
 	@PostMapping("/edit")
 //	@RequireRoles({UserType.USER_ROLE_ADMIN})
-	public AjaxResult editSave(@RequestBody @Valid LotVO lot) {
+	public AjaxResult editSave(@RequestBody LotVO lot) {
 		Lot dbLot = lotService.selectLotById(lot.getId());
-		lot.setUpdateBy(getUsername());
+		if (dbLot==null)
+		    return AjaxResult.error("请传入拍品id");
+		//todo 用户服务不可用先注释掉
+//		lot.setUpdateBy(getUsername());
 		if (Constants.PUB_STATUS_PUBLISHED.equals(dbLot.getPubStatus())) {
 			lotService.updateLotEx(lot);
 			syncService.syncLot(lot.getId());
@@ -141,7 +151,7 @@ public class LotController extends AdminBaseController {
 		Lot dbLot = lotService.selectLotById(lot.getId());
 		if (Objects.equals(Constants.PUB_STATUS_PUBLISHED, dbLot.getPubStatus()))
 			return AjaxResult.error("拍品已发布不能再次发布");
-		Auction dbAuction = auctionService.selectAuctionById(lot.getAuctionId());
+		Auction dbAuction = auctionService.selectAuctionById(dbLot.getAuctionId());
 		if (Objects.equals(Constants.PUB_STATUS_NO_PUBLISHED, dbAuction.getPubStatus()))
 			return AjaxResult.error("拍卖会还未发布");
 		if (Objects.equals(Constants.GROUP_STATUS_FINISH, dbAuction.getStatus()))
@@ -163,6 +173,8 @@ public class LotController extends AdminBaseController {
 		Lot dbLot = lotService.selectLotById(lot.getId());
 		if (Objects.equals(Constants.PUB_STATUS_NO_PUBLISHED, dbLot.getPubStatus()))
 			return AjaxResult.error("拍品未发布不能撤回");
+		if(!Objects.equals(dbLot.getStatus(),Constants.LOT_STATUS_WAITING))
+		    return AjaxResult.error("拍品已开始竞价,下架失败");
 		dbLot.setUpdateBy(getUsername());
 		lotService.cancelLot(dbLot);
 		return AjaxResult.success();

+ 60 - 0
auc/src/main/java/cn/hobbystocks/auc/web/LotNoticeController.java

@@ -0,0 +1,60 @@
+package cn.hobbystocks.auc.web;
+
+import cn.hobbystocks.auc.common.core.domain.AjaxResult;
+import cn.hobbystocks.auc.domain.LotNotice;
+import cn.hobbystocks.auc.service.LotNoticeService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.Date;
+import java.util.List;
+
+@RestController
+@RequestMapping("/lot/notice/")
+@Api(tags = "拍卖公告管理")
+public class LotNoticeController extends AdminBaseController{
+    @Autowired
+    private LotNoticeService lotNoticeService;
+
+    @PostMapping("/list")
+    @ApiOperation("拍卖公告列表查询")
+    public AjaxResult selectLotNoticeList(@RequestBody LotNotice lotNotice){
+        List<LotNotice> lotNoticeList = lotNoticeService.selectLotNoticeList(lotNotice);
+        return AjaxResult.successPage(lotNoticeList);
+    }
+
+    @PostMapping("/create")
+    @ApiOperation("新建拍卖公告")
+    public AjaxResult createLotNotice(@RequestBody LotNotice lotNotice){
+        lotNotice.setCreateTime(new Date());
+        boolean save = lotNoticeService.save(lotNotice);
+        if (save)
+            return AjaxResult.success();
+        return AjaxResult.error("保存失败");
+    }
+
+    @PostMapping("/edit")
+    @ApiOperation("编辑拍卖公告")
+    public AjaxResult editLotNotice(@RequestBody LotNotice lotNotice){
+        //判断公告是否已发布,如已发布,仅可编辑公告内容
+        int i = lotNoticeService.editLotNotice(lotNotice);
+        if (i>0)
+            return AjaxResult.success();
+        return AjaxResult.error("编辑失败");
+    }
+
+    @PostMapping("pub")
+    @ApiOperation(value = "发布拍卖公告",notes = "status:0、下线;1、上线")
+    public AjaxResult publishLotNotice(@RequestBody LotNotice lotNotice){
+        int i = lotNoticeService.pubLotNotice(lotNotice);
+        if (i>0)
+            return AjaxResult.success();
+        return AjaxResult.error("发布失败");
+    }
+
+}

+ 6 - 1
auc/src/main/resources/application-local.yml

@@ -1,8 +1,10 @@
 spring:
   redis:
+    sentinel:
+      master: poyee-master
     database: 9
     host: ${REDIS_HOST:192.168.50.8}
-    port: ${REDIS_PORT:6379}
+    port: ${REDIS_PORT:26379}
     password: Pass2010    # 密码(默认为空)
     timeout: 60000  # 连接超时时长(毫秒)
     lettuce:
@@ -13,6 +15,9 @@ spring:
         min-idle: 5       # 连接池中的最小空闲连接
 
 hobbystocks:
+  redis:
+    sentinel:
+      nodes: ${SENTINEL_NODES:192.168.50.8:26379}
   host:
     pointUrl: https://m-dev.hobbystocks.net/app/api/local/v1/point/operate
     getSku: https://m-dev.hobbystocks.net/app/api/local/v1/items/sku/

+ 1 - 1
auc/src/main/resources/application.yml

@@ -19,7 +19,7 @@ swagger:
   # 是否开启swagger
   enabled: true
   # 请求前缀
-  pathMapping: /
+  pathMapping: /auc/
 
 # 日志配置
 logging:

+ 1 - 1
bid/src/main/java/cn/hobbystocks/auc/app/AppClient.java

@@ -153,7 +153,7 @@ public class AppClient {
             params.put("type", "amount");
             params.put("amount", soldEvent.getBids().get(0).getAmount());
         } else {
-            params.put("amount", soldEvent.getPoint() * 100);
+            params.put("amount", soldEvent.getAmount() * 100);
             params.put("type", "point");
         }
         params.put("auctionId", soldEvent.getLotId());

+ 2 - 4
bid/src/main/java/cn/hobbystocks/auc/listener/SoldListener.java

@@ -45,13 +45,11 @@ public class SoldListener {
                 return;
             }
             Lot lot = lotMapper.selectLotById(soldEvent.getLotId());
-            if (StringUtils.isEmpty(lot.getOrderId())) {
+
                 if(soldHandlerHolder.handle(soldEvent)) {
                     soldOrderRecordMapper.updateOrder(soldEvent.getOrderId(), soldEvent.getLotId());
                 }
-            }else {
-                log.error("handled sold event {}", soldEvent);
-            }
+
         }catch (Exception e) {
             log.error("handle sold event {}", soldEvent, e);
         }

+ 3 - 3
bid/src/main/java/cn/hobbystocks/auc/task/BidTask.java

@@ -170,7 +170,7 @@ public class BidTask implements CacheMap {
     /**
      * 每5秒检查下订单状态,如订单已过期则更新拍品状态为流拍
      */
-    @Scheduled(fixedRate = 5000)
+    /*@Scheduled(fixedRate = 5000)
     public void expireOrder(){
         //查询所有订单状态,如果订单超时未支付,更新拍品状态为流拍
         List<Order> orderList = orderService.list();
@@ -201,7 +201,7 @@ public class BidTask implements CacheMap {
             }
 
         }
-    }
+    }*/
 
 
 
@@ -337,7 +337,7 @@ public class BidTask implements CacheMap {
         depositOrder.setStatus(1);
         List<DepositOrder> depositOrderList = depositOrderService.selectDepositOrder(depositOrder);
         for (DepositOrder order : depositOrderList) {
-            Long userId = order.getUserId();
+            Integer userId = order.getUserId();
             //判断拍卖会是否已结束
             Auction auction = auctionService.selectAuctionById(order.getAuctionId());
             if (!Constants.GROUP_STATUS_FINISH.equals(auction.getStatus())){

+ 79 - 0
bid/src/main/java/cn/hobbystocks/auc/web/AddressController.java

@@ -0,0 +1,79 @@
+package cn.hobbystocks.auc.web;
+
+import cn.hobbystocks.auc.common.core.controller.BaseController;
+import cn.hobbystocks.auc.common.core.domain.AjaxResult;
+import cn.hobbystocks.auc.dto.ShippingAddressDto;
+import cn.hobbystocks.auc.service.AddressService;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+@RestController
+@RequestMapping("/address")
+@Api(tags = "用户地址管理")
+public class AddressController extends BaseController {
+
+    @Autowired
+    private AddressService addressService;
+
+    @ApiOperation("用户收货地址查询接口")
+    @ResponseBody
+    @PostMapping("/list")
+    public AjaxResult addressList(@RequestBody ShippingAddressDto addressDto){
+        //查询用户收货地址
+        if (addressDto.getUserId()==null){
+            AjaxResult.error("请求参数不能为空");
+        }
+        LambdaQueryWrapper<ShippingAddressDto> lambdaQueryWrapper = new LambdaQueryWrapper<>();
+        lambdaQueryWrapper.eq(ShippingAddressDto::getUserId,addressDto.getUserId());
+        List<ShippingAddressDto> list = addressService.list(lambdaQueryWrapper);
+        return AjaxResult.success(list);
+    }
+
+    @ApiOperation("新增用户收货地址")
+    @ResponseBody
+    @PostMapping("/add")
+    public AjaxResult addUserAddr(@RequestBody ShippingAddressDto shippingAddressDto){
+        boolean save = addressService.save(shippingAddressDto);
+        if (save)
+            return AjaxResult.success();
+        return AjaxResult.error("收货地址新增失败");
+    }
+
+    @ApiOperation("编辑用户收货地址")
+    @ResponseBody
+    @PostMapping("/edit")
+    public AjaxResult editUserAddr(@RequestBody ShippingAddressDto shippingAddressDto){
+        LambdaUpdateWrapper<ShippingAddressDto> updateWrapper = new LambdaUpdateWrapper<>();
+        if (shippingAddressDto.getDefult()){
+            //如果修改默认收货地址,将现有默认地址改为否
+            LambdaUpdateWrapper<ShippingAddressDto> updateWrapper1 = new LambdaUpdateWrapper<>();
+            updateWrapper1.eq(ShippingAddressDto::getDefult,true);
+            updateWrapper1.eq(ShippingAddressDto::getUserId,shippingAddressDto.getUserId());
+            updateWrapper1.set(ShippingAddressDto::getDefult,false);
+            addressService.update(updateWrapper1);
+        }
+        boolean update = addressService.update(shippingAddressDto, updateWrapper.eq(ShippingAddressDto::getId, shippingAddressDto.getId()));
+        if (!update)
+            return AjaxResult.error();
+        return AjaxResult.success();
+    }
+
+    @ApiOperation("删除用户收货地址")
+    @PostMapping("/delete")
+    @ResponseBody
+    public AjaxResult deleteUserAddr(@RequestBody ShippingAddressDto shippingAddressDto){
+        boolean b = addressService.removeById(shippingAddressDto.getId());
+        if (b)
+            return AjaxResult.success();
+        return AjaxResult.error();
+    }
+    //修改订单收货地址
+
+
+}

+ 53 - 0
bid/src/main/java/cn/hobbystocks/auc/web/AuctionController.java

@@ -0,0 +1,53 @@
+package cn.hobbystocks.auc.web;
+
+import cn.hobbystocks.auc.common.core.controller.BaseController;
+import cn.hobbystocks.auc.common.core.domain.AjaxResult;
+import cn.hobbystocks.auc.domain.Auction;
+import cn.hobbystocks.auc.domain.Lot;
+import cn.hobbystocks.auc.service.IAuctionService;
+import cn.hobbystocks.auc.service.ILotService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+/**
+ * 首页拍卖会banner查询
+ */
+@RestController
+@RequestMapping("/auction")
+@Api(tags = "移动端拍卖会")
+public class AuctionController extends BaseController {
+
+    @Autowired
+    private IAuctionService auctionService;
+    @Autowired
+    private ILotService lotService;
+
+    @PostMapping("/banner/list")
+    @ApiOperation("首页banner列表查询")
+    public AjaxResult bannerList(){
+        //查询已发布的拍卖会banner、状态,开始时间
+        List<Auction> list = auctionService.selectBannerList();
+        return AjaxResult.success(list);
+    }
+
+    /**
+     * 根据拍卖会id查询详情
+     * @param auction
+     * @return
+     */
+    @PostMapping("/details")
+    @ApiOperation(value = "拍卖会详情查询",notes = "根据拍卖会id,查询拍品列表")
+    public AjaxResult details(@RequestBody Auction auction){
+        Auction dbAuction = auctionService.selectAuctionById(auction.getId());
+        startPage(auction);
+        List<Lot> lots = lotService.selectLotListByAucId(auction.getId());
+        return AjaxResult.success().put("auction",dbAuction).put("lotList",lots);
+    }
+}

+ 8 - 8
bid/src/main/java/cn/hobbystocks/auc/web/BidingController.java

@@ -307,11 +307,11 @@ public class BidingController extends BaseController {
                 }
             }
             if(Objects.equals(getUserId().toString(), lot.getDealAccountId())){
-                live.getLot().setOrderId(lot.getOrderId());
+//                live.getLot().setOrderId(lot.getOrderId());
             }
             else{
                 if (clone != null) {
-                    clone.setOrderId(null);
+
                     if(isDealAccountAnonymous){
                         clone.setDealAccountavatar(null);
                         clone.setDealAccount(null);
@@ -335,10 +335,10 @@ public class BidingController extends BaseController {
             live.getLot().setDealAccountavatar(userInfo.getAvatar());
         }
         if(Objects.equals(getUserId().toString(), lot.getDealAccountId())){
-            live.getLot().setOrderId(lot.getOrderId());
+//            live.getLot().setOrderId(lot.getOrderId());
         }
         else{
-            live.getLot().setOrderId(null);
+//            live.getLot().setOrderId(null);
             if(isDealAccountAnonymous){
                 live.getLot().setDealAccountavatar(null);
                 live.getLot().setDealAccount(null);
@@ -392,11 +392,11 @@ public class BidingController extends BaseController {
                 }
             }
             if(Objects.equals(getUserId().toString(), lot.getDealAccountId())){
-                live.getLot().setOrderId(lot.getOrderId());
+//                live.getLot().setOrderId(lot.getOrderId());
             }
             else{
                 if (clone != null) {
-                    clone.setOrderId(null);
+//                    clone.setOrderId(null);
                     if(isDealAccountAnonymous){
                         clone.setDealAccountavatar(null);
                         clone.setDealAccount(null);
@@ -421,10 +421,10 @@ public class BidingController extends BaseController {
             live.getLot().setDealAccountavatar(userInfo.getAvatar());
         }
         if(Objects.equals(getUserId().toString(), lot.getDealAccountId())){
-            live.getLot().setOrderId(lot.getOrderId());
+//            live.getLot().setOrderId(lot.getOrderId());
         }
         else{
-            live.getLot().setOrderId(null);
+//            live.getLot().setOrderId(null);
             if(isDealAccountAnonymous){
                 live.getLot().setDealAccountavatar(null);
                 live.getLot().setDealAccount(null);

+ 31 - 6
bid/src/main/java/cn/hobbystocks/auc/web/DepositOrderController.java

@@ -3,18 +3,20 @@ package cn.hobbystocks.auc.web;
 import cn.hobbystocks.auc.common.core.domain.AjaxResult;
 import cn.hobbystocks.auc.common.user.UserInfo;
 import cn.hobbystocks.auc.common.user.UserUtils;
+import cn.hobbystocks.auc.common.utils.PageUtils;
+import cn.hobbystocks.auc.domain.DepositOrder;
 import cn.hobbystocks.auc.dto.DepositOrderDTO;
 import cn.hobbystocks.auc.service.DepositOrderService;
 import cn.hobbystocks.auc.service.IOrderService;
 import cn.hobbystocks.auc.vo.OrderVO;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 
+import java.util.List;
 import java.util.Objects;
 
 /**
@@ -33,13 +35,36 @@ public class DepositOrderController {
     //创建保证金订单接口
     @PostMapping("/deposit/create")
     @ApiOperation(value = "创建保证金订单接口",notes = "")
-    public AjaxResult createDepositOrder(DepositOrderDTO depositOrderDTO){
+    @ResponseBody
+    public AjaxResult createDepositOrder(@RequestBody DepositOrderDTO depositOrderDTO){
         UserInfo simpleUserInfo = UserUtils.getSimpleUserInfo();
         if (Objects.isNull(simpleUserInfo))
             return AjaxResult.error("请先登录");
         //todo 判断是否已经缴纳保证金,需要查询订单记录,
-        depositOrderDTO.setUserId(Long.valueOf(simpleUserInfo.getId()));
-        OrderVO depositOrder = orderService.createDepositOrder(depositOrderDTO);
+        depositOrderDTO.setUserId(simpleUserInfo.getId());
+        orderService.createDepositOrder(depositOrderDTO);
         return AjaxResult.success();
     }
+
+    //我的保证金订单
+    @PostMapping("/deposit/list")
+    @ResponseBody
+    @ApiOperation(value = "保证金订单查询",notes = "根据保证金订单状态分页查询保证金信息;")
+    public AjaxResult depositOrderList(@RequestBody DepositOrderDTO depositOrderDTO){
+
+        UserInfo simpleUserInfo = UserUtils.getSimpleUserInfo();
+        if (simpleUserInfo==null)
+            return AjaxResult.error("请先登录");
+        Integer userId = simpleUserInfo.getId();
+        //根据userId 查询保证金信息
+        LambdaQueryWrapper<DepositOrder> depositOrderLambdaQueryWrapper = new LambdaQueryWrapper<>();
+        depositOrderLambdaQueryWrapper.eq(DepositOrder::getUserId,userId);
+        Integer status = depositOrderDTO.getStatus();
+        if (status!=null){
+            depositOrderLambdaQueryWrapper.eq(DepositOrder::getStatus,status);
+        }
+        PageUtils.startPage(depositOrderDTO);
+        List<DepositOrder> list = orderService.list(depositOrderLambdaQueryWrapper);
+        return AjaxResult.success(list);
+    }
 }

+ 6 - 3
bid/src/main/java/cn/hobbystocks/auc/web/LocalController.java

@@ -10,6 +10,7 @@ import cn.hobbystocks.auc.dto.LotDTO;
 import cn.hobbystocks.auc.handle.context.tradition.TraditionRule;
 import cn.hobbystocks.auc.service.IBidService;
 import cn.hobbystocks.auc.service.ILotService;
+import cn.hobbystocks.auc.service.IOrderService;
 import cn.hobbystocks.auc.vo.LotGroupDTO;
 import cn.hobbystocks.auc.vo.LotGroupVO;
 import com.alibaba.fastjson.JSON;
@@ -35,6 +36,8 @@ public class LocalController {
     private ILotService lotService;
     @Autowired
     private IBidService bidService;
+    @Autowired
+    private IOrderService orderService;
 
     @ApiOperation(value = "查询拍品是否正在竞拍",notes = "检查拍品ID数组的拍卖是否正在进行")
     @PostMapping("/lot/status")
@@ -62,13 +65,13 @@ public class LocalController {
     @ApiImplicitParams({
         @ApiImplicitParam(name = "orderNo",value = "订单号"),@ApiImplicitParam(name = "status" ,value = "订单状态")
     })
-    public AjaxResult callback(@PathVariable("orderNo") String orderNo,@PathVariable("status") Long status){
+    public AjaxResult callback(@PathVariable("orderNo") String orderNo,@PathVariable("status") Integer status){
         //根据orderId更新order状态
         Order order = Order.builder().orderNo(orderNo).status(status).build();
-        /*int num = orderStatusService.modifyOrder(order);
+        int num = orderService.modifyOrder(order);
         if (num>0){
             return AjaxResult.success("请求成功");
-        }*/
+        }
         return AjaxResult.error("更新状态失败");
     }
     @ApiOperation(value = "出价记录查询",notes = "根据出价id查询当前出价是否中标")

+ 52 - 0
bid/src/main/java/cn/hobbystocks/auc/web/LotController.java

@@ -0,0 +1,52 @@
+package cn.hobbystocks.auc.web;
+
+import cn.hobbystocks.auc.common.core.controller.BaseController;
+import cn.hobbystocks.auc.common.core.domain.AjaxResult;
+import cn.hobbystocks.auc.domain.Lot;
+import cn.hobbystocks.auc.service.ILotService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+@Api(tags = "移动端拍品查询")
+@RequestMapping("/lot")
+@RestController
+public class LotController extends BaseController {
+
+    @Autowired
+    ILotService lotService;
+    /**
+     * 热门拍品查询:查询正在竞拍中的拍品
+     */
+    @PostMapping("/hot/list")
+    @ApiOperation("热门拍品")
+    public AjaxResult hotLot(@RequestBody Lot lot){
+        if (lot.getPageSize()==null)
+            lot.setPageSize(20);//默认20条数据
+        startPage(lot);
+        //查询正在竞价中的拍品,按开始时间排序
+        // todo 按计算的热度值排序;
+        List<Lot> lots = lotService.selectBiddingLotList();
+        return AjaxResult.success(lots);
+    }
+
+    /**
+     * 根据分类查询拍品
+     */
+    @PostMapping("/list/search")
+    @ApiOperation("资产-珍品搜索查询")
+    public AjaxResult searchLotList(@RequestBody Lot lot){
+        /*
+         * 查询拍品,关键字模糊匹配拍品名称
+         */
+        startPage(lot);
+        List<Lot> lots = lotService.queryLotByCategory(lot);
+        return AjaxResult.success(lots);
+    }
+}

+ 35 - 0
bid/src/main/java/cn/hobbystocks/auc/web/LotNoticeController.java

@@ -0,0 +1,35 @@
+package cn.hobbystocks.auc.web;
+
+import cn.hobbystocks.auc.common.core.domain.AjaxResult;
+import cn.hobbystocks.auc.domain.LotNotice;
+import cn.hobbystocks.auc.service.LotNoticeService;
+import cn.hobbystocks.auc.vo.LotNoticeVO;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+@RestController
+@Api(tags = "拍卖公告")
+@RequestMapping("/lot/notice")
+public class LotNoticeController {
+
+    @Autowired
+    LotNoticeService lotNoticeService;
+
+    @PostMapping("/list")
+    @ApiOperation(value = "拍卖公告查询",notes = "根据拍卖类型分页查询拍卖公告")
+    public AjaxResult getNoticeByType(@RequestBody LotNotice lotNotice){
+        Page<LotNoticeVO> lotNoticePage = lotNoticeService.selectLotNoticeByType(lotNotice);
+        return AjaxResult.success(lotNoticePage);
+    }
+
+    @GetMapping("detail/{id}")
+    @ApiOperation(value = "拍卖公告详情")
+    public AjaxResult getNoticeDetail(@PathVariable("id") Long id){
+        LotNotice lotNotice = lotNoticeService.getById(id);
+        return AjaxResult.success(lotNotice);
+    }
+
+}

+ 5 - 0
bid/src/main/resources/application-local.yml

@@ -11,8 +11,13 @@ spring:
         max-wait: -1ms    # 连接池最大阻塞等待时间(使用负值表示没有限制)
         max-idle: 10      # 连接池中的最大空闲连接
         min-idle: 5       # 连接池中的最小空闲连接
+    sentinel:
+      master: poyee-master
 
 hobbystocks:
+  redis:
+    sentinel:
+      nodes: ${SENTINEL_NODES:192.168.50.8:26379}
   host:
     pointUrl: http://app/api/local/v1/point/operate
     orderUrl: http://order/api/local/v1/order/auction/submit

+ 1 - 0
bid/src/main/resources/logback-spring.xml

@@ -41,6 +41,7 @@
 
     <!-- Spring日志级别控制  -->
     <logger name="org.springframework" level="warn" />
+<!--    <logger name="cn.hobbystocks.auc.mapper" level="debug"/>-->
     <!--系统操作日志-->
     <root level="info">
         <if condition='p("logging.console.enabled").equals("true")'>

+ 3 - 2
lot/src/main/java/cn/hobbystocks/auc/common/constant/Constants.java

@@ -46,11 +46,12 @@ public class Constants {
     // 拍卖会
     public static final String REDIS_AUC_PREFIX = "MAP:AUC:PUB:*";
 
-    // 传统拍 + 延迟拍
+    // 标准延时
     public static final String AUC_RULE_TYPE_TRADITIONAL_DELAY = "traditional_delay";
 
-    // 传统拍 + 延迟拍 + v2
+    // 重置延时
     public static final String AUC_RULE_TYPE_TRADITIONAL_DELAY_V2 = "traditional_delay_v2";
+    //增价拍卖
     public static final String AUC_RULE_TYPE_TRADITIONAL_DELAY_V3 = "traditional_delay_v3";
 
 	//拍品状态未开始

+ 22 - 0
lot/src/main/java/cn/hobbystocks/auc/domain/Auction.java

@@ -8,6 +8,8 @@ import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
 import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.ToString;
@@ -16,6 +18,7 @@ import lombok.ToString;
 @Data
 @ToString
 @TableName("auction")
+@ApiModel("拍卖会")
 public class Auction extends BaseEntity {
     private static final long serialVersionUID = 1L;
     //拍卖会id
@@ -24,47 +27,66 @@ public class Auction extends BaseEntity {
     private Long id;
 //拍卖会名称
     @TableField("name")
+    @ApiModelProperty("拍卖会名称")
     private String name;
 //拍卖会种类:1、标准拍卖;2、直播拍卖;3、混合拍卖
     @TableField("type")
+    @ApiModelProperty("拍卖会种类:1、标准拍卖;2、直播拍卖;3、混合拍卖")
     private Integer type;
 //拍卖会封面
     @TableField("imgs")
+    @ApiModelProperty("拍卖会封面")
     private String imgs;
 //拍卖会banner
     @TableField("banner")
+    @ApiModelProperty("拍卖会banner")
     private String banner;
 //    保证金(元)
     @TableField("deposit")
+    @ApiModelProperty("保证金(元)")
     private Long deposit;
 //    服务费(%)
     @TableField("service_tariff")
+    @ApiModelProperty("服务费(%)")
     private BigDecimal serviceTariff;
 //    中拍支付时限(天)
     @TableField("pay_time_limit")
+    @ApiModelProperty("中拍支付时限(天)")
     private Integer payTimeLimit;
 //    拍卖会介绍
     @TableField("description")
+    @ApiModelProperty("拍卖会介绍")
     private String description;
     @TableField("pub_status")
+    @ApiModelProperty("发布状态:1、发布,2、下架")
     private Integer pubStatus;
     @TableField("pub_time")
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @ApiModelProperty("发布时间")
     private Date pubTime;
     @TableField("status")
+    @ApiModelProperty("拍卖会状态:Waiting 未开始,Starting:进行中,Finished:已结束")
     private String status;
 //拍卖会开始时间
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     @TableField("start_time")
+    @ApiModelProperty("拍卖会开始时间")
     private Date startTime;
     //拍卖会结束时间
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     @TableField("end_time")
+    @ApiModelProperty("拍卖会结束时间")
     private Date endTime;
     @TableField("del_flag")
     private Integer delFlag;
     //商家id
+    @ApiModelProperty("商家id")
+    @TableField("merchant_id")
     private Long merchantId;
+    @ApiModelProperty("拍品数量")
+    @TableField(exist = false)
+    private Long lotNum;
     //排序
+    @ApiModelProperty("排序,值越大排名越靠前")
     private Integer sort;
 }

+ 5 - 3
lot/src/main/java/cn/hobbystocks/auc/domain/DepositOrder.java

@@ -1,16 +1,18 @@
 package cn.hobbystocks.auc.domain;
 
+import cn.hobbystocks.auc.common.core.domain.BaseEntity;
+import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
 import lombok.Data;
 
 @TableName("deposit_order_record")
 @Data
-public class DepositOrder {
-    @TableId
+public class DepositOrder extends BaseEntity {
+    @TableId(type = IdType.AUTO)
     private Long id;
 
-    private Long userId;
+    private Integer userId;
     private Long lotId;
     private Long auctionId;
     private String name;

+ 55 - 12
lot/src/main/java/cn/hobbystocks/auc/domain/Lot.java

@@ -9,8 +9,13 @@ import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableName;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import cn.hobbystocks.auc.common.core.domain.BaseEntity;
+import com.fasterxml.jackson.databind.JsonNode;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
 import lombok.*;
 import nonapi.io.github.classgraph.json.Id;
+import org.apache.ibatis.type.Alias;
 
 import javax.validation.constraints.NotBlank;
 
@@ -20,6 +25,8 @@ import javax.validation.constraints.NotBlank;
 @AllArgsConstructor
 @NoArgsConstructor
 @TableName("lot")
+@ApiModel("拍品")
+@Alias("lot")
 public class Lot extends BaseEntity
 {
     private static final long serialVersionUID = 1L;
@@ -29,134 +36,170 @@ public class Lot extends BaseEntity
 
     /** 商品ID */
     @NotBlank(message = "goodsId is empty")
+    @ApiModelProperty("商品id")
     private String goodsId;
-
+    @ApiModelProperty("商品名称")
     private String goodsName;
 
-    @NotBlank(message = "goodsType is empty")
+    @ApiModelProperty("商品类型:默认sku")
     private String goodsType;
 
     /** 拍卖会ID */
+    @ApiModelProperty("拍卖会id")
     private Long auctionId;
 
     /** 拍品名称 */
+    @ApiModelProperty("拍品名称")
     private String name;
-
+    @ApiModelProperty("商家id")
     private Long merchantId;
-
+    @ApiModelProperty("商家名称")
     private String merchantName;
-
+    @ApiModelProperty("商家头像")
     private String merchantAvatar;
 
     /** 拍品数量 */
+    @ApiModelProperty("拍品数量")
     private Long num;
 
     /** 数量单位 */
+    @ApiModelProperty("数量单位")
     private String unit;
 
     /** 拍品图片 */
+    @ApiModelProperty("拍品图片")
     private String imgs;
 
     /** 轮播图片 */
+    @ApiModelProperty("轮播图片")
     private String carouselImgs;
 
     /** 拍品介绍 */
+    @ApiModelProperty("拍品介绍")
     private String detail;
 
     /** 是否发布(0:未发布;1:已发布) */
+    @ApiModelProperty("是否发布(0:未发布;1:已发布)")
     private Integer pubStatus;
 
     /** 发布时间 */
+    @ApiModelProperty("发布时间")
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     @View(type = 1)
     private Date pubTime;
 
     /** 拍卖状态(Waiting:未开始;Starting:开启中;Bidding:进行中;Finished:拍卖结束;Cancelled:撤拍;Pass:流拍;Sold:成交) */
+    @ApiModelProperty("拍卖状态(Waiting:未开始;Starting:开启中;Bidding:进行中;Finished:拍卖结束;Cancelled:撤拍;Pass:流拍;Sold:成交)")
     private String status;
 
     /** 拍卖开始时间 */
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @ApiModelProperty("拍卖开始时间")
     private Date startTime;
 
     /** 拍卖结束时间 */
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @ApiModelProperty("拍卖结束时间")
     private Date endTime;
 
     /** 实际结束时间 */
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @ApiModelProperty("实际结束时间")
     private Date realEndTime;
 
     /** 规则类型 */
+    @ApiModelProperty("规则类型:traditional_delay;标准延时,traditional_delay_v2:重置延时,traditional_delay_v3:增价拍卖")
     private String ruleType;
 
     /** 规则内容 */
     @View(type = 1)
+    @ApiModelProperty("规则内容")
     private String ruleContent;
 
     /** 最新出价 */
+    @ApiModelProperty("最新出价")
     private BigDecimal lastPrice;
 
     /** 最新出价时间 */
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @ApiModelProperty("最新出价时间")
     private Date lastPriceTime;
 
     /** 成交价 */
+    @ApiModelProperty("成交价")
     private BigDecimal dealPrice;
 
     /** 成交时间 */
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @ApiModelProperty("成交时间")
     private Date dealTime;
 
     /** 成交用户id */
+    @ApiModelProperty("成交用户id")
     private String dealAccountId;
 
     /** 成交用户 */
     @Sensitive(type = 1)
+    @ApiModelProperty("成交用户")
     private String dealAccount;
 
     /** 成交用户avatar */
+    @ApiModelProperty("成交用户avatar")
     private String dealAccountavatar;
 
     /** 已支付 */
+    @ApiModelProperty("已支付")
     private Long paid;
 
-    /** 订单id */
-    private String orderId;
+
 
     /** 出价次数 */
+    @ApiModelProperty("出价次数")
     private Long bidCount;
 
     /** 出价人数 */
+    @ApiModelProperty("出价人数")
     private Long bidPersionCount;
 
     /** 0:未删除;1:已删除 */
+    @ApiModelProperty("删除标识:0:未删除;1:已删除")
     private Integer delFlag;
 
     /** 排序 */
+    @ApiModelProperty("排序")
     private Integer sort;
 
     /** 是否是私域 0 不是  1 是 */
+    @ApiModelProperty("是否是私域 0 不是  1 是")
     private Integer privateDomain;
 
     private String delayPublish;
-
+    @ApiModelProperty("是否自动续期:0、否,1、是")
     private Integer delay;
-
+    @ApiModelProperty("")
     private BigDecimal manualReturnPoint;
-
+    @ApiModelProperty("")
     private Long groupId;
 
-
+    @ApiModelProperty("是否匿名:")
     private Integer anonymous;
 
 
     private Long lotFansId;
     //    保证金(元)
     @TableField("deposit")
+    @ApiModelProperty("保证金(元)")
     private Long deposit;
     //    服务费(%)
     @TableField("service_tariff")
+    @ApiModelProperty("服务费(%)")
     private BigDecimal serviceTariff;
-
+    @ApiModelProperty("中拍支付时限(小时)")
     private Integer payTimeLimit;
+    @ApiModelProperty("拍品分类:如资产类、收藏类")
+    private String category;
+    @ApiModelProperty("拍品子分类")
+    private String subCategory;
+    @ApiModelProperty("拍品属性json")
+    private JsonNode properties;
 }

+ 2 - 0
lot/src/main/java/cn/hobbystocks/auc/domain/LotFans.java

@@ -1,6 +1,7 @@
 package cn.hobbystocks.auc.domain;
 
 import cn.hobbystocks.auc.common.core.domain.BaseEntity;
+import com.baomidou.mybatisplus.annotation.TableName;
 import lombok.*;
 
 import java.util.Date;
@@ -10,6 +11,7 @@ import java.util.Date;
 @AllArgsConstructor
 @NoArgsConstructor
 @Builder
+@TableName("lot_fans")
 public class LotFans extends BaseEntity
 {
     private static final long serialVersionUID = 1L;

+ 39 - 0
lot/src/main/java/cn/hobbystocks/auc/domain/LotNotice.java

@@ -0,0 +1,39 @@
+package cn.hobbystocks.auc.domain;
+
+import cn.hobbystocks.auc.common.core.domain.BaseEntity;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * 拍卖公告
+ */
+@Data
+@TableName("lot_notice")
+@ApiModel("拍卖公告")
+public class LotNotice extends BaseEntity {
+
+    @TableId(value = "id",type = IdType.AUTO)
+    @ApiModelProperty("公告id")
+    private Long id;
+    @ApiModelProperty("公告标题")
+    private String title;
+    @ApiModelProperty("公告内容")
+    private String content;
+    @ApiModelProperty("公告类型")
+    private String type;
+    @ApiModelProperty("公告状态")
+    private Integer status;
+    @ApiModelProperty("创建时间")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date createTime;
+    @ApiModelProperty("发布时间")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date pubTime;
+}

+ 1 - 1
lot/src/main/java/cn/hobbystocks/auc/domain/Order.java

@@ -26,7 +26,7 @@ public class Order {
     private Long skuId;
     private String orderNo;
     //支付状态:
-    private Long status;
+    private Integer status;
     private Date expireTime;
     private Integer flag;
 }

+ 17 - 3
lot/src/main/java/cn/hobbystocks/auc/dto/DepositOrderDTO.java

@@ -1,24 +1,38 @@
 package cn.hobbystocks.auc.dto;
 
+import cn.hobbystocks.auc.common.core.domain.BaseEntity;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
+import lombok.EqualsAndHashCode;
 
 /**
  * 保证金订单
  */
+@EqualsAndHashCode(callSuper = true)
 @Data
-public class DepositOrderDTO {
+@ApiModel("保证金订单")
+public class DepositOrderDTO extends BaseEntity {
     //用户id
-    private Long userId;
+    @ApiModelProperty("用户id")
+    private Integer userId;
     //拍卖会id
+    @ApiModelProperty("拍卖会id")
     private Long auctionId;
     //保证金名称
+    @ApiModelProperty("保证金名称")
     private String name;
     //保证金类型
+    @ApiModelProperty("保证金类型")
     private String depositType;
-
+    @ApiModelProperty("拍品id")
     private Long lotId;
     //保证金金额
+    @ApiModelProperty("保证金金额")
     private Long amount;
     //商家id
+    @ApiModelProperty("商家id")
     private Long merchantId;
+    @ApiModelProperty("保证金订单状态:0、待支付,1、已支付待退款,2、已退款,3、已扣款")
+    private Integer status;
 }

+ 66 - 0
lot/src/main/java/cn/hobbystocks/auc/dto/ShippingAddressDto.java

@@ -0,0 +1,66 @@
+package cn.hobbystocks.auc.dto;
+
+import cn.hobbystocks.auc.common.core.domain.BaseEntity;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.ToString;
+
+import java.io.Serializable;
+
+/**
+ * 收货地址
+ */
+@Data
+@ToString
+@TableName("tzy_shipping_address")
+@ApiModel("用户收货地址")
+public class ShippingAddressDto extends BaseEntity implements Serializable {
+
+    private static final long serializableUID = 1L;
+    //id
+    @TableId(type = IdType.AUTO)
+    @ApiModelProperty("收货地址id")
+    private Integer id;
+    //用户id
+    @TableField("user_id")
+    @ApiModelProperty("用户id")
+    private Integer userId;
+    //收货地址
+    @ApiModelProperty("收货地址")
+    @TableField("address")
+    private String address;
+    //详细地址
+    @TableField("address_more")
+    @ApiModelProperty("详细地址")
+    private String addressMore;
+    //联系人
+    @TableField("linkname")
+    @ApiModelProperty("联系人")
+    private String linkname;
+    //联系方式
+    @TableField("phone")
+    @ApiModelProperty("联系电话")
+    private String phone;
+    //是否默认地址
+    @TableField("defult")
+    @ApiModelProperty("是否默认地址")
+    private Boolean defult;
+
+    @TableField("province")
+    @ApiModelProperty("省份")
+    private String province;
+    @ApiModelProperty("区/市")
+    @TableField("city")
+    private String city;
+    @TableField("county")
+    @ApiModelProperty("县")
+    private String county;
+
+
+
+}

+ 10 - 0
lot/src/main/java/cn/hobbystocks/auc/mapper/AddressMapper.java

@@ -0,0 +1,10 @@
+package cn.hobbystocks.auc.mapper;
+
+
+import cn.hobbystocks.auc.dto.ShippingAddressDto;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+public interface AddressMapper extends BaseMapper<ShippingAddressDto> {
+
+
+}

+ 2 - 0
lot/src/main/java/cn/hobbystocks/auc/mapper/AuctionMapper.java

@@ -34,4 +34,6 @@ public interface AuctionMapper extends BaseMapper<Auction> {
 
     List<Auction> selectActiveAuction();
 
+    List<Auction> selectAucBannerList();
+
 }

+ 2 - 1
lot/src/main/java/cn/hobbystocks/auc/mapper/LotFansMapper.java

@@ -2,11 +2,12 @@ package cn.hobbystocks.auc.mapper;
 
 
 import cn.hobbystocks.auc.domain.LotFans;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
 
-public interface LotFansMapper {
+public interface LotFansMapper extends BaseMapper<LotFans> {
 
     public LotFans selectLotFansById(Long id);
 

+ 5 - 1
lot/src/main/java/cn/hobbystocks/auc/mapper/LotMapper.java

@@ -27,7 +27,7 @@ public interface LotMapper extends BaseMapper<Lot> {
 
     int deleteLotByIds(Long[] ids);
 
-    int updateOrder(@Param("lotId") Long lotId, @Param("orderId") String orderId);
+
 
     int updateLotEx(Lot lot);
 
@@ -56,4 +56,8 @@ public interface LotMapper extends BaseMapper<Lot> {
      */
     List<Lot> selectNotEndLotList(Long auctionId);
 
+    List<Lot> selectBiddingLotList();
+
+    List<Lot> queryLotListByCategory(Lot lot);
+
 }

+ 17 - 0
lot/src/main/java/cn/hobbystocks/auc/mapper/LotNoticeMapper.java

@@ -0,0 +1,17 @@
+package cn.hobbystocks.auc.mapper;
+
+import cn.hobbystocks.auc.domain.LotNotice;
+import cn.hobbystocks.auc.vo.LotNoticeVO;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import org.apache.ibatis.annotations.Param;
+
+public interface LotNoticeMapper extends BaseMapper<LotNotice> {
+
+    //根据分类查询拍卖公告列表
+    Page<LotNoticeVO>  selectNoticeByType(Page<LotNoticeVO> page, @Param("type") String type);
+
+
+
+
+}

+ 1 - 1
lot/src/main/java/cn/hobbystocks/auc/mapper/OrderMapper.java

@@ -19,5 +19,5 @@ public interface OrderMapper extends BaseMapper<Order> {
     List<Order> selectOrderInfoList(Order order);
 
     //查询用户在指定拍卖会下的未设置单独保证金的未支付拍品订单
-    List<Order> selectOrderByAuctionId(@Param("auctionId")Long auctionId,@Param("userId")Long userId);
+    List<Order> selectOrderByAuctionId(@Param("auctionId")Long auctionId,@Param("userId")Integer userId);
 }

+ 63 - 0
lot/src/main/java/cn/hobbystocks/auc/mapper/handler/JsonNodeTypeHandler.java

@@ -0,0 +1,63 @@
+package cn.hobbystocks.auc.mapper.handler;
+
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import org.apache.ibatis.type.BaseTypeHandler;
+import org.apache.ibatis.type.JdbcType;
+import org.apache.ibatis.type.MappedTypes;
+
+import java.sql.CallableStatement;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+
+@MappedTypes(JsonNode.class)
+public class JsonNodeTypeHandler extends BaseTypeHandler<JsonNode> {
+
+    private static final ObjectMapper objectMapper = new ObjectMapper();
+
+    @Override
+    public void setNonNullParameter(PreparedStatement ps, int i, JsonNode parameter, JdbcType jdbcType)
+            throws SQLException {
+        ps.setString(i, parameter.toString());
+    }
+
+    @Override
+    public JsonNode getNullableResult(ResultSet rs, String columnName) throws SQLException {
+        String json = rs.getString(columnName);
+        if (json != null) {
+            try {
+                return objectMapper.readTree(json);
+            } catch (Exception e) {
+                throw new SQLException("Error parsing JSON", e);
+            }
+        }
+        return null;
+    }
+
+    @Override
+    public JsonNode getNullableResult(ResultSet rs, int columnIndex) throws SQLException {
+        String json = rs.getString(columnIndex);
+        if (json != null) {
+            try {
+                return objectMapper.readTree(json);
+            } catch (Exception e) {
+                throw new SQLException("Error parsing JSON", e);
+            }
+        }
+        return null;
+    }
+
+    @Override
+    public JsonNode getNullableResult(CallableStatement cs, int columnIndex) throws SQLException {
+        String json = cs.getString(columnIndex);
+        if (json != null) {
+            try {
+                return objectMapper.readTree(json);
+            } catch (Exception e) {
+                throw new SQLException("Error parsing JSON", e);
+            }
+        }
+        return null;
+    }
+}

+ 7 - 0
lot/src/main/java/cn/hobbystocks/auc/service/AddressService.java

@@ -0,0 +1,7 @@
+package cn.hobbystocks.auc.service;
+
+import cn.hobbystocks.auc.dto.ShippingAddressDto;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+public interface AddressService extends IService<ShippingAddressDto> {
+}

+ 1 - 1
lot/src/main/java/cn/hobbystocks/auc/service/DepositOrderService.java

@@ -12,7 +12,7 @@ import java.util.List;
  */
 public interface DepositOrderService extends IService<DepositOrder> {
 
-    OrderVO createDepositOrder(DepositOrderDTO depositOrderDTO);
+    int createDepositOrder(DepositOrderDTO depositOrderDTO);
 
     /**
      * 保证金订单退款

+ 3 - 1
lot/src/main/java/cn/hobbystocks/auc/service/IAuctionService.java

@@ -22,10 +22,12 @@ public interface IAuctionService extends IService<Auction>
 
     int deleteAuctionById(Long id);
 
-    void pubAuction(AuctionVO auction) throws Exception;
+    boolean pubAuction(AuctionVO auction) throws Exception;
 
     void auctionLive();
 
     List<Auction> live();
 
+    List<Auction> selectBannerList();
+
 }

+ 2 - 1
lot/src/main/java/cn/hobbystocks/auc/service/ILotFansService.java

@@ -3,10 +3,11 @@ package cn.hobbystocks.auc.service;
 
 import cn.hobbystocks.auc.domain.LotFans;
 import cn.hobbystocks.auc.vo.FansVO;
+import com.baomidou.mybatisplus.extension.service.IService;
 
 import java.util.List;
 
-public interface ILotFansService {
+public interface ILotFansService extends IService<LotFans> {
     public LotFans selectLotFansById(Long id);
 
     public List<LotFans> selectLotFansList(LotFans lotFans);

+ 11 - 0
lot/src/main/java/cn/hobbystocks/auc/service/ILotService.java

@@ -17,6 +17,8 @@ public interface ILotService extends IService<Lot> {
 
     List<Lot> selectLotList(Lot lot);
 
+    List<Lot> selectBiddingLotByAucId(Long aucId);
+
     /**
      * 根据拍品组id数组查询拍品列表
      * @param groupIds 拍品组id数组
@@ -104,5 +106,14 @@ public interface ILotService extends IService<Lot> {
 
     void updateSoldAndPaid(LotFans fans, Long groupId);
 
+    List<Lot> selectLotListByAucId(Long aucId);
+
+    /**
+     * 计算并更新拍品热度
+     */
+    void calculatorAndUpdateLotHot();
+
+    List<Lot> selectBiddingLotList();
 
+    List<Lot> queryLotByCategory(Lot lot);
 }

+ 1 - 1
lot/src/main/java/cn/hobbystocks/auc/service/IOrderService.java

@@ -20,7 +20,7 @@ public interface IOrderService extends IService<Order> {
      * @param userId
      * @return
      */
-    List<Order> getOrderListByUserAndAuction(Long auctionId,Long userId);
+    List<Order> getOrderListByUserAndAuction(Long auctionId,Integer userId);
 
 
 

+ 33 - 0
lot/src/main/java/cn/hobbystocks/auc/service/LotNoticeService.java

@@ -0,0 +1,33 @@
+package cn.hobbystocks.auc.service;
+
+import cn.hobbystocks.auc.domain.LotNotice;
+import cn.hobbystocks.auc.vo.LotNoticeVO;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+import java.util.List;
+
+public interface LotNoticeService extends IService<LotNotice> {
+
+
+    /**
+     * 查询拍卖公告列表
+     * @param lotNotice
+     * @return
+     */
+    List<LotNotice> selectLotNoticeList(LotNotice lotNotice);
+
+    /**
+     * 编辑拍卖公告
+     * @param lotNotice
+     * @return
+     */
+    int editLotNotice(LotNotice lotNotice);
+
+    /**
+     *上线下线
+     */
+    int pubLotNotice(LotNotice lotNotice);
+
+    Page<LotNoticeVO> selectLotNoticeByType(LotNotice lotNotice);
+}

+ 12 - 0
lot/src/main/java/cn/hobbystocks/auc/service/impl/AddressServiceImpl.java

@@ -0,0 +1,12 @@
+package cn.hobbystocks.auc.service.impl;
+
+import cn.hobbystocks.auc.dto.ShippingAddressDto;
+import cn.hobbystocks.auc.mapper.AddressMapper;
+
+import cn.hobbystocks.auc.service.AddressService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+@Service
+public class AddressServiceImpl extends ServiceImpl<AddressMapper, ShippingAddressDto> implements AddressService {
+}

+ 15 - 3
lot/src/main/java/cn/hobbystocks/auc/service/impl/AuctionServiceImpl.java

@@ -1,6 +1,7 @@
 package cn.hobbystocks.auc.service.impl;
 
 import cn.hobbystocks.auc.cache.CacheMap;
+import cn.hobbystocks.auc.domain.Lot;
 import cn.hobbystocks.auc.service.ILotService;
 import cn.hobbystocks.auc.common.constant.Constants;
 import cn.hobbystocks.auc.common.core.redis.RedisCache;
@@ -22,6 +23,7 @@ import org.springframework.transaction.TransactionStatus;
 import org.springframework.transaction.annotation.Isolation;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.transaction.support.DefaultTransactionDefinition;
+import org.springframework.util.CollectionUtils;
 
 import javax.annotation.Resource;
 import java.util.Date;
@@ -85,21 +87,26 @@ public class AuctionServiceImpl extends ServiceImpl<AuctionMapper,Auction> imple
 
     @Override
     @Transactional(isolation = Isolation.READ_COMMITTED, rollbackFor = Exception.class)
-    public void pubAuction(AuctionVO auction) {
+    public boolean pubAuction(AuctionVO auction) {
         if (Objects.equals(Constants.PUB_STATUS_PUBLISHED, auction.getPubStatus())) {
             auction.setPubTime(new Date());
             auction.setStatus(Constants.LOT_STATUS_WAITING);
             Auction db = getBaseMapper().selectAuctionById(auction.getId());
             redisCache.setCacheObject(String.format(Constants.REDIS_AUC_TEMPLATE, auction.getId()), db);
         }else if (Objects.equals(Constants.PUB_STATUS_CANCEL_PUBLISHED, auction.getPubStatus())){
+            //判断是否有正在竞拍的拍品,如果有,下架失败
+            List<Lot> lots = lotService.selectBiddingLotByAucId(auction.getId());
+            if (!CollectionUtils.isEmpty(lots))
+                return false;
             auction.setUpdateTime(new Date());
             auction.setStatus(Constants.LOT_STATUS_CANCELLED);
             redisCache.deleteObject(String.format(Constants.REDIS_AUC_TEMPLATE, auction.getId()));
         }
         getBaseMapper().updateAuction(auction);
-        if (auction.getPubLots()) {
+        /*if (auction.getPubLots()) {
             lotService.pubLots(auction);
-        }
+        }*/
+        return true;
     }
 
     @Override
@@ -138,4 +145,9 @@ public class AuctionServiceImpl extends ServiceImpl<AuctionMapper,Auction> imple
             }
         }
     }
+
+    @Override
+    public List<Auction> selectBannerList() {
+        return getBaseMapper().selectAucBannerList();
+    }
 }

+ 5 - 4
lot/src/main/java/cn/hobbystocks/auc/service/impl/DepositOrderServiceImpl.java

@@ -17,6 +17,7 @@ import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
 import javax.annotation.Resource;
+import java.util.Date;
 import java.util.List;
 
 @Service
@@ -31,7 +32,7 @@ public class DepositOrderServiceImpl extends ServiceImpl<DepositOrderMapper, Dep
 
     @Override
     @Transactional
-    public OrderVO createDepositOrder(DepositOrderDTO depositOrderDTO) {
+    public int createDepositOrder(DepositOrderDTO depositOrderDTO) {
 
         //查询拍品保证金配置
         Long lotId = depositOrderDTO.getLotId();
@@ -53,13 +54,13 @@ public class DepositOrderServiceImpl extends ServiceImpl<DepositOrderMapper, Dep
         depositOrderDTO.setLotId(lotId);
         depositOrderDTO.setMerchantId(lot.getMerchantId());
         //todo 调用创建保证金订单接口
-        OrderVO orderVO = orderApi.createDepositOrder(depositOrderDTO);
+//        OrderVO orderVO = orderApi.createDepositOrder(depositOrderDTO);
         //保存保证金订单记录
         DepositOrder depositOrder=new DepositOrder();
         BeanUtils.copyProperties(depositOrderDTO,depositOrder);
         depositOrder.setStatus(0);
-        getBaseMapper().insert(depositOrder);
-        return orderVO;
+        depositOrder.setCreateTime(new Date());
+        return baseMapper.insert(depositOrder);
     }
     @Override
     public OrderVO refundDepositOrder(String orderNo) {

+ 2 - 1
lot/src/main/java/cn/hobbystocks/auc/service/impl/LotFansServiceImpl.java

@@ -6,6 +6,7 @@ import cn.hobbystocks.auc.domain.LotFans;
 import cn.hobbystocks.auc.mapper.LotFansMapper;
 import cn.hobbystocks.auc.service.ILotFansService;
 import cn.hobbystocks.auc.vo.FansVO;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Isolation;
@@ -17,7 +18,7 @@ import java.util.List;
 
 
 @Service
-public class LotFansServiceImpl implements ILotFansService
+public class LotFansServiceImpl extends ServiceImpl<LotFansMapper,LotFans> implements ILotFansService
 {
     @Autowired
     private LotFansMapper lotFansMapper;

+ 48 - 0
lot/src/main/java/cn/hobbystocks/auc/service/impl/LotNoticeServiceImpl.java

@@ -0,0 +1,48 @@
+package cn.hobbystocks.auc.service.impl;
+
+import cn.hobbystocks.auc.common.utils.StringUtils;
+import cn.hobbystocks.auc.domain.LotNotice;
+import cn.hobbystocks.auc.mapper.LotNoticeMapper;
+import cn.hobbystocks.auc.service.LotNoticeService;
+import cn.hobbystocks.auc.vo.LotNoticeVO;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+import java.util.Date;
+import java.util.List;
+
+@Service
+public class LotNoticeServiceImpl extends ServiceImpl<LotNoticeMapper, LotNotice> implements LotNoticeService {
+    @Override
+    public List<LotNotice> selectLotNoticeList(LotNotice lotNotice) {
+        Page<LotNotice> lotNoticePage = new Page<>(lotNotice.getPageNum(), lotNotice.getPageSize());
+        LambdaQueryWrapper<LotNotice> lotNoticeLambdaQueryWrapper = new LambdaQueryWrapper<>();
+        if (StringUtils.isNotEmpty(lotNotice.getTitle()))
+            lotNoticeLambdaQueryWrapper.like(LotNotice::getTitle,"%"+lotNotice.getTitle()+"%");
+        lotNoticeLambdaQueryWrapper.orderByDesc(LotNotice::getId);
+        return getBaseMapper().selectList(lotNoticePage, lotNoticeLambdaQueryWrapper);
+    }
+
+    @Override
+    public int editLotNotice(LotNotice lotNotice) {
+        return getBaseMapper().updateById(lotNotice);
+    }
+
+    @Override
+    public int pubLotNotice(LotNotice lotNotice) {
+        LambdaUpdateWrapper<LotNotice> updateWrapper = new LambdaUpdateWrapper<>();
+        updateWrapper.eq(LotNotice::getId,lotNotice.getId()).set(LotNotice::getStatus,lotNotice.getStatus());
+        if (lotNotice.getStatus()==1)
+            updateWrapper.set(LotNotice::getPubTime,new Date());
+        return getBaseMapper().update(updateWrapper);
+    }
+
+    @Override
+    public Page<LotNoticeVO> selectLotNoticeByType(LotNotice lotNotice) {
+        Page<LotNoticeVO> lotNoticePage = new Page<>(lotNotice.getPageNum(), lotNotice.getPageSize());
+        return getBaseMapper().selectNoticeByType(lotNoticePage,lotNotice.getType());
+    }
+}

+ 44 - 0
lot/src/main/java/cn/hobbystocks/auc/service/impl/LotServiceImpl.java

@@ -89,6 +89,11 @@ public class LotServiceImpl extends ServiceImpl<LotMapper,Lot> implements ILotSe
         return lotMapper.selectLotList(lotIPage,lot);
     }
 
+    @Override
+    public List<Lot> selectBiddingLotByAucId(Long aucId) {
+        return lotMapper.selectNotEndLotList(aucId);
+    }
+
     @Override
     public List<Lot> selectLotByGroupIds(Long[] groupIds) {
         return null;
@@ -597,4 +602,43 @@ public class LotServiceImpl extends ServiceImpl<LotMapper,Lot> implements ILotSe
         }
     }
 
+    @Override
+    public List<Lot> selectLotListByAucId(Long aucId) {
+        return getBaseMapper().selectLotByAucId(aucId);
+    }
+
+    @Override
+    public void calculatorAndUpdateLotHot() {
+        //查询正在竞价中的拍品
+        List<Lot> lots = lotMapper.selectBidding();
+        lots.forEach(lot -> {
+            //计算出价权重
+            double bidWeight = lot.getBidCount() * 0.5;
+            //计算收藏权重
+            LambdaQueryWrapper<LotFans> lotFansLambdaQueryWrapper = new LambdaQueryWrapper<>();
+            Long lotFansCount = lotFansMapper.selectCount(lotFansLambdaQueryWrapper.eq(LotFans::getLotId, lot.getId()));
+            double lotFansWeight = lotFansCount * 0.2;
+            //计算时间权重,竞拍结束时间-当前时间=剩余时间
+            Date endTime = lot.getEndTime();
+            int timeWeight;
+            Date date = new Date();
+            Date date1 = DateUtils.addHours(date, 2);
+            if (date1.after(endTime)){
+
+            }
+            //计算涨价幅度权重
+            Long currentBid = bidMapper.getCurrentBid(lot.getId());
+        });
+    }
+
+    @Override
+    public List<Lot> selectBiddingLotList() {
+
+        return getBaseMapper().selectBiddingLotList();
+    }
+
+    @Override
+    public List<Lot> queryLotByCategory(Lot lot) {
+        return baseMapper.queryLotListByCategory(lot);
+    }
 }

+ 3 - 2
lot/src/main/java/cn/hobbystocks/auc/service/impl/OrderServiceImpl.java

@@ -48,6 +48,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper,Order> implements
             serviceTariff=auction.getServiceTariff();
         }
         if (payTimeLimit==null)
+            //中拍支付时限(小时)
             payTimeLimit=auction.getPayTimeLimit();
         //计算服务费
         long amount = order.getAmount();
@@ -56,7 +57,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper,Order> implements
         BigDecimal serviceExpense = serviceTariff.divide(BigDecimal.valueOf(100)).multiply(bigAmount);
         order.setServiceExpense(serviceExpense);
         //根据支付时限计算订单过期时间,
-        Date date = DateUtils.addDays(new Date(), payTimeLimit);
+        Date date = DateUtils.addHours(new Date(), payTimeLimit);
         order.setExpireTime(date);
         save(order);
 
@@ -80,7 +81,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper,Order> implements
     }
 
     @Override
-    public List<Order> getOrderListByUserAndAuction(Long auctionId, Long userId) {
+    public List<Order> getOrderListByUserAndAuction(Long auctionId, Integer userId) {
         return getBaseMapper().selectOrderByAuctionId(auctionId,userId);
     }
 

+ 2 - 1
lot/src/main/java/cn/hobbystocks/auc/vo/AuctionVO.java

@@ -1,11 +1,12 @@
 package cn.hobbystocks.auc.vo;
 
 import cn.hobbystocks.auc.domain.Auction;
+import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
 @Data
 public class AuctionVO extends Auction implements InData {
-
+    @ApiModelProperty("是否发布拍卖会下所有拍品")
     private Boolean pubLots = false;
 
 }

+ 30 - 0
lot/src/main/java/cn/hobbystocks/auc/vo/LotNoticeVO.java

@@ -0,0 +1,30 @@
+package cn.hobbystocks.auc.vo;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.Date;
+
+@Data
+@ApiModel("公告信息")
+public class LotNoticeVO {
+    @ApiModelProperty("公告id")
+    private Long id;
+    @ApiModelProperty("公告标题")
+    private String title;
+    @ApiModelProperty("公告内容")
+    private String content;
+    @ApiModelProperty("公告类型")
+    private String type;
+    @ApiModelProperty("公告状态")
+    private Integer status;
+    @ApiModelProperty("创建时间")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date createTime;
+    @ApiModelProperty("发布时间")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date pubTime;
+    private Integer isNew;
+}

+ 3 - 0
lot/src/main/java/cn/hobbystocks/auc/vo/LotVO.java

@@ -7,6 +7,7 @@ import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.BeanUtils;
 
 
+import java.math.BigDecimal;
 import java.util.Date;
 import java.util.List;
 
@@ -17,6 +18,8 @@ public class LotVO extends Lot implements InData {
 
     private List<Bid> bids;
 
+    private BigDecimal currentPrice;
+
     public LotVO() {
     }
 

+ 1 - 1
lot/src/main/java/cn/hobbystocks/auc/vo/OrderVO.java

@@ -19,6 +19,6 @@ public class OrderVO {
     @ApiModelProperty("订单过期时间")
     private Date expireTime;
     @ApiModelProperty("订单状态")
-    private Long status;
+    private Integer status;
 
 }

+ 9 - 3
lot/src/main/resources/mapper/AuctionMapper.xml

@@ -8,7 +8,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="id"    column="id"    />
         <result property="no"    column="no"    />
         <result property="name"    column="name"    />
-        <result property="site"    column="site"    />
         <result property="imgs"    column="imgs"    />
         <result property="banner"    column="banner"    />
         <result property="deposit"    column="deposit"    />
@@ -25,13 +24,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="createTime"    column="create_time"    />
         <result property="updateBy"    column="update_by"    />
         <result property="updateTime"    column="update_time"    />
+        <result property="sort" column="sort"/>
+        <association property="lotNum" column="id" select="cn.hobbystocks.auc.mapper.LotMapper.countLotByAucId">
+        </association>
     </resultMap>
 
     <sql id="selectAuctionVo">
         select
             id, no, name,type, imgs, banner, deposit, service_tariff, pay_time_limit,
         description, pub_status, pub_time, status, start_time, end_time,
-            del_flag, create_by, create_time, update_by, update_time
+            del_flag, create_by, create_time, update_by, update_time,sort
         from
             auction
     </sql>
@@ -43,7 +45,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="auction.pubStatus != null "> and pub_status = #{auction.pubStatus}</if>
             and del_flag &lt;&gt; 1
         </where>
-        order by sort asc,id asc
+        order by sort desc,id desc
     </select>
 
     <select id="selectPubbedAndNoEndAuction" resultMap="AuctionResult">
@@ -188,4 +190,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </foreach>
     </delete>
 
+    <select id="selectAucBannerList" resultType="cn.hobbystocks.auc.domain.Auction">
+        select id,name,banner,imgs,description,start_time startTime,status from auction
+        where pub_status=1 order by sort desc
+    </select>
 </mapper>

+ 7 - 7
lot/src/main/resources/mapper/DepositOrderMapper.xml

@@ -8,12 +8,12 @@
         select id,user_id,lot_id,status,amount,order_no,auction_id,name,deposit_type from deposit_order_record
     </sql>
     <select id="selectDepositList" resultType="cn.hobbystocks.auc.domain.DepositOrder">
-    <include refid="selectDeposit"></include>
-    <where>
-        <if test="userId!=null">and user_id=#{userId}</if>
-        <if test="lotId!=null">and lot_id=#{lotId}</if>
-        <if test="auctionId!=null"> and auction_id=#{auctionId}</if>
-        <if test="status!=null">status=#{status}</if>
-    </where>
+        <include refid="selectDeposit"></include>
+        <where>
+            <if test="userId!=null">and user_id=#{userId}</if>
+            <if test="lotId!=null">and lot_id=#{lotId}</if>
+            <if test="auctionId!=null"> and auction_id=#{auctionId}</if>
+            <if test="status!=null">status=#{status}</if>
+        </where>
     </select>
 </mapper>

+ 71 - 15
lot/src/main/resources/mapper/LotMapper.xml

@@ -28,7 +28,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="dealAccountId"    column="deal_account_id"    />
         <result property="dealAccount"    column="deal_account"    />
         <result property="paid"    column="paid"    />
-        <result property="orderId"    column="order_id"    />
         <result property="bidCount"    column="bid_count"    />
         <result property="bidPersionCount"    column="bid_persion_count"    />
         <result property="delFlag"    column="del_flag"    />
@@ -48,11 +47,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="groupId" column="group_id"/>
         <result property="deposit" column="deposit"/>
         <result property="serviceTariff" column="service_tariff"/>
+        <result property="payTimeLimit" column="pay_time_limit"/>
+        <result property="category" column="category"/>
+        <result property="subCategory" column="sub_category"/>
+        <result property="properties" column="properties" jdbcType="OTHER" typeHandler="cn.hobbystocks.auc.mapper.handler.JsonNodeTypeHandler"/>
     </resultMap>
 
     <sql id="selectLotVo">
-        select id, goods_id, auction_id, name, num, unit, imgs, detail, pub_status, pub_time, status, start_time, end_time, real_end_time, rule_type, rule_content, last_price, last_price_time, deal_price, deal_time, deal_account_id, deal_account, paid, order_id, bid_count, bid_persion_count, del_flag, create_by, create_time, update_by, update_time, sort,
-        carousel_imgs,merchant_id,merchant_name,merchant_avatar,goods_name,goods_type,private_domain,delay_publish,pub_status,group_id,deposit,service_tariff
+        select id, goods_id, auction_id, name, num, unit, imgs, detail, pub_status, pub_time, status, start_time, end_time, real_end_time, rule_type, rule_content, last_price, last_price_time, deal_price, deal_time, deal_account_id, deal_account, paid,  bid_count, bid_persion_count, del_flag, create_by, create_time, update_by, update_time, sort,
+        carousel_imgs,merchant_id,merchant_name,merchant_avatar,goods_name,goods_type,private_domain,delay_publish,pub_status,group_id,deposit,service_tariff,pay_time_limit,category,sub_category,properties
          from lot
     </sql>
 
@@ -60,7 +63,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         select l.id, l.goods_id, l.auction_id, l.name, l.num, l.unit, l.imgs, l.detail,
         l.pub_status, l.pub_time, l.status, l.start_time, l.end_time, l.real_end_time, l.rule_type,
         l.rule_content, l.last_price, l.last_price_time, l.deal_price, l.deal_time, l.deal_account_id,
-        l.deal_account, l.paid, l.order_id, l.bid_count, l.bid_persion_count, l.del_flag, l.create_by,
+        l.deal_account, l.paid, l.bid_count, l.bid_persion_count, l.del_flag, l.create_by,
         l.create_time, l.update_by, l.update_time, l.sort,l.carousel_imgs,l.merchant_id,l.merchant_name,
         l.merchant_avatar,l.goods_name,l.goods_type,l.private_domain,l.group_id,l.live_id
         from
@@ -72,9 +75,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <where>
             <if test="lot.name != null  and lot.name != ''"> and name like concat('%', #{lot.name}, '%')</if>
             <if test="lot.pubStatus != null "> and pub_status  = #{lot.pubStatus}</if>
-            and auction_id = #{lot.auctionId}
+            <if test="lot.auctionId!=null">and auction_id=#{lot.auctionId}</if>
         </where>
-        order by sort asc,id desc
+        order by sort desc,id desc
     </select>
     <select id="selectLotByGroupIds" parameterType="Long" resultMap="LotResult">
         <include refid="selectLotVo"/>
@@ -122,7 +125,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="dealAccountId != null">deal_account_id,</if>
             <if test="dealAccount != null">deal_account,</if>
             <if test="paid != null">paid,</if>
-            <if test="orderId != null">order_id,</if>
+
             <if test="bidCount != null">bid_count,</if>
             <if test="bidPersionCount != null">bid_persion_count,</if>
             <if test="delFlag != null">del_flag,</if>
@@ -142,6 +145,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="groupId != null ">group_id,</if>
             <if test="deposit !=null ">deposit,</if>
             <if test="serviceTariff !=null ">service_tariff,</if>
+            <if test="payTimeLimit!=null">pay_limit_time,</if>
+            <if test="category!=null and category!=''">category,</if>
+            <if test="subCategory!=null and subCategory!=''">sub_category,</if>
+            <if test="properties!=null">properties,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="id != null">#{id},</if>
@@ -167,7 +174,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="dealAccountId != null">#{dealAccountId},</if>
             <if test="dealAccount != null">#{dealAccount},</if>
             <if test="paid != null">#{paid},</if>
-            <if test="orderId != null">#{orderId},</if>
             <if test="bidCount != null">#{bidCount},</if>
             <if test="bidPersionCount != null">#{bidPersionCount},</if>
             <if test="delFlag != null">#{delFlag},</if>
@@ -187,6 +193,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="groupId != null ">#{groupId},</if>
             <if test="deposit !=null ">#{deposit},</if>
             <if test="serviceTariff !=null ">#{serviceTariff},</if>
+            <if test="payTimeLimit!=null">#{payTimeLimit},</if>
+            <if test="category!=null and category!=''">#{category},</if>
+            <if test="subCategory!=null and subCategory!=''">#{subCategory}</if>
+            <if test="properties!=null">#{properties,jdbcType=OTHER,typeHandler=cn.hobbystocks.auc.mapper.handler.JsonNodeTypeHandler}</if>
          </trim>
     </insert>
 
@@ -221,6 +231,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="groupId != null ">group_id,</if>
             <if test="deposit !=null ">deposit,</if>
             <if test="serviceTariff !=null ">service_tariff,</if>
+            <if test="payTimeLimit!=null">pay_time_limit,</if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="goodsId != null">#{goodsId},</if>
@@ -251,12 +262,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="groupId != null ">#{groupId},</if>
             <if test="deposit !=null ">#{deposit},</if>
             <if test="serviceTariff !=null ">#{serviceTariff},</if>
+            <if test="payTimeLimit!=null">#{payTimeLimit},</if>
         </trim>
     </insert>
 
-    <update id="updateOrder">
-        update lot set order_id = #{orderId} where id = #{lotId} and order_id is NULL
-    </update>
+
 
     <update id="updateLot" parameterType="cn.hobbystocks.auc.domain.Lot">
         update lot
@@ -283,7 +293,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="dealAccountId != null">deal_account_id = #{dealAccountId},</if>
             <if test="dealAccount != null">deal_account = #{dealAccount},</if>
             <if test="paid != null">paid = #{paid},</if>
-            <if test="orderId != null">order_id = #{orderId},</if>
             <if test="bidCount != null">bid_count = #{bidCount},</if>
             <if test="bidPersionCount != null">bid_persion_count = #{bidPersionCount},</if>
             <if test="delFlag != null">del_flag = #{delFlag},</if>
@@ -303,6 +312,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="groupId != null ">group_id = #{groupId},</if>
             <if test="deposit !=null ">deposit=#{deposit},</if>
             <if test="serviceTariff !=null ">service_tariff=#{serviceTariff},</if>
+            <if test="payTimeLimit!=null">pay_time_limit=#{payTimeLimit},</if>
         </trim>
         where id = #{id}
     </update>
@@ -332,7 +342,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="dealAccountId != null">deal_account_id = #{dealAccountId},</if>
             <if test="dealAccount != null">deal_account = #{dealAccount},</if>
             <if test="paid != null">paid = #{paid},</if>
-            <if test="orderId != null">order_id = #{orderId},</if>
             <if test="bidCount != null">bid_count = #{bidCount},</if>
             <if test="bidPersionCount != null">bid_persion_count = #{bidPersionCount},</if>
             <if test="delFlag != null">del_flag = #{delFlag},</if>
@@ -350,7 +359,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="privateDomain != null">private_domain = #{privateDomain},</if>
             <if test="1==1">delay_publish = #{delayPublish},</if>
             <if test="groupId != null ">group_id = #{groupId},</if>
-
+            <if test="deposit !=null ">deposit=#{deposit},</if>
+            <if test="serviceTariff !=null ">service_tariff=#{serviceTariff},</if>
+            <if test="payTimeLimit!=null">pay_time_limit=#{payTimeLimit},</if>
         </trim>
         where id = #{id}
     </update>
@@ -428,7 +439,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="privateDomain != null">private_domain = #{privateDomain},</if>
             <if test="1 == 1">delay_publish = #{delayPublish},</if>
             <if test="groupId != null ">group_id = #{groupId},</if>
-
+            <if test="deposit !=null ">deposit=#{deposit},</if>
+            <if test="serviceTariff !=null ">service_tariff=#{serviceTariff},</if>
+            <if test="payTimeLimit!=null">pay_time_limit=#{payTimeLimit},</if>
         </trim>
         where id = #{id}
     </update>
@@ -457,4 +470,47 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         status in ('Waiting','Starting','Bidding') and del_flag &lt;&gt; 1 and pub_status = 1
         and auction_id=#{auctionId}
     </select>
+    <select id="countLotByAucId" resultType="long" parameterType="long">
+        select count(*)  from lot where auction_id=#{auctionId} and del_flag &lt;&gt; 1
+    </select>
+    <select id="selectBiddingLotList" resultMap="LotResult">
+        select id, goods_id, auction_id, name, num, unit, imgs, detail, pub_status, pub_time, status, start_time, end_time, real_end_time, rule_type, rule_content, last_price, last_price_time, deal_price, deal_time, deal_account_id, deal_account, paid,  bid_count, bid_persion_count, del_flag, create_by, create_time, update_by, update_time, sort,
+        carousel_imgs,merchant_id,merchant_name,merchant_avatar,goods_name,goods_type,private_domain,delay_publish,pub_status,group_id,deposit,service_tariff,pay_time_limit,category,sub_category,properties
+        from
+        lot
+        where
+        status in ('Waiting','Starting','Bidding') and del_flag &lt;&gt; 1 and pub_status = 1
+        order by start_time
+    </select>
+
+    <select id="queryLotListByCategory" resultMap="LotResult" parameterType="lot">
+        select id, goods_id, auction_id, name, num, unit, imgs, detail, pub_status, pub_time, status, start_time, end_time, real_end_time, rule_type, rule_content, last_price, last_price_time, deal_price, deal_time, deal_account_id, deal_account, paid,  bid_count, bid_persion_count, del_flag, create_by, create_time, update_by, update_time, sort,
+        carousel_imgs,merchant_id,merchant_name,merchant_avatar,goods_name,goods_type,private_domain,delay_publish,pub_status,group_id,deposit,service_tariff,pay_time_limit,category,sub_category,properties
+        from
+        lot
+        <where>
+            del_flag &lt;&gt; 1 and pub_status = 1
+            <if test="category!=null and category!=''">
+                and category=#{category}
+            </if>
+            <if test="subCategory!=null and subCategory!=''">
+                and sub_category=#{subCategory}
+            </if>
+            <if test="searchValue!=null and searchValue!=''">
+                and name like concat('%',#{searchValue},'%')
+            </if>
+            <if test="status==1">
+                and status in ('Starting','Bidding')
+            </if>
+            <if test="status==2">
+                and status ='Waiting' and now()>start_time
+            </if>
+            <if test="status==3">
+                and status ='Sold'
+            </if>
+            <if test="status==4">
+                and now()+ interval '1 hour'>end_time and status in ('Starting','Bidding')
+            </if>
+        </where>
+    </select>
 </mapper>

+ 15 - 0
lot/src/main/resources/mapper/LotNoticeMapper.xml

@@ -0,0 +1,15 @@
+<?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="cn.hobbystocks.auc.mapper.LotNoticeMapper">
+    <select id="selectNoticeByType" resultType="cn.hobbystocks.auc.vo.LotNoticeVO">
+        select id,title,content,type,create_time createTime,case when create_time + INTERVAL '7 day'>now() then 1 else 0 end as isNew from lot_notice
+        <where>
+            <if test="type!=null and type!=''">
+                and type=#{type}
+            </if>
+           and status=1
+        </where>
+    </select>
+</mapper>