Commit 8be650b3 by 高晓磊

获取已经设置的预警人员id

parent 9f2dc139
......@@ -56,7 +56,7 @@ public class StationDaoImpl extends AbstractBaseDao implements StationDao, Stat
@Override
public List<KObject> listStationInfoByRegionalCompany(UUID regionalCompanyId) {
KClass bean = Amino.getStaticMetadataContext().getBean(StationConstant.ENTITY, KClass.class);
KClass bean = Amino.getStaticMetadataContext().getBean(ENTITY, KClass.class);
DetachedCriteria detachedCriteria = DetachedCriteria.forEntityName(bean.getName());
detachedCriteria.add(Restrictions.eq("del", false));
......
package com.xyst.dinas.biz.warn;
import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.List;
import java.util.UUID;
import java.util.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.lang.Nullable;
......@@ -251,4 +249,21 @@ public class WarningServiceImpl implements WarningService{
return new BaseBusinessWarn(warnSettingId);
}
@Override
public ArrayList<String> getExistedWarningSettingPersonnelByBillType(UUID id) {
WarnSetting warnSetting = warnSettingDao.getWarnSetting(id);
List<KObject> kObjects = warnSettingDao.queryWarnSettings(warnSetting.getBillType(), null, null);
HashSet<String> strings = new HashSet<>();
kObjects.forEach(a ->
{
String[] personnels = Optional.ofNullable(a.getString("personnel")).orElse("").split(",");
strings.addAll(Arrays.asList(personnels));
}
);
strings.remove("");
return new ArrayList<>(strings);
}
}
package com.xyst.dinas.biz.warn.service;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.UUID;
......@@ -95,4 +96,6 @@ public interface WarningService {
void ignoreWarnExeRecord(UUID id);
HashMap<String, Object> warnRecodeGroupInfo(List<UUID> regionalCompanyIds, List<String> targets);
ArrayList<String> getExistedWarningSettingPersonnelByBillType(UUID id);
}
......@@ -64,8 +64,15 @@ public class WarnSettingController {
}
/**
* 获取已经设置的预警通知人员
* @param id
* @return
*/
@GetMapping("/warnsetting/getExistedWarningSettingPersonnel/{id}")
public ResponseObj getExistedWarningSetting(@PathVariable("id")UUID id) {
List<String> personnel = warningService.getExistedWarningSettingPersonnelByBillType(id);
return ResponseObj.success("查询成功",personnel);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment