1.解决技术监督计划部门过滤bug
2.终端模板导入 3.台账关联干扰源管理,信息修改
This commit is contained in:
@@ -0,0 +1,56 @@
|
||||
package com.njcn.supervision.controller.file;
|
||||
|
||||
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.supervision.pojo.po.file.FileUrl;
|
||||
import com.njcn.supervision.service.file.IFileUrlService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import com.njcn.web.controller.BaseController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 文件信息录入表 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author wr
|
||||
* @since 2024-08-14
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/fileUrl")
|
||||
@Slf4j
|
||||
@Api(tags = "文件信息")
|
||||
@RequiredArgsConstructor
|
||||
public class FileUrlController extends BaseController {
|
||||
|
||||
private final IFileUrlService fileUrlService;
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@GetMapping("/getFileById")
|
||||
@ApiOperation("根据id查询文件信息集合")
|
||||
public HttpResult<List<FileUrl>> getFileUrlList(String id) {
|
||||
String methodDescribe = getMethodDescribe("getFileUrlList");
|
||||
List<FileUrl> fileUrlList = fileUrlService.getFileUrlList(id);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, fileUrlList, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@GetMapping("/addOrUpdateFile")
|
||||
@ApiOperation("批量添加和修改文件信息")
|
||||
public HttpResult<Boolean> addOrUpdateFile(List<FileUrl> list) {
|
||||
String methodDescribe = getMethodDescribe("addOrUpdateFile");
|
||||
Boolean b = fileUrlService.addOrUpdateFile(list);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, b, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.njcn.supervision.mapper.file;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.supervision.pojo.po.file.FileUrl;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 文件信息录入表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author wr
|
||||
* @since 2024-08-14
|
||||
*/
|
||||
public interface FileUrlMapper extends BaseMapper<FileUrl> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.njcn.supervision.mapper.file.FileUrlMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -52,7 +52,9 @@
|
||||
supervision_user_report.history_instance_id,
|
||||
supervision_user_report.create_time,
|
||||
supervision_user_report.create_by,
|
||||
supervision_user_report.status
|
||||
supervision_user_report.status,
|
||||
supervision_user_report.dev_id,
|
||||
supervision_user_report.line_id
|
||||
FROM supervision_user_report supervision_user_report
|
||||
WHERE ${ew.sqlSegment}
|
||||
</select>
|
||||
@@ -77,7 +79,9 @@
|
||||
r.history_instance_id,
|
||||
supervision_user_report.create_time,
|
||||
supervision_user_report.create_by,
|
||||
r.status
|
||||
r.status,
|
||||
supervision_user_report.dev_id,
|
||||
supervision_user_report.line_id
|
||||
FROM supervision_user_report supervision_user_report
|
||||
LEFT JOIN supervision_user_report_renewal r ON supervision_user_report.id=r.id
|
||||
WHERE ${ew.sqlSegment}
|
||||
|
||||
@@ -4,6 +4,7 @@ import cn.afterturn.easypoi.excel.ExcelImportUtil;
|
||||
import cn.afterturn.easypoi.excel.entity.ExportParams;
|
||||
import cn.afterturn.easypoi.excel.entity.ImportParams;
|
||||
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.text.StrPool;
|
||||
@@ -513,7 +514,10 @@ public class SupervisionDevMainReportPOServiceImpl extends ServiceImpl<Supervisi
|
||||
po = new SupervisionDevMainReportPO();
|
||||
po.setReporter(RequestUtil.getUserIndex());
|
||||
po.setReportDate(LocalDate.now());
|
||||
po.setOrgId(RequestUtil.getDeptIndex());
|
||||
//解决导入部门问题
|
||||
List<String> DeptIds = deptS.stream().filter(x -> x.getName().equals(dev.getCity())).map(DeptDTO::getId).collect(Collectors.toList());
|
||||
po.setOrgId(CollUtil.isNotEmpty(DeptIds)?DeptIds.get(0):RequestUtil.getDeptIndex());
|
||||
|
||||
po.setExpectedProductionDate(dev.getExpectedProductionDate());
|
||||
po.setCity(PubUtil.getDicById(dev.getCity(), jiBeiArea));
|
||||
po.setUserStatus("1");
|
||||
@@ -534,6 +538,7 @@ public class SupervisionDevMainReportPOServiceImpl extends ServiceImpl<Supervisi
|
||||
devDetails.setId(po.getId());
|
||||
if(deptMap.containsKey(dev.getPowerCompany())){
|
||||
devDetails.setPowerCompany(deptMap.get(dev.getPowerCompany()));
|
||||
devDetails.setPowerCompany(deptMap.get(dev.getPowerCompany()));
|
||||
}else{
|
||||
msg.append("所属供电公司不存在!");
|
||||
}
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.njcn.supervision.service.file;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.supervision.pojo.po.file.FileUrl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 文件信息录入表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author wr
|
||||
* @since 2024-08-14
|
||||
*/
|
||||
public interface IFileUrlService extends IService<FileUrl> {
|
||||
|
||||
/**
|
||||
* 根据id获取全部数据
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
List<FileUrl> getFileUrlList(String id);
|
||||
|
||||
/**
|
||||
* 批量添加和修改文件信息
|
||||
* @param list
|
||||
* @return
|
||||
*/
|
||||
Boolean addOrUpdateFile(List<FileUrl> list);
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.njcn.supervision.service.file.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.supervision.mapper.file.FileUrlMapper;
|
||||
import com.njcn.supervision.pojo.po.file.FileUrl;
|
||||
import com.njcn.supervision.service.file.IFileUrlService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 文件信息录入表 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author wr
|
||||
* @since 2024-08-14
|
||||
*/
|
||||
@Service
|
||||
public class FileUrlServiceImpl extends ServiceImpl<FileUrlMapper, FileUrl> implements IFileUrlService {
|
||||
|
||||
@Override
|
||||
public List<FileUrl> getFileUrlList(String id) {
|
||||
return this.list(new LambdaQueryWrapper<FileUrl>().eq(FileUrl::getId, id));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean addOrUpdateFile(List<FileUrl> list) {
|
||||
return this.saveOrUpdateBatch(list);
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.njcn.supervision.service.survey.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.date.DatePattern;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
@@ -18,6 +19,7 @@ import com.njcn.bpm.pojo.dto.BpmInstanceInfo;
|
||||
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.device.pms.pojo.po.PmsNewEnergy;
|
||||
import com.njcn.device.pq.api.LineFeignClient;
|
||||
import com.njcn.device.pq.pojo.dto.PollutionSubstationDTO;
|
||||
import com.njcn.supervision.enums.FlowStatusEnum;
|
||||
@@ -46,10 +48,7 @@ import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
@@ -87,6 +86,7 @@ public class SurveyTestServiceImpl extends ServiceImpl<SurveyTestMapper, SurveyT
|
||||
@Override
|
||||
public Page<SurveyTestVO> surveyTestPage(SurveyTestParam.SurveyTestQueryParam surveyTestQueryParam) {
|
||||
QueryWrapper<SurveyTestVO> surveyTestVOQueryWrapper = new QueryWrapper<>();
|
||||
List<String> deptIds = new ArrayList<>();;
|
||||
if (Objects.nonNull(surveyTestQueryParam)) {
|
||||
//添加上时间范围
|
||||
surveyTestVOQueryWrapper.between("supervision_survey_plan.plan_start_time",
|
||||
@@ -96,13 +96,13 @@ public class SurveyTestServiceImpl extends ServiceImpl<SurveyTestMapper, SurveyT
|
||||
if (Objects.nonNull(surveyTestQueryParam.getSearchValue())) {
|
||||
LambdaQueryWrapper<SurveyPlan> surveyPlanLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
surveyPlanLambdaQueryWrapper.eq(SurveyPlan::getState, DataStateEnum.ENABLE.getCode())
|
||||
.eq(StringUtils.isNotBlank(surveyTestQueryParam.getSupvType()),SurveyPlan::getSupvType,surveyTestQueryParam.getSupvType())
|
||||
.eq(StringUtils.isNotBlank(surveyTestQueryParam.getSupvType()), SurveyPlan::getSupvType, surveyTestQueryParam.getSupvType())
|
||||
.like(SurveyPlan::getPlanName, surveyTestQueryParam.getSearchValue());
|
||||
List<SurveyPlan> surveyPlans = surveyPlanService.getBaseMapper().selectList(surveyPlanLambdaQueryWrapper);
|
||||
if (CollectionUtil.isNotEmpty(surveyPlans)) {
|
||||
List<String> planIds = surveyPlans.stream().map(SurveyPlan::getId).collect(Collectors.toList());
|
||||
surveyTestVOQueryWrapper.in("supervision_survey_test.plan_id", planIds);
|
||||
}else {
|
||||
} else {
|
||||
//没有匹配的。直接返回
|
||||
return new Page<>();
|
||||
}
|
||||
@@ -110,9 +110,9 @@ public class SurveyTestServiceImpl extends ServiceImpl<SurveyTestMapper, SurveyT
|
||||
|
||||
//筛选普测负责单位
|
||||
if (StrUtil.isNotBlank(surveyTestQueryParam.getDeptIndex())) {
|
||||
List<String> deptIds = deptFeignClient.getDepSonIdtByDeptId(surveyTestQueryParam.getDeptIndex()).getData();
|
||||
surveyTestVOQueryWrapper.in("supervision_survey_test.dept_id", deptIds);
|
||||
deptIds = deptFeignClient.getDepSonIdtByDeptId(surveyTestQueryParam.getDeptIndex()).getData();
|
||||
}
|
||||
surveyTestVOQueryWrapper.in(CollUtil.isNotEmpty(deptIds), "supervision_survey_test.dept_id", deptIds);
|
||||
if (Objects.nonNull(surveyTestQueryParam.getStatus())) {
|
||||
surveyTestVOQueryWrapper.eq("supervision_survey_test.status", surveyTestQueryParam.getStatus());
|
||||
}
|
||||
@@ -122,8 +122,14 @@ public class SurveyTestServiceImpl extends ServiceImpl<SurveyTestMapper, SurveyT
|
||||
.eq("supervision_survey_test.state", DataStateEnum.ENABLE.getCode())
|
||||
.orderByDesc("supervision_survey_test.Update_Time");
|
||||
//未完成的技术监督计划,也要展示出来,不受时间限制
|
||||
surveyTestVOQueryWrapper.or().isNull("supervision_survey_test.complete_time")
|
||||
.le("supervision_survey_plan.plan_start_time",surveyTestQueryParam.getSearchBeginTime());
|
||||
List<String> finalDeptIds = deptIds;
|
||||
surveyTestVOQueryWrapper.or(
|
||||
wrapper ->
|
||||
wrapper.isNull("supervision_survey_test.complete_time")
|
||||
.le("supervision_survey_plan.plan_start_time", surveyTestQueryParam.getSearchBeginTime())
|
||||
.in(CollUtil.isNotEmpty(finalDeptIds), "supervision_survey_test.dept_id", finalDeptIds)
|
||||
);
|
||||
|
||||
Page<SurveyTestVO> surveyTestVOPage = this.baseMapper.surveyTestPage(new Page<>(PageFactory.getPageNum(surveyTestQueryParam), PageFactory.getPageSize(surveyTestQueryParam)), surveyTestVOQueryWrapper);
|
||||
List<SurveyTestVO> records = surveyTestVOPage.getRecords();
|
||||
if (CollectionUtil.isNotEmpty(records)) {
|
||||
@@ -134,7 +140,7 @@ public class SurveyTestServiceImpl extends ServiceImpl<SurveyTestMapper, SurveyT
|
||||
if (record.getCustomSubstationFlag() == 0) {
|
||||
//关联台账内的变电站名称
|
||||
String substation = record.getSubstation();
|
||||
if(StringUtils.isNotEmpty(substation)){
|
||||
if (StringUtils.isNotEmpty(substation)) {
|
||||
record.setSubstationName(lineFeignClient.getSubstationInfo(substation).getData().getName());
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -50,9 +50,11 @@ import com.njcn.system.pojo.po.DictData;
|
||||
import com.njcn.system.pojo.po.SysDicTreePO;
|
||||
import com.njcn.user.api.DeptFeignClient;
|
||||
import com.njcn.user.api.UserFeignClient;
|
||||
import com.njcn.user.pojo.dto.DeptDTO;
|
||||
import com.njcn.user.pojo.vo.UserVO;
|
||||
import com.njcn.web.factory.PageFactory;
|
||||
import com.njcn.web.utils.RequestUtil;
|
||||
import com.njcn.web.utils.WebUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
@@ -417,6 +419,11 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
|
||||
//台账不查询全部数据,需要排除敏感及重要用户
|
||||
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())) {
|
||||
//查询所有区域下的数据
|
||||
@@ -440,7 +447,6 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
|
||||
} else {
|
||||
page = this.baseMapper.pageUpdate(new Page<>(PageFactory.getPageNum(userReportQueryParam), PageFactory.getPageSize(userReportQueryParam)), userReportVOQueryWrapper);
|
||||
}
|
||||
|
||||
page.getRecords().forEach(temp -> {
|
||||
Integer needGovernance = 0;
|
||||
if (
|
||||
@@ -709,6 +715,10 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
|
||||
//供电电源情况
|
||||
List<DictData> supplyCondition = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.SUPPLY_CONDITION.getCode()).getData();
|
||||
|
||||
//解决填报部门问题
|
||||
List<DeptDTO> data = deptFeignClient.getDeptDescendantIndexes(RequestUtil.getUserIndex(), WebUtil.filterDeptType()).getData();
|
||||
|
||||
|
||||
//执行批量导入敏感及重要用户,入库过程中会进行数据校验
|
||||
List<SensitiveUserSExcel.SensitiveUserExcelMsg> sensitiveUserExcelMsgs = new ArrayList<>();
|
||||
if (CollectionUtil.isNotEmpty(sensitiveUserExcels)) {
|
||||
@@ -729,7 +739,10 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
|
||||
UserReportPO userReportPO = new UserReportPO();
|
||||
userReportPO.setReporter(RequestUtil.getUserIndex());
|
||||
userReportPO.setReportDate(LocalDate.now());
|
||||
userReportPO.setOrgId(RequestUtil.getDeptIndex());
|
||||
//解决导入部门问题
|
||||
List<String> DeptIds = data.stream().filter(x -> x.getName().equals(userExcel.getCity())).map(DeptDTO::getId).collect(Collectors.toList());
|
||||
userReportPO.setOrgId(CollUtil.isNotEmpty(DeptIds)?DeptIds.get(0):RequestUtil.getDeptIndex());
|
||||
|
||||
userReportPO.setExpectedProductionDate(userExcel.getExpectedProductionDate());
|
||||
userReportPO.setUserType(UserNatureEnum.SENSITIVE_USER.getCode());
|
||||
//所属地市
|
||||
@@ -901,6 +914,8 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
|
||||
Map<String, String> treeString = getTreeString("", treeVOS.get(0).getChildren());
|
||||
//评估类型
|
||||
List<DictData> evaluationType = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.EVALUATION_TYPE.getCode()).getData();
|
||||
//解决填报部门问题
|
||||
List<DeptDTO> data = deptFeignClient.getDeptDescendantIndexes(RequestUtil.getUserIndex(), WebUtil.filterDeptType()).getData();
|
||||
|
||||
//执行批量导入敏感及重要用户,入库过程中会进行数据校验
|
||||
List<SensitiveReportExcel.SensitiveReportExcelMsg> sensitiveUserExcelMsgs = new ArrayList<>();
|
||||
@@ -922,7 +937,11 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
|
||||
UserReportPO userReportPO = new UserReportPO();
|
||||
userReportPO.setReporter(RequestUtil.getUserIndex());
|
||||
userReportPO.setReportDate(LocalDate.now());
|
||||
userReportPO.setOrgId(RequestUtil.getDeptIndex());
|
||||
|
||||
//解决导入部门问题
|
||||
List<String> DeptIds = data.stream().filter(x -> x.getName().equals(reportExcel.getCity())).map(DeptDTO::getId).collect(Collectors.toList());
|
||||
userReportPO.setOrgId(CollUtil.isNotEmpty(DeptIds)?DeptIds.get(0):RequestUtil.getDeptIndex());
|
||||
|
||||
userReportPO.setExpectedProductionDate(reportExcel.getExpectedProductionDate());
|
||||
userReportPO.setUserType(reportExcel.getUserType());
|
||||
//所属地市
|
||||
|
||||
Reference in New Issue
Block a user