提交 f40fcb48 作者: guofeng

1

上级 94507111
...@@ -40,7 +40,6 @@ import com.huazheng.project.hana.model.Vbap; ...@@ -40,7 +40,6 @@ import com.huazheng.project.hana.model.Vbap;
import com.huazheng.project.hana.model.VbapAdv; import com.huazheng.project.hana.model.VbapAdv;
import com.huazheng.project.hana.model.Vbep; import com.huazheng.project.hana.model.Vbep;
import com.huazheng.project.hana.model.Vbpa; import com.huazheng.project.hana.model.Vbpa;
import com.huazheng.project.hana.model.Vbrp;
import com.huazheng.project.hana.model.Vbuk; import com.huazheng.project.hana.model.Vbuk;
import com.huazheng.project.hana.model.Zmdpc; import com.huazheng.project.hana.model.Zmdpc;
import com.huazheng.project.hana.model.Zpoedit; import com.huazheng.project.hana.model.Zpoedit;
...@@ -917,7 +916,6 @@ public class DeleteUpdateJobServiceImpl { ...@@ -917,7 +916,6 @@ public class DeleteUpdateJobServiceImpl {
selectT023tCheck(); // 31 selectT023tCheck(); // 31
selectVbepCheck(); // 33 selectVbepCheck(); // 33
selectVbpaCheck(); // 34 selectVbpaCheck(); // 34
selectVbrpCheck(); // 36
selectVbukCheck(); // 37 selectVbukCheck(); // 37
selectZmdpcCheck(); // 38 selectZmdpcCheck(); // 38
selectTvkbtCheck(); // selectTvkbtCheck(); //
...@@ -1631,50 +1629,6 @@ public class DeleteUpdateJobServiceImpl { ...@@ -1631,50 +1629,6 @@ public class DeleteUpdateJobServiceImpl {
redis1Template.opsForValue().set("huazheng:checkError:Vbpa:rowNum", getErrorInfoFromException(e)); redis1Template.opsForValue().set("huazheng:checkError:Vbpa:rowNum", getErrorInfoFromException(e));
} }
} }
private void selectVbrpCheck() {
try {
ValueOperations<String, String> opsForValue = redis1Template.opsForValue();
opsForValue.setIfAbsent("huazheng:check:Vbrp:rowNum", "0");
String rowNum = opsForValue.get("huazheng:check:Vbrp:rowNum");
Vbrp build = Vbrp.builder().rowNum(rowNum).build();
List<Vbrp> list = gpMapper.selectVbrpCheck(build); // 从数仓中查询一组数据
if (list.size() == 0) {
redis1Template.opsForValue().set("huazheng:check:Vbrp:rowNum", "0"); // 计数器复位
ThreadUtil.sleep(1000); // 没有数据了,休眠一下
}
list.forEach(target -> { // 遍历要检查的数据
Vbrp source = sapMapper.selectVbrpById(target); // 根据主键查询源库中的数据
String operator = "none";
if (source == null) { // 如果源库中没有数据
gpMapper.deleteVbrp(target); // 删除数仓中的数据
operator = "delete";
} else { // 源库中有数据
String shash = SecureUtil.md5(JSONUtil.toJsonStr(source)); // 源库中数据的hash结果
String thash = target.getHashResult(); // 数仓中数据的hash结果
if (!shash.equals(thash)) { // 如果hash结果不一致
source.setHashResult(shash);
// ===============================
// ===============================
while (true) {
try {
gpMapper.updateVbrp(source); // 更新数据到数仓中
break;
} catch (RuntimeException e) {
log.error(e.getMessage());ThreadUtil.safeSleep(500);
}
}
ThreadUtil.safeSleep(500);
}
}
redis1Template.opsForValue().set("huazheng:check:Vbrp:rowNum", target.getRowNum());
if (!operator.equals("none")) {
log.info(String.format("selectVbrpCheck --> rowNum:%s, operator:%s", target.getRowNum(), operator));
}
});
} catch (Exception e) {
redis1Template.opsForValue().set("huazheng:checkError:Vbrp:rowNum", getErrorInfoFromException(e));
}
}
private void selectVbukCheck() { private void selectVbukCheck() {
try { try {
ValueOperations<String, String> opsForValue = redis1Template.opsForValue(); ValueOperations<String, String> opsForValue = redis1Template.opsForValue();
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论