From fe0eacc11841dc1f65e71cd8027c81bac6d4eb08 Mon Sep 17 00:00:00 2001 From: Stormeye Wu Date: Wed, 25 Mar 2020 11:29:43 +0800 Subject: [PATCH 1/5] =?UTF-8?q?[POS][=E4=BF=AE=E6=94=B9]:=E5=8F=82?= =?UTF-8?q?=E6=95=B0=E6=B3=A8=E9=87=8A=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/iformall/controller/PosController.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mallinkPosApi/src/main/java/com/iformall/controller/PosController.java b/mallinkPosApi/src/main/java/com/iformall/controller/PosController.java index c83fc6b7b..3672ab836 100644 --- a/mallinkPosApi/src/main/java/com/iformall/controller/PosController.java +++ b/mallinkPosApi/src/main/java/com/iformall/controller/PosController.java @@ -294,7 +294,8 @@ public class PosController extends BaseController { "\"mem_id\":\"string(必填)\"," + "\"mem_phone_number\":\"string(必填)\"," + "\"order_number_of_platform\":\"string(必填)\"," + - "\"order_amount\":\"string单位(分)(选填)\"," + + "\"order_time_of_platform\":\"string(必填)平台订单创建时间, 格式:4位年2位月2位日2位24小时制时2位分2位秒3位毫秒\"," + + "\"order_amount\":\"string单位(分)(必填)\"," + "\"order_amount_left\":\"string单位(分)(选填)\"," + "\"order_create_sn\":\"string单位(分)(必填)\"," + "\"payment_info\":{" + From 6a3739e61c52f510e069717bde46665b78dd9f21 Mon Sep 17 00:00:00 2001 From: Stormeye Wu Date: Wed, 25 Mar 2020 14:53:07 +0800 Subject: [PATCH 2/5] =?UTF-8?q?[POS][=E4=BF=AE=E6=94=B9]:=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E6=89=93=E5=8D=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/iformall/controller/PosController.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mallinkPosApi/src/main/java/com/iformall/controller/PosController.java b/mallinkPosApi/src/main/java/com/iformall/controller/PosController.java index 3672ab836..328ff0840 100644 --- a/mallinkPosApi/src/main/java/com/iformall/controller/PosController.java +++ b/mallinkPosApi/src/main/java/com/iformall/controller/PosController.java @@ -323,9 +323,11 @@ public class PosController extends BaseController { try { retObj = posService.posOrderSync(params); } catch (MallinkException e) { - return buildReturnMap(retObj, resKey, WxPayConstant.RET_SUCCESS, "", e.getErrorCode(), e.getMessage()); + logger.error(e.getMessage()); + return buildReturnMap(retObj, resKey, WxPayConstant.RET_FAIL, "", e.getErrorCode(), e.getMessage()); } catch (Exception e) { - return buildReturnMap(retObj, resKey, WxPayConstant.RET_SUCCESS, "", 500, e.getMessage()); + logger.error(e.getMessage()); + return buildReturnMap(retObj, resKey, WxPayConstant.RET_FAIL, "", 500, e.getMessage()); } return buildReturnMap(retObj, resKey, WxPayConstant.RET_SUCCESS, "",null); From 6eb8ca47e5e980f32b831c301195d792b828a3f4 Mon Sep 17 00:00:00 2001 From: Stormeye Wu Date: Fri, 27 Mar 2020 13:17:02 +0800 Subject: [PATCH 3/5] =?UTF-8?q?[B=E7=AB=AF=E7=94=A8=E6=88=B7][=E4=BF=AE?= =?UTF-8?q?=E6=94=B9]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/iformall/service/impl/WxBuserServiceImpl.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxBuserServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxBuserServiceImpl.java index 1c6c4a603..8b2576f71 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxBuserServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxBuserServiceImpl.java @@ -14,6 +14,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.Date; +import java.util.List; /** * @author gongbiao @@ -43,7 +44,10 @@ public class WxBuserServiceImpl implements WxBuserService { @Override public WxBuser getByObject(WxBuser record) { try { - return wxBuserMapper.selectOne(new QueryWrapper(record)); + List list = wxBuserMapper.selectList(new QueryWrapper(record)); + if (list.size() > 0) { + return list.get(0); + } } catch (Exception e) { logger.error("NOT found: " + e.getMessage()); } From 6cae2b498226e7d2a47c536775ea49d2070e20ce Mon Sep 17 00:00:00 2001 From: Gitea Date: Fri, 27 Mar 2020 18:22:02 +0800 Subject: [PATCH 4/5] =?UTF-8?q?SQL=E4=BC=98=E5=8C=96=EF=BC=8CSQL=E5=BC=82?= =?UTF-8?q?=E5=B8=B8=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../db/migration/V20203271750__optimization.sql | 2 ++ .../iformall/service/impl/PosServiceImpl.java | 2 ++ .../service/impl/WxCardSpendServiceImpl.java | 2 +- .../main/resources/mapper/WxMsgRecordMapper.xml | 17 ++++++++++++----- .../controller/datafix/DataInitController.java | 2 +- 5 files changed, 18 insertions(+), 7 deletions(-) create mode 100644 mallinkAdmin/src/main/resources/db/migration/V20203271750__optimization.sql diff --git a/mallinkAdmin/src/main/resources/db/migration/V20203271750__optimization.sql b/mallinkAdmin/src/main/resources/db/migration/V20203271750__optimization.sql new file mode 100644 index 000000000..27b5c5f60 --- /dev/null +++ b/mallinkAdmin/src/main/resources/db/migration/V20203271750__optimization.sql @@ -0,0 +1,2 @@ +ALTER TABLE `wx_msg_record` +ADD INDEX `idx_uuid_msg`(`uuid`, `msg_type`, `msg_status`, `status_message`(8)) USING BTREE COMMENT '消息索引'; \ No newline at end of file diff --git a/mallinkPosApi/src/main/java/com/iformall/service/impl/PosServiceImpl.java b/mallinkPosApi/src/main/java/com/iformall/service/impl/PosServiceImpl.java index e82d2e04c..f8de6e1c0 100644 --- a/mallinkPosApi/src/main/java/com/iformall/service/impl/PosServiceImpl.java +++ b/mallinkPosApi/src/main/java/com/iformall/service/impl/PosServiceImpl.java @@ -2346,6 +2346,7 @@ public class PosServiceImpl implements PosService { try { orderQ = orderMapper.selectOne(new QueryWrapper<>(orderQ)); } catch (Exception e) { + logger.error("sql error ",e); isExist = false; } if (orderQ != null) { @@ -2424,6 +2425,7 @@ public class PosServiceImpl implements PosService { try { refundQ = orderMapper.selectOne(new QueryWrapper<>(refundQ)); } catch (Exception e) { + logger.error("sql error ",e); } if (refundQ != null) { logger.error(ErrorCode.POS_ORDER_HAD_SYNCED.getMessage()); diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxCardSpendServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxCardSpendServiceImpl.java index d93c8043d..64c0466c5 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxCardSpendServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxCardSpendServiceImpl.java @@ -85,7 +85,7 @@ public class WxCardSpendServiceImpl implements WxCardSpendService { try { couponMerchant = wxCouponMerchantMapper.selectOne(new QueryWrapper(couponMerchantQ)); } catch (Exception e) { - logger.error("couponmerchant not found: " + cardInfo.getCouponId()); + logger.error("couponmerchant not found: " + cardInfo.getCouponId(),e); } return couponMerchant; } diff --git a/mallinkService/src/main/resources/mapper/WxMsgRecordMapper.xml b/mallinkService/src/main/resources/mapper/WxMsgRecordMapper.xml index ce39aff59..2c3cddffa 100644 --- a/mallinkService/src/main/resources/mapper/WxMsgRecordMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxMsgRecordMapper.xml @@ -59,15 +59,22 @@ order by createtime desc + + + + + + + + + + + update wx_msg_record set updatetime = now() ,msg_status = #{msgStatus} ,status_message = #{statusMessage} - where id in( - select t.id from ( - select id from wx_msg_record where uuid = #{uuid} - ) t - ) + where uuid = #{uuid}