merged
This commit is contained in:
		
						commit
						2af5307c50
					
				@ -40,11 +40,12 @@ namespace Backend.Controllers
 | 
			
		||||
            try
 | 
			
		||||
            {
 | 
			
		||||
                List<Device_value> ds;
 | 
			
		||||
                string url_slot = "slot:/Arena/H|";
 | 
			
		||||
                string url_slot = "slot:/TPE/B1|";
 | 
			
		||||
                string top100 = " top 100 ";
 | 
			
		||||
                webRequestService svc = new webRequestService();
 | 
			
		||||
                string bql = url_slot + "bql:select " + top100 + " * from control:ControlPoint ";
 | 
			
		||||
                ds = svc.obixQuery("http://60.251.164.125:8080/obix/config/Arena/Program/ObixQuery/query/", bql);
 | 
			
		||||
                //ds = svc.obixQuery("http://192.168.0.136:8080/obix/config/Arena/Program/ObixQuery/query/", bql);
 | 
			
		||||
                ds = svc.obixQuery("http://localhost:8080/obix/config/Program/ObixQuery/query/", bql);
 | 
			
		||||
 | 
			
		||||
                apiResult.Code = "0000";
 | 
			
		||||
                apiResult.Data = ds;
 | 
			
		||||
 | 
			
		||||
@ -11,6 +11,7 @@ using System.Text;
 | 
			
		||||
using System.Xml.Linq;
 | 
			
		||||
using Repository.BackendRepository.Implement;
 | 
			
		||||
using Repository.BackendRepository;
 | 
			
		||||
using Ubiety.Dns.Core;
 | 
			
		||||
 | 
			
		||||
namespace Backend.Services.Implement
 | 
			
		||||
{
 | 
			
		||||
@ -24,9 +25,24 @@ namespace Backend.Services.Implement
 | 
			
		||||
            String encoded = System.Convert.ToBase64String(System.Text.Encoding.GetEncoding("ISO-8859-1").GetBytes(username + ":" + password));
 | 
			
		||||
            String API_Url = urlString;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
            HttpWebRequest Postrequest = (HttpWebRequest)WebRequest.Create(API_Url);
 | 
			
		||||
            Postrequest.Method = "POST";
 | 
			
		||||
            Postrequest.Headers.Add("Authorization", "Basic " + encoded);
 | 
			
		||||
            Postrequest.PreAuthenticate = true;
 | 
			
		||||
 | 
			
		||||
            using (var streamWriter = new StreamWriter(Postrequest.GetRequestStream()))
 | 
			
		||||
            {
 | 
			
		||||
                string json = "<str val='" + bql + "'/>";
 | 
			
		||||
 | 
			
		||||
                streamWriter.Write(json);
 | 
			
		||||
            }
 | 
			
		||||
            HttpWebResponse response = (HttpWebResponse)Postrequest.GetResponse();
 | 
			
		||||
            var responseString = new StreamReader(response.GetResponseStream()).ReadToEnd();
 | 
			
		||||
 | 
			
		||||
            XmlDocument xmlDoc = new XmlDocument();
 | 
			
		||||
            //xmlDoc.LoadXml(responseString);
 | 
			
		||||
            xmlDoc.Load("N4v1021.xml");//N4v1021
 | 
			
		||||
            xmlDoc.LoadXml(responseString);
 | 
			
		||||
            //xmlDoc.Load("N4v1021.xml");//N4v1021
 | 
			
		||||
 | 
			
		||||
            //xmlDoc.Save("N4.xml");
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -8,8 +8,8 @@
 | 
			
		||||
    }
 | 
			
		||||
    table.elevator-build td {
 | 
			
		||||
        padding: 0.2rem 0.5rem;
 | 
			
		||||
        height: 40px;
 | 
			
		||||
        width: 55px;
 | 
			
		||||
        height: 50px;
 | 
			
		||||
        width: 45px;
 | 
			
		||||
        border: 1px solid #000;
 | 
			
		||||
    }
 | 
			
		||||
    elevator .elevator-body, elevator .elevator-header {
 | 
			
		||||
@ -27,9 +27,11 @@
 | 
			
		||||
 | 
			
		||||
                </div>
 | 
			
		||||
                <div class="elevator-body d-flex align-items-center justify-content-center h-100 yt-table-container">
 | 
			
		||||
                    <table id="floorTable" class="elevator-build m-auto">
 | 
			
		||||
                        
 | 
			
		||||
                    </table>
 | 
			
		||||
                    <div id="floorTable_wrapper" class="elevator-build-container">
 | 
			
		||||
                        <table id="floorTable" class="elevator-build m-auto">
 | 
			
		||||
                        </table>
 | 
			
		||||
                    </div>
 | 
			
		||||
                   
 | 
			
		||||
                </div>
 | 
			
		||||
            </div>
 | 
			
		||||
            <!--<div>
 | 
			
		||||
@ -892,15 +894,24 @@
 | 
			
		||||
            for (let e = 1; e <= eleCnt + 2; e++) {
 | 
			
		||||
                let td = creEle("td");
 | 
			
		||||
                if (e == 1) {
 | 
			
		||||
                    td.addClass("t-black")
 | 
			
		||||
                    td.text(rfloors[f - 1]);
 | 
			
		||||
                } else if (e == eleCnt + 2) { 
 | 
			
		||||
                }
 | 
			
		||||
                else {
 | 
			
		||||
                    let div = creDiv(["d-flex", "justify-content-center", "align-items-end","h-100"]);
 | 
			
		||||
                    div.append(`<i class="fas fa-door-open fs-1-05"></i>`)
 | 
			
		||||
                    td.append(div)
 | 
			
		||||
                }
 | 
			
		||||
                tr.append(td);
 | 
			
		||||
            }
 | 
			
		||||
            tbody.append(tr);
 | 
			
		||||
            $("#floorTable_wrapper").append(eleCircle)
 | 
			
		||||
        }
 | 
			
		||||
        
 | 
			
		||||
        $("#floorTable").html(tbody);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
        $("#floorTable tbody tr").each((index, tr) => {
 | 
			
		||||
 | 
			
		||||
            $(tr).find("td:eq(0)").css("border-left", "0");
 | 
			
		||||
@ -919,61 +930,4 @@
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    function initYTTable(element) {
 | 
			
		||||
        let obj = { init: null, SetContainer: null, Ele: element || $(".yt-table") };
 | 
			
		||||
 | 
			
		||||
        obj.init = function () {
 | 
			
		||||
            this.SetContainer();
 | 
			
		||||
            this.SetBorder();
 | 
			
		||||
            this.SetEndCellRightBorderRemove();
 | 
			
		||||
            this.SetEndCellBottomBorderRemove();
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        obj.SetContainer = function () {
 | 
			
		||||
            $(this.Ele).each(function (index, value) {
 | 
			
		||||
                if ($(value).parent(".yt-table-container").length != 0) {
 | 
			
		||||
                    $(value).unwrap(".yt-table-container");
 | 
			
		||||
                }
 | 
			
		||||
                let strHtml = $(`<div class="yt-table-container"></div>`);
 | 
			
		||||
                $(value).wrap(strHtml);
 | 
			
		||||
                $(value).parent(".yt-table-container").parent().addClass("table-div");
 | 
			
		||||
            })
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        obj.SetBorder = function () {
 | 
			
		||||
            console.log("123123", $(this.Ele))
 | 
			
		||||
            $(`${$(this.Ele).selector}.th-td-br th,${$(this.Ele).selector}.th-td-br td`).css("border-right", "1px solid #adadad");
 | 
			
		||||
            $(`${$(this.Ele).selector}.th-bd thead th`).css("border-bottom", "1px solid #adadad");
 | 
			
		||||
            $(`${$(this.Ele).selector}.td-bd tbody td`).css("border-bottom", "1px solid #adadad");
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        obj.SetEndCellRightBorderRemove = function () {
 | 
			
		||||
            let notBorder = 0;
 | 
			
		||||
            $(`${$(this.Ele).selector} thead th:last-child,.yt-table tbody td:last-child`).each(function (index, value) {
 | 
			
		||||
                if (index >= notBorder) {
 | 
			
		||||
                    $(value).css("border-right", "0px");
 | 
			
		||||
                }
 | 
			
		||||
                if ($(value).attr("rowspan")) {
 | 
			
		||||
                    let rowspan = parseInt($(value).attr("rowspan"));
 | 
			
		||||
                    notBorder = index + rowspan;
 | 
			
		||||
                }
 | 
			
		||||
            })
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        obj.SetEndCellBottomBorderRemove = function () {
 | 
			
		||||
            $(`${$(this.Ele).selector} tr:last-child td`).each(function (index, value) {
 | 
			
		||||
                $(value).css("border-bottom", "0px");
 | 
			
		||||
            })
 | 
			
		||||
 | 
			
		||||
            $(`${$(this.Ele).selector} tr td[rowspan]`).each(function (index, value) {
 | 
			
		||||
                let tr = $(value).closest("tr");
 | 
			
		||||
                let oriTrInd = $(tr).index();
 | 
			
		||||
                let lastTrInd = $(tr).parent("tbody").find("tr:last-child").index();
 | 
			
		||||
                if (lastTrInd - oriTrInd == $(value).prop("rowspan") - 1) {
 | 
			
		||||
                    $(value).css("border-bottom", "0px");
 | 
			
		||||
                }
 | 
			
		||||
            })
 | 
			
		||||
        }
 | 
			
		||||
        obj.init();
 | 
			
		||||
    }
 | 
			
		||||
</script>
 | 
			
		||||
@ -46,12 +46,43 @@
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
 | 
			
		||||
    var allDevList = [];
 | 
			
		||||
    $(function () {
 | 
			
		||||
        getFloDevList();
 | 
			
		||||
        setLightColor();
 | 
			
		||||
        
 | 
			
		||||
        initSub();
 | 
			
		||||
    })
 | 
			
		||||
 | 
			
		||||
    function initSub() {
 | 
			
		||||
        myBaja = new subscriptionDevices();
 | 
			
		||||
        var ordPath = {
 | 
			
		||||
            "building_tag": pageAct.buiTag,
 | 
			
		||||
            "system_tag": pageAct.sysMainTag,
 | 
			
		||||
            "name_tag": pageAct.sysSubTag,
 | 
			
		||||
        }
 | 
			
		||||
        myBaja.setSubscribeDevicesByBql(ordPath);
 | 
			
		||||
        myBaja.setSubscribeDevicesCallBack(function (data) {
 | 
			
		||||
            
 | 
			
		||||
            let matchDevice = allDevList.filter(x => x.device_number.split("_")[x.device_number.split("_").length - 1] == data.device_number)[0];
 | 
			
		||||
            let norDevPoiName = matchDevice.device_normal_point_name;
 | 
			
		||||
            let cloDevPoiName = matchDevice.device_close_point_name;
 | 
			
		||||
            let errDevPoiName = matchDevice.device_error_point_name;
 | 
			
		||||
 | 
			
		||||
            if (data.point_name == norDevPoiName && data.value == matchDevice.device_normal_point_value) {
 | 
			
		||||
                //顯示正常燈號
 | 
			
		||||
                $(`#${matchDevice.device_number}_status`).attr("data-light-type", "normal").data("light-type", "normal");
 | 
			
		||||
                
 | 
			
		||||
            } else if (data.point_name == cloDevPoiName && data.value == matchDevice.device_close_point_value) {
 | 
			
		||||
                $(`#${matchDevice.device_number}_status`).attr("data-light-type", "close").data("light-type", "close");
 | 
			
		||||
            } else if (data.point_name == errDevPoiName && data.value == matchDevice.device_error_point_value) {
 | 
			
		||||
                $(`#${matchDevice.device_number}_status`).attr("data-light-type", "error").data("light-type", "error");
 | 
			
		||||
            }
 | 
			
		||||
            setLightColor();
 | 
			
		||||
        });
 | 
			
		||||
        
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    //function loadStaLight() {
 | 
			
		||||
    //    if (pageAct.sysSubObj.device_normal_color) {
 | 
			
		||||
    //        $("#sysNorLight").css("background-color", pageAct.sysSubObj.device_normal_color);
 | 
			
		||||
@ -108,7 +139,7 @@
 | 
			
		||||
 | 
			
		||||
                    $.each(floObj.device_list, (index2, devObj) => {
 | 
			
		||||
                        console.log(">>>> url: " + baseImgUrl + " , img: " + varPathImg + ", icon: " + devObj.device_master_icon);
 | 
			
		||||
 | 
			
		||||
                        allDevList.push(devObj);
 | 
			
		||||
                        strHtml += `<div class="card m-1 border device-wrap" style="width:300px">
 | 
			
		||||
                                        <div class="card-body p-2">
 | 
			
		||||
                                            <div class="d-flex mb-2">
 | 
			
		||||
@ -120,7 +151,7 @@
 | 
			
		||||
                                                </div>
 | 
			
		||||
                                            </div>
 | 
			
		||||
                                        <div class="d-flex mb-0 mt-2 align-items-center">
 | 
			
		||||
                                                <span id="${devObj.device_number}_status" class="circle-light" data-light-type="normal"></span>
 | 
			
		||||
                                                <span id="${devObj.device_number}_status" class="circle-light"></span>
 | 
			
		||||
                                                <span class="d-none">即時功率:</span>
 | 
			
		||||
                                                <a href="javascript:;" name="devItem" data-id="${devObj.device_guid}" data-number="${devObj.device_number}" data-name="${devObj.full_name}" class=" ml-2 mb-0 ">詳細資料</a>
 | 
			
		||||
                                            </div>
 | 
			
		||||
@ -234,9 +265,11 @@
 | 
			
		||||
                    console.log($(oriEle).data("number"))
 | 
			
		||||
                    //基本資料tab block
 | 
			
		||||
                    $("#info").html(drawInfoTabBlo(devGuid));
 | 
			
		||||
                    loadErr($(oriEle).data("number"));
 | 
			
		||||
                    loadOpeRecTable(devGuid);
 | 
			
		||||
                    //loadErrRecTable2($(oriEle).data("number"));
 | 
			
		||||
                    loadErrRecTable();
 | 
			
		||||
                    //loadErrRecTable();
 | 
			
		||||
                    
 | 
			
		||||
                }
 | 
			
		||||
            })
 | 
			
		||||
        })
 | 
			
		||||
@ -287,10 +320,20 @@
 | 
			
		||||
        let opeRecTable = new YourTeam.JqDataTables.getTableByAjax(url, tag, null, columns, column_defs, null, null, null, null, null, null, "tpi");
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    function loadErrRecTable() {
 | 
			
		||||
    function loadErr(allPath) {
 | 
			
		||||
        if (allPath != undefined && allPath != null) {
 | 
			
		||||
            let _pathArr = allPath.split("_");//TPE_B1_ELEV_EL_R2F_NA_ELEV1_N1
 | 
			
		||||
            let _devicePath = _pathArr[0] + "_" + _pathArr[1] + "_" + _pathArr[2] + "_" + _pathArr[3] + "_" + _pathArr[4] + "_" + _pathArr[5];
 | 
			
		||||
            getOneDeviceAlarmTop10ByBaja(_devicePath, callbackForErr);
 | 
			
		||||
        }
 | 
			
		||||
        else {
 | 
			
		||||
            console.log("no device");
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    function callbackForErr(result) {
 | 
			
		||||
        let tag = "#errRecTable";
 | 
			
		||||
        let datas;
 | 
			
		||||
        //getOneDeviceAlarmTop10ByBaja(_devicePath, callback);
 | 
			
		||||
 | 
			
		||||
        let column_defs = [
 | 
			
		||||
            { "targets": [0], "width": "15%", "sortable": true },
 | 
			
		||||
@ -314,61 +357,19 @@
 | 
			
		||||
                "data": "ackState",
 | 
			
		||||
            },
 | 
			
		||||
            {
 | 
			
		||||
                "title": "發生/賦歸時間",
 | 
			
		||||
                "data": "timestamp",
 | 
			
		||||
                "width": "45%",
 | 
			
		||||
                "title": "發生/完成時間",
 | 
			
		||||
                "data": "normalTime",
 | 
			
		||||
                "render": function (data, type, row) {
 | 
			
		||||
                    return row.timestamp + "<br>" + data;
 | 
			
		||||
                },
 | 
			
		||||
            },
 | 
			
		||||
 | 
			
		||||
        ];
 | 
			
		||||
 | 
			
		||||
        //let callback = function (result) {
 | 
			
		||||
        //    datas = result;
 | 
			
		||||
        //}
 | 
			
		||||
        let result = '{"count": 2,"data":[{ "uuid": "43dc7846-bd96-4be2-ab35-f11aec729c60","msgText": "","ackState": "1","timestamp": "2022-Nov-16 10:30:24.951 AM UTC+08:00"},{"uuid": "7c309846-d862-4a8b-803b-cdc8e0efa092","msgText": "","ackState": "1","timestamp": "2022-Nov-16 10:00:24.893 AM UTC+08:00"}]}';
 | 
			
		||||
        let json_object = JSON.parse(result);
 | 
			
		||||
        datas = json_object['data'];
 | 
			
		||||
        errRecTable = new YourTeam.JqDataTables.getTableByStatic(tag, datas, columns, column_defs, null, null, null, null, "tpi");
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
        //function loadErrRecTable2(allPath) {
 | 
			
		||||
        //    if (allPath != undefined && allPath != null) {
 | 
			
		||||
        //        let _pathArr = allPath.split("_");//TPE_B1_ELEV_EL_R2F_NA_ELEV1_N1
 | 
			
		||||
        //        let _devicePath = _pathArr[0] + "_" + _pathArr[1] + "_" + _pathArr[2] + "_" + _pathArr[3] + "_" + _pathArr[4] + "_" + _pathArr[5];
 | 
			
		||||
        //        //getOneDeviceAlarmTop10ByBaja(_devicePath, callback);
 | 
			
		||||
        //        console.log("devicePath: " + _devicePath);
 | 
			
		||||
        //        let result = '{"count": 2,"0": { "uuid": "43dc7846-bd96-4be2-ab35-f11aec729c60","timestamp": "2022-Nov-16 10:30:24.951 AM UTC+08:00","sourceName": "TPE_B1_ELEV_EL_R2F_NA_ELEV1_N1_TRIP","sourceState": "1","msgText": "","ackState": "1","normalTime": "1970-Jan-1 08:00:00.000 AM UTC+08:00"},"1": {"uuid": "7c309846-d862-4a8b-803b-cdc8e0efa092","timestamp": "2022-Nov-16 10:00:24.893 AM UTC+08:00","sourceName": "TPE_B1_ELEV_EL_R2F_NA_ELEV1_N1_TRIP","sourceState": "0","msgText": "","ackState": "1","normalTime": "2022-Nov-16 10:15:24.939 AM UTC+08:00"}}';
 | 
			
		||||
        //        let result_Json = JSON.parse(result)
 | 
			
		||||
        //        var eachTable = $('.each-table tbody');
 | 
			
		||||
 | 
			
		||||
        //        for (var i = 0; i < result_Json['count']; i++)
 | 
			
		||||
        //        {
 | 
			
		||||
        //            item = result_Json[i.toString()];
 | 
			
		||||
        //            eachTable.append(
 | 
			
		||||
        //                '<tr>' +
 | 
			
		||||
        //                '<td>' + item.uuid + '</td>' +
 | 
			
		||||
        //                '<td>' + item.msgText + '</td>' +
 | 
			
		||||
        //                '<td>' + (item.ackState = 1 ? item.normalTime : '未確認') + '</td>' +
 | 
			
		||||
        //                '<td>' + item.timestamp + '</td>' +
 | 
			
		||||
        //                '</tr>');
 | 
			
		||||
        //        }
 | 
			
		||||
 | 
			
		||||
        //    }
 | 
			
		||||
 | 
			
		||||
        //    let callback = function (result) {
 | 
			
		||||
        //        var eachTable = $('.each-table tbody');
 | 
			
		||||
        //        $.each(result, function (index, element) {
 | 
			
		||||
        //            eachTable.append(
 | 
			
		||||
        //                '<tr>' +
 | 
			
		||||
        //                '<td>' + element[index].uuid + '</td>' +
 | 
			
		||||
        //                '<td>' + element[index].msgText + '</td>' +
 | 
			
		||||
        //                '<td>' + (element[index].ackState = 1 ? element[index].normalTime : '未確認') + '</td>' +
 | 
			
		||||
        //                '<td>' + element[index].timestamp + '</td>' +
 | 
			
		||||
        //                '</tr>');
 | 
			
		||||
        //        });
 | 
			
		||||
        //    }
 | 
			
		||||
        //}
 | 
			
		||||
   // }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
</script>
 | 
			
		||||
@ -2459,6 +2459,7 @@ License: You must have a valid license purchased only from wrapbootstrap.com (li
 | 
			
		||||
            };
 | 
			
		||||
        });
 | 
			
		||||
    </script>
 | 
			
		||||
    <script src="js/n4js/bajatest.js"></script>
 | 
			
		||||
    <script src="js/bajascript/require.config.js"></script>
 | 
			
		||||
    <script src="js/FileSaver.js"></script>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -88,35 +88,6 @@ function getAlarmByBaja(startDate_millisecond, endDate_millisecond, isRecover, i
 | 
			
		||||
 * @param {any} devicePath
 | 
			
		||||
 * @param {any} callback
 | 
			
		||||
 */
 | 
			
		||||
// function getOneDeviceAlarmTop10ByBaja(devicePath, callback) {
 | 
			
		||||
//     var _result = "";
 | 
			
		||||
//     var _ss = "";
 | 
			
		||||
//     var _index = 0;
 | 
			
		||||
//     //{ "count":2,"data": [{ "time": "2022/11/14 15:00:00", "errId": "0001", "ackCheck": "未確認", "errReason": "燈泡故障" }, { "time": "2022/11/14 15:00:00", "errId": "0002", "ackCheck": "未確認", "errReason": "燈泡故障" }]}
 | 
			
		||||
//     require(['baja!'], function (baja) {
 | 
			
		||||
//         baja.Ord.make("local:|foxs:|alarm:|bql:select top 10 timestamp, ackState, alarmData, alarmData.sourceName, sourceState, uuid, alarmData.msgText, normalTime where alarmData.sourceName like '%" + devicePath + "%' order by timestamp desc").get()
 | 
			
		||||
//             .then(function (table) {
 | 
			
		||||
//                 return table.cursor({
 | 
			
		||||
//                     each: function (record) {
 | 
			
		||||
//                         if (_index == 0)
 | 
			
		||||
//                             _ss += '{"uuid":"' + record.get('uuid') + '", "msgText":"' + record.get('alarmData').get('msgText') + '", "ackState":"' + record.get('ackState') + '", "timestamp":"' + record.get('timestamp') + '"}';
 | 
			
		||||
//                         else
 | 
			
		||||
//                             _ss += ',{"uuid":"' + record.get('uuid') + '", "msgText":"' + record.get('alarmData').get('msgText') + '", "ackState":"' + record.get('ackState') + '", "timestamp":"' + record.get('timestamp') + '"}';
 | 
			
		||||
//                         _index++;
 | 
			
		||||
//                     },
 | 
			
		||||
//                     after: function () {
 | 
			
		||||
//                         _result += '{' + '"count": ' + _index +', "data":[';
 | 
			
		||||
 | 
			
		||||
//                         _result += _ss+']';
 | 
			
		||||
//                         _result += '}';
 | 
			
		||||
//                         if (typeof callback === 'function') {
 | 
			
		||||
//                             callback(_result);
 | 
			
		||||
//                         }
 | 
			
		||||
//                     }
 | 
			
		||||
//                 });
 | 
			
		||||
//             });
 | 
			
		||||
//     });
 | 
			
		||||
// }
 | 
			
		||||
function getOneDeviceAlarmTop10ByBaja(devicePath, callback) {
 | 
			
		||||
    var _result = "";
 | 
			
		||||
    var _ss = "";
 | 
			
		||||
@ -136,16 +107,16 @@ function getOneDeviceAlarmTop10ByBaja(devicePath, callback) {
 | 
			
		||||
                        var _timestampTemp = new Date(record.get('timestamp').toString());
 | 
			
		||||
                        _occurrenceTime += _timestampTemp.getFullYear().toString() + "-" + addzero(_timestampTemp.getMonth() + 1).toString() + "-" + addzero(_timestampTemp.getDate()).toString() + " " + addzero(_timestampTemp.getHours()).toString() + ":" + addzero(_timestampTemp.getMinutes()).toString() + ":" + addzero(_timestampTemp.getSeconds()).toString();
 | 
			
		||||
 | 
			
		||||
                        //var _occurrenceTime = _timestamp.format("yyyy-MM-dd hh:mm:ss");//.toLocaleString();
 | 
			
		||||
                        var _normaltime = new Date(record.get('normalTime').toString());
 | 
			
		||||
                        _normalTime += _normaltime.getFullYear().toString() + "-" + addzero(_normaltime.getMonth() + 1).toString() + "-" + addzero(_normaltime.getDate()).toString() + " " + addzero(_normaltime.getHours()).toString() + ":" + addzero(_normaltime.getMinutes()).toString() + ":" + addzero(_normaltime.getSeconds()).toString();
 | 
			
		||||
 | 
			
		||||
                        var _msgText = record.get('alarmData').get('msgText') == 1 ? _occurrenceTime : "未確認";
 | 
			
		||||
                        var _msgText = record.get('alarmData').get('msgText');
 | 
			
		||||
                        var _ackText = record.get('ackState') == 1 ? _occurrenceTime : "未確認";
 | 
			
		||||
 | 
			
		||||
                        if (_index == 0)
 | 
			
		||||
                            _ss += '{"uuid":"' + _resultUuid[0] + '", "msgText":"' + _msgText + '", "ackState":"' + record.get('ackState') + '", "timestamp":"' + _occurrenceTime + '", "normalTime":"' + _normalTime + '"}';
 | 
			
		||||
                            _ss += '{"uuid":"' + _resultUuid[0] + '", "msgText":"' + _msgText + '", "ackState":"' + _ackText + '", "timestamp":"' + _occurrenceTime + '", "normalTime":"' + _normalTime + '"}';
 | 
			
		||||
                        else
 | 
			
		||||
                            _ss += ',{"uuid":"' + _resultUuid[0] + '", "msgText":"' + _msgText + '", "ackState":"' + record.get('ackState') + '", "timestamp":"' + _occurrenceTime + '", "normalTime":"' + _normalTime + '"}';
 | 
			
		||||
                            _ss += ',{"uuid":"' + _resultUuid[0] + '", "msgText":"' + _msgText + '", "ackState":"' + _ackText + '", "timestamp":"' + _occurrenceTime + '", "normalTime":"' + _normalTime + '"}';
 | 
			
		||||
                        _index++;
 | 
			
		||||
                    },
 | 
			
		||||
                    after: function () {
 | 
			
		||||
 | 
			
		||||
@ -61,7 +61,7 @@ namespace FrontendWebApi.ApiControllers
 | 
			
		||||
            {
 | 
			
		||||
                var dbsub = await frontendRepository.GetAllAsync<HistoryDBMainSub>(
 | 
			
		||||
                    @$"select distinct v1.system_key main_name, v1.system_value main_system_tag, v2.system_key sub_name, v2.system_value sub_system_tag, v1.system_priority, v2.system_priority,
 | 
			
		||||
                                dk.device_normal_color, dk.device_close_color, dk.device_error_color
 | 
			
		||||
                                dk.device_normal_color, dk.device_close_color, dk.device_error_color,dk.device_normal_flashing, dk.device_close_flashing, dk.device_error_flashing
 | 
			
		||||
                                -- di.full_name as device_item_name, di.points as device_item_points, di.unit as device_item_unit, di.is_show_riserDiagram as device_item_is_show_riserDiagram,
 | 
			
		||||
                                -- di.is_controll as device_item_is_controll, di.is_bool as device_item_is_bool, di.is_link as device_item_is_link
 | 
			
		||||
                        from role_auth a
 | 
			
		||||
@ -93,6 +93,9 @@ namespace FrontendWebApi.ApiControllers
 | 
			
		||||
                        history_Sub_System.device_normal_color = sub.device_normal_color;
 | 
			
		||||
                        history_Sub_System.device_close_color = sub.device_close_color;
 | 
			
		||||
                        history_Sub_System.device_error_color = sub.device_error_color;
 | 
			
		||||
                        history_Sub_System.device_normal_flashing = sub.device_normal_flashing;
 | 
			
		||||
                        history_Sub_System.device_close_flashing = sub.device_close_flashing;
 | 
			
		||||
                        history_Sub_System.device_error_flashing = sub.device_error_flashing;
 | 
			
		||||
 | 
			
		||||
                        history_Main_System.History_Sub_systems.Add(history_Sub_System);
 | 
			
		||||
                    }
 | 
			
		||||
@ -224,9 +227,9 @@ namespace FrontendWebApi.ApiControllers
 | 
			
		||||
                {
 | 
			
		||||
                    List<DeviceLists> dl = new List<DeviceLists>();
 | 
			
		||||
                    sqlString = $@"select d.device_guid, d.full_name, d.device_coordinate, dk.device_image, d.device_number, CONCAT('{baseURL}', '{deviceKindFilePath}', dk.device_image) AS device_image_url,
 | 
			
		||||
				                          dk.device_normal_point_id, dk.device_normal_point_guid, dk.device_normal_point_col, dk.device_normal_point_value, dk.device_normal_flashing, 
 | 
			
		||||
				                          dk.device_close_point_id, dk.device_close_point_guid, dk.device_close_point_col, dk.device_close_point_value, dk.device_close_flashing, 
 | 
			
		||||
				                          dk.device_error_point_id, dk.device_error_point_guid, dk.device_error_point_col, dk.device_error_point_value, dk.device_error_flashing
 | 
			
		||||
				                          dk.device_normal_point_id, dk.device_normal_point_guid, dk.device_normal_point_col, dk.device_normal_point_value, dk.device_normal_flashing, dk.device_normal_point_name,
 | 
			
		||||
				                          dk.device_close_point_id, dk.device_close_point_guid, dk.device_close_point_col, dk.device_close_point_value, dk.device_close_flashing, dk.device_close_point_name,
 | 
			
		||||
				                          dk.device_error_point_id, dk.device_error_point_guid, dk.device_error_point_col, dk.device_error_point_value, dk.device_error_flashing, dk.device_error_point_name
 | 
			
		||||
                                   from device d
 | 
			
		||||
                                   left join device_kind dk on d.device_building_tag = dk.device_building_tag and d.device_system_tag = dk.device_system_tag
 | 
			
		||||
			                                   and d.device_name_tag = dk.device_name_tag
 | 
			
		||||
 | 
			
		||||
@ -54,16 +54,19 @@ namespace FrontendWebApi.Models
 | 
			
		||||
        public string device_normal_point_id { get; set; }
 | 
			
		||||
        public string device_normal_point_guid { get; set; }
 | 
			
		||||
        public string device_normal_point_col { get; set; }
 | 
			
		||||
        public string device_normal_point_name { get; set; }
 | 
			
		||||
        public string device_normal_point_value { get; set; }
 | 
			
		||||
        public string device_normal_flashing { get; set; }
 | 
			
		||||
        public string device_close_point_id { get; set; }
 | 
			
		||||
        public string device_close_point_guid { get; set; }
 | 
			
		||||
        public string device_close_point_col { get; set; }
 | 
			
		||||
        public string device_close_point_name { get; set; }
 | 
			
		||||
        public string device_close_point_value { get; set; }
 | 
			
		||||
        public string device_close_flashing { get; set; }
 | 
			
		||||
        public string device_error_point_id { get; set; }
 | 
			
		||||
        public string device_error_point_guid { get; set; }
 | 
			
		||||
        public string device_error_point_col { get; set; }
 | 
			
		||||
        public string device_error_point_name { get; set; }
 | 
			
		||||
        public string device_error_point_value { get; set; }
 | 
			
		||||
        public string device_error_flashing { get; set; }
 | 
			
		||||
        public List<DeviceNode> Device_nodes { get; set; }
 | 
			
		||||
 | 
			
		||||
@ -73,6 +73,10 @@ namespace FrontendWebApi.Models
 | 
			
		||||
        public byte device_item_is_controll { get; set; }
 | 
			
		||||
        public byte device_item_is_bool { get; set; }
 | 
			
		||||
        public byte device_item_is_link { get; set; }
 | 
			
		||||
 | 
			
		||||
        public string device_normal_flashing { get; set; }
 | 
			
		||||
        public string device_close_flashing { get; set; }
 | 
			
		||||
        public string device_error_flashing { get; set; }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public class HistoryFind
 | 
			
		||||
@ -119,6 +123,9 @@ namespace FrontendWebApi.Models
 | 
			
		||||
        public string device_close_color { get; set; }
 | 
			
		||||
        public string device_error_color { get; set; }
 | 
			
		||||
        public List<Device> device { get; set; }
 | 
			
		||||
        public string device_normal_flashing { get; set; }
 | 
			
		||||
        public string device_close_flashing { get; set; }
 | 
			
		||||
        public string device_error_flashing { get; set; }
 | 
			
		||||
    }
 | 
			
		||||
    public class History_PostDevice
 | 
			
		||||
    {
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user