From 56de22fe4166f68601b68b9c57df32cc44425993 Mon Sep 17 00:00:00 2001
From: zmk <496160012@qq.com>
Date: 星期六, 18 五月 2024 14:44:35 +0800
Subject: [PATCH] 提交代码
---
javaweb-plus/javaweb-cms/src/main/resources/mapper/geo/HoleMapper.xml | 9 +
javaweb-plus/javaweb-admin/src/main/java/com/javaweb/web/controller/system/SysIndexController.java | 57 ++++++++
javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/mapper/HoleMapper.java | 12 +
javaweb-plus/javaweb-cms/src/main/resources/templates/geo/deviceLog/deviceLog.html | 22 ++-
javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/vo/ProjectProcessVO.java | 36 +++++
javaweb-plus/javaweb-admin/src/main/resources/templates/main.html | 256 ++++--------------------------------
6 files changed, 153 insertions(+), 239 deletions(-)
diff --git a/javaweb-plus/javaweb-admin/src/main/java/com/javaweb/web/controller/system/SysIndexController.java b/javaweb-plus/javaweb-admin/src/main/java/com/javaweb/web/controller/system/SysIndexController.java
index cee5d1e..e8b3d7a 100644
--- a/javaweb-plus/javaweb-admin/src/main/java/com/javaweb/web/controller/system/SysIndexController.java
+++ b/javaweb-plus/javaweb-admin/src/main/java/com/javaweb/web/controller/system/SysIndexController.java
@@ -1,6 +1,7 @@
package com.javaweb.web.controller.system;
import java.util.ArrayList;
+import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -8,8 +9,11 @@
import com.javaweb.common.core.domain.AjaxResult;
import com.javaweb.common.utils.Arith;
import com.javaweb.common.utils.StringUtils;
+import com.javaweb.geo.domain.Hole;
import com.javaweb.geo.domain.Project;
+import com.javaweb.geo.mapper.HoleMapper;
import com.javaweb.geo.service.IProjectService;
+import com.javaweb.geo.vo.ProjectProcessVO;
import com.javaweb.system.service.ISysConfigService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
@@ -45,6 +49,9 @@
@Autowired
private IProjectService projectService;
+
+ @Autowired
+ private HoleMapper holeMapper;
private String getAdminIndex(){
return configService.selectConfigByKey(CmsConstants.KEY_ADMIN_INDEX);
@@ -114,6 +121,56 @@
ajaxResult.put("projects",projects);
return ajaxResult;
}
+ /**
+ * 鎬昏繘搴�
+ * @return
+ */
+ @ResponseBody
+ @GetMapping("/system/totalProcess")
+ public AjaxResult totalProcess()
+ {
+ AjaxResult ajaxResult = AjaxResult.success();
+ Hole hole = holeMapper.selectHoleTotalProcess();
+ Double data = Arith.div(hole.getFootageCpl(),hole.getFootage(),2) ;
+ ajaxResult.put("pointerData",data);
+ return ajaxResult;
+ }
+
+ /**
+ * 鍦哄湴杩涘害
+ * @return
+ */
+ @ResponseBody
+ @GetMapping("/system/projectProcess")
+ public AjaxResult projectProcess()
+ {
+ AjaxResult ajaxResult = AjaxResult.success();
+ List<Hole> holes = holeMapper.selectHoleProjectProcess();
+ Map<String,Double> holeMap = new HashMap<>();
+ for(Hole hole : holes){
+ Double val = Arith.div(hole.getFootageCpl(),hole.getFootage(),2) ;
+ val = Arith.round(val * 100,2);
+ holeMap.put(hole.getProjectId(),val) ;
+ }
+
+ List<Project> projects = projectService.selectProjectList(new Project());
+ List<ProjectProcessVO> vos = new ArrayList<>();
+ for(int i = 0 ; i<projects.size();i++ ){
+ String ids= projects.get(i).getIds();
+ Double val = holeMap.get(ids);
+ ProjectProcessVO vo = new ProjectProcessVO();
+ vo.setRanking(i + 1);
+ vo.setStation(projects.get(i).getCode());
+ vo.setValue(val);
+ if(val==null){
+ vo.setValue(0.0d);
+ }
+ vos.add(vo);
+ }
+
+ ajaxResult.put("projectData",vos);
+ return ajaxResult;
+ }
}
diff --git a/javaweb-plus/javaweb-admin/src/main/resources/templates/main.html b/javaweb-plus/javaweb-admin/src/main/resources/templates/main.html
index ba0d2d9..ce0adc3 100644
--- a/javaweb-plus/javaweb-admin/src/main/resources/templates/main.html
+++ b/javaweb-plus/javaweb-admin/src/main/resources/templates/main.html
@@ -71,15 +71,14 @@
<th:block th:include="include :: sparkline-js" />
<th:block th:include="include :: footer" />
-<script type="text/javascript">
+ <script th:inline="javascript">
$(function() {
loadMap();
getReallyData();
totalProcess();
stationProcess();
- //getRegulatoryUnitChartData("","");
- //bindEvent();
+
})
// 鍔犺浇鍦板浘
let map=null;
@@ -169,17 +168,23 @@
}
function infoWindowProject(e){
+
+ let ids = e.ids + "";
var sContent =
"<div style='margin:0px;'>" +
"<div>" +
- "<div style='margin:5px 0px 5px 5px;'>" +
+ "<div style='margin:1px 0px 1px 2px;width: 200px;'>" +
"<font style='font-weight: bolder;'>鍦哄湴缂栧彿 :</font>" + e.code + "<br>" +
"<font style='font-weight: bolder;'>鍦哄湴鍚嶅瓧 :</font>" + e.fullName + "<br>" +
"<font style='font-weight: bolder;'>璐熻矗浜� :</font>" + e.leader + "<br>" +
+ "<a class='btn' onclick=viewdata(" +"'" + ids+ "'" + ")>鍦哄湴鏁版嵁</a>" +
"</div>" +
"</div>" +
"</div>";
return sContent;
+ }
+ function viewdata (id) {
+ $.modal.openTab("鍦哄湴瀵艰埅",ctx+ "/geo/project/navigate?ids="+id);
}
function addClickHandler(content, marker) {
@@ -194,41 +199,17 @@
map.openInfoWindow(markerInfoWin, point); //寮�鍚俊鎭獥鍙�
}
-
- // 椤甸潰鏁版嵁璧嬪��
- function pageAssignment(reallyData) {
- for ( let key in reallyData) {
- let className = "." + key;
- $(className).text(reallyData[key]);
- }
- }
-
- //鏌ヨ鐩戠鍗曚綅椤圭洰缁熻鍥捐〃鏁版嵁
- function getRegulatoryUnitChartData(startTime,endTime){
- let url = window.location.protocol + "//" + window.location.host + "/bjfw/geotdp/index/indexProjectNumsCollect";
- $.get(url,{
- startTime: startTime,
- endTime: endTime
- },function(res){
- if(res.status && res.message === "鎿嶄綔鎴愬姛"){
- let chartData = {};
- chartData.yData = res.result.map((item)=>{
- return item.fullName;
- })
- chartData.xData = res.result.map((item)=>{
- return item.projectNums;
- })
- loadRegulatoryUnitChart(chartData);
- }else{
- $.modal.alertError("璇锋眰鍑洪敊");
- }
-
- })
- }
-
+ //鎬昏繘搴︿华琛ㄧ洏
function totalProcess() {
var Chart1 = echarts.init(document.getElementById('Chart1'));
- var pointerData = 36; // 浠〃鎸囬拡鏁版嵁
+ var pointerData = 0; // 浠〃鎸囬拡鏁版嵁
+ let url = ctx + "/system/totalProcess";
+ $.ajaxSettings.async = false;
+ $.get(url,{},function(res){
+ pointerData = res.pointerData;
+ pointerData = (pointerData*100).toFixed(0);
+ })
+ $.ajaxSettings.async = false;
var option = {
backgroundColor: "#fff",
series: [
@@ -410,12 +391,10 @@
{ ranking: 32, station: '鍦哄湴032', value: 18.48 },
{ ranking: 33, station: '鍦哄湴033', value: 13.03 },
{ ranking: 34, station: '鍦哄湴034', value: 18.48 },
-
-
];
- var seriesName = ['',''];
+ var seriesName = ['宸插畬鎴愯繘搴�','鎬昏繘搴�'];
var attackSourcesColor1 = ['#FF557F','#FFAA00','#5470C6','#1E9FFF'];
var attackSourcesColor = [
@@ -438,9 +417,17 @@
];
function stationProcess() {
+
+ let url = ctx + "/system/projectProcess";
+ $.ajaxSettings.async = false;
+ $.get(url,{},function(res){
+ console.log(res.projectData);
+ datas = res.projectData;
+ })
+ $.ajaxSettings.async = false;
+
+
var Chart2 = echarts.init(document.getElementById('Chart2'));
-
-
var rankings = [];
var stationData = [];
var values = [];
@@ -450,7 +437,6 @@
stationData.push(it.station);
values.push(it.value);
});
-
option = {
// backgroundColor: '#000',
@@ -657,192 +643,8 @@
return false;
}
- //鍔犺浇鐩戠鍗曚綅椤圭洰缁熻鍥捐〃
- function loadRegulatoryUnitChart(chartData){
- var myChart = echarts.init(document.getElementById('rank_chart'));
- let beginColor = "rgb(255,140,0,0.1)",
- endColor = "rgb(255,140,0,1)",
- endPix = "";
- //let endZom = 50;
- let option = {
- title: {
- show: false,
- },
- dataZoom: [
- {
- type: "inside",
- start: 0,
- // end: endZom,
- orient: "vertical",
- zoomOnMouseWheel: false, ////婊氳疆鏄惁瑙﹀彂缂╂斁
- },
- ],
- tooltip: {
- trigger: "axis",
- axisPointer: {
- type: "shadow",
- },
- },
- legend: {
- bottom: 20,
- right: 0,
- textStyle: {
- color: "#666",
- fontSize: 18,
- },
- orient: "vertical",
- },
- grid: {
- borderWidth: 0,
- top: "8%",
- left: "1%",
- right: "8%",
- bottom: "2%",
- },
- color: "#fff",
- yAxis: [
- {
- type: "category",
- inverse: true,
- axisLine: {
- show: false,
- },
- splitLine: {
- show: false,
- },
- axisTick: {
- show: false,
- },
- axisLabel: {
- show: false,
- },
- data: chartData.yData,
- },
- ],
- xAxis: {
- type: "value",
- axisTick: {
- show: false,
- },
- axisLine: {
- show: false,
- },
- splitLine: {
- show: false,
- },
- axisLabel: {
- show: false,
- },
- },
- series: [
- {
- name: "绱",
- type: "bar",
- barWidth: "10px",
- itemStyle: {
- normal: {
- show: true,
- color: new echarts.graphic.LinearGradient(0, 0, 1, 0, [
- {
- offset: 0,
- color: beginColor,
- },
- {
- offset: 1,
- color: endColor,
- },
- ]),
- barBorderRadius: [0, 5, 5, 0],
- },
- emphasis: {
- shadowBlur: 15,
- shadowColor: "rgba(0, 0, 0, 0.1)",
- },
- },
- data: chartData.xData,
- animationDuration: 1500,
- label: {
- normal: {
- color: "black",
- show: true,
- position: "right",
- fontSize: 18,
- fontStyle: "italic",
- formatter: function (para) {
- return para.data + endPix;
- },
- },
- },
- },
- {
- type: "bar",
- barGap: "0",
- barWidth: 10,
- animation: false,
- itemStyle: {
- color: "transparent",
- },
- tooltip: {
- show: false,
- },
- label: {
- show: true,
- position: ["0", "-35"],
- fontSize: 13,
- color: "rgb(0,0,0,0.7)",
- formatter: function (param) {
- return param.dataIndex + 1 + " " + param.name;
- },
- },
- data: chartData.xData,
- },
-
- ],
- animationEasing: "cubicOut",
- };
-
- myChart.setOption(option);
- }
-
- //缁戝畾浜嬩欢
- function bindEvent(){
- $(".statistic-btn .btn").on("click",function(){
- if(this.innerText === "鎬昏"){
- getRegulatoryUnitChartData("","");
- }else if(this.innerText === "鏈勾搴�"){
- let d = new Date();
- let n = d.getFullYear();
- let startTime = n + "-01-01 00:00:00";
- let endTime = n + "-12-31 23:59:59";
- getRegulatoryUnitChartData(startTime,endTime);
- }else{
- let startTime = getFirstDay() + " 00:00:00";
- let endTime = getLastDay() + " 23:59:59";
- getRegulatoryUnitChartData(startTime,endTime);
- }
- })
- }
-
- //鑾峰彇鏈湀绗竴澶�
- function getFirstDay(){
- var y = new Date().getFullYear(); //鑾峰彇骞翠唤
- var m = new Date().getMonth() + 1; //鑾峰彇鏈堜唤
- var d = '01'
- m = m < 10 ? '0' + m : m; //鏈堜唤琛� 0
-
- return [y,m,d].join("-")
- }
- //鑾峰彇鏈湀鏈�鍚庝竴澶�
- function getLastDay(){
- var y = new Date().getFullYear(); //鑾峰彇骞翠唤
- var m = new Date().getMonth() + 1; //鑾峰彇鏈堜唤
- var d = new Date(y, m, 0).getDate(); //鑾峰彇褰撴湀鏈�鍚庝竴鏃�
- m = m < 10 ? '0' + m : m; //鏈堜唤琛� 0
- d = d < 10 ? '0' + d : d; //鏃ユ暟琛� 0
- return [y,m,d].join("-");
- }
</script>
diff --git a/javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/mapper/HoleMapper.java b/javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/mapper/HoleMapper.java
index 0876f44..41088ac 100644
--- a/javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/mapper/HoleMapper.java
+++ b/javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/mapper/HoleMapper.java
@@ -74,11 +74,15 @@
*/
public int deleteHoleByIds(String[] idss);
- Long selectHoleNum();
+ public Long selectHoleNum();
- Long selectAllHoleNum();
+ public Long selectAllHoleNum();
- List<Hole> selectHoleListByFlag0();
+ public List<Hole> selectHoleListByFlag0();
- List<Hole> selectHoleByProjectId(@Param("projectId") String projectId);
+ public List<Hole> selectHoleByProjectId(@Param("projectId") String projectId);
+
+ public Hole selectHoleTotalProcess();
+
+ public List<Hole> selectHoleProjectProcess();
}
diff --git a/javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/vo/ProjectProcessVO.java b/javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/vo/ProjectProcessVO.java
new file mode 100644
index 0000000..750fc8d
--- /dev/null
+++ b/javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/vo/ProjectProcessVO.java
@@ -0,0 +1,36 @@
+package com.javaweb.geo.vo;
+
+/**
+ * 鍦哄湴杩涘害 棣栭〉
+ */
+public class ProjectProcessVO {
+
+
+ private Integer ranking;
+ private String station;
+ private Double value;
+
+ public Integer getRanking() {
+ return ranking;
+ }
+
+ public void setRanking(Integer ranking) {
+ this.ranking = ranking;
+ }
+
+ public String getStation() {
+ return station;
+ }
+
+ public void setStation(String station) {
+ this.station = station;
+ }
+
+ public Double getValue() {
+ return value;
+ }
+
+ public void setValue(Double value) {
+ this.value = value;
+ }
+}
diff --git a/javaweb-plus/javaweb-cms/src/main/resources/mapper/geo/HoleMapper.xml b/javaweb-plus/javaweb-cms/src/main/resources/mapper/geo/HoleMapper.xml
index 11ea16e..77c94a0 100644
--- a/javaweb-plus/javaweb-cms/src/main/resources/mapper/geo/HoleMapper.xml
+++ b/javaweb-plus/javaweb-cms/src/main/resources/mapper/geo/HoleMapper.xml
@@ -99,6 +99,15 @@
<include refid="selectHoleVo"/> WHERE project_id = #{projectId}
</select>
+ <select id="selectHoleTotalProcess" resultMap="HoleResult">
+ select sum(footage_cpl) as footage_cpl, sum(footage) as footage from js_hole
+ </select>
+
+ <select id="selectHoleProjectProcess" resultMap="HoleResult">
+ select project_id as project_id, sum(footage_cpl) as footage_cpl, sum(footage) as footage
+ from js_hole GROUP BY project_id
+ </select>
+
<insert id="insertHole" parameterType="Hole">
insert into js_hole
<trim prefix="(" suffix=")" suffixOverrides=",">
diff --git a/javaweb-plus/javaweb-cms/src/main/resources/templates/geo/deviceLog/deviceLog.html b/javaweb-plus/javaweb-cms/src/main/resources/templates/geo/deviceLog/deviceLog.html
index ce46554..28915a7 100644
--- a/javaweb-plus/javaweb-cms/src/main/resources/templates/geo/deviceLog/deviceLog.html
+++ b/javaweb-plus/javaweb-cms/src/main/resources/templates/geo/deviceLog/deviceLog.html
@@ -11,7 +11,7 @@
<div class="select-list">
<ul>
<li>
- <p>鍑哄叆搴撳崟瀛愬彿锛�</p>
+ <p>宸ュ崟鍙凤細</p>
<input type="text" name="code"/>
</li>
<li>
@@ -19,7 +19,7 @@
<input type="text" name="deviceName"/>
</li>
<li>
- <p>璁惧/鏉愭枡绫诲瀷锛�</p>
+ <p>绫诲瀷锛�</p>
<select name="type" th:with="type=${@dict.getType('device_log_type')}">
<option value="">鎵�鏈�</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
@@ -91,7 +91,8 @@
},
{
field : 'code',
- title : '鍑哄叆搴撳崟瀛愬彿'
+ title : '宸ュ崟鍙�',
+ sortable:true
},
{
field : 'projectName',
@@ -109,26 +110,31 @@
},
{
field : 'type',
- title : '璁惧/鏉愭枡绫诲瀷',
+ title : '璁惧/鏉愭枡',
+ sortable:true,
formatter: function(value, row, index) {
return $.table.selectDictLabel(typeDatas, value);
}
},
{
field : 'inboundDate',
- title : '鍏ュ簱鏃堕棿'
+ title : '鍏ュ簱鏃堕棿',
+ sortable:true
},
{
field : 'outboundDate',
- title : '鍑哄簱鏃堕棿'
+ title : '鍑哄簱鏃堕棿',
+ sortable:true
},
{
field : 'optUser',
- title : '缁忓姙浜�'
+ title : '缁忓姙浜�',
+ sortable:true
},
{
field : 'applyUser',
- title : '璐熻矗浜�'
+ title : '璐熻矗浜�',
+ sortable:true
},
{
field : 'number',
--
Gitblit v1.9.1