更新10.11 更新积分兑换核销码

This commit is contained in:
许允枞 2024-10-11 18:13:24 +08:00
parent 9e6ca618aa
commit 21af38fd8e
5 changed files with 26 additions and 5 deletions

View File

@ -112,6 +112,10 @@ public class IntegralOrders extends BaseEntity {
private String makeChange;
private Integer addressId;
/**
* 核销码
*/
private String checkCode;
}

View File

@ -28,6 +28,7 @@
<result property="updateBy" column="update_by" jdbcType="INTEGER"/>
<result property="staffId" column="staff_id" jdbcType="INTEGER"/>
<result property="paymentType" column="payment_type" jdbcType="VARCHAR"/>
<result property="checkCode" column="check_code" jdbcType="VARCHAR"/>
<!-- outher-->
<result property="mobile" column="mobile" jdbcType="VARCHAR"/>
@ -67,7 +68,8 @@
update_time,
create_by,
update_by,
address_id
address_id,
check_code
from integral_orders
where id = #{id}
</select>
@ -505,7 +507,7 @@
<insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
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
<foreach collection="entities" item="entity" separator=",">
(#{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})
</foreach>
</insert>

View File

@ -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位
}
/**
* 查询是否领取到同一件商品领取了几件

View File

@ -183,6 +183,7 @@
})
}
}
this.getInfo()
})
},
getInfo() {

View File

@ -30,7 +30,7 @@
<w-qrcode :options="options"></w-qrcode>
</view>
<view class="">核销码6688172293684182</view>
<view class="">核销码{{orderInfo.checkCode}}</view>
</view>
<view class="box_" style="font-size: 14px;">
<view class="title_">自提信息</view>
@ -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, // 460460rpx
},
orderId: '',
@ -139,6 +140,7 @@
if (res.code == 200) {
console.log(res, 132);
this.orderInfo = res.data
this.options.code = res.data.checkCode
}
})
},