fix: 老法规导入-标准号代替被代替问题 数据修复接口 企标状态

This commit is contained in:
2023-12-29 17:44:37 +08:00
parent f9fa5e59fd
commit 2510597f01
@@ -283,8 +283,8 @@ public class OldSystemServiceImpl implements OldSystemService {
// 代替标准号
// 先删除已经存储的关联
String standardNumber = dbData.getStandardNumber();
lawsReplacedStandardService.removeRelation(standardNumber, 1);
if (StringUtils.isNotBlank(tdbzh)) {
lawsReplacedStandardService.removeRelation(standardNumber, 1);
lawsReplacedStandardService.addRelationOldSystemSync(tdbzh, standardNumber, 1);
}
// 被代替标准号
@@ -297,7 +297,7 @@ public class OldSystemServiceImpl implements OldSystemService {
}
LambdaUpdateWrapper<LawsOverseasStandard> fbWrapper = new LambdaUpdateWrapper<>();
fbWrapper.eq(LawsOverseasStandard::getId, dbData.getId());
fbWrapper.set(LawsOverseasStandard::getStandardState, dbData.getStandardState());
fbWrapper.set(LawsOverseasStandard::getStandardState, fb.getStandardState());
overseasStandardService.update(fbWrapper);
}
@@ -356,8 +356,8 @@ public class OldSystemServiceImpl implements OldSystemService {
// 代替标准号
// 先删除已经存储的关联
String standardNumber = dbData.getStandardNumber();
lawsReplacedStandardService.removeRelation(standardNumber, 1);
if (StringUtils.isNotBlank(tdbzh)) {
lawsReplacedStandardService.removeRelation(standardNumber, 1);
lawsReplacedStandardService.addRelationOldSystemSync(tdbzh, standardNumber, 1);
}
// 被代替标准号
@@ -370,7 +370,7 @@ public class OldSystemServiceImpl implements OldSystemService {
}
LambdaUpdateWrapper<LawsDomesticStandard> gbWrapper = new LambdaUpdateWrapper<>();
gbWrapper.eq(LawsDomesticStandard::getId, dbData.getId());
gbWrapper.set(LawsDomesticStandard::getStandardState, dbData.getStandardState());
gbWrapper.set(LawsDomesticStandard::getStandardState, gb.getStandardState());
domesticStandardService.update(gbWrapper);
}
@@ -405,7 +405,20 @@ public class OldSystemServiceImpl implements OldSystemService {
es.setStandardNumber(dto.getBzh());
es.setStandardName(dto.getBzmc());
String standardState = dto.getBzzt();
es.setStandardState(standardState.equals("现行有效") ? "8" : "9");
switch (standardState) {
case "现行有效":
es.setStandardState("8");
break;
case "作废":
es.setStandardState("9");
break;
case "封存":
es.setStandardState("A");
break;
case "预发布":
es.setStandardState("5");
break;
}
es.setSubstituteStandardNumber(tdbzh);
es.setReplacedByStandardNumber(btdbzh);
esList.add(es);
@@ -421,8 +434,8 @@ public class OldSystemServiceImpl implements OldSystemService {
// 代替标准号
// 先删除已经存储的关联
String standardNumber = dbData.getStandardNumber();
lawsReplacedStandardService.removeRelation(standardNumber, 1);
if (StringUtils.isNotBlank(tdbzh)) {
lawsReplacedStandardService.removeRelation(standardNumber, 1);
lawsReplacedStandardService.addRelationOldSystemSync(tdbzh, standardNumber, 1);
}
// 被代替标准号
@@ -435,7 +448,7 @@ public class OldSystemServiceImpl implements OldSystemService {
}
LambdaUpdateWrapper<LawsEnterpriseStandard> esWrapper = new LambdaUpdateWrapper<>();
esWrapper.eq(LawsEnterpriseStandard::getId, dbData.getId());
esWrapper.set(LawsEnterpriseStandard::getStandardState, dbData.getStandardState());
esWrapper.set(LawsEnterpriseStandard::getStandardState, es.getStandardState());
esService.update(esWrapper);
}
// 获取当前时间戳(毫秒)