UPDATE:修改导出导入子计划检测配置同步逻辑
This commit is contained in:
@@ -6,8 +6,8 @@ import com.njcn.gather.err.pojo.po.PqErrSys;
|
||||
import com.njcn.gather.err.pojo.po.PqErrSysDtls;
|
||||
import com.njcn.gather.icd.pojo.po.PqIcdPath;
|
||||
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.system.cfg.pojo.po.SysTestConfig;
|
||||
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.DictType;
|
||||
@@ -23,7 +23,7 @@ public class AdSubPlanMetaDataVO {
|
||||
|
||||
private Dict dict;
|
||||
private AdPlan plan;
|
||||
private SysTestConfig testConfig;
|
||||
private AdPlanTestConfig testConfig;
|
||||
private List<PqDev> devList;
|
||||
private List<PqStandardDev> standardDevList;
|
||||
private List<DevType> devTypeList;
|
||||
|
||||
@@ -1556,10 +1556,6 @@ public class AdPlanServiceImpl extends ServiceImpl<AdPlanMapper, AdPlan> impleme
|
||||
dict.setTreeList(dictTreeList);
|
||||
subPlanMetaData.setDict(dict);
|
||||
|
||||
// 获取检测相关配置
|
||||
SysTestConfig testConfig = sysTestConfigService.getOneConfig();
|
||||
subPlanMetaData.setTestConfig(testConfig);
|
||||
|
||||
// 获取误差体系数据
|
||||
List<PqErrSys> errSysList = pqErrSysService.list();
|
||||
subPlanMetaData.setErrSysList(errSysList);
|
||||
@@ -1569,7 +1565,9 @@ public class AdPlanServiceImpl extends ServiceImpl<AdPlanMapper, AdPlan> impleme
|
||||
// 获取检测计划基本数据
|
||||
AdPlan subPlan = this.getById(planId);
|
||||
subPlanMetaData.setPlan(subPlan);
|
||||
|
||||
// 获取检测配置
|
||||
AdPlanTestConfig testConfig = adPlanTestConfigService.lambdaQuery().eq(AdPlanTestConfig::getPlanId, subPlan.getFatherPlanId()).one();
|
||||
subPlanMetaData.setTestConfig(testConfig);
|
||||
// 获取检设备类型数据
|
||||
List<DevType> devTypeList = devTypeService.list();
|
||||
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) {
|
||||
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()));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// 批量更新误差体系
|
||||
|
||||
Reference in New Issue
Block a user