|
@@ -53,14 +53,14 @@ public class PatrolInspectionSiteServiceImpl extends AbstractCrudService<PatrolI
|
|
|
LambdaQueryWrapper<PatrolInspectionArea> queryWrapper = Wrappers.lambdaQuery();
|
|
|
queryWrapper.eq(PatrolInspectionArea::getEnable, 1)
|
|
|
.eq(PatrolInspectionArea::getTenantId, SecurityUtils.getTenantId());
|
|
|
- if ("00".equals(userType)){
|
|
|
+ if ("00".equals(userType)) {
|
|
|
queryWrapper.eq(PatrolInspectionArea::getCreator, SecurityUtils.getUsername());
|
|
|
}
|
|
|
List<PatrolInspectionArea> patrolInspectionAreaList = patrolInspectionAreaService.list(queryWrapper);
|
|
|
LambdaQueryWrapper<PatrolInspectionSite> queryWrapperOne = Wrappers.lambdaQuery();
|
|
|
queryWrapperOne.eq(PatrolInspectionSite::getEnable, 1)
|
|
|
.eq(PatrolInspectionSite::getTenantId, SecurityUtils.getTenantId());
|
|
|
- if("00".equals(userType)){
|
|
|
+ if ("00".equals(userType)) {
|
|
|
queryWrapperOne.eq(PatrolInspectionSite::getCreator, SecurityUtils.getUsername());
|
|
|
}
|
|
|
List<PatrolInspectionSite> list = this.list(queryWrapperOne);
|
|
@@ -108,7 +108,7 @@ public class PatrolInspectionSiteServiceImpl extends AbstractCrudService<PatrolI
|
|
|
LambdaQueryWrapper<PatrolInspectionSite> queryWrapper = Wrappers.lambdaQuery();
|
|
|
queryWrapper.eq(PatrolInspectionSite::getEnable, 1)
|
|
|
.eq(PatrolInspectionSite::getTenantId, SecurityUtils.getTenantId());
|
|
|
- if("00".equals(userType)){
|
|
|
+ if ("00".equals(userType)) {
|
|
|
queryWrapper.eq(PatrolInspectionSite::getCreator, SecurityUtils.getUsername());
|
|
|
}
|
|
|
if (areaId != null) {
|
|
@@ -202,4 +202,108 @@ public class PatrolInspectionSiteServiceImpl extends AbstractCrudService<PatrolI
|
|
|
}
|
|
|
|
|
|
|
|
|
+// @Override
|
|
|
+// public List<PatrolInspectionSiteExportVo> patrolInspectionSiteListExport(Integer areaId, String siteName, Integer id) {
|
|
|
+//
|
|
|
+//// LoginUser a = SecurityUtils.getLoginUser();
|
|
|
+//// String userType = SecurityUtils.getLoginUser().getUserType();
|
|
|
+// String userType = null;
|
|
|
+// LambdaQueryWrapper<PatrolInspectionSite> queryWrapper = Wrappers.lambdaQuery();
|
|
|
+// queryWrapper.eq(PatrolInspectionSite::getEnable, 1)
|
|
|
+// .eq(PatrolInspectionSite::getTenantId, SecurityUtils.getTenantId());
|
|
|
+// if ("00".equals(userType)) {
|
|
|
+// queryWrapper.eq(PatrolInspectionSite::getCreator, SecurityUtils.getUsername());
|
|
|
+// }
|
|
|
+// if (areaId != null) {
|
|
|
+// queryWrapper.eq(PatrolInspectionSite::getAreaId, areaId);
|
|
|
+// }
|
|
|
+// if (id != null && id != 0) {
|
|
|
+// queryWrapper.eq(PatrolInspectionSite::getId, id);
|
|
|
+// }
|
|
|
+// if (siteName != null && !"".equals(siteName)) {
|
|
|
+// queryWrapper.like(PatrolInspectionSite::getSiteName, siteName);
|
|
|
+// }
|
|
|
+// queryWrapper.orderByDesc(PatrolInspectionSite::getId);
|
|
|
+// List<PatrolInspectionSite> patrolInspectionSiteList = this.list(queryWrapper);
|
|
|
+// List<PatrolInspectionSiteExportVo> list = new ArrayList<>();
|
|
|
+// for (int i = 0; i < patrolInspectionSiteList.size(); i++) {
|
|
|
+// PatrolInspectionSiteExportVo patrolInspectionSiteExportVo = new PatrolInspectionSiteExportVo();
|
|
|
+// patrolInspectionSiteExportVo.setXh(i + 1);
|
|
|
+// patrolInspectionSiteExportVo.setSiteName(patrolInspectionSiteList.get(i).getSiteName());
|
|
|
+// patrolInspectionSiteExportVo.setSiteNubmber(patrolInspectionSiteList.get(i).getSiteNubmber());
|
|
|
+// patrolInspectionSiteExportVo.setLatitude(patrolInspectionSiteList.get(i).getLatitude());
|
|
|
+// patrolInspectionSiteExportVo.setLongitude(patrolInspectionSiteList.get(i).getLongitude());
|
|
|
+// patrolInspectionSiteExportVo.setPictureUrl(patrolInspectionSiteList.get(i).getPictureUrl());
|
|
|
+// patrolInspectionSiteExportVo.setCreateTime("1111");
|
|
|
+// list.add(patrolInspectionSiteExportVo);
|
|
|
+// }
|
|
|
+// return list;
|
|
|
+// }
|
|
|
+//
|
|
|
+//
|
|
|
+// @Override
|
|
|
+// public String correspondDeviceExport(Integer areaId, String siteName, Integer id) {
|
|
|
+// DateFormat dFormat = new SimpleDateFormat("yyyy年MM月dd日 HH时mm分ss秒");
|
|
|
+// SimpleDateFormat longSdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
+// Workbook workbook = null;
|
|
|
+// File file = null;
|
|
|
+// try {
|
|
|
+// ExportParams params = new ExportParams(null, "巡检地点列表");
|
|
|
+// workbook = ExcelExportUtil.exportBigExcel(params, PatrolInspectionSiteExportOneVo.class,
|
|
|
+// (o, i) -> {
|
|
|
+// String userType = null;
|
|
|
+// LambdaQueryWrapper<PatrolInspectionSite> queryWrapper = Wrappers.lambdaQuery();
|
|
|
+// queryWrapper.eq(PatrolInspectionSite::getEnable, 1)
|
|
|
+// .eq(PatrolInspectionSite::getTenantId, SecurityUtils.getTenantId());
|
|
|
+// if ("00".equals(userType)) {
|
|
|
+// queryWrapper.eq(PatrolInspectionSite::getCreator, SecurityUtils.getUsername());
|
|
|
+// }
|
|
|
+// if (areaId != null) {
|
|
|
+// queryWrapper.eq(PatrolInspectionSite::getAreaId, areaId);
|
|
|
+// }
|
|
|
+// if (id != null && id != 0) {
|
|
|
+// queryWrapper.eq(PatrolInspectionSite::getId, id);
|
|
|
+// }
|
|
|
+// if (siteName != null && !"".equals(siteName)) {
|
|
|
+// queryWrapper.like(PatrolInspectionSite::getSiteName, siteName);
|
|
|
+// }
|
|
|
+// queryWrapper.orderByDesc(PatrolInspectionSite::getId);
|
|
|
+// List<PatrolInspectionSite> patrolInspectionSiteList = this.list(queryWrapper);
|
|
|
+// List<PatrolInspectionSiteExportVo> list = new ArrayList<>();
|
|
|
+// for (int j = 0; j < patrolInspectionSiteList.size(); j++) {
|
|
|
+// PatrolInspectionSiteExportVo patrolInspectionSiteExportVo = new PatrolInspectionSiteExportVo();
|
|
|
+// patrolInspectionSiteExportVo.setId(patrolInspectionSiteList.get(j).getId());
|
|
|
+// patrolInspectionSiteExportVo.setXh(j + 1);
|
|
|
+// patrolInspectionSiteExportVo.setSiteName(patrolInspectionSiteList.get(j).getSiteName());
|
|
|
+// patrolInspectionSiteExportVo.setSiteNubmber(patrolInspectionSiteList.get(j).getSiteNubmber());
|
|
|
+// patrolInspectionSiteExportVo.setLatitude(patrolInspectionSiteList.get(j).getLatitude());
|
|
|
+// patrolInspectionSiteExportVo.setLongitude(patrolInspectionSiteList.get(j).getLongitude());
|
|
|
+// patrolInspectionSiteExportVo.setPictureUrl(patrolInspectionSiteList.get(j).getPictureUrl());
|
|
|
+// patrolInspectionSiteExportVo.setCreateTime("1111");
|
|
|
+// list.add(patrolInspectionSiteExportVo);
|
|
|
+// }
|
|
|
+// return new ArrayList<>(BeanMapperUtils.mapList(list, PatrolInspectionSiteExportVo.class, PatrolInspectionSiteExportOneVo.class));
|
|
|
+// }, null);
|
|
|
+// if (null != workbook) {
|
|
|
+// file = FileUtils.getFile(GlobalUtils.getTempBaseDir(), String.format("%s-%s.xlsx", "巡检地点列表", dFormat.format(System.currentTimeMillis()) + ""));
|
|
|
+// FileUtils.createFile(file.getAbsolutePath());
|
|
|
+// FileOutputStream allListingFileOutputStream = new FileOutputStream(file);
|
|
|
+// workbook.write(allListingFileOutputStream);
|
|
|
+// } else {
|
|
|
+// throw new BusinessException("表格数据为空");
|
|
|
+// }
|
|
|
+// } catch (Exception e) {
|
|
|
+// log.error("导出文件失败", e);
|
|
|
+// throw new BusinessException("导出文件失败");
|
|
|
+// } finally {
|
|
|
+// if (workbook != null) {
|
|
|
+// try {
|
|
|
+// workbook.close();
|
|
|
+// } catch (IOException e) {
|
|
|
+// log.error("===export spec=== 关闭workbook失败", e);
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+// return file.getName();
|
|
|
+// }
|
|
|
}
|