| | |
| | | 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.*; |
| | |
| | | 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; |
| | |
| | | |
| | | public static final String BEAN_ID = "bhznGrainv1.analysisService"; |
| | | |
| | | @Autowired |
| | | private RedisUtil redisUtil; |
| | | @Autowired |
| | | private CoreSerService coreSerService; |
| | | @Autowired |
| | |
| | | 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); |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | Grain grain = new Grain(); |
| | | grain.setDepotId(depotConf.getDepotId()); |
| | | grain.setCompanyId(depotConf.getCompanyId()); |
| | |
| | | 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("粮情解析中获取到的温湿度信息={}", thDto.toString()); |
| | | grain.setHumidityIn(thDto.getHumidityIn()); |
| | |
| | | $("#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); |
| | | } |
| | | }; |
| | | |
| | | // 根据批次更新的值调整 |
| | |
| | | var timer; |
| | | var t=-2; |
| | | |
| | | var isSleep = true; |
| | | |
| | | |
| | | // 初始化参数 |
| | | function initCanvasParam() { |
| | | isSleep = true; |
| | | cirNum = distrList.length; //圈数 |
| | | layNum = bottomList[bottomList.length-1]; //层数 |
| | | longAxis = 120; //第一内圈半长轴 |
| | |
| | | |
| | | initCanvasParam(); |
| | | draw(); |
| | | sleep();//开始闪烁 |
| | | |
| | | if(distrList.length == 1){ |
| | | sleep2(); |
| | | }else{ |
| | | sleep();//开始闪烁 |
| | | } |
| | | curType = "z"; |
| | | curVal = 1; |
| | | renderGrainByLay(curVal); |
| | |
| | | return; |
| | | } |
| | | }); |
| | | }; |
| | | }; |
| | | |
| | | //根查看 |
| | | 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) |
| | | } |
| | | } |
| | |
| | | var showMax = turns; |
| | | //循环生成每圈 |
| | | for (i = turns; i >= 1; i--) { |
| | | |
| | | //内外显示逻辑判断 |
| | | if ((displayMode === 'outside') && !(i === cirNum)) { |
| | | continue; |
| | |
| | | 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); |
| | | |
| | |
| | | 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"); |
| | |
| | | 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-正面 "02-背面"), "03-左侧"), "04-右侧"), "05-仓内"), |
| | | var DeviceLocation = { |
| | | L_01: "01",// 01-正面 |
| | | 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" |
| | | }; |
| | | |
| | | // 出入库-流程 |
| | |
| | | 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" |
| | | }; |
| | | |
| | | // 仓库状态 |
| | |
| | | <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> |