|
|
|
|
@ -26,6 +26,7 @@ |
|
|
|
|
package org.springblade.desk.energy.service.impl; |
|
|
|
|
|
|
|
|
|
import cn.hutool.core.collection.CollUtil; |
|
|
|
|
import cn.hutool.core.util.StrUtil; |
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.Wrapper; |
|
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|
|
|
|
@ -59,12 +60,18 @@ public class BsSafePatrolInspectionServiceImpl extends BaseServiceImpl<BsSafePat |
|
|
|
|
private final IBsSafeInspectionPointService bsSafeInspectionPointService; |
|
|
|
|
@Override |
|
|
|
|
public IPage<BsSafePatrolInspectionVO> selectBsSafePatrolInspectionPage(IPage<BsSafePatrolInspectionVO> page, BsSafePatrolInspectionVO bsSafePatrolInspection) { |
|
|
|
|
if(bsSafePatrolInspection.getQueryLaunchTime()!=null){ |
|
|
|
|
bsSafePatrolInspection.setStartDate(bsSafePatrolInspection.getQueryLaunchTime().split(",")[0]); |
|
|
|
|
bsSafePatrolInspection.setEndDate(bsSafePatrolInspection.getQueryLaunchTime().split(",")[1]); |
|
|
|
|
if(StrUtil.isNotEmpty(bsSafePatrolInspection.getQueryLaunchTime())){ |
|
|
|
|
String[] launchDates = bsSafePatrolInspection.getQueryLaunchTime().split(","); |
|
|
|
|
if (launchDates.length >= 2) { |
|
|
|
|
bsSafePatrolInspection.setStartDate(launchDates[0]); |
|
|
|
|
bsSafePatrolInspection.setEndDate(launchDates[1]); |
|
|
|
|
} |
|
|
|
|
}else if(StringUtils.isNotEmpty(bsSafePatrolInspection.getQueryTestTime())){ |
|
|
|
|
bsSafePatrolInspection.setStartTestDate(bsSafePatrolInspection.getQueryTestTime().split(",")[0]); |
|
|
|
|
bsSafePatrolInspection.setEndTestDate(bsSafePatrolInspection.getQueryTestTime().split(",")[1]); |
|
|
|
|
String[] testDates = bsSafePatrolInspection.getQueryTestTime().split(","); |
|
|
|
|
if (testDates.length >= 2) { |
|
|
|
|
bsSafePatrolInspection.setStartTestDate(testDates[0]); |
|
|
|
|
bsSafePatrolInspection.setEndTestDate(testDates[1]); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return page.setRecords(baseMapper.selectBsSafePatrolInspectionPage(page, bsSafePatrolInspection)); |
|
|
|
|
} |
|
|
|
|
@ -133,7 +140,7 @@ public class BsSafePatrolInspectionServiceImpl extends BaseServiceImpl<BsSafePat |
|
|
|
|
@Override |
|
|
|
|
public void updateOldPatrol(Long ipId, Date launchTime, Long id) { |
|
|
|
|
update(Wrappers.lambdaUpdate(BsSafePatrolInspectionEntity.class) |
|
|
|
|
.eq(BsSafePatrolInspectionEntity::getIpId, id) |
|
|
|
|
.eq(BsSafePatrolInspectionEntity::getIpId, ipId) |
|
|
|
|
.lt(BsSafePatrolInspectionEntity::getLaunchTime, launchTime) |
|
|
|
|
.eq(BsSafePatrolInspectionEntity::getTaskStatus, BsSafePatrolInspectionEntity.PREPARE_TEXT) |
|
|
|
|
.set(BsSafePatrolInspectionEntity::getTaskStatus, BsSafePatrolInspectionEntity.NO_CHECK) |
|
|
|
|
|