1.区域报告和监测点报告代码提交

2.终端管理部分代码提交
This commit is contained in:
wurui
2023-03-08 16:08:30 +08:00
parent d657c55217
commit daffdb9048
6 changed files with 3370 additions and 99 deletions

View File

@@ -71,4 +71,6 @@ public class ExportParam implements Serializable {
@ApiModelProperty(name = "flag",value = "标识") @ApiModelProperty(name = "flag",value = "标识")
private Integer flag; private Integer flag;
@ApiModelProperty(name = "type",value = "系统区分(0:pq 1:pms)")
private Integer type;
} }

View File

@@ -202,8 +202,14 @@ public class ReportController extends BaseController {
@ApiImplicitParam(name = "areaReportParam", value = "参数体", required = true) @ApiImplicitParam(name = "areaReportParam", value = "参数体", required = true)
public void getAreaReport(@RequestBody @Validated AreaReportParam areaReportParam, HttpServletResponse response) throws Exception { public void getAreaReport(@RequestBody @Validated AreaReportParam areaReportParam, HttpServletResponse response) throws Exception {
reportService.getAreaReport(areaReportParam, response); reportService.getAreaReport(areaReportParam, response);
} }
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/getPmsAreaReport")
@ApiOperation("获取Pms区域报告")
@ApiImplicitParam(name = "areaReportParam", value = "参数体", required = true)
public void getPmsAreaReport(@RequestBody @Validated AreaReportParam areaReportParam, HttpServletResponse response) throws Exception {
reportService.getPmsAreaReport(areaReportParam, response);
}
} }

View File

@@ -56,4 +56,12 @@ public interface ReportService {
void getAreaReport(AreaReportParam areaReportParam, HttpServletResponse response) throws Exception; void getAreaReport(AreaReportParam areaReportParam, HttpServletResponse response) throws Exception;
/***
* Pms获取区域报告
* @author wr
* @date 2023-03-07 10:16
* @param areaReportParam
* @param response
*/
void getPmsAreaReport(AreaReportParam areaReportParam, HttpServletResponse response) throws Exception;
} }

View File

@@ -28,8 +28,16 @@ public class TerminalParam {
@ApiModelProperty("单位id") @ApiModelProperty("单位id")
private String id; private String id;
public String getStartTime() {
return startTime + " 00:00:00";
}
public String getEndTime() {
return endTime + " 23:59:59";
}
@Data @Data
public static class TerminalPageParam extends TerminalParam{ public static class TerminalPageParam extends TerminalParam {
@ApiModelProperty(value = "页码") @ApiModelProperty(value = "页码")
private Integer PageNum; private Integer PageNum;
@@ -37,6 +45,9 @@ public class TerminalParam {
@ApiModelProperty(value = "条数") @ApiModelProperty(value = "条数")
private Integer PageSize; private Integer PageSize;
@ApiModelProperty("终端名称")
private String name;
@ApiModelProperty(value = "是否周期检测列表") @ApiModelProperty(value = "是否周期检测列表")
private Integer type; private Integer type;
} }

View File

@@ -54,12 +54,17 @@ public class PmsTerminalDetectionServiceImpl extends ServiceImpl<PmsTerminalDete
@Override @Override
public Page<TerminalVO> terminalPage(TerminalParam.TerminalPageParam param) { public Page<TerminalVO> terminalPage(TerminalParam.TerminalPageParam param) {
List<DeptDTO> data = deptFeignClient.getDepSonDetailByDeptId(param.getId()).getData();
List<String> deptCodes = data.stream().map(DeptDTO::getCode).collect(Collectors.toList());
Page<PmsTerminalDetection> pageList = this.page(new Page<>(param.getPageNum(), param.getPageSize()) Page<PmsTerminalDetection> pageList = this.page(new Page<>(param.getPageNum(), param.getPageSize())
, new LambdaQueryWrapper<PmsTerminalDetection>() , new LambdaQueryWrapper<PmsTerminalDetection>()
.eq(CollectionUtil.isNotEmpty(deptCodes), PmsTerminalDetection::getOrgName, deptCodes)
.eq(PmsTerminalDetection::getStatus, DataStateEnum.ENABLE.getCode()) .eq(PmsTerminalDetection::getStatus, DataStateEnum.ENABLE.getCode())
// .in(RMpWpPowerDetailQ::getMeasurementPointId, monitorIds) .like(StrUtil.isNotBlank(param.getName()), PmsTerminalDetection::getName, param.getName())
.le(param.getType() != 0, PmsTerminalDetection::getNextInspectionTime, LocalDate.now()) .le(param.getType() != 0, PmsTerminalDetection::getNextInspectionTime, LocalDate.now())
// .le(StrUtil.isNotBlank(param.getEndTime()), PmsTerminalDetection::getDataDate, param.getEndTime()) .ge(StrUtil.isNotBlank(param.getStartTime()), PmsTerminalDetection::getInspectionTime, param.getStartTime())
.le(StrUtil.isNotBlank(param.getEndTime()), PmsTerminalDetection::getInspectionTime, param.getEndTime())
); );
List<TerminalVO> rMpWpPowerDetailVOS2 = BeanUtil.copyToList(pageList.getRecords(), TerminalVO.class); List<TerminalVO> rMpWpPowerDetailVOS2 = BeanUtil.copyToList(pageList.getRecords(), TerminalVO.class);
@@ -131,7 +136,7 @@ public class PmsTerminalDetectionServiceImpl extends ServiceImpl<PmsTerminalDete
public void importReport(MultipartFile[] files, HttpServletResponse response) { public void importReport(MultipartFile[] files, HttpServletResponse response) {
PmsTerminalDetection detection; PmsTerminalDetection detection;
List<PmsTerminalDetection> data = new ArrayList<>(); List<PmsTerminalDetection> data = new ArrayList<>();
//传入的文件格式(终端编号-检测报告.docx);
for (int i = 0; i < files.length; i++) { for (int i = 0; i < files.length; i++) {
detection = new PmsTerminalDetection(); detection = new PmsTerminalDetection();
//上传的文件名称 //上传的文件名称