diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/entity/IntegralOrders.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/entity/IntegralOrders.java
index 5d61d090d..a4e5c8e40 100644
--- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/entity/IntegralOrders.java
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/entity/IntegralOrders.java
@@ -112,6 +112,10 @@ public class IntegralOrders extends BaseEntity {
private String makeChange;
private Integer addressId;
+ /**
+ * 核销码
+ */
+ private String checkCode;
}
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/mapper/xml/IntegralOrdersMapper.xml b/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/mapper/xml/IntegralOrdersMapper.xml
index c8fa7dbbf..b081779a1 100644
--- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/mapper/xml/IntegralOrdersMapper.xml
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/mapper/xml/IntegralOrdersMapper.xml
@@ -28,6 +28,7 @@
+
@@ -67,7 +68,8 @@
update_time,
create_by,
update_by,
- address_id
+ address_id,
+ check_code
from integral_orders
where id = #{id}
@@ -505,7 +507,7 @@
insert into integral_orders(user_id, order_number, gift_id, shipping_type, paid_info, amount, integral, come_on,
exchange_quantity, order_status, status, order_type, processing_result, notes, store_id, create_time,
- update_time, create_by, update_by,staff_id,payment_type,chain_store_id,actual_payment,make_change)
+ update_time, create_by, update_by,staff_id,payment_type,chain_store_id,actual_payment,make_change,check_code)
values
(#{entity.userId}, #{entity.orderNumber}, #{entity.giftId}, #{entity.shippingType}, #{entity.paidInfo},
@@ -513,7 +515,7 @@
#{entity.status}, #{entity.orderType}, #{entity.processingResult}, #{entity.notes}, #{entity.storeId},
NOW(), NOW(), #{entity.createBy},
#{entity.updateBy},#{entity.staffId},#{entity.paymentType},#{entity.chainStoreId}
- ,#{entity.actualPayment},#{entity.makeChange})
+ ,#{entity.actualPayment},#{entity.makeChange},#{entity.checkCode})
diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/service/impl/IntegralOrdersServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/service/impl/IntegralOrdersServiceImpl.java
index ff575c3e8..c9f12cad7 100644
--- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/service/impl/IntegralOrdersServiceImpl.java
+++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/service/impl/IntegralOrdersServiceImpl.java
@@ -63,6 +63,7 @@ import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.math.BigDecimal;
+import java.security.SecureRandom;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.concurrent.TimeUnit;
@@ -640,6 +641,7 @@ public class IntegralOrdersServiceImpl implements IntegralOrdersService {
integralOrders.setOrderStatus("待处理");
integralOrders.setOrderType("0");
integralOrders.setChainStoreId(integralOrdersList.getChainStoreId());
+ integralOrders.setCheckCode(generateUniqueRandomNumber());
}
integralOrdersDao.insertBatch(integralOrdersList.getIntegralOrdersList());
@@ -686,6 +688,16 @@ public class IntegralOrdersServiceImpl implements IntegralOrdersService {
return applet;
}
+ /**
+ * 生成核销码
+ * @return
+ */
+ public static String generateUniqueRandomNumber() {
+ // 生成 UUID 并移除所有非数字字符,然后截取前 16 位
+ String uuid = UUID.randomUUID().toString().replaceAll("[^0-9]", "");
+ return uuid.substring(0, 16); // 确保返回16位
+ }
+
/**
* 查询是否领取到同一件商品领取了几件
diff --git a/gasStation-uni/pagesHome/certificate/details.vue b/gasStation-uni/pagesHome/certificate/details.vue
index 10df2c356..d7b7d9200 100644
--- a/gasStation-uni/pagesHome/certificate/details.vue
+++ b/gasStation-uni/pagesHome/certificate/details.vue
@@ -183,6 +183,7 @@
})
}
}
+ this.getInfo()
})
},
getInfo() {
diff --git a/gasStation-uni/pagesHome/myPointsOrder/details.vue b/gasStation-uni/pagesHome/myPointsOrder/details.vue
index 0d0068869..3fbfa6cfe 100644
--- a/gasStation-uni/pagesHome/myPointsOrder/details.vue
+++ b/gasStation-uni/pagesHome/myPointsOrder/details.vue
@@ -30,7 +30,7 @@
- 核销码:6688172293684182
+ 核销码:{{orderInfo.checkCode}}
自提信息
@@ -103,7 +103,8 @@
pageSize: 10,
totalPage: '',
options: {
- code: 'https://qm.qq.com/cgi-bin/qm/qr?k=LKqML292dD2WvwQfAJXBUmvgbiB_TZWF&noverify=0', // 生成二维码的值
+ // code: 'https://qm.qq.com/cgi-bin/qm/qr?k=LKqML292dD2WvwQfAJXBUmvgbiB_TZWF&noverify=0', // 生成二维码的值
+ code: '', // 生成二维码的值
size: 300, // 460代表生成的二维码的宽高均为460rpx
},
orderId: '',
@@ -139,6 +140,7 @@
if (res.code == 200) {
console.log(res, 132);
this.orderInfo = res.data
+ this.options.code = res.data.checkCode
}
})
},