diff --git a/.idea/MyBatisCodeHelperDatasource.xml b/.idea/MyBatisCodeHelperDatasource.xml
index faa83e6..33e0be0 100644
--- a/.idea/MyBatisCodeHelperDatasource.xml
+++ b/.idea/MyBatisCodeHelperDatasource.xml
@@ -63,6 +63,43 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -77,7 +114,6 @@
-
diff --git a/.idea/dataSources.xml b/.idea/dataSources.xml
index cf16d1c..d6a35b5 100644
--- a/.idea/dataSources.xml
+++ b/.idea/dataSources.xml
@@ -8,5 +8,12 @@
jdbc:postgresql://10.0.200.170:5432/s_integrated_fixed_source?useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true&serverTimezone=Asia/Shanghai
$ProjectFileDir$
+
+ postgresql
+ true
+ org.postgresql.Driver
+ jdbc:postgresql://39.100.149.153:5432/postgres
+ $ProjectFileDir$
+
\ No newline at end of file
diff --git a/szhpt-fixed-task/src/main/java/cn/cecep/talroad/controller/callback/AmProblemFiCallbackController.java b/szhpt-fixed-task/src/main/java/cn/cecep/talroad/controller/callback/AmProblemFiCallbackController.java
index 9c84106..d8260db 100644
--- a/szhpt-fixed-task/src/main/java/cn/cecep/talroad/controller/callback/AmProblemFiCallbackController.java
+++ b/szhpt-fixed-task/src/main/java/cn/cecep/talroad/controller/callback/AmProblemFiCallbackController.java
@@ -6,7 +6,7 @@ import cn.cecep.talroad.domain.AmProblemFiProcess;
import cn.cecep.talroad.service.IAmProblemFiService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
-import org.junit.jupiter.api.Disabled;
+//import org.junit.jupiter.api.Disabled;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
@@ -37,7 +37,7 @@ public class AmProblemFiCallbackController extends BasesController {
@ApiOperation(value = "审核结果回调")
@PostMapping(value = "/audit/result")
- @Disabled
+// @Disabled
public AjaxResults auditResult(@RequestBody @Validated AmProblemFiProcess param) {
amProblemFiService.auditResult(param);
return AjaxResults.success();
diff --git a/szhpt-fixed-task/src/main/java/cn/cecep/talroad/controller/effective/ERmStationExceedController.java b/szhpt-fixed-task/src/main/java/cn/cecep/talroad/controller/effective/ERmStationExceedController.java
index 6437789..03c9cf2 100644
--- a/szhpt-fixed-task/src/main/java/cn/cecep/talroad/controller/effective/ERmStationExceedController.java
+++ b/szhpt-fixed-task/src/main/java/cn/cecep/talroad/controller/effective/ERmStationExceedController.java
@@ -14,7 +14,7 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
-import org.junit.jupiter.api.Disabled;
+//import org.junit.jupiter.api.Disabled;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.GetMapping;
@@ -51,7 +51,7 @@ public class ERmStationExceedController {
@GetMapping("/selectInfo")
@ApiOperation("查询站点信息--弃用,使用接口 POST station/detail/air/{id}")
- @Disabled("使用cn.cecep.talroad.controller.TCodStationController.airStationDetail")
+// @Disabled("使用cn.cecep.talroad.controller.TCodStationController.airStationDetail")
public AjaxResults selectInfo(@RequestParam(name = "stationCode") String stationCode) {
QueryWrapper ew = new QueryWrapper<>();
ew.eq(ERmStationHour.COL_STATION_CODE, stationCode);
diff --git a/szhpt-fixed-task/src/main/java/cn/cecep/talroad/data/analyse/task/execute/report/specifications/audit/ExcessiveEmissionsService.java b/szhpt-fixed-task/src/main/java/cn/cecep/talroad/data/analyse/task/execute/report/specifications/audit/ExcessiveEmissionsService.java
index cc864c9..e2e8520 100644
--- a/szhpt-fixed-task/src/main/java/cn/cecep/talroad/data/analyse/task/execute/report/specifications/audit/ExcessiveEmissionsService.java
+++ b/szhpt-fixed-task/src/main/java/cn/cecep/talroad/data/analyse/task/execute/report/specifications/audit/ExcessiveEmissionsService.java
@@ -1,15 +1,30 @@
package cn.cecep.talroad.data.analyse.task.execute.report.specifications.audit;
+import cn.cecep.talroad.domain.AmProblemFi;
import cn.cecep.talroad.domain.BMainActionReports;
+import cn.cecep.talroad.domain.PcOutlet;
+import cn.cecep.talroad.domain.analysis.SRaActionReportsAuditRecord;
+import cn.cecep.talroad.domain.analysis.SRaActionReportsAuditResult;
+import cn.cecep.talroad.domain.analysis.SRaSelfMonitoringData;
+import cn.cecep.talroad.enums.EmlTypeEnums;
+import cn.cecep.talroad.enums.ProblemTypeEnum;
+import cn.cecep.talroad.mapper.AmProblemFiMapper;
import cn.cecep.talroad.mapper.BMainActionReportsMapper;
+import cn.cecep.talroad.mapper.PcOutletMapper;
+import cn.cecep.talroad.mapper.analysis.SRaActionReportsAuditRecordMapper;
import cn.cecep.talroad.mapper.analysis.SRaActionReportsAuditResultMapper;
+import cn.cecep.talroad.mapper.analysis.SRaSelfMonitoringDataMapper;
+import cn.cecep.talroad.util.DateUtil;
+import cn.hutool.core.collection.CollectionUtil;
+import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
-import java.util.List;
+import java.util.*;
+import java.util.stream.Collectors;
/**
* @author hehongyu
@@ -26,6 +41,17 @@ public class ExcessiveEmissionsService {
@Autowired
private BMainActionReportsMapper actionReportsMapper;
+ @Autowired
+ private SRaSelfMonitoringDataMapper monitoringDataMapper;
+
+ @Autowired
+ private AmProblemFiMapper problemFiMapper;
+
+ @Autowired
+ private SRaActionReportsAuditRecordMapper recordMapper;
+
+ @Autowired
+ private PcOutletMapper outletMapper;
public void execute(List reportIds){
LambdaQueryWrapper queryWrapper = new QueryWrapper().lambda()
@@ -35,9 +61,75 @@ public class ExcessiveEmissionsService {
String factoryId = bMainActionReport.getFactoryId();
String reportsType = bMainActionReport.getReportsType();//EmlTypeEnums
//根据 企业id 加 报告周期 查询到对应报警信息表 是否有超标信息
-
-
+ //按照报表审核类型的时间 为 查询数据开始的时间
+ Calendar startCalendar = Calendar.getInstance();
+ Calendar endCalendar = Calendar.getInstance();
+ if (EmlTypeEnums.YEAR.getCode().equals(reportsType)) {
+ //去年 开始的数据 到今年的数据
+ startCalendar.setTime(DateUtil.parseTime(startCalendar.get(Calendar.YEAR) - 1 + "-01-01 00:00:00"));
+ endCalendar.setTime(DateUtil.parseTime(endCalendar.get(Calendar.YEAR) + "-01-01 00:00:00"));
+ }else if (EmlTypeEnums.QUARTER.getCode().equals(reportsType)) {
+ //获取上季度的数据 此处获取到当前季度开始的日期 手动去-3月 上季度结束日期 就是本季度开始
+ startCalendar.setTime(DateUtil.getQuarterStart(new Date()));
+ startCalendar.set(Calendar.MONTH,startCalendar.get(Calendar.MONTH) - 3);
+ endCalendar.setTime(DateUtil.getQuarterStart(new Date()));
+ }else if (EmlTypeEnums.MONTH.getCode().equals(reportsType)) {
+ //上月开始 到 这月结束的数据
+ startCalendar.set(Calendar.DAY_OF_MONTH,0);
+ DateUtil.setTimeZero(startCalendar);
+ endCalendar.set(Calendar.DAY_OF_MONTH,1);
+ DateUtil.setTimeZero(endCalendar);
+ startCalendar.set(Calendar.MONTH,startCalendar.get(Calendar.MONTH) - 1);
+ }
+ Date endTime = endCalendar.getTime();
+ Date startTime = startCalendar.getTime();
+ //直接查询企业下 所有超标的站点和 污染物 然后去 执行报告进行匹配
+ LambdaQueryWrapper problemFiLambdaQueryWrapper = new QueryWrapper().lambda()
+ .eq(AmProblemFi::getFactoryId, factoryId)
+ .eq(AmProblemFi::getProblemType, ProblemTypeEnum.CONCENTRATION_EXCEEDED_TYPE.getCode())
+ .between(AmProblemFi::getAnalyseTime, startTime, endTime);
+ List mAmProblemFis = problemFiMapper.selectList(problemFiLambdaQueryWrapper);
+ if (CollectionUtil.isEmpty(mAmProblemFis)){
+ log.warn("超标排放信息 无报警信息!bMainActionReport:{}", JSON.toJSONString(bMainActionReport));
+ continue;
+ }
+ for (AmProblemFi mAmProblemFi : mAmProblemFis) {
+ LambdaQueryWrapper dataLambdaQueryWrapper = new QueryWrapper().lambda()
+ .eq(SRaSelfMonitoringData::getFactoryId, mAmProblemFi.getFactoryId())
+ .eq(SRaSelfMonitoringData::getMonitorId, mAmProblemFi.getStationId())
+ //现有的报警内容中有污染物名称 直接根据污染物名称进行查询
+ .eq(SRaSelfMonitoringData::getPollutantsName, mAmProblemFi.getParamName())
+ .between(SRaSelfMonitoringData::getMonitorTime, startTime, endTime);
+ List sRaSelfMonitoringData = monitoringDataMapper.selectList(dataLambdaQueryWrapper);
+ //如果有该企业有报警信息 但是根据报警信息中的站点和污染物没有查询到实际数据 则认为是不规范
+ if (CollectionUtil.isEmpty(sRaSelfMonitoringData)){
+ //转换一下排口id 和 code 将 排口编号 输出到提示内容里面
+ PcOutlet pcOutlet = outletMapper.selectOne(new QueryWrapper().lambda().select(PcOutlet::getOutletCode).eq(PcOutlet::getId, mAmProblemFi.getStationId()));
+ //报告id 排口编号 污染物名称
+ updateReportAuditData(bMainActionReport.getId(),pcOutlet.getOutletCode(),mAmProblemFi.getParamName());
+ }
+ }
}
}
+ public void updateReportAuditData(String problemReportId,String outletCode, String pollutantsName){
+ LambdaQueryWrapper recordQueryWrapper = new QueryWrapper()
+ .lambda()
+ .select(SRaActionReportsAuditRecord::getId,SRaActionReportsAuditRecord::getReportId)
+ .eq(SRaActionReportsAuditRecord::getReportId, problemReportId);
+ List sRaActionReportsAuditRecords = recordMapper.selectList(recordQueryWrapper);
+ if (CollectionUtil.isEmpty(sRaActionReportsAuditRecords)){
+ log.warn("执行报告审核记录不存在!");
+ return;
+ }
+ List recordIds = sRaActionReportsAuditRecords.stream().map(SRaActionReportsAuditRecord::getId).collect(Collectors.toList());
+ LambdaQueryWrapper queryWrapper = new QueryWrapper().lambda().in(SRaActionReportsAuditResult::getRecordId, recordIds);
+ List sRaActionReportsAuditResults = mapper.selectList(queryWrapper);
+ if (CollectionUtil.isEmpty(sRaActionReportsAuditResults)){
+ log.warn("执行报告规范性审核结果记录不存在!");
+ return;
+ }
+ sRaActionReportsAuditResults.forEach(data -> data.setAttachment("“"+outletCode+"”“"+pollutantsName+"”在执行周期内有超标排放信息,但是此表未填报。"));
+ mapper.batchUpdate(sRaActionReportsAuditResults);
+ }
}
diff --git a/szhpt-fixed-task/src/main/java/cn/cecep/talroad/data/analyse/task/execute/report/specifications/audit/LedgerManagementStatusTableService.java b/szhpt-fixed-task/src/main/java/cn/cecep/talroad/data/analyse/task/execute/report/specifications/audit/LedgerManagementStatusTableService.java
index 84adf4c..f588c1b 100644
--- a/szhpt-fixed-task/src/main/java/cn/cecep/talroad/data/analyse/task/execute/report/specifications/audit/LedgerManagementStatusTableService.java
+++ b/szhpt-fixed-task/src/main/java/cn/cecep/talroad/data/analyse/task/execute/report/specifications/audit/LedgerManagementStatusTableService.java
@@ -1,9 +1,21 @@
package cn.cecep.talroad.data.analyse.task.execute.report.specifications.audit;
+import cn.cecep.talroad.domain.OdsPermissionSharereportledgerinfoLedgerinfoA;
+import cn.cecep.talroad.domain.analysis.SRaActionReportsAuditRecord;
+import cn.cecep.talroad.domain.analysis.SRaActionReportsAuditResult;
+import cn.cecep.talroad.mapper.OdsPermissionSharereportledgerinfoLedgerinfoAMapper;
+import cn.cecep.talroad.mapper.analysis.SRaActionReportsAuditRecordMapper;
+import cn.cecep.talroad.mapper.analysis.SRaActionReportsAuditResultMapper;
+import cn.hutool.core.collection.CollectionUtil;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
/**
* @author hehongyu
@@ -13,9 +25,51 @@ import java.util.List;
@Slf4j
@Service
public class LedgerManagementStatusTableService {
+ @Autowired
+ private SRaActionReportsAuditResultMapper mapper;
+ @Autowired
+ private SRaActionReportsAuditRecordMapper recordMapper;
+
+ @Autowired
+ private OdsPermissionSharereportledgerinfoLedgerinfoAMapper sharereportattachmentAMapper;
public void execute(List reportIds){
+ LambdaQueryWrapper recordQueryWrapper = new QueryWrapper()
+ .lambda()
+ .select(SRaActionReportsAuditRecord::getId,SRaActionReportsAuditRecord::getReportId)
+ .in(SRaActionReportsAuditRecord::getReportId, reportIds);
+ List sRaActionReportsAuditRecords = recordMapper.selectList(recordQueryWrapper);
+ if (CollectionUtil.isEmpty(sRaActionReportsAuditRecords)){
+ log.warn("执行报告审核记录不存在!");
+ return;
+ }
+ //报告id 和 报告记录id映射
+ Map reportIdMap = sRaActionReportsAuditRecords.stream().collect(Collectors.toMap(SRaActionReportsAuditRecord::getId, SRaActionReportsAuditRecord::getReportId));
+ List recordIds = sRaActionReportsAuditRecords.stream().map(SRaActionReportsAuditRecord::getId).collect(Collectors.toList());
+ LambdaQueryWrapper queryWrapper = new QueryWrapper().lambda().in(SRaActionReportsAuditResult::getRecordId, recordIds);
+ List sRaActionReportsAuditResults = mapper.selectList(queryWrapper);
+ if (CollectionUtil.isEmpty(sRaActionReportsAuditResults)){
+ log.warn("执行报告规范性审核结果记录不存在!");
+ return;
+ }
+ //未填“是否完整”则不完整
+ LambdaQueryWrapper fileQueryWrapper = new QueryWrapper()
+ .lambda().in(OdsPermissionSharereportledgerinfoLedgerinfoA::getReportid, reportIds);
+ List odsPermissionSharereportattachmentAS = sharereportattachmentAMapper.selectList(fileQueryWrapper);
+ //过滤未填“是否完整”则不完整 报表id
+ List notFileReportIds = odsPermissionSharereportattachmentAS.stream()
+ .filter(data -> !"Y".equals(data.getWhethercomplete()))
+ .map(OdsPermissionSharereportledgerinfoLedgerinfoA::getReportid)
+ .collect(Collectors.toList());
+ sRaActionReportsAuditResults.stream().filter(data -> {
+ String reportId = reportIdMap.get(data.getRecordId());
+ if (reportId == null){
+ return false;
+ }
+ return notFileReportIds.contains(reportId);
+ }).forEach(data -> data.setAttachment("台账管理情况表填报不完整"));
+ mapper.batchUpdate(sRaActionReportsAuditResults);
}
}
diff --git a/szhpt-fixed-task/src/main/java/cn/cecep/talroad/data/analyse/task/execute/report/specifications/audit/PollutantEmissionsCalculationProcessService.java b/szhpt-fixed-task/src/main/java/cn/cecep/talroad/data/analyse/task/execute/report/specifications/audit/PollutantEmissionsCalculationProcessService.java
index ca74a38..554a731 100644
--- a/szhpt-fixed-task/src/main/java/cn/cecep/talroad/data/analyse/task/execute/report/specifications/audit/PollutantEmissionsCalculationProcessService.java
+++ b/szhpt-fixed-task/src/main/java/cn/cecep/talroad/data/analyse/task/execute/report/specifications/audit/PollutantEmissionsCalculationProcessService.java
@@ -1,9 +1,22 @@
package cn.cecep.talroad.data.analyse.task.execute.report.specifications.audit;
+import cn.cecep.talroad.domain.OdsPermissionSharereportattachmentA;
+import cn.cecep.talroad.domain.analysis.SRaActionReportsAuditRecord;
+import cn.cecep.talroad.domain.analysis.SRaActionReportsAuditResult;
+import cn.cecep.talroad.mapper.OdsPermissionSharereportattachmentAMapper;
+import cn.cecep.talroad.mapper.analysis.SRaActionReportsAuditRecordMapper;
+import cn.cecep.talroad.mapper.analysis.SRaActionReportsAuditResultMapper;
+import cn.hutool.core.collection.CollectionUtil;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
/**
* @author hehongyu
@@ -14,8 +27,54 @@ import java.util.List;
@Service
public class PollutantEmissionsCalculationProcessService {
- public void execute(List reportIds){
+ @Autowired
+ private SRaActionReportsAuditResultMapper mapper;
+
+ @Autowired
+ private SRaActionReportsAuditRecordMapper recordMapper;
+
+ @Autowired
+ private OdsPermissionSharereportattachmentAMapper sharereportattachmentAMapper;
+
+ public void execute(List reportIds){
+ LambdaQueryWrapper recordQueryWrapper = new QueryWrapper()
+ .lambda()
+ .select(SRaActionReportsAuditRecord::getId,SRaActionReportsAuditRecord::getReportId)
+ .in(SRaActionReportsAuditRecord::getReportId, reportIds);
+ List sRaActionReportsAuditRecords = recordMapper.selectList(recordQueryWrapper);
+ if (CollectionUtil.isEmpty(sRaActionReportsAuditRecords)){
+ log.warn("执行报告审核记录不存在!");
+ return;
+ }
+ //报告id 和 报告记录id映射
+ Map reportIdMap = sRaActionReportsAuditRecords.stream().collect(Collectors.toMap(SRaActionReportsAuditRecord::getId, SRaActionReportsAuditRecord::getReportId));
+
+ List recordIds = sRaActionReportsAuditRecords.stream().map(SRaActionReportsAuditRecord::getId).collect(Collectors.toList());
+ LambdaQueryWrapper queryWrapper = new QueryWrapper().lambda().in(SRaActionReportsAuditResult::getRecordId, recordIds);
+ List sRaActionReportsAuditResults = mapper.selectList(queryWrapper);
+ if (CollectionUtil.isEmpty(sRaActionReportsAuditResults)){
+ log.warn("执行报告规范性审核结果记录不存在!");
+ return;
+ }
+ //污染物实际排放计算过程 未上传 则为不规范
+ LambdaQueryWrapper fileQueryWrapper = new QueryWrapper()
+ .lambda().in(OdsPermissionSharereportattachmentA::getReportid, reportIds)
+ .like(OdsPermissionSharereportattachmentA::getFilename,"实际排放计算过程");
+ List odsPermissionSharereportattachmentAS = sharereportattachmentAMapper.selectList(fileQueryWrapper);
+ //过滤没有附件的 报表id
+ List notFileReportIds = odsPermissionSharereportattachmentAS.stream().filter(data -> StringUtils.isBlank(data.getFastdfsid()))
+ .map(OdsPermissionSharereportattachmentA::getReportid)
+ .collect(Collectors.toList());
+ sRaActionReportsAuditResults
+ .stream().filter(data -> {
+ String reportId = reportIdMap.get(data.getRecordId());
+ if (reportId == null){
+ return false;
+ }
+ return notFileReportIds.contains(reportId);
+ }).forEach(data -> data.setAttachment("未上报自行监测布点图"));
+ mapper.batchUpdate(sRaActionReportsAuditResults);
}
}
diff --git a/szhpt-fixed-task/src/main/java/cn/cecep/talroad/data/analyse/task/execute/report/specifications/audit/SelfMonitoringLayoutMapService.java b/szhpt-fixed-task/src/main/java/cn/cecep/talroad/data/analyse/task/execute/report/specifications/audit/SelfMonitoringLayoutMapService.java
index 7e4dd50..2fac9dc 100644
--- a/szhpt-fixed-task/src/main/java/cn/cecep/talroad/data/analyse/task/execute/report/specifications/audit/SelfMonitoringLayoutMapService.java
+++ b/szhpt-fixed-task/src/main/java/cn/cecep/talroad/data/analyse/task/execute/report/specifications/audit/SelfMonitoringLayoutMapService.java
@@ -1,7 +1,9 @@
package cn.cecep.talroad.data.analyse.task.execute.report.specifications.audit;
+import cn.cecep.talroad.domain.OdsPermissionSharereportattachmentA;
import cn.cecep.talroad.domain.analysis.SRaActionReportsAuditRecord;
import cn.cecep.talroad.domain.analysis.SRaActionReportsAuditResult;
+import cn.cecep.talroad.mapper.OdsPermissionSharereportattachmentAMapper;
import cn.cecep.talroad.mapper.analysis.SRaActionReportsAuditRecordMapper;
import cn.cecep.talroad.mapper.analysis.SRaActionReportsAuditResultMapper;
import cn.hutool.core.collection.CollectionUtil;
@@ -13,6 +15,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
+import java.util.Map;
import java.util.stream.Collectors;
/**
@@ -30,6 +33,9 @@ public class SelfMonitoringLayoutMapService {
@Autowired
private SRaActionReportsAuditRecordMapper recordMapper;
+ @Autowired
+ private OdsPermissionSharereportattachmentAMapper sharereportattachmentAMapper;
+
public void execute(List reportIds){
LambdaQueryWrapper recordQueryWrapper = new QueryWrapper()
.lambda()
@@ -40,6 +46,9 @@ public class SelfMonitoringLayoutMapService {
log.warn("执行报告审核记录不存在!");
return;
}
+ //报告id 和 报告记录id映射
+ Map reportIdMap = sRaActionReportsAuditRecords.stream().collect(Collectors.toMap(SRaActionReportsAuditRecord::getId, SRaActionReportsAuditRecord::getReportId));
+
List recordIds = sRaActionReportsAuditRecords.stream().map(SRaActionReportsAuditRecord::getId).collect(Collectors.toList());
LambdaQueryWrapper queryWrapper = new QueryWrapper().lambda().in(SRaActionReportsAuditResult::getRecordId, recordIds);
List sRaActionReportsAuditResults = mapper.selectList(queryWrapper);
@@ -47,10 +56,24 @@ public class SelfMonitoringLayoutMapService {
log.warn("执行报告规范性审核结果记录不存在!");
return;
}
- //TODO 自行监测布点图 未上传 则为不规范
- List updateList = sRaActionReportsAuditResults.stream().filter(data -> StringUtils.isBlank(data.getAttachment())).collect(Collectors.toList());
- updateList.forEach(data -> data.setAttachment("未上报自行监测布点图"));
- mapper.batchUpdate(updateList);
+ //自行监测布点图 未上传 则为不规范
+ LambdaQueryWrapper fileQueryWrapper = new QueryWrapper()
+ .lambda().in(OdsPermissionSharereportattachmentA::getReportid, reportIds)
+ .eq(OdsPermissionSharereportattachmentA::getFiletype,"file3");
+ List odsPermissionSharereportattachmentAS = sharereportattachmentAMapper.selectList(fileQueryWrapper);
+ //过滤没有附件的 报表id
+ List notFileReportIds = odsPermissionSharereportattachmentAS.stream().filter(data -> StringUtils.isBlank(data.getFastdfsid()))
+ .map(OdsPermissionSharereportattachmentA::getReportid)
+ .collect(Collectors.toList());
+ sRaActionReportsAuditResults
+ .stream().filter(data -> {
+ String reportId = reportIdMap.get(data.getRecordId());
+ if (reportId == null){
+ return false;
+ }
+ return notFileReportIds.contains(reportId);
+ }).forEach(data -> data.setAttachment("未上报自行监测布点图"));
+ mapper.batchUpdate(sRaActionReportsAuditResults);
}
}
diff --git a/szhpt-fixed-task/src/main/java/cn/cecep/talroad/domain/OdsPermissionSharereportattachmentA.java b/szhpt-fixed-task/src/main/java/cn/cecep/talroad/domain/OdsPermissionSharereportattachmentA.java
new file mode 100644
index 0000000..f4d2772
--- /dev/null
+++ b/szhpt-fixed-task/src/main/java/cn/cecep/talroad/domain/OdsPermissionSharereportattachmentA.java
@@ -0,0 +1,46 @@
+package cn.cecep.talroad.domain;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+
+ /**
+ * @description: TODO
+ * @author hehongyu
+ * @date 2023/8/12 18:33
+ */
+/**
+ * 执行报告-获取附件信息
+ */
+@ApiModel(description="执行报告-获取附件信息")
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class OdsPermissionSharereportattachmentA implements Serializable {
+ @ApiModelProperty(value="")
+ private Long reportid;
+
+ @ApiModelProperty(value="")
+ private Long fileid;
+
+ @ApiModelProperty(value="")
+ private String filename;
+
+ @ApiModelProperty(value="")
+ private String filesize;
+
+ @ApiModelProperty(value="")
+ private String filetype;
+
+ @ApiModelProperty(value="")
+ private String remark;
+
+ @ApiModelProperty(value="")
+ private String fastdfsid;
+
+ private static final long serialVersionUID = 1L;
+}
\ No newline at end of file
diff --git a/szhpt-fixed-task/src/main/java/cn/cecep/talroad/domain/OdsPermissionSharereportledgerinfoLedgerinfoA.java b/szhpt-fixed-task/src/main/java/cn/cecep/talroad/domain/OdsPermissionSharereportledgerinfoLedgerinfoA.java
new file mode 100644
index 0000000..8646894
--- /dev/null
+++ b/szhpt-fixed-task/src/main/java/cn/cecep/talroad/domain/OdsPermissionSharereportledgerinfoLedgerinfoA.java
@@ -0,0 +1,43 @@
+package cn.cecep.talroad.domain;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+
+ /**
+ * @description: TODO
+ * @author hehongyu
+ * @date 2023/8/12 18:34
+ */
+/**
+ * 执行报告-台账管理情况
+ */
+@ApiModel(description="执行报告-台账管理情况")
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class OdsPermissionSharereportledgerinfoLedgerinfoA implements Serializable {
+ @ApiModelProperty(value="")
+ private String reportid;
+
+ @ApiModelProperty(value="")
+ private String summary;
+
+ @ApiModelProperty(value="")
+ private String ledgerrecordname;
+
+ @ApiModelProperty(value="")
+ private String whethercomplete;
+
+ @ApiModelProperty(value="")
+ private String description;
+
+ @ApiModelProperty(value="")
+ private String reporttime;
+
+ private static final long serialVersionUID = 1L;
+}
\ No newline at end of file
diff --git a/szhpt-fixed-task/src/main/java/cn/cecep/talroad/enums/EmlTypeEnums.java b/szhpt-fixed-task/src/main/java/cn/cecep/talroad/enums/EmlTypeEnums.java
index f280100..62727e1 100644
--- a/szhpt-fixed-task/src/main/java/cn/cecep/talroad/enums/EmlTypeEnums.java
+++ b/szhpt-fixed-task/src/main/java/cn/cecep/talroad/enums/EmlTypeEnums.java
@@ -22,4 +22,13 @@ public enum EmlTypeEnums {
private final String code;
private final String name;
private final String simple;
+
+ public static EmlTypeEnums getEnumByCode(String type){
+ for (EmlTypeEnums value : values()) {
+ if (value.getCode().equals(type)){
+ return value;
+ }
+ }
+ return null;
+ }
}
diff --git a/szhpt-fixed-task/src/main/java/cn/cecep/talroad/enums/LabelFactoryEnum.java b/szhpt-fixed-task/src/main/java/cn/cecep/talroad/enums/LabelFactoryEnum.java
index 3b187ee..e54ae6c 100644
--- a/szhpt-fixed-task/src/main/java/cn/cecep/talroad/enums/LabelFactoryEnum.java
+++ b/szhpt-fixed-task/src/main/java/cn/cecep/talroad/enums/LabelFactoryEnum.java
@@ -75,6 +75,15 @@ public enum LabelFactoryEnum {
this.enumName=enumName;
}
+ public static LabelFactoryEnum getByCode(String code) {
+ for (LabelFactoryEnum value : values()) {
+ if (value.enumId.equals(code)) {
+ return value;
+ }
+ }
+ return null;
+ }
+
public String getEnumId() {
return enumId;
}
@@ -84,19 +93,19 @@ public enum LabelFactoryEnum {
}
public PcLabelFactory pcLabelFactory(String id, Map pcLabelsMap, String value, String useing, PcLabelFactory pcLabelFactory){
- pcLabelFactory=new PcLabelFactory();
- pcLabelFactory.setFactoryId(id);
- pcLabelFactory.setLabelId(pcLabelsMap.get(enumId).getId());
- pcLabelFactory.setLabelValue(value);
- pcLabelFactory.setLableUseing(useing);
+ pcLabelFactory=new PcLabelFactory();
+ pcLabelFactory.setFactoryId(id);
+ pcLabelFactory.setLabelId(pcLabelsMap.get(enumId).getId());
+ pcLabelFactory.setLabelValue(value);
+ pcLabelFactory.setLableUseing(useing);
return pcLabelFactory;
}
public PcLabelFactory pcLabelFactoryPollutant(String id, Map pcLabelsMap, String value, String useing, PcLabelFactory pcLabelFactory){
- pcLabelFactory=new PcLabelFactory();
- pcLabelFactory.setFactoryId(id);
- pcLabelFactory.setLabelId(pcLabelsMap.get(enumId).getId());
- pcLabelFactory.setLabelValue(value);
- pcLabelFactory.setLableUseing(useing);
+ pcLabelFactory=new PcLabelFactory();
+ pcLabelFactory.setFactoryId(id);
+ pcLabelFactory.setLabelId(pcLabelsMap.get(enumId).getId());
+ pcLabelFactory.setLabelValue(value);
+ pcLabelFactory.setLableUseing(useing);
return pcLabelFactory;
}
diff --git a/szhpt-fixed-task/src/main/java/cn/cecep/talroad/enums/ProblemTypeEnum.java b/szhpt-fixed-task/src/main/java/cn/cecep/talroad/enums/ProblemTypeEnum.java
index ac8ce23..dbc5e4e 100644
--- a/szhpt-fixed-task/src/main/java/cn/cecep/talroad/enums/ProblemTypeEnum.java
+++ b/szhpt-fixed-task/src/main/java/cn/cecep/talroad/enums/ProblemTypeEnum.java
@@ -30,6 +30,7 @@ public enum ProblemTypeEnum {
//TODO 待确认该枚举是否正确
POLLUTION_CONTROL_EXCEEDED("0040020112","污染源管控超标"),
FREQUENCY_MEASUREMENT("006005","手工监测频次不满足许可证要求"),
+ CONCENTRATION_EXCEEDED_TYPE("003002","浓度超标类型"),
;
diff --git a/szhpt-fixed-task/src/main/java/cn/cecep/talroad/mapper/OdsPermissionSharereportattachmentAMapper.java b/szhpt-fixed-task/src/main/java/cn/cecep/talroad/mapper/OdsPermissionSharereportattachmentAMapper.java
new file mode 100644
index 0000000..7b701a2
--- /dev/null
+++ b/szhpt-fixed-task/src/main/java/cn/cecep/talroad/mapper/OdsPermissionSharereportattachmentAMapper.java
@@ -0,0 +1,14 @@
+package cn.cecep.talroad.mapper;
+
+import cn.cecep.talroad.domain.OdsPermissionSharereportattachmentA;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+
+ /**
+ * @description: TODO
+ * @author hehongyu
+ * @date 2023/8/12 18:33
+ */
+@Mapper
+public interface OdsPermissionSharereportattachmentAMapper extends BaseMapper {
+}
\ No newline at end of file
diff --git a/szhpt-fixed-task/src/main/java/cn/cecep/talroad/mapper/OdsPermissionSharereportledgerinfoLedgerinfoAMapper.java b/szhpt-fixed-task/src/main/java/cn/cecep/talroad/mapper/OdsPermissionSharereportledgerinfoLedgerinfoAMapper.java
new file mode 100644
index 0000000..08c803e
--- /dev/null
+++ b/szhpt-fixed-task/src/main/java/cn/cecep/talroad/mapper/OdsPermissionSharereportledgerinfoLedgerinfoAMapper.java
@@ -0,0 +1,14 @@
+package cn.cecep.talroad.mapper;
+
+import cn.cecep.talroad.domain.OdsPermissionSharereportledgerinfoLedgerinfoA;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+
+ /**
+ * @description: TODO
+ * @author hehongyu
+ * @date 2023/8/12 18:34
+ */
+@Mapper
+public interface OdsPermissionSharereportledgerinfoLedgerinfoAMapper extends BaseMapper {
+}
\ No newline at end of file
diff --git a/szhpt-fixed-task/src/main/java/cn/cecep/talroad/service/impl/AppVersionAddressManagementServiceImpl.java b/szhpt-fixed-task/src/main/java/cn/cecep/talroad/service/impl/AppVersionAddressManagementServiceImpl.java
index 83c4b96..768488f 100644
--- a/szhpt-fixed-task/src/main/java/cn/cecep/talroad/service/impl/AppVersionAddressManagementServiceImpl.java
+++ b/szhpt-fixed-task/src/main/java/cn/cecep/talroad/service/impl/AppVersionAddressManagementServiceImpl.java
@@ -4,13 +4,9 @@ import cn.cecep.talroad.common.core.utils.StringUtils;
import cn.cecep.talroad.domain.AppVersionAddressManagement;
import cn.cecep.talroad.mapper.AppVersionAddressManagementMapper;
import cn.cecep.talroad.service.IAppVersionAddressManagementService;
-import cn.cecep.talroad.util.QrCodeUtils;
-import cn.hutool.core.io.FileUtil;
import cn.hutool.core.util.ObjectUtil;
-import cn.hutool.core.util.StrUtil;
-import org.springframework.stereotype.Service;
-
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
/**
* @Description: app版本管理表
@@ -58,8 +54,8 @@ public class AppVersionAddressManagementServiceImpl extends ServiceImpl 0) {
// 查询设备类型的参数配置
deviceList.forEach(d -> {
- msgProducer.sendYieldStatisticMsg(UUID.randomUUID().toString(),d.getDeviceId());
+// msgProducer.sendYieldStatisticMsg(UUID.randomUUID().toString(),d.getDeviceId());
});
}
}
diff --git a/szhpt-fixed-task/src/main/java/cn/cecep/talroad/util/DateUtil.java b/szhpt-fixed-task/src/main/java/cn/cecep/talroad/util/DateUtil.java
index 540783b..e814aa6 100644
--- a/szhpt-fixed-task/src/main/java/cn/cecep/talroad/util/DateUtil.java
+++ b/szhpt-fixed-task/src/main/java/cn/cecep/talroad/util/DateUtil.java
@@ -1,6 +1,7 @@
package cn.cecep.talroad.util;
+import cn.cecep.talroad.enums.EmlTypeEnums;
import com.alibaba.nacos.common.utils.DateFormatUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.time.DateUtils;
@@ -870,4 +871,52 @@ public class DateUtil {
}
return dayAgo;
}
+
+ /**
+ * 获取日期所对的季度开始日期
+ * @param date
+ * @return
+ */
+ public static Date getQuarterStart(Date date) {
+ Calendar calendar = Calendar.getInstance();
+ calendar.setTime(date);
+ int month = calendar.get(Calendar.MONTH) + 1;
+ int quarter = (month - 1) / 3 + 1;
+ int year = calendar.get(Calendar.YEAR);
+ int quarterStartMonth = (quarter - 1) * 3 + 1;
+ int quarterEndMonth = quarter * 3 + 1;
+ Calendar quarterStart = Calendar.getInstance();
+ quarterStart.set(year, quarterStartMonth - 1, 1);
+ return quarterStart.getTime();
+ }
+ /**
+ * 获取日期所对的季度结束日期
+ * @param date
+ * @return
+ */
+ public static Date getQuarterEnd(Date date){
+ Calendar calendar = Calendar.getInstance();
+ calendar.setTime(date);
+ int month = calendar.get(Calendar.MONTH) + 1;
+ int quarter = (month - 1) / 3 + 1;
+ int year = calendar.get(Calendar.YEAR);
+ int quarterStartMonth = (quarter - 1) * 3 + 1;
+ int quarterEndMonth = quarter * 3 + 1;
+ Calendar quarterEnd = Calendar.getInstance();
+ quarterEnd.set(year, quarterEndMonth - 2, 1);
+ quarterEnd.add(Calendar.DATE, -1);
+ return quarterEnd.getTime();
+ }
+
+ /**
+ * 时间至0
+ */
+ public static Calendar setTimeZero(Calendar calendar){
+ calendar.set(Calendar.HOUR_OF_DAY,0);
+ calendar.set(Calendar.MILLISECOND,0);
+ calendar.set(Calendar.MINUTE,0);
+ calendar.set(Calendar.SECOND,0);
+ return calendar;
+ }
+
}
diff --git a/szhpt-fixed-task/src/main/java/cn/cecep/talroad/util/MsgProducer.java b/szhpt-fixed-task/src/main/java/cn/cecep/talroad/util/MsgProducer.java
index b996f8e..b2c2b72 100644
--- a/szhpt-fixed-task/src/main/java/cn/cecep/talroad/util/MsgProducer.java
+++ b/szhpt-fixed-task/src/main/java/cn/cecep/talroad/util/MsgProducer.java
@@ -1,53 +1,53 @@
-package cn.cecep.talroad.util;
-
-import cn.cecep.talroad.config.ExchangeConfig;
-import cn.cecep.talroad.config.RabbitmqConfig;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.amqp.rabbit.connection.CorrelationData;
-import org.springframework.amqp.rabbit.core.RabbitTemplate;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Component;
-
-/**
- * @Auther: cjh
- * @Date: 2022-05-07 15:27
- * @Class: MsgProducer
- * @Deseription:
- * @Version V1.0
- */
-@Slf4j
-@Component
-public class MsgProducer implements RabbitTemplate.ConfirmCallback {
-
-
- @Autowired
- private RabbitTemplate rabbitTemplate;
-
- /**
- * 发送消息-定时判断设备停限产状态
- *
- * @param uuid
- * @param message 消息
- */
- public void sendStatusMsg(String uuid, Object message) {
- rabbitTemplate.setConfirmCallback(this);
- CorrelationData correlationId = new CorrelationData(uuid);
- rabbitTemplate.convertAndSend(ExchangeConfig.DIRECT_EXCHANGE, RabbitmqConfig.ROUTE_KEY_STATUS,message, correlationId);
- }
-
- /**
- * 发送探查消息
- * @param uuid
- * @param message
- */
- public void sendYieldStatisticMsg(String uuid, Object message) {
- rabbitTemplate.setConfirmCallback(this);
- CorrelationData correlationId = new CorrelationData(uuid);
- rabbitTemplate.convertAndSend(ExchangeConfig.DIRECT_EXCHANGE, RabbitmqConfig.ROUTE_KEY_YIELD,message, correlationId);
- }
-
- @Override
- public void confirm(CorrelationData correlationData, boolean b, String s) {
- log.info("消息推送交换机状态{},消息ID{}",b,correlationData.getId());
- }
-}
+//package cn.cecep.talroad.util;
+//
+//import cn.cecep.talroad.config.ExchangeConfig;
+//import cn.cecep.talroad.config.RabbitmqConfig;
+//import lombok.extern.slf4j.Slf4j;
+//import org.springframework.amqp.rabbit.connection.CorrelationData;
+//import org.springframework.amqp.rabbit.core.RabbitTemplate;
+//import org.springframework.beans.factory.annotation.Autowired;
+//import org.springframework.stereotype.Component;
+//
+///**
+// * @Auther: cjh
+// * @Date: 2022-05-07 15:27
+// * @Class: MsgProducer
+// * @Deseription:
+// * @Version V1.0
+// */
+//@Slf4j
+//@Component
+//public class MsgProducer implements RabbitTemplate.ConfirmCallback {
+//
+//
+// @Autowired
+// private RabbitTemplate rabbitTemplate;
+//
+// /**
+// * 发送消息-定时判断设备停限产状态
+// *
+// * @param uuid
+// * @param message 消息
+// */
+// public void sendStatusMsg(String uuid, Object message) {
+// rabbitTemplate.setConfirmCallback(this);
+// CorrelationData correlationId = new CorrelationData(uuid);
+// rabbitTemplate.convertAndSend(ExchangeConfig.DIRECT_EXCHANGE, RabbitmqConfig.ROUTE_KEY_STATUS,message, correlationId);
+// }
+//
+// /**
+// * 发送探查消息
+// * @param uuid
+// * @param message
+// */
+// public void sendYieldStatisticMsg(String uuid, Object message) {
+// rabbitTemplate.setConfirmCallback(this);
+// CorrelationData correlationId = new CorrelationData(uuid);
+// rabbitTemplate.convertAndSend(ExchangeConfig.DIRECT_EXCHANGE, RabbitmqConfig.ROUTE_KEY_YIELD,message, correlationId);
+// }
+//
+// @Override
+// public void confirm(CorrelationData correlationData, boolean b, String s) {
+// log.info("消息推送交换机状态{},消息ID{}",b,correlationData.getId());
+// }
+//}
diff --git a/szhpt-fixed-task/src/main/java/cn/cecep/talroad/util/QrCodeUtils.java b/szhpt-fixed-task/src/main/java/cn/cecep/talroad/util/QrCodeUtils.java
index a898f5c..2380e1f 100644
--- a/szhpt-fixed-task/src/main/java/cn/cecep/talroad/util/QrCodeUtils.java
+++ b/szhpt-fixed-task/src/main/java/cn/cecep/talroad/util/QrCodeUtils.java
@@ -1,229 +1,229 @@
-package cn.cecep.talroad.util;
-
-import com.google.zxing.BarcodeFormat;
-import com.google.zxing.EncodeHintType;
-import com.google.zxing.MultiFormatWriter;
-import com.google.zxing.WriterException;
-import com.google.zxing.common.BitMatrix;
-import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel;
-import org.springframework.web.client.RestTemplate;
-
-import javax.imageio.ImageIO;
-import java.awt.*;
-import java.awt.geom.RoundRectangle2D;
-import java.awt.image.BufferedImage;
-import java.io.ByteArrayOutputStream;
-import java.io.File;
-import java.util.*;
-
-/**
- * @Description:二维码工具类
- * @PACKAGE_NAME: cn.cecep.talroad.utils
- * @date 2021-12-21 11:10*/
-public class QrCodeUtils {
-
- private static final int BLACK = 0xFF000000;
- private static final int WHITE = 0xFFFFFFFF;
- private static final String CHARSET = "utf-8";
- private static final String FORMAT_NAME = "JPG";
- // 二维码尺寸
- private static final int QRCODE_SIZE = 300;
- // LOGO宽度
- private static final int WIDTH = 60;
- // LOGO高度
- private static final int HEIGHT = 60;
-
- private static RestTemplate restTemplate = new RestTemplate();
-
-
- /**
- * 生成二维码
- * 经过base64编码
- *
- * @param url
- * @return
- */
- public static BufferedImage createQrCode(String url) throws WriterException {
- Map hints = new HashMap(4);
- hints.put(EncodeHintType.CHARACTER_SET, "UTF-8");
- BitMatrix bitMatrix = new MultiFormatWriter().encode(url, BarcodeFormat.QR_CODE, 500, 500, hints);
-
- return toBufferedImage(bitMatrix);
- }
-
- /**
- * 生成二维码
- * 经过base64编码
- *
- * @param url
- * @return
- */
- public static String createQrCodeBase64(String url) {
- String base64String = "";
- try {
- Map hints = new HashMap(4);
- hints.put(EncodeHintType.CHARACTER_SET, "UTF-8");
- BitMatrix bitMatrix = new MultiFormatWriter().encode(url, BarcodeFormat.QR_CODE, 400, 400, hints);
- ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
-
- BufferedImage bufferedImage = toBufferedImage(bitMatrix);
- ImageIO.write(bufferedImage, "jpg", outputStream);
- Base64.Encoder encoder = Base64.getEncoder();
- base64String = encoder.encodeToString(outputStream.toByteArray());
- } catch (Exception e) {
- e.printStackTrace();
- }
- //return "data:image/jpg;base64," + base64String;
- return base64String;
- }
-
- private static BufferedImage toBufferedImage(BitMatrix matrix) {
- int width = matrix.getWidth();
- int height = matrix.getHeight();
- BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
- for (int x = 0; x < width; x++) {
- for (int y = 0; y < height; y++) {
- image.setRGB(x, y, matrix.get(x, y) ? BLACK : WHITE);
- }
- }
- return image;
- }
-
- /**
- * 生成二维码(内嵌LOGO)
- * author zhangpeizhi
- * @param content 内容
- * @param logoFile LOGO文件
- * @param needCompress 是否压缩LOGO
- * @throws Exception
- */
- public static String createQrCodeBase64Encode(String content, File logoFile,
- boolean needCompress) throws Exception {
- BufferedImage image = createImage(content, logoFile,
- needCompress);
-
- ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
-
- ImageIO.write(image, "jpg", outputStream);
- Base64.Encoder encoder = Base64.getEncoder();
- String base64String = encoder.encodeToString(outputStream.toByteArray());
-
- return base64String;
- }
-
-
- /**
- * 生成二维码(内嵌LOGO)
- *
- * @param content 内容
- * @param logoFile LOGO文件
- * @param destPath 存放目录
- * @param needCompress 是否压缩LOGO
- * @throws Exception
- */
- public static String encode(String content, File logoFile, String destPath,
- boolean needCompress) throws Exception {
- BufferedImage image = createImage(content, logoFile,
- needCompress);
- mkdirs(destPath);
- String file = new Random().nextInt(99999999) + ".jpg";
- ImageIO.write(image, FORMAT_NAME, new File(destPath + "/" + file));
- return file;
- }
-
- private static BufferedImage createImage(String content, File logoFile,
- boolean needCompress) throws Exception {
- Hashtable hints = new Hashtable();
- hints.put(EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel.H);
- hints.put(EncodeHintType.CHARACTER_SET, CHARSET);
- hints.put(EncodeHintType.MARGIN, 1);
- BitMatrix bitMatrix = new MultiFormatWriter().encode(content,
- BarcodeFormat.QR_CODE, QRCODE_SIZE, QRCODE_SIZE, hints);
- int width = bitMatrix.getWidth();
- int height = bitMatrix.getHeight();
- BufferedImage image = new BufferedImage(width, height,
- BufferedImage.TYPE_INT_RGB);
- for (int x = 0; x < width; x++) {
- for (int y = 0; y < height; y++) {
- image.setRGB(x, y, bitMatrix.get(x, y) ? 0xFF000000
- : 0xFFFFFFFF);
- }
- }
- if (CmUtil.isEmpty(logoFile)) {
- return image;
- }
- // 插入图片
- insertImage(image, logoFile, needCompress);
- return image;
- }
-
- /**
- * 当文件夹不存在时,mkdirs会自动创建多层目录,区别于mkdir.(mkdir如果父目录不存在则会抛出异常)
- *
- * @param destPath 存放目录
- * @date 2013-12-11 上午10:16:36
- */
- public static void mkdirs(String destPath) {
- File file = new File(destPath);
- //当文件夹不存在时,mkdirs会自动创建多层目录,区别于mkdir.(mkdir如果父目录不存在则会抛出异常)
- if (!file.exists() && !file.isDirectory()) {
- file.mkdirs();
- }
- }
-
- public static class CmUtil{
- public static boolean isEmpty(File file){
- if (null == file || 0 == file.length() || !file.exists()) return true;
- return false;
- }
- }
-
-
- /**
- * 插入LOGO
- *
- * @param source 二维码图片
- * @param logoFile LOGO图片文件
- * @param needCompress 是否压缩
- * @throws Exception
- */
- private static void insertImage(BufferedImage source, File logoFile,
- boolean needCompress) throws Exception {
-
- if (!logoFile.exists()) {
- System.err.println("" + logoFile + " 该文件不存在!");
- return;
- }
- Image src = ImageIO.read(logoFile);
- int width = src.getWidth(null);
- int height = src.getHeight(null);
- // 压缩LOGO
- if (needCompress) {
- if (width > WIDTH) {
- width = WIDTH;
- }
- if (height > HEIGHT) {
- height = HEIGHT;
- }
- Image image = src.getScaledInstance(width, height,
- Image.SCALE_SMOOTH);
- BufferedImage tag = new BufferedImage(width, height,
- BufferedImage.TYPE_INT_RGB);
- Graphics g = tag.getGraphics();
- // 绘制缩小后的图
- g.drawImage(image, 0, 0, null);
- g.dispose();
- src = image;
- }
- // 插入LOGO
- Graphics2D graph = source.createGraphics();
- int x = (QRCODE_SIZE - width) / 2;
- int y = (QRCODE_SIZE - height) / 2;
- graph.drawImage(src, x, y, width, height, null);
- Shape shape = new RoundRectangle2D.Float(x, y, width, width, 6, 6);
- graph.setStroke(new BasicStroke(3f));
- graph.draw(shape);
- graph.dispose();
- }
-
-}
+//package cn.cecep.talroad.util;
+//
+//import com.google.zxing.BarcodeFormat;
+//import com.google.zxing.EncodeHintType;
+//import com.google.zxing.MultiFormatWriter;
+//import com.google.zxing.WriterException;
+//import com.google.zxing.common.BitMatrix;
+//import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel;
+//import org.springframework.web.client.RestTemplate;
+//
+//import javax.imageio.ImageIO;
+//import java.awt.*;
+//import java.awt.geom.RoundRectangle2D;
+//import java.awt.image.BufferedImage;
+//import java.io.ByteArrayOutputStream;
+//import java.io.File;
+//import java.util.*;
+//
+///**
+// * @Description:二维码工具类
+// * @PACKAGE_NAME: cn.cecep.talroad.utils
+// * @date 2021-12-21 11:10*/
+//public class QrCodeUtils {
+//
+// private static final int BLACK = 0xFF000000;
+// private static final int WHITE = 0xFFFFFFFF;
+// private static final String CHARSET = "utf-8";
+// private static final String FORMAT_NAME = "JPG";
+// // 二维码尺寸
+// private static final int QRCODE_SIZE = 300;
+// // LOGO宽度
+// private static final int WIDTH = 60;
+// // LOGO高度
+// private static final int HEIGHT = 60;
+//
+// private static RestTemplate restTemplate = new RestTemplate();
+//
+//
+// /**
+// * 生成二维码
+// * 经过base64编码
+// *
+// * @param url
+// * @return
+// */
+// public static BufferedImage createQrCode(String url) throws WriterException {
+// Map hints = new HashMap(4);
+// hints.put(EncodeHintType.CHARACTER_SET, "UTF-8");
+// BitMatrix bitMatrix = new MultiFormatWriter().encode(url, BarcodeFormat.QR_CODE, 500, 500, hints);
+//
+// return toBufferedImage(bitMatrix);
+// }
+//
+// /**
+// * 生成二维码
+// * 经过base64编码
+// *
+// * @param url
+// * @return
+// */
+// public static String createQrCodeBase64(String url) {
+// String base64String = "";
+// try {
+// Map hints = new HashMap(4);
+// hints.put(EncodeHintType.CHARACTER_SET, "UTF-8");
+// BitMatrix bitMatrix = new MultiFormatWriter().encode(url, BarcodeFormat.QR_CODE, 400, 400, hints);
+// ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
+//
+// BufferedImage bufferedImage = toBufferedImage(bitMatrix);
+// ImageIO.write(bufferedImage, "jpg", outputStream);
+// Base64.Encoder encoder = Base64.getEncoder();
+// base64String = encoder.encodeToString(outputStream.toByteArray());
+// } catch (Exception e) {
+// e.printStackTrace();
+// }
+// //return "data:image/jpg;base64," + base64String;
+// return base64String;
+// }
+//
+// private static BufferedImage toBufferedImage(BitMatrix matrix) {
+// int width = matrix.getWidth();
+// int height = matrix.getHeight();
+// BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
+// for (int x = 0; x < width; x++) {
+// for (int y = 0; y < height; y++) {
+// image.setRGB(x, y, matrix.get(x, y) ? BLACK : WHITE);
+// }
+// }
+// return image;
+// }
+//
+// /**
+// * 生成二维码(内嵌LOGO)
+// * author zhangpeizhi
+// * @param content 内容
+// * @param logoFile LOGO文件
+// * @param needCompress 是否压缩LOGO
+// * @throws Exception
+// */
+// public static String createQrCodeBase64Encode(String content, File logoFile,
+// boolean needCompress) throws Exception {
+// BufferedImage image = createImage(content, logoFile,
+// needCompress);
+//
+// ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
+//
+// ImageIO.write(image, "jpg", outputStream);
+// Base64.Encoder encoder = Base64.getEncoder();
+// String base64String = encoder.encodeToString(outputStream.toByteArray());
+//
+// return base64String;
+// }
+//
+//
+// /**
+// * 生成二维码(内嵌LOGO)
+// *
+// * @param content 内容
+// * @param logoFile LOGO文件
+// * @param destPath 存放目录
+// * @param needCompress 是否压缩LOGO
+// * @throws Exception
+// */
+// public static String encode(String content, File logoFile, String destPath,
+// boolean needCompress) throws Exception {
+// BufferedImage image = createImage(content, logoFile,
+// needCompress);
+// mkdirs(destPath);
+// String file = new Random().nextInt(99999999) + ".jpg";
+// ImageIO.write(image, FORMAT_NAME, new File(destPath + "/" + file));
+// return file;
+// }
+//
+// private static BufferedImage createImage(String content, File logoFile,
+// boolean needCompress) throws Exception {
+// Hashtable hints = new Hashtable();
+// hints.put(EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel.H);
+// hints.put(EncodeHintType.CHARACTER_SET, CHARSET);
+// hints.put(EncodeHintType.MARGIN, 1);
+// BitMatrix bitMatrix = new MultiFormatWriter().encode(content,
+// BarcodeFormat.QR_CODE, QRCODE_SIZE, QRCODE_SIZE, hints);
+// int width = bitMatrix.getWidth();
+// int height = bitMatrix.getHeight();
+// BufferedImage image = new BufferedImage(width, height,
+// BufferedImage.TYPE_INT_RGB);
+// for (int x = 0; x < width; x++) {
+// for (int y = 0; y < height; y++) {
+// image.setRGB(x, y, bitMatrix.get(x, y) ? 0xFF000000
+// : 0xFFFFFFFF);
+// }
+// }
+// if (CmUtil.isEmpty(logoFile)) {
+// return image;
+// }
+// // 插入图片
+// insertImage(image, logoFile, needCompress);
+// return image;
+// }
+//
+// /**
+// * 当文件夹不存在时,mkdirs会自动创建多层目录,区别于mkdir.(mkdir如果父目录不存在则会抛出异常)
+// *
+// * @param destPath 存放目录
+// * @date 2013-12-11 上午10:16:36
+// */
+// public static void mkdirs(String destPath) {
+// File file = new File(destPath);
+// //当文件夹不存在时,mkdirs会自动创建多层目录,区别于mkdir.(mkdir如果父目录不存在则会抛出异常)
+// if (!file.exists() && !file.isDirectory()) {
+// file.mkdirs();
+// }
+// }
+//
+// public static class CmUtil{
+// public static boolean isEmpty(File file){
+// if (null == file || 0 == file.length() || !file.exists()) return true;
+// return false;
+// }
+// }
+//
+//
+// /**
+// * 插入LOGO
+// *
+// * @param source 二维码图片
+// * @param logoFile LOGO图片文件
+// * @param needCompress 是否压缩
+// * @throws Exception
+// */
+// private static void insertImage(BufferedImage source, File logoFile,
+// boolean needCompress) throws Exception {
+//
+// if (!logoFile.exists()) {
+// System.err.println("" + logoFile + " 该文件不存在!");
+// return;
+// }
+// Image src = ImageIO.read(logoFile);
+// int width = src.getWidth(null);
+// int height = src.getHeight(null);
+// // 压缩LOGO
+// if (needCompress) {
+// if (width > WIDTH) {
+// width = WIDTH;
+// }
+// if (height > HEIGHT) {
+// height = HEIGHT;
+// }
+// Image image = src.getScaledInstance(width, height,
+// Image.SCALE_SMOOTH);
+// BufferedImage tag = new BufferedImage(width, height,
+// BufferedImage.TYPE_INT_RGB);
+// Graphics g = tag.getGraphics();
+// // 绘制缩小后的图
+// g.drawImage(image, 0, 0, null);
+// g.dispose();
+// src = image;
+// }
+// // 插入LOGO
+// Graphics2D graph = source.createGraphics();
+// int x = (QRCODE_SIZE - width) / 2;
+// int y = (QRCODE_SIZE - height) / 2;
+// graph.drawImage(src, x, y, width, height, null);
+// Shape shape = new RoundRectangle2D.Float(x, y, width, width, 6, 6);
+// graph.setStroke(new BasicStroke(3f));
+// graph.draw(shape);
+// graph.dispose();
+// }
+//
+//}
diff --git a/szhpt-fixed-task/src/main/java/cn/cecep/talroad/util/StatusConsumer.java b/szhpt-fixed-task/src/main/java/cn/cecep/talroad/util/StatusConsumer.java
index 38d5e79..6c29e60 100644
--- a/szhpt-fixed-task/src/main/java/cn/cecep/talroad/util/StatusConsumer.java
+++ b/szhpt-fixed-task/src/main/java/cn/cecep/talroad/util/StatusConsumer.java
@@ -1,48 +1,48 @@
-package cn.cecep.talroad.util;
-
-import com.rabbitmq.client.Channel;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.amqp.core.Message;
-import org.springframework.amqp.rabbit.annotation.RabbitListener;
-import org.springframework.amqp.rabbit.listener.api.ChannelAwareMessageListener;
-import org.springframework.stereotype.Component;
-
-/**
- * @Auther: cjh
- * @Date: 2023-04-17 11:02
- * @Class: MsgReceiver
- * @Deseription: 停限产状态消息消费
- * @Version V1.0
- */
-@Slf4j
-@Component
-public class StatusConsumer implements ChannelAwareMessageListener {
-
-
- @Override
- //@RabbitListener(queues = "status-queue")
- public void onMessage(Message message, Channel channel) throws Exception {
-// try {
-// String deviceId = new String(message.getBody());
-// BasDevice d = deviceMapper.selectById(deviceId);
-// PcFactory p = pcFactoryMapper.selectPcFactoryById(d.getFactoryId());
+//package cn.cecep.talroad.util;
//
-// QueryWrapper paramWrapper = new QueryWrapper<>();
-// paramWrapper.eq("industry", d.getIndustry());
-// paramWrapper.eq("device_id", d.getDeviceId());
-// paramWrapper.eq("device_type",d.getType());
-// List paramList = basDeviceParamMapper.selectList(paramWrapper);
-// //拼接策略服务名称
-// String strategyName = StringUtils.upperCase(d.getIndustry() + d.getType());
-// //执行策略,处理设备状态
-// strategyFactory.getByName(strategyName).doCheckProcess(p, d, paramList);
+//import com.rabbitmq.client.Channel;
+//import lombok.extern.slf4j.Slf4j;
+//import org.springframework.amqp.core.Message;
+//import org.springframework.amqp.rabbit.annotation.RabbitListener;
+//import org.springframework.amqp.rabbit.listener.api.ChannelAwareMessageListener;
+//import org.springframework.stereotype.Component;
//
-// } catch (Exception e) {
-// log.error("MsgReceiver.onMessage##失败:" + e.getMessage());
-// } finally {
-// //ACK 手动签收消息,告诉对方消息签收成功,唯一标识ID
-// Long deliverTag = message.getMessageProperties().getDeliveryTag();
-// channel.basicAck(deliverTag, false);
-// }
- }
-}
+///**
+// * @Auther: cjh
+// * @Date: 2023-04-17 11:02
+// * @Class: MsgReceiver
+// * @Deseription: 停限产状态消息消费
+// * @Version V1.0
+// */
+//@Slf4j
+//@Component
+//public class StatusConsumer implements ChannelAwareMessageListener {
+//
+//
+// @Override
+// //@RabbitListener(queues = "status-queue")
+// public void onMessage(Message message, Channel channel) throws Exception {
+//// try {
+//// String deviceId = new String(message.getBody());
+//// BasDevice d = deviceMapper.selectById(deviceId);
+//// PcFactory p = pcFactoryMapper.selectPcFactoryById(d.getFactoryId());
+////
+//// QueryWrapper paramWrapper = new QueryWrapper<>();
+//// paramWrapper.eq("industry", d.getIndustry());
+//// paramWrapper.eq("device_id", d.getDeviceId());
+//// paramWrapper.eq("device_type",d.getType());
+//// List paramList = basDeviceParamMapper.selectList(paramWrapper);
+//// //拼接策略服务名称
+//// String strategyName = StringUtils.upperCase(d.getIndustry() + d.getType());
+//// //执行策略,处理设备状态
+//// strategyFactory.getByName(strategyName).doCheckProcess(p, d, paramList);
+////
+//// } catch (Exception e) {
+//// log.error("MsgReceiver.onMessage##失败:" + e.getMessage());
+//// } finally {
+//// //ACK 手动签收消息,告诉对方消息签收成功,唯一标识ID
+//// Long deliverTag = message.getMessageProperties().getDeliveryTag();
+//// channel.basicAck(deliverTag, false);
+//// }
+// }
+//}
diff --git a/szhpt-fixed-task/src/main/java/cn/cecep/talroad/util/YieldConsumer.java b/szhpt-fixed-task/src/main/java/cn/cecep/talroad/util/YieldConsumer.java
index a8d9a83..82ab06a 100644
--- a/szhpt-fixed-task/src/main/java/cn/cecep/talroad/util/YieldConsumer.java
+++ b/szhpt-fixed-task/src/main/java/cn/cecep/talroad/util/YieldConsumer.java
@@ -1,52 +1,52 @@
-package cn.cecep.talroad.util;
-
-import cn.cecep.talroad.common.core.utils.StringUtils;
-import cn.cecep.talroad.service.IBasDeviceService;
-import cn.cecep.talroad.service.strategy.StrategyFactory;
-import cn.cecep.talroad.vo.FactoryDeviceVo;
-import com.rabbitmq.client.Channel;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.amqp.core.Message;
-import org.springframework.amqp.rabbit.annotation.RabbitListener;
-import org.springframework.amqp.rabbit.listener.api.ChannelAwareMessageListener;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Component;
-
-/**
- * @Auther: cjh
- * @Date: 2023-04-17 11:02
- * @Class: MsgReceiver
- * @Deseription: 产量统计消息消费
- * @Version V1.0
- */
-@Slf4j
-@Component
-public class YieldConsumer implements ChannelAwareMessageListener {
-
- @Autowired
- private IBasDeviceService basDeviceService;
- @Autowired
- private StrategyFactory strategyFactory;
-
- @Override
- @RabbitListener(queues = "yield-queue")
- public void onMessage(Message message, Channel channel) throws Exception {
- String deviceId = new String(message.getBody());
- try {
- FactoryDeviceVo vo = basDeviceService.selectFactoryDeviceVoByDeviceId(deviceId);
-
- //拼接策略服务名称
- String strategyName = StringUtils.upperCase(vo.getIndustry() + vo.getDeviceType() + vo.getDeviceType());
- log.info("开始消费者-产量统计-行业:"+vo.getIndustry()+",设备类型:"+vo.getDeviceType());
- //执行策略,处理设备状态
- strategyFactory.getByName(strategyName).doCheckProcessYield(vo);
-
- } catch (Exception e) {
- log.error("MsgReceiver.onMessage##设备ID:"+ deviceId+"##异常信息:"+ e.getMessage());
- } finally {
- //ACK 手动签收消息,告诉对方消息签收成功,唯一标识ID
- Long deliverTag = message.getMessageProperties().getDeliveryTag();
- channel.basicAck(deliverTag, false);
- }
- }
-}
+//package cn.cecep.talroad.util;
+//
+//import cn.cecep.talroad.common.core.utils.StringUtils;
+//import cn.cecep.talroad.service.IBasDeviceService;
+//import cn.cecep.talroad.service.strategy.StrategyFactory;
+//import cn.cecep.talroad.vo.FactoryDeviceVo;
+//import com.rabbitmq.client.Channel;
+//import lombok.extern.slf4j.Slf4j;
+//import org.springframework.amqp.core.Message;
+//import org.springframework.amqp.rabbit.annotation.RabbitListener;
+//import org.springframework.amqp.rabbit.listener.api.ChannelAwareMessageListener;
+//import org.springframework.beans.factory.annotation.Autowired;
+//import org.springframework.stereotype.Component;
+//
+///**
+// * @Auther: cjh
+// * @Date: 2023-04-17 11:02
+// * @Class: MsgReceiver
+// * @Deseription: 产量统计消息消费
+// * @Version V1.0
+// */
+//@Slf4j
+//@Component
+//public class YieldConsumer implements ChannelAwareMessageListener {
+//
+// @Autowired
+// private IBasDeviceService basDeviceService;
+// @Autowired
+// private StrategyFactory strategyFactory;
+//
+// @Override
+// @RabbitListener(queues = "yield-queue")
+// public void onMessage(Message message, Channel channel) throws Exception {
+// String deviceId = new String(message.getBody());
+// try {
+// FactoryDeviceVo vo = basDeviceService.selectFactoryDeviceVoByDeviceId(deviceId);
+//
+// //拼接策略服务名称
+// String strategyName = StringUtils.upperCase(vo.getIndustry() + vo.getDeviceType() + vo.getDeviceType());
+// log.info("开始消费者-产量统计-行业:"+vo.getIndustry()+",设备类型:"+vo.getDeviceType());
+// //执行策略,处理设备状态
+// strategyFactory.getByName(strategyName).doCheckProcessYield(vo);
+//
+// } catch (Exception e) {
+// log.error("MsgReceiver.onMessage##设备ID:"+ deviceId+"##异常信息:"+ e.getMessage());
+// } finally {
+// //ACK 手动签收消息,告诉对方消息签收成功,唯一标识ID
+// Long deliverTag = message.getMessageProperties().getDeliveryTag();
+// channel.basicAck(deliverTag, false);
+// }
+// }
+//}
diff --git a/szhpt-fixed-task/src/main/resources/application.yaml b/szhpt-fixed-task/src/main/resources/application.yaml
index 1dc15fe..365749f 100644
--- a/szhpt-fixed-task/src/main/resources/application.yaml
+++ b/szhpt-fixed-task/src/main/resources/application.yaml
@@ -45,7 +45,7 @@ spring:
# 主库数据源
master:
driver-class-name: org.postgresql.Driver
- url: jdbc:postgresql://39.100.149.153:5432/public?useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true&serverTimezone=Asia/Shanghai
+ url: jdbc:postgresql://39.100.149.153:5432/postgres?useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true&serverTimezone=Asia/Shanghai
username: postgres
password: abc@123@...
# ods:
diff --git a/szhpt-fixed-task/src/main/resources/mapper/talroad/OdsPermissionSharereportattachmentAMapper.xml b/szhpt-fixed-task/src/main/resources/mapper/talroad/OdsPermissionSharereportattachmentAMapper.xml
new file mode 100644
index 0000000..f186b95
--- /dev/null
+++ b/szhpt-fixed-task/src/main/resources/mapper/talroad/OdsPermissionSharereportattachmentAMapper.xml
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ reportId, fileId, fileName, fileSize, fileType, remark, fastdfsId
+
+
\ No newline at end of file
diff --git a/szhpt-fixed-task/src/main/resources/mapper/talroad/OdsPermissionSharereportledgerinfoLedgerinfoAMapper.xml b/szhpt-fixed-task/src/main/resources/mapper/talroad/OdsPermissionSharereportledgerinfoLedgerinfoAMapper.xml
new file mode 100644
index 0000000..574e484
--- /dev/null
+++ b/szhpt-fixed-task/src/main/resources/mapper/talroad/OdsPermissionSharereportledgerinfoLedgerinfoAMapper.xml
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ reportId, summary, ledgerRecordName, whetherComplete, description, reportTime
+
+
\ No newline at end of file