代码优化
This commit is contained in:
@@ -14,7 +14,9 @@ import com.njcn.common.utils.PubUtils;
|
||||
import com.njcn.device.biz.commApi.CommTerminalGeneralClient;
|
||||
import com.njcn.device.biz.pojo.dto.DeptGetBase;
|
||||
import com.njcn.device.biz.pojo.param.DeptGetLineParam;
|
||||
import com.njcn.device.pq.api.DeptLineFeignClient;
|
||||
import com.njcn.device.pq.api.LineFeignClient;
|
||||
import com.njcn.device.pq.pojo.po.DeptLine;
|
||||
import com.njcn.device.pq.pojo.vo.AreaLineInfoVO;
|
||||
import com.njcn.event.pojo.vo.SendEventVO;
|
||||
import com.njcn.event.utils.EventUtil;
|
||||
@@ -55,6 +57,7 @@ public class EventDetailServiceImpl extends ServiceImpl<EventDetailMapper, RmpEv
|
||||
private final MqttPublisher publisher;
|
||||
private final CommTerminalGeneralClient commTerminalGeneralClient;
|
||||
private final LineFeignClient lineFeignClient;
|
||||
private final DeptLineFeignClient deptLineFeignClient;
|
||||
|
||||
|
||||
@Override
|
||||
@@ -181,12 +184,13 @@ public class EventDetailServiceImpl extends ServiceImpl<EventDetailMapper, RmpEv
|
||||
}
|
||||
|
||||
private void pushEvent(RmpEventDetailPO po) {
|
||||
//获取部门
|
||||
String deptIndex = RequestUtil.getDeptIndex();
|
||||
//根据监测点获取部门
|
||||
DeptLine deptLine = deptLineFeignClient.getLineByLineIds(po.getMeasurementPointId()).getData();
|
||||
String id = deptLine.getId();
|
||||
Set<String> dept = new HashSet<>();
|
||||
dept.add(deptIndex);
|
||||
dept.add(id);
|
||||
DeptGetLineParam deptGetLineParam = new DeptGetLineParam();
|
||||
deptGetLineParam.setDeptId(deptIndex);
|
||||
deptGetLineParam.setDeptId(id);
|
||||
List<DeptGetBase> deptList = commTerminalGeneralClient.getDeptChildrenByParent(deptGetLineParam).getData();
|
||||
if (CollectionUtil.isNotEmpty(deptList)) {
|
||||
deptList.forEach(item->{
|
||||
|
||||
Reference in New Issue
Block a user