提交 8444f81e authored 作者: inroi's avatar inroi

微调

上级 560efbca
......@@ -34,12 +34,12 @@ public interface LogMapper extends BaseMapper<Log> {
/**
* 根据ID查询同步日志
* 根据ID查询失败日志
*
* @param id 时间
* @return 失败同步日志
* @param idList ID列表
* @return 失败日志
*/
Log selectLogById(Integer id);
List<Log> selectLogByIdList(List<Integer> idList);
}
......@@ -37,9 +37,12 @@
<select id="selectLogById" parameterType="java.lang.Integer" resultType="com.nzwz.model.Log">
<select id="selectLogByIdList" parameterType="java.lang.Integer" resultType="com.nzwz.model.Log">
SELECT id, content, `data` FROM tb_log WHERE id = #{id}
SELECT id, content, `data` FROM tb_log WHERE id IN
<foreach collection="idList" item="item" separator="," open="(" close=")">
#{item}
</foreach>
</select>
......
......@@ -160,12 +160,14 @@ public class SynchronizationServiceImpl implements ISynchronizationService {
@Override
public RestResponse abnormalSynchronization(AbnormalSynchronizationInVo inVo) {
Log log = logMapper.selectLogById(inVo.getId());
List<Log> dataList = logMapper.selectLogByIdList(inVo.getIdList());
List<Object> tempList = JsonUtil.toList(log.getData(), Object.class);
for (Object object : tempList) {
Map<String, Object> data = JsonUtil.toMap(JsonUtil.toString(object), String.class, Object.class);
this.reload(data, log);
for (Log log : dataList) {
List<Object> tempList = JsonUtil.toList(log.getData(), Object.class);
for (Object object : tempList) {
Map<String, Object> data = JsonUtil.toMap(JsonUtil.toString(object), String.class, Object.class);
this.reload(data, log);
}
}
return RestResponse.success();
......
......@@ -2,6 +2,8 @@ package com.nzwz.transfer.synchronization;
import lombok.Data;
import java.util.List;
/**
* @author Inori
*/
......@@ -9,9 +11,9 @@ import lombok.Data;
public class AbnormalSynchronizationInVo {
/**
* ID
* ID列表
*/
private Integer id;
private List<Integer> idList;
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论