|
|
@ -9,6 +9,7 @@ import com.epmet.dao.IcResiCategoryWarnConfigDao; |
|
|
|
import com.epmet.dto.IcResiCategoryStatsConfigDTO; |
|
|
|
import com.epmet.dto.form.IcResiCategoryStatsConfigFormDTO; |
|
|
|
import com.epmet.dto.form.IcResiCategoryStatsConfigSortFormDTO; |
|
|
|
import com.epmet.dto.form.ResiCategoryStatsConfigListFormDTO; |
|
|
|
import com.epmet.dto.result.IcResiCategoryStatsConfigResultDTO; |
|
|
|
import com.epmet.entity.IcFormItemEntity; |
|
|
|
import com.epmet.entity.IcFormItemGroupEntity; |
|
|
@ -47,7 +48,7 @@ public class ResiCategoryStatsConfigServiceImpl implements ResiCategoryStatsConf |
|
|
|
|
|
|
|
@Override |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public List<IcResiCategoryStatsConfigResultDTO> list(String customerId) { |
|
|
|
public List<IcResiCategoryStatsConfigResultDTO> list(String customerId, ResiCategoryStatsConfigListFormDTO formDTO) { |
|
|
|
//1.获取IC_FORM_ITEM 中 用于数据分析字段的 id 和label
|
|
|
|
List<IcFormItemEntity> icFormItemEntityList = icFormItemDao.selectList(new QueryWrapper<IcFormItemEntity>().lambda().eq(IcFormItemEntity::getCustomerId,customerId).eq(IcFormItemEntity::getDataAnalyse, 1)); |
|
|
|
if(CollectionUtils.isEmpty(icFormItemEntityList)){ |
|
|
@ -160,7 +161,28 @@ public class ResiCategoryStatsConfigServiceImpl implements ResiCategoryStatsConf |
|
|
|
result.add(icResiCategoryStatsConfigResultDTO); |
|
|
|
|
|
|
|
}); |
|
|
|
return result; |
|
|
|
if(null == formDTO){ |
|
|
|
return result; |
|
|
|
} |
|
|
|
List<IcResiCategoryStatsConfigResultDTO> collect = new ArrayList<>(); |
|
|
|
for (IcResiCategoryStatsConfigResultDTO item:result){ |
|
|
|
String isWarn = String.valueOf(formDTO.getIsWarn()); |
|
|
|
if(null !=formDTO.getIsWarn() && (!item.getWarn().equals(isWarn))){ |
|
|
|
continue; |
|
|
|
} |
|
|
|
if(null!=formDTO.getLevel()){ |
|
|
|
if(1==formDTO.getLevel()&&null==item.getLevel1()){ |
|
|
|
continue; |
|
|
|
} |
|
|
|
if(2==formDTO.getLevel()&&null==item.getLevel2()){ |
|
|
|
continue; |
|
|
|
} |
|
|
|
} |
|
|
|
collect.add(item); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return collect; |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
@ -198,13 +220,14 @@ public class ResiCategoryStatsConfigServiceImpl implements ResiCategoryStatsConf |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public void update(String customerId,IcResiCategoryStatsConfigFormDTO formDTO) { |
|
|
|
IcResiCategoryStatsConfigDTO icResiCategoryStatsConfigDTO = icResiCategoryStatsConfigService.get(formDTO.getId()); |
|
|
|
if(null == icResiCategoryStatsConfigDTO){ |
|
|
|
if(null == icResiCategoryStatsConfigDTO || !customerId.equals(icResiCategoryStatsConfigDTO.getCustomerId())){ |
|
|
|
return ; |
|
|
|
} |
|
|
|
|
|
|
|
//更新配置类别
|
|
|
|
IcResiCategoryStatsConfigEntity icResiCategoryStatsConfigEntity = new IcResiCategoryStatsConfigEntity(); |
|
|
|
BeanUtils.copyProperties(formDTO,icResiCategoryStatsConfigEntity); |
|
|
|
icResiCategoryStatsConfigEntity.setCustomerId(customerId); |
|
|
|
// icResiCategoryStatsConfigEntity.setCustomerId(customerId);
|
|
|
|
icResiCategoryStatsConfigDao.updateById(icResiCategoryStatsConfigEntity); |
|
|
|
|
|
|
|
//更新配置预警
|
|
|
@ -226,7 +249,7 @@ public class ResiCategoryStatsConfigServiceImpl implements ResiCategoryStatsConf |
|
|
|
icResiCategoryWarnConfigEntity.setSort(icResiCategoryStatsConfigDTO.getSort()); |
|
|
|
icResiCategoryWarnConfigDao.insert(icResiCategoryWarnConfigEntity); |
|
|
|
}else{ |
|
|
|
icResiCategoryWarnConfigEntity.setCustomerId(customerId); |
|
|
|
// icResiCategoryWarnConfigEntity.setCustomerId(customerId);
|
|
|
|
icResiCategoryWarnConfigEntity.setLabel(icResiCategoryStatsConfigDTO.getLabel()); |
|
|
|
icResiCategoryWarnConfigEntity.setTableName(icResiCategoryStatsConfigDTO.getTableName()); |
|
|
|
icResiCategoryWarnConfigEntity.setColumnName(icResiCategoryStatsConfigDTO.getColumnName()); |
|
|
@ -253,7 +276,7 @@ public class ResiCategoryStatsConfigServiceImpl implements ResiCategoryStatsConf |
|
|
|
//更新配置类别
|
|
|
|
IcResiCategoryStatsConfigEntity icResiCategoryStatsConfigEntity = new IcResiCategoryStatsConfigEntity(); |
|
|
|
BeanUtils.copyProperties(formDTO,icResiCategoryStatsConfigEntity); |
|
|
|
icResiCategoryStatsConfigEntity.setCustomerId(customerId); |
|
|
|
// icResiCategoryStatsConfigEntity.setCustomerId(customerId);
|
|
|
|
icResiCategoryStatsConfigDao.updateById(icResiCategoryStatsConfigEntity); |
|
|
|
} |
|
|
|
|
|
|
@ -264,7 +287,7 @@ public class ResiCategoryStatsConfigServiceImpl implements ResiCategoryStatsConf |
|
|
|
for (IcResiCategoryStatsConfigSortFormDTO formDTO : formDTOs) { |
|
|
|
IcResiCategoryStatsConfigEntity icResiCategoryStatsConfigEntity = new IcResiCategoryStatsConfigEntity(); |
|
|
|
icResiCategoryStatsConfigEntity.setId(formDTO.getId()); |
|
|
|
icResiCategoryStatsConfigEntity.setCustomerId(customerId); |
|
|
|
// icResiCategoryStatsConfigEntity.setCustomerId(customerId);
|
|
|
|
icResiCategoryStatsConfigEntity.setSort(formDTO.getSort()); |
|
|
|
entityList.add(icResiCategoryStatsConfigEntity); |
|
|
|
} |
|
|
|