b7173089 康伟

kangwei: 生产运营日报

1 个父辈 d94a49ed
......@@ -47,5 +47,7 @@ public interface ReportConstant {
public static final String fieldSz = "JSZL,CSZL,JSCOD,CSCOD,JSAD,CSAD,JSZD,CSTN,JSPH,JSSS,CSPH,CSSS";
//出水字段
public static final String field_2119_CS = "CSZL,CSCOD,CSAD,CSTN,CSPH";
//进水字段
public static final String field_2119_JS = "JSZL,JSCOD,JSAD,JSZD,JSPH";
}
......
......@@ -9,6 +9,7 @@ import com.skua.modules.common.vo.DepartVO;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
......@@ -24,7 +25,11 @@ public class CommonSqlServiceImpl implements ICommonSqlService {
@Override
public Map<String, Object> queryForMap(String sql) {
return commonSqlMapper.queryForMap(sql);
Map<String, Object> dataMap = commonSqlMapper.queryForMap(sql);
if(dataMap == null ){
dataMap = new HashMap<>();
}
return dataMap ;
}
@Override
......
......@@ -830,4 +830,27 @@ public class DateUtils {
calendar.setTime(currentDate);
return calendar.get(Calendar.MONTH)+1;
}
/***
* 前几天时间
* @param dateString
* @param minusDays
* @return
*/
public static String getPreviousDay(String dateString,Integer minusDays){
if(minusDays == null){
minusDays = 1;
}
// 假设这是你提供的日期字符串
//String dateString = "2023-03-15";
// 创建一个DateTimeFormatter来解析日期字符串
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
// 使用formatter将字符串解析为LocalDate对象
LocalDate date = LocalDate.parse(dateString, formatter);
// 获取前一天的日期
LocalDate previousDay = date.minusDays(minusDays);
// 将前一天的日期格式化为字符串
String previousDayString = previousDay.format(formatter);
return previousDayString;
}
}
......
......@@ -9,6 +9,8 @@ import java.math.BigDecimal;
import java.text.DecimalFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
......@@ -54,6 +56,8 @@ public class JSUtils {
return "0";
}
/***
* 格式化结果,保留两位小数
* @param obj1
......
......@@ -93,7 +93,7 @@ public class AjhPlanScheduleConfig {
this.configName = configName;
}
public AjhPlanScheduleConfig(String departId, String year, String parentId, String configName, String completeTime, String responsibler) {
public AjhPlanScheduleConfig(String departId, String years, String parentId, String configName, String completeTime, String responsibler) {
this.departId = departId;
this.years = years;
this.parentId = parentId;
......
......@@ -28,8 +28,8 @@ public class EventMapController {
@Autowired
private IEmergencyRiskEventService emergencyRiskEventService;
@AutoLog(value = "风险库统计(数字)")
@ApiOperation(value="风险库统计", notes="风险库统计")
@AutoLog(value = "隐患事件统计(数字)")
@ApiOperation(value="隐患事件统计(数字)", notes="隐患事件统计(数字)")
@GetMapping(value = "/dangerEventStatistics")
public Result<DangerEventOverviewVO> dangerEventStatistics(String departIds, String startDate, String endDate){
Result<DangerEventOverviewVO> result = new Result<>();
......@@ -41,8 +41,8 @@ public class EventMapController {
result.setResult(eventOverview);
return result;
}
@AutoLog(value = "安全检查列表")
@ApiOperation(value="安全检查列表", notes="安全检查列表")
@AutoLog(value = "隐患事件统计(列表)")
@ApiOperation(value="隐患事件统计(列表)", notes="隐患事件统计(列表)")
@GetMapping(value = "/dangerEventStatisticsList")
public Result<List<DangerEventOverviewVO>> dangerEventStatisticsList(String departIds,String startDate, String endDate){
Result<List<DangerEventOverviewVO>> result = new Result<>();
......@@ -57,7 +57,7 @@ public class EventMapController {
}
@AutoLog(value = "风险库统计(数字)")
@ApiOperation(value="风险库统计", notes="风险库统计")
@ApiOperation(value="风险库统计(数字)", notes="风险库统计(数字)")
@GetMapping(value = "/riskLibraryStatistics")
public Result<RiskDatabaseResult> riskLibraryStatistics(String departIds,String startDate, String endDate){
Result<RiskDatabaseResult> result = new Result<>();
......
......@@ -181,7 +181,7 @@ public class EmergencyRiskEventServiceImpl extends ServiceImpl<EmergencyRiskEven
* @return
*/
public RiskDatabaseResult getRiskLibraryStatistics(String departIds, String startDate, String endDate){
String sql = " select sum(ifnull(aa.count,0)) 'aqyhCount',sum(ifnull(bb.count,0) )'yhpcCount', sum(ifnull(cc.count,0)) 'ycCount', sum(ifnull(dd.count,0)) 'xjCount'";
String sql = " select sum(ifnull(aa.count,0)) 'aqyhCount',sum(ifnull(bb.count,0) )'yhpcCount', sum(ifnull(ee.count,0)) 'yhpcSJCount', sum(ifnull(cc.count,0)) 'ycCount', sum(ifnull(dd.count,0)) 'xjCount'";
sql += getRiskLibraryStatisticsSql(departIds, startDate, endDate);
List<RiskDatabaseResult> dataList = getJdbcTemplate().query(sql,new BeanPropertyRowMapper<RiskDatabaseResult>(RiskDatabaseResult.class));
......@@ -191,7 +191,7 @@ public class EmergencyRiskEventServiceImpl extends ServiceImpl<EmergencyRiskEven
return new RiskDatabaseResult(0,0,0,0,0);
}
public List<RiskDatabaseResult> getRiskLibraryStatisticsList(String departIds, String startDate, String endDate){
String sql = " select d.id 'dpart_id',d.depart_name , ifnull(aa.count,0) 'aqyhCount',ifnull(bb.count,0) 'yhpcCount', ifnull(cc.count,0) 'ycCount', ifnull(dd.count,0) 'xjCount'";
String sql = " select d.id 'dpart_id',d.depart_name , ifnull(aa.count,0) 'aqyhCount',ifnull(bb.count,0) 'yhpcCount',ifnull(ee.count,0) 'yhpcSJCount', ifnull(cc.count,0) 'ycCount', ifnull(dd.count,0) 'xjCount'";
sql += getRiskLibraryStatisticsSql(departIds, startDate, endDate);
List<RiskDatabaseResult> dataList = getJdbcTemplate().query(sql,new BeanPropertyRowMapper<RiskDatabaseResult>(RiskDatabaseResult.class));
return dataList;
......@@ -266,6 +266,9 @@ public class EmergencyRiskEventServiceImpl extends ServiceImpl<EmergencyRiskEven
sql += " left join ( select t.depart_id , count(1) 'count' from ajh_rectification_info t where t.rec_ord_report_date >='"+startDate+"' and t.rec_ord_report_date <='"+endDate+"' group by t.depart_id) aa on aa.depart_id = d.id";
// 风险排查
sql += " left join ( select depart_id ,count(id) 'count' from danger_inspection_record where report_date >= '"+startDate+" 00:00:00' and report_date <='"+endDate+" 23:59:59' group by depart_id ) bb on bb.depart_id = d.id ";
//实际完成数量
sql += " left join ( select depart_id ,count(id) 'count' from danger_inspection_record where status = '2' and end_date >= '"+startDate+" 00:00:00' and end_date <='"+endDate+" 23:59:59' group by depart_id ) eee on eee.depart_id = d.id ";
// 异常
sql += " left join ( select t.depart_id , count(1) 'count' from problem_report_plan t where t.report_time >='"+startDate+"' and t.report_time <='"+endDate+"' group by t.depart_id) cc on cc.depart_id = d.id";
//巡检
......
......@@ -28,6 +28,8 @@ public class RiskDatabaseResult {
@ApiModelProperty(value = "隐患排查数量")
private Integer yhpcCount;
@ApiModelProperty(value = "隐患排查:实际完成次数")
private Integer yhpcSJCount;
/**异常数*/
@ApiModelProperty(value = "异常数")
......
package com.skua.modules.report.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* 运营日报 日报
* @author kangwei
*/
@Data
public class OperationDailyVO {
@ApiModelProperty(value = "处理水量合计")
private String cslhj;
@ApiModelProperty(value = "日均水量")
private String clsavg;
@ApiModelProperty(value = "昨日增加出水量")
private String increaseCLS;
@ApiModelProperty(value = "吨水电耗")
private String dsdh;
@ApiModelProperty(value = "昨日增加吨水电耗")
private String increaseDsdh;
@ApiModelProperty(value = "污泥量")
private String wnl;
@ApiModelProperty(value = "污泥脱水公司")
private String wnDepartName;
@ApiModelProperty(value = "污泥浓度公司")
private String mlssDepartName;
@ApiModelProperty(value = "进水超标公司")
private String jsDepartName;
@ApiModelProperty(value = "出水超标公司")
private String csDepartName;
@ApiModelProperty(value = "电耗超标公司")
private String dhDepartName;
@ApiModelProperty(value = "药耗超标公司")
private String yhDepartName;
}
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!