Просмотр исходного кода

SQL优化,SQL异常日志

release_toaliyun_real
Gitea 6 лет назад
committed by Stormeye Wu
Родитель
Сommit
6cae2b4982
5 измененных файлов: 18 добавлений и 7 удалений
  1. +2
    -0
      mallinkAdmin/src/main/resources/db/migration/V20203271750__optimization.sql
  2. +2
    -0
      mallinkPosApi/src/main/java/com/iformall/service/impl/PosServiceImpl.java
  3. +1
    -1
      mallinkService/src/main/java/com/iformall/service/impl/WxCardSpendServiceImpl.java
  4. +12
    -5
      mallinkService/src/main/resources/mapper/WxMsgRecordMapper.xml
  5. +1
    -1
      mallinkSysAdmin/src/main/java/com/iformall/controller/datafix/DataInitController.java

+ 2
- 0
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 '消息索引';

+ 2
- 0
mallinkPosApi/src/main/java/com/iformall/service/impl/PosServiceImpl.java Просмотреть файл

@@ -2346,6 +2346,7 @@ public class PosServiceImpl implements PosService {
try { try {
orderQ = orderMapper.selectOne(new QueryWrapper<>(orderQ)); orderQ = orderMapper.selectOne(new QueryWrapper<>(orderQ));
} catch (Exception e) { } catch (Exception e) {
logger.error("sql error ",e);
isExist = false; isExist = false;
} }
if (orderQ != null) { if (orderQ != null) {
@@ -2424,6 +2425,7 @@ public class PosServiceImpl implements PosService {
try { try {
refundQ = orderMapper.selectOne(new QueryWrapper<>(refundQ)); refundQ = orderMapper.selectOne(new QueryWrapper<>(refundQ));
} catch (Exception e) { } catch (Exception e) {
logger.error("sql error ",e);
} }
if (refundQ != null) { if (refundQ != null) {
logger.error(ErrorCode.POS_ORDER_HAD_SYNCED.getMessage()); logger.error(ErrorCode.POS_ORDER_HAD_SYNCED.getMessage());


+ 1
- 1
mallinkService/src/main/java/com/iformall/service/impl/WxCardSpendServiceImpl.java Просмотреть файл

@@ -85,7 +85,7 @@ public class WxCardSpendServiceImpl implements WxCardSpendService {
try { try {
couponMerchant = wxCouponMerchantMapper.selectOne(new QueryWrapper(couponMerchantQ)); couponMerchant = wxCouponMerchantMapper.selectOne(new QueryWrapper(couponMerchantQ));
} catch (Exception e) { } catch (Exception e) {
logger.error("couponmerchant not found: " + cardInfo.getCouponId());
logger.error("couponmerchant not found: " + cardInfo.getCouponId(),e);
} }
return couponMerchant; return couponMerchant;
} }


+ 12
- 5
mallinkService/src/main/resources/mapper/WxMsgRecordMapper.xml Просмотреть файл

@@ -59,15 +59,22 @@
order by createtime desc order by createtime desc
</sql> </sql>


<!-- <update id="updateByBaseMsg" parameterType="com.iformall.domain.po.msg.BaseMsg">-->
<!-- update wx_msg_record set updatetime = now()-->
<!-- <if test=" null != msgStatus ">,msg_status = #{msgStatus}</if>-->
<!-- <if test=" null != statusMessage ">,status_message = #{statusMessage}</if>-->
<!-- where id in(-->
<!-- select t.id from (-->
<!-- select id from wx_msg_record where uuid = #{uuid}-->
<!-- ) t-->
<!-- )-->
<!-- </update>-->

<update id="updateByBaseMsg" parameterType="com.iformall.domain.po.msg.BaseMsg"> <update id="updateByBaseMsg" parameterType="com.iformall.domain.po.msg.BaseMsg">
update wx_msg_record set updatetime = now() update wx_msg_record set updatetime = now()
<if test=" null != msgStatus ">,msg_status = #{msgStatus}</if> <if test=" null != msgStatus ">,msg_status = #{msgStatus}</if>
<if test=" null != statusMessage ">,status_message = #{statusMessage}</if> <if test=" null != statusMessage ">,status_message = #{statusMessage}</if>
where id in(
select t.id from (
select id from wx_msg_record where uuid = #{uuid}
) t
)
where uuid = #{uuid}
</update> </update>


<select id="findList" parameterType="com.iformall.domain.po.msg.WxMsgRecord" resultMap="BaseResultMap"> <select id="findList" parameterType="com.iformall.domain.po.msg.WxMsgRecord" resultMap="BaseResultMap">


+ 1
- 1
mallinkSysAdmin/src/main/java/com/iformall/controller/datafix/DataInitController.java Просмотреть файл

@@ -184,7 +184,7 @@ public class DataInitController extends BaseController {
try { try {
ret = creditHistoryMapper.selectOne(new QueryWrapper<>(q)); ret = creditHistoryMapper.selectOne(new QueryWrapper<>(q));
} catch (Exception e) { } catch (Exception e) {
logger.error("sql error ",e);
} }
if (ret != null) { if (ret != null) {
log.debug(" : {}", ret.getId()); log.debug(" : {}", ret.getId());


Загрузка…
Отмена
Сохранить