Kaynağa Gözat

Merge branch 'dev' into master_0411

# Conflicts:
#	src/main/java/com/izouma/nineth/repo/AssetRepo.java
wangqifan 2 yıl önce
ebeveyn
işleme
58fcefebf7
100 değiştirilmiş dosya ile 1517 ekleme ve 397 silme
  1. 1 0
      src/main/java/com/izouma/nineth/config/Constants.java
  2. 2 0
      src/main/java/com/izouma/nineth/config/RedisKeys.java
  3. 20 0
      src/main/java/com/izouma/nineth/config/RiceScheduledTasksConfig.java
  4. 22 4
      src/main/java/com/izouma/nineth/domain/Asset.java
  5. 69 4
      src/main/java/com/izouma/nineth/domain/Rice.java
  6. 56 0
      src/main/java/com/izouma/nineth/domain/RiceWaterTypeForWatreing.java
  7. 1 0
      src/main/java/com/izouma/nineth/domain/Showroom.java
  8. 2 0
      src/main/java/com/izouma/nineth/domain/netease/NeteaseMessage.java
  9. 46 0
      src/main/java/com/izouma/nineth/dto/excel/GlobalSearchDTO.java
  10. 25 0
      src/main/java/com/izouma/nineth/dto/nftdomain/DomainOrderDTO.java
  11. 11 2
      src/main/java/com/izouma/nineth/enums/HyperLinkType.java
  12. 21 0
      src/main/java/com/izouma/nineth/enums/RiceBubbleStatus.java
  13. 20 0
      src/main/java/com/izouma/nineth/enums/RiceWaterType.java
  14. 1 0
      src/main/java/com/izouma/nineth/event/OrderNotifyEvent.java
  15. 8 1
      src/main/java/com/izouma/nineth/listener/OrderNotifyListener.java
  16. 7 1
      src/main/java/com/izouma/nineth/repo/AssetRepo.java
  17. 4 0
      src/main/java/com/izouma/nineth/repo/CollectionRepo.java
  18. 5 1
      src/main/java/com/izouma/nineth/repo/NewsRepo.java
  19. 3 0
      src/main/java/com/izouma/nineth/repo/OrderRepo.java
  20. 3 0
      src/main/java/com/izouma/nineth/repo/RiceInviteRepo.java
  21. 4 0
      src/main/java/com/izouma/nineth/repo/RiceOperationRecordRepo.java
  22. 1 1
      src/main/java/com/izouma/nineth/repo/RiceRepo.java
  23. 16 0
      src/main/java/com/izouma/nineth/repo/RiceWaterTypeForWatreingRepo.java
  24. 5 1
      src/main/java/com/izouma/nineth/repo/UserRepo.java
  25. 1 1
      src/main/java/com/izouma/nineth/repo/nftdomain/DomainAskRepo.java
  26. 18 0
      src/main/java/com/izouma/nineth/service/AssetService.java
  27. 9 4
      src/main/java/com/izouma/nineth/service/DomainOrderService.java
  28. 93 0
      src/main/java/com/izouma/nineth/service/OrderPayService.java
  29. 149 9
      src/main/java/com/izouma/nineth/service/OrderService.java
  30. 402 227
      src/main/java/com/izouma/nineth/service/RiceService.java
  31. 20 0
      src/main/java/com/izouma/nineth/service/RiceWaterTypeForWatreingService.java
  32. 86 10
      src/main/java/com/izouma/nineth/service/StatisticService.java
  33. 2 2
      src/main/java/com/izouma/nineth/service/netease/NeteaseMessageService.java
  34. 53 13
      src/main/java/com/izouma/nineth/service/nftdomain/DomainAskService.java
  35. 5 0
      src/main/java/com/izouma/nineth/web/AlipayNotifyController.java
  36. 4 0
      src/main/java/com/izouma/nineth/web/AssetController.java
  37. 2 2
      src/main/java/com/izouma/nineth/web/DomainOrderController.java
  38. 7 2
      src/main/java/com/izouma/nineth/web/HmPayController.java
  39. 13 2
      src/main/java/com/izouma/nineth/web/OrderController.java
  40. 32 0
      src/main/java/com/izouma/nineth/web/OrderPayControllerV2.java
  41. 5 0
      src/main/java/com/izouma/nineth/web/PayEaseController.java
  42. 50 83
      src/main/java/com/izouma/nineth/web/RiceController.java
  43. 25 18
      src/main/java/com/izouma/nineth/web/RiceInviteController.java
  44. 60 0
      src/main/java/com/izouma/nineth/web/RiceWaterTypeForWatreingController.java
  45. 5 0
      src/main/java/com/izouma/nineth/web/SandPayController.java
  46. 6 0
      src/main/java/com/izouma/nineth/web/StatisticController.java
  47. 9 9
      src/main/java/com/izouma/nineth/web/nftdomain/DomainAskController.java
  48. 0 0
      src/main/resources/static/web-mobile/assets/internal/config.json
  49. 0 0
      src/main/resources/static/web-mobile/assets/internal/import/02/02229b71c.json
  50. 0 0
      src/main/resources/static/web-mobile/assets/internal/import/03/03855e110.json
  51. 0 0
      src/main/resources/static/web-mobile/assets/main/config.json
  52. 0 0
      src/main/resources/static/web-mobile/assets/main/import/04/047fd44c3.json
  53. 0 0
      src/main/resources/static/web-mobile/assets/main/import/07/0722a61c0.json
  54. 0 0
      src/main/resources/static/web-mobile/assets/main/import/08/08997832d.json
  55. 0 0
      src/main/resources/static/web-mobile/assets/main/import/0b/0bba3bf2c.json
  56. 0 0
      src/main/resources/static/web-mobile/assets/main/import/0e/0e6574479.json
  57. BIN
      src/main/resources/static/web-mobile/assets/main/import/24/241c9a6d-9bb2-4e32-ad36-7ccd57900057.cconb
  58. BIN
      src/main/resources/static/web-mobile/assets/main/import/24/24c14049-280c-4d85-96b2-2787547a4bf3.cconb
  59. BIN
      src/main/resources/static/web-mobile/assets/main/import/38/380ef80f-545e-4ad6-a2f1-982243651433.cconb
  60. BIN
      src/main/resources/static/web-mobile/assets/main/import/56/56c49332-afff-453f-92cf-4a474f92bce9@3c910.cconb
  61. BIN
      src/main/resources/static/web-mobile/assets/main/import/ac/ac5e989e-666e-45d7-a349-b66da3ed049c@48976.cconb
  62. BIN
      src/main/resources/static/web-mobile/assets/main/import/b3/b302a0e5-7787-4f4b-97f7-e54f7b9ac7ec.cconb
  63. BIN
      src/main/resources/static/web-mobile/assets/main/import/f0/f05bac55-23db-4b2f-919a-fd8f42abe301.cconb
  64. 0 0
      src/main/resources/static/web-mobile/assets/main/index.js
  65. BIN
      src/main/resources/static/web-mobile/assets/main/native/08/082f4a3b-0c79-4872-ac51-ba481418af9a.png
  66. BIN
      src/main/resources/static/web-mobile/assets/main/native/09/09acc84b-4970-400c-a4da-45e8b4771e81.png
  67. BIN
      src/main/resources/static/web-mobile/assets/main/native/12/1263d74c-8167-4928-91a6-4e2672411f47@fc873.bin
  68. BIN
      src/main/resources/static/web-mobile/assets/main/native/13/132a64f1-e0fb-48ce-b541-3cb7f411c659.png
  69. BIN
      src/main/resources/static/web-mobile/assets/main/native/24/24c419ea-63a8-4ea1-a9d0-7fc469489bbc.png
  70. BIN
      src/main/resources/static/web-mobile/assets/main/native/2d/2dd75ecd-6937-49dd-868f-1e9f8382e65b.png
  71. BIN
      src/main/resources/static/web-mobile/assets/main/native/46/4657582d-01c4-4131-8b1c-6c99f02044e7.png
  72. BIN
      src/main/resources/static/web-mobile/assets/main/native/46/4668b013-2ed9-4731-b896-d7ea3b296493.jpg
  73. BIN
      src/main/resources/static/web-mobile/assets/main/native/46/468525b9-cc53-4d1d-82f0-b6fd624eb41c.png
  74. BIN
      src/main/resources/static/web-mobile/assets/main/native/56/56c49332-afff-453f-92cf-4a474f92bce9@86c21.bin
  75. BIN
      src/main/resources/static/web-mobile/assets/main/native/56/56c49332-afff-453f-92cf-4a474f92bce9@aa173.bin
  76. BIN
      src/main/resources/static/web-mobile/assets/main/native/6a/6a4eb777-1480-451c-a430-99f7e894c42c.png
  77. BIN
      src/main/resources/static/web-mobile/assets/main/native/6b/6bce5383-9fb9-4c4b-8288-d3ca0805b7dd.png
  78. BIN
      src/main/resources/static/web-mobile/assets/main/native/77/77ed749d-5b30-4730-b78b-1e1cd6f6c1d5.png
  79. BIN
      src/main/resources/static/web-mobile/assets/main/native/79/7931b9ee-c0b6-4e67-a802-39e1c3697801.png
  80. BIN
      src/main/resources/static/web-mobile/assets/main/native/79/79b90ed2-74b2-4899-b6e5-1f82e298d98a.png
  81. BIN
      src/main/resources/static/web-mobile/assets/main/native/7f/7fa7777a-9955-4b5a-83d6-b289050e6cb3@0259a.bin
  82. 108 0
      src/main/resources/static/web-mobile/assets/main/native/86/86f25d5c-9de5-454f-a5f9-ee16603e6701.plist
  83. BIN
      src/main/resources/static/web-mobile/assets/main/native/89/894cfae3-6b66-4d9c-b0d3-78a9d2fac553.png
  84. BIN
      src/main/resources/static/web-mobile/assets/main/native/ac/ac5e989e-666e-45d7-a349-b66da3ed049c@0bd78.bin
  85. BIN
      src/main/resources/static/web-mobile/assets/main/native/ac/ac5e989e-666e-45d7-a349-b66da3ed049c@42c5c.bin
  86. BIN
      src/main/resources/static/web-mobile/assets/main/native/ac/ac5e989e-666e-45d7-a349-b66da3ed049c@4984c.png
  87. BIN
      src/main/resources/static/web-mobile/assets/main/native/ac/ac5e989e-666e-45d7-a349-b66da3ed049c@7a673.png
  88. BIN
      src/main/resources/static/web-mobile/assets/main/native/ac/ac5e989e-666e-45d7-a349-b66da3ed049c@84cbb.png
  89. BIN
      src/main/resources/static/web-mobile/assets/main/native/ac/ac5e989e-666e-45d7-a349-b66da3ed049c@86c21.bin
  90. BIN
      src/main/resources/static/web-mobile/assets/main/native/ac/ac5e989e-666e-45d7-a349-b66da3ed049c@9baa8.bin
  91. BIN
      src/main/resources/static/web-mobile/assets/main/native/ac/ac5e989e-666e-45d7-a349-b66da3ed049c@aa173.bin
  92. BIN
      src/main/resources/static/web-mobile/assets/main/native/ac/ac5e989e-666e-45d7-a349-b66da3ed049c@d96f5.png
  93. BIN
      src/main/resources/static/web-mobile/assets/main/native/ac/ac5e989e-666e-45d7-a349-b66da3ed049c@e32c4.png
  94. BIN
      src/main/resources/static/web-mobile/assets/main/native/ac/ac5e989e-666e-45d7-a349-b66da3ed049c@f5713.bin
  95. BIN
      src/main/resources/static/web-mobile/assets/main/native/af/afc47931-f066-46b0-90be-9fe61f213428.png
  96. BIN
      src/main/resources/static/web-mobile/assets/main/native/b5/b5b27ab1-e740-4398-b407-848fc2b2c897.png
  97. BIN
      src/main/resources/static/web-mobile/assets/main/native/b9/b910ce1c-58e2-403a-89cd-e83e9af0960f.png
  98. BIN
      src/main/resources/static/web-mobile/assets/main/native/cc/ccc16058-d983-4c2b-ad70-9c8cea33c32c.png
  99. BIN
      src/main/resources/static/web-mobile/assets/main/native/cf/cf4b43f2-6105-46f8-99c0-470b139c3f9e.png
  100. BIN
      src/main/resources/static/web-mobile/assets/main/native/ec/ec7451fb-1e0d-4b9f-8523-802b5fbe7415.png

+ 1 - 0
src/main/java/com/izouma/nineth/config/Constants.java

@@ -58,6 +58,7 @@ public interface Constants {
         String AUCTION  = "auctionOrder";
         String AUCTION  = "auctionOrder";
         String PIC      = "picOrder";
         String PIC      = "picOrder";
         String DOMAIN   = "domain";
         String DOMAIN   = "domain";
+        String ASK      = "ask";
     }
     }
 
 
     interface Rarity {
     interface Rarity {

+ 2 - 0
src/main/java/com/izouma/nineth/config/RedisKeys.java

@@ -23,6 +23,8 @@ public class RedisKeys {
 
 
     public static final String DOMAIN_LOCK = "domainLock::";
     public static final String DOMAIN_LOCK = "domainLock::";
 
 
+    public static final String ASK_LOCK = "askLock::";
+
     public static final String MINT_ACTIVITY_STOCK = "mintActivityStock::";
     public static final String MINT_ACTIVITY_STOCK = "mintActivityStock::";
 
 
     public static final String MINT_ORDER_LOCK = "mintOrderLock::";
     public static final String MINT_ORDER_LOCK = "mintOrderLock::";

+ 20 - 0
src/main/java/com/izouma/nineth/config/RiceScheduledTasksConfig.java

@@ -38,4 +38,24 @@ public class RiceScheduledTasksConfig {
         }
         }
         riceRepo.saveAll(riceList);
         riceRepo.saveAll(riceList);
     }
     }
+
+
+    @Scheduled(cron = "0 0 0 * * ?")
+    public void resetHelpCount() {
+        List<Rice> riceList = riceRepo.findAll();
+        for (Rice rice : riceList) {
+            rice.setHelpCount(0L);
+        }
+        riceRepo.saveAll(riceList);
+    }
+
+    @Scheduled(cron = "0 0 0 * * ?")
+    public void resetEarnPointsEveryDay() {
+        List<Rice> riceList = riceRepo.findAll();
+        for (Rice rice : riceList) {
+            rice.setEarnPointsEveryDay(0L);
+        }
+        riceRepo.saveAll(riceList);
+    }
+
 }
 }

+ 22 - 4
src/main/java/com/izouma/nineth/domain/Asset.java

@@ -7,10 +7,7 @@ import com.izouma.nineth.converter.FileObjectConverter;
 import com.izouma.nineth.converter.FileObjectListConverter;
 import com.izouma.nineth.converter.FileObjectListConverter;
 import com.izouma.nineth.converter.PrivilegeListConverter;
 import com.izouma.nineth.converter.PrivilegeListConverter;
 import com.izouma.nineth.converter.PropertyListConverter;
 import com.izouma.nineth.converter.PropertyListConverter;
-import com.izouma.nineth.enums.AssetSource;
-import com.izouma.nineth.enums.AssetStatus;
-import com.izouma.nineth.enums.CollectionType;
-import com.izouma.nineth.enums.MetaSize;
+import com.izouma.nineth.enums.*;
 import com.izouma.nineth.utils.CollectionTagSerializer;
 import com.izouma.nineth.utils.CollectionTagSerializer;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import io.swagger.annotations.ApiModelProperty;
@@ -244,6 +241,27 @@ public class Asset extends CollectionBaseEntity {
     @Transient
     @Transient
     private LocalDateTime endTime;
     private LocalDateTime endTime;
 
 
+
+
+    @Transient
+    @ApiModelProperty("是否打开超链")
+    private boolean openHyperLink = false;
+
+    @Transient
+    @ApiModelProperty("超链类型")
+    @Enumerated(EnumType.STRING)
+    private HyperLinkType hyperLinkType;
+
+    @Transient
+    @ApiModelProperty("超链地址")
+    private String address;
+
+    @Transient
+    @ApiModelProperty("当前使用nft域名的人的id")
+    private Long CurrentOwnerId;
+
+
+
     @Transient
     @Transient
     @ApiModelProperty("元宇宙展厅是否上架")
     @ApiModelProperty("元宇宙展厅是否上架")
     private boolean metaPutOn;
     private boolean metaPutOn;

+ 69 - 4
src/main/java/com/izouma/nineth/domain/Rice.java

@@ -1,6 +1,7 @@
 package com.izouma.nineth.domain;
 package com.izouma.nineth.domain;
 
 
 
 
+import com.alipay.mychain.sdk.vm.abi.datatype.Int;
 import com.izouma.nineth.annotations.Searchable;
 import com.izouma.nineth.annotations.Searchable;
 import com.izouma.nineth.enums.SearchMode;
 import com.izouma.nineth.enums.SearchMode;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModel;
@@ -38,12 +39,13 @@ public class Rice extends BaseEntity {
     @ApiModelProperty("等级")
     @ApiModelProperty("等级")
     private Long level;
     private Long level;
 
 
-    @ApiModelProperty("水滴次数")
-    private Long waterDropCount;
 
 
     @ApiModelProperty("签到次数")
     @ApiModelProperty("签到次数")
     private Long signCount;
     private Long signCount;
 
 
+    @ApiModelProperty("助力次数")
+    private Long helpCount =0L;
+
     @ApiModelProperty("上次签到时间")
     @ApiModelProperty("上次签到时间")
     private Long lastSignInTime;
     private Long lastSignInTime;
 
 
@@ -57,10 +59,73 @@ public class Rice extends BaseEntity {
     private Long empiricalValue;
     private Long empiricalValue;
 
 
     @Column(name = "exchange_count", columnDefinition = "int(11) DEFAULT 0 COMMENT '今日已兑换次数'")
     @Column(name = "exchange_count", columnDefinition = "int(11) DEFAULT 0 COMMENT '今日已兑换次数'")
-    private Integer exchangeCount=0;
+    private int exchangeCount =0;
 
 
     @Column(name = "Invite_count", columnDefinition = "int(11) DEFAULT 0 COMMENT '今日已邀请次数'")
     @Column(name = "Invite_count", columnDefinition = "int(11) DEFAULT 0 COMMENT '今日已邀请次数'")
-    private Integer InviteCount = 0;
+    private int InviteCount = 0;
+
+
+
+    @ApiModelProperty("水滴之签到")
+    private Long numberOfSingnIn=0L ;
+
+    @ApiModelProperty("水滴之邀请")
+    private Long numberOfInviteFriends= 0L;
+
+    @ApiModelProperty("水滴之助力")
+    private Long numberOfHelpOthers= 0L;
+
+    @ApiModelProperty("水滴之积分兑换")
+    private Long numberOfScoreExchanged= 0L;
+
+    @ApiModelProperty("水滴之活动")
+    private Long numberOfActivity= 0L;
+
+
+    @ApiModelProperty("今日用户获得积分")
+    private Long earnPointsEveryDay= 0L;
+
+
+
+
+
+
+    public Long getEarnPointsEveryDay() {
+        return earnPointsEveryDay == null ? 0L : earnPointsEveryDay;
+    }
+    public Long getNumberOfSingnIn() {
+        return numberOfSingnIn == null ? 0L : numberOfSingnIn;
+    }
+
+    public Long getNumberOfInviteFriends() {
+        return numberOfInviteFriends == null ? 0L : numberOfInviteFriends;
+    }
+
+    public Long getNumberOfHelpOthers() {
+        return numberOfHelpOthers == null ? 0L : numberOfHelpOthers;
+    }
+
+    public Long getNumberOfScoreExchanged() {
+        return numberOfScoreExchanged == null ? 0L : numberOfScoreExchanged;
+    }
+
+    public Long getNumberOfActivity() {
+        return numberOfActivity == null ? 0L : numberOfActivity;
+    }
+
+
+    public Long getLevel() {
+        return level == null ? 0L : level;
+    }
+
+    public Long getSignCount() {
+        return signCount == null ? 0L : signCount;
+    }
+
+    public Long getHelpCount() {
+        return helpCount == null ? 0L : helpCount;
+    }
+
 
 
 
 
 
 

+ 56 - 0
src/main/java/com/izouma/nineth/domain/RiceWaterTypeForWatreing.java

@@ -0,0 +1,56 @@
+package com.izouma.nineth.domain;
+
+
+import com.izouma.nineth.enums.RiceBubbleStatus;
+import com.izouma.nineth.enums.RiceWaterType;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.EnumType;
+import javax.persistence.Enumerated;
+import java.time.LocalDateTime;
+
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+@Entity
+@ApiModel("水稻水滴类型对应浇水")
+public class RiceWaterTypeForWatreing  extends BaseEntity {
+
+    @ApiModelProperty("用户ID")
+    @Column(name = "user_id")
+    private Long userId;
+
+    @ApiModelProperty("类型:水滴,活动积分,积分,经验值")
+    @Enumerated(EnumType.STRING)
+    private RiceWaterType type;
+
+
+    @ApiModelProperty("类型数量")
+    private Long counts;
+
+    @ApiModelProperty("气泡状态类型,未点击,已点击,已过期")
+    @Column(name = "rice_bubble_status")
+    private RiceBubbleStatus riceBubbleStatus;
+
+    @ApiModelProperty("气泡创建时间")
+    @Column(name = "bubble_created_at")
+    private LocalDateTime bubbleCreatedAt;
+
+    public  Long getCounts(){
+        return  counts == null ? 0 : counts;
+    }
+
+
+
+}
+
+
+
+
+

+ 1 - 0
src/main/java/com/izouma/nineth/domain/Showroom.java

@@ -38,6 +38,7 @@ public class Showroom extends BaseEntity {
 
 
     private Long assetId;
     private Long assetId;
 
 
+    @Searchable
     private String name;
     private String name;
 
 
     private String pic;
     private String pic;

+ 2 - 0
src/main/java/com/izouma/nineth/domain/netease/NeteaseMessage.java

@@ -7,6 +7,7 @@ import lombok.Builder;
 import lombok.Data;
 import lombok.Data;
 import lombok.NoArgsConstructor;
 import lombok.NoArgsConstructor;
 
 
+import javax.persistence.Column;
 import javax.persistence.Entity;
 import javax.persistence.Entity;
 
 
 @Entity
 @Entity
@@ -28,6 +29,7 @@ public class NeteaseMessage extends BaseEntity {
     //type: 0 文本消息, 1 图片消息,3 视频消息
     //type: 0 文本消息, 1 图片消息,3 视频消息
     private Integer type;
     private Integer type;
     @Searchable
     @Searchable
+    @Column(columnDefinition = "TEXT")
     private String  body;
     private String  body;
     private String  msgInfo;
     private String  msgInfo;
     private Long    timetag;
     private Long    timetag;

+ 46 - 0
src/main/java/com/izouma/nineth/dto/excel/GlobalSearchDTO.java

@@ -0,0 +1,46 @@
+package com.izouma.nineth.dto.excel;
+
+import com.izouma.nineth.domain.*;
+import com.izouma.nineth.service.LikeService;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.util.List;
+
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+public class GlobalSearchDTO {
+    List<Collection> collections;
+
+    boolean collectionsAll;
+
+    List<Collection> domains;
+
+    boolean domainsAll;
+
+    List<Collection> pictures;
+
+    boolean picturesAll;
+
+    List<News> news;
+
+    boolean newsAll;
+
+    List<MintActivity> mintActivities;
+
+    boolean mintActivitiesAll;
+
+    List<User> minters;
+
+    boolean mintersAll;
+
+    List<User> users;
+
+    boolean usersAll;
+
+    List<Showroom> showrooms;
+
+    boolean showroomAll;
+}

+ 25 - 0
src/main/java/com/izouma/nineth/dto/nftdomain/DomainOrderDTO.java

@@ -0,0 +1,25 @@
+package com.izouma.nineth.dto.nftdomain;
+
+import com.izouma.nineth.converter.FileObjectListConverter;
+import com.izouma.nineth.domain.FileObject;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import javax.persistence.Convert;
+import java.math.BigDecimal;
+import java.time.LocalDate;
+import java.util.List;
+
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class DomainOrderDTO {
+    private String           name;
+    private String           owner;
+    private String           ownerAvatar;
+    private BigDecimal       price;
+    @Convert(converter = FileObjectListConverter.class)
+    private List<FileObject> pic;
+    private LocalDate        payTime;
+}

+ 11 - 2
src/main/java/com/izouma/nineth/enums/HyperLinkType.java

@@ -1,9 +1,14 @@
 package com.izouma.nineth.enums;
 package com.izouma.nineth.enums;
 
 
 public enum HyperLinkType {
 public enum HyperLinkType {
+    RID_CLOUD_DOMAIN_NAME("RID云域名"),
     HOMEPAGE("个人主页"),
     HOMEPAGE("个人主页"),
-    EXTERNALLINK("外部链接"),
-    COLLECTION(" 藏品");
+    COLLECTION(" 藏品"),
+    EXTERNALLINK("web2.0外部链接"),
+    PERSONAL_BUSINESS_CARD("个人名片"),
+    VIBRATO_VIDEO("抖音视频"),
+    OASISMETA("绿洲元宇宙");
+
 
 
     private final String description;
     private final String description;
 
 
@@ -16,3 +21,7 @@ public enum HyperLinkType {
     }
     }
 }
 }
 
 
+
+
+
+

+ 21 - 0
src/main/java/com/izouma/nineth/enums/RiceBubbleStatus.java

@@ -0,0 +1,21 @@
+package com.izouma.nineth.enums;
+
+
+public enum RiceBubbleStatus {
+
+    NOT_CLICKED("未点击"),
+    CLICKED("已点击"),
+    EXPIRED("已过期");
+
+
+
+    private final String description;
+
+    RiceBubbleStatus(String description) {
+        this.description = description;
+    }
+
+    public String getDescription() {
+        return description;
+    }
+}

+ 20 - 0
src/main/java/com/izouma/nineth/enums/RiceWaterType.java

@@ -0,0 +1,20 @@
+package com.izouma.nineth.enums;
+
+public enum RiceWaterType {
+    DAILY_CHECK_IN("每日签到"),
+    INVITE_FRIENDS("邀请好友"),
+    FRIENDS_HELP("好友助力"),
+    REDEEM("积分兑换"),
+    ACTIVITY_AWARD("活动奖励");
+
+
+    private final String description;
+
+    RiceWaterType(String description) {
+        this.description = description;
+    }
+
+    public String getDescription() {
+        return description;
+    }
+}

+ 1 - 0
src/main/java/com/izouma/nineth/event/OrderNotifyEvent.java

@@ -18,6 +18,7 @@ public class OrderNotifyEvent implements Serializable {
     public static final String TYPE_AUCTION_ORDER = "auction_order";
     public static final String TYPE_AUCTION_ORDER = "auction_order";
     public static final String TYPE_PIC           = "pic_order";
     public static final String TYPE_PIC           = "pic_order";
     public static final String DOMAIN             = "domain";
     public static final String DOMAIN             = "domain";
+    public static final String TYPE_ASK           = "ask";
 
 
     private Long      orderId;
     private Long      orderId;
     private PayMethod payMethod;
     private PayMethod payMethod;

+ 8 - 1
src/main/java/com/izouma/nineth/listener/OrderNotifyListener.java

@@ -1,8 +1,10 @@
 package com.izouma.nineth.listener;
 package com.izouma.nineth.listener;
 
 
 import com.izouma.nineth.domain.PhotoAsset;
 import com.izouma.nineth.domain.PhotoAsset;
+import com.izouma.nineth.domain.nftdomain.DomainAsk;
 import com.izouma.nineth.event.OrderNotifyEvent;
 import com.izouma.nineth.event.OrderNotifyEvent;
 import com.izouma.nineth.service.*;
 import com.izouma.nineth.service.*;
+import com.izouma.nineth.service.nftdomain.DomainAskService;
 import lombok.AllArgsConstructor;
 import lombok.AllArgsConstructor;
 import lombok.SneakyThrows;
 import lombok.SneakyThrows;
 import lombok.extern.slf4j.Slf4j;
 import lombok.extern.slf4j.Slf4j;
@@ -28,6 +30,7 @@ public class OrderNotifyListener implements RocketMQListener<OrderNotifyEvent> {
     private AuctionOrderService auctionOrderService;
     private AuctionOrderService auctionOrderService;
     private PhotoAssetService   photoAssetService;
     private PhotoAssetService   photoAssetService;
     private DomainOrderService  domainOrderService;
     private DomainOrderService  domainOrderService;
+    private DomainAskService    domainAskService;
 
 
     @SneakyThrows
     @SneakyThrows
     @Override
     @Override
@@ -54,9 +57,13 @@ public class OrderNotifyListener implements RocketMQListener<OrderNotifyEvent> {
                 photoAssetService.notify(e.getOrderId(), e.getPayMethod(), e.getTransactionId());
                 photoAssetService.notify(e.getOrderId(), e.getPayMethod(), e.getTransactionId());
                 break;
                 break;
             case OrderNotifyEvent.DOMAIN:
             case OrderNotifyEvent.DOMAIN:
-                //星图回调
+                //域名回调
                 domainOrderService.notify(e.getOrderId(), e.getPayMethod(), e.getTransactionId());
                 domainOrderService.notify(e.getOrderId(), e.getPayMethod(), e.getTransactionId());
                 break;
                 break;
+            case OrderNotifyEvent.TYPE_ASK:
+                //星图回调
+                domainAskService.notifyOrder(e.getOrderId(), e.getPayMethod(), e.getTransactionId());
+                break;
             case OrderNotifyEvent.TYPE_ORDER:
             case OrderNotifyEvent.TYPE_ORDER:
             default:
             default:
                 orderService.notifyOrder(e.getOrderId(), e.getPayMethod(), e.getTransactionId());
                 orderService.notifyOrder(e.getOrderId(), e.getPayMethod(), e.getTransactionId());

+ 7 - 1
src/main/java/com/izouma/nineth/repo/AssetRepo.java

@@ -187,7 +187,13 @@ public interface AssetRepo extends JpaRepository<Asset, Long>, JpaSpecificationE
 
 
     Asset findFirstByNameAndStatus(String name, AssetStatus status);
     Asset findFirstByNameAndStatus(String name, AssetStatus status);
 
 
-    Asset findByNameAndStatusAndCategoryAndDel(String name, AssetStatus status, String categroy,boolean del);
+    Asset findByNameAndStatusAndCategoryAndDel(String name, AssetStatus status, String categroy, boolean del);
+
+    int countAllByPrefixNameInAndStatusAndDel(Set<String> prefixName, AssetStatus assetStatus, boolean del);
+
+    int countAllByPrefixNameInAndStatusAndConsignmentAndDel(Set<String> prefixName, AssetStatus assetStatus, boolean consignment, boolean del);
+
+    int countAllByPrefixNameInAndStatusAndConsignmentAndPublicShowAndDel(Set<String> prefixName, AssetStatus assetStatus, boolean consignment, boolean publicShow, boolean del);
 
 
     @Query(nativeQuery = true,value = "select phone from asset inner join user on asset.user_id = user.id where asset.name like ?1 and status = 'NORMAL' and category = '元域名'")
     @Query(nativeQuery = true,value = "select phone from asset inner join user on asset.user_id = user.id where asset.name like ?1 and status = 'NORMAL' and category = '元域名'")
     String findPhone(String name);
     String findPhone(String name);

+ 4 - 0
src/main/java/com/izouma/nineth/repo/CollectionRepo.java

@@ -219,6 +219,10 @@ public interface CollectionRepo extends JpaRepository<Collection, Long>, JpaSpec
 
 
     List<Collection> findAllByNameLikeAndSalableAndOnShelf(String name, boolean salable, boolean onshelf);
     List<Collection> findAllByNameLikeAndSalableAndOnShelf(String name, boolean salable, boolean onshelf);
 
 
+    Collection findFirstByNameAndSalableAndOnShelf(String name, boolean salable, boolean onshelf);
+
+    Collection findFirstByNameAndOnShelf(String name, boolean onshelf);
+
     @Query(nativeQuery = true, value = "update collection_info c set c.hold_days = null where c.name like ?1")
     @Query(nativeQuery = true, value = "update collection_info c set c.hold_days = null where c.name like ?1")
     @Modifying
     @Modifying
     @Transactional
     @Transactional

+ 5 - 1
src/main/java/com/izouma/nineth/repo/NewsRepo.java

@@ -4,6 +4,8 @@ import com.izouma.nineth.domain.News;
 import com.izouma.nineth.dto.RecommendCollection;
 import com.izouma.nineth.dto.RecommendCollection;
 import com.izouma.nineth.dto.RecommendNews;
 import com.izouma.nineth.dto.RecommendNews;
 import org.springframework.cache.annotation.CacheEvict;
 import org.springframework.cache.annotation.CacheEvict;
+import org.springframework.data.domain.Page;
+import org.springframework.data.domain.Pageable;
 import org.springframework.data.jpa.repository.JpaRepository;
 import org.springframework.data.jpa.repository.JpaRepository;
 import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
 import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
 import org.springframework.data.jpa.repository.Modifying;
 import org.springframework.data.jpa.repository.Modifying;
@@ -25,7 +27,9 @@ public interface NewsRepo extends JpaRepository<News, Long>, JpaSpecificationExe
     void addLike(Long id, int num);
     void addLike(Long id, int num);
 
 
     @Query("select new com.izouma.nineth.dto.RecommendNews(n,r) from News n join Recommend r on n.id = r.collectionId " +
     @Query("select new com.izouma.nineth.dto.RecommendNews(n,r) from News n join Recommend r on n.id = r.collectionId " +
-                "where n.del = false and r.companyId = ?2 and r.type = ?1 and r.category = 'NEWS' order by r.sort desc")
+            "where n.del = false and r.companyId = ?2 and r.type = ?1 and r.category = 'NEWS' order by r.sort desc")
     List<RecommendNews> recommend(String type, Long companyId);
     List<RecommendNews> recommend(String type, Long companyId);
 
 
+    Page<News> findByTitleLike(String name, Pageable pageable);
+
 }
 }

+ 3 - 0
src/main/java/com/izouma/nineth/repo/OrderRepo.java

@@ -130,4 +130,7 @@ public interface OrderRepo extends JpaRepository<Order, Long>, JpaSpecificationE
     List<Map<String, Object>> newestDomainOrder();
     List<Map<String, Object>> newestDomainOrder();
 
 
     List<Order> findAllByParentOrderId(Long id);
     List<Order> findAllByParentOrderId(Long id);
+
+    @Query("select o from Order o inner join Asset a on o.assetId = a.id where o.status = 'FINISH' and a.prefixName in ?1")
+    Page<Order> queryDomainOrder(Set<String> prefixName, Pageable pageable);
 }
 }

+ 3 - 0
src/main/java/com/izouma/nineth/repo/RiceInviteRepo.java

@@ -35,6 +35,9 @@ public interface RiceInviteRepo extends JpaRepository<RiceInvite, Long>, JpaSpec
     @Query("SELECT COUNT(r) FROM RiceInvite r WHERE r.helpeeId = :helpeeId AND r.createTime >= :todayStartTime AND r.createTime < :todayEndTime")
     @Query("SELECT COUNT(r) FROM RiceInvite r WHERE r.helpeeId = :helpeeId AND r.createTime >= :todayStartTime AND r.createTime < :todayEndTime")
     int countRiceInviteBy(@Param("helpeeId") Long helpeeId, @Param("todayStartTime") Long todayStartTime, @Param("todayEndTime") Long todayEndTime);
     int countRiceInviteBy(@Param("helpeeId") Long helpeeId, @Param("todayStartTime") Long todayStartTime, @Param("todayEndTime") Long todayEndTime);
 
 
+    @Query("SELECT COUNT(r) FROM RiceInvite r WHERE r.helperId = :helperId AND r.createTime >= :todayStartTime AND r.createTime < :todayEndTime")
+    int countRiceInviteByHelperId(@Param("helperId") Long helperId, @Param("todayStartTime") Long todayStartTime, @Param("todayEndTime") Long todayEndTime);
+
 
 
 
 
 }
 }

+ 4 - 0
src/main/java/com/izouma/nineth/repo/RiceOperationRecordRepo.java

@@ -23,4 +23,8 @@ public interface RiceOperationRecordRepo extends JpaRepository<RiceOperationReco
 
 
     @Query("SELECT COUNT(r) FROM RiceOperationRecord r WHERE r.userId = :userId AND r.type = :type AND r.modifiedAt >= :todayStartTime AND r.modifiedAt <= :todayEndTime")
     @Query("SELECT COUNT(r) FROM RiceOperationRecord r WHERE r.userId = :userId AND r.type = :type AND r.modifiedAt >= :todayStartTime AND r.modifiedAt <= :todayEndTime")
     int countTodayRiceOperationType(Long userId, RiceOperationType type, LocalDateTime todayStartTime, LocalDateTime todayEndTime);
     int countTodayRiceOperationType(Long userId, RiceOperationType type, LocalDateTime todayStartTime, LocalDateTime todayEndTime);
+
+    @Query("SELECT COUNT(r) FROM RiceOperationRecord r WHERE r.userId = :userId AND r.type = :type AND r.modifiedAt >= :todayStartTime AND r.modifiedAt <= :todayEndTime")
+    int sumTodayRiceOperationType(Long userId, RiceOperationType type, LocalDateTime todayStartTime, LocalDateTime todayEndTime);
+
 }
 }

+ 1 - 1
src/main/java/com/izouma/nineth/repo/RiceRepo.java

@@ -40,6 +40,6 @@ public interface RiceRepo extends JpaRepository<Rice, Long>, JpaSpecificationExe
      *
      *
      * @return
      * @return
      */
      */
-    @Query(value = "SELECT * FROM rice r ORDER BY r.empirical_value DESC;", nativeQuery = true)
+    @Query(value = "SELECT * FROM rice r ORDER BY r.empirical_value DESC LIMIT 100", nativeQuery = true)
     List<Rice> findTop100OrderByEmpiricalValueDesc();
     List<Rice> findTop100OrderByEmpiricalValueDesc();
 }
 }

+ 16 - 0
src/main/java/com/izouma/nineth/repo/RiceWaterTypeForWatreingRepo.java

@@ -0,0 +1,16 @@
+package com.izouma.nineth.repo;
+
+import com.izouma.nineth.domain.RiceWaterTypeForWatreing;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
+import org.springframework.data.jpa.repository.Modifying;
+import org.springframework.data.jpa.repository.Query;
+
+import javax.transaction.Transactional;
+
+public interface RiceWaterTypeForWatreingRepo extends JpaRepository<RiceWaterTypeForWatreing, Long>, JpaSpecificationExecutor<RiceWaterTypeForWatreing> {
+    @Query("update RiceWaterTypeForWatreing t set t.del = true where t.id = ?1")
+    @Modifying
+    @Transactional
+    void softDelete(Long id);
+}

+ 5 - 1
src/main/java/com/izouma/nineth/repo/UserRepo.java

@@ -5,6 +5,8 @@ import com.izouma.nineth.dto.InvitedUserDTO;
 import com.izouma.nineth.enums.AuthStatus;
 import com.izouma.nineth.enums.AuthStatus;
 import com.izouma.nineth.security.Authority;
 import com.izouma.nineth.security.Authority;
 import org.springframework.cache.annotation.Cacheable;
 import org.springframework.cache.annotation.Cacheable;
+import org.springframework.data.domain.Page;
+import org.springframework.data.domain.Pageable;
 import org.springframework.data.jpa.repository.JpaRepository;
 import org.springframework.data.jpa.repository.JpaRepository;
 import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
 import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
 import org.springframework.data.jpa.repository.Modifying;
 import org.springframework.data.jpa.repository.Modifying;
@@ -263,7 +265,9 @@ public interface UserRepo extends JpaRepository<User, Long>, JpaSpecificationExe
     @Query("update User set destroyPoint = destroyPoint + ?2 where id = ?1")
     @Query("update User set destroyPoint = destroyPoint + ?2 where id = ?1")
     void addDestroyPoint(Long id, int num);
     void addDestroyPoint(Long id, int num);
 
 
-    @Query(nativeQuery = true, value ="SELECT user.avatar avatar, user.nickname nickname, user.level level FROM user WHERE user.id = ?1 AND user.del = false")
+    @Query(nativeQuery = true, value = "SELECT user.avatar avatar, user.nickname nickname, user.level level FROM user WHERE user.id = ?1 AND user.del = false")
     Map<String, String> websocketQuery(Long userId);
     Map<String, String> websocketQuery(Long userId);
 
 
+    Page<User> findByNicknameLikeOrIntroLike(String search1, String search2, Pageable pageable);
+
 }
 }

+ 1 - 1
src/main/java/com/izouma/nineth/repo/nftdomain/DomainAskRepo.java

@@ -26,7 +26,7 @@ public interface DomainAskRepo extends JpaRepository<DomainAsk, Long>, JpaSpecif
     @Query(nativeQuery = true, value = "select price from domain_ask where domain_order_id = ?1 and status = 'ASKING' order by price desc limit 1")
     @Query(nativeQuery = true, value = "select price from domain_ask where domain_order_id = ?1 and status = 'ASKING' order by price desc limit 1")
     BigDecimal findMaxPrice(Long domainOrderId);
     BigDecimal findMaxPrice(Long domainOrderId);
 
 
-    @Query(nativeQuery = true, value = "select count(da.id) count,da.pic_url pic,da.domain_order_id domainOrderId,a.id assetId,da.`name` picName,da.end_time endTime from domain_ask da inner join asset a on a.id = da.asset_id where da.status = 'ASKING' and da.owner_id = ?1 and a.status = 'NORMAL' group by da.asset_id order by a.created_at desc ")
+    @Query(nativeQuery = true, value = "select count(da.id) count,da.pic_url pic,da.domain_order_id domainOrderId,a.id assetId,da.`name` picName,da.end_time endTime from domain_ask da inner join asset a on a.id = da.asset_id where da.status in ('REFUNDED','ASKING','FINISH') and da.owner_id = ?1 and a.status = 'NORMAL' group by da.asset_id order by a.created_at desc")
     List<Map<String, Object>> askGroup(Long userId);
     List<Map<String, Object>> askGroup(Long userId);
 
 
     int countByAssetIdAndUserIdAndStatusInAndDelFalse(Long assetId, Long userId, Set<DomainAskStatus> statuses);
     int countByAssetIdAndUserIdAndStatusInAndDelFalse(Long assetId, Long userId, Set<DomainAskStatus> statuses);

+ 18 - 0
src/main/java/com/izouma/nineth/service/AssetService.java

@@ -15,6 +15,7 @@ import com.izouma.nineth.dto.*;
 import com.izouma.nineth.enums.*;
 import com.izouma.nineth.enums.*;
 import com.izouma.nineth.exception.BusinessException;
 import com.izouma.nineth.exception.BusinessException;
 import com.izouma.nineth.repo.*;
 import com.izouma.nineth.repo.*;
+import com.izouma.nineth.repo.nftdomain.DomainAskRepo;
 import com.izouma.nineth.utils.JpaUtils;
 import com.izouma.nineth.utils.JpaUtils;
 import com.izouma.nineth.utils.SecurityUtils;
 import com.izouma.nineth.utils.SecurityUtils;
 import com.izouma.nineth.utils.TokenUtils;
 import com.izouma.nineth.utils.TokenUtils;
@@ -80,6 +81,7 @@ public class AssetService {
     private UserBalanceService      userBalanceService;
     private UserBalanceService      userBalanceService;
     private PhotoAssetRepo          photoAssetRepo;
     private PhotoAssetRepo          photoAssetRepo;
     private NumberSeqRepo           numberSeqRepo;
     private NumberSeqRepo           numberSeqRepo;
+    private DomainAskRepo           domainAskRepo;
 
 
     public Page<Asset> all(PageQuery pageQuery) {
     public Page<Asset> all(PageQuery pageQuery) {
 
 
@@ -433,6 +435,12 @@ public class AssetService {
 
 
     public void publicShow(Long id) {
     public void publicShow(Long id) {
         Asset asset = assetRepo.findById(id).orElseThrow(new BusinessException("无记录"));
         Asset asset = assetRepo.findById(id).orElseThrow(new BusinessException("无记录"));
+        Set<DomainAskStatus> statuses = new HashSet<>();
+        statuses.add(DomainAskStatus.ASKING);
+        if (domainAskRepo
+                .countByAssetIdAndOwnerIdAndStatusInAndDelFalse(asset.getId(), asset.getOwnerId(), statuses) > 0) {
+            throw new BusinessException("已有叫价,不可上架");
+        }
         if (!asset.getUserId().equals(SecurityUtils.getAuthenticatedUser().getId())) {
         if (!asset.getUserId().equals(SecurityUtils.getAuthenticatedUser().getId())) {
             throw new BusinessException("此藏品不属于你");
             throw new BusinessException("此藏品不属于你");
         }
         }
@@ -495,6 +503,12 @@ public class AssetService {
 
 
     public synchronized void consignment(Long id, BigDecimal price, String tradeCode, boolean safeFlag) {
     public synchronized void consignment(Long id, BigDecimal price, String tradeCode, boolean safeFlag) {
         Asset asset = assetRepo.findById(id).orElseThrow(new BusinessException("无记录"));
         Asset asset = assetRepo.findById(id).orElseThrow(new BusinessException("无记录"));
+        Set<DomainAskStatus> statuses = new HashSet<>();
+        statuses.add(DomainAskStatus.ASKING);
+        if (domainAskRepo
+                .countByAssetIdAndOwnerIdAndStatusInAndDelFalse(asset.getId(), asset.getOwnerId(), statuses) > 0) {
+            throw new BusinessException("已有叫价,不可上架");
+        }
         String mapString = sysConfigService.getString("collection_price");
         String mapString = sysConfigService.getString("collection_price");
         if (StringUtils.isNotBlank(mapString)) {
         if (StringUtils.isNotBlank(mapString)) {
             JSONObject json = JSONObject.parseObject(mapString);
             JSONObject json = JSONObject.parseObject(mapString);
@@ -803,6 +817,10 @@ public class AssetService {
         newAsset.setOasisId(asset.getOasisId());
         newAsset.setOasisId(asset.getOasisId());
         newAsset.setFromAssetId(asset.getId());
         newAsset.setFromAssetId(asset.getId());
         newAsset.setType(CollectionType.DEFAULT);
         newAsset.setType(CollectionType.DEFAULT);
+        newAsset.setOpenHyperLink(false);
+        newAsset.setHyperLinkType(null);
+        newAsset.setAddress(null);
+        newAsset.setCurrentOwnerId(null);
         if (asset.getType() == CollectionType.DOMAIN) {
         if (asset.getType() == CollectionType.DOMAIN) {
             newAsset.setType(CollectionType.DOMAIN);
             newAsset.setType(CollectionType.DOMAIN);
         }
         }

+ 9 - 4
src/main/java/com/izouma/nineth/service/DomainOrderService.java

@@ -317,7 +317,11 @@ public class DomainOrderService {
                 if (asset != null) {
                 if (asset != null) {
                     if (asset.isConsignment()) {
                     if (asset.isConsignment()) {
                         sold.put("canAsk", false);
                         sold.put("canAsk", false);
+                        sold.put("collectionId", asset.getPublicCollectionId());
                     } else {
                     } else {
+                        if (asset.isPublicShow()) {
+                            sold.put("collectionId", asset.getPublicCollectionId());
+                        }
                         sold.put("canAsk", true);
                         sold.put("canAsk", true);
                     }
                     }
                     sold.put("id", domainOrder.getId());
                     sold.put("id", domainOrder.getId());
@@ -630,10 +634,11 @@ public class DomainOrderService {
         return jsonArray.toJavaList(DomainTop.class);
         return jsonArray.toJavaList(DomainTop.class);
     }
     }
 
 
-    public void addHyperLink(Long collectionId, boolean openHyperLink, HyperLinkType hyperLinkType, String address) {
-        // Collection collection = collectionRepo.findById(collectionId).orElseThrow(new BusinessException("没找到记录"));
-        Asset asset = assetRepo.findByIdAndStatus(collectionId, AssetStatus.NORMAL).orElseThrow(new BusinessException("没找到记录"));
-        DomainOrder domainOrder = domainOrderRepo.findById(asset.getCollectionId()).orElseThrow(new BusinessException("没找到记录"));
+    public void addHyperLink(Long assetId, boolean openHyperLink, HyperLinkType hyperLinkType, String address) {
+        Asset asset = assetRepo.findByIdAndStatus(assetId, AssetStatus.NORMAL)
+                               .orElseThrow(new BusinessException("没找到记录"));
+        DomainOrder domainOrder = domainOrderRepo.findById(asset.getCollectionId())
+                                                 .orElseThrow(new BusinessException("没找到记录"));
         domainOrder.setOpenHyperLink(openHyperLink);
         domainOrder.setOpenHyperLink(openHyperLink);
         domainOrder.setHyperLinkType(hyperLinkType);
         domainOrder.setHyperLinkType(hyperLinkType);
         domainOrder.setAddress(address);
         domainOrder.setAddress(address);

+ 93 - 0
src/main/java/com/izouma/nineth/service/OrderPayService.java

@@ -30,12 +30,15 @@ import org.springframework.stereotype.Service;
 import org.springframework.web.context.request.RequestContextHolder;
 import org.springframework.web.context.request.RequestContextHolder;
 import org.springframework.web.context.request.ServletRequestAttributes;
 import org.springframework.web.context.request.ServletRequestAttributes;
 
 
+import javax.swing.text.DateFormatter;
 import java.awt.*;
 import java.awt.*;
 import java.io.IOException;
 import java.io.IOException;
 import java.math.BigDecimal;
 import java.math.BigDecimal;
 import java.net.URLEncoder;
 import java.net.URLEncoder;
 import java.nio.charset.StandardCharsets;
 import java.nio.charset.StandardCharsets;
+import java.text.DateFormat;
 import java.time.LocalDateTime;
 import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
 import java.util.Map;
 import java.util.Map;
 import java.util.Objects;
 import java.util.Objects;
 import java.util.Optional;
 import java.util.Optional;
@@ -113,6 +116,8 @@ public class OrderPayService {
         bizContent.put("out_trade_no", orderId + "");
         bizContent.put("out_trade_no", orderId + "");
         bizContent.put("total_amount", amount);
         bizContent.put("total_amount", amount);
         bizContent.put("subject", subject);
         bizContent.put("subject", subject);
+        DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+        bizContent.put("time_expire", df.format(LocalDateTime.now().plusSeconds(175)));
         JSONObject body = new JSONObject();
         JSONObject body = new JSONObject();
         body.put("type", type);
         body.put("type", type);
         body.put("orderId", orderId);
         body.put("orderId", orderId);
@@ -979,4 +984,92 @@ public class OrderPayService {
         BalanceRecord record = userBalanceService.balancePay(order.getUserId(), order.getPrice(), orderId, "元域名叫价");
         BalanceRecord record = userBalanceService.balancePay(order.getUserId(), order.getPrice(), orderId, "元域名叫价");
         domainAskService.notifyOrder(orderId, PayMethod.BALANCE, record.getId().toString());
         domainAskService.notifyOrder(orderId, PayMethod.BALANCE, record.getId().toString());
     }
     }
+
+    @Cacheable(value = "payOrder", key = "'ask#'+#orderId")
+    public String payAskOrder(Long orderId) {
+        DomainAsk order = domainAskRepo.findById(orderId).orElseThrow(new BusinessException("订单不存在"));
+        if (order.getStatus() != DomainAskStatus.NOT_PAID) {
+            throw new BusinessException("订单状态错误");
+        }
+        switch (PAY_CHANNEL) {
+            case Constants.PayChannel.SAND:
+                return sandPayService.pay(orderId + "", "域名:" + order.getName(), order.getPrice(),
+                        order.getCreatedAt().plusMinutes(3), Constants.OrderNotifyType.ASK);
+            case Constants.PayChannel.HM:
+                return hmPayService.requestAlipay(orderId + "", order.getPrice(),
+                        "域名:" + order.getName(), HMPayService.getTimeout(order.getCreatedAt(), 180),
+                        Constants.OrderNotifyType.ASK, generalProperties
+                                .resolveFrontUrl(getCompanyId(), "/domainname"));
+        }
+        throw new BusinessException("绿洲宇宙冷却系统已启动,请稍后支付");
+    }
+
+    @Cacheable(value = "payOrder", key = "'ask#'+#orderId")
+    public String payAskAli(Long orderId) {
+        DomainAsk order = domainAskRepo.findById(orderId).orElseThrow(new BusinessException("订单不存在"));
+        if (order.getStatus() != DomainAskStatus.NOT_PAID) {
+            throw new BusinessException("订单状态错误");
+        }
+        String qrCode = aliRequest(orderId, order.getPrice(), "叫价:" + order
+                .getName(), Constants.OrderNotifyType.ASK);
+
+        String ua = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()
+                                                                                            .getHeader("User-Agent");
+        if (ua.toLowerCase().contains("micromessenger")) {
+            return "/static/wx_alipay_bridge.html?payUrl=" + URLEncoder
+                    .encode(Constants.ALIPAY_URL_SCHEME + qrCode, StandardCharsets.UTF_8)
+                    + "&orderId=" + orderId + "&type=domain&returnUrl="
+                    + URLEncoder
+                    .encode(generalProperties
+                            .resolveFrontUrl(getCompanyId(), "/domainname"), StandardCharsets.UTF_8);
+        } else {
+            return Constants.ALIPAY_URL_SCHEME + qrCode;
+        }
+    }
+
+    @Cacheable(value = "payOrder", key = "'ask#'+#orderId")
+    public String payAskQuick(Long orderId) {
+        DomainAsk order = domainAskRepo.findById(orderId).orElseThrow(new BusinessException("订单不存在"));
+        if (order.getStatus() != DomainAskStatus.NOT_PAID) {
+            throw new BusinessException("订单状态错误");
+        }
+        IdentityAuth identityAuth = identityAuthRepo
+                .findFirstByUserIdAndStatusAndDelFalseOrderByCreatedAtDesc(order.getUserId(), AuthStatus.SUCCESS)
+                .orElseThrow(new BusinessException("请先完成实名认证"));
+        return sandPayService.payQuick(orderId + "", "叫价:" + order.getName(),
+                order.getPrice(), order.getCreatedAt().plusMinutes(3), Constants.OrderNotifyType.ASK,
+                generalProperties.resolveFrontUrl(getCompanyId(), "/domainname"));
+    }
+
+    @Cacheable(value = "payOrder", key = "'ask#'+#orderId")
+    public String payAskQuickBind(Long orderId) {
+        DomainAsk order = domainAskRepo.findById(orderId).orElseThrow(new BusinessException("订单不存在"));
+        if (order.getStatus() != DomainAskStatus.NOT_PAID) {
+            throw new BusinessException("订单状态错误");
+        }
+        IdentityAuth identityAuth = identityAuthRepo
+                .findFirstByUserIdAndStatusAndDelFalseOrderByCreatedAtDesc(order.getUserId(), AuthStatus.SUCCESS)
+                .orElseThrow(new BusinessException("请先完成实名认证"));
+        return sandPayService.payQuickBind(orderId + "", "叫价:" + order.getName(),
+                order.getPrice(), order.getCreatedAt().plusMinutes(3), Constants.OrderNotifyType.ASK,
+                generalProperties.resolveFrontUrl(getCompanyId(), "/domainname"),
+                order.getUserId(), identityAuth.getRealName(), identityAuth.getIdNo());
+    }
+
+    @Cacheable(value = "payOrder", key = "'ask#'+#orderId")
+    public Map<String, Object> payAskOrderAgreement(Long orderId, String bindCardId) {
+        DomainAsk order = domainAskRepo.findById(orderId).orElseThrow(new BusinessException("订单不存在"));
+        if (order.getStatus() != DomainAskStatus.NOT_PAID) {
+            throw new BusinessException("订单状态错误");
+        }
+        if (StringUtils.isEmpty(bindCardId)) {
+            bindCardId = userBankCardRepo.findByUserId(order.getUserId())
+                                         .stream().map(UserBankCard::getBindCardId).findFirst().orElse(null);
+        }
+        if (StringUtils.isEmpty(bindCardId)) {
+            throw new BusinessException("请先绑定银行卡");
+        }
+        return payEaseService.pay("叫价:" + order.getName(), orderId.toString(), order.getPrice(),
+                order.getUserId().toString(), bindCardId, Constants.OrderNotifyType.ASK);
+    }
 }
 }

+ 149 - 9
src/main/java/com/izouma/nineth/service/OrderService.java

@@ -24,6 +24,7 @@ import com.izouma.nineth.domain.nftdomain.Cart;
 import com.izouma.nineth.dto.MarketSettlement;
 import com.izouma.nineth.dto.MarketSettlement;
 import com.izouma.nineth.dto.PageQuery;
 import com.izouma.nineth.dto.PageQuery;
 import com.izouma.nineth.dto.UserBankCard;
 import com.izouma.nineth.dto.UserBankCard;
+import com.izouma.nineth.dto.nftdomain.DomainOrderDTO;
 import com.izouma.nineth.enums.*;
 import com.izouma.nineth.enums.*;
 import com.izouma.nineth.event.*;
 import com.izouma.nineth.event.*;
 import com.izouma.nineth.exception.BusinessException;
 import com.izouma.nineth.exception.BusinessException;
@@ -33,6 +34,7 @@ import com.izouma.nineth.security.Authority;
 import com.izouma.nineth.service.netease.NeteaseMessageService;
 import com.izouma.nineth.service.netease.NeteaseMessageService;
 import com.izouma.nineth.service.sms.SmsService;
 import com.izouma.nineth.service.sms.SmsService;
 import com.izouma.nineth.utils.*;
 import com.izouma.nineth.utils.*;
+import com.sun.xml.bind.v2.runtime.NameBuilder;
 import io.github.bucket4j.Bandwidth;
 import io.github.bucket4j.Bandwidth;
 import io.github.bucket4j.Bucket;
 import io.github.bucket4j.Bucket;
 import io.github.bucket4j.BucketConfiguration;
 import io.github.bucket4j.BucketConfiguration;
@@ -52,6 +54,7 @@ import org.springframework.cache.annotation.Cacheable;
 import org.springframework.context.event.EventListener;
 import org.springframework.context.event.EventListener;
 import org.springframework.core.env.Environment;
 import org.springframework.core.env.Environment;
 import org.springframework.data.domain.Page;
 import org.springframework.data.domain.Page;
+import org.springframework.data.domain.PageImpl;
 import org.springframework.data.domain.Pageable;
 import org.springframework.data.domain.Pageable;
 import org.springframework.data.redis.core.BoundSetOperations;
 import org.springframework.data.redis.core.BoundSetOperations;
 import org.springframework.data.redis.core.BoundValueOperations;
 import org.springframework.data.redis.core.BoundValueOperations;
@@ -60,6 +63,7 @@ import org.springframework.scheduling.annotation.Async;
 import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 
 
+import javax.crypto.interfaces.PBEKey;
 import javax.persistence.criteria.Join;
 import javax.persistence.criteria.Join;
 import javax.transaction.Transactional;
 import javax.transaction.Transactional;
 import java.io.OutputStream;
 import java.io.OutputStream;
@@ -660,7 +664,7 @@ public class OrderService {
         }
         }
         Map<String, Object> expend = new HashMap<>();
         Map<String, Object> expend = new HashMap<>();
         paymentParams.put("expend", expend);
         paymentParams.put("expend", expend);
-        if ("wx_pub".equals(payChannel)) {
+        if ("wx_pub" .equals(payChannel)) {
             if (StringUtils.isBlank(openId)) {
             if (StringUtils.isBlank(openId)) {
                 throw new BusinessException("缺少openId");
                 throw new BusinessException("缺少openId");
             }
             }
@@ -669,7 +673,7 @@ public class OrderService {
         }
         }
 
 
         Map<String, Object> response;
         Map<String, Object> response;
-        if ("wx_lite".equals(payChannel)) {
+        if ("wx_lite" .equals(payChannel)) {
             paymentParams.put("adapay_func_code", "wxpay.createOrder");
             paymentParams.put("adapay_func_code", "wxpay.createOrder");
             paymentParams.put("callback_url", generalProperties.getHost() + "/9th/orders");
             paymentParams.put("callback_url", generalProperties.getHost() + "/9th/orders");
             response = AdapayCommon.requestAdapayUits(paymentParams);
             response = AdapayCommon.requestAdapayUits(paymentParams);
@@ -840,16 +844,72 @@ public class OrderService {
 
 
                                 DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
                                 DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
                                 String localDateTimeNowStr = order.getPayTime().format(formatter);
                                 String localDateTimeNowStr = order.getPayTime().format(formatter);
-                                String info = "元域名:\"" + collection.getName().substring(9)
-                                                                   .replace(".nft", "") + "\"\n" +
-                                        "持有人:\"" + collection.getOwner() + "\"\n" +
-                                        "购买人:\"" + user.getNickname() + "\"\n" +
-                                        "时间:\"" + localDateTimeNowStr + "\"\n" +
-                                        "成交价:\"" + order.getTotalPrice() + "\"\n";
+//                                String info = "<div style=\"line-height: 40px;background: #06c04f;border-radius: 4px;padding: 0 20px;margin-bottom: 12px;\">RAEX绿洲:RID元域名称交易监控</div><div style=\"display: flex\"><img style=\"width: 18px; height: 18px; margin: 5px 10px 0 0\"src=\"https://cdn.raex.vip/image/2023-04-06-14-32-07vINcTaZP.png\"alt=\"\"/><span> RID:" + collection
+//                                        .getName()
+//                                        .substring(9) + "【已出售】</span></div><div style=\"display: flex\"><img style=\"width: 18px; height: 18px; margin: 5px 10px 0 0\"src=\"https://cdn.raex.vip/image/2023-04-06-14-28-32HcaKTDYb.png\"alt=\"\"/><span>分类:【RID元域名】</span></div><div style=\"display: flex\"><img style=\"width: 18px; height: 18px; margin: 5px 10px 0 0\"src=\"https://cdn.raex.vip/image/2023-04-06-14-31-49lldhGaqC.png\"alt=\"\"/><span>销售价格:【" + order
+//                                        .getTotalPrice() + "】</span></div><div style=\"display: flex\"><img style=\"width: 18px; height: 18px; margin: 5px 10px 0 0\"src=\"https://cdn.raex.vip/image/2023-04-06-14-32-21ciilInpO.png\"alt=\"\"/><span>交易时间:<br/>【" + localDateTimeNowStr + "】</span></div>";
+
+                                String info = "<div style=\"padding: 4px 0\">" +
+                                        "                        <div" +
+                                        "                            style=\"" +
+                                        "                                line-height: 40px;" +
+                                        "                                background: #06c04f;" +
+                                        "                                border-radius: 4px;" +
+                                        "                                padding: 0 12px;" +
+                                        "                                margin-bottom: 12px;" +
+                                        "                                font-weight: bold;" +
+                                        "                            \"" +
+                                        "                        >" +
+                                        "                            RAEX绿洲:RID元域名称交易监控" +
+                                        "                        </div>" +
+                                        "                        <div style=\"display: flex; margin-bottom: 8px\">" +
+                                        "                            <img" +
+                                        "                                style=\"width: 18px; height: 18px; margin: 5px 10px 0 0\"" +
+                                        "                                src=\"https://cdn.raex.vip/image/2023-04-06-14-32-07vINcTaZP.png\"" +
+                                        "                                alt=\"\"" +
+                                        "                            />" +
+                                        "                            <span> RID:"
+                                        + collection
+                                        .getName()
+                                        .substring(9)
+                                        + "【已出售】</span>" +
+                                        "                        </div>" +
+                                        "                        <div style=\"display: flex; margin-bottom: 8px\">" +
+                                        "                            <img" +
+                                        "                                style=\"width: 18px; height: 18px; margin: 5px 10px 0 0\"" +
+                                        "                                src=\"https://cdn.raex.vip/image/2023-04-06-14-28-32HcaKTDYb.png\"" +
+                                        "                                alt=\"\"" +
+                                        "                            />" +
+                                        "                            <span>分类: 【RID元域名】</span>" +
+                                        "                        </div>" +
+                                        "                        <div style=\"display: flex; margin-bottom: 8px\">" +
+                                        "                            <img" +
+                                        "                                style=\"width: 18px; height: 18px; margin: 5px 10px 0 0\"" +
+                                        "                                src=\"https://cdn.raex.vip/image/2023-04-06-14-31-49lldhGaqC.png\"" +
+                                        "                                alt=\"\"" +
+                                        "                            />" +
+                                        "                            <span>销售价格: 【" + order
+                                        .getTotalPrice() + " 】</span>" +
+                                        "                        </div>" +
+                                        "                        <div style=\"display: flex\">" +
+                                        "                            <img" +
+                                        "                                style=\"width: 18px; height: 18px; margin: 5px 10px 0 0\"" +
+                                        "                                src=\"https://cdn.raex.vip/image/2023-04-06-14-32-21ciilInpO.png\"" +
+                                        "                                alt=\"\"" +
+                                        "                            />" +
+                                        "                            <span>交易时间:<br />【" + localDateTimeNowStr + "】</span>" +
+                                        "                        </div>" +
+                                        "                    </div>";
+//                                String info = "元域名:\"" + collection.getName().substring(9)
+//                                                                   .replace(".nft", "") + "\"\n" +
+//                                        "持有人:\"" + collection.getOwner() + "\"\n" +
+//                                        "购买人:\"" + user.getNickname() + "\"\n" +
+//                                        "时间:\"" + localDateTimeNowStr + "\"\n" +
+//                                        "成交价:\"" + order.getTotalPrice() + "\"\n";
                                 object.put("msg", info);
                                 object.put("msg", info);
                                 String news = JSONObject.toJSONString(object);
                                 String news = JSONObject.toJSONString(object);
                                 neteaseMessage.setBody(news);
                                 neteaseMessage.setBody(news);
-                                neteaseMessageService.sendMessage(neteaseMessage);
+//                                neteaseMessageService.sendMessage(neteaseMessage);
                             }
                             }
                             userBalanceService.realtimeSettleOrder(order);
                             userBalanceService.realtimeSettleOrder(order);
                         } else {
                         } else {
@@ -1258,4 +1318,84 @@ public class OrderService {
             });
             });
         }).get();
         }).get();
     }
     }
+
+    public Map<String, Object> domainTransferInfo(int type) {
+        Set<String> prefixNames = new HashSet<>();
+        switch (type) {
+            case 0:
+                prefixNames.add("RIDCX");
+                break;
+            case 1:
+                prefixNames.add("RID");
+                prefixNames.add("RID1");
+                prefixNames.add("RID2");
+                prefixNames.add("RID3");
+                prefixNames.add("RID4");
+                prefixNames.add("RID5");
+                break;
+            case 2:
+                prefixNames.add("RIDN1");
+                prefixNames.add("RIDN2");
+                prefixNames.add("RIDN3");
+                prefixNames.add("RIDN4");
+                prefixNames.add("RIDN5");
+                prefixNames.add("RIDN6");
+                break;
+        }
+        //流通量
+        int transferringCount = assetRepo.countAllByPrefixNameInAndStatusAndDel(prefixNames, AssetStatus.NORMAL, false);
+        //寄售中
+        int consignment = assetRepo
+                .countAllByPrefixNameInAndStatusAndConsignmentAndDel(prefixNames, AssetStatus.NORMAL, true, false);
+        //仅展示
+        int publicShow = assetRepo
+                .countAllByPrefixNameInAndStatusAndConsignmentAndPublicShowAndDel(prefixNames, AssetStatus.NORMAL, false, true, false);
+        Map<String, Object> result = new HashMap<>();
+        result.put("transferringCount", transferringCount);
+        result.put("consignment", consignment);
+        result.put("publicShow", publicShow);
+        return result;
+    }
+
+    public Page<DomainOrderDTO> newestDomainTransfer(int type, Pageable pageable) {
+        Set<String> prefixNames = new HashSet<>();
+        switch (type) {
+            case 0:
+                prefixNames.add("RIDCX");
+                break;
+            case 1:
+                prefixNames.add("RID");
+                prefixNames.add("RID1");
+                prefixNames.add("RID2");
+                prefixNames.add("RID3");
+                prefixNames.add("RID4");
+                prefixNames.add("RID5");
+                break;
+            case 2:
+                prefixNames.add("RIDN1");
+                prefixNames.add("RIDN2");
+                prefixNames.add("RIDN3");
+                prefixNames.add("RIDN4");
+                prefixNames.add("RIDN5");
+                prefixNames.add("RIDN6");
+                break;
+        }
+        Page<Order> orders = orderRepo.queryDomainOrder(prefixNames, pageable);
+        List<Order> orderContent = orders.getContent();
+        List<DomainOrderDTO> domainOrderDTOS = new ArrayList<>();
+        orderContent.forEach(order -> {
+            Asset asset = assetRepo.findById(order.getAssetId()).orElse(null);
+            if (asset != null) {
+                DomainOrderDTO domainOrderDTO = new DomainOrderDTO();
+                domainOrderDTO.setName(order.getName());
+                domainOrderDTO.setOwner(asset.getOwner());
+                domainOrderDTO.setOwnerAvatar(asset.getOwnerAvatar());
+                domainOrderDTO.setPrice(order.getPrice());
+                domainOrderDTO.setPayTime(order.getPayTime().toLocalDate());
+                domainOrderDTO.setPic(order.getPic());
+                domainOrderDTOS.add(domainOrderDTO);
+            }
+        });
+        return new PageImpl<>(domainOrderDTOS, orders.getPageable(), orders.getTotalElements());
+    }
 }
 }

+ 402 - 227
src/main/java/com/izouma/nineth/service/RiceService.java

@@ -6,6 +6,7 @@ import com.izouma.nineth.dto.PageQuery;
 import com.izouma.nineth.dto.R;
 import com.izouma.nineth.dto.R;
 import com.izouma.nineth.dto.RiceDTO;
 import com.izouma.nineth.dto.RiceDTO;
 import com.izouma.nineth.enums.RiceOperationType;
 import com.izouma.nineth.enums.RiceOperationType;
+import com.izouma.nineth.enums.RiceWaterType;
 import com.izouma.nineth.exception.BusinessException;
 import com.izouma.nineth.exception.BusinessException;
 import com.izouma.nineth.repo.*;
 import com.izouma.nineth.repo.*;
 import com.izouma.nineth.utils.JpaUtils;
 import com.izouma.nineth.utils.JpaUtils;
@@ -32,18 +33,20 @@ import java.time.LocalTime;
 import java.time.ZoneOffset;
 import java.time.ZoneOffset;
 import java.util.*;
 import java.util.*;
 
 
+import static com.izouma.nineth.enums.RiceWaterType.ACTIVITY_AWARD;
+
 @Service
 @Service
 @AllArgsConstructor
 @AllArgsConstructor
 public class RiceService {
 public class RiceService {
 
 
     private static final int                         MAX_NICKNAME_LENGTH = 6;
     private static final int                         MAX_NICKNAME_LENGTH = 6;
     private static final String                      UPDATE_SUCCESS_MSG  = "修改成功";
     private static final String                      UPDATE_SUCCESS_MSG  = "修改成功";
-    private              RiceRepo                    riceRepo;
-    private              RiceUserWaterDropRecordRepo riceUserWaterDropRecordRepo;
-    private              RiceOperationRecordRepo     riceOperationRecordRepo;
-    private              UserRepo                    userRepo;
-    private              SysConfigService            sysConfigService;
-    private RiceInviteRepo  riceInviteRepo;
+    private final        RiceRepo                    riceRepo;
+    private final        RiceUserWaterDropRecordRepo riceUserWaterDropRecordRepo;
+    private final        RiceOperationRecordRepo     riceOperationRecordRepo;
+    private final        UserRepo                    userRepo;
+    private final        SysConfigService            sysConfigService;
+    private final        RiceInviteRepo              riceInviteRepo;
 
 
     public Page<Rice> all(PageQuery pageQuery) {
     public Page<Rice> all(PageQuery pageQuery) {
         return riceRepo.findAll(JpaUtils.toSpecification(pageQuery, Rice.class), JpaUtils.toPageRequest(pageQuery));
         return riceRepo.findAll(JpaUtils.toSpecification(pageQuery, Rice.class), JpaUtils.toPageRequest(pageQuery));
@@ -60,7 +63,7 @@ public class RiceService {
             User user = byId.get();
             User user = byId.get();
             nickname = user.getNickname();
             nickname = user.getNickname();
             avatar = user.getAvatar();
             avatar = user.getAvatar();
-            phone= user.getPhone();
+            phone = user.getPhone();
         } else {
         } else {
             throw new BusinessException("用户不存在");
             throw new BusinessException("用户不存在");
         }
         }
@@ -78,7 +81,6 @@ public class RiceService {
             rice.setNickname(nickname);
             rice.setNickname(nickname);
             rice.setPhone(phone);
             rice.setPhone(phone);
             rice.setLevel(0L);
             rice.setLevel(0L);
-            rice.setWaterDropCount(0L);
             rice.setSignCount(0L);
             rice.setSignCount(0L);
             rice.setSelfScore(0L);
             rice.setSelfScore(0L);
             rice.setSelfActivityScore(0L);
             rice.setSelfActivityScore(0L);
@@ -100,12 +102,7 @@ public class RiceService {
     }
     }
 
 
 
 
-    /**
-     * 获取当前等级
-     *
-     * @param empiricalValue
-     * @return
-     */
+    //获取当前等级
     public Map<String, Object> getCurrentLevel(Long empiricalValue) {
     public Map<String, Object> getCurrentLevel(Long empiricalValue) {
         String jsonString = sysConfigService.getString("rice_level");
         String jsonString = sysConfigService.getString("rice_level");
         User authenticatedUser = SecurityUtils.getAuthenticatedUser();
         User authenticatedUser = SecurityUtils.getAuthenticatedUser();
@@ -113,24 +110,20 @@ public class RiceService {
         Optional<Rice> byUserId = riceRepo.findByUserId(authId);
         Optional<Rice> byUserId = riceRepo.findByUserId(authId);
         if (byUserId.isPresent()) {
         if (byUserId.isPresent()) {
             Rice rice = byUserId.get();
             Rice rice = byUserId.get();
-            empiricalValue = rice.getEmpiricalValue();
-
             JsonReader jsonReader = Json.createReader(new StringReader(jsonString));
             JsonReader jsonReader = Json.createReader(new StringReader(jsonString));
             JsonArray jsonArray = jsonReader.readArray();
             JsonArray jsonArray = jsonReader.readArray();
-
             Long currentLevel = null;
             Long currentLevel = null;
             Long currentStart = null;
             Long currentStart = null;
             Long nextStart = null;
             Long nextStart = null;
             for (int i = 0; i < jsonArray.size(); i++) {
             for (int i = 0; i < jsonArray.size(); i++) {
                 JsonObject jsonObject = jsonArray.getJsonObject(i);
                 JsonObject jsonObject = jsonArray.getJsonObject(i);
                 Long start = Long.valueOf(jsonObject.getInt("start"));
                 Long start = Long.valueOf(jsonObject.getInt("start"));
-
-                if (empiricalValue >= start && empiricalValue < (i < jsonArray.size() - 1 ? Long
-                        .valueOf(jsonArray.getJsonObject(i + 1).getInt("start")) : Long.MAX_VALUE)) {
+                if (empiricalValue >= start && empiricalValue < (i < jsonArray.size() - 1 ? Long.valueOf(jsonArray.getJsonObject(i + 1).getInt("start")) : Long.MAX_VALUE)) {
                     String currentLevelStr = jsonObject.getString("name").replace("Lv", "");
                     String currentLevelStr = jsonObject.getString("name").replace("Lv", "");
                     currentLevel = Long.parseLong(currentLevelStr);
                     currentLevel = Long.parseLong(currentLevelStr);
+                    rice.setLevel(currentLevel);
+                    riceRepo.save(rice);
                     currentStart = Long.valueOf(jsonObject.getInt("start"));
                     currentStart = Long.valueOf(jsonObject.getInt("start"));
-
                     if (i < jsonArray.size() - 1) {
                     if (i < jsonArray.size() - 1) {
                         JsonObject nextObject = jsonArray.getJsonObject(i + 1);
                         JsonObject nextObject = jsonArray.getJsonObject(i + 1);
                         nextStart = nextObject.getJsonNumber("start").longValue();
                         nextStart = nextObject.getJsonNumber("start").longValue();
@@ -165,12 +158,12 @@ public class RiceService {
      * @return R<?>
      * @return R<?>
      */
      */
     public R<?> taskInitialization() {
     public R<?> taskInitialization() {
-        User authenticatedUser = SecurityUtils.getAuthenticatedUser();
-        Long authId = authenticatedUser.getId();
-        Optional<Rice> byUserId = riceRepo.findByUserId(authId);
+
+        Optional<Rice> byUserId = riceRepo.findByUserId(SecurityUtils.getAuthenticatedUser().getId());
         if (byUserId.isPresent()) {
         if (byUserId.isPresent()) {
             Rice rice = byUserId.get();
             Rice rice = byUserId.get();
             int i = riceInviteRepo.countRiceInviteBy(rice.getUserId(), getTodayStartTime(), getTodayEndTime());
             int i = riceInviteRepo.countRiceInviteBy(rice.getUserId(), getTodayStartTime(), getTodayEndTime());
+            int InviteHelpOthersCounts = riceInviteRepo.countRiceInviteByHelperId(SecurityUtils.getAuthenticatedUser().getId(), getTodayStartTime(), getTodayEndTime());
 
 
             Long lastSignInTime = rice.getLastSignInTime();
             Long lastSignInTime = rice.getLastSignInTime();
             Long currentTime = System.currentTimeMillis();
             Long currentTime = System.currentTimeMillis();
@@ -179,16 +172,16 @@ public class RiceService {
             Boolean isInvited;
             Boolean isInvited;
             Boolean isCanExchangeScore;
             Boolean isCanExchangeScore;
 
 
-            if(rice.getSelfActivityScore()<10&&rice.getSelfScore()>=2){
-                isCanExchangeScore=true;
-            }else {
-                isCanExchangeScore=false;
+            if (rice.getExchangeCount() < 10 && rice.getSelfScore() >= 10) {
+                isCanExchangeScore = true;
+            } else {
+                isCanExchangeScore = false;
             }
             }
 
 
-            if(i==0){
+            if (i == 0) {
                 isInvited = false;
                 isInvited = false;
 
 
-            }else {
+            } else {
                 isInvited = true;
                 isInvited = true;
             }
             }
 
 
@@ -201,27 +194,27 @@ public class RiceService {
             // 判断上次签到时间是否为空,如果为空,则默认为从未签到过
             // 判断上次签到时间是否为空,如果为空,则默认为从未签到过
             if (lastSignInTime == null) {
             if (lastSignInTime == null) {
                 return R.success("未签到").add("isSignedIn", false)
                 return R.success("未签到").add("isSignedIn", false)
-                        .add("exchangeCount", rice.getExchangeCount() == null ? 0 : rice.getExchangeCount())
-                        .add("waterDropCount", rice.getWaterDropCount())
+                        .add("exchangeCount", rice.getExchangeCount())
                         .add("isCanExchangeActivityScoreForWater", isCanExchangeActivityScoreForWater)
                         .add("isCanExchangeActivityScoreForWater", isCanExchangeActivityScoreForWater)
-                        .add("isInvited",isInvited)
-                .add("isCanExchangeScore",isCanExchangeScore);
+                        .add("isInvited", isInvited)
+                        .add("isCanExchangeScore", isCanExchangeScore)
+                        .add("InviteHelpOthersCounts", InviteHelpOthersCounts);
             }
             }
             // 判断今天是否已经签到过
             // 判断今天是否已经签到过
             if (DateUtils.isSameDay(new Date(lastSignInTime), new Date(currentTime))) {
             if (DateUtils.isSameDay(new Date(lastSignInTime), new Date(currentTime))) {
                 return R.success("已签到").add("isSignedIn", true)
                 return R.success("已签到").add("isSignedIn", true)
-                        .add("exchangeCount", rice.getExchangeCount() == null ? 0 : rice.getExchangeCount())
-                        .add("waterDropCount", rice.getWaterDropCount())
+                        .add("exchangeCount", rice.getExchangeCount())
                         .add("isCanExchangeActivityScoreForWater", isCanExchangeActivityScoreForWater)
                         .add("isCanExchangeActivityScoreForWater", isCanExchangeActivityScoreForWater)
-                        .add("isInvited",isInvited)
-                .add("isCanExchangeScore",isCanExchangeScore);
+                        .add("isInvited", isInvited)
+                        .add("isCanExchangeScore", isCanExchangeScore)
+                        .add("InviteHelpOthersCounts", InviteHelpOthersCounts);
             } else {
             } else {
                 return R.success("未签到").add("isSignedIn", false)
                 return R.success("未签到").add("isSignedIn", false)
-                        .add("exchangeCount", rice.getExchangeCount() == null ? 0 : rice.getExchangeCount())
-                        .add("waterDropCount", rice.getWaterDropCount())
+                        .add("exchangeCount", rice.getExchangeCount())
                         .add("isCanExchangeActivityScoreForWater", isCanExchangeActivityScoreForWater)
                         .add("isCanExchangeActivityScoreForWater", isCanExchangeActivityScoreForWater)
-                        .add("isInvited",isInvited)
-                .add("isCanExchangeScore",isCanExchangeScore);
+                        .add("isInvited", isInvited)
+                        .add("isCanExchangeScore", isCanExchangeScore)
+                        .add("InviteHelpOthersCounts", InviteHelpOthersCounts);
             }
             }
         }
         }
         return R.error("查询失败");
         return R.error("查询失败");
@@ -232,42 +225,53 @@ public class RiceService {
      * 获取当前用户积分
      * 获取当前用户积分
      */
      */
     public R<String> getCurrentScore() {
     public R<String> getCurrentScore() {
-        User authenticatedUser = SecurityUtils.getAuthenticatedUser();
-        Long authId = authenticatedUser.getId();
-        Optional<Rice> byUserId = riceRepo.findByUserId(authId);
-        if (byUserId.isPresent()) {
-            Rice rice = byUserId.get();
-            Long selfScore = rice.getSelfScore();
-            return R.success("获取到当前用户积分").add("selfScore", selfScore);
-        }
-        return R.error("获取失败");
+        Rice rice = riceRepo.findByUserId(SecurityUtils.getAuthenticatedUser().getId()).orElseThrow(new BusinessException("用户不存在"));
+        Long selfScore = rice.getSelfScore();
+        return R.success("获取到当前用户积分").add("selfScore", selfScore);
     }
     }
 
 
 
 
     //在RiceService中添加一个方法用于更新所有用户的排名。
     //在RiceService中添加一个方法用于更新所有用户的排名。
-    public void updateScoreRank() {
+    public void updateLvRank() {
         List<Rice> allRices = riceRepo.findAll();
         List<Rice> allRices = riceRepo.findAll();
-        allRices.sort(Comparator.comparing(Rice::getSelfScore).reversed());
         for (int i = 0; i < allRices.size(); i++) {
         for (int i = 0; i < allRices.size(); i++) {
             Rice rice = allRices.get(i);
             Rice rice = allRices.get(i);
-//            rice.setScoreRank(i + 1);
-            riceRepo.save(rice);
+
+            String jsonString = sysConfigService.getString("rice_level");
+            JsonReader jsonReader = Json.createReader(new StringReader(jsonString));
+            JsonArray jsonArray = jsonReader.readArray();
+            Long currentLevel = null;
+
+            for (int j = 0; j < jsonArray.size(); j++) {
+                JsonObject jsonObject = jsonArray.getJsonObject(j);
+                Long start = Long.valueOf(jsonObject.getInt("start"));
+                if (rice.getEmpiricalValue() >= start && rice.getEmpiricalValue() < (j < jsonArray.size() - 1 ? Long.valueOf(jsonArray.getJsonObject(j + 1).getInt("start")) : Long.MAX_VALUE)) {
+                    String currentLevelStr = jsonObject.getString("name").replace("Lv", "");
+                    currentLevel = Long.parseLong(currentLevelStr);
+                    rice.setLevel(currentLevel);
+                    riceRepo.save(rice);
+                    break;
+                }
+            }
         }
         }
     }
     }
 
 
 
 
+
+    //一个获取积分排行榜的接口
     public List<RiceDTO> getTop100(Long userId) {
     public List<RiceDTO> getTop100(Long userId) {
+        this.updateLvRank();
         List<Rice> top100Rices = riceRepo.findTop100OrderByEmpiricalValueDesc();
         List<Rice> top100Rices = riceRepo.findTop100OrderByEmpiricalValueDesc();
         List<RiceDTO> result = new ArrayList<>();
         List<RiceDTO> result = new ArrayList<>();
 
 
         // 计算自己的排名
         // 计算自己的排名
-        int selfRank = 0;
-        for (int i = 0; i < top100Rices.size(); i++) {
-            if (top100Rices.get(i).getId().equals(userId)) {
-                selfRank = i + 1;
-                break;
-            }
-        }
+//        int selfRank = 0;
+//        for (int i = 0; i < top100Rices.size(); i++) {
+//            if (top100Rices.get(i).getId().equals(userId)) {
+//                selfRank = i + 1;
+//                break;
+//            }
+//        }
 
 
         for (int i = 0; i < top100Rices.size(); i++) {
         for (int i = 0; i < top100Rices.size(); i++) {
             Rice rice = top100Rices.get(i);
             Rice rice = top100Rices.get(i);
@@ -297,6 +301,21 @@ public class RiceService {
     }
     }
 
 
 
 
+    //获取当前等级
+    public R<Map<String, Object>> showLevel() {
+        Rice rice = riceRepo.findByUserId(SecurityUtils.getAuthenticatedUser().getId()).orElseThrow(new BusinessException("用户不存在"));
+        Map<String, Object> currentLevel = this.getCurrentLevel(rice.getEmpiricalValue());
+        Long riceLevel = (Long) currentLevel.get("currentLevel");
+        Double levelUpPercentage = (Double) currentLevel.get("levelUpPercentage");
+        rice.setLevel(riceLevel);
+        riceRepo.save(rice);
+        Map<String, Object> responseData = new HashMap<>();
+        responseData.put("riceLevel", currentLevel);
+        responseData.put("levelUpPercentage", levelUpPercentage);
+        return R.success(responseData).add("msg", "查询成功");
+    }
+
+
     //计算自己排名
     //计算自己排名
     public R<RiceDTO> getRiceUserRank(Long userId) {
     public R<RiceDTO> getRiceUserRank(Long userId) {
         Optional<Rice> rice1 = riceRepo.findByUserId(userId);
         Optional<Rice> rice1 = riceRepo.findByUserId(userId);
@@ -314,7 +333,6 @@ public class RiceService {
                 break;
                 break;
             }
             }
         }
         }
-
         for (int i = 0; i < top100Rices.size(); i++) {
         for (int i = 0; i < top100Rices.size(); i++) {
             Rice rice = top100Rices.get(i);
             Rice rice = top100Rices.get(i);
             RiceDTO riceDTO = new RiceDTO();
             RiceDTO riceDTO = new RiceDTO();
@@ -336,177 +354,326 @@ public class RiceService {
                 } else {
                 } else {
                     riceDTO.setRankGap(i + 1 - 100);
                     riceDTO.setRankGap(i + 1 - 100);
                 }
                 }
-
                 BeanUtils.copyProperties(riceDTO, dto);
                 BeanUtils.copyProperties(riceDTO, dto);
-
-
             }
             }
-
         }
         }
-
         if (dto == null) {
         if (dto == null) {
             return R.error("用户不存在");
             return R.error("用户不存在");
         }
         }
-
         return R.success(dto);
         return R.success(dto);
     }
     }
 
 
+
     //浇水
     //浇水
-    public R<? extends Object> watering() {
-        // 获取当前用户 ID,
-        User authenticatedUser = SecurityUtils.getAuthenticatedUser();
-        Long authId = authenticatedUser.getId();
-        Optional<Rice> byUserId = riceRepo.findByUserId(authId);
-        if (byUserId.isPresent()) {
-            Rice rice = byUserId.get();
-            Long waterDropCount = rice.getWaterDropCount();
-            Long beforeWaterDropCount = rice.getWaterDropCount();
-            Long beforeEmpiricalValue = rice.getEmpiricalValue();
-            // 如果水滴次数为 0,返回不能浇水的提示
-            if (waterDropCount == 0) {
-                return R.error("水滴次数已用完,无法浇水").add("can", false);
-            }
-            // 浇水成功,更新水滴次数,经验值加2
-            rice.setWaterDropCount(waterDropCount - 1);
-            rice.setEmpiricalValue(rice.getEmpiricalValue() + 2);
-            riceRepo.save(rice);
-            createRiceOperationRecord(authId, RiceOperationType.WATER_DROP, 1L, beforeWaterDropCount, rice
-                    .getWaterDropCount());
-            createRiceOperationRecord(authId, RiceOperationType.EMPIRICAL_VALUE, 2L, beforeEmpiricalValue, rice
-                    .getEmpiricalValue());
-
-            // Save watering record
-            RiceUserWaterDropRecord record = new RiceUserWaterDropRecord();
-            record.setUserId(authId);
-            record.setWateringTime(LocalDateTime.now());
-            riceUserWaterDropRecordRepo.save(record);
-
-            return R.success("浇水成功").add("can", true).add("time", waterDropCount - 1);
-        }
-        return R.error("浇水失败").add("can", false);
-    }
+    public R<? extends Object> waterDrop(RiceWaterType riceWaterType, Long riceId) {
+
+        Rice rice = riceRepo.findByUserId(riceId).orElseThrow(new BusinessException("未找到用户"));
+        switch (riceWaterType) {
+            case DAILY_CHECK_IN:
+                // 处理水滴之签到
+                Long numberOfSingnIn = rice.getNumberOfSingnIn();
+                Long beforeEmpiricalValue = rice.getEmpiricalValue();
+                if (numberOfSingnIn == 0) {
+                    return R.error("浇水次数已用完,无法浇水").add("can", false).add("num", rice.getNumberOfSingnIn());
+                }
+                if (numberOfSingnIn <= 10) {
+                    // 浇水成功,更新水滴次数,经验值加
+                    rice.setNumberOfSingnIn((long) 0);
+                    rice.setEmpiricalValue(rice.getEmpiricalValue() + 10 * numberOfSingnIn);
+                    riceRepo.save(rice);
+                    createRiceOperationRecord(riceId, RiceOperationType.WATER_DROP, numberOfSingnIn, numberOfSingnIn, rice
+                            .getNumberOfSingnIn());
+                    createRiceOperationRecord(riceId, RiceOperationType.EMPIRICAL_VALUE, 10 * numberOfSingnIn, beforeEmpiricalValue, rice
+                            .getEmpiricalValue());
+
+                    // Save watering record
+                    RiceUserWaterDropRecord record = new RiceUserWaterDropRecord();
+                    record.setUserId(riceId);
+                    record.setWateringTime(LocalDateTime.now());
+                    riceUserWaterDropRecordRepo.save(record);
+
+                    return R.success("浇水成功").add("can", true).add("num", rice.getNumberOfSingnIn());
+                }
+                if (numberOfSingnIn > 10) {
+                    rice.setNumberOfSingnIn(rice.getNumberOfSingnIn() - 10);
+                    rice.setEmpiricalValue(rice.getEmpiricalValue() + 100);
+                    riceRepo.save(rice);
+                    createRiceOperationRecord(riceId, RiceOperationType.WATER_DROP, (long) 10, numberOfSingnIn, rice
+                            .getNumberOfSingnIn());
+                    createRiceOperationRecord(riceId, RiceOperationType.EMPIRICAL_VALUE, (long) 100, beforeEmpiricalValue, rice
+                            .getEmpiricalValue());
+
+                    // Save watering record
+                    RiceUserWaterDropRecord record = new RiceUserWaterDropRecord();
+                    record.setUserId(riceId);
+                    record.setWateringTime(LocalDateTime.now());
+                    riceUserWaterDropRecordRepo.save(record);
+
+                    return R.success("浇水成功").add("can", true).add("num", rice.getNumberOfSingnIn());
+                }
 
 
-    //根据用户ID和今日时间获取今日浇水次数的方法
-    public Long getTodayWateringCount(Long userId) {
-        List<RiceUserWaterDropRecord> records = riceUserWaterDropRecordRepo.findByUserId(userId);
-        Long count = records.stream()
-                .filter(RiceUserWaterDropRecord::isToday)
-                .count();
-        return count;
-    }
 
 
-    /**
-     * 每浇水一次可获得2经验值,升级所需经验值为下一等级所配置的经验值标准。按照以下方式来计算用户升级所需水滴数
-     *
-     * @param rice
-     * @return
-     */
-    public Long getWaterDropNeededForLevelUp(Rice rice) {
-        Long currentEmpiricalValue = rice.getEmpiricalValue();
-        String jsonString = sysConfigService.getString("rice_level");
-        JsonReader jsonReader = Json.createReader(new StringReader(jsonString));
-        JsonArray jsonArray = jsonReader.readArray();
-
-        for (int i = 0; i < jsonArray.size(); i++) {
-            JsonObject jsonObject = jsonArray.getJsonObject(i);
-            Long start = Long.valueOf(jsonObject.getInt("start"));
-            Long nextStart = 0L;
-            if (i + 1 < jsonArray.size()) {
-                JsonObject nextJsonObject = jsonArray.getJsonObject(i + 1);
-                nextStart = Long.valueOf(nextJsonObject.getInt("start"));
-            }
-            if (currentEmpiricalValue >= start && currentEmpiricalValue < nextStart) {
-                Long levelUpEmpiricalValue = nextStart - currentEmpiricalValue;
-                Long waterDropNeededForLevelUp = levelUpEmpiricalValue / 2;
-                return waterDropNeededForLevelUp;
-            }
+            case INVITE_FRIENDS:
+                // 处理水滴之邀请
+                Long numberOfInviteFriends = rice.getNumberOfInviteFriends();
+                Long beforeEmpiricalValue1 = rice.getEmpiricalValue();
+                if (numberOfInviteFriends == 0) {
+                    return R.error("电量次数已用完,无法充能").add("can", false);
+                }
+
+                if (numberOfInviteFriends <= 10) {
+
+                    // 浇水成功,更新水滴次数,经验值加2
+                    rice.setNumberOfInviteFriends((long) 0);
+                    rice.setEmpiricalValue(rice.getEmpiricalValue() + 10 * numberOfInviteFriends);
+                    riceRepo.save(rice);
+                    createRiceOperationRecord(riceId, RiceOperationType.WATER_DROP, numberOfInviteFriends, numberOfInviteFriends, rice
+                            .getNumberOfInviteFriends());
+                    createRiceOperationRecord(riceId, RiceOperationType.EMPIRICAL_VALUE, 10 * numberOfInviteFriends, beforeEmpiricalValue1, rice
+                            .getEmpiricalValue());
+
+                    // Save watering record
+                    RiceUserWaterDropRecord record1 = new RiceUserWaterDropRecord();
+                    record1.setUserId(riceId);
+                    record1.setWateringTime(LocalDateTime.now());
+                    riceUserWaterDropRecordRepo.save(record1);
+
+                    return R.success("浇水成功").add("can", true).add("num", rice.getNumberOfInviteFriends());
+                }
+                if (numberOfInviteFriends > 10) {
+                    // 浇水成功,更新水滴次数,经验值加2
+                    rice.setNumberOfInviteFriends(rice.getNumberOfInviteFriends() - 10);
+                    rice.setEmpiricalValue(rice.getEmpiricalValue() + 100L);
+                    riceRepo.save(rice);
+                    createRiceOperationRecord(riceId, RiceOperationType.WATER_DROP, 10L, numberOfInviteFriends, rice
+                            .getNumberOfInviteFriends());
+                    createRiceOperationRecord(riceId, RiceOperationType.EMPIRICAL_VALUE, 100L, beforeEmpiricalValue1, rice
+                            .getEmpiricalValue());
+
+                    // Save watering record
+                    RiceUserWaterDropRecord record1 = new RiceUserWaterDropRecord();
+                    record1.setUserId(riceId);
+                    record1.setWateringTime(LocalDateTime.now());
+                    riceUserWaterDropRecordRepo.save(record1);
+
+                    return R.success("浇水成功").add("can", true).add("num", rice.getNumberOfInviteFriends());
+                }
+
+
+            case FRIENDS_HELP:
+                // 处理水滴之助力
+                Long numberOfHelpOthers = rice.getNumberOfHelpOthers();
+                Long beforeEmpiricalValue2 = rice.getEmpiricalValue();
+                if (numberOfHelpOthers == 0) {
+                    return R.error("电量次数已用完,无法充能").add("can", false);
+                }
+                if (numberOfHelpOthers <= 10) {
+                    // 浇水成功,更新水滴次数,经验值加2
+                    rice.setNumberOfHelpOthers((long) 0);
+                    rice.setEmpiricalValue(rice.getEmpiricalValue() + 10 * numberOfHelpOthers);
+                    riceRepo.save(rice);
+                    createRiceOperationRecord(riceId, RiceOperationType.WATER_DROP, numberOfHelpOthers, numberOfHelpOthers, rice
+                            .getNumberOfHelpOthers());
+                    createRiceOperationRecord(riceId, RiceOperationType.EMPIRICAL_VALUE, 10 * numberOfHelpOthers, beforeEmpiricalValue2, rice
+                            .getEmpiricalValue());
+
+                    // Save watering record
+                    RiceUserWaterDropRecord record2 = new RiceUserWaterDropRecord();
+                    record2.setUserId(riceId);
+                    record2.setWateringTime(LocalDateTime.now());
+                    riceUserWaterDropRecordRepo.save(record2);
+
+                    return R.success("浇水成功").add("can", true).add("num", rice.getNumberOfHelpOthers());
+                }
+                if (numberOfHelpOthers > 10) {
+                    // 浇水成功,更新水滴次数,经验值加2
+                    rice.setNumberOfHelpOthers(rice.getNumberOfHelpOthers() - 10L);
+                    rice.setEmpiricalValue(rice.getEmpiricalValue() + 100L);
+                    riceRepo.save(rice);
+                    createRiceOperationRecord(riceId, RiceOperationType.WATER_DROP, 10L, numberOfHelpOthers, rice
+                            .getNumberOfHelpOthers());
+                    createRiceOperationRecord(riceId, RiceOperationType.EMPIRICAL_VALUE, 100L, beforeEmpiricalValue2, rice
+                            .getEmpiricalValue());
+
+                    // Save watering record
+                    RiceUserWaterDropRecord record2 = new RiceUserWaterDropRecord();
+                    record2.setUserId(riceId);
+                    record2.setWateringTime(LocalDateTime.now());
+                    riceUserWaterDropRecordRepo.save(record2);
+
+                    return R.success("浇水成功").add("can", true).add("num", rice.getNumberOfHelpOthers());
+                }
+
+
+            case REDEEM:
+                // 处理水滴之积分兑换
+                Long numberOfScoreExchanged = rice.getNumberOfScoreExchanged();
+                Long beforeEmpiricalValue3 = rice.getEmpiricalValue();
+                if (numberOfScoreExchanged == 0) {
+                    return R.error("电量次数已用完,无法充能").add("can", false);
+                }
+
+                if (numberOfScoreExchanged <= 10) {
+                    // 浇水成功,更新水滴次数,经验值加2
+                    rice.setNumberOfScoreExchanged((long) 0);
+                    rice.setEmpiricalValue(rice.getEmpiricalValue() + 10 * numberOfScoreExchanged);
+                    riceRepo.save(rice);
+                    createRiceOperationRecord(riceId, RiceOperationType.WATER_DROP, numberOfScoreExchanged, numberOfScoreExchanged, rice
+                            .getNumberOfScoreExchanged());
+                    createRiceOperationRecord(riceId, RiceOperationType.EMPIRICAL_VALUE, 10 * numberOfScoreExchanged, beforeEmpiricalValue3, rice
+                            .getEmpiricalValue());
+
+                    // Save watering record
+                    RiceUserWaterDropRecord record3 = new RiceUserWaterDropRecord();
+                    record3.setUserId(riceId);
+                    record3.setWateringTime(LocalDateTime.now());
+                    riceUserWaterDropRecordRepo.save(record3);
+
+                    return R.success("浇水成功").add("can", true).add("num", rice.getNumberOfScoreExchanged());
+                }
+                if (numberOfScoreExchanged > 10) {
+                    // 浇水成功,更新水滴次数,经验值加2
+                    rice.setNumberOfScoreExchanged(rice.getNumberOfScoreExchanged() - 10L);
+                    rice.setEmpiricalValue(rice.getEmpiricalValue() + 100L);
+                    riceRepo.save(rice);
+                    createRiceOperationRecord(riceId, RiceOperationType.WATER_DROP, 10L, numberOfScoreExchanged, rice
+                            .getNumberOfScoreExchanged());
+                    createRiceOperationRecord(riceId, RiceOperationType.EMPIRICAL_VALUE, 100L, beforeEmpiricalValue3, rice
+                            .getEmpiricalValue());
+
+                    // Save watering record
+                    RiceUserWaterDropRecord record3 = new RiceUserWaterDropRecord();
+                    record3.setUserId(riceId);
+                    record3.setWateringTime(LocalDateTime.now());
+                    riceUserWaterDropRecordRepo.save(record3);
+
+                    return R.success("浇水成功").add("can", true).add("num", rice.getNumberOfScoreExchanged());
+                }
+
+
+            case ACTIVITY_AWARD:
+                // 处理水滴之活动
+                Long numberOfActivity = rice.getNumberOfActivity();
+                Long beforeEmpiricalValue4 = rice.getEmpiricalValue();
+                if (numberOfActivity == 0) {
+                    return R.error("电量次数已用完,无法充能").add("can", false);
+                }
+                if (numberOfActivity <= 10) {
+                    // 浇水成功,更新水滴次数,经验值加2
+                    rice.setNumberOfActivity((long) 0);
+                    rice.setEmpiricalValue(rice.getEmpiricalValue() + 10 * numberOfActivity);
+                    riceRepo.save(rice);
+                    createRiceOperationRecord(riceId, RiceOperationType.WATER_DROP, numberOfActivity, numberOfActivity, rice
+                            .getNumberOfActivity());
+                    createRiceOperationRecord(riceId, RiceOperationType.EMPIRICAL_VALUE, 10 * numberOfActivity, beforeEmpiricalValue4, rice
+                            .getEmpiricalValue());
+
+                    // Save watering record
+                    RiceUserWaterDropRecord record4 = new RiceUserWaterDropRecord();
+                    record4.setUserId(riceId);
+                    record4.setWateringTime(LocalDateTime.now());
+                    riceUserWaterDropRecordRepo.save(record4);
+
+                    return R.success("浇水成功").add("can", true).add("num", rice.getNumberOfActivity());
+                }
+                if (numberOfActivity > 10) {
+                    // 浇水成功,更新水滴次数,经验值加2
+                    rice.setNumberOfActivity(rice.getNumberOfActivity() - 10L);
+                    rice.setEmpiricalValue(rice.getEmpiricalValue() + 100L);
+                    riceRepo.save(rice);
+                    createRiceOperationRecord(riceId, RiceOperationType.WATER_DROP, 10L, numberOfActivity, rice
+                            .getNumberOfActivity());
+                    createRiceOperationRecord(riceId, RiceOperationType.EMPIRICAL_VALUE, 100L, beforeEmpiricalValue4, rice
+                            .getEmpiricalValue());
+
+                    // Save watering record
+                    RiceUserWaterDropRecord record4 = new RiceUserWaterDropRecord();
+                    record4.setUserId(riceId);
+                    record4.setWateringTime(LocalDateTime.now());
+                    riceUserWaterDropRecordRepo.save(record4);
+
+                    return R.success("浇水成功").add("can", true).add("num", rice.getNumberOfActivity());
+                }
+
+
+            default:
+                // 处理未知类型
+                return R.error("浇水失败");
+
         }
         }
-        throw new BusinessException("没有配置对应的等级对应经验值");
+
     }
     }
 
 
 
 
     //签到
     //签到
     public R<?> signIn(Long userId) {
     public R<?> signIn(Long userId) {
-        Optional<Rice> byUserId = riceRepo.findByUserId(userId);
-        if (byUserId.isPresent()) {
-            Rice rice = byUserId.get();
-            Long lastSignInTime = rice.getLastSignInTime();
-            Long currentTime = System.currentTimeMillis();
-            Long beforeWaterDropCount = rice.getWaterDropCount();
-            Long beforeEmpiricalValue = rice.getEmpiricalValue();
-            // 判断上次签到时间是否为空,如果为空,则默认为从未签到过
-            if (lastSignInTime == null) {
-                rice.setWaterDropCount(rice.getWaterDropCount() + 1);
-                rice.setSignCount(rice.getSignCount() + 1);
-                rice.setLastSignInTime(currentTime);
-                riceRepo.save(rice);
-                createRiceOperationRecord(userId, RiceOperationType.WATER_DROP, (long) 1, beforeWaterDropCount, rice
-                        .getWaterDropCount());
-                return R.success("签到成功").add("can", true).add("waterDropCount", rice.getWaterDropCount());
-            }
-            // 判断今天是否已经签到过
-            if (DateUtils.isSameDay(new Date(lastSignInTime), new Date(currentTime))) {
-                return R.error("今天已经签到过了").add("can", false);
-            }
-            // 签到成功,水滴数加1,签到次数加1,更新签到时间
-            rice.setWaterDropCount(rice.getWaterDropCount() + 1);
+        Rice rice = riceRepo.findByUserId(userId).orElseThrow(new BusinessException("没找到用户"));
+        Long lastSignInTime = rice.getLastSignInTime();
+        Long beforeNumberOfSingnIn = rice.getNumberOfSingnIn();
+        // 判断上次签到时间是否为空,如果为空,则默认为从未签到过
+        if (lastSignInTime == null) {
+
             rice.setSignCount(rice.getSignCount() + 1);
             rice.setSignCount(rice.getSignCount() + 1);
-            rice.setLastSignInTime(currentTime);
+            rice.setLastSignInTime(System.currentTimeMillis());
+            rice.setNumberOfSingnIn(rice.getNumberOfSingnIn() + 1);
             riceRepo.save(rice);
             riceRepo.save(rice);
-            createRiceOperationRecord(userId, RiceOperationType.WATER_DROP, (long) 1, beforeWaterDropCount, rice
-                    .getWaterDropCount());
-            return R.success("签到成功").add("can", true).add("waterDropCount", rice.getWaterDropCount());
+            createRiceOperationRecord(userId, RiceOperationType.WATER_DROP, (long) 1, beforeNumberOfSingnIn, rice
+                    .getNumberOfSingnIn());
+            return R.success("签到成功").add("can", true).add("waterDropCount", rice.getNumberOfSingnIn());
+        }
+        // 判断今天是否已经签到过
+        if (DateUtils.isSameDay(new Date(lastSignInTime), new Date(System.currentTimeMillis()))) {
+            return R.error("今天已经签到过了").add("can", false);
         }
         }
-        return R.error("签到失败").add("can", false);
+        // 签到成功,水滴数加1,签到次数加1,更新签到时间
+        rice.setNumberOfSingnIn(rice.getNumberOfSingnIn() + 1);
+        rice.setSignCount(rice.getSignCount() + 1);
+        rice.setLastSignInTime(System.currentTimeMillis());
+        riceRepo.save(rice);
+
+        createRiceOperationRecord(userId, RiceOperationType.WATER_DROP, (long) 1, beforeNumberOfSingnIn, rice
+                .getNumberOfSingnIn());
+        return R.success("签到成功").add("can", true).add("waterDropCount", rice.getNumberOfSingnIn());
+
+
     }
     }
 
 
 
 
     //积分兑换水滴
     //积分兑换水滴
     public R<?> exchangeScoreForWaterDrop(User authenticatedUser) {
     public R<?> exchangeScoreForWaterDrop(User authenticatedUser) {
-        Long authId = authenticatedUser.getId();
-        Optional<Rice> byUserId = riceRepo.findByUserId(authId);
-        if (byUserId.isPresent()) {
-            Rice rice = byUserId.get();
-            Long selfScore = rice.getSelfScore();
-            Long beforeSelfScore = rice.getSelfScore();
-            Integer waterDropCount = Math.toIntExact(rice.getWaterDropCount());
-            Long beforeWaterDropCount = rice.getWaterDropCount();
+        Rice rice = riceRepo.findByUserId(authenticatedUser.getId()).orElseThrow(new BusinessException("没找到用户"));
+        //获取当前的积分
+        Long selfScore = rice.getSelfScore();
+        Long beforeSelfScore = rice.getSelfScore();
+        Long beforeNumberOfScoreExchanged = rice.getNumberOfScoreExchanged();
+        // 每次兑换需要消耗的积分和最大兑换次数
+        int exchangeScore = 10;
+        int maxExchangeCount = 10;
+        if (rice.getExchangeCount() == 10) {
+            return R.error("您今天已经兑换十次了.");
+        }
+        int exchangeCount = Math.min((int) (selfScore / exchangeScore), maxExchangeCount - rice.getExchangeCount());
+        int totalScore = exchangeCount * exchangeScore;
 
 
-            // 每次兑换需要消耗的积分和最大兑换次数
-            int exchangeScore = 2;
-            int maxExchangeCount = 10;
+        if (exchangeCount > 0) {
+            rice.setSelfScore(selfScore - totalScore);
+            rice.setNumberOfScoreExchanged(rice.getNumberOfScoreExchanged() + exchangeCount);
+            rice.setExchangeCount(rice.getExchangeCount() + exchangeCount);
+            riceRepo.save(rice);
+            createRiceOperationRecord(authenticatedUser.getId(), RiceOperationType.WATER_DROP, (long) exchangeCount, beforeNumberOfScoreExchanged, rice
+                    .getNumberOfScoreExchanged());
 
 
-            // 计算当前可兑换的次数和消耗的积分
-//            if (rice.getExchangeCount() == null) {
-//                rice.setExchangeCount(0);
-//            }
+//            createRiceOperationRecord(authenticatedUser.getId(), RiceOperationType.SELF_SCORE, (long) totalScore, beforeSelfScore, rice
+//                    .getSelfScore());
+            return R.success("兑换成功").add("exchangeCount", exchangeCount)
+                    .add("numberOfScoreExchanged", rice.getNumberOfScoreExchanged());
+        } else if (exchangeCount == 0) {
+            return R.error("兑换失败,当前积分不足").add("numberOfScoreExchanged", rice.getNumberOfScoreExchanged()).add("exchangeCount", rice.getExchangeCount());
 
 
-            if (rice.getExchangeCount() == 10) {
-                return R.error("您今天已经兑换十次了.").add("waterDropCount", rice.getWaterDropCount());
-            }
-            int exchangeCount = Math.min((int) (selfScore / exchangeScore), maxExchangeCount - rice.getExchangeCount());
-            int totalScore = exchangeCount * exchangeScore;
-
-            if (exchangeCount > 0) {
-                rice.setSelfScore(selfScore - totalScore);
-                rice.setWaterDropCount((long) (waterDropCount + exchangeCount));
-                rice.setExchangeCount(rice.getExchangeCount()+exchangeCount);
-                riceRepo.save(rice);
-                createRiceOperationRecord(authId, RiceOperationType.WATER_DROP, (long) exchangeCount, beforeWaterDropCount, rice
-                        .getWaterDropCount());
-
-                createRiceOperationRecord(authId, RiceOperationType.SELF_SCORE, (long) totalScore, beforeSelfScore, rice
-                        .getSelfScore());
-                return R.success("兑换成功").add("exchangeCount", exchangeCount)
-                        .add("waterDropCount", rice.getWaterDropCount());
-            } else if (exchangeCount == 0) {
-                return R.error("兑换失败,当前积分不足").add("waterDropCount", rice.getWaterDropCount());
-
-            } else {
-                return R.error("兑换失败,当前积分不足").add("exchangeCount", rice.getExchangeCount()).add("waterDropCount", rice.getWaterDropCount());
-            }
+        } else {
+            return R.error("兑换失败,当前积分不足").add("exchangeCount", rice.getExchangeCount()).add("numberOfScoreExchanged", rice.getNumberOfScoreExchanged());
         }
         }
-        return R.error("兑换失败,用户不存在");
+
     }
     }
 
 
 
 
@@ -532,7 +699,7 @@ public class RiceService {
         }
         }
         Rice rice = optionalRice.get();
         Rice rice = optionalRice.get();
         Long currentActivityPoints = rice.getSelfActivityScore();
         Long currentActivityPoints = rice.getSelfActivityScore();
-        Long beforeWaterDropCount = rice.getWaterDropCount();
+        Long beforeWaterDropCount = rice.getNumberOfActivity();
 
 
         // 计算兑换的水滴数量
         // 计算兑换的水滴数量
         Long exchangedWaterDropCount = (long) Math.floor(currentActivityPoints / 2.0);
         Long exchangedWaterDropCount = (long) Math.floor(currentActivityPoints / 2.0);
@@ -542,15 +709,15 @@ public class RiceService {
 
 
         // 更新用户活动积分和水滴数
         // 更新用户活动积分和水滴数
         rice.setSelfActivityScore(currentActivityPoints - (Long) exchangedWaterDropCount * 2);
         rice.setSelfActivityScore(currentActivityPoints - (Long) exchangedWaterDropCount * 2);
-        rice.setWaterDropCount(rice.getWaterDropCount() + exchangedWaterDropCount);
+        rice.setNumberOfActivity(rice.getNumberOfActivity() + exchangedWaterDropCount);
         riceRepo.save(rice);
         riceRepo.save(rice);
 
 
         // 记录水滴操作记录
         // 记录水滴操作记录
         createRiceOperationRecord(authenticatedUser
         createRiceOperationRecord(authenticatedUser
                 .getId(), RiceOperationType.WATER_DROP, exchangedWaterDropCount, beforeWaterDropCount, rice
                 .getId(), RiceOperationType.WATER_DROP, exchangedWaterDropCount, beforeWaterDropCount, rice
-                .getWaterDropCount());
+                .getNumberOfActivity());
         createRiceOperationRecord(authenticatedUser
         createRiceOperationRecord(authenticatedUser
-                .getId(), RiceOperationType.SELF_ACTIVITY_SCORE, (Long) exchangedWaterDropCount * 2, currentActivityPoints, rice
+                .getId(), RiceOperationType.SELF_ACTIVITY_SCORE, exchangedWaterDropCount * 2, currentActivityPoints, rice
                 .getSelfActivityScore());
                 .getSelfActivityScore());
 
 
         return R.success("兑换成功").add("counts", exchangedWaterDropCount);
         return R.success("兑换成功").add("counts", exchangedWaterDropCount);
@@ -558,6 +725,7 @@ public class RiceService {
 
 
     }
     }
 
 
+    //购买商品获得积分
     public void addScoreInOrder(Long userId) {
     public void addScoreInOrder(Long userId) {
 
 
         Optional<Rice> byUserId = riceRepo.findByUserId(userId);
         Optional<Rice> byUserId = riceRepo.findByUserId(userId);
@@ -572,28 +740,35 @@ public class RiceService {
             LocalDateTime now = LocalDateTime.now();
             LocalDateTime now = LocalDateTime.now();
             LocalDateTime todayStartTime = LocalDateTime.of(now.toLocalDate(), LocalTime.MIN).withNano(0);
             LocalDateTime todayStartTime = LocalDateTime.of(now.toLocalDate(), LocalTime.MIN).withNano(0);
             LocalDateTime todayEndTime = LocalDateTime.of(now.toLocalDate(), LocalTime.MAX).withNano(0);
             LocalDateTime todayEndTime = LocalDateTime.of(now.toLocalDate(), LocalTime.MAX).withNano(0);
-            int counts = riceOperationRecordRepo.countTodayRiceOperationType(rice.getUserId(), RiceOperationType.SELF_SCORE, todayStartTime, todayEndTime);
-            counts = counts + 1;
-            int defaultScore = 0;
-            for (int i = 0; i < jsonArray.size(); i++) {
-                JsonObject jsonObject = jsonArray.getJsonObject(i);
-                JsonArray countsArray = jsonObject.getJsonArray("counts");
-                int score = jsonObject.getInt("score");
 
 
-                int lowerBound = countsArray.getInt(0);
-                int upperBound = countsArray.getInt(countsArray.size() - 1);
-
-                if (counts >= lowerBound && counts <= upperBound) {
-                    defaultScore = score;
-                    break;
+            if (rice.getEarnPointsEveryDay() <= 80) {
+                int counts = riceOperationRecordRepo.countTodayRiceOperationType(rice.getUserId(), RiceOperationType.SELF_SCORE, todayStartTime, todayEndTime);
+                counts = counts + 1;
+                int defaultScore = 0;
+                for (int i = 0; i < jsonArray.size(); i++) {
+                    JsonObject jsonObject = jsonArray.getJsonObject(i);
+                    JsonArray countsArray = jsonObject.getJsonArray("counts");
+                    int score = jsonObject.getInt("score");
+
+                    int lowerBound = countsArray.getInt(0);
+                    int upperBound = countsArray.getInt(countsArray.size() - 1);
+
+                    if (counts >= lowerBound && counts <= upperBound) {
+                        defaultScore = score;
+                        break;
+                    }
                 }
                 }
+
+
+                    rice.setSelfScore(rice.getSelfScore() + defaultScore);
+                    rice.setEarnPointsEveryDay(rice.getEarnPointsEveryDay()+defaultScore);
+                    riceRepo.save(rice);
+                    createRiceOperationRecord(userId, RiceOperationType.SELF_SCORE, (long) defaultScore, beforeSelfScore, rice.getSelfScore());
+
             }
             }
-            // 如果 counts 不在任何范围内,则默认的 score 值是最后一个对象中的 score 值
-            if (!(defaultScore == 0 && jsonArray.size() > 0)) {
-                rice.setSelfScore(rice.getSelfScore() + defaultScore);
-                riceRepo.save(rice);
-                createRiceOperationRecord(userId, RiceOperationType.SELF_SCORE, (long) defaultScore, beforeSelfScore, rice.getSelfScore());
-            }
+
+
+
 
 
         }
         }
     }
     }

+ 20 - 0
src/main/java/com/izouma/nineth/service/RiceWaterTypeForWatreingService.java

@@ -0,0 +1,20 @@
+package com.izouma.nineth.service;
+
+import com.izouma.nineth.domain.RiceWaterTypeForWatreing;
+import com.izouma.nineth.dto.PageQuery;
+import com.izouma.nineth.repo.RiceWaterTypeForWatreingRepo;
+import com.izouma.nineth.utils.JpaUtils;
+import lombok.AllArgsConstructor;
+import org.springframework.data.domain.Page;
+import org.springframework.stereotype.Service;
+
+@Service
+@AllArgsConstructor
+public class RiceWaterTypeForWatreingService {
+
+    private RiceWaterTypeForWatreingRepo riceWaterTypeForWatreingRepo;
+
+    public Page<RiceWaterTypeForWatreing> all(PageQuery pageQuery) {
+        return riceWaterTypeForWatreingRepo.findAll(JpaUtils.toSpecification(pageQuery, RiceWaterTypeForWatreing.class), JpaUtils.toPageRequest(pageQuery));
+    }
+}

+ 86 - 10
src/main/java/com/izouma/nineth/service/StatisticService.java

@@ -5,10 +5,11 @@ import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import com.alibaba.fastjson.JSONObject;
 import com.alipay.api.domain.PriceInfo;
 import com.alipay.api.domain.PriceInfo;
 import com.github.kevinsawicki.http.HttpRequest;
 import com.github.kevinsawicki.http.HttpRequest;
-import com.izouma.nineth.domain.BalanceRecord;
-import com.izouma.nineth.domain.Order;
-import com.izouma.nineth.domain.RechargeOrder;
-import com.izouma.nineth.domain.User;
+import com.izouma.nineth.config.GeneralProperties;
+import com.izouma.nineth.domain.*;
+import com.izouma.nineth.domain.Collection;
+import com.izouma.nineth.dto.PageQuery;
+import com.izouma.nineth.dto.excel.GlobalSearchDTO;
 import com.izouma.nineth.enums.BalanceType;
 import com.izouma.nineth.enums.BalanceType;
 import com.izouma.nineth.enums.CollectionSource;
 import com.izouma.nineth.enums.CollectionSource;
 import com.izouma.nineth.enums.OrderStatus;
 import com.izouma.nineth.enums.OrderStatus;
@@ -18,6 +19,11 @@ import com.izouma.nineth.repo.*;
 import com.izouma.nineth.utils.netease.CheckSumBuilder;
 import com.izouma.nineth.utils.netease.CheckSumBuilder;
 import lombok.AllArgsConstructor;
 import lombok.AllArgsConstructor;
 import org.apache.commons.lang.RandomStringUtils;
 import org.apache.commons.lang.RandomStringUtils;
+import org.apache.rocketmq.spring.core.RocketMQTemplate;
+import org.springframework.core.env.Environment;
+import org.springframework.data.domain.Page;
+import org.springframework.data.domain.PageRequest;
+import org.springframework.data.redis.core.RedisTemplate;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 
 
 import javax.xml.stream.events.EndDocument;
 import javax.xml.stream.events.EndDocument;
@@ -33,12 +39,17 @@ import java.util.stream.Collectors;
 @AllArgsConstructor
 @AllArgsConstructor
 public class StatisticService {
 public class StatisticService {
 
 
-    private UserRepo          userRepo;
-    private OrderRepo         orderRepo;
-    private TokenHistoryRepo  tokenHistoryRepo;
-    private BalanceRecordRepo balanceRecordRepo;
-    private PhotoAssetRepo    photoAssetRepo;
-    private DomainOrderRepo   domainOrderRepo;
+    private UserRepo            userRepo;
+    private OrderRepo           orderRepo;
+    private TokenHistoryRepo    tokenHistoryRepo;
+    private BalanceRecordRepo   balanceRecordRepo;
+    private PhotoAssetRepo      photoAssetRepo;
+    private DomainOrderRepo     domainOrderRepo;
+    private CollectionService   collectionService;
+    private NewsRepo            newsRepo;
+    private MintActivityService mintActivityService;
+    private UserService         userService;
+    private ShowroomService     showroomService;
 
 
     public Map<String, Object> total(Long userId, Long companyId) {
     public Map<String, Object> total(Long userId, Long companyId) {
         User user1 = userRepo.findByIdAndDelFalse(userId).orElseThrow(new BusinessException("无用户"));
         User user1 = userRepo.findByIdAndDelFalse(userId).orElseThrow(new BusinessException("无用户"));
@@ -462,4 +473,69 @@ public class StatisticService {
         today.put("saas", Optional.ofNullable(saas).orElse(BigDecimal.ZERO));
         today.put("saas", Optional.ofNullable(saas).orElse(BigDecimal.ZERO));
         return today;
         return today;
     }
     }
+
+    public GlobalSearchDTO globalSearch(String search) {
+        GlobalSearchDTO globalSearchDTO = new GlobalSearchDTO();
+        PageQuery pageQuery = new PageQuery();
+        pageQuery.setPage(0);
+        pageQuery.setSize(6);
+        pageQuery.setSort("createdAt,desc");
+        pageQuery.setSearch(search);
+        Map<String, Object> map = new HashMap<>();
+        map.put("type", "DEFAULT,BLIND_BOX");
+        map.put("onShelf", true);
+        map.put("del", false);
+        map.put("notLike", "星星的孩子,测试");
+        pageQuery.setQuery(map);
+        Page<Collection> collections1 = collectionService.all(pageQuery).toPage();
+        //default
+        globalSearchDTO.setCollections(collections1.getContent());
+        globalSearchDTO.setCollectionsAll(collections1.getTotalElements() <= 6);
+        map.put("type", "PICTURE");
+        Page<Collection> collections2 = collectionService.all(pageQuery).toPage();
+        //picture
+        globalSearchDTO.setPictures(collections2.getContent());
+        globalSearchDTO.setPicturesAll(collections2.getTotalElements() <= 6);
+        map.put("type", "DOMAIN");
+        Page<Collection> collections3 = collectionService.all(pageQuery).toPage();
+        //domain
+        globalSearchDTO.setDomains(collections3.getContent());
+        globalSearchDTO.setDomainsAll(collections3.getTotalElements() <= 6);
+        PageRequest pageRequest = PageRequest.of(0, 6);
+        Page<News> news = newsRepo.findByTitleLike("%" + search + "%", pageRequest);
+        //news
+        globalSearchDTO.setNews(news.getContent());
+        globalSearchDTO.setNewsAll(news.getTotalElements() <= 6);
+        Map<String, Object> mintMap = new HashMap<>();
+        mintMap.put("companyId", 1);
+        mintMap.put("del", false);
+        pageQuery.setQuery(mintMap);
+        Page<MintActivity> mints = mintActivityService.all(pageQuery);
+        //mint
+        globalSearchDTO.setMintActivities(mints.getContent());
+        globalSearchDTO.setMintActivitiesAll(mints.getTotalElements() <= 6);
+        Map<String, Object> minterMap = new HashMap<>();
+        minterMap.put("companyId", 1);
+        minterMap.put("del", false);
+        minterMap.put("minter", true);
+        pageQuery.setQuery(minterMap);
+        Page<User> minters = userService.all(pageQuery).toPage();
+        //minter
+        globalSearchDTO.setMinters(minters.getContent());
+        globalSearchDTO.setMintersAll(minters.getTotalElements() <= 6);
+        Page<User> userPage = userRepo
+                .findByNicknameLikeOrIntroLike("%" + search + "%", "%" + search + "%", pageRequest);
+        //user
+        globalSearchDTO.setUsers(userPage.getContent());
+        globalSearchDTO.setUsersAll(userPage.getTotalElements() <= 6);
+        Map<String, Object> showRoomMap = new HashMap<>();
+        showRoomMap.put("del", false);
+        showRoomMap.put("status", "SUCCESS");
+        pageQuery.setQuery(showRoomMap);
+        Page<Showroom> showrooms = showroomService.all(pageQuery);
+        //showroom
+        globalSearchDTO.setShowrooms(showrooms.getContent());
+        globalSearchDTO.setShowroomAll(showrooms.getTotalElements() <= 6);
+        return globalSearchDTO;
+    }
 }
 }

+ 2 - 2
src/main/java/com/izouma/nineth/service/netease/NeteaseMessageService.java

@@ -40,9 +40,9 @@ public class NeteaseMessageService {
                     });
                     });
             String msgContent = map.get("msg");
             String msgContent = map.get("msg");
             if (msgContent
             if (msgContent
-                    .contains("cdn.raex.vip")) {
+                    .contains("cdn.raex.vip") & !msgContent.contains("<div")) {
                 result1 = contentAuditService.auditImage(msgContent);
                 result1 = contentAuditService.auditImage(msgContent);
-            } else if (msgContent.contains("raex-meta.oss-cn-shenzhen.aliyuncs.com")) {
+            } else if (msgContent.contains("raex-meta.oss-cn-shenzhen.aliyuncs.com") || msgContent.contains("<div")) {
                 result1 = true;
                 result1 = true;
             } else {
             } else {
                 result1 = contentAuditService.auditText(msgContent);
                 result1 = contentAuditService.auditText(msgContent);

+ 53 - 13
src/main/java/com/izouma/nineth/service/nftdomain/DomainAskService.java

@@ -1,6 +1,8 @@
 package com.izouma.nineth.service.nftdomain;
 package com.izouma.nineth.service.nftdomain;
 
 
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONArray;
+import com.izouma.nineth.config.GeneralProperties;
+import com.izouma.nineth.config.RedisKeys;
 import com.izouma.nineth.domain.Asset;
 import com.izouma.nineth.domain.Asset;
 import com.izouma.nineth.domain.DomainOrder;
 import com.izouma.nineth.domain.DomainOrder;
 import com.izouma.nineth.domain.User;
 import com.izouma.nineth.domain.User;
@@ -9,6 +11,7 @@ import com.izouma.nineth.dto.PageQuery;
 import com.izouma.nineth.dto.nftdomain.DomainAskGroup;
 import com.izouma.nineth.dto.nftdomain.DomainAskGroup;
 import com.izouma.nineth.dto.nftdomain.DomainResult;
 import com.izouma.nineth.dto.nftdomain.DomainResult;
 import com.izouma.nineth.enums.*;
 import com.izouma.nineth.enums.*;
+import com.izouma.nineth.event.OrderNotifyEvent;
 import com.izouma.nineth.exception.BusinessException;
 import com.izouma.nineth.exception.BusinessException;
 import com.izouma.nineth.repo.AssetRepo;
 import com.izouma.nineth.repo.AssetRepo;
 import com.izouma.nineth.repo.DomainOrderRepo;
 import com.izouma.nineth.repo.DomainOrderRepo;
@@ -19,7 +22,11 @@ import com.izouma.nineth.service.UserBalanceService;
 import com.izouma.nineth.utils.JpaUtils;
 import com.izouma.nineth.utils.JpaUtils;
 import com.izouma.nineth.utils.SecurityUtils;
 import com.izouma.nineth.utils.SecurityUtils;
 import lombok.AllArgsConstructor;
 import lombok.AllArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.rocketmq.spring.core.RocketMQTemplate;
 import org.springframework.data.domain.Page;
 import org.springframework.data.domain.Page;
+import org.springframework.data.redis.core.BoundValueOperations;
+import org.springframework.data.redis.core.RedisTemplate;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 
 
 import java.math.BigDecimal;
 import java.math.BigDecimal;
@@ -28,17 +35,22 @@ import java.util.HashSet;
 import java.util.List;
 import java.util.List;
 import java.util.Map;
 import java.util.Map;
 import java.util.Set;
 import java.util.Set;
+import java.util.concurrent.TimeUnit;
 
 
 @Service
 @Service
 @AllArgsConstructor
 @AllArgsConstructor
+@Slf4j
 public class DomainAskService {
 public class DomainAskService {
 
 
-    private final DomainAskRepo      domainAskRepo;
-    private final DomainOrderRepo    domainOrderRepo;
-    private final AssetRepo          assetRepo;
-    private final UserRepo           userRepo;
-    private final AssetService       assetService;
-    private final UserBalanceService userBalanceService;
+    private final DomainAskRepo                 domainAskRepo;
+    private final DomainOrderRepo               domainOrderRepo;
+    private final AssetRepo                     assetRepo;
+    private final UserRepo                      userRepo;
+    private final AssetService                  assetService;
+    private final UserBalanceService            userBalanceService;
+    private       RedisTemplate<String, Object> redisTemplate;
+    private       GeneralProperties             generalProperties;
+    private       RocketMQTemplate              rocketMQTemplate;
 
 
     public Page<DomainAsk> all(PageQuery pageQuery) {
     public Page<DomainAsk> all(PageQuery pageQuery) {
         return domainAskRepo
         return domainAskRepo
@@ -91,11 +103,19 @@ public class DomainAskService {
     }
     }
 
 
     public void notifyOrder(Long id, PayMethod payMethod, String transactionId) {
     public void notifyOrder(Long id, PayMethod payMethod, String transactionId) {
+        if (!getOrderLock(id)) {
+            log.info("订单回调失败 orderId: {} redis锁定, 重新发送到队列", id);
+            rocketMQTemplate.syncSend(generalProperties.getOrderNotifyTopic(),
+                    new OrderNotifyEvent(id, payMethod, transactionId, System.currentTimeMillis()));
+            return;
+        }
         DomainAsk domainAsk = domainAskRepo.findById(id).orElseThrow(new BusinessException("未找到账户"));
         DomainAsk domainAsk = domainAskRepo.findById(id).orElseThrow(new BusinessException("未找到账户"));
         domainAsk.setStatus(DomainAskStatus.ASKING);
         domainAsk.setStatus(DomainAskStatus.ASKING);
         domainAsk.setPayMethod(payMethod);
         domainAsk.setPayMethod(payMethod);
         domainAsk.setTransactionId(transactionId);
         domainAsk.setTransactionId(transactionId);
         domainAskRepo.save(domainAsk);
         domainAskRepo.save(domainAsk);
+
+        releaseOrderLock(domainAsk.getId());
     }
     }
 
 
     public List<Map<String, Object>> getGroups() {
     public List<Map<String, Object>> getGroups() {
@@ -106,16 +126,25 @@ public class DomainAskService {
     public void cancel(DomainAsk domainAsk) {
     public void cancel(DomainAsk domainAsk) {
 //        DomainAsk domainAsk = domainAskRepo.findById(id).orElseThrow(new BusinessException("未找到账户"));
 //        DomainAsk domainAsk = domainAskRepo.findById(id).orElseThrow(new BusinessException("未找到账户"));
         if (domainAsk.getStatus() == DomainAskStatus.NOT_PAID) {
         if (domainAsk.getStatus() == DomainAskStatus.NOT_PAID) {
+            log.info("尝试取消订单 {}", domainAsk.getId());
+            // 取消订单与订单回调不能同时进行,需要抢锁
+            if (!getOrderLock(domainAsk.getId())) {
+                log.error("订单取消失败 {}, redis锁了", domainAsk.getId());
+                return;
+            }
             domainAsk.setStatus(DomainAskStatus.CANCELLED);
             domainAsk.setStatus(DomainAskStatus.CANCELLED);
         }
         }
         if (domainAsk.getStatus() == DomainAskStatus.ASKING) {
         if (domainAsk.getStatus() == DomainAskStatus.ASKING) {
-            if (!SecurityUtils.getAuthenticatedUser().getId().equals(domainAsk.getUserId())) {
+            if (!SecurityUtils.getAuthenticatedUser().getId().equals(domainAsk.getUserId()) & !SecurityUtils
+                    .getAuthenticatedUser().getId().equals(domainAsk.getOwnerId())) {
                 throw new BusinessException("该叫价用户id不匹配,不能取消");
                 throw new BusinessException("该叫价用户id不匹配,不能取消");
             }
             }
             domainAsk.setStatus(DomainAskStatus.REFUNDED);
             domainAsk.setStatus(DomainAskStatus.REFUNDED);
             refund(domainAsk);
             refund(domainAsk);
         }
         }
         domainAskRepo.save(domainAsk);
         domainAskRepo.save(domainAsk);
+
+        releaseOrderLock(domainAsk.getId());
     }
     }
 
 
     public void refund(DomainAsk domainAsk) {
     public void refund(DomainAsk domainAsk) {
@@ -139,12 +168,12 @@ public class DomainAskService {
                         .getOwnerId(), domainAskStatuses) > 0) {
                         .getOwnerId(), domainAskStatuses) > 0) {
             throw new BusinessException("已有通过报价,请勿重复通过!");
             throw new BusinessException("已有通过报价,请勿重复通过!");
         }
         }
-        BigDecimal amount = domainAsk.getPrice()
-//                                 .subtract(BigDecimal.valueOf(1))
-                                     .multiply(BigDecimal
-                                             .valueOf(100 - domainAsk.getRoyalties() - domainAsk.getServiceCharge()))
-                                     .divide(new BigDecimal("100"), 2, RoundingMode.HALF_UP);
-        assetService.transfer(asset, amount,
+//        BigDecimal amount = domainAsk.getPrice()
+////                                 .subtract(BigDecimal.valueOf(1))
+//                                     .multiply(BigDecimal
+//                                             .valueOf(100 - domainAsk.getRoyalties() - domainAsk.getServiceCharge()))
+//                                     .divide(new BigDecimal("100"), 2, RoundingMode.HALF_UP);
+        assetService.transfer(asset, domainAsk.getPrice(),
                 userRepo.findById(domainAsk.getUserId())
                 userRepo.findById(domainAsk.getUserId())
                         .orElseThrow(new BusinessException("未找到用户")), TransferReason.ASK, domainAsk
                         .orElseThrow(new BusinessException("未找到用户")), TransferReason.ASK, domainAsk
                         .getId());
                         .getId());
@@ -156,5 +185,16 @@ public class DomainAskService {
         otherAsks.forEach(this::cancel);
         otherAsks.forEach(this::cancel);
     }
     }
 
 
+    // 获取订单锁,有效时间1小时
+    public boolean getOrderLock(Long orderId) {
+        BoundValueOperations<String, Object> ops = redisTemplate.boundValueOps(RedisKeys.ASK_LOCK + orderId);
+        Boolean flag = ops.setIfAbsent(1, 1, TimeUnit.HOURS);
+        return Boolean.TRUE.equals(flag);
+    }
+
+    // 释放订单锁
+    public void releaseOrderLock(Long orderId) {
+        redisTemplate.delete(RedisKeys.ASK_LOCK + orderId);
+    }
 
 
 }
 }

+ 5 - 0
src/main/java/com/izouma/nineth/web/AlipayNotifyController.java

@@ -89,6 +89,11 @@ public class AlipayNotifyController {
                             new OrderNotifyEvent(orderId, PayMethod.ALIPAY, tradeNo,
                             new OrderNotifyEvent(orderId, PayMethod.ALIPAY, tradeNo,
                                     System.currentTimeMillis(), OrderNotifyEvent.DOMAIN));
                                     System.currentTimeMillis(), OrderNotifyEvent.DOMAIN));
                     break;
                     break;
+                case "ask":
+                    rocketMQTemplate.syncSend(generalProperties.getOrderNotifyTopic(),
+                            new OrderNotifyEvent(orderId, PayMethod.ALIPAY, tradeNo,
+                                    System.currentTimeMillis(), OrderNotifyEvent.TYPE_ASK));
+                    break;
                 case "auctionOrder":
                 case "auctionOrder":
                     rocketMQTemplate.syncSend(generalProperties.getOrderNotifyTopic(),
                     rocketMQTemplate.syncSend(generalProperties.getOrderNotifyTopic(),
                             new OrderNotifyEvent(orderId, PayMethod.ALIPAY, tradeNo,
                             new OrderNotifyEvent(orderId, PayMethod.ALIPAY, tradeNo,

+ 4 - 0
src/main/java/com/izouma/nineth/web/AssetController.java

@@ -113,6 +113,10 @@ public class AssetController extends BaseController {
             DomainOrder domainOrder = domainOrderRepo
             DomainOrder domainOrder = domainOrderRepo
                     .findFirstByDomainNameAndOrderStatus(domainName, OrderStatus.FINISH);
                     .findFirstByDomainNameAndOrderStatus(domainName, OrderStatus.FINISH);
             asset.setEndTime(domainOrder.getEndTime());
             asset.setEndTime(domainOrder.getEndTime());
+            asset.setOpenHyperLink(domainOrder.isOpenHyperLink());
+            asset.setHyperLinkType(domainOrder.getHyperLinkType());
+            asset.setAddress(domainOrder.getAddress());
+            asset.setCurrentOwnerId(domainOrder.getCurrentOwnerId());
         }
         }
 //        orderRepo.findByIdAndDelFalse(asset.getOrderId()).ifPresent(order -> asset.setOpened(order.isOpened()));
 //        orderRepo.findByIdAndDelFalse(asset.getOrderId()).ifPresent(order -> asset.setOpened(order.isOpened()));
         return asset;
         return asset;

+ 2 - 2
src/main/java/com/izouma/nineth/web/DomainOrderController.java

@@ -127,10 +127,10 @@ public class DomainOrderController extends BaseController {
 
 
     //自己添加超链
     //自己添加超链
     @PostMapping("/addHyperLink")
     @PostMapping("/addHyperLink")
-    public void addHyperLink(@RequestParam Long collectionId, @RequestParam("openHyperLink") boolean openHyperLink,
+    public void addHyperLink(@RequestParam Long assetId, @RequestParam("openHyperLink") boolean openHyperLink,
                              @RequestParam("hyperLinkType") HyperLinkType hyperLinkType,
                              @RequestParam("hyperLinkType") HyperLinkType hyperLinkType,
                              @RequestParam("address") String address) {
                              @RequestParam("address") String address) {
-        domainOrderService.addHyperLink(collectionId, openHyperLink, hyperLinkType, address);
+        domainOrderService.addHyperLink(assetId, openHyperLink, hyperLinkType, address);
 
 
     }
     }
 
 

+ 7 - 2
src/main/java/com/izouma/nineth/web/HmPayController.java

@@ -42,8 +42,8 @@ public class HmPayController extends BaseController {
         String sign = params.get("sign");
         String sign = params.get("sign");
         params.remove("sign");
         params.remove("sign");
         String signStr = params.entrySet().stream().sorted(Map.Entry.comparingByKey())
         String signStr = params.entrySet().stream().sorted(Map.Entry.comparingByKey())
-                .map(e -> e.getKey() + "=" + e.getValue())
-                .collect(Collectors.joining("&"));
+                               .map(e -> e.getKey() + "=" + e.getValue())
+                               .collect(Collectors.joining("&"));
         boolean verify = AlipaySignature.verify(signStr, sign, hmPayProperties.getHmPublicKey(), "UTF-8", "RSA");
         boolean verify = AlipaySignature.verify(signStr, sign, hmPayProperties.getHmPublicKey(), "UTF-8", "RSA");
         log.info("签名校验: {}", verify);
         log.info("签名校验: {}", verify);
         if ("SUCCESS".equals(params.get("trade_status"))) {
         if ("SUCCESS".equals(params.get("trade_status"))) {
@@ -82,6 +82,11 @@ public class HmPayController extends BaseController {
                             new OrderNotifyEvent(id, PayMethod.SANDPAY, plat_trx_no,
                             new OrderNotifyEvent(id, PayMethod.SANDPAY, plat_trx_no,
                                     System.currentTimeMillis(), OrderNotifyEvent.DOMAIN));
                                     System.currentTimeMillis(), OrderNotifyEvent.DOMAIN));
                     break;
                     break;
+                case "ask":
+                    rocketMQTemplate.syncSend(generalProperties.getOrderNotifyTopic(),
+                            new OrderNotifyEvent(id, PayMethod.SANDPAY, plat_trx_no,
+                                    System.currentTimeMillis(), OrderNotifyEvent.TYPE_ASK));
+                    break;
             }
             }
         }
         }
         return "SUCCESS";
         return "SUCCESS";

+ 13 - 2
src/main/java/com/izouma/nineth/web/OrderController.java

@@ -5,6 +5,7 @@ import com.izouma.nineth.domain.Order;
 import com.izouma.nineth.domain.User;
 import com.izouma.nineth.domain.User;
 import com.izouma.nineth.dto.OrderDTO;
 import com.izouma.nineth.dto.OrderDTO;
 import com.izouma.nineth.dto.PageQuery;
 import com.izouma.nineth.dto.PageQuery;
+import com.izouma.nineth.dto.nftdomain.DomainOrderDTO;
 import com.izouma.nineth.enums.*;
 import com.izouma.nineth.enums.*;
 import com.izouma.nineth.exception.BusinessException;
 import com.izouma.nineth.exception.BusinessException;
 import com.izouma.nineth.repo.AssetRepo;
 import com.izouma.nineth.repo.AssetRepo;
@@ -78,8 +79,8 @@ public class OrderController extends BaseController {
         Page<Order> all = orderService.all(pageQuery);
         Page<Order> all = orderService.all(pageQuery);
         List<Long> userIds = all.getContent().stream().map(Order::getUserId).distinct().collect(Collectors.toList());
         List<Long> userIds = all.getContent().stream().map(Order::getUserId).distinct().collect(Collectors.toList());
         Map<Long, String> userMap = userRepo.findAllById(userIds)
         Map<Long, String> userMap = userRepo.findAllById(userIds)
-                .stream()
-                .collect(Collectors.toMap(User::getId, User::getNickname));
+                                            .stream()
+                                            .collect(Collectors.toMap(User::getId, User::getNickname));
         return all.map(order -> {
         return all.map(order -> {
             order.setNickname(userMap.get(order.getUserId()));
             order.setNickname(userMap.get(order.getUserId()));
             return order;
             return order;
@@ -247,5 +248,15 @@ public class OrderController extends BaseController {
     public void refundGas() throws ExecutionException, InterruptedException {
     public void refundGas() throws ExecutionException, InterruptedException {
         orderService.refundGas();
         orderService.refundGas();
     }
     }
+
+    @PostMapping("/domainOrderStatistic")
+    public Map<String, Object> domainOrderStatistic(int type) {
+        return orderService.domainTransferInfo(type);
+    }
+
+    @PostMapping("/newestOrder")
+    public Page<DomainOrderDTO> domainOrderStatistic(int type, Pageable pageable) {
+        return orderService.newestDomainTransfer(type, pageable);
+    }
 }
 }
 
 

+ 32 - 0
src/main/java/com/izouma/nineth/web/OrderPayControllerV2.java

@@ -345,4 +345,36 @@ public class OrderPayControllerV2 {
     public void payDomainAskBalance(@RequestParam Long id, @RequestParam String tradeCode) throws FontFormatException, IOException, WriterException {
     public void payDomainAskBalance(@RequestParam Long id, @RequestParam String tradeCode) throws FontFormatException, IOException, WriterException {
         orderPayService.payDomainAskBalance(id, SecurityUtils.getAuthenticatedUser().getId(), tradeCode);
         orderPayService.payDomainAskBalance(id, SecurityUtils.getAuthenticatedUser().getId(), tradeCode);
     }
     }
+
+    @RequestMapping(value = "/ask/ali")
+    @ResponseBody
+    public String payAskAli(Long id) {
+        return orderPayService.payAskAli(id);
+    }
+
+    @RequestMapping(value = "/ask/alipay_wx", method = RequestMethod.GET)
+    public String payAskAlipayWx(Long id, Model model) {
+        String payUrl = orderPayService.payAskOrder(id);
+        model.addAttribute("payUrl", payUrl);
+        model.addAttribute("orderId", id);
+        return "AlipayHtml";
+    }
+
+    @RequestMapping(value = "/ask/sandQuick", method = RequestMethod.GET, produces = "text/html")
+    @ResponseBody
+    public String payAskQuick(@RequestParam Long id) {
+        return orderPayService.payAskQuick(id);
+    }
+
+    @RequestMapping("/ask/sandQuickBind")
+    @ResponseBody
+    public String payAskQuickBind(@RequestParam Long id) {
+        return orderPayService.payAskQuickBind(id);
+    }
+
+    @RequestMapping(value = "/ask/agreement")
+    @ResponseBody
+    public Map<String, Object> payAskAgreement(@RequestParam Long id, String bindCardId) {
+        return orderPayService.payAskOrderAgreement(id, bindCardId);
+    }
 }
 }

+ 5 - 0
src/main/java/com/izouma/nineth/web/PayEaseController.java

@@ -72,6 +72,11 @@ public class PayEaseController {
                             new OrderNotifyEvent(id, PayMethod.SANDPAY, serialNumber,
                             new OrderNotifyEvent(id, PayMethod.SANDPAY, serialNumber,
                                     System.currentTimeMillis(), OrderNotifyEvent.DOMAIN));
                                     System.currentTimeMillis(), OrderNotifyEvent.DOMAIN));
                     break;
                     break;
+                case "ask":
+                    rocketMQTemplate.syncSend(generalProperties.getOrderNotifyTopic(),
+                            new OrderNotifyEvent(id, PayMethod.SANDPAY, serialNumber,
+                                    System.currentTimeMillis(), OrderNotifyEvent.TYPE_ASK));
+                    break;
             }
             }
         }
         }
         return "SUCCESS";
         return "SUCCESS";

+ 50 - 83
src/main/java/com/izouma/nineth/web/RiceController.java

@@ -1,11 +1,14 @@
 package com.izouma.nineth.web;
 package com.izouma.nineth.web;
 
 
 import com.izouma.nineth.domain.Rice;
 import com.izouma.nineth.domain.Rice;
+import com.izouma.nineth.domain.RiceUserWaterDropRecord;
 import com.izouma.nineth.domain.User;
 import com.izouma.nineth.domain.User;
 import com.izouma.nineth.dto.PageQuery;
 import com.izouma.nineth.dto.PageQuery;
 import com.izouma.nineth.dto.R;
 import com.izouma.nineth.dto.R;
 import com.izouma.nineth.dto.RiceDTO;
 import com.izouma.nineth.dto.RiceDTO;
 import com.izouma.nineth.enums.AuthorityName;
 import com.izouma.nineth.enums.AuthorityName;
+import com.izouma.nineth.enums.RiceOperationType;
+import com.izouma.nineth.enums.RiceWaterType;
 import com.izouma.nineth.exception.BusinessException;
 import com.izouma.nineth.exception.BusinessException;
 import com.izouma.nineth.repo.*;
 import com.izouma.nineth.repo.*;
 import com.izouma.nineth.service.*;
 import com.izouma.nineth.service.*;
@@ -21,6 +24,7 @@ import org.springframework.web.bind.annotation.*;
 
 
 import javax.servlet.http.HttpServletResponse;
 import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
 import java.io.IOException;
+import java.time.LocalDateTime;
 import java.util.*;
 import java.util.*;
 
 
 @RestController
 @RestController
@@ -28,18 +32,18 @@ import java.util.*;
 @AllArgsConstructor
 @AllArgsConstructor
 @Slf4j
 @Slf4j
 public class RiceController extends BaseController {
 public class RiceController extends BaseController {
-    private RiceService riceService;
-    private RiceRepo riceRepo;
-    private UserDetailService userDetailService;
-    private UserDetailRepo userDetailRepo;
-    private UserService userService;
-    private UserRepo userRepo;
-    private RiceInviteRepo RiceInviteRepo;
-    private RiceInviteService RiceInviteService;
-    private SysConfigService sysConfigService;
-    private SysConfigRepo sysConfigRepo;
-    private static final int MAX_NICKNAME_LENGTH = 14;
-    private static final String UPDATE_SUCCESS_MSG = "修改成功";
+    private              RiceService       riceService;
+    private              RiceRepo          riceRepo;
+    private              UserDetailService userDetailService;
+    private              UserDetailRepo    userDetailRepo;
+    private              UserService       userService;
+    private              UserRepo          userRepo;
+    private              RiceInviteRepo    RiceInviteRepo;
+    private              RiceInviteService RiceInviteService;
+    private              SysConfigService  sysConfigService;
+    private              SysConfigRepo     sysConfigRepo;
+    private static final int               MAX_NICKNAME_LENGTH = 14;
+    private static final String            UPDATE_SUCCESS_MSG  = "修改成功";
 
 
     @PreAuthorize("hasRole('ADMIN')")
     @PreAuthorize("hasRole('ADMIN')")
     @PostMapping("/save")
     @PostMapping("/save")
@@ -51,6 +55,7 @@ public class RiceController extends BaseController {
         }
         }
         return riceRepo.save(record);
         return riceRepo.save(record);
     }
     }
+
     @PreAuthorize("hasRole('ADMIN')")
     @PreAuthorize("hasRole('ADMIN')")
     @PostMapping("/all")
     @PostMapping("/all")
     public Page<Rice> all(@RequestBody PageQuery pageQuery) {
     public Page<Rice> all(@RequestBody PageQuery pageQuery) {
@@ -86,8 +91,7 @@ public class RiceController extends BaseController {
     //点击水稻游戏后对riceuser进行初始化赋值
     //点击水稻游戏后对riceuser进行初始化赋值
     @GetMapping("/current")
     @GetMapping("/current")
     public R<Rice> getCurrentUser() throws BusinessException {
     public R<Rice> getCurrentUser() throws BusinessException {
-        User authenticatedUser = SecurityUtils.getAuthenticatedUser();
-        return R.success(riceService.getCurrentRiceUser(authenticatedUser));
+        return R.success(riceService.getCurrentRiceUser(SecurityUtils.getAuthenticatedUser()));
     }
     }
 
 
     //修改用户昵称
     //修改用户昵称
@@ -98,24 +102,8 @@ public class RiceController extends BaseController {
 
 
     //等级显示
     //等级显示
     @GetMapping("/showLevel")
     @GetMapping("/showLevel")
-    public R<Map<String, Object>> getCurrentLevel() {
-        User authenticatedUser = SecurityUtils.getAuthenticatedUser();
-        Long authId = authenticatedUser.getId();
-        Optional<Rice> byUserId = riceRepo.findByUserId(authId);
-        if (byUserId.isPresent()) {
-            Rice rice = byUserId.get();
-            Map<String, Object> currentLevel = riceService.getCurrentLevel(rice.getEmpiricalValue());
-            Long riceLevel = (Long) currentLevel.get("currentLevel");
-            Double levelUpPercentage = (Double) currentLevel.get("levelUpPercentage");
-            rice.setLevel(riceLevel);
-            riceRepo.save(rice);
-            Map<String, Object> responseData = new HashMap<>();
-            responseData.put("riceLevel", currentLevel);
-            responseData.put("levelUpPercentage", levelUpPercentage);
-            return R.success(responseData).add("msg", "查询成功");
-        } else {
-            throw new BusinessException("用户不存在");
-        }
+    public R<Map<String, Object>> showLevel() {
+        return riceService.showLevel();
     }
     }
 
 
     //获取用户积分
     //获取用户积分
@@ -127,52 +115,37 @@ public class RiceController extends BaseController {
     //一个获取积分排行榜的接口
     //一个获取积分排行榜的接口
     @GetMapping("/scoreRanking")
     @GetMapping("/scoreRanking")
     public R<List<RiceDTO>> getTop100AndSelf() {
     public R<List<RiceDTO>> getTop100AndSelf() {
-        // 获取当前用户的id,假设这个方法可以获取当前用户的id
-        User authenticatedUser = SecurityUtils.getAuthenticatedUser();
-        Long authId = authenticatedUser.getId();
-        List<RiceDTO> top100 = riceService.getTop100(authId);
-        return R.success(top100);
+        return R.success(riceService.getTop100(SecurityUtils.getAuthenticatedUser().getId()));
     }
     }
 
 
 
 
     //只获取自己的排名
     //只获取自己的排名
     @GetMapping("/riceUserRank")
     @GetMapping("/riceUserRank")
     public R<?> getRiceUserRank() {
     public R<?> getRiceUserRank() {
-        User authenticatedUser = SecurityUtils.getAuthenticatedUser();
-        Long userId = authenticatedUser.getId();
-
-        return riceService.getRiceUserRank(userId);
+        return riceService.getRiceUserRank(SecurityUtils.getAuthenticatedUser().getId());
     }
     }
 
 
 
 
-    //浇水响应
-    @GetMapping("/watering")
-    public R<String> watering() {
-        return (R<String>) riceService.watering();
+    //浇水
+    @PostMapping("/waterDrop")
+    public R<?> waterDrop(@RequestParam("riceWaterType") RiceWaterType riceWaterType, @RequestParam Long riceId) {
+        return riceService.waterDrop(riceWaterType, riceId);
     }
     }
 
 
 
 
-    //获取今日已浇水次数和还需浇水次数升级的接口
-    @GetMapping("/watering/count")
-    public R<?> getWateringCount() {
-        User authenticatedUser = SecurityUtils.getAuthenticatedUser();
-        Long userId = authenticatedUser.getId();
-        Long todayWateringCount = riceService.getTodayWateringCount(userId);
-        Optional<Rice> byUserId = riceRepo.findByUserId(userId);
-        if (byUserId.isPresent()) {
-            Rice rice = byUserId.get();
-            Long waterDropNeededForLevelUp = riceService.getWaterDropNeededForLevelUp(rice);
-            return R.success(Map.of("todayWateringCount", todayWateringCount, "waterDropNeededForLevelUp", waterDropNeededForLevelUp));
-        }
-        return R.error("获取用户信息失败");
-    }
+//    //获取今日已浇水次数和还需浇水次数升级的接口
+//    @GetMapping("/watering/count")
+//    public R<?> getWateringCount() {
+//        Long todayWateringCount = riceService.getTodayWateringCount(SecurityUtils.getAuthenticatedUser().getId());
+//        Rice rice = riceRepo.findByUserId(SecurityUtils.getAuthenticatedUser().getId()).orElseThrow(new BusinessException("没找到记录"));
+//            Long waterDropNeededForLevelUp = riceService.getWaterDropNeededForLevelUp(rice);
+//            return R.success(Map.of("todayWateringCount", todayWateringCount, "waterDropNeededForLevelUp", waterDropNeededForLevelUp));
+//    }
 
 
     //签到
     //签到
     @GetMapping("/signin")
     @GetMapping("/signin")
     public R<?> signIn() {
     public R<?> signIn() {
-        User authenticatedUser = SecurityUtils.getAuthenticatedUser();
-        Long authId = authenticatedUser.getId();
-        return riceService.signIn(authId);
+        return riceService.signIn(SecurityUtils.getAuthenticatedUser().getId());
     }
     }
 
 
 
 
@@ -185,19 +158,18 @@ public class RiceController extends BaseController {
     //积分兑换水滴
     //积分兑换水滴
     @GetMapping("/exchangeScoreForWaterDrop")
     @GetMapping("/exchangeScoreForWaterDrop")
     public R<?> exchangeScoreForWaterDrop() {
     public R<?> exchangeScoreForWaterDrop() {
-        User authenticatedUser = SecurityUtils.getAuthenticatedUser();
-        return riceService.exchangeScoreForWaterDrop(authenticatedUser);
+        return riceService.exchangeScoreForWaterDrop(SecurityUtils.getAuthenticatedUser());
     }
     }
 
 
 
 
     //活动积分兑换水滴
     //活动积分兑换水滴
     @GetMapping("/exchangeActivityScoreForWaterDrop")
     @GetMapping("/exchangeActivityScoreForWaterDrop")
     public R<?> exchangeActivityScoreForWaterDrop() {
     public R<?> exchangeActivityScoreForWaterDrop() {
-        User authenticatedUser = SecurityUtils.getAuthenticatedUser();
-        return riceService.exchangeActivityScoreForWaterDrop(authenticatedUser);
+        return riceService.exchangeActivityScoreForWaterDrop(SecurityUtils.getAuthenticatedUser());
     }
     }
 
 
 
 
+    //测试添加用户
     @GetMapping("/newRiceUser")
     @GetMapping("/newRiceUser")
     public R<?> newRiceUser() {
     public R<?> newRiceUser() {
         User authenticatedUser = SecurityUtils.getAuthenticatedUser();
         User authenticatedUser = SecurityUtils.getAuthenticatedUser();
@@ -215,19 +187,17 @@ public class RiceController extends BaseController {
 
 
         UUID uuid = UUID.randomUUID();
         UUID uuid = UUID.randomUUID();
         Rice rice = new Rice();
         Rice rice = new Rice();
-            rice.setUserId(generateUniqueId());
-            rice.setAvatar(avatar);
-            rice.setNickname(nickname);
-            rice.setLevel(0L);
-            rice.setWaterDropCount(0L);
-            rice.setSignCount(0L);
-            rice.setSelfScore(0L);
-            rice.setSelfActivityScore(0L);
-            rice.setEmpiricalValue(0L);
-            riceRepo.save(rice);
-            return R.success("添加成功");
-        }
-
+        rice.setUserId(generateUniqueId());
+        rice.setAvatar(avatar);
+        rice.setNickname(nickname);
+        rice.setLevel(0L);
+        rice.setSignCount(0L);
+        rice.setSelfScore(0L);
+        rice.setSelfActivityScore(0L);
+        rice.setEmpiricalValue(0L);
+        riceRepo.save(rice);
+        return R.success("添加成功");
+    }
 
 
 
 
     public static Long generateUniqueId() {
     public static Long generateUniqueId() {
@@ -238,10 +208,7 @@ public class RiceController extends BaseController {
     }
     }
 
 
 
 
-
-
-
-    }
+}
 
 
 
 
 
 

+ 25 - 18
src/main/java/com/izouma/nineth/web/RiceInviteController.java

@@ -94,6 +94,8 @@ public class RiceInviteController extends BaseController {
             return R.error("不能自己助力自己");
             return R.error("不能自己助力自己");
         }
         }
 
 
+
+
         // 检查助力者是否已经助力过该用户
         // 检查助力者是否已经助力过该用户
         Optional<RiceInvite> invite = riceInviteRepo.findByHelperIdAndHelpeeIdAndCreateTimeBetween(helperId, helpeeId, getTodayStartTime(), getTodayEndTime());
         Optional<RiceInvite> invite = riceInviteRepo.findByHelperIdAndHelpeeIdAndCreateTimeBetween(helperId, helpeeId, getTodayStartTime(), getTodayEndTime());
         if (invite.isPresent()) {
         if (invite.isPresent()) {
@@ -110,21 +112,6 @@ public class RiceInviteController extends BaseController {
         }
         }
 
 
 
 
-        // 检查助力者是否已经助力过其他用户
-        Optional<RiceInvite> helperRice = riceInviteRepo.findByHelperIdAndCreateTimeBetween(helperId, getTodayStartTime(), getTodayEndTime());
-        if (helperRice.isPresent()) {
-            Optional<Rice> byUserId = riceRepo.findByUserId(helpeeId);
-            String avatar = null;
-            String nickname = null;
-            if (byUserId.isPresent()) {
-                Rice rice = byUserId.get();
-                avatar = rice.getAvatar();
-                nickname = rice.getNickname();
-
-            }
-            return R.error("您今天已经助力过其他用户,请勿重复助力").add("avatar", avatar).add("nickname", nickname);
-        }
-
         // 检查被助力者是否已经被别人助力
         // 检查被助力者是否已经被别人助力
         Optional<RiceInvite> helpeeRice = riceInviteRepo.findByHelpeeIdAndDelIsFalseAndCreateTimeBetween(helpeeId, getTodayStartTime(), getTodayEndTime());
         Optional<RiceInvite> helpeeRice = riceInviteRepo.findByHelpeeIdAndDelIsFalseAndCreateTimeBetween(helpeeId, getTodayStartTime(), getTodayEndTime());
         if (helpeeRice.isPresent()) {
         if (helpeeRice.isPresent()) {
@@ -141,6 +128,20 @@ public class RiceInviteController extends BaseController {
         }
         }
 
 
 
 
+        //助力者助力次数加一
+        Rice rice1 = riceRepo.findByUserId(helperId).orElseThrow(new BusinessException("没有找到记录"));
+        if(rice1.getHelpCount()>=2){
+            return R.error("您今日已助力两位好友,已达助力上限。").add("avatar", rice1.getAvatar()).add("nickname", rice1.getNickname());
+
+        }
+        rice1.setHelpCount(rice1.getHelpCount() + 1);
+        if(rice1.getHelpCount()==2){
+            Long BeforeNumberOfHelpOthers = rice1.getNumberOfHelpOthers();
+            rice1.setNumberOfHelpOthers(rice1.getNumberOfHelpOthers()+1);
+            riceRepo.save(rice1);
+            createRiceOperationRecord(helpeeId, RiceOperationType.WATER_DROP, 1L,BeforeNumberOfHelpOthers , rice1.getNumberOfHelpOthers());
+        }
+
         // 创建邀请记录
         // 创建邀请记录
         RiceInvite newInvite = new RiceInvite();
         RiceInvite newInvite = new RiceInvite();
         newInvite.setHelperId(helperId);
         newInvite.setHelperId(helperId);
@@ -152,14 +153,15 @@ public class RiceInviteController extends BaseController {
             Rice rice = byUserId.get();
             Rice rice = byUserId.get();
         }
         }
 
 
+
         // 增加被助力者的水滴数
         // 增加被助力者的水滴数
         Optional<Rice> rice = riceRepo.findByUserId(helpeeId);
         Optional<Rice> rice = riceRepo.findByUserId(helpeeId);
         if (rice.isPresent()) {
         if (rice.isPresent()) {
             Rice helpee = rice.get();
             Rice helpee = rice.get();
-            Long beforeWaterDropCount = helpee.getWaterDropCount();
-            helpee.setWaterDropCount(helpee.getWaterDropCount() + 1);
+            Long beforeWaterDropCount = helpee.getNumberOfInviteFriends();
+            helpee.setNumberOfInviteFriends(helpee.getNumberOfInviteFriends()+1);
             riceRepo.save(helpee);
             riceRepo.save(helpee);
-            createRiceOperationRecord(helpeeId, RiceOperationType.WATER_DROP, 1L, beforeWaterDropCount, helpee.getWaterDropCount());
+            createRiceOperationRecord(helpeeId, RiceOperationType.WATER_DROP, 1L, beforeWaterDropCount, helpee.getNumberOfInviteFriends());
         } else {
         } else {
             return R.error("未找到被助力者的用户信息").add("avatar", rice.get().getAvatar()).add("nickname", rice.get().getNickname());
             return R.error("未找到被助力者的用户信息").add("avatar", rice.get().getAvatar()).add("nickname", rice.get().getNickname());
         }
         }
@@ -169,6 +171,11 @@ public class RiceInviteController extends BaseController {
     }
     }
 
 
 
 
+
+
+
+
+
     private void createRiceOperationRecord(Long userId, RiceOperationType type, Long amount, Long beforeAmount, Long afterAmount) {
     private void createRiceOperationRecord(Long userId, RiceOperationType type, Long amount, Long beforeAmount, Long afterAmount) {
         RiceOperationRecord record = new RiceOperationRecord();
         RiceOperationRecord record = new RiceOperationRecord();
         record.setUserId(userId);
         record.setUserId(userId);

+ 60 - 0
src/main/java/com/izouma/nineth/web/RiceWaterTypeForWatreingController.java

@@ -0,0 +1,60 @@
+package com.izouma.nineth.web;
+import com.izouma.nineth.domain.RiceWaterTypeForWatreing;
+import com.izouma.nineth.service.RiceWaterTypeForWatreingService;
+import com.izouma.nineth.dto.PageQuery;
+import com.izouma.nineth.exception.BusinessException;
+import com.izouma.nineth.repo.RiceWaterTypeForWatreingRepo;
+import com.izouma.nineth.utils.ObjUtils;
+import com.izouma.nineth.utils.excel.ExcelUtils;
+import lombok.AllArgsConstructor;
+import org.springframework.data.domain.Page;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.util.List;
+
+@RestController
+@RequestMapping("/riceWaterTypeForWatreing")
+@AllArgsConstructor
+public class RiceWaterTypeForWatreingController extends BaseController {
+    private RiceWaterTypeForWatreingService riceWaterTypeForWatreingService;
+    private RiceWaterTypeForWatreingRepo riceWaterTypeForWatreingRepo;
+
+    //@PreAuthorize("hasRole('ADMIN')")
+    @PostMapping("/save")
+    public RiceWaterTypeForWatreing save(@RequestBody RiceWaterTypeForWatreing record) {
+        if (record.getId() != null) {
+            RiceWaterTypeForWatreing orig = riceWaterTypeForWatreingRepo.findById(record.getId()).orElseThrow(new BusinessException("无记录"));
+            ObjUtils.merge(orig, record);
+            return riceWaterTypeForWatreingRepo.save(orig);
+        }
+        return riceWaterTypeForWatreingRepo.save(record);
+    }
+
+
+    //@PreAuthorize("hasRole('ADMIN')")
+    @PostMapping("/all")
+    public Page<RiceWaterTypeForWatreing> all(@RequestBody PageQuery pageQuery) {
+        return riceWaterTypeForWatreingService.all(pageQuery);
+    }
+
+    @GetMapping("/get/{id}")
+    public RiceWaterTypeForWatreing get(@PathVariable Long id) {
+        return riceWaterTypeForWatreingRepo.findById(id).orElseThrow(new BusinessException("无记录"));
+    }
+
+    @PostMapping("/del/{id}")
+    public void del(@PathVariable Long id) {
+        riceWaterTypeForWatreingRepo.softDelete(id);
+    }
+
+    @GetMapping("/excel")
+    @ResponseBody
+    public void excel(HttpServletResponse response, PageQuery pageQuery) throws IOException {
+        List<RiceWaterTypeForWatreing> data = all(pageQuery).getContent();
+        ExcelUtils.export(response, data);
+    }
+}
+

+ 5 - 0
src/main/java/com/izouma/nineth/web/SandPayController.java

@@ -89,6 +89,11 @@ public class SandPayController {
                                         new OrderNotifyEvent(id, PayMethod.SANDPAY, payOrderCode,
                                         new OrderNotifyEvent(id, PayMethod.SANDPAY, payOrderCode,
                                                 System.currentTimeMillis(), OrderNotifyEvent.DOMAIN));
                                                 System.currentTimeMillis(), OrderNotifyEvent.DOMAIN));
                                 break;
                                 break;
+                            case "ask":
+                                rocketMQTemplate.syncSend(generalProperties.getOrderNotifyTopic(),
+                                        new OrderNotifyEvent(id, PayMethod.SANDPAY, payOrderCode,
+                                                System.currentTimeMillis(), OrderNotifyEvent.TYPE_ASK));
+                                break;
                         }
                         }
                     }
                     }
                     return "respCode=000000";
                     return "respCode=000000";

+ 6 - 0
src/main/java/com/izouma/nineth/web/StatisticController.java

@@ -1,5 +1,6 @@
 package com.izouma.nineth.web;
 package com.izouma.nineth.web;
 
 
+import com.izouma.nineth.dto.excel.GlobalSearchDTO;
 import com.izouma.nineth.service.CacheService;
 import com.izouma.nineth.service.CacheService;
 import com.izouma.nineth.service.StatisticService;
 import com.izouma.nineth.service.StatisticService;
 import com.izouma.nineth.utils.SecurityUtils;
 import com.izouma.nineth.utils.SecurityUtils;
@@ -122,4 +123,9 @@ public class StatisticController {
     public Map<String, Map<String, Object>> statisticDetail() {
     public Map<String, Map<String, Object>> statisticDetail() {
         return statisticService.statisticDetail();
         return statisticService.statisticDetail();
     }
     }
+
+    @PostMapping("/globalSearch")
+    public GlobalSearchDTO globalSearch(String search) {
+        return statisticService.globalSearch(search);
+    }
 }
 }

+ 9 - 9
src/main/java/com/izouma/nineth/web/nftdomain/DomainAskController.java

@@ -42,14 +42,14 @@ public class DomainAskController extends BaseController {
         return domainAskRepo.save(record);
         return domainAskRepo.save(record);
     }
     }
 
 
-    @PreAuthorize("hasRole('ADMIN')")
+    //    @PreAuthorize("hasRole('ADMIN')")
     @PostMapping("/create")
     @PostMapping("/create")
     public DomainAsk create(Long domainOrderId, BigDecimal price) {
     public DomainAsk create(Long domainOrderId, BigDecimal price) {
         Long userId = SecurityUtils.getAuthenticatedUser().getId();
         Long userId = SecurityUtils.getAuthenticatedUser().getId();
         return domainAskService.create(domainOrderId, userId, price);
         return domainAskService.create(domainOrderId, userId, price);
     }
     }
 
 
-    @PreAuthorize("hasRole('ADMIN')")
+    //    @PreAuthorize("hasRole('ADMIN')")
     @PostMapping("/cancel")
     @PostMapping("/cancel")
     public void cancel(Long id) {
     public void cancel(Long id) {
         DomainAsk domainAsk = domainAskRepo.findById(id).orElseThrow(new BusinessException("暂无"));
         DomainAsk domainAsk = domainAskRepo.findById(id).orElseThrow(new BusinessException("暂无"));
@@ -63,19 +63,19 @@ public class DomainAskController extends BaseController {
         domainAskService.cancel(domainAsk);
         domainAskService.cancel(domainAsk);
     }
     }
 
 
-    @PreAuthorize("hasRole('ADMIN')")
+    //    @PreAuthorize("hasRole('ADMIN')")
     @PostMapping("/accept")
     @PostMapping("/accept")
     public void accept(Long id) {
     public void accept(Long id) {
         domainAskService.accept(id);
         domainAskService.accept(id);
     }
     }
 
 
-    @PreAuthorize("hasRole('ADMIN')")
+    //    @PreAuthorize("hasRole('ADMIN')")
     @PostMapping("/maxPrice")
     @PostMapping("/maxPrice")
     public BigDecimal maxPrice(Long domainOrderId) {
     public BigDecimal maxPrice(Long domainOrderId) {
         return Optional.ofNullable(domainAskService.getMaxPrice(domainOrderId)).orElse(BigDecimal.ZERO);
         return Optional.ofNullable(domainAskService.getMaxPrice(domainOrderId)).orElse(BigDecimal.ZERO);
     }
     }
 
 
-    @PreAuthorize("hasRole('ADMIN')")
+    //    @PreAuthorize("hasRole('ADMIN')")
     @PostMapping("/groupInfo")
     @PostMapping("/groupInfo")
     public List<Map<String, Object>> getGroupInfo() {
     public List<Map<String, Object>> getGroupInfo() {
         return domainAskService.getGroups();
         return domainAskService.getGroups();
@@ -83,25 +83,25 @@ public class DomainAskController extends BaseController {
 
 
 
 
     //@PreAuthorize("hasRole('ADMIN')")
     //@PreAuthorize("hasRole('ADMIN')")
-    @PreAuthorize("hasRole('ADMIN')")
+//    @PreAuthorize("hasRole('ADMIN')")
     @PostMapping("/all")
     @PostMapping("/all")
     public Page<DomainAsk> all(@RequestBody PageQuery pageQuery) {
     public Page<DomainAsk> all(@RequestBody PageQuery pageQuery) {
         return domainAskService.all(pageQuery);
         return domainAskService.all(pageQuery);
     }
     }
 
 
-    @PreAuthorize("hasRole('ADMIN')")
+    //    @PreAuthorize("hasRole('ADMIN')")
     @GetMapping("/get/{id}")
     @GetMapping("/get/{id}")
     public DomainAsk get(@PathVariable Long id) {
     public DomainAsk get(@PathVariable Long id) {
         return domainAskRepo.findById(id).orElseThrow(new BusinessException("无记录"));
         return domainAskRepo.findById(id).orElseThrow(new BusinessException("无记录"));
     }
     }
 
 
-    @PreAuthorize("hasRole('ADMIN')")
+    //    @PreAuthorize("hasRole('ADMIN')")
     @PostMapping("/del/{id}")
     @PostMapping("/del/{id}")
     public void del(@PathVariable Long id) {
     public void del(@PathVariable Long id) {
         domainAskRepo.softDelete(id);
         domainAskRepo.softDelete(id);
     }
     }
 
 
-    @PreAuthorize("hasRole('ADMIN')")
+    //    @PreAuthorize("hasRole('ADMIN')")
     @GetMapping("/excel")
     @GetMapping("/excel")
     @ResponseBody
     @ResponseBody
     public void excel(HttpServletResponse response, PageQuery pageQuery) throws IOException {
     public void excel(HttpServletResponse response, PageQuery pageQuery) throws IOException {

Dosya farkı çok büyük olduğundan ihmal edildi
+ 0 - 0
src/main/resources/static/web-mobile/assets/internal/config.json


Dosya farkı çok büyük olduğundan ihmal edildi
+ 0 - 0
src/main/resources/static/web-mobile/assets/internal/import/02/02229b71c.json


Dosya farkı çok büyük olduğundan ihmal edildi
+ 0 - 0
src/main/resources/static/web-mobile/assets/internal/import/03/03855e110.json


Dosya farkı çok büyük olduğundan ihmal edildi
+ 0 - 0
src/main/resources/static/web-mobile/assets/main/config.json


Dosya farkı çok büyük olduğundan ihmal edildi
+ 0 - 0
src/main/resources/static/web-mobile/assets/main/import/04/047fd44c3.json


Dosya farkı çok büyük olduğundan ihmal edildi
+ 0 - 0
src/main/resources/static/web-mobile/assets/main/import/07/0722a61c0.json


Dosya farkı çok büyük olduğundan ihmal edildi
+ 0 - 0
src/main/resources/static/web-mobile/assets/main/import/08/08997832d.json


Dosya farkı çok büyük olduğundan ihmal edildi
+ 0 - 0
src/main/resources/static/web-mobile/assets/main/import/0b/0bba3bf2c.json


Dosya farkı çok büyük olduğundan ihmal edildi
+ 0 - 0
src/main/resources/static/web-mobile/assets/main/import/0e/0e6574479.json


BIN
src/main/resources/static/web-mobile/assets/main/import/24/241c9a6d-9bb2-4e32-ad36-7ccd57900057.cconb


BIN
src/main/resources/static/web-mobile/assets/main/import/24/24c14049-280c-4d85-96b2-2787547a4bf3.cconb


BIN
src/main/resources/static/web-mobile/assets/main/import/38/380ef80f-545e-4ad6-a2f1-982243651433.cconb


BIN
src/main/resources/static/web-mobile/assets/main/import/56/56c49332-afff-453f-92cf-4a474f92bce9@3c910.cconb


BIN
src/main/resources/static/web-mobile/assets/main/import/ac/ac5e989e-666e-45d7-a349-b66da3ed049c@48976.cconb


BIN
src/main/resources/static/web-mobile/assets/main/import/b3/b302a0e5-7787-4f4b-97f7-e54f7b9ac7ec.cconb


BIN
src/main/resources/static/web-mobile/assets/main/import/f0/f05bac55-23db-4b2f-919a-fd8f42abe301.cconb


Dosya farkı çok büyük olduğundan ihmal edildi
+ 0 - 0
src/main/resources/static/web-mobile/assets/main/index.js


BIN
src/main/resources/static/web-mobile/assets/main/native/08/082f4a3b-0c79-4872-ac51-ba481418af9a.png


BIN
src/main/resources/static/web-mobile/assets/main/native/09/09acc84b-4970-400c-a4da-45e8b4771e81.png


BIN
src/main/resources/static/web-mobile/assets/main/native/12/1263d74c-8167-4928-91a6-4e2672411f47@fc873.bin


BIN
src/main/resources/static/web-mobile/assets/main/native/13/132a64f1-e0fb-48ce-b541-3cb7f411c659.png


BIN
src/main/resources/static/web-mobile/assets/main/native/24/24c419ea-63a8-4ea1-a9d0-7fc469489bbc.png


BIN
src/main/resources/static/web-mobile/assets/main/native/2d/2dd75ecd-6937-49dd-868f-1e9f8382e65b.png


BIN
src/main/resources/static/web-mobile/assets/main/native/46/4657582d-01c4-4131-8b1c-6c99f02044e7.png


BIN
src/main/resources/static/web-mobile/assets/main/native/46/4668b013-2ed9-4731-b896-d7ea3b296493.jpg


BIN
src/main/resources/static/web-mobile/assets/main/native/46/468525b9-cc53-4d1d-82f0-b6fd624eb41c.png


BIN
src/main/resources/static/web-mobile/assets/main/native/56/56c49332-afff-453f-92cf-4a474f92bce9@86c21.bin


BIN
src/main/resources/static/web-mobile/assets/main/native/56/56c49332-afff-453f-92cf-4a474f92bce9@aa173.bin


BIN
src/main/resources/static/web-mobile/assets/main/native/6a/6a4eb777-1480-451c-a430-99f7e894c42c.png


BIN
src/main/resources/static/web-mobile/assets/main/native/6b/6bce5383-9fb9-4c4b-8288-d3ca0805b7dd.png


BIN
src/main/resources/static/web-mobile/assets/main/native/77/77ed749d-5b30-4730-b78b-1e1cd6f6c1d5.png


BIN
src/main/resources/static/web-mobile/assets/main/native/79/7931b9ee-c0b6-4e67-a802-39e1c3697801.png


BIN
src/main/resources/static/web-mobile/assets/main/native/79/79b90ed2-74b2-4899-b6e5-1f82e298d98a.png


BIN
src/main/resources/static/web-mobile/assets/main/native/7f/7fa7777a-9955-4b5a-83d6-b289050e6cb3@0259a.bin


+ 108 - 0
src/main/resources/static/web-mobile/assets/main/native/86/86f25d5c-9de5-454f-a5f9-ee16603e6701.plist

@@ -0,0 +1,108 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+  <dict>
+    <key>angle</key>
+    <integer>360</integer>
+    <key>angleVariance</key>
+    <integer>360</integer>
+    <key>blendFuncDestination</key>
+    <integer>1</integer>
+    <key>blendFuncSource</key>
+    <integer>2</integer>
+    <key>duration</key>
+    <integer>-1</integer>
+    <key>emitterType</key>
+    <integer>0</integer>
+    <key>finishColorAlpha</key>
+    <real>0.8399999737739563</real>
+    <key>finishColorBlue</key>
+    <real>0.0771484375</real>
+    <key>finishColorGreen</key>
+    <real>0.6349284052848816</real>
+    <key>finishColorRed</key>
+    <real>0.6808268427848816</real>
+    <key>finishColorVarianceAlpha</key>
+    <real>0.7400000095367432</real>
+    <key>finishColorVarianceBlue</key>
+    <real>0.9800000190734863</real>
+    <key>finishColorVarianceGreen</key>
+    <real>0.9800000190734863</real>
+    <key>finishColorVarianceRed</key>
+    <real>0.41999998688697815</real>
+    <key>finishParticleSize</key>
+    <real>30.31999969482422</real>
+    <key>finishParticleSizeVariance</key>
+    <integer>0</integer>
+    <key>gravityx</key>
+    <real>0.25</real>
+    <key>gravityy</key>
+    <real>0.8600000143051147</real>
+    <key>maxParticles</key>
+    <integer>200</integer>
+    <key>maxRadius</key>
+    <integer>100</integer>
+    <key>maxRadiusVariance</key>
+    <integer>0</integer>
+    <key>minRadius</key>
+    <integer>0</integer>
+    <key>particleLifespan</key>
+    <real>0.20000000298023224</real>
+    <key>particleLifespanVariance</key>
+    <real>0.5</real>
+    <key>radialAccelVariance</key>
+    <real>65.79000091552734</real>
+    <key>radialAcceleration</key>
+    <real>-671.0499877929688</real>
+    <key>rotatePerSecond</key>
+    <integer>0</integer>
+    <key>rotatePerSecondVariance</key>
+    <integer>0</integer>
+    <key>rotationEnd</key>
+    <real>-47.369998931884766</real>
+    <key>rotationEndVariance</key>
+    <real>-142.11000061035156</real>
+    <key>rotationStart</key>
+    <real>-47.369998931884766</real>
+    <key>rotationStartVariance</key>
+    <integer>0</integer>
+    <key>sourcePositionVariancex</key>
+    <integer>7</integer>
+    <key>sourcePositionVariancey</key>
+    <integer>7</integer>
+    <key>sourcePositionx</key>
+    <real>373.7277526855469</real>
+    <key>sourcePositiony</key>
+    <real>478.40472412109375</real>
+    <key>speed</key>
+    <integer>0</integer>
+    <key>speedVariance</key>
+    <real>190.7899932861328</real>
+    <key>startColorAlpha</key>
+    <real>0.6399999856948853</real>
+    <key>startColorBlue</key>
+    <real>0.3375650942325592</real>
+    <key>startColorGreen</key>
+    <real>0.7879231572151184</real>
+    <key>startColorRed</key>
+    <real>0.794921875</real>
+    <key>startColorVarianceAlpha</key>
+    <real>0.7799999713897705</real>
+    <key>startColorVarianceBlue</key>
+    <real>0.6800000071525574</real>
+    <key>startColorVarianceGreen</key>
+    <integer>1</integer>
+    <key>startColorVarianceRed</key>
+    <real>0.8999999761581421</real>
+    <key>startParticleSize</key>
+    <real>3.369999885559082</real>
+    <key>startParticleSizeVariance</key>
+    <integer>50</integer>
+    <key>tangentialAccelVariance</key>
+    <real>65.79000091552734</real>
+    <key>tangentialAcceleration</key>
+    <real>-92.11000061035156</real>
+    <key>spriteFrameUuid</key>
+    <string>24c419ea-63a8-4ea1-a9d0-7fc469489bbc@f9941</string>
+  </dict>
+</plist>

BIN
src/main/resources/static/web-mobile/assets/main/native/89/894cfae3-6b66-4d9c-b0d3-78a9d2fac553.png


BIN
src/main/resources/static/web-mobile/assets/main/native/ac/ac5e989e-666e-45d7-a349-b66da3ed049c@0bd78.bin


BIN
src/main/resources/static/web-mobile/assets/main/native/ac/ac5e989e-666e-45d7-a349-b66da3ed049c@42c5c.bin


BIN
src/main/resources/static/web-mobile/assets/main/native/ac/ac5e989e-666e-45d7-a349-b66da3ed049c@4984c.png


BIN
src/main/resources/static/web-mobile/assets/main/native/ac/ac5e989e-666e-45d7-a349-b66da3ed049c@7a673.png


BIN
src/main/resources/static/web-mobile/assets/main/native/ac/ac5e989e-666e-45d7-a349-b66da3ed049c@84cbb.png


BIN
src/main/resources/static/web-mobile/assets/main/native/ac/ac5e989e-666e-45d7-a349-b66da3ed049c@86c21.bin


BIN
src/main/resources/static/web-mobile/assets/main/native/ac/ac5e989e-666e-45d7-a349-b66da3ed049c@9baa8.bin


BIN
src/main/resources/static/web-mobile/assets/main/native/ac/ac5e989e-666e-45d7-a349-b66da3ed049c@aa173.bin


BIN
src/main/resources/static/web-mobile/assets/main/native/ac/ac5e989e-666e-45d7-a349-b66da3ed049c@d96f5.png


BIN
src/main/resources/static/web-mobile/assets/main/native/ac/ac5e989e-666e-45d7-a349-b66da3ed049c@e32c4.png


BIN
src/main/resources/static/web-mobile/assets/main/native/ac/ac5e989e-666e-45d7-a349-b66da3ed049c@f5713.bin


BIN
src/main/resources/static/web-mobile/assets/main/native/af/afc47931-f066-46b0-90be-9fe61f213428.png


BIN
src/main/resources/static/web-mobile/assets/main/native/b5/b5b27ab1-e740-4398-b407-848fc2b2c897.png


BIN
src/main/resources/static/web-mobile/assets/main/native/b9/b910ce1c-58e2-403a-89cd-e83e9af0960f.png


BIN
src/main/resources/static/web-mobile/assets/main/native/cc/ccc16058-d983-4c2b-ad70-9c8cea33c32c.png


BIN
src/main/resources/static/web-mobile/assets/main/native/cf/cf4b43f2-6105-46f8-99c0-470b139c3f9e.png


BIN
src/main/resources/static/web-mobile/assets/main/native/ec/ec7451fb-1e0d-4b9f-8523-802b5fbe7415.png


Bu fark içinde çok fazla dosya değişikliği olduğu için bazı dosyalar gösterilmiyor