登录用户部门排序问题
This commit is contained in:
@@ -26,4 +26,6 @@ public class BaseVO implements Serializable {
|
||||
@ApiModelProperty("父节点id")
|
||||
private String pid;
|
||||
|
||||
private Integer sort;
|
||||
|
||||
}
|
||||
|
||||
@@ -206,7 +206,7 @@ public class MonitorPointController extends BaseController {
|
||||
* @author zbj
|
||||
* @date 2022/7/28
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.DOWNLOAD)
|
||||
/*@OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.DOWNLOAD)
|
||||
@PostMapping("/downloadMonitorEventWaveFile")
|
||||
@ApiOperation("监测点事件波形下载")
|
||||
@ApiImplicitParam(name = "waveFileParam", value = "波形下载参数", required = true)
|
||||
@@ -214,6 +214,6 @@ public class MonitorPointController extends BaseController {
|
||||
String methodDescribe = getMethodDescribe("downloadMonitorEventWaveFile");
|
||||
HttpServletResponse resp = eventAnalysisService.downloadMonitorEventWaveFile(waveFileParam, response);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, resp, methodDescribe);
|
||||
}
|
||||
}*/
|
||||
|
||||
}
|
||||
|
||||
@@ -89,7 +89,7 @@ public interface EventAnalysisService {
|
||||
* @author zbj
|
||||
* @date 2022/7/28
|
||||
*/
|
||||
HttpServletResponse downloadMonitorEventWaveFile(WaveFileParam waveFileParam, HttpServletResponse response) throws Exception;
|
||||
//HttpServletResponse downloadMonitorEventWaveFile(WaveFileParam waveFileParam, HttpServletResponse response) throws Exception;
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1815,7 +1815,7 @@ public class EventAnalysisServiceImpl implements EventAnalysisService {
|
||||
* @author zbj
|
||||
* @date 2022/7/28
|
||||
*/
|
||||
@Override
|
||||
/* @Override
|
||||
public HttpServletResponse downloadMonitorEventWaveFile(WaveFileParam waveFileParam, HttpServletResponse response) throws Exception {
|
||||
List<String> lineId = waveFileParam.getLineId();
|
||||
List<String> timeId = waveFileParam.getTimeId();
|
||||
@@ -1872,7 +1872,7 @@ public class EventAnalysisServiceImpl implements EventAnalysisService {
|
||||
delFile(zipPath);
|
||||
deleteDirectoryLegacyIO(new File(generalInfo.getBusinessTempPath() + File.separator + "comtrade"));
|
||||
return response;
|
||||
}
|
||||
}*/
|
||||
|
||||
/**
|
||||
* 复制保存文件
|
||||
|
||||
@@ -133,22 +133,22 @@ public class TransientServiceImpl implements TransientService {
|
||||
String format = dateTimeFormatter.format(eventDetail.getStartTime());
|
||||
transientVO.setTime(format);
|
||||
switch (eventDetail.getEventType()) {
|
||||
case 0+"":
|
||||
case 0 + "":
|
||||
transientVO.setTrigType("扰动");
|
||||
break;
|
||||
case 1+"":
|
||||
case 1 + "":
|
||||
transientVO.setTrigType("暂降");
|
||||
break;
|
||||
case 2+"":
|
||||
case 2 + "":
|
||||
transientVO.setTrigType("暂升");
|
||||
break;
|
||||
case 3+"":
|
||||
case 3 + "":
|
||||
transientVO.setTrigType("中断");
|
||||
break;
|
||||
case 4+"":
|
||||
case 4 + "":
|
||||
transientVO.setTrigType("其他");
|
||||
break;
|
||||
case 5+"":
|
||||
case 5 + "":
|
||||
transientVO.setTrigType("录波");
|
||||
break;
|
||||
}
|
||||
@@ -189,16 +189,16 @@ public class TransientServiceImpl implements TransientService {
|
||||
|
||||
//获取暂降事件
|
||||
RmpEventDetailPO eventDetail = rmpEventDetailMapper.getByEventId(param.getId());
|
||||
LineDetailDataVO lineDetailData=new LineDetailDataVO();
|
||||
MonitorVO monitorVO=new MonitorVO();
|
||||
LineDetailDataVO lineDetailData = new LineDetailDataVO();
|
||||
MonitorVO monitorVO = new MonitorVO();
|
||||
String ip;
|
||||
if(param.getSystemType()==0){
|
||||
if (param.getSystemType() == 0) {
|
||||
lineDetailData = lineFeignClient.getLineDetailData(eventDetail.getMeasurementPointId()).getData();
|
||||
ip=lineDetailData.getIp();
|
||||
}else{
|
||||
ip = lineDetailData.getIp();
|
||||
} else {
|
||||
param.setId(eventDetail.getMeasurementPointId());
|
||||
monitorVO = monitorClient.getMonitorTerminal(param).getData();
|
||||
ip=monitorVO.getIp();
|
||||
ip = monitorVO.getIp();
|
||||
}
|
||||
|
||||
|
||||
@@ -218,7 +218,7 @@ public class TransientServiceImpl implements TransientService {
|
||||
} else {
|
||||
cfgPath = OssPath.WAVE_DIR + ip + StrUtil.SLASH + waveName + GeneralConstant.CFG;
|
||||
datPath = OssPath.WAVE_DIR + ip + StrUtil.SLASH + waveName + GeneralConstant.DAT;
|
||||
System.out.println("波形路径-------------------"+cfgPath);
|
||||
System.out.println("波形路径-------------------" + cfgPath);
|
||||
try (
|
||||
|
||||
InputStream cfgStream = fileStorageUtil.getFileStream(cfgPath);
|
||||
@@ -233,7 +233,7 @@ public class TransientServiceImpl implements TransientService {
|
||||
}
|
||||
}
|
||||
waveDataDTO = waveUtil.getValidData(originalData);
|
||||
if(param.getSystemType()==0){
|
||||
if (param.getSystemType() == 0) {
|
||||
waveDataDTO.setPtType(PubUtils.ptTypeName(lineDetailData.getPtType()));
|
||||
double pt1 = Double.parseDouble(lineDetailData.getPt().split(StrUtil.SLASH)[0]);
|
||||
double pt2 = Double.parseDouble(lineDetailData.getPt().split(StrUtil.SLASH)[1]);
|
||||
@@ -252,7 +252,6 @@ public class TransientServiceImpl implements TransientService {
|
||||
|
||||
@Override
|
||||
public void downloadWaveFile(List<String> eventIds, HttpServletResponse response) {
|
||||
|
||||
copyTempData(eventIds);
|
||||
zipCompress(new File(generalInfo.getBusinessTempPath() + File.separator + "comtrade"));
|
||||
String zipPath = generalInfo.getBusinessTempPath() + File.separator + "comtrade.zip";
|
||||
@@ -349,8 +348,8 @@ public class TransientServiceImpl implements TransientService {
|
||||
}
|
||||
// Page<RmpEventDetailPO> pageInfo = eventDetailService.page(new Page<>(transientParam.getPageNum(), transientParam.getPageSize()),wrapper);
|
||||
Page<RmpEventDetailPO> pageInfo = pwRmpEventDetailMapper.selectPage(new Page<>(transientParam.getPageNum(), transientParam.getPageSize()), wrapper);
|
||||
List<EventDetailNew> eventDetailData=BeanUtil.copyToList(pageInfo.getRecords(),EventDetailNew.class);
|
||||
page= BeanUtil.copyProperties(pageInfo,Page.class);
|
||||
List<EventDetailNew> eventDetailData = BeanUtil.copyToList(pageInfo.getRecords(), EventDetailNew.class);
|
||||
page = BeanUtil.copyProperties(pageInfo, Page.class);
|
||||
if (CollUtil.isNotEmpty(eventDetailData)) {
|
||||
List<String> lineIds = eventDetailData.stream().map(EventDetailNew::getLineId).distinct().collect(Collectors.toList());
|
||||
List<AreaLineInfoVO> r = lineFeignClient.getBaseLineAreaInfo(lineIds).getData();
|
||||
@@ -372,7 +371,7 @@ public class TransientServiceImpl implements TransientService {
|
||||
}
|
||||
}
|
||||
|
||||
if(StrUtil.isNotBlank(eventDetail.getAdvanceReason())) {
|
||||
if (StrUtil.isNotBlank(eventDetail.getAdvanceReason())) {
|
||||
for (DictData dictData : reasonList) {
|
||||
if (eventDetail.getAdvanceReason().equals(dictData.getId())) {
|
||||
eventDetail.setAdvanceReason(dictData.getName());
|
||||
@@ -381,7 +380,7 @@ public class TransientServiceImpl implements TransientService {
|
||||
}
|
||||
}
|
||||
|
||||
if(StrUtil.isNotBlank(eventDetail.getAdvanceType())) {
|
||||
if (StrUtil.isNotBlank(eventDetail.getAdvanceType())) {
|
||||
for (DictData dictData : typeList) {
|
||||
if (eventDetail.getAdvanceType().equals(dictData.getId())) {
|
||||
eventDetail.setAdvanceType(dictData.getName());
|
||||
@@ -404,11 +403,11 @@ public class TransientServiceImpl implements TransientService {
|
||||
if (StringUtils.isBlank(searchValue)) {
|
||||
return true;
|
||||
} else {
|
||||
if (StringUtils.contains(item.getGdName(),searchValue)
|
||||
||StringUtils.contains(item.getSubName(),searchValue)
|
||||
||StringUtils.contains(item.getIp(),searchValue)
|
||||
||StringUtils.contains(item.getLineName(),searchValue)
|
||||
||StringUtils.containsIgnoreCase(item.getVoltageScale(),searchValue))
|
||||
if (StringUtils.contains(item.getGdName(), searchValue)
|
||||
|| StringUtils.contains(item.getSubName(), searchValue)
|
||||
|| StringUtils.contains(item.getIp(), searchValue)
|
||||
|| StringUtils.contains(item.getLineName(), searchValue)
|
||||
|| StringUtils.containsIgnoreCase(item.getVoltageScale(), searchValue))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@@ -419,17 +418,18 @@ public class TransientServiceImpl implements TransientService {
|
||||
* 复制保存文件
|
||||
*/
|
||||
public void copyTempData(List<String> eventIds) {
|
||||
|
||||
|
||||
for (int i = 0; i < eventIds.size(); i++) {
|
||||
List<RmpEventDetailPO> rmpEventDetailPOList = eventDetailService.listByIds(eventIds);
|
||||
List<RmpEventDetailPO> nullWave = rmpEventDetailPOList.stream().filter(item->Objects.isNull(item.getWavePath())).collect(Collectors.toList());
|
||||
if(nullWave.size()!=0){
|
||||
throw new BusinessException("请选择存在波形的事件导出!");
|
||||
}
|
||||
if (CollUtil.isNotEmpty(rmpEventDetailPOList)) {
|
||||
for (int i = 0; i < rmpEventDetailPOList.size(); i++) {
|
||||
//根据监测点id获取监测点详情
|
||||
|
||||
RmpEventDetailPO rmpEventDetailPO = eventDetailService.getById(eventIds.get(i));
|
||||
if (Objects.nonNull(rmpEventDetailPO)) {
|
||||
LineDetailDataVO lineDetailData = lineFeignClient.getLineDetailData(rmpEventDetailPO.getMeasurementPointId()).getData();
|
||||
LineDetailDataVO lineDetailData = lineFeignClient.getLineDetailData(rmpEventDetailPOList.get(i).getMeasurementPointId()).getData();
|
||||
if (Objects.nonNull(lineDetailData)) {
|
||||
String ip = lineDetailData.getIp();
|
||||
String waveName = rmpEventDetailPO.getWavePath();
|
||||
String waveName = rmpEventDetailPOList.get(i).getWavePath();
|
||||
if (StrUtil.isBlank(ip) && StrUtil.isBlank(waveName)) {
|
||||
throw new BusinessException(EventResponseEnum.EVENT_NOT_FOUND);
|
||||
}
|
||||
@@ -460,13 +460,13 @@ public class TransientServiceImpl implements TransientService {
|
||||
}
|
||||
}
|
||||
|
||||
String fileMu = generalInfo.getBusinessTempPath()+File.separator+"comtrade"+File.separator+ip;
|
||||
String fileMu = generalInfo.getBusinessTempPath() + File.separator + "comtrade" + File.separator + ip;
|
||||
File mulu = new File(fileMu);
|
||||
if(!mulu.exists()){
|
||||
if (!mulu.exists()) {
|
||||
mulu.mkdirs();
|
||||
}
|
||||
File fileCfg = new File(fileMu+File.separator+waveName+GeneralConstant.CFG);
|
||||
File fileDat = new File(fileMu+File.separator+waveName+GeneralConstant.DAT);
|
||||
File fileCfg = new File(fileMu + File.separator + waveName + GeneralConstant.CFG);
|
||||
File fileDat = new File(fileMu + File.separator + waveName + GeneralConstant.DAT);
|
||||
|
||||
fileCfg.createNewFile();
|
||||
fileDat.createNewFile();
|
||||
@@ -476,7 +476,7 @@ public class TransientServiceImpl implements TransientService {
|
||||
|
||||
} catch (Exception e) {
|
||||
throw new BusinessException(EventResponseEnum.WAVE_DATA_INVALID);
|
||||
}finally {
|
||||
} finally {
|
||||
try {
|
||||
if (cfgStream != null) {
|
||||
cfgStream.close();
|
||||
@@ -488,7 +488,6 @@ public class TransientServiceImpl implements TransientService {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.njcn.user.pojo.vo;
|
||||
import com.njcn.web.pojo.vo.BaseVO;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -12,6 +13,7 @@ import java.util.List;
|
||||
* @date 2022年04月15日 11:28
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class DeptAllTreeVO extends BaseVO {
|
||||
|
||||
@ApiModelProperty("子节点详细信息")
|
||||
|
||||
@@ -60,29 +60,26 @@
|
||||
SELECT
|
||||
T3.*
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
@codes AS _ids,
|
||||
(
|
||||
SELECT @codes := GROUP_CONCAT( id ) FROM sys_dept WHERE FIND_IN_SET( pid, @codes ) ) AS T1
|
||||
FROM
|
||||
sys_dept s,
|
||||
( SELECT @codes := #{id} ) T4
|
||||
WHERE
|
||||
@codes IS NOT NULL
|
||||
<if test="type != null">
|
||||
AND s.type in
|
||||
<foreach collection="type" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
) T2,
|
||||
sys_dept T3,
|
||||
sys_area T5
|
||||
WHERE
|
||||
FIND_IN_SET( T3.id, T2._ids )
|
||||
FIND_IN_SET( #{id}, T3.pids )
|
||||
and t3.type in
|
||||
<foreach collection="type" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
AND t3.area = t5.id
|
||||
AND t3.State = 1
|
||||
UNION
|
||||
SELECT
|
||||
T3.*
|
||||
FROM
|
||||
sys_dept T3,
|
||||
sys_area T5
|
||||
WHERE
|
||||
t3.area = t5.id
|
||||
and T3.id = #{id}
|
||||
AND t3.State = 1
|
||||
</select>
|
||||
|
||||
<select id="deptArea" resultType="String">
|
||||
|
||||
@@ -38,6 +38,7 @@ import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
@@ -319,7 +320,7 @@ public class DeptServiceImpl extends ServiceImpl<DeptMapper, Dept> implements ID
|
||||
return allDept.stream().filter(dept -> dept.getPid().equals(deptFirst.getId()))
|
||||
.peek(deptVo -> {
|
||||
deptVo.setChildren(getChildrens(deptVo, allDept));
|
||||
}).collect(Collectors.toList());
|
||||
}).sorted(Comparator.comparing(DeptAllTreeVO::getSort)).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user