1.excel通用导出模板,解决时间格式不是文本问题
2.解决部分部门查询问题
This commit is contained in:
@@ -76,7 +76,6 @@ public class DeVReportManageController extends BaseController {
|
||||
public HttpResult<Boolean> auditDevReport(@RequestBody @Validated SupervisionDevMainReportParam.SupervisionDevMainReportParamUpdate supervisionDevMainReportParamUpdate){
|
||||
String methodDescribe = getMethodDescribe("auditDevReport");
|
||||
boolean res = supervisionDevMainReportPOService.auditDevReport(supervisionDevMainReportParamUpdate);
|
||||
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, res, methodDescribe);
|
||||
|
||||
}
|
||||
|
||||
@@ -7,8 +7,8 @@ import cn.afterturn.easypoi.excel.entity.result.ExcelImportResult;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.date.LocalDateTimeUtil;
|
||||
import cn.hutool.core.text.StrPool;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
@@ -22,6 +22,9 @@ import com.njcn.bpm.pojo.dto.BpmProcessInstanceCreateReqDTO;
|
||||
import com.njcn.bpm.pojo.param.instance.BpmProcessInstanceCancelParam;
|
||||
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.device.biz.commApi.CommTerminalGeneralClient;
|
||||
import com.njcn.device.biz.pojo.dto.SubGetBase;
|
||||
import com.njcn.device.biz.pojo.param.SubstationParam;
|
||||
import com.njcn.device.pms.utils.PubUtil;
|
||||
import com.njcn.device.pq.api.LineFeignClient;
|
||||
import com.njcn.device.pq.api.NodeClient;
|
||||
@@ -33,7 +36,6 @@ import com.njcn.supervision.enums.FlowStatusEnum;
|
||||
import com.njcn.supervision.enums.SupervisionKeyEnum;
|
||||
import com.njcn.supervision.enums.SupervisionResponseEnum;
|
||||
import com.njcn.supervision.mapper.device.SupervisionDevMainReportPOMapper;
|
||||
import com.njcn.supervision.pojo.dto.SensitiveUserSExcel;
|
||||
import com.njcn.supervision.pojo.dto.SupervisionDevMainReportExcel;
|
||||
import com.njcn.supervision.pojo.param.device.SupervisionDevMainReportParam;
|
||||
import com.njcn.supervision.pojo.param.device.SupervisionTempDeviceReportParam;
|
||||
@@ -85,6 +87,7 @@ public class SupervisionDevMainReportPOServiceImpl extends ServiceImpl<Supervisi
|
||||
private final LineFeignClient lineFeignClient;
|
||||
private final DicDataFeignClient dicDataFeignClient;
|
||||
private final NodeClient nodeClient;
|
||||
private final CommTerminalGeneralClient commterminalGeneralClient;
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@@ -111,7 +114,14 @@ public class SupervisionDevMainReportPOServiceImpl extends ServiceImpl<Supervisi
|
||||
supervisionDevMainReportPO.setStatus(BpmTaskStatusEnum.RUNNING.getStatus());
|
||||
|
||||
}
|
||||
|
||||
if (ObjectUtil.isNotNull(supervisionDevMainReportParam.getImportType())) {
|
||||
supervisionDevMainReportPO.setImportType(supervisionDevMainReportParam.getImportType());
|
||||
if (supervisionDevMainReportParam.getImportType() == 1) {
|
||||
supervisionDevMainReportParam.setStatus(FlowStatusEnum.APPROVE.getCode());
|
||||
}
|
||||
} else {
|
||||
supervisionDevMainReportParam.setImportType(0);
|
||||
}
|
||||
|
||||
supervisionDevMainReportPO.setState(DataStateEnum.ENABLE.getCode());
|
||||
this.saveOrUpdate(supervisionDevMainReportPO);
|
||||
@@ -300,8 +310,8 @@ public class SupervisionDevMainReportPOServiceImpl extends ServiceImpl<Supervisi
|
||||
ExportParams exportParams = new ExportParams("终端入网检测数据模板(带*字段均是必填,请严格按照模板标准填入数据)", "终端入网检测数据信息");
|
||||
//所属地市
|
||||
List<DictData> jiBeiArea = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.JIBEI_AREA.getCode()).getData();
|
||||
//所属供电公司 RequestUtil.getDeptIndex()
|
||||
List<DeptDTO> depts = deptFeignClient.getDepSonDetailByDeptId("0d52f9f6e43ec0ee83013cd32da93f66").getData();
|
||||
//所属供电公司
|
||||
List<DeptDTO> depts = deptFeignClient.getDepSonDetailByDeptId(RequestUtil.getDeptIndex()).getData();
|
||||
//终端型号
|
||||
List<DictData> devType = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.DEV_TYPE.getCode()).getData();
|
||||
//通讯类型
|
||||
@@ -317,11 +327,40 @@ public class SupervisionDevMainReportPOServiceImpl extends ServiceImpl<Supervisi
|
||||
List<DictData> voltageTransformer = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.VOLTAGE_TRANSFORMER.getCode()).getData();
|
||||
//中性点接线方式
|
||||
List<DictData> neutralPoint = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.Neutral_Point.getCode()).getData();
|
||||
|
||||
SubstationParam substationParam=new SubstationParam();
|
||||
substationParam.setOrgIds(depts.stream().map(DeptDTO::getId).distinct().collect(Collectors.toList()));
|
||||
List<SubGetBase> data = commterminalGeneralClient.tagOrIdGetSub(substationParam).getData();
|
||||
|
||||
List<PullDown> pullDowns = new ArrayList<>();
|
||||
|
||||
PullDown pullDown;
|
||||
pullDown = new PullDown();
|
||||
pullDown.setFirstCol(0);
|
||||
pullDown.setLastCol(0);
|
||||
pullDown.setIsText(true);
|
||||
pullDowns.add(pullDown);
|
||||
|
||||
pullDown = new PullDown();
|
||||
pullDown.setFirstCol(10);
|
||||
pullDown.setLastCol(10);
|
||||
pullDown.setIsText(true);
|
||||
pullDowns.add(pullDown);
|
||||
|
||||
|
||||
pullDown = new PullDown();
|
||||
pullDown.setFirstCol(11);
|
||||
pullDown.setLastCol(11);
|
||||
pullDown.setIsText(true);
|
||||
pullDowns.add(pullDown);
|
||||
|
||||
|
||||
pullDown = new PullDown();
|
||||
pullDown.setFirstCol(20);
|
||||
pullDown.setLastCol(20);
|
||||
pullDown.setIsText(true);
|
||||
pullDowns.add(pullDown);
|
||||
|
||||
|
||||
pullDown = new PullDown();
|
||||
pullDown.setFirstCol(1);
|
||||
pullDown.setLastCol(1);
|
||||
@@ -329,11 +368,11 @@ public class SupervisionDevMainReportPOServiceImpl extends ServiceImpl<Supervisi
|
||||
pullDowns.add(pullDown);
|
||||
|
||||
//缺少变电站名称
|
||||
// pullDown = new PullDown();
|
||||
// pullDown.setFirstCol(2);
|
||||
// pullDown.setLastCol(2);
|
||||
// pullDown.setStrings();
|
||||
// pullDowns.add(pullDown);
|
||||
pullDown = new PullDown();
|
||||
pullDown.setFirstCol(2);
|
||||
pullDown.setLastCol(2);
|
||||
pullDown.setStrings(data.stream().map(SubGetBase::getName).distinct().collect(Collectors.toList()));
|
||||
pullDowns.add(pullDown);
|
||||
|
||||
pullDown = new PullDown();
|
||||
pullDown.setFirstCol(3);
|
||||
@@ -484,10 +523,23 @@ public class SupervisionDevMainReportPOServiceImpl extends ServiceImpl<Supervisi
|
||||
//中性点接线方式
|
||||
List<DictData> neutralPoint = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.Neutral_Point.getCode()).getData();
|
||||
|
||||
SubstationParam substationParam=new SubstationParam();
|
||||
substationParam.setOrgIds(deptS.stream().map(DeptDTO::getId).distinct().collect(Collectors.toList()));
|
||||
List<SubGetBase> data = commterminalGeneralClient.tagOrIdGetSub(substationParam).getData();
|
||||
|
||||
SupervisionDevMainReportPO po;
|
||||
if (CollectionUtil.isNotEmpty(devExcels)) {
|
||||
for (SupervisionDevMainReportExcel dev : devExcels) {
|
||||
//todo 需要根据变电站id进行匹配
|
||||
List<SubGetBase> subList = data.stream().filter(x -> x.getName().equals(dev.getSubstation())).collect(Collectors.toList());
|
||||
if(CollUtil.isEmpty(subList)){
|
||||
//该用户已经录入
|
||||
SupervisionDevMainReportExcel.ExcelMsg sensitiveUserExcelMsg = new SupervisionDevMainReportExcel.ExcelMsg();
|
||||
BeanUtils.copyProperties(dev, sensitiveUserExcelMsg);
|
||||
sensitiveUserExcelMsg.setMsg(dev.getTerminalIp().concat("变电站不存在,请检查变电站信息是否是下拉框信息!"));
|
||||
devMsgList.add(sensitiveUserExcelMsg);
|
||||
continue;
|
||||
}
|
||||
LambdaQueryWrapper<SupervisionTempDeviceReport> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper
|
||||
.eq(SupervisionTempDeviceReport::getSubstationName, dev.getSubstation())
|
||||
@@ -542,12 +594,12 @@ public class SupervisionDevMainReportPOServiceImpl extends ServiceImpl<Supervisi
|
||||
msg.append("所属供电公司不存在!");
|
||||
}
|
||||
//todo 需要根据变电站id进行匹配
|
||||
// devDetails.setCustomSubstationFlag();
|
||||
// devDetails.setSubstation();
|
||||
devDetails.setCustomSubstationFlag(0);
|
||||
devDetails.setSubstation(subList.get(0).getId());
|
||||
devDetails.setSubstationName(dev.getSubstation());
|
||||
// devDetails.setSubstationVoltageLevel();
|
||||
// devDetails.setLongitude();
|
||||
// devDetails.setLatitude();
|
||||
devDetails.setSubstationVoltageLevel(subList.get(0).getVoltageLevel());
|
||||
devDetails.setLongitude(subList.get(0).getLat());
|
||||
devDetails.setLatitude(subList.get(0).getLng());
|
||||
|
||||
devDetails.setMonitoringTerminalCode(dev.getMonitoringTerminalName());
|
||||
devDetails.setMonitoringTerminalName(dev.getMonitoringTerminalName());
|
||||
|
||||
@@ -412,18 +412,19 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
|
||||
public Page<UserReportVO> getInterferenceUserPage(UserReportParam.UserReportQueryParam userReportQueryParam, Boolean allDataFlag) {
|
||||
QueryWrapper<UserReportVO> userReportVOQueryWrapper = new QueryWrapper<>();
|
||||
List<String> colleaguesIds = userFeignClient.getColleaguesIdByUserId(RequestUtil.getUserIndex()).getData();
|
||||
userReportVOQueryWrapper.in("supervision_user_report.create_by", colleaguesIds)
|
||||
List<String> data = deptFeignClient.getDepSonIdtByDeptId(userReportQueryParam.getOrgId()).getData();
|
||||
//此处仅查询敏感及重要用户
|
||||
userReportVOQueryWrapper.and(wrapper ->
|
||||
wrapper.in("supervision_user_report.create_by", colleaguesIds)
|
||||
.or()
|
||||
.in("supervision_user_report.org_id", data)
|
||||
)
|
||||
.eq("supervision_user_report.state", DataStateEnum.ENABLE.getCode())
|
||||
.eq("supervision_user_report.status", FlowStatusEnum.APPROVE.getCode());
|
||||
if (!allDataFlag) {
|
||||
//台账不查询全部数据,需要排除敏感及重要用户
|
||||
userReportVOQueryWrapper.ne("supervision_user_report.user_type", UserNatureEnum.SENSITIVE_USER.getCode());
|
||||
}
|
||||
if (StrUtil.isNotBlank(userReportQueryParam.getOrgId())) {
|
||||
/*获取直接下属子单位*/
|
||||
List<String> data = deptFeignClient.getDepSonIdtByDeptId(userReportQueryParam.getOrgId()).getData();
|
||||
userReportVOQueryWrapper.in("supervision_user_report.org_id", data);
|
||||
}
|
||||
if (Objects.nonNull(userReportQueryParam)) {
|
||||
if (StrUtil.isNotBlank(userReportQueryParam.getCity())) {
|
||||
//查询所有区域下的数据
|
||||
@@ -544,8 +545,13 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
|
||||
public Page<UserReportVO> getSensitiveUserPage(UserReportParam.UserReportQueryParam userReportQueryParam) {
|
||||
QueryWrapper<UserReportVO> userReportVOQueryWrapper = new QueryWrapper<>();
|
||||
List<String> colleaguesIds = userFeignClient.getColleaguesIdByUserId(RequestUtil.getUserIndex()).getData();
|
||||
List<String> data = deptFeignClient.getDepSonIdtByDeptId(userReportQueryParam.getOrgId()).getData();
|
||||
//此处仅查询敏感及重要用户
|
||||
userReportVOQueryWrapper.in("supervision_user_report.create_by", colleaguesIds)
|
||||
userReportVOQueryWrapper.and(wrapper ->
|
||||
wrapper.in("supervision_user_report.create_by", colleaguesIds)
|
||||
.or()
|
||||
.in("supervision_user_report.org_id", data)
|
||||
)
|
||||
.eq("supervision_user_report.state", DataStateEnum.ENABLE.getCode())
|
||||
.eq("supervision_user_report.user_type", UserNatureEnum.SENSITIVE_USER.getCode())
|
||||
.eq("supervision_user_report.status", FlowStatusEnum.APPROVE.getCode());
|
||||
@@ -610,6 +616,12 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
|
||||
pullDown.setStrings(Stream.of("可研", "建设", "运行", "退运").collect(Collectors.toList()));
|
||||
pullDowns.add(pullDown);
|
||||
|
||||
pullDown = new PullDown();
|
||||
pullDown.setFirstCol(7);
|
||||
pullDown.setLastCol(7);
|
||||
pullDown.setIsText(true);
|
||||
pullDowns.add(pullDown);
|
||||
|
||||
pullDown = new PullDown();
|
||||
pullDown.setFirstCol(5);
|
||||
pullDown.setLastCol(5);
|
||||
@@ -840,6 +852,12 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
|
||||
pullDown.setStrings(jiBeiArea.stream().filter(x -> !"风光储".equals(x.getName()) && !"超高压".equals(x.getName())).map(DictData::getName).collect(Collectors.toList()));
|
||||
pullDowns.add(pullDown);
|
||||
|
||||
pullDown = new PullDown();
|
||||
pullDown.setFirstCol(6);
|
||||
pullDown.setLastCol(6);
|
||||
pullDown.setIsText(true);
|
||||
pullDowns.add(pullDown);
|
||||
|
||||
pullDown = new PullDown();
|
||||
pullDown.setFirstCol(4);
|
||||
pullDown.setLastCol(4);
|
||||
|
||||
Reference in New Issue
Block a user