终端台账数据同步

This commit is contained in:
hzj
2024-05-30 15:37:07 +08:00
parent df178c4882
commit 1060b94e7a
27 changed files with 556 additions and 64 deletions

View File

@@ -96,5 +96,13 @@ public class TempLineDebugController extends BaseController {
// String id = supervisionTempLineReportService.cancelTempLineReport(cancelReqVO);
// return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, id, methodDescribe);
// }
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/ledgerSync")
@ApiOperation("台账同步")
public HttpResult<String> ledgerSync(@RequestParam("id") String id) {
String methodDescribe = getMethodDescribe("ledgerSync");
String out = supervisionTempLineDebugPOService.ledgerSync(id);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, out, methodDescribe);
}
}

View File

@@ -64,7 +64,7 @@
supervision_temp_line_debug
inner JOIN supervision_temp_line_report ON supervision_temp_line_report.id = supervision_temp_line_debug.id
left join supervision_temp_line_run_test on supervision_temp_line_debug.id = supervision_temp_line_run_test.id
where supervision_temp_line_debug.`status`=2
where supervision_temp_line_debug.`status`=5
and ${ew.sqlSegment}
</select>
</mapper>

View File

@@ -25,4 +25,6 @@ public interface SupervisionTempLineDebugPOService extends IService<SupervisionT
SupervisionTempLineDebugVO getDetailTempLineDebug(String id);
void updateStatus(String businessKey, Integer status);
String ledgerSync(String id);
}

View File

@@ -69,8 +69,8 @@ public class SupervisionDevMainReportPOServiceImpl extends ServiceImpl<Supervisi
@Transactional(rollbackFor = Exception.class)
public String addDevReport(SupervisionDevMainReportParam supervisionDevMainReportParam) {
//判断干扰源用户是否绑定 todo 修改校验终端名称
// checkUserId(supervisionDevMainReportParam, false);
//设备校验ip
checkIp(supervisionDevMainReportParam, false);
SupervisionDevMainReportPO supervisionDevMainReportPO = new SupervisionDevMainReportPO();
BeanUtils.copyProperties(supervisionDevMainReportParam, supervisionDevMainReportPO);
supervisionDevMainReportPO.setState(DataStateEnum.ENABLE.getCode());
@@ -192,40 +192,43 @@ public class SupervisionDevMainReportPOServiceImpl extends ServiceImpl<Supervisi
SupervisionTempDeviceReport supervisionTempDeviceReport = supervisionTempDeviceReportService.lambdaQuery().eq(SupervisionTempDeviceReport::getId, id).one();
supervisionTempDeviceReport.setSubstation(lineFeignClient.getSubstationInfo(supervisionTempDeviceReport.getSubstation()).getData().getName());
supervisionTempDeviceReport.setPowerCompany(deptFeignClient.getDeptById(byId.getOrgId()).getData().getName());
supervisionTempDeviceReport.setPowerCompany(deptFeignClient.getDeptById(supervisionTempDeviceReport.getPowerCompany()).getData().getName());
supervisionDevMainReportVO.setSupervisionTempDeviceReport(supervisionTempDeviceReport);
return supervisionDevMainReportVO;
}
/**
* @Description: 判断干扰源用户是否绑定设备,如果重复提示干扰源用户已经设备
* @Description: 判断设备ip是否重复,如果重复提示
* @Param: supervisionDevMainReportParam终端详情 isExcludeSelf是否排除自己一般新增不排除更新时需要排除自己
* @return: void
* @Author: clam
* @Date: 2024/5/11
*/
private void checkUserId(SupervisionDevMainReportParam supervisionDevMainReportParam, boolean isExcludeSelf) {
LambdaQueryWrapper<SupervisionDevMainReportPO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
private void checkIp(SupervisionDevMainReportParam supervisionDevMainReportParam, boolean isExcludeSelf) {
LambdaQueryWrapper<SupervisionTempDeviceReport> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper
.eq(SupervisionDevMainReportPO::getUserId, supervisionDevMainReportParam.getUserId())
.eq(SupervisionDevMainReportPO::getState, DataStateEnum.ENABLE.getCode());
.eq(SupervisionTempDeviceReport::getSubstation,supervisionDevMainReportParam.getSupervisionTempDeviceReportParam().getSubstation())
.eq(SupervisionTempDeviceReport::getTerminalIp, supervisionDevMainReportParam.getSupervisionTempDeviceReportParam().getTerminalIp());
//更新的时候,需排除当前记录
if (isExcludeSelf) {
if(supervisionDevMainReportParam instanceof SupervisionDevMainReportParam.SupervisionDevMainReportParamUpdate){
lambdaQueryWrapper.ne(SupervisionDevMainReportPO::getId, ((SupervisionDevMainReportParam.SupervisionDevMainReportParamUpdate) supervisionDevMainReportParam).getId());
lambdaQueryWrapper.ne(SupervisionTempDeviceReport::getId, ((SupervisionDevMainReportParam.SupervisionDevMainReportParamUpdate) supervisionDevMainReportParam).getId());
}
}
List<SupervisionDevMainReportPO> list = this.baseMapper.selectList(lambdaQueryWrapper);
List<SupervisionTempDeviceReport> list = supervisionTempDeviceReportService.getBaseMapper().selectList(lambdaQueryWrapper);
if (CollectionUtil.isNotEmpty(list)) {
//过滤已取消的申请
list = list.stream()
//过滤已取消的申请和删除的
List<String> collect = list.stream().map(SupervisionTempDeviceReport::getId).collect(Collectors.toList());
List<SupervisionDevMainReportPO> list1 = this.lambdaQuery().in(SupervisionDevMainReportPO::getId, collect).list();
list1 = list1.stream()
.filter(userReportPO -> !userReportPO.getStatus().equals(FlowStatusEnum.CANCEL.getCode()))
.filter(userReportPO -> userReportPO.getState().equals(DataStateEnum.ENABLE.getCode()))
.collect(Collectors.toList());
//如果还存在,则说明有人申请过了
if (CollectionUtil.isNotEmpty(list)) {
throw new BusinessException(supervisionDevMainReportParam.getUserName().concat(",扰源用户").concat(list.get(0).getReporter()).concat("绑定"));
if (CollectionUtil.isNotEmpty(list1)) {
throw new BusinessException(supervisionDevMainReportParam.getSupervisionTempDeviceReportParam().getTerminalIp().concat("Ip已占用"));
}
}
}

View File

@@ -1,7 +1,8 @@
package com.njcn.supervision.service.device.impl;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.date.DatePattern;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.date.LocalDateTimeUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -11,14 +12,29 @@ import com.njcn.bpm.enums.BpmTaskStatusEnum;
import com.njcn.bpm.pojo.dto.BpmProcessInstanceCreateReqDTO;
import com.njcn.common.pojo.enums.common.DataStateEnum;
import com.njcn.common.pojo.exception.BusinessException;
import com.njcn.device.pq.api.LineFeignClient;
import com.njcn.device.pq.api.TerminalBaseClient;
import com.njcn.device.pq.pojo.param.DeviceParam;
import com.njcn.device.pq.pojo.param.LineParam;
import com.njcn.device.pq.pojo.param.SubVoltageParam;
import com.njcn.device.pq.pojo.param.SyncTerminalParam;
import com.njcn.device.pq.pojo.po.Line;
import com.njcn.supervision.mapper.device.SupervisionTempLineDebugPOMapper;
import com.njcn.supervision.pojo.param.device.SupervisionTempLineDebugParam;
import com.njcn.supervision.pojo.po.device.SupervisionTempDeviceReport;
import com.njcn.supervision.pojo.po.device.SupervisionTempLineDebugPO;
import com.njcn.supervision.pojo.po.device.SupervisionTempLineReport;
import com.njcn.supervision.pojo.vo.device.SupervisionDevMainReportVO;
import com.njcn.supervision.pojo.vo.device.SupervisionTempLineDebugVO;
import com.njcn.supervision.service.device.SupervisionDevMainReportPOService;
import com.njcn.supervision.service.device.SupervisionTempDeviceReportService;
import com.njcn.supervision.service.device.SupervisionTempLineDebugPOService;
import com.njcn.supervision.service.device.SupervisionTempLineReportService;
import com.njcn.system.api.DicDataFeignClient;
import com.njcn.system.api.DictTreeFeignClient;
import com.njcn.system.enums.DicDataTypeEnum;
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.web.factory.PageFactory;
@@ -28,10 +44,9 @@ import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.Stream;
/**
*
@@ -50,8 +65,17 @@ public class SupervisionTempLineDebugPOServiceImpl extends ServiceImpl<Supervisi
private final SupervisionTempLineReportService supervisionTempLineReportService;
private final UserFeignClient userFeignClient;
private final SupervisionDevMainReportPOService supervisionDevMainReportPOService;
private final SupervisionTempDeviceReportService supervisionTempDeviceReportService;
private final LineFeignClient lineFeignClient;
private final DictTreeFeignClient dictTreeFeignClient;
private final DicDataFeignClient dicDataFeignClient;
private final UserFeignClient userFeignClient;
private final TerminalBaseClient terminalBaseClient;
@Override
@Transactional(rollbackFor = Exception.class)
public String addTempLineDebug(SupervisionTempLineDebugParam supervisionTempLineReportParam) {
@@ -161,4 +185,151 @@ public class SupervisionTempLineDebugPOServiceImpl extends ServiceImpl<Supervisi
this.lambdaUpdate().set(SupervisionTempLineDebugPO::getStatus,status).eq(SupervisionTempLineDebugPO::getId,businessKey).update();
}
/**
* @Description: 临时表台账数据同步到实际表中
* @Param:
* @return: java.lang.String
* @Author: clam
* @Date: 2024/5/29
*/
@Override
public String ledgerSync(String id) {
SupervisionTempLineDebugPO byId = this.getById(id);
if(byId.getStatus()!=2){
throw new BusinessException("未审核通过无法同步台账");
}
//获取临时监测点详情
SupervisionTempLineReport tempLine = supervisionTempLineReportService.getById(id);
//获取关联的设备信息
SupervisionTempDeviceReport tempDevice = supervisionTempDeviceReportService.getById(tempLine.getMonitoringTerminalCode());
List<Line> data = lineFeignClient.getBaseLineList(Stream.of(tempDevice.getSubstation()).collect(Collectors.toList())).getData();
String pids = data.get(0).getPids();
String[] idsArray = pids.split(",");
SyncTerminalParam syncTerminalParam = new SyncTerminalParam();
syncTerminalParam.setProjectIndex(idsArray[0]);
syncTerminalParam.setProvinceIndex(idsArray[1]);
syncTerminalParam.setGdIndex(idsArray[2]);
syncTerminalParam.setSubIndex(tempDevice.getSubstation());
//用于绑定监测点部门
syncTerminalParam.setDeptId(tempDevice.getPowerCompany());
//电站可能后期要录 todo
//syncTerminalParam.setSubStationParam();
DeviceParam deviceParam = new DeviceParam();
SubVoltageParam subVoltageParam = new SubVoltageParam();
LineParam lineParam = new LineParam();
assembleSyncTerminalParam(deviceParam,tempDevice,subVoltageParam,lineParam,tempLine);
syncTerminalParam.setDeviceParam(deviceParam);
syncTerminalParam.setSubVoltageParam(subVoltageParam);
syncTerminalParam.setLineParam(lineParam);
terminalBaseClient.terminalSync(syncTerminalParam);
this.updateStatus(id,5);
return null;
}
private void assembleSyncTerminalParam(DeviceParam deviceParam, SupervisionTempDeviceReport tempDevice,SubVoltageParam subVoltageParam,LineParam lineParam ,SupervisionTempLineReport tempLine) {
//包装device
deviceParam.setDevIndex(tempDevice.getId());
deviceParam.setName(tempDevice.getMonitoringTerminalName());
deviceParam.setDevType(tempDevice.getTerminalType());
deviceParam.setFrontType(tempDevice.getFrontType());
deviceParam.setIp(tempDevice.getTerminalIp());
deviceParam.setPort(Integer.valueOf(tempDevice.getTerminalPort()));
deviceParam.setNodeId(tempDevice.getFrontEndMachine());
deviceParam.setSeries(tempDevice.getIdentificationCode());
deviceParam.setDevKey(tempDevice.getTerminalSecretKey());
deviceParam.setDevModel(Integer.valueOf(tempDevice.getTerminalModel()));
deviceParam.setDevDataType(Integer.valueOf(tempDevice.getDataType()));
deviceParam.setCallFlag(Integer.valueOf(tempDevice.getCommunicationStatus()));
deviceParam.setManufacturer(tempDevice.getManufacturer());
deviceParam.setElectroplate(tempDevice.getElectroplatingFunction());
deviceParam.setLoginTime(LocalDateTimeUtil.format(tempDevice.getCommissioningTime(), DatePattern.NORM_DATE_FORMATTER));
deviceParam.setThisTimeCheck(LocalDateTimeUtil.format(tempDevice.getCurrentTerminalDetectionTime(), DatePattern.NORM_DATE_FORMATTER));
deviceParam.setNextTimeCheck(LocalDateTimeUtil.format(tempDevice.getNextTerminalInspectionTime(), DatePattern.NORM_DATE_FORMATTER));
deviceParam.setContract(tempDevice.getContractNumber());
deviceParam.setSim(tempDevice.getSimCardNumber());
deviceParam.setDevSeries(null);
deviceParam.setDevLocation(tempDevice.getMonitoringDeviceInstallationPosition());
deviceParam.setDevNo(tempDevice.getManufacturerDeviceNumber());
deviceParam.setIsAlarm(Integer.valueOf(tempDevice.getAlarmFunction()));
deviceParam.setSort(0);
//subVoltageParam
subVoltageParam.setName(tempLine.getConnectedBus());
//母线线路号无要求,目前随机生成
subVoltageParam.setNum(new Random().nextInt(6) + 1);
//使用监测点的电压等级,监测点和母线是同一个电压等级
subVoltageParam.setScale(tempLine.getVoltageLevel());
subVoltageParam.setModel(1);
subVoltageParam.setSort(0);
//包装lineParam
lineParam.setLineIndex(tempLine.getId());
lineParam.setName(tempLine.getLineName());
lineParam.setPt1(tempLine.getPtRatio()*100);
lineParam.setPt2(100.00f);
lineParam.setCt1(tempLine.getCtRatio());
lineParam.setCt2(1.00f);
lineParam.setDevCapacity(tempLine.getDevCapacity());
lineParam.setShortCapacity(tempLine.getShortCapacity());
lineParam.setDealCapacity(tempLine.getDealCapacity());
lineParam.setStandardCapacity(tempLine.getStandardCapacity());
lineParam.setTimeInterval(tempLine.getTimeInterval());
//这两个字段统一用BusinessType()来反射取
lineParam.setLoadType(reflectionLoadType(tempLine.getBusinessType()));
lineParam.setBusinessType(reflectionBusinessType(tempLine.getBusinessType()));
// lineParam.setRemark();
// lineParam.setMonitorId();
lineParam.setPowerFlag(Integer.valueOf(tempLine.getPointNature()));
lineParam.setObjName(tempLine.getObjName());
//目前接线方式在device里现在使用device代替监测点
lineParam.setPtType(tempLine.getPtType());
lineParam.setNum(tempLine.getNum());
lineParam.setSort(0);
lineParam.setVoltageDev(tempLine.getVoltageDeviationUpperLimit());
lineParam.setUvoltageDev(tempLine.getVoltageDeviationLowerLimit());
lineParam.setPowerSubstationName(tempLine.getPowerSubstationName());
// lineParam.setCalssificationGrade();
// lineParam.setSuperiorsSubstation();
lineParam.setStatFlag(Integer.valueOf(tempLine.getIsStatistical()));
// lineParam.setHangLine();
// lineParam.setOwner();
// lineParam.setOwnerDuty();
// lineParam.setOwnerTel();
lineParam.setWiringDiagram(tempLine.getMainWiringDiagram());
}
private String reflectionBusinessType(String businessType) {
try {
SysDicTreePO data = dictTreeFeignClient.queryById(businessType).getData();
List<DictData> data1 = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.BUSINESS_TYPE.getCode()).getData();
List<DictData> collect = data1.stream().filter(temp -> temp.getName().equals(data.getRemark())).collect(Collectors.toList());
return collect.get(0).getId();
} catch (Exception e) {
throw new BusinessException("字典转换异常");
}
}
private String reflectionLoadType(String businessType) {
try {
SysDicTreePO data = dictTreeFeignClient.queryById(businessType).getData();
List<DictData> data1 = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.INTERFERENCE_SOURCE_TYPE.getCode()).getData();
List<DictData> collect = data1.stream().filter(temp -> temp.getName().equals(data.getName())).collect(Collectors.toList());
return collect.get(0).getId();
} catch (Exception e) {
throw new BusinessException("字典转换异常");
}
}
}

View File

@@ -154,7 +154,10 @@ public class SupervisionTempLineReportServiceImpl extends ServiceImpl<Supervisio
private void checkLineId(SupervisionTempLineReportParam supervisionTempLineReportParam, boolean isExcludeSelf) {
LambdaQueryWrapper<SupervisionTempLineReport> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper
.eq(SupervisionTempLineReport::getLineId, supervisionTempLineReportParam.getLineId())
.eq(SupervisionTempLineReport::getMonitoringTerminalCode,supervisionTempLineReportParam.getMonitoringTerminalCode())
.and(wrapper->wrapper.eq(SupervisionTempLineReport::getNum ,supervisionTempLineReportParam.getNum()).or()
.eq(SupervisionTempLineReport::getLineName ,supervisionTempLineReportParam.getLineName())
)
.eq(SupervisionTempLineReport::getState, DataStateEnum.ENABLE.getCode());
//更新的时候,需排除当前记录
if (isExcludeSelf) {
@@ -172,7 +175,7 @@ public class SupervisionTempLineReportServiceImpl extends ServiceImpl<Supervisio
.collect(Collectors.toList());
//如果还存在,则说明有人申请过了
if (CollectionUtil.isNotEmpty(list)) {
throw new BusinessException(supervisionTempLineReportParam.getUserName().concat(",监测点编号").concat(list.get(0).getReporter()).concat("以使用"));
throw new BusinessException(supervisionTempLineReportParam.getUserName().concat(",监测点线路号或监测点名称").concat(list.get(0).getReporter()).concat("以使用"));
}
}
}

View File

@@ -1,10 +1,8 @@
package com.njcn.supervision.service.device.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.date.DatePattern;
import cn.hutool.core.date.DateUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.njcn.bpm.api.BpmProcessFeignClient;
@@ -14,7 +12,6 @@ import com.njcn.common.pojo.enums.common.DataStateEnum;
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
import com.njcn.common.pojo.exception.BusinessException;
import com.njcn.device.biz.commApi.CommLineClient;
import com.njcn.device.biz.enums.RunFlagEnum;
import com.njcn.device.biz.pojo.dto.LineDTO;
import com.njcn.device.pq.api.LineIntegrityClient;
import com.njcn.device.pq.pojo.dto.LineDataQualityDTO;
@@ -22,7 +19,6 @@ import com.njcn.device.pq.pojo.param.LineDataQualityParam;
import com.njcn.supervision.mapper.device.SupervisionTempLineReportMapper;
import com.njcn.supervision.mapper.device.SupervisionTempLineRunTestMapper;
import com.njcn.supervision.pojo.param.device.SupervisionTempLineRunTestParam;
import com.njcn.supervision.pojo.po.device.QuitRunningDevice;
import com.njcn.supervision.pojo.po.device.SupervisionTempLineReport;
import com.njcn.supervision.pojo.po.device.SupervisionTempLineRunTestPO;
import com.njcn.supervision.pojo.vo.device.SupervisionTempLineRunTestVO;
@@ -68,7 +64,7 @@ public class SupervisionTempLineRunTestServiceImpl extends ServiceImpl<Supervisi
List<String> ids = supervisionTempLineRunTestParam.getLineIds();
List<SupervisionTempLineReport> supervisionTempLineReportList = supervisionTempLineReportMapper.selectBatchIds(ids);
List<String> lineIds = supervisionTempLineReportList.stream().map(SupervisionTempLineReport::getLineId).collect(Collectors.toList());
List<String> lineIds = supervisionTempLineReportList.stream().map(SupervisionTempLineReport::getId).collect(Collectors.toList());
List<LineDTO> lineDTOList = commLineClient.getLineDetailBatch(lineIds).getData();
if(lineIds.size()!=lineDTOList.size()){

View File

@@ -2,14 +2,12 @@ package com.njcn.supervision.service.plan.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.date.DatePattern;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.date.LocalDateTimeUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@@ -219,10 +217,10 @@ public class SupervisionPlanPOServiceImpl extends ServiceImpl<SupervisionPlanPOM
SupervisionPlanPO byId = this.getById(id);
List<SupervisionProblemPO> list = supervisionProblemPOService.lambdaQuery().eq(SupervisionProblemPO::getPlanId, id).list();
if (CollectionUtil.isEmpty(list)){
throw new BusinessException("请填写完实问题提交审核");
}
// List<SupervisionProblemPO> list = supervisionProblemPOService.lambdaQuery().eq(SupervisionProblemPO::getPlanId, id).list();
// if (CollectionUtil.isEmpty(list)){
// throw new BusinessException("请填写完实问题提交审核");
// }
// 发起 BPM 流程
Map<String, Object> processInstanceVariables = new HashMap<>();
BpmProcessInstanceCreateReqDTO bpmProcessInstanceCreateReqDTO = new BpmProcessInstanceCreateReqDTO();
@@ -310,6 +308,9 @@ public class SupervisionPlanPOServiceImpl extends ServiceImpl<SupervisionPlanPOM
List<SupervisionProblemPO> list = supervisionProblemPOService.lambdaQuery().eq(SupervisionProblemPO::getPlanId, id).list();
SupervisionPlanPO byId = this.getById(id);
if(byId.getStatus()!=2){
throw new BusinessException("该计划未审核通过无法发送预告警单");
}
/*
* 1、预告警单名称此处暂时用计算监督计划名称
* 2、预告警编号暂时随机by yxb

View File

@@ -34,6 +34,7 @@ import com.njcn.user.pojo.vo.UserVO;
import com.njcn.web.factory.PageFactory;
import com.njcn.web.utils.RequestUtil;
import lombok.RequiredArgsConstructor;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.BeanWrapper;
import org.springframework.beans.BeanWrapperImpl;
@@ -175,6 +176,8 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
//查询所有区域下的数据
userReportVOQueryWrapper.in("supervision_user_report.city", userReportQueryParam.getCity());
}
userReportVOQueryWrapper.like(StringUtils.isNotBlank(userReportQueryParam.getProjectName()),"supervision_user_report.project_name", userReportQueryParam.getProjectName());
//添加上时间范围
// userReportVOQueryWrapper.between("supervision_user_report.Create_Time",
// DateUtil.beginOfDay(DateUtil.parse(userReportQueryParam.getSearchBeginTime())),
@@ -283,6 +286,8 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
if(Objects.nonNull(userReportQueryParam.getDataType())){
userReportVOQueryWrapper.eq("data_type",userReportQueryParam.getDataType());
}
userReportVOQueryWrapper.like(StringUtils.isNotBlank(userReportQueryParam.getProjectName()),"supervision_user_report.project_name", userReportQueryParam.getProjectName());
}
userReportVOQueryWrapper.orderByDesc("supervision_user_report.create_time");
return this.baseMapper.page(new Page<>(PageFactory.getPageNum(userReportQueryParam), PageFactory.getPageSize(userReportQueryParam)), userReportVOQueryWrapper);