Browse Source

Merge branch 'dev'

# Conflicts:
#	src/main/java/com/izouma/nineth/repo/UserRepo.java
xiongzhu 4 years ago
parent
commit
b116ca5a5e

+ 9 - 0
src/main/java/com/izouma/nineth/repo/SysConfigRepo.java

@@ -1,11 +1,20 @@
 package com.izouma.nineth.repo;
 
 import com.izouma.nineth.domain.SysConfig;
+import org.springframework.cache.annotation.CachePut;
+import org.springframework.cache.annotation.Cacheable;
 import org.springframework.data.jpa.repository.JpaRepository;
 import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
 
+import javax.annotation.Nonnull;
 import java.util.Optional;
 
 public interface SysConfigRepo extends JpaRepository<SysConfig, String>, JpaSpecificationExecutor<SysConfig> {
+    @Cacheable("sysConfig")
     Optional<SysConfig> findByName(String name);
+
+    @Override
+    @CachePut(value = "sysConfig", key = "#record.name")
+    @Nonnull
+    SysConfig save(@Nonnull SysConfig record);
 }

+ 0 - 2
src/main/java/com/izouma/nineth/repo/UserRepo.java

@@ -24,8 +24,6 @@ public interface UserRepo extends JpaRepository<User, Long>, JpaSpecificationExe
     @CachePut(value = "userInfo",key = "#user.id")
     User save(@NonNull User user);
 
-    Optional<User> findById(@NonNull Long id);
-
     @Cacheable("user")
     User findByUsernameAndDelFalse(String username);
 

+ 5 - 3
src/main/java/com/izouma/nineth/service/OrderService.java

@@ -325,7 +325,9 @@ public class OrderService {
         if (collection.getSource().equals(CollectionSource.TRANSFER)) {
             Asset asset = assetRepo.findById(collection.getAssetId()).orElseThrow(new BusinessException("无记录"));
             User owner = userRepo.findById(asset.getUserId()).orElseThrow(new BusinessException("拥有者用户不存在"));
+            restAmount = divMoney(restAmount, divMembers, "0", BigDecimal.valueOf(1), true); // gas费
             if (collection.getServiceCharge() + collection.getRoyalties() > 0) {
+                // 手续费和服务费
                 restAmount = divMoney(totalAmount, restAmount, divMembers, "0",
                         collection.getServiceCharge() + collection.getRoyalties(), true);
             }
@@ -461,9 +463,9 @@ public class OrderService {
                     collectionRepo.delete(collection);
 
                     // 发送短信提醒用户转让成功
-//                    if (asset != null && asset.getUserId() != null) {
-//                        smsService.sellOut(userRepo.findPhoneById(asset.getUserId()));
-//                    }
+                    if (asset != null && asset.getUserId() != null) {
+                        smsService.sellOut(userRepo.findPhoneById(asset.getUserId()));
+                    }
 
                 } else {
                     orderRepo.save(order);

+ 0 - 5
src/main/java/com/izouma/nineth/service/SysConfigService.java

@@ -6,7 +6,6 @@ import com.izouma.nineth.exception.BusinessException;
 import com.izouma.nineth.repo.SysConfigRepo;
 import com.izouma.nineth.utils.JpaUtils;
 import lombok.AllArgsConstructor;
-import org.springframework.cache.annotation.Cacheable;
 import org.springframework.data.domain.Page;
 import org.springframework.stereotype.Service;
 
@@ -24,13 +23,11 @@ public class SysConfigService {
         return sysConfigRepo.findAll(JpaUtils.toSpecification(pageQuery, SysConfig.class), JpaUtils.toPageRequest(pageQuery));
     }
 
-    @Cacheable("SysConfigServiceGetBigDecimal")
     public BigDecimal getBigDecimal(String name) {
         return sysConfigRepo.findByName(name).map(sysConfig -> new BigDecimal(sysConfig.getValue()))
                 .orElse(BigDecimal.ZERO);
     }
 
-    @Cacheable("SysConfigServiceGetTime")
     public LocalTime getTime(String name) {
         String str = sysConfigRepo.findByName(name).map(SysConfig::getValue)
                 .orElseThrow(new BusinessException("配置不存在"));
@@ -38,14 +35,12 @@ public class SysConfigService {
         return LocalTime.from(dateTimeFormatter.parse(str));
     }
 
-    @Cacheable("SysConfigServiceGetBoolean")
     public boolean getBoolean(String name) {
         String str = sysConfigRepo.findByName(name).map(SysConfig::getValue)
                 .orElseThrow(new BusinessException("配置不存在"));
         return str.equals("1");
     }
 
-    @Cacheable("SysConfigServiceGetInt")
     public int getInt(String name) {
         String str = sysConfigRepo.findByName(name).map(SysConfig::getValue)
                 .orElseThrow(new BusinessException("配置不存在"));

+ 1 - 1
src/main/java/com/izouma/nineth/service/UserService.java

@@ -456,7 +456,7 @@ public class UserService {
         String accountId = adapayService.createSettleAccount(user.getMemberId(), identityAuth.getRealName(),
                 identityAuth.getIdNo(), phone, bankNo);
         user.setSettleAccountId(accountId);
-        userRepo.save(user);
+        userRepo.saveAndFlush(user);
 
         userBankCardRepo.save(UserBankCard.builder()
                 .bank(bankValidate.getBank())

+ 9 - 0
src/main/java/com/izouma/nineth/web/OrderPayController.java

@@ -5,6 +5,10 @@ import com.github.binarywang.wxpay.bean.order.WxPayMpOrderResult;
 import com.github.binarywang.wxpay.constant.WxPayConstants;
 import com.github.binarywang.wxpay.exception.WxPayException;
 import com.huifu.adapay.core.exception.BaseAdaPayException;
+import com.izouma.nineth.domain.Order;
+import com.izouma.nineth.enums.OrderStatus;
+import com.izouma.nineth.exception.BusinessException;
+import com.izouma.nineth.repo.OrderRepo;
 import com.izouma.nineth.service.AssetService;
 import com.izouma.nineth.service.GiftOrderService;
 import com.izouma.nineth.service.OrderService;
@@ -30,6 +34,7 @@ public class OrderPayController {
     private final AssetService     assetService;
     private final WxMpService      wxMpService;
     private final GiftOrderService giftOrderService;
+    private final OrderRepo        orderRepo;
 
     @RequestMapping(value = "/alipay_h5", method = RequestMethod.GET)
     @ResponseBody
@@ -39,6 +44,10 @@ public class OrderPayController {
 
     @RequestMapping(value = "/alipay_wx", method = RequestMethod.GET)
     public String payOrderAlipayWx(Long id, Model model) throws BaseAdaPayException {
+        Order order = orderRepo.findById(id).orElseThrow(new BusinessException("订单不存在"));
+        if (order.getStatus() != OrderStatus.NOT_PAID) {
+            return "redirect:/9th/store";
+        }
         String payUrl = (String) orderService.payAdapay(id, "alipay_wap", null);
         model.addAttribute("payUrl", payUrl);
         model.addAttribute("orderId", id);

+ 0 - 1
src/main/java/com/izouma/nineth/web/SysConfigController.java

@@ -43,7 +43,6 @@ public class SysConfigController extends BaseController {
         return sysConfigRepo.findByName(id).orElseThrow(new BusinessException("无记录"));
     }
 
-    @Cacheable("SysConfigServiceGetBigDecimal")
     @GetMapping("/getDecimal/{id}")
     public BigDecimal getDecimal(@PathVariable String id) {
         return sysConfigService.getBigDecimal(id);

+ 2 - 2
src/main/resources/application.yaml

@@ -131,9 +131,9 @@ aliyun:
   oss-end-point: oss-cn-shenzhen.aliyuncs.com
   oss-bucket-name: raex-meta
   oss-domain: https://raex-meta.oss-cn-shenzhen.aliyuncs.com
-  sms-sign: 华储艺术品中心
+  sms-sign: 绿洲数字藏品中心
   sms-code: SMS_228870098
-  sell-out-code: SMS_232907378
+  sell-out-code: SMS_232892483
 
 general:
   host: https://test.raex.vip

+ 1 - 1
src/main/resources/static/download_raex.html

@@ -59,7 +59,7 @@
             align-items: center;
             justify-content: center;
             color: rgb(0, 255, 18);
-            font-size: 18px;
+            font-size: 16px;
             border-radius: 10px;
             background: rgba(0, 0, 0, 0);
             outline: none;

BIN
src/main/resources/static/img/app_icon_raex.png


+ 1 - 1
src/main/vue/src/views/BannerEdit.vue

@@ -130,7 +130,7 @@ export default {
             },
             typeOptions: [
                 { label: '首页', value: 'HOME' },
-                { label: '探索', value: 'DISCOVER' },
+                { label: '发现页', value: 'DISCOVER' },
                 { label: '铸造者', value: 'MINTER' },
                 { label: '市场', value: 'MARKET' },
                 { label: 'PC官方活动', value: 'PC_ACT' },

+ 1 - 1
src/main/vue/src/views/BannerList.vue

@@ -109,7 +109,7 @@ export default {
             downloading: false,
             typeOptions: [
                 { label: '首页', value: 'HOME' },
-                { label: '探索', value: 'DISCOVER' },
+                { label: '发现页', value: 'DISCOVER' },
                 { label: '铸造者', value: 'MINTER' },
                 { label: '市场', value: 'MARKET' },
                 { label: 'PC官方活动', value: 'PC_ACT' },