Commit 7d186580 authored by 韩桐桐's avatar 韩桐桐

检查设备是否引用,查询sql时清除mybatis缓存,强制开启新事务。减少干扰

parent 80eaba86
......@@ -2330,7 +2330,7 @@
WHERE tjvi."USE_UNIT_CREDIT_CODE" = #{useCode}
AND tjvi.is_delete = '0'
</select>
<select id="countEquipInUseTimesWithOutZF" resultType="java.lang.Integer">
<select id="countEquipInUseTimesWithOutZF" resultType="java.lang.Integer" flushCache="true">
select
sum(inUseNumber)
from (
......
......@@ -85,6 +85,7 @@ import org.springframework.core.io.Resource;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.Assert;
import org.springframework.util.CollectionUtils;
......@@ -2152,6 +2153,7 @@ public class CommonServiceImpl implements ICommonService {
}
@Override
@Transactional(propagation = Propagation.REQUIRES_NEW)
public Boolean checkEquipIsUsed(String record) {
Integer useTime = commonMapper.countEquipInUseTimesWithOutZF(record);
log.info("检查设备是否被使用,设备:{},业务数:{}", record, useTime);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment