Browse Source

Merge branch 'dev' of xiongzhu/raex_back into master

sunkean 3 years ago
parent
commit
580a5a9ba3

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

@@ -59,7 +59,7 @@ public class UserAssetSummary {
 //    @Column(columnDefinition = "int default 0")
 //    private int auctionedNum;
 
-    @ApiModelProperty("资产分类")
+    @ApiModelProperty("系列名称")
     private String prefixName;
 
     @ApiModelProperty("图片")

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

@@ -46,4 +46,7 @@ public interface BlindBoxItemRepo extends JpaRepository<BlindBoxItem, Long>, Jpa
     @Modifying
     @Transactional
     void increaseStockAndDecreaseSale(Long id, int num);
+
+    @Query(nativeQuery = true, value = "select CONCAT(sum(stock),'/',sum(total))from blind_box_item where blind_box_id = ?1 and name like ?2 AND NAME NOT LIKE ?3")
+    String getBlindBoxRare(Long blindBoxId, String rare, String not);
 }

+ 1 - 0
src/main/java/com/izouma/nineth/security/WebSecurityConfig.java

@@ -135,6 +135,7 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
                 .antMatchers("/payOrder/v2/**/sandQuick").permitAll()
                 .antMatchers("/pay/v2/**/sandQuick").permitAll()
                 .antMatchers("/user/faceAuthNotify/*").permitAll()
+                .antMatchers("/blindBoxItem/rare/*").permitAll()
                 // all other requests need to be authenticated
                 .anyRequest().authenticated().and()
                 // make sure we use stateless session; session won't be used to

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

@@ -284,6 +284,7 @@ public class AssetService {
                 .assetId(id)
                 .number(asset.getNumber())
                 .tags(new HashSet<>())
+                .prefixName(asset.getPrefixName())
                 .build();
         if (asset.getTags() != null) {
             collection.getTags().addAll(asset.getTags());
@@ -395,6 +396,7 @@ public class AssetService {
                 .assetId(id)
                 .number(asset.getNumber())
                 .tags(new HashSet<>())
+                .prefixName(asset.getPrefixName())
                 .build();
         if (asset.getTags() != null) {
             collection.getTags().addAll(asset.getTags());

+ 24 - 0
src/main/java/com/izouma/nineth/service/BlindBoxItemService.java

@@ -5,18 +5,42 @@ import com.izouma.nineth.dto.PageQuery;
 import com.izouma.nineth.dto.PageWrapper;
 import com.izouma.nineth.repo.BlindBoxItemRepo;
 import com.izouma.nineth.utils.JpaUtils;
+import jodd.util.StringUtil;
 import lombok.AllArgsConstructor;
 import org.springframework.cache.annotation.Cacheable;
 import org.springframework.stereotype.Service;
 
+import java.util.HashMap;
+
 @Service
 @AllArgsConstructor
 public class BlindBoxItemService {
 
     private BlindBoxItemRepo blindBoxItemRepo;
 
+    private final String SSR = "SSR";
+    private final String SR = "SR";
+    private final String U = "U";
+
     @Cacheable(value = "blindBoxList", key = "#pageQuery.hashCode()")
     public PageWrapper<BlindBoxItem> all(PageQuery pageQuery) {
         return PageWrapper.of(blindBoxItemRepo.findAll(JpaUtils.toSpecification(pageQuery, BlindBoxItem.class), JpaUtils.toPageRequest(pageQuery)));
     }
+
+    public HashMap<String, String> getBlindBoxRare(Long blindBoxId) {
+        HashMap<String, String> rare = new HashMap<>();
+        String ssr = blindBoxItemRepo.getBlindBoxRare(blindBoxId, "%" + SSR + " #%", "%" + U + " #%");
+        if (StringUtil.isNotBlank(ssr)) {
+            rare.put(SSR, ssr);
+        }
+        String sr = blindBoxItemRepo.getBlindBoxRare(blindBoxId, "%" + SR + " #%", "%" + SSR + " #%");
+        if (StringUtil.isNotBlank(sr)) {
+            rare.put(SR, sr);
+        }
+        String u = blindBoxItemRepo.getBlindBoxRare(blindBoxId, "%" + U + " #%", "%" + SR + " #%");
+        if (StringUtil.isNotBlank(u)) {
+            rare.put(U, u);
+        }
+        return rare;
+    }
 }

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

@@ -217,6 +217,7 @@ public class CollectionService {
         collection.setTotalQuota(record.getTotalQuota());
         collection.setMinimumCharge(record.getMinimumCharge());
         collection.setRule(record.getRule());
+        collection.setPrefixName(record.getPrefixName());
         if (record.getTags().isEmpty()) {
             collection.setTags(null);
         } else {

+ 81 - 4
src/main/java/com/izouma/nineth/service/OrderPayService.java

@@ -6,10 +6,7 @@ import com.izouma.nineth.config.GeneralProperties;
 import com.izouma.nineth.domain.*;
 import com.izouma.nineth.dto.PayQuery;
 import com.izouma.nineth.dto.UserBankCard;
-import com.izouma.nineth.enums.AuctionOrderStatus;
-import com.izouma.nineth.enums.MintOrderStatus;
-import com.izouma.nineth.enums.OrderStatus;
-import com.izouma.nineth.enums.PayMethod;
+import com.izouma.nineth.enums.*;
 import com.izouma.nineth.event.OrderNotifyEvent;
 import com.izouma.nineth.exception.BusinessException;
 import com.izouma.nineth.repo.*;
@@ -55,6 +52,7 @@ public class OrderPayService {
     private final UserBankCardRepo    userBankCardRepo;
     private final AuctionOrderRepo    auctionOrderRepo;
     private final AuctionOrderService auctionOrderService;
+    private final IdentityAuthRepo    identityAuthRepo;
 
     public static void setPayChannel(String payChannel) {
         log.info("set pay channel {}", payChannel);
@@ -92,6 +90,20 @@ public class OrderPayService {
                 generalProperties.getHost() + "/9th/home");
     }
 
+    @Cacheable(value = "payOrder", key = "'order#'+#orderId")
+    public String payOrderQuickBind(Long orderId) {
+        Order order = orderRepo.findById(orderId).orElseThrow(new BusinessException("订单不存在"));
+        if (order.getStatus() != OrderStatus.NOT_PAID) {
+            throw new BusinessException("订单状态错误");
+        }
+        IdentityAuth identityAuth = identityAuthRepo.findFirstByUserIdAndStatusAndDelFalseOrderByCreatedAtDesc(order.getUserId(), AuthStatus.SUCCESS)
+                .orElseThrow(new BusinessException("请先完成实名认证"));
+        return sandPayService.payQuickBind(orderId + "", order.getName(), order.getTotalPrice(),
+                order.getCreatedAt().plusMinutes(3), Constants.OrderNotifyType.ORDER,
+                generalProperties.getHost() + "/9th/home",
+                order.getUserId(), identityAuth.getRealName(), identityAuth.getIdNo());
+    }
+
     public void payOrderBalance(Long orderId, Long userId, String tradeCode) {
         Order order = orderRepo.findById(orderId).orElseThrow(new BusinessException("订单不存在"));
         if (order.getStatus() != OrderStatus.NOT_PAID) {
@@ -165,6 +177,20 @@ public class OrderPayService {
                 generalProperties.getHost() + "/9th/home");
     }
 
+    @Cacheable(value = "payOrder", key = "'gift#'+#orderId")
+    public String payGiftQuickBind(Long orderId) {
+        GiftOrder order = giftOrderRepo.findById(orderId).orElseThrow(new BusinessException("订单不存在"));
+        if (order.getStatus() != OrderStatus.NOT_PAID) {
+            throw new BusinessException("订单状态错误");
+        }
+        IdentityAuth identityAuth = identityAuthRepo.findFirstByUserIdAndStatusAndDelFalseOrderByCreatedAtDesc(order.getUserId(), AuthStatus.SUCCESS)
+                .orElseThrow(new BusinessException("请先完成实名认证"));
+        return sandPayService.payQuickBind(orderId + "", "转赠" + order.getAssetId(), order.getGasPrice(),
+                order.getCreatedAt().plusMinutes(3), Constants.OrderNotifyType.GIFT,
+                generalProperties.getHost() + "/9th/home",
+                order.getUserId(), identityAuth.getRealName(), identityAuth.getIdNo());
+    }
+
     public void payGiftBalance(Long orderId, Long userId, String tradeCode) {
         GiftOrder order = giftOrderRepo.findById(orderId).orElseThrow(new BusinessException("订单不存在"));
         if (order.getStatus() != OrderStatus.NOT_PAID) {
@@ -222,6 +248,20 @@ public class OrderPayService {
                 generalProperties.getHost() + "/9th/home");
     }
 
+    @Cacheable(value = "payOrder", key = "'mintOrder#'+#orderId")
+    public String payMintQuickBind(Long orderId) {
+        MintOrder order = mintOrderRepo.findById(orderId).orElseThrow(new BusinessException("订单不存在"));
+        if (order.getStatus() != MintOrderStatus.NOT_PAID) {
+            throw new BusinessException("订单状态错误");
+        }
+        IdentityAuth identityAuth = identityAuthRepo.findFirstByUserIdAndStatusAndDelFalseOrderByCreatedAtDesc(order.getUserId(), AuthStatus.SUCCESS)
+                .orElseThrow(new BusinessException("请先完成实名认证"));
+        return sandPayService.payQuickBind(orderId + "", "铸造活动:" + order.getMintActivityId(),
+                order.getGasPrice(), order.getCreatedAt().plusMinutes(3), Constants.OrderNotifyType.MINT,
+                generalProperties.getHost() + "/9th/home",
+                order.getUserId(), identityAuth.getRealName(), identityAuth.getIdNo());
+    }
+
     public void payMintOrderBalance(Long orderId, Long userId, String tradeCode) {
         MintOrder order = mintOrderRepo.findById(orderId).orElseThrow(new BusinessException("订单不存在"));
         if (order.getStatus() != MintOrderStatus.NOT_PAID) {
@@ -336,6 +376,29 @@ public class OrderPayService {
                 generalProperties.getHost() + "/9th/home");
     }
 
+    public String rechargeQuickBind(Long userId, BigDecimal amount) {
+        BigDecimal minAmount = sysConfigService.getBigDecimal("min_recharge_amount");
+        if (amount.compareTo(minAmount) < 0) {
+            throw new BusinessException("充值金额不能小于" + minAmount);
+        }
+        if (amount.compareTo(new BigDecimal("50000")) > 0) {
+            throw new BusinessException("充值金额不能大于50000");
+        }
+        IdentityAuth identityAuth = identityAuthRepo.findFirstByUserIdAndStatusAndDelFalseOrderByCreatedAtDesc(userId, AuthStatus.SUCCESS)
+                .orElseThrow(new BusinessException("请先完成实名认证"));
+        RechargeOrder order = RechargeOrder.builder()
+                .id(snowflakeIdWorker.nextId())
+                .userId(userId)
+                .amount(amount)
+                .status(OrderStatus.NOT_PAID)
+                .build();
+        rechargeOrderRepo.save(order);
+        return sandPayService.payQuickBind(order.getId() + "", "余额充值",
+                order.getAmount(), LocalDateTime.now().plusMinutes(3), Constants.OrderNotifyType.RECHARGE,
+                generalProperties.getHost() + "/9th/home",
+                userId, identityAuth.getRealName(), identityAuth.getIdNo());
+    }
+
     public JSONObject refund(String orderId, String transactionId, BigDecimal amount, String channel) {
         switch (channel) {
             case Constants.PayChannel.SAND: {
@@ -413,6 +476,20 @@ public class OrderPayService {
 
     @Cacheable(value = "payOrder", key = "'auctionOrder#'+#orderId")
     public String payAuctionQuick(Long orderId) {
+        AuctionOrder order = auctionOrderRepo.findById(orderId).orElseThrow(new BusinessException("订单不存在"));
+        if (order.getStatus() != AuctionOrderStatus.NOT_PAID) {
+            throw new BusinessException("订单状态错误");
+        }
+        IdentityAuth identityAuth = identityAuthRepo.findFirstByUserIdAndStatusAndDelFalseOrderByCreatedAtDesc(order.getUserId(), AuthStatus.SUCCESS)
+                .orElseThrow(new BusinessException("请先完成实名认证"));
+        return sandPayService.payQuickBind(orderId + "", "拍卖:" + order.getName(),
+                order.getTotalPrice(), order.getCreatedAt().plusMinutes(3), Constants.OrderNotifyType.AUCTION,
+                generalProperties.getHost() + "/9th/home",
+                order.getUserId(), identityAuth.getRealName(), identityAuth.getIdNo());
+    }
+
+    @Cacheable(value = "payOrder", key = "'auctionOrder#'+#orderId")
+    public String payAuctionQuickBind(Long orderId) {
         AuctionOrder order = auctionOrderRepo.findById(orderId).orElseThrow(new BusinessException("订单不存在"));
         if (order.getStatus() != AuctionOrderStatus.NOT_PAID) {
             throw new BusinessException("订单状态错误");

+ 96 - 4
src/main/java/com/izouma/nineth/service/SandPayService.java

@@ -14,6 +14,7 @@ import com.izouma.nineth.repo.GiftOrderRepo;
 import com.izouma.nineth.repo.MintOrderRepo;
 import com.izouma.nineth.repo.OrderRepo;
 import com.izouma.nineth.utils.DateTimeUtils;
+import com.izouma.nineth.utils.MD5Util;
 import com.izouma.nineth.utils.SnowflakeIdWorker;
 import lombok.AllArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
@@ -26,15 +27,14 @@ import java.io.IOException;
 import java.math.BigDecimal;
 import java.math.RoundingMode;
 import java.net.URLDecoder;
+import java.net.URLEncoder;
 import java.nio.charset.StandardCharsets;
 import java.text.DecimalFormat;
 import java.text.DecimalFormatSymbols;
+import java.text.SimpleDateFormat;
 import java.time.LocalDateTime;
 import java.time.format.DateTimeFormatter;
-import java.util.HashMap;
-import java.util.Locale;
-import java.util.Map;
-import java.util.Optional;
+import java.util.*;
 import java.util.concurrent.TimeUnit;
 
 @Service
@@ -235,6 +235,98 @@ public class SandPayService {
         throw new BusinessException(Constants.PAY_ERR_MSG, msg);
     }
 
+    public String payQuickBind(String orderId, String subject, BigDecimal amount, LocalDateTime expireAt,
+                               String type, String returnUrl, Long userId, String name, String idNo) {
+        String pOrderId = paddingOrderId(orderId);
+
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
+        Calendar calendar = Calendar.getInstance();
+        String createTime = sdf.format(calendar.getTime());
+        calendar.add(Calendar.HOUR, 1);
+        String endTime = sdf.format(calendar.getTime());
+
+        String version = "10";
+        String mer_no = sandPayProperties.getMid();
+        //key1
+        String mer_key = "fvLh4EEoJPJEkqg+6s3B8sTRVREAyVAxS34+5JGiJOmIFnIrnfD1k/KiUYo5Nfb7tBx0jj9HOI0=";
+        UUID uuid = UUID.randomUUID();
+        String mer_order_no = uuid.toString().replaceAll("-", "");
+        String notify_url = sandPayProperties.getNotifyUrl();
+        String order_amt = amount.toPlainString();
+        //"userId":"用户在商户下唯一标识 1-10位","userName":"证件姓名","idCard":"18位身份证号码"
+        String pay_extra = "{\"userId\":\"" + userId + "\",\"userName\":\"" + name + "\",\"idCard\":\"" + idNo + "\"}";
+        //md5key
+        String key = "KvKQYXhwvkoQRAiQN2IzVSaecqYFP8emDHJrLettbShZsd8k/V2OU/myAV6My/qeotZ8K0WG8ifDzgelCexY7517gmF7SqFUcyuKgSC+HFNmn14C4iy9JRy0NvsSJRjgMzZWAhrwNL5ixuz+UKFTiw==";
+
+        JSONObject extend = new JSONObject();
+        extend.put("type", type);
+        extend.put("orderId", pOrderId);
+        extend.put("id", pOrderId);
+
+        Map<String, String> map = new LinkedHashMap<>();
+        map.put("accsplit_flag", "NO");
+        map.put("create_ip", "127_0_0_1");
+        map.put("create_time", createTime);
+        map.put("extend", extend.toJSONString());
+//        if(!(gh_static_url==null||"".equals(gh_static_url)))map.put("gh_static_url",gh_static_url);;
+        map.put("mer_key", mer_key);
+        map.put("mer_no", mer_no);
+        map.put("mer_order_no", mer_order_no);
+        map.put("notify_url", notify_url);
+        map.put("order_amt", order_amt);
+        map.put("pay_extra", pay_extra);
+        map.put("return_url", returnUrl);
+        map.put("sign_type", "MD5");
+        map.put("store_id", "000000");
+        map.put("version", version);
+        map.put("key", key);
+
+
+//        map.put("extend", "aaa");
+//        map.put("expire_time",endTime);
+//        map.put("goods_name",goods_name);
+//        map.put("product_code","02010006");
+//        map.put("clear_cycle","0");
+
+        String signature = "";
+
+        for (String s : map.keySet()) {
+            if (!(map.get(s) == null || map.get(s).equals(""))) {
+                signature += s + "=";
+                signature += map.get(s) + "&";
+            }
+        }
+        signature = signature.substring(0, signature.length() - 1);
+        String sign = MD5Util.encode(signature).toUpperCase();
+
+
+        //url
+        return "https://sandcash.mixienet.com.cn/pay/h5/quicktopup?" +
+                "version=" + version +
+                "&mer_no=" + mer_no +
+                "&mer_key=" + URLEncoder.encode(mer_key, StandardCharsets.UTF_8) +
+                "&mer_order_no=" + mer_order_no +
+                "&create_time=" + createTime +
+                "&expire_time=" + getTimeout(expireAt, 0) +
+                "&extend=" + URLEncoder.encode(extend.toJSONString(), StandardCharsets.UTF_8) +
+                "&order_amt=" + order_amt +
+                "&notify_url=" + URLEncoder.encode(notify_url, StandardCharsets.UTF_8) +
+                "&return_url=" + URLEncoder.encode(returnUrl, StandardCharsets.UTF_8) +
+                "&create_ip=127_0_0_1" +
+                "&goods_name=" + URLEncoder.encode(subject, StandardCharsets.UTF_8) +
+                "&store_id=000000" +
+                "&product_code=06030003" +
+                "&clear_cycle=3" +
+                "&pay_extra=" + URLEncoder.encode(pay_extra, StandardCharsets.UTF_8) +
+                "&meta_option=%5B%7B%22s%22%3A%22Android%22,%22n%22%3A%22wxDemo%22,%22id%22%3A%22com.pay.paytypetest%22,%22sc%22%3A%22com.pay.paytypetest%22%7D%5D" +
+                "&accsplit_flag=NO" +
+                "&jump_scheme=" +
+//                "&gh_static_url="+gh_static_url+""+
+                "&sign_type=MD5" +
+                "&key=" + URLEncoder.encode(key, StandardCharsets.UTF_8) +
+                "&sign=" + sign;
+    }
+
     public JSONObject query(String orderId) {
         orderId = paddingOrderId(orderId);
         JSONObject header = new JSONObject();

+ 51 - 0
src/main/java/com/izouma/nineth/utils/MD5Util.java

@@ -0,0 +1,51 @@
+package com.izouma.nineth.utils;
+
+import java.nio.charset.StandardCharsets;
+import java.security.MessageDigest;
+
+public class MD5Util {
+    private MD5Util() {
+    }
+
+    private static final String[] hex = {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"};
+
+    public static String encode(String password) {
+        try {
+            MessageDigest md5 = MessageDigest.getInstance("MD5");
+            byte[] byteArray = md5.digest(password.getBytes(StandardCharsets.UTF_8));
+            return byteArrayToHexString(byteArray);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return password;
+    }
+
+    public static String encode(String password, String enc) {
+        try {
+            MessageDigest md5 = MessageDigest.getInstance("MD5");
+            byte[] byteArray = md5.digest(password.getBytes(enc));
+            return byteArrayToHexString(byteArray);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return password;
+    }
+
+    private static String byteArrayToHexString(byte[] byteArray) {
+        StringBuilder sb = new StringBuilder();
+        for (byte b : byteArray) {
+            sb.append(byteToHexChar(b));
+        }
+        return sb.toString();
+    }
+
+    private static Object byteToHexChar(byte b) {
+        int n = b;
+        if (n < 0) {
+            n = 256 + n;
+        }
+        int d1 = n / 16;
+        int d2 = n % 16;
+        return hex[d1] + hex[d2];
+    }
+}

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

@@ -14,6 +14,7 @@ import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
+import java.util.HashMap;
 import java.util.List;
 
 @RestController
@@ -57,5 +58,10 @@ public class BlindBoxItemController extends BaseController {
         List<BlindBoxItem> data = all(pageQuery).getContent();
         ExcelUtils.export(response, data);
     }
+
+    @GetMapping("/rare/{blindBoxId}")
+    public HashMap<String, String> getBlindBoxRare(@PathVariable Long blindBoxId) {
+        return blindBoxItemService.getBlindBoxRare(blindBoxId);
+    }
 }
 

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

@@ -60,6 +60,13 @@ public class OrderPayControllerV2 {
         return orderPayService.payOrderQuick(id);
     }
 
+    @ApiOperation("衫德h5快捷+绑卡")
+    @RequestMapping(value = "/sandQuickBind", produces = "text/html")
+    @ResponseBody
+    public String sandQuickBind(@RequestParam Long id) {
+        return orderPayService.payOrderQuickBind(id);
+    }
+
     @ApiOperation("首信易协议支付")
     @RequestMapping(value = "/agreement")
     @ResponseBody
@@ -101,6 +108,12 @@ public class OrderPayControllerV2 {
         return orderPayService.payGiftQuick(id);
     }
 
+    @RequestMapping(value = "/gift/sandQuickBind", produces = "text/html")
+    @ResponseBody
+    public String payGiftQuickBind(@RequestParam Long id) {
+        return orderPayService.payGiftQuickBind(id);
+    }
+
     @RequestMapping(value = "/gift/agreement")
     @ResponseBody
     public Map<String, Object> payGiftAgreement(@RequestParam Long id, String bindCardId) {
@@ -127,6 +140,12 @@ public class OrderPayControllerV2 {
         return orderPayService.payMintQuick(id);
     }
 
+    @RequestMapping(value = "/mint/sandQuickBind", produces = "text/html")
+    @ResponseBody
+    public String payMintQuickBind(@RequestParam Long id) {
+        return orderPayService.payMintQuickBind(id);
+    }
+
     @RequestMapping(value = "/mint/balance")
     @ResponseBody
     public void payMintOrderBalance(@RequestParam Long id, @RequestParam String tradeCode) {
@@ -158,6 +177,12 @@ public class OrderPayControllerV2 {
         return orderPayService.rechargeQuick(userId, amount);
     }
 
+    @RequestMapping(value = "/recharge/sandQuickBind", produces = "text/html")
+    @ResponseBody
+    public String payRechargeQuickBind(@RequestParam Long userId, @RequestParam BigDecimal amount) {
+        return orderPayService.rechargeQuickBind(userId, amount);
+    }
+
     @RequestMapping(value = "/auction/alipay", method = RequestMethod.GET)
     @ResponseBody
     public String payAuctionOrderAlipayH5(Long id) {
@@ -178,6 +203,12 @@ public class OrderPayControllerV2 {
         return orderPayService.payAuctionQuick(id);
     }
 
+    @RequestMapping(value = "/auction/sandQuickBind", produces = "text/html")
+    @ResponseBody
+    public String payAuctionQuickBind(@RequestParam Long id) {
+        return orderPayService.payAuctionQuickBind(id);
+    }
+
     @RequestMapping(value = "/auction/balance")
     @ResponseBody
     public void payAuctionOrderBalance(@RequestParam Long id, @RequestParam String tradeCode) {

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

@@ -232,7 +232,7 @@ sandpay:
   sign-cert-path: classpath:cert/6888806043057.pfx
   sign-cert-pwd: 3edc#EDC
   sand-cert-path: classpath:cert/sand.cer
-  notify-url: http://xiongzhu.frp.izouma.com/sandpay/notify
+  notify-url: http://raex.frp.izouma.com/sandpay/notify
 hmpay:
   mer-no: 664403000025502
   app-private-key: MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBAJCaYSAw8c2uk4gry+/uy5thmzgdg1tPr6TRRj25AKxa13hnhjMEzp/eD8++LHxyPXg0ZXlbotZ/g0ES1XHJMkmHA4fRZ6Ki35LxlY60Z8xRwaTZXIctlaCkjhJmURNncQzyB5XMFF2M6cgy1T0yr+czoVPelVEFbAWu4cg/kQ1tAgMBAAECgYAGQwktsbDm7UZqQStFqpuakPF9zplfnOXIR1+5UIec7xohlqoTD4Q7HAynPF8EzJWo3OwAA13b2A3BBaXElafdwod7J2H9zlGJiqfmsnSTMhapVYsBbqnXGYWFS33wAm1Wx4Y9hSQxUD6AsZ+A05RiolrTTfAAGMS9E4sGhh1O6QJBANGUbGUednN4/0A0KlH3pWgLKPT+JyMeZLFGXeFLJpwWf25Xj98JcGai5t9sDqPl6xSgkEnJHdLB7LNEnmqr5X8CQQCwoaZwsVd0jnW6RU6F3SZ+BY4YS7SAhMlElqaJbBTP7DbXH/Z3cS1V696bvKup6+HlI/l0YwTDdRJIR0hl9XsTAkEAwFpPWkepQ7ZL36uBJBX9FA8aGjGhzhO5KxOAWqTU3PGxJ57qBzTsmubsqybMERWWuynbBD24R5WBH8/c7d6zFQJAShIP9TQ5Y5SWRB3qVvKtwK1dsEyXDkohCRVQE1Lyy1rYiJBL0Dzy8RQvzwlox6I2odvbMXaQudKvbwYNk0xFZwJAAxAeFweoXqDWcYl7Oa4nmgbM9LVqAMCbjzkChquXvj5q5sE9LOXiSMfbnDalNlLonbApnuTx5YCJYB0jA0ml8g==

+ 9 - 2
src/main/vue/src/views/BlindBoxEdit.vue

@@ -149,8 +149,8 @@
                         </el-table>
                         <el-button size="mini" @click="addItem" :disabled="!canEdit">添加作品</el-button>
                     </el-form-item>
-                    <el-form-item prop="prefixName" label="作品共同名称">
-                        <el-input v-model="formData.prefixName" style="width: 200px" placeholder="默认为盲盒名称"></el-input>
+                    <el-form-item prop="prefixName" label="系列名称">
+                        <el-input v-model="formData.prefixName" style="width: 200px" placeholder="请输入系列名称"></el-input>
                     </el-form-item>
                     <!-- <el-form-item prop="likes" label="点赞">
                         <el-input-number v-model="formData.likes"></el-input-number>
@@ -475,6 +475,13 @@ export default {
                         trigger: 'blur'
                     }
                 ],
+                prefixName: [
+                    {
+                        required: true,
+                        message: '请输入系列名称',
+                        trigger: 'blur'
+                    }
+                ],
                 pic: [
                     {
                         validator: (rule, value, callback) => {

+ 9 - 6
src/main/vue/src/views/CollectionEdit.vue

@@ -171,8 +171,8 @@
                         <el-input-number v-model="formData.total" :disabled="!canEdit"></el-input-number>
                     </el-form-item>
 
-                    <el-form-item prop="prefixName" label="藏品室分类名称">
-                        <el-input v-model="formData.prefixName" style="width: 200px" placeholder="默认为藏品名称"></el-input>
+                    <el-form-item prop="prefixName" label="系列名称">
+                        <el-input v-model="formData.prefixName" style="width: 200px" placeholder="请输入系列名称"></el-input>
                     </el-form-item>
 
                     <!-- <el-form-item prop="likes" label="点赞">
@@ -457,6 +457,13 @@ export default {
                         trigger: 'blur'
                     }
                 ],
+                prefixName: [
+                    {
+                        required: true,
+                        message: '请输入系列名称',
+                        trigger: 'blur'
+                    }
+                ],
                 pic: [
                     {
                         validator: (rule, value, callback) => {
@@ -699,10 +706,6 @@ export default {
             if (this.editQuota && data.totalQuota) {
                 data.vipQuota = data.totalQuota;
             }
-            let prefixName = data.prefixName.replaceAll(' ','')
-            if (prefixName === '' || prefixName === undefined || prefixName === null) {
-                data.prefixName = data.name
-            }
             this.saving = true;
             this.$http
                 .post(this.formData.id ? '/collection/save' : '/collection/create', data, { body: 'json' })

+ 1 - 1
src/test/java/com/izouma/nineth/CommonTest.java

@@ -746,6 +746,6 @@ public class CommonTest {
 
     @Test
     public void decrypt() throws Exception {
-        System.out.println(AESEncryptUtil.decrypt("946B7C9FB530401F25088C321D1322EA7D4C5B71BE30BF488CBCA0D34362682E"));
+        System.out.println(AESEncryptUtil.decrypt("C4EE0C1050C613707CE88FE3BDAA13CAA3A702AD2B010B23EDB1F94A44CC485E"));
     }
 }

+ 104 - 0
src/test/java/com/izouma/nineth/GenerateUrl.java

@@ -0,0 +1,104 @@
+package com.izouma.nineth;
+
+import com.izouma.nineth.utils.MD5Util;
+
+import java.net.URLEncoder;
+import java.nio.charset.StandardCharsets;
+import java.security.MessageDigest;
+import java.text.SimpleDateFormat;
+import java.util.*;
+
+/**
+ * @Auther YaoJun Qi
+ * @Date 2021/03/05 13:43
+ * @description
+ */
+
+public class GenerateUrl {
+    public static void main(String[] args) {
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
+        Calendar calendar = Calendar.getInstance();
+        String createTime = sdf.format(calendar.getTime());
+        calendar.add(Calendar.HOUR, 1);
+        String endTime = sdf.format(calendar.getTime());
+
+        String version = "10";
+        String mer_no = "6888806043057";
+        //key1
+        String mer_key = "fvLh4EEoJPJEkqg+6s3B8sTRVREAyVAxS34+5JGiJOmIFnIrnfD1k/KiUYo5Nfb7tBx0jj9HOI0=";
+        UUID uuid = UUID.randomUUID();
+        String mer_order_no = uuid.toString().replaceAll("-", "");
+        String notify_url = "https://www.baidu.com";
+        String order_amt = "1";
+        String return_url = "http://sandcash/return";
+        String goods_name = "test";
+        //"userId":"用户在商户下唯一标识 1-10位","userName":"证件姓名","idCard":"18位身份证号码"
+        String pay_extra = "{\"userId\":\"1\",\"userName\":\"熊竹\",\"idCard\":\"321002199408304614\"}";
+        //md5key
+        String key = "KvKQYXhwvkoQRAiQN2IzVSaecqYFP8emDHJrLettbShZsd8k/V2OU/myAV6My/qeotZ8K0WG8ifDzgelCexY7517gmF7SqFUcyuKgSC+HFNmn14C4iy9JRy0NvsSJRjgMzZWAhrwNL5ixuz+UKFTiw==";
+
+
+        Map<String, String> map = new LinkedHashMap<>();
+        map.put("accsplit_flag", "NO");
+        map.put("create_ip", "127_0_0_1");
+        map.put("create_time", createTime);
+//        if(!(gh_static_url==null||"".equals(gh_static_url)))map.put("gh_static_url",gh_static_url);;
+        map.put("mer_key", mer_key);
+        map.put("mer_no", mer_no);
+        map.put("mer_order_no", mer_order_no);
+        map.put("notify_url", notify_url);
+        map.put("order_amt", order_amt);
+        map.put("pay_extra", pay_extra);
+        map.put("return_url", return_url);
+        map.put("sign_type", "MD5");
+        map.put("store_id", "000000");
+        map.put("version", version);
+        map.put("key", key);
+
+
+//        map.put("expire_time",endTime);
+//        map.put("goods_name",goods_name);
+//        map.put("product_code","02010006");
+//        map.put("clear_cycle","0");
+
+        String signature = "";
+
+        for (String s : map.keySet()) {
+            if (!(map.get(s) == null || map.get(s).equals(""))) {
+                signature += s + "=";
+                signature += map.get(s) + "&";
+            }
+        }
+        signature = signature.substring(0, signature.length() - 1);
+        String sign = MD5Util.encode(signature).toUpperCase();
+
+
+        //url
+        String url = "https://sandcash.mixienet.com.cn/pay/h5/quicktopup?" +
+                "version=" + version +
+                "&mer_no=" + mer_no +
+                "&mer_key=" + URLEncoder.encode(mer_key, StandardCharsets.UTF_8) +
+                "&mer_order_no=" + mer_order_no +
+                "&create_time=" + createTime +
+                "&expire_time=" + endTime +  //endTime
+                "&order_amt=1" +
+                "&notify_url=" + URLEncoder.encode(notify_url, StandardCharsets.UTF_8) +
+                "&return_url=" + URLEncoder.encode(return_url, StandardCharsets.UTF_8) +
+                "&create_ip=127_0_0_1" +
+                "&goods_name=" + URLEncoder.encode(goods_name, StandardCharsets.UTF_8) +
+                "&store_id=000000" +
+                "&product_code=06030003" +
+                "&clear_cycle=3" +
+                "&pay_extra=" + URLEncoder.encode(pay_extra, StandardCharsets.UTF_8) +
+                "&meta_option=%5B%7B%22s%22%3A%22Android%22,%22n%22%3A%22wxDemo%22,%22id%22%3A%22com.pay.paytypetest%22,%22sc%22%3A%22com.pay.paytypetest%22%7D%5D" +
+                "&accsplit_flag=NO" +
+                "&jump_scheme=" +
+//                "&gh_static_url="+gh_static_url+""+
+                "&sign_type=MD5" +
+                "&key=" + URLEncoder.encode(key, StandardCharsets.UTF_8) +
+                "&sign=" + sign;
+
+        System.out.println("url\n\n" + url);
+
+    }
+}

+ 9 - 3
src/test/java/com/izouma/nineth/service/SandPayServiceTest.java

@@ -2,6 +2,8 @@ package com.izouma.nineth.service;
 
 import cn.com.sandpay.cashier.sdk.*;
 import com.alibaba.fastjson.JSONObject;
+import com.alipay.api.AlipayApiException;
+import com.alipay.api.internal.util.AlipaySignature;
 import com.izouma.nineth.ApplicationTests;
 import com.izouma.nineth.utils.DateTimeUtils;
 import com.izouma.nineth.utils.SnowflakeIdWorker;
@@ -13,14 +15,13 @@ import org.springframework.beans.factory.annotation.Autowired;
 import java.io.IOException;
 import java.math.BigDecimal;
 import java.net.URLDecoder;
+import java.net.URLEncoder;
 import java.nio.charset.StandardCharsets;
 import java.text.DecimalFormat;
 import java.text.DecimalFormatSymbols;
 import java.time.LocalDate;
 import java.time.LocalDateTime;
-import java.util.HashMap;
-import java.util.Locale;
-import java.util.Map;
+import java.util.*;
 
 @Slf4j
 class SandPayServiceTest {
@@ -337,4 +338,9 @@ class SandPayServiceTest {
             log.error(e.getMessage());
         }
     }
+
+    @Test
+    public void quick() {
+
+    }
 }