insertOrdersToDatabase sql fix getOnSale
This commit is contained in:
parent
446abe8a69
commit
eb1c8ca0a9
|
@ -84,6 +84,7 @@ public class DouDianOrderCatchServiceImpl implements OrderCatchService {
|
|||
private OnSaleProductService onSaleProductService;
|
||||
@Resource
|
||||
private OrderSyncLogService orderSyncLogService;
|
||||
|
||||
@Override
|
||||
public void syncOrder(AccessToken accessToken, long createTimeStart, long createTimeEnd) {
|
||||
// 分页查询订单
|
||||
|
@ -94,6 +95,7 @@ public class DouDianOrderCatchServiceImpl implements OrderCatchService {
|
|||
|
||||
/**
|
||||
* 抖音消息推送订单,抓取/更新 订单
|
||||
*
|
||||
* @param catchRepVO
|
||||
*/
|
||||
@Override
|
||||
|
@ -143,7 +145,9 @@ public class DouDianOrderCatchServiceImpl implements OrderCatchService {
|
|||
* 2.1 需更新的数据: 订单状态 退款状态
|
||||
*/
|
||||
// 所有在售商品
|
||||
List<OnSaleProductDO> onSaleProductDOS = onSaleProductMapper.selectList(new QueryWrapper<OnSaleProductDO>().eq("deleted", 0).eq("onSale", true));
|
||||
List<OnSaleProductDO> onSaleProductDOS = onSaleProductMapper.selectList(new LambdaQueryWrapperX<OnSaleProductDO>().eq(OnSaleProductDO::getDeleted, 0)
|
||||
.eq(OnSaleProductDO::getOnSale, true));
|
||||
|
||||
// 所有在售商品sku
|
||||
List<String> skuList = onSaleProductDOS.stream().map(OnSaleProductDO::getSku).toList();
|
||||
// 买家备注
|
||||
|
@ -326,7 +330,10 @@ public class DouDianOrderCatchServiceImpl implements OrderCatchService {
|
|||
* 2.1 需更新的数据: 订单状态 退款状态
|
||||
*/
|
||||
// 所有在售商品
|
||||
List<OnSaleProductDO> onSaleProductDOS = onSaleProductMapper.selectList(new QueryWrapper<OnSaleProductDO>().eq("deleted", 0).eq("onSale", true));
|
||||
// List<OnSaleProductDO> onSaleProductDOS = onSaleProductMapper.selectList(new QueryWrapper<OnSaleProductDO>().eq("deleted", 0).eq("onSale", true));
|
||||
List<OnSaleProductDO> onSaleProductDOS = onSaleProductMapper.selectList(new LambdaQueryWrapperX<OnSaleProductDO>().eq(OnSaleProductDO::getDeleted, 0)
|
||||
.eq(OnSaleProductDO::getOnSale, true));
|
||||
|
||||
// 所有在售商品sku
|
||||
List<String> skuList = onSaleProductDOS.stream().map(OnSaleProductDO::getSku).toList();
|
||||
// 买家备注
|
||||
|
@ -496,6 +503,7 @@ public class DouDianOrderCatchServiceImpl implements OrderCatchService {
|
|||
|
||||
/**
|
||||
* 将订单数据插入到数据库
|
||||
*
|
||||
* @param orders 订单数据
|
||||
*/
|
||||
private void insertOrdersToDatabase(List<ShopOrderListItem> orders) {
|
||||
|
@ -676,12 +684,14 @@ public class DouDianOrderCatchServiceImpl implements OrderCatchService {
|
|||
batchDecryptOrderAndUpdate(ordersDOS);
|
||||
}
|
||||
}
|
||||
|
||||
private CipherInfosItem createCipherItem(String cipherText, String authId) {
|
||||
CipherInfosItem item = new CipherInfosItem();
|
||||
item.setCipherText(cipherText);
|
||||
item.setAuthId(authId);
|
||||
return item;
|
||||
}
|
||||
|
||||
private void updateOrderFields(OrdersDO order, String cipherText, String decryptText) {
|
||||
// 检查并更新每个加密字段
|
||||
if (cipherText.equals(order.getEncryptAddress())) {
|
||||
|
@ -696,6 +706,7 @@ public class DouDianOrderCatchServiceImpl implements OrderCatchService {
|
|||
order.setEncryptAddressMobile(decryptText);
|
||||
}
|
||||
}
|
||||
|
||||
private void batchDecryptOrderAndUpdate(List<OrdersDO> orderList) {
|
||||
List<CipherInfosItem> cipherInfos = new ArrayList<>();
|
||||
for (OrdersDO ordersDO : orderList) {
|
||||
|
@ -725,6 +736,7 @@ public class DouDianOrderCatchServiceImpl implements OrderCatchService {
|
|||
|
||||
/**
|
||||
* 使用正则表达式获取手机号
|
||||
*
|
||||
* @param skuName
|
||||
* @return
|
||||
*/
|
||||
|
@ -745,6 +757,7 @@ public class DouDianOrderCatchServiceImpl implements OrderCatchService {
|
|||
|
||||
/**
|
||||
* 分页查询订单
|
||||
*
|
||||
* @param accessToken 访问令牌
|
||||
* @param createTimeStart 创建时间起始
|
||||
* @param createTimeEnd 创建时间结束
|
||||
|
@ -798,6 +811,7 @@ public class DouDianOrderCatchServiceImpl implements OrderCatchService {
|
|||
|
||||
/**
|
||||
* 批量解密接口
|
||||
*
|
||||
* @param cipherInfos 待解密数据 一次性最多50条
|
||||
* @return
|
||||
*/
|
||||
|
@ -827,6 +841,7 @@ public class DouDianOrderCatchServiceImpl implements OrderCatchService {
|
|||
OrderOrderDetailResponse response = request.execute(accessToken);
|
||||
return response.getData();
|
||||
}
|
||||
|
||||
public void refreshToken() {
|
||||
//设置appKey和appSecret,全局设置一次
|
||||
GlobalConfig.initAppKey("7381306825771091495");
|
||||
|
|
Loading…
Reference in New Issue