Procházet zdrojové kódy

SQL优化,SQL异常日志

release_toaliyun_real
Gitea před 6 roky
committed by Stormeye Wu
rodič
revize
6cae2b4982
5 změnil soubory, kde provedl 18 přidání a 7 odebrání
  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 Zobrazit soubor

@@ -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 Zobrazit soubor

@@ -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());


+ 1
- 1
mallinkService/src/main/java/com/iformall/service/impl/WxCardSpendServiceImpl.java Zobrazit soubor

@@ -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;
}


+ 12
- 5
mallinkService/src/main/resources/mapper/WxMsgRecordMapper.xml Zobrazit soubor

@@ -59,15 +59,22 @@
order by createtime desc
</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 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
)
where uuid = #{uuid}
</update>

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


+ 1
- 1
mallinkSysAdmin/src/main/java/com/iformall/controller/datafix/DataInitController.java Zobrazit soubor

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


Načítá se…
Zrušit
Uložit