xiongzhu 4 éve
szülő
commit
c9fdcc3425

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

@@ -20,4 +20,6 @@ public class PriceList extends BaseEntity {
     private String price;
 
     private String pic;
+
+    private String cPrice;
 }

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

@@ -32,6 +32,17 @@ public class HMPayService {
     private final GeneralProperties generalProperties;
     private final SnowflakeIdWorker snowflakeIdWorker;
 
+    public String paddingOrderId(String orderId) {
+        if (orderId != null && orderId.length() < 12) {
+            StringBuilder orderIdBuilder = new StringBuilder(orderId);
+            for (int i = orderIdBuilder.length(); i < 12; i++) {
+                orderIdBuilder.insert(0, "0");
+            }
+            orderId = orderIdBuilder.toString();
+        }
+        return orderId;
+    }
+
     private String getSign(Map<String, String> params) {
         try {
             Map<String, String> m = new HashMap<>(params);
@@ -143,7 +154,7 @@ public class HMPayService {
 
     public JSONObject refund(String orderId, BigDecimal amount) {
         Map<String, String> bizContent = new HashMap<>();
-        bizContent.put("out_order_no", orderId);
+        bizContent.put("out_order_no", paddingOrderId(orderId));
         bizContent.put("refund_amount", amount.stripTrailingZeros().toPlainString());
         bizContent.put("refund_request_no", snowflakeIdWorker.nextId() + "");
         return requestApi("trade.refund", bizContent);

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

@@ -97,7 +97,6 @@ public class IdentityAuthService {
         auth.setReason(reason);
         auth.setAutoValidated(true);
         identityAuthRepo.save(auth);
-        cacheService.clearUserMy(user.getId());
 
         identityAuthRepo.deleteDuplicated(auth.getUserId(), auth.getId());
     }

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

@@ -520,7 +520,7 @@ public class MintOrderService {
             this.notify(order, null, null, false);
             return;
         }
-        this.cancel(order, false);
+        this.cancel(order, true);
     }
 
 

+ 11 - 10
src/main/java/com/izouma/nineth/service/OrderPayService.java

@@ -49,6 +49,17 @@ public class OrderPayService {
         }
     }
 
+    public String paddingOrderId(String orderId) {
+        if (orderId != null && orderId.length() < 12) {
+            StringBuilder orderIdBuilder = new StringBuilder(orderId);
+            for (int i = orderIdBuilder.length(); i < 12; i++) {
+                orderIdBuilder.insert(0, "0");
+            }
+            orderId = orderIdBuilder.toString();
+        }
+        return orderId;
+    }
+
     @Cacheable(value = "payOrder", key = "'order#'+#orderId")
     public String payOrder(Long orderId) {
         Order order = orderRepo.findById(orderId).orElseThrow(new BusinessException("订单不存在"));
@@ -186,11 +197,6 @@ public class OrderPayService {
     public JSONObject refund(String orderId, BigDecimal amount, String channel) {
         switch (channel) {
             case "sandPay": {
-                if (orderId.length() < 12) {
-                    for (int i = orderId.length(); i < 12; i++) {
-                        orderId = "0" + orderId;
-                    }
-                }
                 JSONObject res = sandPayService.refund(orderId, amount);
                 if (!"000000".equals(res.getJSONObject("head").getString("respCode"))) {
                     throw new BusinessException("退款失败");
@@ -198,11 +204,6 @@ public class OrderPayService {
                 break;
             }
             case "hmPay": {
-                if (orderId.length() < 12) {
-                    for (int i = orderId.length(); i < 12; i++) {
-                        orderId = "0" + orderId;
-                    }
-                }
                 JSONObject res = hmPayService.refund(orderId, amount);
                 if (!"REFUND_SUCCESS".equals(res.getString("sub_code"))) {
                     throw new BusinessException("退款失败");

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

@@ -45,6 +45,17 @@ public class SandPayService {
     private final SnowflakeIdWorker snowflakeIdWorker;
     private final GeneralProperties generalProperties;
 
+    public String paddingOrderId(String orderId) {
+        if (orderId != null && orderId.length() < 12) {
+            StringBuilder orderIdBuilder = new StringBuilder(orderId);
+            for (int i = orderIdBuilder.length(); i < 12; i++) {
+                orderIdBuilder.insert(0, "0");
+            }
+            orderId = orderIdBuilder.toString();
+        }
+        return orderId;
+    }
+
     public String getReqTime() {
         return DateTimeUtils.format(LocalDateTime.now(), "yyyyMMddHHmmss");
     }
@@ -236,7 +247,7 @@ public class SandPayService {
 
         JSONObject body = new JSONObject();
         body.put("orderCode", snowflakeIdWorker.nextId());        //商户订单号
-        body.put("oriOrderCode", orderId);                        //原交易订单号
+        body.put("oriOrderCode", paddingOrderId(orderId));        //原交易订单号
         body.put("refundAmount", convertAmount(amount));          //退货金额
         body.put("refundReason", "退货测试");                      //退货原因
         body.put("notifyUrl", sandPayProperties.getNotifyUrl());  //异步通知地址

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

@@ -57,16 +57,16 @@ public class HmPayController extends BaseController {
             switch (type) {
                 case "order":
                     rocketMQTemplate.syncSend(generalProperties.getOrderNotifyTopic(),
-                            new OrderNotifyEvent(id, PayMethod.ALIPAY, plat_trx_no, System.currentTimeMillis()));
+                            new OrderNotifyEvent(id, PayMethod.HMPAY, plat_trx_no, System.currentTimeMillis()));
                     break;
                 case "gift":
-                    giftOrderService.giftNotify(id, PayMethod.ALIPAY, plat_trx_no);
+                    giftOrderService.giftNotify(id, PayMethod.HMPAY, plat_trx_no);
                     break;
                 case "mintOrder":
-                    mintOrderService.mintNotify(id, PayMethod.ALIPAY, plat_trx_no);
+                    mintOrderService.mintNotify(id, PayMethod.HMPAY, plat_trx_no);
                     break;
                 case "recharge":
-                    userBalanceService.recharge(id, PayMethod.ALIPAY, plat_trx_no);
+                    userBalanceService.recharge(id, PayMethod.HMPAY, plat_trx_no);
                     break;
             }
         }

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

@@ -67,13 +67,13 @@ public class SandPayController {
                         switch (type) {
                             case "order":
                                 rocketMQTemplate.syncSend(generalProperties.getOrderNotifyTopic(),
-                                        new OrderNotifyEvent(id, PayMethod.ALIPAY, payOrderCode, System.currentTimeMillis()));
+                                        new OrderNotifyEvent(id, PayMethod.SANDPAY, payOrderCode, System.currentTimeMillis()));
                                 break;
                             case "gift":
-                                giftOrderService.giftNotify(id, PayMethod.ALIPAY, payOrderCode);
+                                giftOrderService.giftNotify(id, PayMethod.SANDPAY, payOrderCode);
                                 break;
                             case "mintOrder":
-                                mintOrderService.mintNotify(id, PayMethod.ALIPAY, payOrderCode);
+                                mintOrderService.mintNotify(id, PayMethod.SANDPAY, payOrderCode);
                                 break;
                             case "recharge":
                                 userBalanceService.recharge(id, PayMethod.SANDPAY, payOrderCode);

+ 6 - 1
src/main/vue/src/views/MintOrderAuditList.vue

@@ -153,7 +153,12 @@ export default {
             downloading: false,
             payMethodOptions: [
                 { label: '微信', value: 'WEIXIN' },
-                { label: '支付宝', value: 'ALIPAY' }
+                { label: '支付宝', value: 'ALIPAY' },
+                { label: '免费', value: 'FREE' },
+                { label: '衫德', value: 'SANDPAY' },
+                { label: '河马', value: 'HMPAY' },
+                { label: '首信易', value: 'PAYEASE' },
+                { label: '余额', value: 'BALANCE' }
             ],
             statusOptions: [
                 { label: '未支付', value: 'NOT_PAID' },

+ 6 - 1
src/main/vue/src/views/MintOrderEdit.vue

@@ -182,7 +182,12 @@ export default {
             ],
             payMethodOptions: [
                 { label: '微信', value: 'WEIXIN' },
-                { label: '支付宝', value: 'ALIPAY' }
+                { label: '支付宝', value: 'ALIPAY' },
+                { label: '免费', value: 'FREE' },
+                { label: '衫德', value: 'SANDPAY' },
+                { label: '河马', value: 'HMPAY' },
+                { label: '首信易', value: 'PAYEASE' },
+                { label: '余额', value: 'BALANCE' }
             ]
         };
     },

+ 6 - 1
src/main/vue/src/views/MintOrderList.vue

@@ -178,7 +178,12 @@ export default {
             downloading: false,
             payMethodOptions: [
                 { label: '微信', value: 'WEIXIN' },
-                { label: '支付宝', value: 'ALIPAY' }
+                { label: '支付宝', value: 'ALIPAY' },
+                { label: '免费', value: 'FREE' },
+                { label: '衫德', value: 'SANDPAY' },
+                { label: '河马', value: 'HMPAY' },
+                { label: '首信易', value: 'PAYEASE' },
+                { label: '余额', value: 'BALANCE' }
             ],
             statusOptions: [
                 { label: '未支付', value: 'NOT_PAID' },

+ 6 - 1
src/main/vue/src/views/OrderEdit.vue

@@ -125,7 +125,12 @@ export default {
             ],
             payMethodOptions: [
                 { label: '微信', value: 'WEIXIN' },
-                { label: '支付宝', value: 'ALIPAY' }
+                { label: '支付宝', value: 'ALIPAY' },
+                { label: '免费', value: 'FREE' },
+                { label: '衫德', value: 'SANDPAY' },
+                { label: '河马', value: 'HMPAY' },
+                { label: '首信易', value: 'PAYEASE' },
+                { label: '余额', value: 'BALANCE' }
             ]
         };
     },

+ 6 - 1
src/main/vue/src/views/OrderList.vue

@@ -158,7 +158,12 @@ export default {
             ],
             payMethodOptions: [
                 { label: '微信', value: 'WEIXIN' },
-                { label: '支付宝', value: 'ALIPAY' }
+                { label: '支付宝', value: 'ALIPAY' },
+                { label: '免费', value: 'FREE' },
+                { label: '衫德', value: 'SANDPAY' },
+                { label: '河马', value: 'HMPAY' },
+                { label: '首信易', value: 'PAYEASE' },
+                { label: '余额', value: 'BALANCE' }
             ],
             status: null,
             createdAt: [],

+ 7 - 2
src/main/vue/src/views/OrderUsedList.vue

@@ -38,7 +38,7 @@
                     :label="item.label"
                 ></el-option>
             </el-select>
-             <el-input
+            <el-input
                 placeholder="搜索藏品ID"
                 v-model="collectionId"
                 clearable
@@ -155,7 +155,12 @@ export default {
             ],
             payMethodOptions: [
                 { label: '微信', value: 'WEIXIN' },
-                { label: '支付宝', value: 'ALIPAY' }
+                { label: '支付宝', value: 'ALIPAY' },
+                { label: '免费', value: 'FREE' },
+                { label: '衫德', value: 'SANDPAY' },
+                { label: '河马', value: 'HMPAY' },
+                { label: '首信易', value: 'PAYEASE' },
+                { label: '余额', value: 'BALANCE' }
             ],
             status: null,
             createdAt: [],