UPDATE:修改导出导入子计划检测配置同步逻辑

This commit is contained in:
贾同学
2025-08-27 20:11:20 +08:00
parent 4128b21da8
commit d5e550a8f4
2 changed files with 13 additions and 9 deletions

View File

@@ -6,8 +6,8 @@ import com.njcn.gather.err.pojo.po.PqErrSys;
import com.njcn.gather.err.pojo.po.PqErrSysDtls; import com.njcn.gather.err.pojo.po.PqErrSysDtls;
import com.njcn.gather.icd.pojo.po.PqIcdPath; import com.njcn.gather.icd.pojo.po.PqIcdPath;
import com.njcn.gather.plan.pojo.po.AdPlan; import com.njcn.gather.plan.pojo.po.AdPlan;
import com.njcn.gather.plan.pojo.po.AdPlanTestConfig;
import com.njcn.gather.report.pojo.po.PqReport; import com.njcn.gather.report.pojo.po.PqReport;
import com.njcn.gather.system.cfg.pojo.po.SysTestConfig;
import com.njcn.gather.system.dictionary.pojo.po.DictData; import com.njcn.gather.system.dictionary.pojo.po.DictData;
import com.njcn.gather.system.dictionary.pojo.po.DictTree; import com.njcn.gather.system.dictionary.pojo.po.DictTree;
import com.njcn.gather.system.dictionary.pojo.po.DictType; import com.njcn.gather.system.dictionary.pojo.po.DictType;
@@ -23,7 +23,7 @@ public class AdSubPlanMetaDataVO {
private Dict dict; private Dict dict;
private AdPlan plan; private AdPlan plan;
private SysTestConfig testConfig; private AdPlanTestConfig testConfig;
private List<PqDev> devList; private List<PqDev> devList;
private List<PqStandardDev> standardDevList; private List<PqStandardDev> standardDevList;
private List<DevType> devTypeList; private List<DevType> devTypeList;

View File

@@ -1556,10 +1556,6 @@ public class AdPlanServiceImpl extends ServiceImpl<AdPlanMapper, AdPlan> impleme
dict.setTreeList(dictTreeList); dict.setTreeList(dictTreeList);
subPlanMetaData.setDict(dict); subPlanMetaData.setDict(dict);
// 获取检测相关配置
SysTestConfig testConfig = sysTestConfigService.getOneConfig();
subPlanMetaData.setTestConfig(testConfig);
// 获取误差体系数据 // 获取误差体系数据
List<PqErrSys> errSysList = pqErrSysService.list(); List<PqErrSys> errSysList = pqErrSysService.list();
subPlanMetaData.setErrSysList(errSysList); subPlanMetaData.setErrSysList(errSysList);
@@ -1569,7 +1565,9 @@ public class AdPlanServiceImpl extends ServiceImpl<AdPlanMapper, AdPlan> impleme
// 获取检测计划基本数据 // 获取检测计划基本数据
AdPlan subPlan = this.getById(planId); AdPlan subPlan = this.getById(planId);
subPlanMetaData.setPlan(subPlan); subPlanMetaData.setPlan(subPlan);
// 获取检测配置
AdPlanTestConfig testConfig = adPlanTestConfigService.lambdaQuery().eq(AdPlanTestConfig::getPlanId, subPlan.getFatherPlanId()).one();
subPlanMetaData.setTestConfig(testConfig);
// 获取检设备类型数据 // 获取检设备类型数据
List<DevType> devTypeList = devTypeService.list(); List<DevType> devTypeList = devTypeService.list();
subPlanMetaData.setDevTypeList(devTypeList); subPlanMetaData.setDevTypeList(devTypeList);
@@ -1762,9 +1760,15 @@ public class AdPlanServiceImpl extends ServiceImpl<AdPlanMapper, AdPlan> impleme
} }
} }
// 更新检测配置 // 更新检测配置
SysTestConfig testConfig = subPlanMetaDataVO.getTestConfig(); AdPlanTestConfig testConfig = subPlanMetaDataVO.getTestConfig();
if (testConfig != null) { if (testConfig != null) {
sysTestConfigService.saveOrUpdate(testConfig); Integer count = adPlanTestConfigService.lambdaQuery().eq(AdPlanTestConfig::getPlanId, testConfig.getPlanId()).count();
if (count.intValue() == 0) {
adPlanTestConfigService.save(testConfig);
} else {
adPlanTestConfigService.update(testConfig, new LambdaUpdateWrapper<AdPlanTestConfig>().eq(AdPlanTestConfig::getPlanId, testConfig.getPlanId()));
}
} }
// 批量更新误差体系 // 批量更新误差体系