Browse Source

Merge remote-tracking branch 'origin/prod-5.1.3' into prod-5.1.3

zhongwei
haungxing 3 months ago
parent
commit
5f85e7b417
  1. 72
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/home/impl/RealTargetServiceImpl.java
  2. 7
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/ecology/service/impl/EcologyFlowStationServiceImpl.java
  3. 1
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/HydropowerServiceImpl.java
  4. 8
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/PhotovoltaicServiceImpl.java
  5. 9
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/service/impl/RunMonthServiceImpl.java
  6. BIN
      hzims-service/operational/src/main/resources/template/word/stationMonthReport.docx
  7. 22
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/RehearsalPlanServiceImpl.java

72
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/home/impl/RealTargetServiceImpl.java

@ -41,6 +41,8 @@ import com.hnac.hzinfo.sdk.analyse.po.MultiAnalyzeCodePO;
import com.hnac.hzinfo.sdk.core.response.HzPage; import com.hnac.hzinfo.sdk.core.response.HzPage;
import com.hnac.hzinfo.sdk.core.response.Result; import com.hnac.hzinfo.sdk.core.response.Result;
import com.hnac.hzinfo.sdk.v5.device.DeviceDataClient; import com.hnac.hzinfo.sdk.v5.device.DeviceDataClient;
import com.xxl.job.core.log.XxlJobLogger;
import io.undertow.util.CopyOnWriteMap;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.MapUtils; import org.apache.commons.collections4.MapUtils;
@ -642,7 +644,7 @@ public class RealTargetServiceImpl implements RealTargetService {
List<WaterLevelVo> list = new CopyOnWriteArrayList<>(); List<WaterLevelVo> list = new CopyOnWriteArrayList<>();
CountDownLatch countDownLatch = new CountDownLatch(modelList.size()); CountDownLatch countDownLatch = new CountDownLatch(modelList.size());
for(HzimsAnalyzeModelStationEntity item : modelList){ for(HzimsAnalyzeModelStationEntity item : modelList){
pool.submit(() -> { pool.execute(() -> {
try{ try{
List<MultiAnalyzeCodePO> multiAnalyzeCodePOList = new ArrayList<>(); List<MultiAnalyzeCodePO> multiAnalyzeCodePOList = new ArrayList<>();
MultiAnalyzeCodePO multiAnalyzeCodePO = new MultiAnalyzeCodePO(); MultiAnalyzeCodePO multiAnalyzeCodePO = new MultiAnalyzeCodePO();
@ -650,6 +652,8 @@ public class RealTargetServiceImpl implements RealTargetService {
multiAnalyzeCodePO.setSignages(Collections.singletonList(HomePageConstant.FRONT_WATER_LEVEL)); multiAnalyzeCodePO.setSignages(Collections.singletonList(HomePageConstant.FRONT_WATER_LEVEL));
multiAnalyzeCodePOList.add(multiAnalyzeCodePO); multiAnalyzeCodePOList.add(multiAnalyzeCodePO);
R<List<AnalyzeCodeBySignagesVO>> result = analyseDataSearchClient.getAnalyzeCodeBySignages(multiAnalyzeCodePOList); R<List<AnalyzeCodeBySignagesVO>> result = analyseDataSearchClient.getAnalyzeCodeBySignages(multiAnalyzeCodePOList);
if(result.isSuccess() && CollectionUtil.isNotEmpty(result.getData())){ if(result.isSuccess() && CollectionUtil.isNotEmpty(result.getData())){
WaterLevelVo waterLevelVo=new WaterLevelVo(); WaterLevelVo waterLevelVo=new WaterLevelVo();
waterLevelVo.setStationCode(item.getStationId()); waterLevelVo.setStationCode(item.getStationId());
@ -671,21 +675,25 @@ public class RealTargetServiceImpl implements RealTargetService {
list.add(waterLevelVo); list.add(waterLevelVo);
} }
countDownLatch.countDown(); countDownLatch.countDown();
XxlJobLogger.log("load_water_level : 子线程执行完成 {}", item.getInstanceCode());
} catch (Exception exception) { } catch (Exception exception) {
log.error("load_water_level_error : {}",exception.getMessage());
countDownLatch.countDown(); countDownLatch.countDown();
XxlJobLogger.log("load_water_level_error : 子线程执行失败 {}", exception.getMessage());
} }
}); });
} }
try { try {
XxlJobLogger.log("load_water_level :等待线程执行");
countDownLatch.await(); countDownLatch.await();
} catch (InterruptedException e) { } catch (InterruptedException e) {
e.printStackTrace(); e.printStackTrace();
Thread.currentThread().interrupt(); Thread.currentThread().interrupt();
} }
XxlJobLogger.log("load_water_level :线程执行结束");
redisTemplate.opsForValue().set(loadwater_level_key,list); redisTemplate.opsForValue().set(loadwater_level_key,list);
} }
/** /**
* 光伏站-逆变器实时加载 * 光伏站-逆变器实时加载
* *
@ -947,7 +955,12 @@ public class RealTargetServiceImpl implements RealTargetService {
} }
return datas.stream().map(data->{ return datas.stream().map(data->{
ActivePowerVo active = new ActivePowerVo(); ActivePowerVo active = new ActivePowerVo();
Date dateTime = DateUtil.parse(data.getTs(), "yyyy-MM-dd HH:mm:ss.s"); Date dateTime;
if(data.getTs().contains(".0")){
dateTime = DateUtil.parse(data.getTs(), "yyyy-MM-dd HH:mm:ss.s");
}else{
dateTime = DateUtil.parse(data.getTs() + ".0", "yyyy-MM-dd HH:mm:ss.s");
}
active.setHour(dateTime.getHours()); active.setHour(dateTime.getHours());
if (StringUtil.isBlank(data.getVal())) { if (StringUtil.isBlank(data.getVal())) {
active.setActivePower("0"); active.setActivePower("0");
@ -974,7 +987,12 @@ public class RealTargetServiceImpl implements RealTargetService {
} }
return records.stream().map(record -> { return records.stream().map(record -> {
UsrPowerVo usr = new UsrPowerVo(); UsrPowerVo usr = new UsrPowerVo();
Date time = DateUtil.parse(record.getTs(), "yyyy-MM-dd HH:mm:ss.s"); Date time;
if(record.getTs().contains(".0")){
time = DateUtil.parse(record.getTs(), "yyyy-MM-dd HH:mm:ss.s");
}else{
time = DateUtil.parse(record.getTs() + ".0", "yyyy-MM-dd HH:mm:ss.s");
}
usr.setDate(DateUtil.format(time,DateUtil.PATTERN_DATE)); usr.setDate(DateUtil.format(time,DateUtil.PATTERN_DATE));
usr.setUsrPower(Float.valueOf(Optional.ofNullable(record.getVal()).orElse("0"))); usr.setUsrPower(Float.valueOf(Optional.ofNullable(record.getVal()).orElse("0")));
return usr; return usr;
@ -1004,7 +1022,12 @@ public class RealTargetServiceImpl implements RealTargetService {
} }
return records.stream().map(record -> { return records.stream().map(record -> {
PowerMonthVo generate = new PowerMonthVo(); PowerMonthVo generate = new PowerMonthVo();
Date time = DateUtil.parse(record.getTs(), "yyyy-MM-dd HH:mm:ss.s"); Date time;
if(record.getTs().contains(".0")){
time = DateUtil.parse(record.getTs(), "yyyy-MM-dd HH:mm:ss.s");
}else{
time = DateUtil.parse(record.getTs() + ".0", "yyyy-MM-dd HH:mm:ss.s");
}
generate.setStrMonth(DateUtil.format(time, DateUtil.PATTERN_DATE)); generate.setStrMonth(DateUtil.format(time, DateUtil.PATTERN_DATE));
if(StringUtil.isEmpty(record.getVal())){ if(StringUtil.isEmpty(record.getVal())){
generate.setPower(0f); generate.setPower(0f);
@ -1217,7 +1240,12 @@ public class RealTargetServiceImpl implements RealTargetService {
if(StringUtil.isEmpty(time) || "-".equals(time)){ if(StringUtil.isEmpty(time) || "-".equals(time)){
return 0.0; return 0.0;
} }
Date date = DateUtil.parse(time, "yyyy-MM-dd HH:mm:ss.sss"); Date date;
if(time.contains(".000")){
date = DateUtil.parse(time, "yyyy-MM-dd HH:mm:ss.sss");
}else{
date = DateUtil.parse(time, DateUtil.PATTERN_DATETIME);
}
if(System.currentTimeMillis() - date.getTime() > 30 * 60 * 1000L){ if(System.currentTimeMillis() - date.getTime() > 30 * 60 * 1000L){
return 0.0; return 0.0;
} }
@ -1245,8 +1273,12 @@ public class RealTargetServiceImpl implements RealTargetService {
} }
return datas.stream().collect(Collectors.toMap( return datas.stream().collect(Collectors.toMap(
key-> { key-> {
if(key.getTs().contains(".0")){
Date dateTime = DateUtil.parse(key.getTs(), "yyyy-MM-dd HH:mm:ss.s"); Date dateTime = DateUtil.parse(key.getTs(), "yyyy-MM-dd HH:mm:ss.s");
return dateTime.getHours(); return dateTime.getHours();
}
Date dateTime = DateUtil.parse(key.getTs() + ".0", "yyyy-MM-dd HH:mm:ss.s");
return dateTime.getHours();
}, },
value -> { value -> {
if(StringUtil.isEmpty(value.getVal())){ if(StringUtil.isEmpty(value.getVal())){
@ -1417,7 +1449,12 @@ public class RealTargetServiceImpl implements RealTargetService {
} }
datas.addAll(records.stream().map(record -> { datas.addAll(records.stream().map(record -> {
PowerMonthVo generate = new PowerMonthVo(); PowerMonthVo generate = new PowerMonthVo();
Date time = DateUtil.parse(record.get("ts"), "yyyy-MM-dd HH:mm:ss.s"); Date time;
if(record.get("ts").contains(".0")){
time = DateUtil.parse(record.get("ts"), "yyyy-MM-dd HH:mm:ss.s");
}else{
time = DateUtil.parse(record.get("ts") + ".0", "yyyy-MM-dd HH:mm:ss.s");
}
generate.setStrMonth(DateUtil.format(time,DateUtil.PATTERN_DATE)); generate.setStrMonth(DateUtil.format(time,DateUtil.PATTERN_DATE));
String val = record.get(HomePageConstant.HYDROPOWER_GENERATE_POWER); String val = record.get(HomePageConstant.HYDROPOWER_GENERATE_POWER);
if(StringUtil.isEmpty(val)){ if(StringUtil.isEmpty(val)){
@ -1535,7 +1572,12 @@ public class RealTargetServiceImpl implements RealTargetService {
} }
datas.addAll(records.stream().map(record -> { datas.addAll(records.stream().map(record -> {
PowerMonthVo generate = new PowerMonthVo(); PowerMonthVo generate = new PowerMonthVo();
Date time = DateUtil.parse(record.getTs(), "yyyy-MM-dd HH:mm:ss.s"); Date time;
if(record.getTs().contains(".0")){
time = DateUtil.parse(record.getTs(), "yyyy-MM-dd HH:mm:ss.s");
}else{
time = DateUtil.parse(record.getTs() + ".0", "yyyy-MM-dd HH:mm:ss.s");
}
generate.setStrMonth(DateUtil.format(time,DateUtil.PATTERN_DATE)); generate.setStrMonth(DateUtil.format(time,DateUtil.PATTERN_DATE));
if(StringUtil.isEmpty(record.getVal())){ if(StringUtil.isEmpty(record.getVal())){
generate.setPower(0f); generate.setPower(0f);
@ -1782,7 +1824,12 @@ public class RealTargetServiceImpl implements RealTargetService {
} }
return records.stream().map(record -> { return records.stream().map(record -> {
PhotovoltaicPowerVo load = new PhotovoltaicPowerVo(); PhotovoltaicPowerVo load = new PhotovoltaicPowerVo();
Date time = DateUtil.parse(record.getTs(), "yyyy-MM-dd HH:mm:ss.s"); Date time;
if(record.getTs().contains(".0")){
time = DateUtil.parse(record.getTs(), "yyyy-MM-dd HH:mm:ss.s");
}else{
time = DateUtil.parse(record.getTs() + ".0", "yyyy-MM-dd HH:mm:ss.s");
}
load.setHour(time.getHours()); load.setHour(time.getHours());
load.setActivePower(Optional.ofNullable(record.getVal()).orElse("0")); load.setActivePower(Optional.ofNullable(record.getVal()).orElse("0"));
return load; return load;
@ -1809,7 +1856,12 @@ public class RealTargetServiceImpl implements RealTargetService {
} }
return records.stream().map(record -> { return records.stream().map(record -> {
GenerationPowerVo generate = new GenerationPowerVo(); GenerationPowerVo generate = new GenerationPowerVo();
Date time = DateUtil.parse(record.getTs(), "yyyy-MM-dd HH:mm:ss.s"); Date time;
if(record.getTs().contains(".0")){
time = DateUtil.parse(record.getTs(), "yyyy-MM-dd HH:mm:ss.s");
}else{
time = DateUtil.parse(record.getTs() + ".0", "yyyy-MM-dd HH:mm:ss.s");
}
generate.setDate(DateUtil.format(time, DateUtil.PATTERN_DATE)); generate.setDate(DateUtil.format(time, DateUtil.PATTERN_DATE));
generate.setGenerate(Float.valueOf(Optional.ofNullable(record.getVal()).orElse("0"))); generate.setGenerate(Float.valueOf(Optional.ofNullable(record.getVal()).orElse("0")));
return generate; return generate;

7
hzims-service/operational/src/main/java/com/hnac/hzims/operational/ecology/service/impl/EcologyFlowStationServiceImpl.java

@ -310,7 +310,12 @@ public class EcologyFlowStationServiceImpl extends ServiceImpl<EcologyFlowStatio
} }
return records.stream().map(record -> { return records.stream().map(record -> {
WaterVo water = new WaterVo(); WaterVo water = new WaterVo();
Date time = DateUtil.parse(record.getTs(), "yyyy-MM-dd HH:mm:ss.s"); Date time;
if(record.getTs().contains(".0")){
time = DateUtil.parse(record.getTs(), "yyyy-MM-dd HH:mm:ss.s");
}else{
time = DateUtil.parse(record.getTs() + ".0", "yyyy-MM-dd HH:mm:ss.s");
}
water.setTime(DateUtil.format(time,DateUtil.PATTERN_DATE)); water.setTime(DateUtil.format(time,DateUtil.PATTERN_DATE));
water.setWater(Double.valueOf(Optional.ofNullable(record.getVal()).orElse("0"))); water.setWater(Double.valueOf(Optional.ofNullable(record.getVal()).orElse("0")));
if(Math.abs(water.getWater()) == 0){ if(Math.abs(water.getWater()) == 0){

1
hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/HydropowerServiceImpl.java

@ -569,6 +569,7 @@ public class HydropowerServiceImpl implements HydropowerService {
WaterLevelVo level = validList.get(0); WaterLevelVo level = validList.get(0);
// 前池水位、当日水位曲线 // 前池水位、当日水位曲线
response.setFrontWaterLevel(level.getFrontWaterLevel()); response.setFrontWaterLevel(level.getFrontWaterLevel());
response.setFrontCurveMap(level.getFrontCurveMap());
} }
/** /**

8
hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/PhotovoltaicServiceImpl.java

@ -780,7 +780,13 @@ public class PhotovoltaicServiceImpl implements PhotovoltaicService {
} }
return list.stream().collect(Collectors.groupingBy(AnalyseDataTaosVO::getTs)).entrySet().stream().map(entry ->{ return list.stream().collect(Collectors.groupingBy(AnalyseDataTaosVO::getTs)).entrySet().stream().map(entry ->{
PhotovoltaicLoadGenerateVo target = new PhotovoltaicLoadGenerateVo(); PhotovoltaicLoadGenerateVo target = new PhotovoltaicLoadGenerateVo();
LocalDateTime time = LocalDateTime.parse(DateUtil.format(DateUtil.parse(entry.getKey(), "yyyy-MM-dd HH:mm:ss.s"),DateUtil.PATTERN_DATETIME), DateUtil.DATETIME_FORMATTER); Date date;
if(entry.getKey().contains(".0")){
date = DateUtil.parse(entry.getKey(), "yyyy-MM-dd HH:mm:ss.s");
}else{
date = DateUtil.parse(entry.getKey() + ".0", "yyyy-MM-dd HH:mm:ss.s");
}
LocalDateTime time = LocalDateTime.parse(DateUtil.format(date,DateUtil.PATTERN_DATETIME), DateUtil.DATETIME_FORMATTER);
target.setPeriod(String.valueOf(time.getHour())); target.setPeriod(String.valueOf(time.getHour()));
target.setValue((float) entry.getValue().stream().filter(val -> !StringUtil.isEmpty(val.getVal())).mapToDouble(o-> Double.parseDouble(String.valueOf(o.getVal()))).sum()); target.setValue((float) entry.getValue().stream().filter(val -> !StringUtil.isEmpty(val.getVal())).mapToDouble(o-> Double.parseDouble(String.valueOf(o.getVal()))).sum());
return target; return target;

9
hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/service/impl/RunMonthServiceImpl.java

@ -247,6 +247,7 @@ public class RunMonthServiceImpl extends ServiceImpl<RunMonthMapper, RunMonthEnt
calendar.setTime(DateUtil.parse(mon,"yyyy-MM")); calendar.setTime(DateUtil.parse(mon,"yyyy-MM"));
String start = DateUtil.format(calendar.getTime(),DateUtil.PATTERN_DATETIME); String start = DateUtil.format(calendar.getTime(),DateUtil.PATTERN_DATETIME);
calendar.add(Calendar.MONTH,1); calendar.add(Calendar.MONTH,1);
calendar.add(Calendar.DAY_OF_MONTH,-1);
String end = DateUtil.format(calendar.getTime(),DateUtil.PATTERN_DATETIME); String end = DateUtil.format(calendar.getTime(),DateUtil.PATTERN_DATETIME);
// 告警数据 // 告警数据
run.setAlarmData(this.alarmData(station.getCode(),start,end)); run.setAlarmData(this.alarmData(station.getCode(),start,end));
@ -721,7 +722,12 @@ public class RunMonthServiceImpl extends ServiceImpl<RunMonthMapper, RunMonthEnt
} }
analyseDatas.addAll(data.getList().stream().peek(item->{ analyseDatas.addAll(data.getList().stream().peek(item->{
item.setSignage(data.getSignage()); item.setSignage(data.getSignage());
Date date = DateUtil.parse(item.getTs(), "yyyy-MM-dd HH:mm:ss.s"); Date date;
if(item.getTs().contains(".0")){
date = DateUtil.parse(item.getTs(), "yyyy-MM-dd HH:mm:ss.s");
}else{
date = DateUtil.parse(item.getTs() + ".0", "yyyy-MM-dd HH:mm:ss.s");
}
day.setTime(date); day.setTime(date);
item.setTs(String.valueOf(day.get(Calendar.DAY_OF_MONTH))); item.setTs(String.valueOf(day.get(Calendar.DAY_OF_MONTH)));
}).collect(Collectors.toList())); }).collect(Collectors.toList()));
@ -763,7 +769,6 @@ public class RunMonthServiceImpl extends ServiceImpl<RunMonthMapper, RunMonthEnt
attributes.add(attribute); attributes.add(attribute);
break; break;
case 1: case 1:
AttributeVo upper_temp = new AttributeVo(); AttributeVo upper_temp = new AttributeVo();
upper_temp.setSignage(HomePageConstant.UPPER_GUIDE_BEARING_TEMP); upper_temp.setSignage(HomePageConstant.UPPER_GUIDE_BEARING_TEMP);
upper_temp.setSignageName("上导轴承瓦温1"); upper_temp.setSignageName("上导轴承瓦温1");

BIN
hzims-service/operational/src/main/resources/template/word/stationMonthReport.docx

Binary file not shown.

22
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/RehearsalPlanServiceImpl.java

@ -20,6 +20,7 @@ import com.hnac.hzims.safeproduct.service.IRehearsalPlanService;
import com.hnac.hzims.safeproduct.service.IRehearsalRecordService; import com.hnac.hzims.safeproduct.service.IRehearsalRecordService;
import com.hnac.hzims.safeproduct.vo.RehearsalMonthVO; import com.hnac.hzims.safeproduct.vo.RehearsalMonthVO;
import com.hnac.hzims.safeproduct.vo.RehearsalYearVO; import com.hnac.hzims.safeproduct.vo.RehearsalYearVO;
import org.apache.commons.collections4.map.HashedMap;
import org.springblade.core.log.exception.ServiceException; import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.mp.support.Query; import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.utils.DateUtil; import org.springblade.core.tool.utils.DateUtil;
@ -34,10 +35,7 @@ import java.io.IOException;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.RoundingMode; import java.math.RoundingMode;
import java.net.URLEncoder; import java.net.URLEncoder;
import java.util.ArrayList; import java.util.*;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
@ -119,7 +117,7 @@ public class RehearsalPlanServiceImpl extends ServiceImpl<RehearsalPlanMapper, R
// 查询各单位全年已完成的演练数据 // 查询各单位全年已完成的演练数据
List<AnalysisYearDTO> unitMonthDataList = baseMapper.selectFinishedDataByUnit(unitList, year); List<AnalysisYearDTO> unitMonthDataList = baseMapper.selectFinishedDataByUnit(unitList, year);
// 将各单位每个月的演练数据写入统计列表 // 将各单位每个月的演练数据写入统计列表
List<RehearsalYearVO> res = new ArrayList<>(); HashedMap<String, RehearsalYearVO> map = new HashedMap<>();
unitMonthDataList.forEach(data -> { unitMonthDataList.forEach(data -> {
RehearsalYearVO rehearsalYearVO = records.stream().filter(x -> x.getUnit().equals(data.getUnit())) RehearsalYearVO rehearsalYearVO = records.stream().filter(x -> x.getUnit().equals(data.getUnit()))
.collect(Collectors.toList()).get(0); .collect(Collectors.toList()).get(0);
@ -175,9 +173,11 @@ public class RehearsalPlanServiceImpl extends ServiceImpl<RehearsalPlanMapper, R
rehearsalYearVO.setSum(sum + data.getFinishedNum()); rehearsalYearVO.setSum(sum + data.getFinishedNum());
} }
if (rehearsalYearVO.getSum() != 0) { if (rehearsalYearVO.getSum() != 0) {
res.add(rehearsalYearVO); map.put(rehearsalYearVO.getUnit(), rehearsalYearVO);
} }
}); });
List<RehearsalYearVO> list = new ArrayList<>(map.values());
List<RehearsalYearVO> res = list.stream().sorted(Comparator.comparing(RehearsalYearVO::getUnit)).collect(Collectors.toList());
unitPage.setRecords(res); unitPage.setRecords(res);
return unitPage; return unitPage;
} }
@ -299,18 +299,18 @@ public class RehearsalPlanServiceImpl extends ServiceImpl<RehearsalPlanMapper, R
String startTime = String.valueOf(param.get("scheduledStartTime")); String startTime = String.valueOf(param.get("scheduledStartTime"));
String endTime = String.valueOf(param.get("scheduledEndTime")); String endTime = String.valueOf(param.get("scheduledEndTime"));
String rehearsalStatus = String.valueOf(param.get("rehearsalStatus")); String rehearsalStatus = String.valueOf(param.get("rehearsalStatus"));
if (!unit.equals("null") && !unit.equals("")) { if (!"null".equals(unit) && !unit.isEmpty()) {
queryWrapper.lambda().like(RehearsalPlanEntity::getUnit, unit); queryWrapper.lambda().like(RehearsalPlanEntity::getUnit, unit);
} }
if (!startTime.equals("null") && !startTime.equals("")) { if (!"null".equals(startTime) && !startTime.isEmpty()) {
queryWrapper.lambda().ge(RehearsalPlanEntity::getScheduledEndTime, startTime); queryWrapper.lambda().ge(RehearsalPlanEntity::getScheduledEndTime, startTime);
} }
if (!endTime.equals("null") && !endTime.equals("")) { if (!"null".equals(endTime) && !endTime.isEmpty()) {
queryWrapper.lambda().le(RehearsalPlanEntity::getScheduledEndTime, endTime); queryWrapper.lambda().le(RehearsalPlanEntity::getScheduledEndTime, endTime);
} }
if (!rehearsalStatus.equals("null") && !rehearsalStatus.equals("")) { if (!"null".equals(rehearsalStatus) && !rehearsalStatus.isEmpty()) {
// 未完成计划包括UNFINISHED和WAITING两种状态 // 未完成计划包括UNFINISHED和WAITING两种状态
if (rehearsalStatus.equals("UNFINISHED+WAITING")) { if ("UNFINISHED+WAITING".equals(rehearsalStatus)) {
queryWrapper.lambda().and(wrapper -> wrapper.eq(RehearsalPlanEntity::getRehearsalStatus, RehearsalStatusEnum.UNFINISHED.getValue()) queryWrapper.lambda().and(wrapper -> wrapper.eq(RehearsalPlanEntity::getRehearsalStatus, RehearsalStatusEnum.UNFINISHED.getValue())
.or() .or()
.eq(RehearsalPlanEntity::getRehearsalStatus, RehearsalStatusEnum.WAITING.getValue())); .eq(RehearsalPlanEntity::getRehearsalStatus, RehearsalStatusEnum.WAITING.getValue()));

Loading…
Cancel
Save