insertOrdersToDatabase sql fix getOnSale
This commit is contained in:
parent
3e6c3adcca
commit
4295baf3bc
|
@ -1,16 +1,24 @@
|
||||||
package cn.iocoder.yudao.module.haoka.service.orderCatch;
|
package cn.iocoder.yudao.module.haoka.service.orderCatch;
|
||||||
|
|
||||||
import cn.hutool.core.collection.CollectionUtil;
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||||
import cn.iocoder.yudao.module.haoka.controller.admin.onsaleproduct.vo.OnSaleProductPreOrderRespVO;
|
import cn.iocoder.yudao.module.haoka.controller.admin.onsaleproduct.vo.OnSaleProductPreOrderRespVO;
|
||||||
import cn.iocoder.yudao.module.haoka.controller.admin.orderCatch.po.Message;
|
import cn.iocoder.yudao.module.haoka.controller.admin.orderCatch.po.Message;
|
||||||
|
import cn.iocoder.yudao.module.haoka.controller.admin.orderCatch.vo.OrderCatchRepVO;
|
||||||
|
import cn.iocoder.yudao.module.haoka.controller.admin.ordersynclog.vo.OrderSyncLogPageReqVO;
|
||||||
|
import cn.iocoder.yudao.module.haoka.controller.admin.ordersynclog.vo.OrderSyncLogSaveReqVO;
|
||||||
import cn.iocoder.yudao.module.haoka.dal.dataobject.onsaleproduct.OnSaleProductDO;
|
import cn.iocoder.yudao.module.haoka.dal.dataobject.onsaleproduct.OnSaleProductDO;
|
||||||
import cn.iocoder.yudao.module.haoka.dal.dataobject.orders.OrdersDO;
|
import cn.iocoder.yudao.module.haoka.dal.dataobject.orders.OrdersDO;
|
||||||
|
import cn.iocoder.yudao.module.haoka.dal.dataobject.ordersynclog.OrderSyncLogDO;
|
||||||
import cn.iocoder.yudao.module.haoka.dal.mysql.onsaleproduct.OnSaleProductMapper;
|
import cn.iocoder.yudao.module.haoka.dal.mysql.onsaleproduct.OnSaleProductMapper;
|
||||||
import cn.iocoder.yudao.module.haoka.dal.mysql.orders.OrdersMapper;
|
import cn.iocoder.yudao.module.haoka.dal.mysql.orders.OrdersMapper;
|
||||||
import cn.iocoder.yudao.module.haoka.service.onsaleproduct.OnSaleProductService;
|
import cn.iocoder.yudao.module.haoka.service.onsaleproduct.OnSaleProductService;
|
||||||
import cn.iocoder.yudao.module.haoka.service.ordersynclog.OrderSyncLogService;
|
import cn.iocoder.yudao.module.haoka.service.ordersynclog.OrderSyncLogService;
|
||||||
|
import cn.iocoder.yudao.module.haoka.service.ordersynclog.OrderSyncLogServiceImpl;
|
||||||
import cn.iocoder.yudao.module.haoka.utils.GroupListUtil;
|
import cn.iocoder.yudao.module.haoka.utils.GroupListUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.doudian.open.api.order_batchDecrypt.OrderBatchDecryptRequest;
|
import com.doudian.open.api.order_batchDecrypt.OrderBatchDecryptRequest;
|
||||||
import com.doudian.open.api.order_batchDecrypt.OrderBatchDecryptResponse;
|
import com.doudian.open.api.order_batchDecrypt.OrderBatchDecryptResponse;
|
||||||
import com.doudian.open.api.order_batchDecrypt.data.DecryptInfosItem;
|
import com.doudian.open.api.order_batchDecrypt.data.DecryptInfosItem;
|
||||||
|
@ -135,7 +143,9 @@ public class DouDianOrderCatchServiceImpl implements OrderCatchService {
|
||||||
* 2.1 需更新的数据: 订单状态 退款状态
|
* 2.1 需更新的数据: 订单状态 退款状态
|
||||||
*/
|
*/
|
||||||
// 所有在售商品
|
// 所有在售商品
|
||||||
List<OnSaleProductDO> onSaleProductDOS = onSaleProductMapper.selectList(new LambdaQueryWrapperX<OnSaleProductDO>().eq(OnSaleProductDO::getDeleted, 0).eq(OnSaleProductDO::getOnSale, 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
|
// 所有在售商品sku
|
||||||
List<String> skuList = onSaleProductDOS.stream().map(OnSaleProductDO::getSku).toList();
|
List<String> skuList = onSaleProductDOS.stream().map(OnSaleProductDO::getSku).toList();
|
||||||
// 买家备注
|
// 买家备注
|
||||||
|
@ -240,7 +250,7 @@ public class DouDianOrderCatchServiceImpl implements OrderCatchService {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 查询订单是否存在 不存在则新增,存在则更新
|
// 查询订单是否存在 不存在则新增,存在则更新
|
||||||
List<OrdersDO> ordersDOS = ordersMapper.selectList(new LambdaQueryWrapperX<OrdersDO>().eq(OrdersDO::getRealSourceId, orderId).eq(OrdersDO::getDeleted, 0));
|
List<OrdersDO> ordersDOS = ordersMapper.selectList(new QueryWrapper<OrdersDO>().eq("real_source_id", orderId).eq("deleted", 0));
|
||||||
if(CollectionUtil.isNotEmpty(ordersDOS)){
|
if(CollectionUtil.isNotEmpty(ordersDOS)){
|
||||||
// 更新订单
|
// 更新订单
|
||||||
OrdersDO ordersDO1 = ordersDOS.get(0);
|
OrdersDO ordersDO1 = ordersDOS.get(0);
|
||||||
|
@ -318,7 +328,9 @@ public class DouDianOrderCatchServiceImpl implements OrderCatchService {
|
||||||
* 2.1 需更新的数据: 订单状态 退款状态
|
* 2.1 需更新的数据: 订单状态 退款状态
|
||||||
*/
|
*/
|
||||||
// 所有在售商品
|
// 所有在售商品
|
||||||
List<OnSaleProductDO> onSaleProductDOS = onSaleProductMapper.selectList(new LambdaQueryWrapperX<OnSaleProductDO>().eq(OnSaleProductDO::getDeleted, 0).eq(OnSaleProductDO::getOnSale, 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
|
// 所有在售商品sku
|
||||||
List<String> skuList = onSaleProductDOS.stream().map(OnSaleProductDO::getSku).toList();
|
List<String> skuList = onSaleProductDOS.stream().map(OnSaleProductDO::getSku).toList();
|
||||||
// 买家备注
|
// 买家备注
|
||||||
|
@ -423,7 +435,7 @@ public class DouDianOrderCatchServiceImpl implements OrderCatchService {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 查询订单是否存在 不存在则新增,存在则更新
|
// 查询订单是否存在 不存在则新增,存在则更新
|
||||||
List<OrdersDO> ordersDOS = ordersMapper.selectList(new LambdaQueryWrapperX<OrdersDO>().eq(OrdersDO::getRealSourceId, orderId).eq(OrdersDO::getDeleted, 0));
|
List<OrdersDO> ordersDOS = ordersMapper.selectList(new QueryWrapper<OrdersDO>().eq("real_source_id", orderId).eq("deleted", 0));
|
||||||
if(CollectionUtil.isNotEmpty(ordersDOS)){
|
if(CollectionUtil.isNotEmpty(ordersDOS)){
|
||||||
// 更新订单
|
// 更新订单
|
||||||
OrdersDO ordersDO1 = ordersDOS.get(0);
|
OrdersDO ordersDO1 = ordersDOS.get(0);
|
||||||
|
@ -615,7 +627,7 @@ public class DouDianOrderCatchServiceImpl implements OrderCatchService {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 查询订单是否存在 不存在则新增,存在则更新
|
// 查询订单是否存在 不存在则新增,存在则更新
|
||||||
List<OrdersDO> ordersDOS = ordersMapper.selectList(new LambdaQueryWrapperX<OrdersDO>().eq(OrdersDO::getRealSourceId, orderId).eq(OrdersDO::getDeleted, 0));
|
List<OrdersDO> ordersDOS = ordersMapper.selectList(new QueryWrapper<OrdersDO>().eq("real_source_id", orderId).eq("deleted", 0));
|
||||||
if(CollectionUtil.isNotEmpty(ordersDOS)){
|
if(CollectionUtil.isNotEmpty(ordersDOS)){
|
||||||
// 更新订单
|
// 更新订单
|
||||||
OrdersDO ordersDO1 = ordersDOS.get(0);
|
OrdersDO ordersDO1 = ordersDOS.get(0);
|
||||||
|
|
Loading…
Reference in New Issue