From 692a225097b15d0f6e253a79c0734a28137e636f Mon Sep 17 00:00:00 2001 From: wangchaoxu Date: Fri, 22 Sep 2023 17:08:12 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=9B=B4=E6=96=B0=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ms/api/service/impl/OpOrderServiceImpl.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/ms-biz/src/main/java/com/ms/api/service/impl/OpOrderServiceImpl.java b/ms-biz/src/main/java/com/ms/api/service/impl/OpOrderServiceImpl.java index 92dcd76e..9254acf7 100644 --- a/ms-biz/src/main/java/com/ms/api/service/impl/OpOrderServiceImpl.java +++ b/ms-biz/src/main/java/com/ms/api/service/impl/OpOrderServiceImpl.java @@ -447,7 +447,15 @@ public class OpOrderServiceImpl implements OpOrderService { OpOrder insertOrderData = BeanUtil.toBean(orderInfo, OpOrder.class); log.info("start insertUpdateOpOrder {}", insertOrderData); - opOrderMapper.insertOrUpdate(insertOrderData); + OpOrder orderObj = opOrderMapper.selectByOrderId(order.getOrderId()); + if (orderObj == null) { + opOrderMapper.insertSelective(insertOrderData); + } else { + OpOrder updateOrderData = insertOrderData; + updateOrderData.setGmtCreate(null); + updateOrderData.setOpOrderId(orderObj.getOpOrderId()); + opOrderMapper.updateByPrimaryKeySelective(updateOrderData); + } // TODO: 2023/8/31 op_order_user_open_id // log.info("start saveOpOrderUserOpenId ");