|
|
|
@ -187,7 +187,14 @@ public class CalcTargetConfigServiceImpl |
|
|
|
// 目标物配置默认设置 |
|
|
|
targetConfig.setId(flag? IdGenerator.nextId() : targetConfig.getId()); |
|
|
|
targetConfig.setEnable(Optional.ofNullable(targetConfig.getEnable()).orElse(true)); |
|
|
|
|
|
|
|
QueryWrapper eq = QueryWrapper.create().eq(CalcTargetConfigEntity::getTargetThingCode, targetConfig.getTargetThingCode()) |
|
|
|
.eq(CalcTargetConfigEntity::getTargetAttrCode, targetConfig.getTargetAttrCode()) |
|
|
|
.eq(CalcTargetConfigEntity::getTenantCode, UserContext.getRealTenantCode()); |
|
|
|
CalcTargetConfigEntity calcTargetConfigEntity = mapper.selectOneByQuery(eq); |
|
|
|
if(!Objects.isNull(calcTargetConfigEntity)){ |
|
|
|
//calcSourceConfigService.findByTargetId(calcTargetConfigEntity.getId()); |
|
|
|
throw new SysException(targetConfig.getTargetThingCode()+"-"+targetConfig.getTargetAttrCode()+"目标物配置已存在!不要重复配置"); |
|
|
|
} |
|
|
|
// 目标物公式描述生成、计算物配置默认信息设置 |
|
|
|
List<CalcSourceConfigDTO> sourceConfigs = targetConfig.getSourceConfigs(); |
|
|
|
|
|
|
|
|