Browse Source

优化无桩号预警

develop
zhaoxianglong 8 months ago
parent
commit
1485539aa8
  1. 12
      zc-business/src/main/java/com/zc/business/controller/DcNoStakeWarningTableController.java
  2. 5
      zc-business/src/main/java/com/zc/business/service/IDcNoStakeWarningTableService.java
  3. 18
      zc-business/src/main/java/com/zc/business/service/impl/DcNoStakeWarningTableServiceImpl.java

12
zc-business/src/main/java/com/zc/business/controller/DcNoStakeWarningTableController.java

@ -5,10 +5,7 @@ import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType; import com.ruoyi.common.enums.BusinessType;
import com.zc.business.domain.DcFacility;
import com.zc.business.domain.DcNoStakeWarningTable; import com.zc.business.domain.DcNoStakeWarningTable;
import com.zc.business.service.IDcFacilityService;
import com.zc.business.service.IDcNoStakeWarningTableService;
import com.zc.business.service.impl.DcNoStakeWarningTableServiceImpl; import com.zc.business.service.impl.DcNoStakeWarningTableServiceImpl;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
@ -17,6 +14,7 @@ import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.validation.Valid; import javax.validation.Valid;
import java.util.Date;
import java.util.List; import java.util.List;
/** /**
@ -42,8 +40,8 @@ public class DcNoStakeWarningTableController extends BaseController {
@ApiOperation("分页查询路网设施列表") @ApiOperation("分页查询路网设施列表")
@PreAuthorize("@ss.hasPermi('iot:dcNoStakeWarningTable:list')") @PreAuthorize("@ss.hasPermi('iot:dcNoStakeWarningTable:list')")
@GetMapping("list") @GetMapping("list")
public TableDataInfo listFacility(DcNoStakeWarningTable dcNoStakeWarningTable) { public TableDataInfo listFacility(DcNoStakeWarningTable dcNoStakeWarningTable, @RequestParam(value = "endTime", required = false) Date endTime, @RequestParam(value = "startTime", required = false)Date startTime) {
return getDataTable(dcNoStakeWarningTableService.pageDcNoStakeWarningTable(dcNoStakeWarningTable)); return getDataTable(dcNoStakeWarningTableService.pageDcNoStakeWarningTable(dcNoStakeWarningTable,endTime,startTime));
} }
/** /**
@ -55,8 +53,8 @@ public class DcNoStakeWarningTableController extends BaseController {
@ApiOperation("无分页查询路网设施列表") @ApiOperation("无分页查询路网设施列表")
@PreAuthorize("@ss.hasPermi('iot:dcNoStakeWarningTable:query')") @PreAuthorize("@ss.hasPermi('iot:dcNoStakeWarningTable:query')")
@GetMapping("query") @GetMapping("query")
public AjaxResult queryFacility(DcNoStakeWarningTable dcNoStakeWarningTable) { public AjaxResult queryFacility(DcNoStakeWarningTable dcNoStakeWarningTable, @RequestParam(value = "endTime", required = false) Date endTime, @RequestParam(value = "startTime", required = false)Date startTime) {
return AjaxResult.success(dcNoStakeWarningTableService.listDcNoStakeWarningTable(dcNoStakeWarningTable)); return AjaxResult.success(dcNoStakeWarningTableService.listDcNoStakeWarningTable(dcNoStakeWarningTable,endTime,startTime));
} }
/** /**

5
zc-business/src/main/java/com/zc/business/service/IDcNoStakeWarningTableService.java

@ -4,6 +4,7 @@ package com.zc.business.service;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.zc.business.domain.DcNoStakeWarningTable; import com.zc.business.domain.DcNoStakeWarningTable;
import java.util.Date;
import java.util.List; import java.util.List;
/** /**
@ -42,7 +43,7 @@ public interface IDcNoStakeWarningTableService extends IService<DcNoStakeWarning
* @param dcNoStakeWarningTable 参数 * @param dcNoStakeWarningTable 参数
* @return 结果 * @return 结果
*/ */
List<DcNoStakeWarningTable> pageDcNoStakeWarningTable(DcNoStakeWarningTable dcNoStakeWarningTable); List<DcNoStakeWarningTable> pageDcNoStakeWarningTable(DcNoStakeWarningTable dcNoStakeWarningTable, Date endTime, Date startTime);
/** /**
* 获取无桩号预警列表 * 获取无桩号预警列表
@ -50,7 +51,7 @@ public interface IDcNoStakeWarningTableService extends IService<DcNoStakeWarning
* @param dcNoStakeWarningTable 参数 * @param dcNoStakeWarningTable 参数
* @return 结果 * @return 结果
*/ */
List<DcNoStakeWarningTable> listDcNoStakeWarningTable(DcNoStakeWarningTable dcNoStakeWarningTable); List<DcNoStakeWarningTable> listDcNoStakeWarningTable(DcNoStakeWarningTable dcNoStakeWarningTable, Date endTime, Date startTime);
/** /**

18
zc-business/src/main/java/com/zc/business/service/impl/DcNoStakeWarningTableServiceImpl.java

@ -5,15 +5,10 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.constant.HttpStatus; import com.ruoyi.common.constant.HttpStatus;
import com.ruoyi.common.exception.ServiceException; import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.PageUtils; import com.ruoyi.common.utils.PageUtils;
import com.zc.business.domain.DcFacility;
import com.zc.business.domain.DcNoStakeWarningTable; import com.zc.business.domain.DcNoStakeWarningTable;
import com.zc.business.mapper.DcFacilityMapper;
import com.zc.business.mapper.DcNoStakeWarningTableMapper; import com.zc.business.mapper.DcNoStakeWarningTableMapper;
import com.zc.business.service.IDcFacilityService;
import com.zc.business.service.IDcNoStakeWarningTableService; import com.zc.business.service.IDcNoStakeWarningTableService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
@ -27,7 +22,7 @@ import java.util.Objects;
@Service @Service
public class DcNoStakeWarningTableServiceImpl extends ServiceImpl<DcNoStakeWarningTableMapper, DcNoStakeWarningTable> implements IDcNoStakeWarningTableService { public class DcNoStakeWarningTableServiceImpl extends ServiceImpl<DcNoStakeWarningTableMapper, DcNoStakeWarningTable> implements IDcNoStakeWarningTableService {
public LambdaQueryWrapper<DcNoStakeWarningTable> noStakeWarningTableQueryWrapper(DcNoStakeWarningTable dcNoStakeWarningTable) { public LambdaQueryWrapper<DcNoStakeWarningTable> noStakeWarningTableQueryWrapper(DcNoStakeWarningTable dcNoStakeWarningTable, Date endTime, Date startTime) {
LambdaQueryWrapper<DcNoStakeWarningTable> queryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<DcNoStakeWarningTable> queryWrapper = new LambdaQueryWrapper<>();
@ -56,6 +51,9 @@ public class DcNoStakeWarningTableServiceImpl extends ServiceImpl<DcNoStakeWarni
queryWrapper.eq(DcNoStakeWarningTable::getCreateTime, dcNoStakeWarningTable.getCreateTime()); queryWrapper.eq(DcNoStakeWarningTable::getCreateTime, dcNoStakeWarningTable.getCreateTime());
} }
if (endTime != null && startTime != null) {
queryWrapper.between(DcNoStakeWarningTable::getWarningTime, startTime, endTime);
}
// 木桩 // 木桩
return queryWrapper; return queryWrapper;
} }
@ -96,15 +94,15 @@ public class DcNoStakeWarningTableServiceImpl extends ServiceImpl<DcNoStakeWarni
} }
@Override @Override
public List<DcNoStakeWarningTable> pageDcNoStakeWarningTable(DcNoStakeWarningTable dcNoStakeWarningTable) { public List<DcNoStakeWarningTable> pageDcNoStakeWarningTable(DcNoStakeWarningTable dcNoStakeWarningTable, Date endTime, Date startTime) {
// 分页 // 分页
PageUtils.startPage(); PageUtils.startPage();
return list(noStakeWarningTableQueryWrapper(dcNoStakeWarningTable)); return list(noStakeWarningTableQueryWrapper(dcNoStakeWarningTable,endTime,startTime));
} }
@Override @Override
public List<DcNoStakeWarningTable> listDcNoStakeWarningTable(DcNoStakeWarningTable dcNoStakeWarningTable) { public List<DcNoStakeWarningTable> listDcNoStakeWarningTable(DcNoStakeWarningTable dcNoStakeWarningTable, Date endTime, Date startTime) {
return list(noStakeWarningTableQueryWrapper(dcNoStakeWarningTable)); return list(noStakeWarningTableQueryWrapper(dcNoStakeWarningTable,endTime,startTime));
} }
@Override @Override

Loading…
Cancel
Save