From cbe1226ae82f1818e13b7a4faa965b591d631633 Mon Sep 17 00:00:00 2001 From: jiazx0107@163.com <jiazx0107@163.com> Date: 星期三, 11 十月 2023 12:24:18 +0800 Subject: [PATCH] 更新油罐页面 --- igds-protocol-bhzn/src/main/java/com/ld/igds/protocol/bhzn/grainv1/msg/AnalysisService.java | 19 ++++++ igds-web/src/main/resources/templates/admin/grain/grain-check3.html | 8 +- igds-web/src/main/resources/static/admin/grain/grainPoint3.js | 62 ++++++++++++++++++++ igds-web/src/main/resources/static/js/constant.js | 50 ++++++++-------- igds-web/src/main/resources/static/admin/grain/grainPoint4.js | 5 - igds-web/src/main/resources/static/admin/grain/grain-check1.js | 20 ++++-- 6 files changed, 121 insertions(+), 43 deletions(-) diff --git a/igds-protocol-bhzn/src/main/java/com/ld/igds/protocol/bhzn/grainv1/msg/AnalysisService.java b/igds-protocol-bhzn/src/main/java/com/ld/igds/protocol/bhzn/grainv1/msg/AnalysisService.java index 4f54fce..6a883f3 100644 --- a/igds-protocol-bhzn/src/main/java/com/ld/igds/protocol/bhzn/grainv1/msg/AnalysisService.java +++ b/igds-protocol-bhzn/src/main/java/com/ld/igds/protocol/bhzn/grainv1/msg/AnalysisService.java @@ -6,7 +6,9 @@ import com.ld.igds.constant.BizType; import com.ld.igds.constant.Constant; import com.ld.igds.constant.DepotType; +import com.ld.igds.constant.RedisConst; import com.ld.igds.grain.GrainUtil; +import com.ld.igds.grain.dto.GrainData; import com.ld.igds.grain.dto.GrainItemInfo; import com.ld.igds.io.notify.NotifyGrainInvoker; import com.ld.igds.models.*; @@ -19,6 +21,7 @@ import com.ld.igds.protocol.bhzn.grainv1.server.BhznGrainV1ServerUtils; import com.ld.igds.util.BytesUtil; import com.ld.igds.util.ContextUtil; +import com.ld.igds.util.RedisUtil; import com.ld.igds.warn.WarnUtils; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; @@ -48,6 +51,8 @@ public static final String BEAN_ID = "bhznGrainv1.analysisService"; + @Autowired + private RedisUtil redisUtil; @Autowired private CoreSerService coreSerService; @Autowired @@ -293,12 +298,13 @@ if (null != thDto) { log.debug("-------THDto--={}", thDto.toString()); } + + //娓呯┖ String key = "GRAIN_" + message.getAddr(); contextMapGrain.put(key, null); // 灏嗛泦鍚堣В鏋愭垚鍧愭爣鏁版嵁 addPoint1(temps, depotConf, ser, exeRequest, thDto, sysConf, batchId); - } @@ -344,6 +350,9 @@ } + + + Grain grain = new Grain(); grain.setDepotId(depotConf.getDepotId()); grain.setCompanyId(depotConf.getCompanyId()); @@ -353,6 +362,14 @@ grain.setTempIn(Constant.ERROR_TEMP); grain.setHumidityIn(Constant.ERROR_TEMP); + //濡傛灉鏄补缃愪粨 + if(DepotType.TYPE_03.getCode().equals(depot.getDepotType())){ + GrainData tempData = (GrainData) redisUtil.get(RedisConst.buildKey(ser.getCompanyId(),RedisConst.KEY_DEPOT_HEIGHT,depot.getId())); + if(null != tempData){ + //TODO + } + } + if (null != thDto) { log.debug("绮儏瑙f瀽涓幏鍙栧埌鐨勬俯婀垮害淇℃伅={}", thDto.toString()); grain.setHumidityIn(thDto.getHumidityIn()); diff --git a/igds-web/src/main/resources/static/admin/grain/grain-check1.js b/igds-web/src/main/resources/static/admin/grain/grain-check1.js index 4785a51..74bbb83 100644 --- a/igds-web/src/main/resources/static/admin/grain/grain-check1.js +++ b/igds-web/src/main/resources/static/admin/grain/grain-check1.js @@ -546,12 +546,20 @@ $("#tempMax").text(grainData.tempMax); $("#tempAve").text(grainData.tempAve); $("#tempMin").text(grainData.tempMin); - $("#tempIn").text(grainData.tempIn <= -100.0 ? "--" : grainData.tempIn); - $("#tempOut").text(grainData.tempOut <= -100.0 ? "--" : grainData.tempOut); - $("#humidityIn").text( - grainData.humidityIn <= -100.0 ? "--" : grainData.humidityIn); - $("#humidityOut").text( - grainData.humidityOut <= -100.0 ? "--" : grainData.humidityOut); + + + //console.log("------------"+grainData.humidityIn); + //濡傛灉婀垮害==0琛ㄧず娌℃湁鑾峰彇鍒� + if(grainData.humidityIn != 0){ + $("#tempIn").text(grainData.tempIn <= -100.0 ? "--" : grainData.tempIn); + $("#humidityIn").text( + grainData.humidityIn <= -100.0 ? "--" : grainData.humidityIn); + } + if(grainData.humidityOut != 0){ + $("#tempOut").text(grainData.tempOut <= -100.0 ? "--" : grainData.tempOut); + $("#humidityOut").text( + grainData.humidityOut <= -100.0 ? "--" : grainData.humidityOut); + } }; // 鏍规嵁鎵规鏇存柊鐨勫�艰皟鏁� diff --git a/igds-web/src/main/resources/static/admin/grain/grainPoint3.js b/igds-web/src/main/resources/static/admin/grain/grainPoint3.js index f9c14b2..5efef9a 100644 --- a/igds-web/src/main/resources/static/admin/grain/grainPoint3.js +++ b/igds-web/src/main/resources/static/admin/grain/grainPoint3.js @@ -52,9 +52,12 @@ var timer; var t=-2; +var isSleep = true; + // 鍒濆鍖栧弬鏁� function initCanvasParam() { + isSleep = true; cirNum = distrList.length; //鍦堟暟 layNum = bottomList[bottomList.length-1]; //灞傛暟 longAxis = 120; //绗竴鍐呭湀鍗婇暱杞� @@ -633,7 +636,12 @@ initCanvasParam(); draw(); - sleep();//寮�濮嬮棯鐑� + + if(distrList.length == 1){ + sleep2(); + }else{ + sleep();//寮�濮嬮棯鐑� + } curType = "z"; curVal = 1; renderGrainByLay(curVal); @@ -655,4 +663,54 @@ return; } }); -}; \ No newline at end of file +}; + +//鏍规煡鐪� +function sleep2() { + isSleep = false; + curCol = 1; + listPoints = grainData.listPoints; + listLays = grainData.listLays; + distrList = grainData.cable.split("-").map(Number); + bottomList = grainData.cableCir.split("-").map(Number); + + flash2(); +} + + +//闂儊绋嬪簭 +function flash2() { + + var canvas = document.getElementById('canvas'); + var ctx = canvas.getContext('2d'); + canvas.height = canvas.height; + colPoints = []; + arr = []; + make_ellipse(ctx); + gainData2(ctx); + entityBlock2(ctx); + make_top_ellipse(ctx); + title(ctx) +} + +//杩囨护鏁版嵁 +function gainData2() { + for (i = 0; i < listPoints.length; i++) { + if ((listPoints[i]['y'] + 1) == curCol) { + colPoints.push(listPoints[i]) + } + } +} + +//杩涜鎺掔嚎锛岀粯鍒惰壊鍧� +function entityBlock2(ctx) { + //璁剧疆鐐瑰�间负null; + var point = null; + //寰幆鐢熸垚鍦堝唴鐐� + for (j = 0; j < colPoints.length; j++) { + point = colPoints[j]; + point_x = center_x; + point_y = center_y + (j + 1) * spaceLay; + textBox(ctx, point, point_x, point_y) + } +} \ No newline at end of file diff --git a/igds-web/src/main/resources/static/admin/grain/grainPoint4.js b/igds-web/src/main/resources/static/admin/grain/grainPoint4.js index 81cae72..5247bad 100644 --- a/igds-web/src/main/resources/static/admin/grain/grainPoint4.js +++ b/igds-web/src/main/resources/static/admin/grain/grainPoint4.js @@ -205,7 +205,6 @@ var showMax = turns; //寰幆鐢熸垚姣忓湀 for (i = turns; i >= 1; i--) { - //鍐呭鏄剧ず閫昏緫鍒ゆ柇 if ((displayMode === 'outside') && !(i === cirNum)) { continue; @@ -231,9 +230,7 @@ continue; } - ctx.beginPath(); - ctx.strokeStyle = 'rgba(0,0,0,1)'; ctx.ellipse(center_x, center_y + (curVal) * spaceLay, longAxis + i * spaceCir, shortAxis + i * spaceCir, 0, 0, Math.PI * 2); @@ -241,10 +238,8 @@ var grd = ctx.createRadialGradient(center_x, center_y + caseHeight - longAxis, shortAxis, center_x, center_y + caseHeight - 2 * longAxis, 5 * longAxis); grd.addColorStop(0, "rgba(245,222,179)"); grd.addColorStop(1, "rgba(240 255 255)"); - ctx.fillStyle = grd; ctx.fill(); - } else { var grd = ctx.createRadialGradient(center_x, center_y + caseHeight - longAxis, shortAxis, center_x, center_y + caseHeight - 2 * longAxis, 2 * longAxis); grd.addColorStop(0, "white"); diff --git a/igds-web/src/main/resources/static/js/constant.js b/igds-web/src/main/resources/static/js/constant.js index cfe4740..f609ad5 100644 --- a/igds-web/src/main/resources/static/js/constant.js +++ b/igds-web/src/main/resources/static/js/constant.js @@ -13,29 +13,29 @@ ZERO: "ZERO" }; -// 璁惧绫诲瀷 +// 璁惧绫诲瀷01-椋庣獥 "02-杞存祦椋庣獥"),"03-绂诲績椋庢満"),"04-鐜祦椋庢満"),"05-绌鸿皟"),"06-鐓ф槑"),"07-鏅�氶榾闂�"),"08-姘旀车"),"09-涓婚榾闂�"),"0B-閫氶鍙�"),"0C-娣锋祦椋庢満"),"0D-鍔犲帇椋庢満"); var DeviceType = { - TYPE_01: "01",// 01-椋庣獥 - TYPE_02: "02", // "02-杞存祦椋庣獥"), - TYPE_03: "03", // "03-绂诲績椋庢満"), - TYPE_04: "04", // "04-鐜祦椋庢満"), - TYPE_05: "05", // "05-绌鸿皟"), - TYPE_06: "06", // "06-鐓ф槑"), - TYPE_07: "07", // "07-鏅�氶榾闂�"), - TYPE_08: "08", // "08-姘旀车"), - TYPE_09: "09", // "09-涓婚榾闂�"), - TYPE_0B: "0B", // "0B-閫氶鍙�"), - TYPE_0C: "0C", // "0C-娣锋祦椋庢満"), - TYPE_0D: "0D" // "0D-鍔犲帇椋庢満"); + TYPE_01: "01", + TYPE_02: "02", + TYPE_03: "03", + TYPE_04: "04", + TYPE_05: "05", + TYPE_06: "06", + TYPE_07: "07", + TYPE_08: "08", + TYPE_09: "09", + TYPE_0B: "0B", + TYPE_0C: "0C", + TYPE_0D: "0D" }; -// 璁惧绫诲瀷 +// 璁惧绫诲瀷 01-姝i潰 "02-鑳岄潰"), "03-宸︿晶"), "04-鍙充晶"), "05-浠撳唴"), var DeviceLocation = { - L_01: "01",// 01-姝i潰 - L_02: "02", // "02-鑳岄潰"), - L_03: "03", // "03-宸︿晶"), - L_04: "04", // "04-鍙充晶"), - L_05: "05" // "05-浠撳唴"), + L_01: "01", + L_02: "02", + L_03: "03", + L_04: "04", + L_05: "05" }; // 鍑哄叆搴�-娴佺▼ @@ -51,13 +51,13 @@ RECORD: "RECORD" }; -// 浠撳簱绫诲瀷 +// 浠撳簱绫诲瀷//骞虫柟浠�//娴呭渾浠�//娌圭綈//绔嬬瓛浠�//鍏朵粬绫诲瀷 var DepotType = { - T_01: "01", //骞虫柟浠� - T_02: "02",//娴呭渾浠� - T_03: "03",//娌圭綈 - T_04: "04",//绔嬬瓛浠� - T_99: "99"//鍏朵粬绫诲瀷 + T_01: "01", + T_02: "02", + T_03: "03", + T_04: "04", + T_99: "99" }; // 浠撳簱鐘舵�� diff --git a/igds-web/src/main/resources/templates/admin/grain/grain-check3.html b/igds-web/src/main/resources/templates/admin/grain/grain-check3.html index f798085..94d7420 100644 --- a/igds-web/src/main/resources/templates/admin/grain/grain-check3.html +++ b/igds-web/src/main/resources/templates/admin/grain/grain-check3.html @@ -218,23 +218,23 @@ <p> <span id="tempAve">--</span>鈩� </p> - <h4>绮潎娓�</h4> + <h4>娌瑰潎娓�</h4> </div> <div class="layui-col-lg4 lq-cTop-item"> <p> <span id="tempMax">--</span>鈩� </p> - <h4>绮珮娓�</h4> + <h4>娌归珮娓�</h4> </div> <div class="layui-col-lg4 lq-cTop-item"> <p> <span id="tempMin">--</span>鈩� </p> - <h4>绮綆娓�</h4> + <h4>娌逛綆娓�</h4> </div> </div> </div> - <div class="lq-cTop-2"> + <div class="lq-cTop-2" style="display:none;" > <div class="layui-row"> <div class="layui-col-lg4 lq-cTop-item"> <p> -- Gitblit v1.9.3