Browse Source

Merge remote-tracking branch 'origin/develop' into develop

develop
zhaoxianglong 5 months ago
parent
commit
e2f51b5d66
  1. 75
      zc-business/src/main/java/com/zc/business/controller/DCPerceivedEventsWarningController.java
  2. 61
      zc-business/src/main/java/com/zc/business/domain/export/NonAutomaticWarningFacility.java
  3. 49
      zc-business/src/main/java/com/zc/business/domain/export/NonAutomaticWarningTimeType.java
  4. 61
      zc-business/src/main/java/com/zc/business/domain/export/NonAutomaticWarningType.java

75
zc-business/src/main/java/com/zc/business/controller/DCPerceivedEventsWarningController.java

@ -235,6 +235,33 @@ public class DCPerceivedEventsWarningController extends BaseController {
}
return AjaxResult.success(perceivedEventsWarningService.selectTypeNonAutomaticWarning(dcWarning));
}
@ApiOperation(value = "导出非机预警统计分析(按事件分类)",tags = {"ECharts导出"})
@GetMapping("/exportNonAutomaticWarningType")
public void exportNonAutomaticWarningType(HttpServletResponse response, DcWarning dcWarning){
List<NonAutomaticWarningType> list = new ArrayList<>();
if (StringUtils.isBlank(dcWarning.getType())||dcWarning.getWarningTime()==null){
} else {
List<HashMap<String,Object>> data = perceivedEventsWarningService.selectTypeNonAutomaticWarning(dcWarning);
Long total = data.stream().mapToLong(item -> (long) item.get("number")).sum();
for (Map<String, Object> datum : data) {
NonAutomaticWarningType nonAutomaticWarningType = new NonAutomaticWarningType();
nonAutomaticWarningType.setSubclass(datum.get("subclass").toString());
nonAutomaticWarningType.setNumber(datum.get("number").toString());
//计算百分比
double ratio = (double) Long.parseLong(datum.get("number").toString()) / total * 100;
ratio = Math.round(ratio * 100.0) / 100.0;
nonAutomaticWarningType.setRatio(ratio + "%");
list.add(nonAutomaticWarningType);
}
}
ExcelUtil<NonAutomaticWarningType> util = new ExcelUtil<>(NonAutomaticWarningType.class);
util.exportExcel(response, list, "统计分析");
}
//查询非机预警,按照时间查询(传入时间类型type与时间warningTime)
@PostMapping("/nonAutomaticWarningTimeType")
public AjaxResult nonAutomaticWarningTimeType(@RequestBody DcWarning dcWarning){
@ -243,6 +270,28 @@ public class DCPerceivedEventsWarningController extends BaseController {
}
return AjaxResult.success(perceivedEventsWarningService.selectNonAutomaticWarningTimeType(dcWarning));
}
@ApiOperation(value = "导出非机预警统计分析(按日期)",tags = {"ECharts导出"})
@GetMapping("/exportNonAutomaticWarningTimeType")
public void exportNonAutomaticWarningTimeType(HttpServletResponse response, DcWarning dcWarning){
List<NonAutomaticWarningTimeType> list = new ArrayList<>();
if (StringUtils.isBlank(dcWarning.getType())||dcWarning.getWarningTime()==null){
} else {
List<HashMap<String,Object>> data = perceivedEventsWarningService.selectNonAutomaticWarningTimeType(dcWarning);
for (Map<String, Object> datum : data) {
NonAutomaticWarningTimeType nonAutomaticWarningTimeType = new NonAutomaticWarningTimeType();
nonAutomaticWarningTimeType.setTime(datum.get("time").toString());
nonAutomaticWarningTimeType.setNumber(datum.get("number").toString());
list.add(nonAutomaticWarningTimeType);
}
}
ExcelUtil<NonAutomaticWarningTimeType> util = new ExcelUtil<>(NonAutomaticWarningTimeType.class);
util.exportExcel(response, list, "统计分析");
}
//查询非机预警,按照时间查询收费站分组(传入时间类型type与时间warningTime)
@PostMapping("/nonAutomaticWarningFacility")
public AjaxResult nonAutomaticWarningFacility(@RequestBody DcWarning dcWarning){
@ -252,6 +301,32 @@ public class DCPerceivedEventsWarningController extends BaseController {
return AjaxResult.success(perceivedEventsWarningService.selectNonAutomaticWarningFacility(dcWarning));
}
@ApiOperation(value = "导出非机预警统计分析(按事件分类)",tags = {"ECharts导出"})
@GetMapping("/exportNonAutomaticWarningFacility")
public void exportNonAutomaticWarningFacility(HttpServletResponse response, DcWarning dcWarning){
List<NonAutomaticWarningFacility> list = new ArrayList<>();
if (StringUtils.isBlank(dcWarning.getType())||dcWarning.getWarningTime()==null){
} else {
List<HashMap<String,Object>> data = perceivedEventsWarningService.selectNonAutomaticWarningFacility(dcWarning);
Long total = data.stream().mapToLong(item -> (long) item.get("number")).sum();
for (Map<String, Object> datum : data) {
NonAutomaticWarningFacility nonAutomaticWarningFacility = new NonAutomaticWarningFacility();
nonAutomaticWarningFacility.setFacilityName(datum.get("facilityName").toString());
nonAutomaticWarningFacility.setNumber(datum.get("number").toString());
//计算百分比
double ratio = (double) Long.parseLong(datum.get("number").toString()) / total * 100;
ratio = Math.round(ratio * 100.0) / 100.0;
nonAutomaticWarningFacility.setRatio(ratio + "%");
list.add(nonAutomaticWarningFacility);
}
}
ExcelUtil<NonAutomaticWarningFacility> util = new ExcelUtil<>(NonAutomaticWarningFacility.class);
util.exportExcel(response, list, "统计分析");
}
//新-感知事件多发时段
@PostMapping("/manyTimesInterval")
public AjaxResult manyTimesInterval(@RequestBody DcWarning dcWarning){

61
zc-business/src/main/java/com/zc/business/domain/export/NonAutomaticWarningFacility.java

@ -0,0 +1,61 @@
package com.zc.business.domain.export;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
/**
* 导出非机预警统计分析(按站点)对象
*
* @author ruoyi
* @date 2024-01-13
*/
public class NonAutomaticWarningFacility extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 站点 */
@Excel(name = "站点")
private String facilityName;
/** 数量 */
@Excel(name = "数量")
private String number;
/** 占比 */
@Excel(name = "占比")
private String ratio;
public String getFacilityName() {
return facilityName;
}
public void setFacilityName(String facilityName) {
this.facilityName = facilityName;
}
public String getNumber() {
return number;
}
public void setNumber(String number) {
this.number = number;
}
public String getRatio() {
return ratio;
}
public void setRatio(String ratio) {
this.ratio = ratio;
}
@Override
public String toString() {
return new ToStringBuilder(this)
.append("facilityName", facilityName)
.append("number", number)
.append("ratio", ratio)
.toString();
}
}

49
zc-business/src/main/java/com/zc/business/domain/export/NonAutomaticWarningTimeType.java

@ -0,0 +1,49 @@
package com.zc.business.domain.export;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
/**
* 导出非机预警统计分析(按日期)对象
*
* @author ruoyi
* @date 2024-01-13
*/
public class NonAutomaticWarningTimeType extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 时间 */
@Excel(name = "时间")
private String time;
/** 数量 */
@Excel(name = "数量")
private String number;
public String getTime() {
return time;
}
public void setTime(String time) {
this.time = time;
}
public String getNumber() {
return number;
}
public void setNumber(String number) {
this.number = number;
}
@Override
public String toString() {
return new ToStringBuilder(this)
.append("time", time)
.append("number", number)
.toString();
}
}

61
zc-business/src/main/java/com/zc/business/domain/export/NonAutomaticWarningType.java

@ -0,0 +1,61 @@
package com.zc.business.domain.export;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
/**
* 导出非机预警统计分析(按事件分类)对象
*
* @author ruoyi
* @date 2024-01-13
*/
public class NonAutomaticWarningType extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 类型 */
@Excel(name = "类型")
private String subclass;
/** 数量 */
@Excel(name = "数量")
private String number;
/** 占比 */
@Excel(name = "占比")
private String ratio;
public String getSubclass() {
return subclass;
}
public void setSubclass(String subclass) {
this.subclass = subclass;
}
public String getNumber() {
return number;
}
public void setNumber(String number) {
this.number = number;
}
public String getRatio() {
return ratio;
}
public void setRatio(String ratio) {
this.ratio = ratio;
}
@Override
public String toString() {
return new ToStringBuilder(this)
.append("subclass", subclass)
.append("number", number)
.append("ratio", ratio)
.toString();
}
}
Loading…
Cancel
Save