Explorar el Código

拍品新增编辑修改

linhui.li hace 3 semanas
padre
commit
92a6a96740

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

@@ -80,7 +80,7 @@ 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("拍卖会已经结束");
 		//拍品结束时间不能小于拍卖会结束时间
 		lot.setMerchantId(userInfo.getMerchantId());
@@ -102,7 +102,7 @@ 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 (Constants.PUB_STATUS_PUBLISHED.equals(dbLot.getPubStatus())) {

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

@@ -2,7 +2,6 @@ spring:
   redis:
     sentinel:
       master: poyee-master
-#      nodes: 192.168.50.8:26379
     database: 9
     host: ${REDIS_HOST:192.168.50.8}
     port: ${REDIS_PORT:26379}

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

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

+ 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

+ 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>