Merge branch 'Lxz' into 'main'
综合安全应用及数据管控系统 See merge request likehai/ytr-god!9
This commit is contained in:
commit
1b3a2b67d4
BIN
God-Vue-master/dump.rdb
Normal file
BIN
God-Vue-master/dump.rdb
Normal file
Binary file not shown.
@ -0,0 +1,99 @@
|
||||
package com.god.web.controller.comprehensiveSafetyData;
|
||||
|
||||
import com.god.common.annotation.Log;
|
||||
import com.god.common.core.controller.BaseController;
|
||||
import com.god.common.core.domain.AjaxResult;
|
||||
import com.god.common.core.page.TableDataInfo;
|
||||
import com.god.common.enums.BusinessType;
|
||||
import com.god.common.utils.poi.ExcelUtil;
|
||||
import com.god.comprehensiveSafetyData.domain.EchartsPie;
|
||||
import com.god.comprehensiveSafetyData.domain.ZhcjDataAsset;
|
||||
import com.god.comprehensiveSafetyData.service.IZhcjDataAssetService;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 数据资产Controller
|
||||
*
|
||||
* @author Lxz
|
||||
* @date 2023-10-18
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/dataAssets/dataAssets")
|
||||
public class ZhcjDataAssetController extends BaseController {
|
||||
@Resource
|
||||
private IZhcjDataAssetService zhcjDataAssetService;
|
||||
|
||||
/**
|
||||
* 查询数据资产列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('dataAssets:dataAssets:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(ZhcjDataAsset zhcjDataAsset) {
|
||||
startPage();
|
||||
List<ZhcjDataAsset> list = zhcjDataAssetService.selectZhcjDataAssetList(zhcjDataAsset);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@GetMapping("/getPieData")
|
||||
public TableDataInfo getPieData(ZhcjDataAsset zhcjDataAsset) {
|
||||
startPage();
|
||||
List<EchartsPie> list = zhcjDataAssetService.getPieData(zhcjDataAsset);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出数据资产列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('dataAssets:dataAssets:export')")
|
||||
@Log(title = "数据资产", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, ZhcjDataAsset zhcjDataAsset) {
|
||||
List<ZhcjDataAsset> list = zhcjDataAssetService.selectZhcjDataAssetList(zhcjDataAsset);
|
||||
ExcelUtil<ZhcjDataAsset> util = new ExcelUtil<ZhcjDataAsset>(ZhcjDataAsset.class);
|
||||
util.exportExcel(response, list, "数据资产数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取数据资产详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('dataAssets:dataAssets:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") String id) {
|
||||
return success(zhcjDataAssetService.selectZhcjDataAssetById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增数据资产
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('dataAssets:dataAssets:add')")
|
||||
@Log(title = "数据资产", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody ZhcjDataAsset zhcjDataAsset) {
|
||||
return toAjax(zhcjDataAssetService.insertZhcjDataAsset(zhcjDataAsset));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改数据资产
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('dataAssets:dataAssets:edit')")
|
||||
@Log(title = "数据资产", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody ZhcjDataAsset zhcjDataAsset) {
|
||||
return toAjax(zhcjDataAssetService.updateZhcjDataAsset(zhcjDataAsset));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除数据资产
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('dataAssets:dataAssets:remove')")
|
||||
@Log(title = "数据资产", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable String[] ids) {
|
||||
return toAjax(zhcjDataAssetService.deleteZhcjDataAssetByIds(ids));
|
||||
}
|
||||
}
|
@ -0,0 +1,98 @@
|
||||
package com.god.web.controller.comprehensiveSafetyData;
|
||||
|
||||
import com.god.common.annotation.Log;
|
||||
import com.god.common.core.controller.BaseController;
|
||||
import com.god.common.core.domain.AjaxResult;
|
||||
import com.god.common.core.page.TableDataInfo;
|
||||
import com.god.common.enums.BusinessType;
|
||||
import com.god.common.utils.poi.ExcelUtil;
|
||||
import com.god.comprehensiveSafetyData.domain.ZhcjOperationsAnalysis;
|
||||
import com.god.comprehensiveSafetyData.service.IZhcjOperationsAnalysisService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 运营分析Controller
|
||||
*
|
||||
* @author Lxz
|
||||
* @date 2023-10-18
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/operationsAnalysis/operationsAnalysis")
|
||||
public class ZhcjOperationsAnalysisController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IZhcjOperationsAnalysisService zhcjOperationsAnalysisService;
|
||||
|
||||
/**
|
||||
* 查询运营分析列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('operationsAnalysis:operationsAnalysis:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(ZhcjOperationsAnalysis zhcjOperationsAnalysis)
|
||||
{
|
||||
startPage();
|
||||
List<ZhcjOperationsAnalysis> list = zhcjOperationsAnalysisService.selectZhcjOperationsAnalysisList(zhcjOperationsAnalysis);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出运营分析列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('operationsAnalysis:operationsAnalysis:export')")
|
||||
@Log(title = "运营分析", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, ZhcjOperationsAnalysis zhcjOperationsAnalysis)
|
||||
{
|
||||
List<ZhcjOperationsAnalysis> list = zhcjOperationsAnalysisService.selectZhcjOperationsAnalysisList(zhcjOperationsAnalysis);
|
||||
ExcelUtil<ZhcjOperationsAnalysis> util = new ExcelUtil<ZhcjOperationsAnalysis>(ZhcjOperationsAnalysis.class);
|
||||
util.exportExcel(response, list, "运营分析数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取运营分析详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('operationsAnalysis:operationsAnalysis:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") String id)
|
||||
{
|
||||
return success(zhcjOperationsAnalysisService.selectZhcjOperationsAnalysisById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增运营分析
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('operationsAnalysis:operationsAnalysis:add')")
|
||||
@Log(title = "运营分析", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody ZhcjOperationsAnalysis zhcjOperationsAnalysis)
|
||||
{
|
||||
return toAjax(zhcjOperationsAnalysisService.insertZhcjOperationsAnalysis(zhcjOperationsAnalysis));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改运营分析
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('operationsAnalysis:operationsAnalysis:edit')")
|
||||
@Log(title = "运营分析", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody ZhcjOperationsAnalysis zhcjOperationsAnalysis)
|
||||
{
|
||||
return toAjax(zhcjOperationsAnalysisService.updateZhcjOperationsAnalysis(zhcjOperationsAnalysis));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除运营分析
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('operationsAnalysis:operationsAnalysis:remove')")
|
||||
@Log(title = "运营分析", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable String[] ids)
|
||||
{
|
||||
return toAjax(zhcjOperationsAnalysisService.deleteZhcjOperationsAnalysisByIds(ids));
|
||||
}
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
package com.god.comprehensiveSafetyData.domain;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Description: 饼图实体类
|
||||
* @Author: Lxz
|
||||
* @Date: 2023/10/18 16:31
|
||||
*/
|
||||
@Data
|
||||
public class EchartsPie {
|
||||
String name;
|
||||
String value;
|
||||
}
|
||||
|
@ -0,0 +1,122 @@
|
||||
package com.god.comprehensiveSafetyData.domain;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.god.common.annotation.Excel;
|
||||
import com.god.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 数据资产对象 zhcj_data_asset
|
||||
*
|
||||
* @author Lxz
|
||||
* @date 2023-10-18
|
||||
*/
|
||||
public class ZhcjDataAsset extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键 */
|
||||
private String id;
|
||||
|
||||
/** 系统名称 */
|
||||
@Excel(name = "系统名称")
|
||||
private String sysName;
|
||||
|
||||
/** 年份 */
|
||||
@Excel(name = "年份")
|
||||
private String year;
|
||||
|
||||
/** 月份 */
|
||||
@Excel(name = "月份")
|
||||
private String month;
|
||||
|
||||
/** 数据类型(设备数据、预警数据、图像数据) */
|
||||
@Excel(name = "数据类型", readConverterExp = "设=备数据、预警数据、图像数据")
|
||||
private String dateType;
|
||||
|
||||
/** 数据量 */
|
||||
@Excel(name = "数据量")
|
||||
private String dateNumber;
|
||||
|
||||
/** 数据占用容量(T) */
|
||||
@Excel(name = "数据占用容量", readConverterExp = "T=")
|
||||
private String dataOccupancyCapacity;
|
||||
|
||||
public void setId(String id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setSysName(String sysName)
|
||||
{
|
||||
this.sysName = sysName;
|
||||
}
|
||||
|
||||
public String getSysName()
|
||||
{
|
||||
return sysName;
|
||||
}
|
||||
public void setYear(String year)
|
||||
{
|
||||
this.year = year;
|
||||
}
|
||||
|
||||
public String getYear()
|
||||
{
|
||||
return year;
|
||||
}
|
||||
public void setMonth(String month)
|
||||
{
|
||||
this.month = month;
|
||||
}
|
||||
|
||||
public String getMonth()
|
||||
{
|
||||
return month;
|
||||
}
|
||||
public void setDateType(String dateType)
|
||||
{
|
||||
this.dateType = dateType;
|
||||
}
|
||||
|
||||
public String getDateType()
|
||||
{
|
||||
return dateType;
|
||||
}
|
||||
public void setDateNumber(String dateNumber)
|
||||
{
|
||||
this.dateNumber = dateNumber;
|
||||
}
|
||||
|
||||
public String getDateNumber()
|
||||
{
|
||||
return dateNumber;
|
||||
}
|
||||
public void setDataOccupancyCapacity(String dataOccupancyCapacity)
|
||||
{
|
||||
this.dataOccupancyCapacity = dataOccupancyCapacity;
|
||||
}
|
||||
|
||||
public String getDataOccupancyCapacity()
|
||||
{
|
||||
return dataOccupancyCapacity;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("sysName", getSysName())
|
||||
.append("year", getYear())
|
||||
.append("month", getMonth())
|
||||
.append("dateType", getDateType())
|
||||
.append("dateNumber", getDateNumber())
|
||||
.append("dataOccupancyCapacity", getDataOccupancyCapacity())
|
||||
.append("remark", getRemark())
|
||||
.toString();
|
||||
}
|
||||
}
|
@ -0,0 +1,163 @@
|
||||
package com.god.comprehensiveSafetyData.domain;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.god.common.annotation.Excel;
|
||||
import com.god.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 运营分析对象 zhcj_operations_analysis
|
||||
*
|
||||
* @author Lxz
|
||||
* @date 2023-10-18
|
||||
*/
|
||||
public class ZhcjOperationsAnalysis extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键 */
|
||||
private String id;
|
||||
|
||||
/** 系统名称 */
|
||||
@Excel(name = "系统名称")
|
||||
private String sysName;
|
||||
|
||||
/** 开始运行时间 */
|
||||
@Excel(name = "开始运行时间")
|
||||
private String startDate;
|
||||
|
||||
/** 运行时长(天) */
|
||||
@Excel(name = "运行时长(天)")
|
||||
private String runTime;
|
||||
|
||||
/** 数据采集量 */
|
||||
@Excel(name = "数据采集量")
|
||||
private String dataCollectionVolume;
|
||||
|
||||
/** 预警总数 */
|
||||
@Excel(name = "预警总数")
|
||||
private String alertsNum;
|
||||
|
||||
/** 正常预警次数 */
|
||||
@Excel(name = "正常预警次数")
|
||||
private String alertsYes;
|
||||
|
||||
/** 异常预警次数 */
|
||||
@Excel(name = "异常预警次数")
|
||||
private String alertsNo;
|
||||
|
||||
/** 预警准确率 */
|
||||
@Excel(name = "预警准确率")
|
||||
private String accuracy;
|
||||
|
||||
/** 预留字段 */
|
||||
private String one;
|
||||
|
||||
public void setId(String id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setSysName(String sysName)
|
||||
{
|
||||
this.sysName = sysName;
|
||||
}
|
||||
|
||||
public String getSysName()
|
||||
{
|
||||
return sysName;
|
||||
}
|
||||
public void setStartDate(String startDate)
|
||||
{
|
||||
this.startDate = startDate;
|
||||
}
|
||||
|
||||
public String getStartDate()
|
||||
{
|
||||
return startDate;
|
||||
}
|
||||
public void setRunTime(String runTime)
|
||||
{
|
||||
this.runTime = runTime;
|
||||
}
|
||||
|
||||
public String getRunTime()
|
||||
{
|
||||
return runTime;
|
||||
}
|
||||
public void setDataCollectionVolume(String dataCollectionVolume)
|
||||
{
|
||||
this.dataCollectionVolume = dataCollectionVolume;
|
||||
}
|
||||
|
||||
public String getDataCollectionVolume()
|
||||
{
|
||||
return dataCollectionVolume;
|
||||
}
|
||||
public void setAlertsNum(String alertsNum)
|
||||
{
|
||||
this.alertsNum = alertsNum;
|
||||
}
|
||||
|
||||
public String getAlertsNum()
|
||||
{
|
||||
return alertsNum;
|
||||
}
|
||||
public void setAlertsYes(String alertsYes)
|
||||
{
|
||||
this.alertsYes = alertsYes;
|
||||
}
|
||||
|
||||
public String getAlertsYes()
|
||||
{
|
||||
return alertsYes;
|
||||
}
|
||||
public void setAlertsNo(String alertsNo)
|
||||
{
|
||||
this.alertsNo = alertsNo;
|
||||
}
|
||||
|
||||
public String getAlertsNo()
|
||||
{
|
||||
return alertsNo;
|
||||
}
|
||||
public void setAccuracy(String accuracy)
|
||||
{
|
||||
this.accuracy = accuracy;
|
||||
}
|
||||
|
||||
public String getAccuracy()
|
||||
{
|
||||
return accuracy;
|
||||
}
|
||||
public void setOne(String one)
|
||||
{
|
||||
this.one = one;
|
||||
}
|
||||
|
||||
public String getOne()
|
||||
{
|
||||
return one;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("sysName", getSysName())
|
||||
.append("startDate", getStartDate())
|
||||
.append("runTime", getRunTime())
|
||||
.append("dataCollectionVolume", getDataCollectionVolume())
|
||||
.append("alertsNum", getAlertsNum())
|
||||
.append("alertsYes", getAlertsYes())
|
||||
.append("alertsNo", getAlertsNo())
|
||||
.append("accuracy", getAccuracy())
|
||||
.append("remark", getRemark())
|
||||
.append("one", getOne())
|
||||
.toString();
|
||||
}
|
||||
}
|
@ -0,0 +1,64 @@
|
||||
package com.god.comprehensiveSafetyData.mapper;
|
||||
|
||||
import com.god.comprehensiveSafetyData.domain.ZhcjDataAsset;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 数据资产Mapper接口
|
||||
*
|
||||
* @author Lxz
|
||||
* @date 2023-10-18
|
||||
*/
|
||||
public interface ZhcjDataAssetMapper
|
||||
{
|
||||
/**
|
||||
* 查询数据资产
|
||||
*
|
||||
* @param id 数据资产主键
|
||||
* @return 数据资产
|
||||
*/
|
||||
public ZhcjDataAsset selectZhcjDataAssetById(String id);
|
||||
|
||||
/**
|
||||
* 查询数据资产列表
|
||||
*
|
||||
* @param zhcjDataAsset 数据资产
|
||||
* @return 数据资产集合
|
||||
*/
|
||||
public List<ZhcjDataAsset> selectZhcjDataAssetList(ZhcjDataAsset zhcjDataAsset);
|
||||
|
||||
/**
|
||||
* 新增数据资产
|
||||
*
|
||||
* @param zhcjDataAsset 数据资产
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertZhcjDataAsset(ZhcjDataAsset zhcjDataAsset);
|
||||
|
||||
/**
|
||||
* 修改数据资产
|
||||
*
|
||||
* @param zhcjDataAsset 数据资产
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateZhcjDataAsset(ZhcjDataAsset zhcjDataAsset);
|
||||
|
||||
/**
|
||||
* 删除数据资产
|
||||
*
|
||||
* @param id 数据资产主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteZhcjDataAssetById(String id);
|
||||
|
||||
/**
|
||||
* 批量删除数据资产
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteZhcjDataAssetByIds(String[] ids);
|
||||
|
||||
List<ZhcjDataAsset> selectDataAssetList(ZhcjDataAsset zhcjDataAsset);
|
||||
}
|
@ -0,0 +1,65 @@
|
||||
package com.god.comprehensiveSafetyData.mapper;
|
||||
|
||||
import com.god.comprehensiveSafetyData.domain.ZhcjOperationsAnalysis;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 运营分析Mapper接口
|
||||
*
|
||||
* @author Lxz
|
||||
* @date 2023-10-18
|
||||
*/
|
||||
public interface ZhcjOperationsAnalysisMapper
|
||||
{
|
||||
/**
|
||||
* 查询运营分析
|
||||
*
|
||||
* @param id 运营分析主键
|
||||
* @return 运营分析
|
||||
*/
|
||||
public ZhcjOperationsAnalysis selectZhcjOperationsAnalysisById(String id);
|
||||
|
||||
public ZhcjOperationsAnalysis selectZhcjOperationsAnalysisByDate(@Param("id") String id, @Param("endDate") String endDate);
|
||||
|
||||
/**
|
||||
* 查询运营分析列表
|
||||
*
|
||||
* @param zhcjOperationsAnalysis 运营分析
|
||||
* @return 运营分析集合
|
||||
*/
|
||||
public List<ZhcjOperationsAnalysis> selectZhcjOperationsAnalysisList(ZhcjOperationsAnalysis zhcjOperationsAnalysis);
|
||||
|
||||
/**
|
||||
* 新增运营分析
|
||||
*
|
||||
* @param zhcjOperationsAnalysis 运营分析
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertZhcjOperationsAnalysis(ZhcjOperationsAnalysis zhcjOperationsAnalysis);
|
||||
|
||||
/**
|
||||
* 修改运营分析
|
||||
*
|
||||
* @param zhcjOperationsAnalysis 运营分析
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateZhcjOperationsAnalysis(ZhcjOperationsAnalysis zhcjOperationsAnalysis);
|
||||
|
||||
/**
|
||||
* 删除运营分析
|
||||
*
|
||||
* @param id 运营分析主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteZhcjOperationsAnalysisById(String id);
|
||||
|
||||
/**
|
||||
* 批量删除运营分析
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteZhcjOperationsAnalysisByIds(String[] ids);
|
||||
}
|
@ -0,0 +1,65 @@
|
||||
package com.god.comprehensiveSafetyData.service;
|
||||
|
||||
import com.god.comprehensiveSafetyData.domain.EchartsPie;
|
||||
import com.god.comprehensiveSafetyData.domain.ZhcjDataAsset;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 数据资产Service接口
|
||||
*
|
||||
* @author Lxz
|
||||
* @date 2023-10-18
|
||||
*/
|
||||
public interface IZhcjDataAssetService
|
||||
{
|
||||
/**
|
||||
* 查询数据资产
|
||||
*
|
||||
* @param id 数据资产主键
|
||||
* @return 数据资产
|
||||
*/
|
||||
public ZhcjDataAsset selectZhcjDataAssetById(String id);
|
||||
|
||||
/**
|
||||
* 查询数据资产列表
|
||||
*
|
||||
* @param zhcjDataAsset 数据资产
|
||||
* @return 数据资产集合
|
||||
*/
|
||||
public List<ZhcjDataAsset> selectZhcjDataAssetList(ZhcjDataAsset zhcjDataAsset);
|
||||
|
||||
/**
|
||||
* 新增数据资产
|
||||
*
|
||||
* @param zhcjDataAsset 数据资产
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertZhcjDataAsset(ZhcjDataAsset zhcjDataAsset);
|
||||
|
||||
/**
|
||||
* 修改数据资产
|
||||
*
|
||||
* @param zhcjDataAsset 数据资产
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateZhcjDataAsset(ZhcjDataAsset zhcjDataAsset);
|
||||
|
||||
/**
|
||||
* 批量删除数据资产
|
||||
*
|
||||
* @param ids 需要删除的数据资产主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteZhcjDataAssetByIds(String[] ids);
|
||||
|
||||
/**
|
||||
* 删除数据资产信息
|
||||
*
|
||||
* @param id 数据资产主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteZhcjDataAssetById(String id);
|
||||
|
||||
List<EchartsPie> getPieData(ZhcjDataAsset zhcjDataAsset);
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.god.comprehensiveSafetyData.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.god.comprehensiveSafetyData.domain.ZhcjOperationsAnalysis;
|
||||
|
||||
/**
|
||||
* 运营分析Service接口
|
||||
*
|
||||
* @author Lxz
|
||||
* @date 2023-10-18
|
||||
*/
|
||||
public interface IZhcjOperationsAnalysisService
|
||||
{
|
||||
/**
|
||||
* 查询运营分析
|
||||
*
|
||||
* @param id 运营分析主键
|
||||
* @return 运营分析
|
||||
*/
|
||||
public ZhcjOperationsAnalysis selectZhcjOperationsAnalysisById(String id);
|
||||
|
||||
/**
|
||||
* 查询运营分析列表
|
||||
*
|
||||
* @param zhcjOperationsAnalysis 运营分析
|
||||
* @return 运营分析集合
|
||||
*/
|
||||
public List<ZhcjOperationsAnalysis> selectZhcjOperationsAnalysisList(ZhcjOperationsAnalysis zhcjOperationsAnalysis);
|
||||
|
||||
/**
|
||||
* 新增运营分析
|
||||
*
|
||||
* @param zhcjOperationsAnalysis 运营分析
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertZhcjOperationsAnalysis(ZhcjOperationsAnalysis zhcjOperationsAnalysis);
|
||||
|
||||
/**
|
||||
* 修改运营分析
|
||||
*
|
||||
* @param zhcjOperationsAnalysis 运营分析
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateZhcjOperationsAnalysis(ZhcjOperationsAnalysis zhcjOperationsAnalysis);
|
||||
|
||||
/**
|
||||
* 批量删除运营分析
|
||||
*
|
||||
* @param ids 需要删除的运营分析主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteZhcjOperationsAnalysisByIds(String[] ids);
|
||||
|
||||
/**
|
||||
* 删除运营分析信息
|
||||
*
|
||||
* @param id 运营分析主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteZhcjOperationsAnalysisById(String id);
|
||||
}
|
@ -0,0 +1,104 @@
|
||||
package com.god.comprehensiveSafetyData.service.impl;
|
||||
|
||||
import com.god.common.utils.uuid.IdUtils;
|
||||
import com.god.comprehensiveSafetyData.domain.EchartsPie;
|
||||
import com.god.comprehensiveSafetyData.domain.ZhcjDataAsset;
|
||||
import com.god.comprehensiveSafetyData.mapper.ZhcjDataAssetMapper;
|
||||
import com.god.comprehensiveSafetyData.service.IZhcjDataAssetService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 数据资产Service业务层处理
|
||||
*
|
||||
* @author Lxz
|
||||
* @date 2023-10-18
|
||||
*/
|
||||
@Service
|
||||
public class ZhcjDataAssetServiceImpl implements IZhcjDataAssetService {
|
||||
@Resource
|
||||
private ZhcjDataAssetMapper zhcjDataAssetMapper;
|
||||
|
||||
/**
|
||||
* 查询数据资产
|
||||
*
|
||||
* @param id 数据资产主键
|
||||
* @return 数据资产
|
||||
*/
|
||||
@Override
|
||||
public ZhcjDataAsset selectZhcjDataAssetById(String id) {
|
||||
return zhcjDataAssetMapper.selectZhcjDataAssetById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询数据资产列表
|
||||
*
|
||||
* @param zhcjDataAsset 数据资产
|
||||
* @return 数据资产
|
||||
*/
|
||||
@Override
|
||||
public List<ZhcjDataAsset> selectZhcjDataAssetList(ZhcjDataAsset zhcjDataAsset) {
|
||||
return zhcjDataAssetMapper.selectZhcjDataAssetList(zhcjDataAsset);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增数据资产
|
||||
*
|
||||
* @param zhcjDataAsset 数据资产
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertZhcjDataAsset(ZhcjDataAsset zhcjDataAsset) {
|
||||
zhcjDataAsset.setId(IdUtils.fastUUID());
|
||||
return zhcjDataAssetMapper.insertZhcjDataAsset(zhcjDataAsset);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改数据资产
|
||||
*
|
||||
* @param zhcjDataAsset 数据资产
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateZhcjDataAsset(ZhcjDataAsset zhcjDataAsset) {
|
||||
return zhcjDataAssetMapper.updateZhcjDataAsset(zhcjDataAsset);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除数据资产
|
||||
*
|
||||
* @param ids 需要删除的数据资产主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteZhcjDataAssetByIds(String[] ids) {
|
||||
return zhcjDataAssetMapper.deleteZhcjDataAssetByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除数据资产信息
|
||||
*
|
||||
* @param id 数据资产主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteZhcjDataAssetById(String id) {
|
||||
return zhcjDataAssetMapper.deleteZhcjDataAssetById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<EchartsPie> getPieData(ZhcjDataAsset zhcjDataAsset) {
|
||||
List<EchartsPie> echartsPies = new ArrayList<>();
|
||||
System.out.println(zhcjDataAssetMapper.selectDataAssetList(zhcjDataAsset));
|
||||
for (ZhcjDataAsset dataAsset : zhcjDataAssetMapper.selectDataAssetList(zhcjDataAsset)) {
|
||||
EchartsPie echartsPie = new EchartsPie();
|
||||
echartsPie.setName(dataAsset.getSysName());
|
||||
echartsPie.setValue(dataAsset.getDateNumber());
|
||||
echartsPies.add(echartsPie);
|
||||
}
|
||||
return echartsPies;
|
||||
}
|
||||
}
|
@ -0,0 +1,106 @@
|
||||
package com.god.comprehensiveSafetyData.service.impl;
|
||||
|
||||
import com.god.common.utils.uuid.IdUtils;
|
||||
import com.god.comprehensiveSafetyData.domain.ZhcjOperationsAnalysis;
|
||||
import com.god.comprehensiveSafetyData.mapper.ZhcjOperationsAnalysisMapper;
|
||||
import com.god.comprehensiveSafetyData.service.IZhcjOperationsAnalysisService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 运营分析Service业务层处理
|
||||
*
|
||||
* @author Lxz
|
||||
* @date 2023-10-18
|
||||
*/
|
||||
@Service
|
||||
public class ZhcjOperationsAnalysisServiceImpl implements IZhcjOperationsAnalysisService {
|
||||
@Resource
|
||||
private ZhcjOperationsAnalysisMapper zhcjOperationsAnalysisMapper;
|
||||
|
||||
/**
|
||||
* 查询运营分析
|
||||
*
|
||||
* @param id 运营分析主键
|
||||
* @return 运营分析
|
||||
*/
|
||||
@Override
|
||||
public ZhcjOperationsAnalysis selectZhcjOperationsAnalysisById(String id) {
|
||||
return zhcjOperationsAnalysisMapper.selectZhcjOperationsAnalysisById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询运营分析列表
|
||||
*
|
||||
* @param zhcjOperationsAnalysis 运营分析
|
||||
* @return 运营分析
|
||||
*/
|
||||
@Override
|
||||
public List<ZhcjOperationsAnalysis> selectZhcjOperationsAnalysisList(ZhcjOperationsAnalysis zhcjOperationsAnalysis) {
|
||||
List<ZhcjOperationsAnalysis> zhcjOperationsAnalyses = zhcjOperationsAnalysisMapper.selectZhcjOperationsAnalysisList(zhcjOperationsAnalysis);
|
||||
for (ZhcjOperationsAnalysis operationsAnalysis : zhcjOperationsAnalyses) {
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
ZhcjOperationsAnalysis zhcjOperationsAnalysis1 = zhcjOperationsAnalysisMapper.selectZhcjOperationsAnalysisByDate(operationsAnalysis.getId(), sdf.format(System.currentTimeMillis()));
|
||||
|
||||
ZhcjOperationsAnalysis zhcj = new ZhcjOperationsAnalysis();
|
||||
zhcj.setId(operationsAnalysis.getId());
|
||||
float runDate = Integer.parseInt(zhcjOperationsAnalysis1.getRunTime()) - 480;
|
||||
BigDecimal time = new BigDecimal(runDate / 60 / 24);
|
||||
time = time.setScale(2, RoundingMode.HALF_UP);
|
||||
zhcj.setRunTime(String.valueOf(time));
|
||||
operationsAnalysis.setRunTime(String.valueOf(time));
|
||||
zhcjOperationsAnalysisMapper.updateZhcjOperationsAnalysis(zhcj);
|
||||
}
|
||||
return zhcjOperationsAnalyses;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增运营分析
|
||||
*
|
||||
* @param zhcjOperationsAnalysis 运营分析
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertZhcjOperationsAnalysis(ZhcjOperationsAnalysis zhcjOperationsAnalysis) {
|
||||
zhcjOperationsAnalysis.setId(IdUtils.fastUUID());
|
||||
return zhcjOperationsAnalysisMapper.insertZhcjOperationsAnalysis(zhcjOperationsAnalysis);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改运营分析
|
||||
*
|
||||
* @param zhcjOperationsAnalysis 运营分析
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateZhcjOperationsAnalysis(ZhcjOperationsAnalysis zhcjOperationsAnalysis) {
|
||||
return zhcjOperationsAnalysisMapper.updateZhcjOperationsAnalysis(zhcjOperationsAnalysis);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除运营分析
|
||||
*
|
||||
* @param ids 需要删除的运营分析主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteZhcjOperationsAnalysisByIds(String[] ids) {
|
||||
return zhcjOperationsAnalysisMapper.deleteZhcjOperationsAnalysisByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除运营分析信息
|
||||
*
|
||||
* @param id 运营分析主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteZhcjOperationsAnalysisById(String id) {
|
||||
return zhcjOperationsAnalysisMapper.deleteZhcjOperationsAnalysisById(id);
|
||||
}
|
||||
}
|
@ -0,0 +1,129 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.god.comprehensiveSafetyData.mapper.ZhcjDataAssetMapper">
|
||||
|
||||
<resultMap type="ZhcjDataAsset" id="ZhcjDataAssetResult">
|
||||
<result property="id" column="id"/>
|
||||
<result property="sysName" column="sys_name"/>
|
||||
<result property="year" column="year"/>
|
||||
<result property="month" column="month"/>
|
||||
<result property="dateType" column="date_type"/>
|
||||
<result property="dateNumber" column="date_number"/>
|
||||
<result property="dataOccupancyCapacity" column="data_occupancy_capacity"/>
|
||||
<result property="remark" column="remark"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectZhcjDataAssetVo">
|
||||
select id, sys_name, year, month, date_type, date_number, data_occupancy_capacity, remark
|
||||
from zhcj_data_asset
|
||||
</sql>
|
||||
|
||||
<select id="selectZhcjDataAssetList" parameterType="ZhcjDataAsset" resultMap="ZhcjDataAssetResult">
|
||||
<include refid="selectZhcjDataAssetVo"/>
|
||||
<where>
|
||||
<if test="sysName != null and sysName != ''"> and sys_name like concat('%',
|
||||
#{sysName},
|
||||
'%'
|
||||
)</if>
|
||||
<if test="year != null and year != ''"> and year =
|
||||
#{year}</if>
|
||||
<if test="month != null and month != ''"> and month =
|
||||
#{month}</if>
|
||||
<if test="dateType != null and dateType != ''"> and date_type =
|
||||
#{dateType}</if>
|
||||
<if test="dateNumber != null and dateNumber != ''"> and date_number =
|
||||
#{dateNumber}</if>
|
||||
<if test="dataOccupancyCapacity != null and dataOccupancyCapacity != ''"> and data_occupancy_capacity =
|
||||
#{dataOccupancyCapacity}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectZhcjDataAssetById" parameterType="String" resultMap="ZhcjDataAssetResult">
|
||||
<include refid="selectZhcjDataAssetVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
<select id="selectDataAssetList" parameterType="ZhcjDataAsset" resultMap="ZhcjDataAssetResult">
|
||||
select sys_name, sum(date_number) as date_number
|
||||
from zhcj_data_asset
|
||||
group by sys_name
|
||||
</select>
|
||||
|
||||
<insert id="insertZhcjDataAsset" parameterType="ZhcjDataAsset">
|
||||
insert into zhcj_data_asset
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">id
|
||||
,</if>
|
||||
<if test="sysName != null">sys_name
|
||||
,</if>
|
||||
<if test="year != null">year,</if>
|
||||
<if test="month != null">month,</if>
|
||||
<if test="dateType != null">date_type
|
||||
,</if>
|
||||
<if test="dateNumber != null">date_number
|
||||
,</if>
|
||||
<if test="dataOccupancyCapacity != null">data_occupancy_capacity
|
||||
,</if>
|
||||
<if test="remark != null">remark
|
||||
,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id}
|
||||
,</if>
|
||||
<if test="sysName != null">#{sysName}
|
||||
,</if>
|
||||
<if test="year != null">#{year}
|
||||
,</if>
|
||||
<if test="month != null">#{month}
|
||||
,</if>
|
||||
<if test="dateType != null">#{dateType}
|
||||
,</if>
|
||||
<if test="dateNumber != null">#{dateNumber}
|
||||
,</if>
|
||||
<if test="dataOccupancyCapacity != null">#{dataOccupancyCapacity}
|
||||
,</if>
|
||||
<if test="remark != null">#{remark}
|
||||
,</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateZhcjDataAsset" parameterType="ZhcjDataAsset">
|
||||
update zhcj_data_asset
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="sysName != null">sys_name
|
||||
=
|
||||
#{sysName},</if>
|
||||
<if test="year != null">year =
|
||||
#{year},</if>
|
||||
<if test="month != null">month =
|
||||
#{month},</if>
|
||||
<if test="dateType != null">date_type
|
||||
=
|
||||
#{dateType},</if>
|
||||
<if test="dateNumber != null">date_number
|
||||
=
|
||||
#{dateNumber},</if>
|
||||
<if test="dataOccupancyCapacity != null">data_occupancy_capacity
|
||||
=
|
||||
#{dataOccupancyCapacity},</if>
|
||||
<if test="remark != null">remark
|
||||
=
|
||||
#{remark},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteZhcjDataAssetById" parameterType="String">
|
||||
delete
|
||||
from zhcj_data_asset
|
||||
where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteZhcjDataAssetByIds" parameterType="String">
|
||||
delete from zhcj_data_asset where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
@ -0,0 +1,172 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.god.comprehensiveSafetyData.mapper.ZhcjOperationsAnalysisMapper">
|
||||
|
||||
<resultMap type="ZhcjOperationsAnalysis" id="ZhcjOperationsAnalysisResult">
|
||||
<result property="id" column="id"/>
|
||||
<result property="sysName" column="sys_name"/>
|
||||
<result property="startDate" column="start_date"/>
|
||||
<result property="runTime" column="run_time"/>
|
||||
<result property="dataCollectionVolume" column="data_collection_volume"/>
|
||||
<result property="alertsNum" column="alerts_num"/>
|
||||
<result property="alertsYes" column="alerts_yes"/>
|
||||
<result property="alertsNo" column="alerts_no"/>
|
||||
<result property="accuracy" column="accuracy"/>
|
||||
<result property="remark" column="remark"/>
|
||||
<result property="one" column="one"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectZhcjOperationsAnalysisVo">
|
||||
select id,
|
||||
sys_name,
|
||||
start_date,
|
||||
run_time,
|
||||
data_collection_volume,
|
||||
alerts_num,
|
||||
alerts_yes,
|
||||
alerts_no,
|
||||
accuracy,
|
||||
remark,
|
||||
one
|
||||
from zhcj_operations_analysis
|
||||
</sql>
|
||||
|
||||
<select id="selectZhcjOperationsAnalysisList" parameterType="ZhcjOperationsAnalysis"
|
||||
resultMap="ZhcjOperationsAnalysisResult">
|
||||
<include refid="selectZhcjOperationsAnalysisVo"/>
|
||||
<where>
|
||||
<if test="sysName != null and sysName != ''"> and sys_name like concat('%',
|
||||
#{sysName},
|
||||
'%'
|
||||
)</if>
|
||||
<if test="startDate != null and startDate != ''"> and start_date =
|
||||
#{startDate}</if>
|
||||
<if test="runTime != null and runTime != ''"> and run_time =
|
||||
#{runTime}</if>
|
||||
<if test="dataCollectionVolume != null and dataCollectionVolume != ''"> and data_collection_volume =
|
||||
#{dataCollectionVolume}</if>
|
||||
<if test="alertsNum != null and alertsNum != ''"> and alerts_num =
|
||||
#{alertsNum}</if>
|
||||
<if test="alertsYes != null and alertsYes != ''"> and alerts_yes =
|
||||
#{alertsYes}</if>
|
||||
<if test="alertsNo != null and alertsNo != ''"> and alerts_no =
|
||||
#{alertsNo}</if>
|
||||
<if test="accuracy != null and accuracy != ''"> and accuracy =
|
||||
#{accuracy}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectZhcjOperationsAnalysisById" parameterType="String" resultMap="ZhcjOperationsAnalysisResult">
|
||||
<include refid="selectZhcjOperationsAnalysisVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
<select id="selectZhcjOperationsAnalysisByDate" resultMap="ZhcjOperationsAnalysisResult">
|
||||
SELECT TIMESTAMPDIFF(MINUTE, start_date, #{endDate}) AS run_time
|
||||
FROM zhcj_operations_analysis
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertZhcjOperationsAnalysis" parameterType="ZhcjOperationsAnalysis">
|
||||
insert into zhcj_operations_analysis
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">id
|
||||
,</if>
|
||||
<if test="sysName != null">sys_name
|
||||
,</if>
|
||||
<if test="startDate != null">start_date
|
||||
,</if>
|
||||
<if test="runTime != null">run_time
|
||||
,</if>
|
||||
<if test="dataCollectionVolume != null">data_collection_volume
|
||||
,</if>
|
||||
<if test="alertsNum != null">alerts_num
|
||||
,</if>
|
||||
<if test="alertsYes != null">alerts_yes
|
||||
,</if>
|
||||
<if test="alertsNo != null">alerts_no
|
||||
,</if>
|
||||
<if test="accuracy != null">accuracy
|
||||
,</if>
|
||||
<if test="remark != null">remark
|
||||
,</if>
|
||||
<if test="one != null">one
|
||||
,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id}
|
||||
,</if>
|
||||
<if test="sysName != null">#{sysName}
|
||||
,</if>
|
||||
<if test="startDate != null">#{startDate}
|
||||
,</if>
|
||||
<if test="runTime != null">#{runTime}
|
||||
,</if>
|
||||
<if test="dataCollectionVolume != null">#{dataCollectionVolume}
|
||||
,</if>
|
||||
<if test="alertsNum != null">#{alertsNum}
|
||||
,</if>
|
||||
<if test="alertsYes != null">#{alertsYes}
|
||||
,</if>
|
||||
<if test="alertsNo != null">#{alertsNo}
|
||||
,</if>
|
||||
<if test="accuracy != null">#{accuracy}
|
||||
,</if>
|
||||
<if test="remark != null">#{remark}
|
||||
,</if>
|
||||
<if test="one != null">#{one}
|
||||
,</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateZhcjOperationsAnalysis" parameterType="ZhcjOperationsAnalysis">
|
||||
update zhcj_operations_analysis
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="sysName != null">sys_name
|
||||
=
|
||||
#{sysName},</if>
|
||||
<if test="startDate != null">start_date
|
||||
=
|
||||
#{startDate},</if>
|
||||
<if test="runTime != null">run_time
|
||||
=
|
||||
#{runTime},</if>
|
||||
<if test="dataCollectionVolume != null">data_collection_volume
|
||||
=
|
||||
#{dataCollectionVolume},</if>
|
||||
<if test="alertsNum != null">alerts_num
|
||||
=
|
||||
#{alertsNum},</if>
|
||||
<if test="alertsYes != null">alerts_yes
|
||||
=
|
||||
#{alertsYes},</if>
|
||||
<if test="alertsNo != null">alerts_no
|
||||
=
|
||||
#{alertsNo},</if>
|
||||
<if test="accuracy != null">accuracy
|
||||
=
|
||||
#{accuracy},</if>
|
||||
<if test="remark != null">remark
|
||||
=
|
||||
#{remark},</if>
|
||||
<if test="one != null">one
|
||||
=
|
||||
#{one},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteZhcjOperationsAnalysisById" parameterType="String">
|
||||
delete
|
||||
from zhcj_operations_analysis
|
||||
where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteZhcjOperationsAnalysisByIds" parameterType="String">
|
||||
delete from zhcj_operations_analysis where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
53
god-ui/src/api/comprehensiveSafetyData/dataAssets.js
Normal file
53
god-ui/src/api/comprehensiveSafetyData/dataAssets.js
Normal file
@ -0,0 +1,53 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询数据资产列表
|
||||
export function listDataAssets(query) {
|
||||
return request({
|
||||
url: '/dataAssets/dataAssets/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询数据资产列表
|
||||
export function getPieData(query) {
|
||||
return request({
|
||||
url: '/dataAssets/dataAssets/getPieData',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询数据资产详细
|
||||
export function getDataAssets(id) {
|
||||
return request({
|
||||
url: '/dataAssets/dataAssets/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增数据资产
|
||||
export function addDataAssets(data) {
|
||||
return request({
|
||||
url: '/dataAssets/dataAssets',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改数据资产
|
||||
export function updateDataAssets(data) {
|
||||
return request({
|
||||
url: '/dataAssets/dataAssets',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除数据资产
|
||||
export function delDataAssets(id) {
|
||||
return request({
|
||||
url: '/dataAssets/dataAssets/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
44
god-ui/src/api/comprehensiveSafetyData/operationsAnalysis.js
Normal file
44
god-ui/src/api/comprehensiveSafetyData/operationsAnalysis.js
Normal file
@ -0,0 +1,44 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询运营分析列表
|
||||
export function listOperationsAnalysis(query) {
|
||||
return request({
|
||||
url: '/operationsAnalysis/operationsAnalysis/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询运营分析详细
|
||||
export function getOperationsAnalysis(id) {
|
||||
return request({
|
||||
url: '/operationsAnalysis/operationsAnalysis/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增运营分析
|
||||
export function addOperationsAnalysis(data) {
|
||||
return request({
|
||||
url: '/operationsAnalysis/operationsAnalysis',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改运营分析
|
||||
export function updateOperationsAnalysis(data) {
|
||||
return request({
|
||||
url: '/operationsAnalysis/operationsAnalysis',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除运营分析
|
||||
export function delOperationsAnalysis(id) {
|
||||
return request({
|
||||
url: '/operationsAnalysis/operationsAnalysis/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
@ -37,7 +37,10 @@ import DictTag from '@/components/DictTag'
|
||||
import VueMeta from 'vue-meta'
|
||||
// 字典数据组件
|
||||
import DictData from '@/components/DictData'
|
||||
|
||||
// 引入echarts
|
||||
import * as echarts from "echarts";
|
||||
// 挂载到vue实例中
|
||||
Vue.prototype.$echarts = echarts;
|
||||
// 全局方法挂载
|
||||
Vue.prototype.getDicts = getDicts
|
||||
Vue.prototype.getConfigKey = getConfigKey
|
||||
|
536
god-ui/src/views/comprehensiveSafetyData/dataAssets/index.vue
Normal file
536
god-ui/src/views/comprehensiveSafetyData/dataAssets/index.vue
Normal file
@ -0,0 +1,536 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-tabs type="border-card" @tab-click="handleChange()">
|
||||
<el-tab-pane label="数据资产">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch"
|
||||
label-width="68px"
|
||||
>
|
||||
<el-form-item label="系统名称" prop="sysName">
|
||||
<el-input
|
||||
v-model="queryParams.sysName"
|
||||
placeholder="请输入系统名称"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="年份" prop="year">
|
||||
<el-input
|
||||
v-model="queryParams.year"
|
||||
placeholder="请输入年份"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="月份" prop="month">
|
||||
<el-input
|
||||
v-model="queryParams.month"
|
||||
placeholder="请输入月份"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['dataAssets:dataAssets:add']"
|
||||
>新增
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['dataAssets:dataAssets:edit']"
|
||||
>修改
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['dataAssets:dataAssets:remove']"
|
||||
>删除
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['dataAssets:dataAssets:export']"
|
||||
>导出
|
||||
</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="dataAssetsList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center"/>
|
||||
<!-- <el-table-column label="主键" align="center" prop="id" />-->
|
||||
<el-table-column label="系统名称" align="center" prop="sysName"/>
|
||||
<el-table-column label="年份" align="center" prop="year"/>
|
||||
<el-table-column label="月份" align="center" prop="month"/>
|
||||
<el-table-column label="数据类型" align="center" prop="dateType"/>
|
||||
<el-table-column label="数据量" align="center" prop="dateNumber"/>
|
||||
<el-table-column label="数据占用容量" align="center" prop="dataOccupancyCapacity"/>
|
||||
<el-table-column label="备注" align="center" prop="remark"/>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['dataAssets:dataAssets:edit']"
|
||||
>修改
|
||||
</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['dataAssets:dataAssets:remove']"
|
||||
>删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="统计图">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<div class="grid-content bg-purple">
|
||||
<div
|
||||
id="ChartPie"
|
||||
class="char-pie"
|
||||
/>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<div class="grid-content bg-purple">
|
||||
<div
|
||||
id="ChartBar"
|
||||
class="char-pie"
|
||||
/>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
|
||||
|
||||
<!-- 添加或修改数据资产对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="系统名称" prop="sysName">
|
||||
<el-input v-model="form.sysName" placeholder="请输入系统名称"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="年份" prop="year">
|
||||
<el-input v-model="form.year" placeholder="请输入年份"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="月份" prop="month">
|
||||
<el-input v-model="form.month" placeholder="请输入月份"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="数据量" prop="dateNumber">
|
||||
<el-input v-model="form.dateNumber" placeholder="请输入数据量"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="数据占用容量" prop="dataOccupancyCapacity">
|
||||
<el-input v-model="form.dataOccupancyCapacity" placeholder="请输入数据占用容量"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" placeholder="请输入备注"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
listDataAssets,
|
||||
getDataAssets,
|
||||
delDataAssets,
|
||||
addDataAssets,
|
||||
updateDataAssets, getPieData
|
||||
} from '@/api/comprehensiveSafetyData/dataAssets'
|
||||
|
||||
export default {
|
||||
name: 'DataAssets',
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 数据资产表格数据
|
||||
dataAssetsList: [],
|
||||
// 弹出层标题
|
||||
title: '',
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
sysName: null,
|
||||
year: null,
|
||||
month: null,
|
||||
dateType: null,
|
||||
dateNumber: null,
|
||||
dataOccupancyCapacity: null,
|
||||
name:null,
|
||||
value:null
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {},
|
||||
echartPie: null,
|
||||
echartBar: null
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList()
|
||||
},
|
||||
mounted() {
|
||||
this.initEchart()
|
||||
},
|
||||
methods: {
|
||||
handleChange() {
|
||||
this.$nextTick(() => {
|
||||
this.echartBar.resize()
|
||||
this.echartPie.resize()
|
||||
})
|
||||
},
|
||||
initEchart() {
|
||||
this.getPieData();
|
||||
|
||||
this.echartBar = this.$echarts.init(document.getElementById('ChartBar'))
|
||||
this.echartBar.setOption(this.getBar())
|
||||
window.addEventListener('resize', () => {
|
||||
this.$nextTick(() => {
|
||||
this.echartBar.resize()
|
||||
this.echartPie.resize()
|
||||
})
|
||||
})
|
||||
},
|
||||
//获取饼图数据
|
||||
async getPieData() {
|
||||
this.echartPie = this.$echarts.init(document.getElementById('ChartPie'))
|
||||
const { rows } = await getPieData(this.queryParams)
|
||||
this.echartPie.setOption({
|
||||
// 饼图的option
|
||||
title: {
|
||||
text: '系统数据占比',
|
||||
subtext: '',
|
||||
left: 'left',
|
||||
},
|
||||
tooltip: {
|
||||
trigger: 'item'
|
||||
},
|
||||
legend: {
|
||||
orient: 'vertical',
|
||||
left: 'right'
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name: '系统数据占比',
|
||||
type: 'pie',
|
||||
radius: '50%',
|
||||
data: rows,
|
||||
emphasis: {
|
||||
itemStyle: {
|
||||
shadowBlur: 10,
|
||||
shadowOffsetX: 0,
|
||||
shadowColor: 'rgba(0, 0, 0, 0.5)'
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
})
|
||||
},
|
||||
getBar() {
|
||||
return {
|
||||
title: {
|
||||
text: '系统数据统计量(近半年)',
|
||||
subtext: '',
|
||||
left: 'left',
|
||||
},
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
axisPointer: {
|
||||
// Use axis to trigger tooltip
|
||||
type: 'shadow' // 'shadow' as default; can also be 'line' or 'shadow'
|
||||
}
|
||||
},
|
||||
legend: {
|
||||
left: 'right',
|
||||
show:false
|
||||
},
|
||||
grid: {
|
||||
left: '3%',
|
||||
right: '4%',
|
||||
bottom: '3%',
|
||||
containLabel: true
|
||||
},
|
||||
xAxis: {
|
||||
type: 'value'
|
||||
},
|
||||
yAxis: {
|
||||
type: 'category',
|
||||
data: ['5月', '6月', '7月', '8月', '9月', '10月']
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name: '客流统计预测分析系统',
|
||||
type: 'bar',
|
||||
stack: 'total',
|
||||
label: {
|
||||
show: true
|
||||
},
|
||||
emphasis: {
|
||||
focus: 'series'
|
||||
},
|
||||
data: [0, 0, 0, 23, 47, 30]
|
||||
},
|
||||
{
|
||||
name: '综合安防及应急响应系统',
|
||||
type: 'bar',
|
||||
stack: 'total',
|
||||
label: {
|
||||
show: true
|
||||
},
|
||||
emphasis: {
|
||||
focus: 'series'
|
||||
},
|
||||
data: [ 0, 0, 0, 56, 0, 0]
|
||||
},
|
||||
{
|
||||
name: '路测停车智能识别系统',
|
||||
type: 'bar',
|
||||
stack: 'total',
|
||||
label: {
|
||||
show: true
|
||||
},
|
||||
emphasis: {
|
||||
focus: 'series'
|
||||
},
|
||||
data: [0, 0, 0, 34, 12, 0]
|
||||
},
|
||||
{
|
||||
name: '车辆出入智能检测系统',
|
||||
type: 'bar',
|
||||
stack: 'total',
|
||||
label: {
|
||||
show: true
|
||||
},
|
||||
emphasis: {
|
||||
focus: 'series'
|
||||
},
|
||||
data: [ 0, 0, 0, 40, 56, 12]
|
||||
},
|
||||
]
|
||||
}
|
||||
},
|
||||
/** 查询数据资产列表 */
|
||||
getList() {
|
||||
this.loading = true
|
||||
listDataAssets(this.queryParams).then(response => {
|
||||
this.dataAssetsList = response.rows
|
||||
this.total = response.total
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false
|
||||
this.reset()
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
sysName: null,
|
||||
year: null,
|
||||
month: null,
|
||||
dateType: null,
|
||||
dateNumber: null,
|
||||
dataOccupancyCapacity: null,
|
||||
remark: null
|
||||
}
|
||||
this.resetForm('form')
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1
|
||||
this.getList()
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm('queryForm')
|
||||
this.handleQuery()
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.id)
|
||||
this.single = selection.length !== 1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset()
|
||||
this.open = true
|
||||
this.title = '添加数据资产'
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset()
|
||||
const id = row.id || this.ids
|
||||
getDataAssets(id).then(response => {
|
||||
this.form = response.data
|
||||
this.open = true
|
||||
this.title = '修改数据资产'
|
||||
})
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs['form'].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.id != null) {
|
||||
updateDataAssets(this.form).then(response => {
|
||||
this.$modal.msgSuccess('修改成功')
|
||||
this.open = false
|
||||
this.getList()
|
||||
})
|
||||
} else {
|
||||
addDataAssets(this.form).then(response => {
|
||||
this.$modal.msgSuccess('新增成功')
|
||||
this.open = false
|
||||
this.getList()
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ids = row.id || this.ids
|
||||
this.$modal.confirm('是否确认删除数据资产编号为"' + ids + '"的数据项?').then(function() {
|
||||
return delDataAssets(ids)
|
||||
}).then(() => {
|
||||
this.getList()
|
||||
this.$modal.msgSuccess('删除成功')
|
||||
}).catch(() => {
|
||||
})
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('dataAssets/dataAssets/export', {
|
||||
...this.queryParams
|
||||
}, `dataAssets_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.el-row {
|
||||
margin-bottom: 20px;
|
||||
|
||||
&:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.el-col {
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.bg-purple-dark {
|
||||
background: #99a9bf;
|
||||
}
|
||||
|
||||
.bg-purple {
|
||||
background: #f6f8fa;
|
||||
}
|
||||
|
||||
.bg-purple-light {
|
||||
background: #e5e9f2;
|
||||
}
|
||||
|
||||
.grid-content {
|
||||
border-radius: 4px;
|
||||
min-height: 600px;
|
||||
}
|
||||
|
||||
.row-bg {
|
||||
padding: 10px 0;
|
||||
background-color: #f9fafc;
|
||||
}
|
||||
|
||||
.content-title {
|
||||
width: 100%;
|
||||
height: 30px;
|
||||
}
|
||||
|
||||
.content-title-align {
|
||||
height: 0px;
|
||||
line-height: 0px;
|
||||
}
|
||||
|
||||
.content-font {
|
||||
color: #4b4b4e;
|
||||
font-weight: bold;
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
.content-float-left {
|
||||
float: left;
|
||||
}
|
||||
|
||||
.char-pie {
|
||||
width: 100%;
|
||||
height: 600px;
|
||||
}
|
||||
</style>
|
@ -0,0 +1,313 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="系统名称" prop="sysName">
|
||||
<el-input
|
||||
v-model="queryParams.sysName"
|
||||
placeholder="请输入系统名称"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['operationsAnalysis:operationsAnalysis:add']"
|
||||
>新增
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['operationsAnalysis:operationsAnalysis:edit']"
|
||||
>修改
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['operationsAnalysis:operationsAnalysis:remove']"
|
||||
>删除
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['operationsAnalysis:operationsAnalysis:export']"
|
||||
>导出
|
||||
</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="operationsAnalysisList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center"/>
|
||||
<el-table-column label="系统名称" align="center" prop="sysName"/>
|
||||
<el-table-column label="开始运行时间" align="center" prop="startDate" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.startDate, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="运行时长(天)" align="center" prop="runTime"/>
|
||||
<el-table-column label="数据采集量" align="center" prop="dataCollectionVolume"/>
|
||||
<el-table-column label="预警总数" align="center" prop="alertsNum"/>
|
||||
<el-table-column label="正常预警次数" align="center" prop="alertsYes"/>
|
||||
<el-table-column label="异常预警次数" align="center" prop="alertsNo"/>
|
||||
<el-table-column label="预警准确率" align="center" prop="accuracy"/>
|
||||
<el-table-column label="备注" align="center" prop="remark"/>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['operationsAnalysis:operationsAnalysis:edit']"
|
||||
>修改
|
||||
</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['operationsAnalysis:operationsAnalysis:remove']"
|
||||
>删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改运营分析对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="系统名称" prop="sysName">
|
||||
<el-input v-model="form.sysName" placeholder="请输入系统名称"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="开始运行时间" prop="startDate">
|
||||
<el-date-picker
|
||||
v-model="form.startDate"
|
||||
type="datetime"
|
||||
placeholder="选择时间"
|
||||
>
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="运行时长(天)" prop="runTime">-->
|
||||
<!-- <el-input v-model="form.runTime" placeholder="请输入运行时长(天)"/>-->
|
||||
<!-- </el-form-item>-->
|
||||
<el-form-item label="数据采集量" prop="dataCollectionVolume">
|
||||
<el-input v-model="form.dataCollectionVolume" placeholder="请输入数据采集量"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="预警总数" prop="alertsNum">
|
||||
<el-input v-model="form.alertsNum" placeholder="请输入预警总数"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="正常预警次数" prop="alertsYes">
|
||||
<el-input v-model="form.alertsYes" placeholder="请输入正常预警次数"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="异常预警次数" prop="alertsNo">
|
||||
<el-input v-model="form.alertsNo" placeholder="请输入异常预警次数"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="预警准确率" prop="accuracy">
|
||||
<el-input v-model="form.accuracy" placeholder="请输入预警准确率"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" placeholder="请输入备注"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
listOperationsAnalysis,
|
||||
getOperationsAnalysis,
|
||||
delOperationsAnalysis,
|
||||
addOperationsAnalysis,
|
||||
updateOperationsAnalysis
|
||||
} from '@/api/comprehensiveSafetyData/operationsAnalysis'
|
||||
|
||||
export default {
|
||||
name: 'OperationsAnalysis',
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 运营分析表格数据
|
||||
operationsAnalysisList: [],
|
||||
// 弹出层标题
|
||||
title: '',
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
sysName: null,
|
||||
startDate: null,
|
||||
runTime: null,
|
||||
dataCollectionVolume: null,
|
||||
alertsNum: null,
|
||||
alertsYes: null,
|
||||
alertsNo: null,
|
||||
accuracy: null
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
/** 查询运营分析列表 */
|
||||
getList() {
|
||||
this.loading = true
|
||||
listOperationsAnalysis(this.queryParams).then(response => {
|
||||
this.operationsAnalysisList = response.rows
|
||||
this.total = response.total
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false
|
||||
this.reset()
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
sysName: null,
|
||||
startDate: null,
|
||||
runTime: null,
|
||||
dataCollectionVolume: null,
|
||||
alertsNum: null,
|
||||
alertsYes: null,
|
||||
alertsNo: null,
|
||||
accuracy: null,
|
||||
remark: null,
|
||||
one: null
|
||||
}
|
||||
this.resetForm('form')
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1
|
||||
this.getList()
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm('queryForm')
|
||||
this.handleQuery()
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.id)
|
||||
this.single = selection.length !== 1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset()
|
||||
this.open = true
|
||||
this.title = '添加运营分析'
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset()
|
||||
const id = row.id || this.ids
|
||||
getOperationsAnalysis(id).then(response => {
|
||||
this.form = response.data
|
||||
this.open = true
|
||||
this.title = '修改运营分析'
|
||||
})
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs['form'].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.id != null) {
|
||||
updateOperationsAnalysis(this.form).then(response => {
|
||||
this.$modal.msgSuccess('修改成功')
|
||||
this.open = false
|
||||
this.getList()
|
||||
})
|
||||
} else {
|
||||
addOperationsAnalysis(this.form).then(response => {
|
||||
this.$modal.msgSuccess('新增成功')
|
||||
this.open = false
|
||||
this.getList()
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ids = row.id || this.ids
|
||||
this.$modal.confirm('是否确认删除运营分析编号为"' + ids + '"的数据项?').then(function() {
|
||||
return delOperationsAnalysis(ids)
|
||||
}).then(() => {
|
||||
this.getList()
|
||||
this.$modal.msgSuccess('删除成功')
|
||||
}).catch(() => {
|
||||
})
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('operationsAnalysis/operationsAnalysis/export', {
|
||||
...this.queryParams
|
||||
}, `operationsAnalysis_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
1410
god-ui/src/views/comprehensiveSafetyData/unifiedManagement/index.vue
Normal file
1410
god-ui/src/views/comprehensiveSafetyData/unifiedManagement/index.vue
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user