初始化

This commit is contained in:
2025-11-25 17:41:24 +08:00
commit 4cdf0f0f85
3383 changed files with 1050962 additions and 0 deletions

View File

@@ -0,0 +1,44 @@
@using Face.Domain.Application;
@model List<TBL_ROOM_BASIC_INFO>
@{
Layout = "";
}
@if (Model != null)
{
foreach (var item in Model)
{
<div class="col-lg-1 col-3">
<!-- small card -->
@*<div class="@(item.RoomStatusID == 2 ? "small-box bg-warning" : "small-box bg-success")">*@
@*<div class="inner">*@
<div style="background-color: #00FF7F; width: 100%;">
<div style="text-align: center; color: blue; font-size:23px;">@item.ROOM_NUMBER</div>
</div>
<div style="background-color: #98FB98; width: 100%;">
<span style="text-align:center;">
<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" fill="currentColor" class="bi bi-person-fill" viewBox="0 0 16 16">
<path d="M3 14s-1 0-1-1 1-4 6-4 6 3 6 4-1 1-1 1H3zm5-6a3 3 0 1 0 0-6 3 3 0 0 0 0 6z" />
</svg>
2
</span>
<span style="margin-left: 35%;">
<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" fill="currentColor" class="bi bi-card-image" viewBox="0 0 16 16">
<path d="M6.002 5.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0z" />
<path d="M1.5 2A1.5 1.5 0 0 0 0 3.5v9A1.5 1.5 0 0 0 1.5 14h13a1.5 1.5 0 0 0 1.5-1.5v-9A1.5 1.5 0 0 0 14.5 2h-13zm13 1a.5.5 0 0 1 .5.5v6l-3.775-1.947a.5.5 0 0 0-.577.093l-3.71 3.71-2.66-1.772a.5.5 0 0 0-.63.062L1.002 12v.54A.505.505 0 0 1 1 12.5v-9a.5.5 0 0 1 .5-.5h13z" />
</svg>
2
</span>
<div class="small-box-footer" style="width: 100%; margin-top: 10%; ">
<a onclick="getBarCodeTestLogs('@item.ROOM_NUMBER')">
背景图
</a>
<a style="margin-left: 40%;">
Logo房号
</a>
</div>
</div>
</div>
}
}

View File

@@ -0,0 +1,21 @@

@{
ViewBag.Title = "SetUIPhotos";
Layout = "~/Areas/App/Views/Shared/_Layout.cshtml";
}
<div class="content-wrapper">
<button onclick="rebootfssace()">按钮</button>
</div>
<script>
function rebootfssace() {//重启
$.ajax({
url: "/App/SetFace/TheDoor",
type: "post", // 提交方式
success: function (res) { // 请求成功后的回调函数其中的参数data为controller返回的map,也就是说然后通过data这个参数取JSON数据中的值
alert(res)
}
});
};
</script>

View File

@@ -0,0 +1,100 @@
@using PagedList.Mvc;
@using Face.Web.Areas.App.Models
@{
ViewBag.Title = "UpdateLogoRoom";
Layout = "~/Areas/App/Views/Shared/_Layout.cshtml";
}
<div class="content-wrapper">
<section class="content" style="padding:0px;">
<div class="container-fluid">
<div class="row">
<div class="col-sm-12">
<!-- Default box -->
<div class="card">
<div class="card-header">
<span style="font-size:30px">设置房号与Logo</span>
<div class="card-tools">
<button type="button" class="btn btn-tool" data-card-widget="collapse" title="Collapse"></button>
<button type="button" class="btn btn-tool" data-card-widget="remove" title="Remove">
<i class="fas fa-times"></i>
</button>
</div>
</div>
<div class="card-body">
<select class="form-control" id="userCustomer" onchange="Show()">
@{
List<HotelsItem> Hotelslist = (List<HotelsItem>)Session["qxHotels"];
for (int i = 0; i < Hotelslist.Count; i++)
{
<option value="@Hotelslist[i].HotelId" )>
@Hotelslist[i].HotelName
</option>
}
}
</select>
<div class="row" id="tableShow">
</div>
</div>
<div class="ibox-content" style="padding:0px;">
<div class="modal inmodal" id="myModal" tabindex="-1" role="dialog" aria-hidden="false">
<div class="modal-dialog">
<div class="modal-content animated fadeIn">
<div class="modal-header">
<h4 class="modal-title" id="RoomName"></h4>
<button type="button" class="close" data-dismiss="modal" onclick="closeLog()"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
</div>
<div class="modal-body" id="modal-body" style="padding:10px">
</div>
@*<div class="modal-footer">
<button type="button" class="btn btn-white" data-dismiss="modal" onclick="closeLog()">关闭</button>
</div>*@
</div>
</div>
</div>
</div>
</div>
</div>
<!-- /.card -->
<div class="col-sm-4" id="faceDetailsBox">
</div>
</div>
</div>
</section>
</div>
<script>
//$("#userCustomer").change(function () {
// console.log('123');
// var customerID = $("#userCustomer").val();
// // Ajax提交数据
// $.ajax({
// url: "/App/SetFace/InquireUpdateLogo",
// type: "post", // 提交方式
// data: { "Roomid": customerID }, // data为String类型必须为 Key/Value 格式。
// dataType: "json", // 服务器端返回的数据类型
// success: function (res) { // 请求成功后的回调函数其中的参数data为controller返回的map,也就是说然后通过data这个参数取JSON数据中的值
// $("#tableShow").val(res);
// },
// });
//});
function Show() {
var customerID = $("#userCustomer").val();
$.ajax({
url: "/App/SetFace/InquireUpdateLogo",
type: "post", // 提交方式
data: { "Roomid": customerID }, // data为String类型必须为 Key/Value 格式。
success: function (res) {
console.log('123');
console.log(res);
$("#tableShow").html(res);
}
});
}
</script>

View File

@@ -0,0 +1,487 @@

@{
ViewBag.Title = "updateAPKs";
Layout = "~/Areas/App/Views/Shared/_Layout.cshtml";
List<Face.Domain.Entities.Hotels> Hotellist = (List<Face.Domain.Entities.Hotels>)ViewData["Hotelsp"];
List<Face.Domain.Application.FaceAll.fileawholelog> Akplist = (List<Face.Domain.Application.FaceAll.fileawholelog>)ViewData["ToBool"];
}
<div class="content-wrapper">
<section class="content" style="padding:0px;">
<div class="container-fluid">
<div class="row">
<div class="col-sm-8">
<!-- Default box -->
<div class="card">
<div class="card-header">
<span style="font-size:30px">下发固件</span>
<div class="card-tools">
<button type="button" class="btn btn-tool" data-card-widget="collapse" title="Collapse"></button>
<button type="button" class="btn btn-tool" data-card-widget="remove" title="Remove">
<i class="fas fa-times"></i>
</button>
</div>
</div>
@*内容筛选*@
<div>
</div>
<div style="display:none"> </div>
<div class="ibox-content" style="padding:0px;">
<div id="project">
<div class="card-body">
<form class="form-horizontal" id="AddresidentFrom">
<div class="form-group">
<p></p>
<div>
<div class="col-md-12">
<label for="exampleInputFile"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">酒店名称</font></font></label>
<select class="form-control" id="OrgIds">
<option value="0">
请选择酒店
</option>
@{
List<int> sum = (List<int>)Session["list"];
foreach (int item in sum)
{
foreach (var iten in Hotellist)
{
if (iten.Id == item)
{
<option class="ComboBox" value="@iten.Id" id="@iten.Code">
@iten.Name
</option>
}
}
}
}
</select>
@if (Session["username"]?.ToString()?.ToLower() == "momo")
{
<input type="text" class="form-control" id="OrgIdsjud" placeholder="请输入酒店" onblur="judiannamecx()">
}
</div>
<div class="col-md-12">
<label for="exampleInputFile"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">房间</font></font></label>
<select class="form-control" id="RoomIdshow">
<option>请选择房间</option>'
</select>
</div>
<div class="col-md-12">
<label for="exampleInputFile"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">固件</font></font></label>
<select class="form-control" id="firmware">
<option>请选择固件</option>
</select>
</div>
<div class="col-md-12">
<label for="exampleInputFile"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">域名:</font></font></label>
<input type="text" class="form-control" placeholder="请输入域名" aria-label="" id="DomainNmaeinfo" aria-describedby="addon-wrapping" value="blv-rd.tpddns.cn">
</div>
<div class="col-md-12">
<label for="exampleInputFile"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">端口:</font></font></label>
<input type="text" class="form-control" placeholder="请输入端口号" aria-label="" id="FTPPortinfo" aria-describedby="addon-wrapping" value="50">
</div>
<div class="col-md-12">
<label for="exampleInputFile"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">用户名:</font></font></label>
<input type="text" class="form-control" placeholder="请输入用户名" aria-label="" id="UserNmaeinfo" aria-describedby="addon-wrapping" value="yh_face">
</div>
<div class="col-md-12">
<label for="exampleInputFile"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">密码:</font></font></label>
<input type="password" class="form-control" placeholder="请输入密码" aria-label="" id="pwdinfo" aria-describedby="addon-wrapping" value="Hz&Gyu87^%7yXt">
</div>
<div class="col-md-12">
<label for="exampleInputFile"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">路径:</font></font></label>
<input type="text" class="form-control" placeholder="请输入路径" aria-label="" id="foderinfo" aria-describedby="addon-wrapping" value="yh/fw">
</div>
<div class="col-md-12">
<label for="exampleInputFile"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">进度条:</font></font></label>
<div class="progress">
<div class="progress-bar bg-success" id="progressbarsunji" role="progressbar" style="width: 0%" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100"></div>
</div>
</div>
<div class="col-md-12">
<label for="exampleInputFile"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">下载速度:</font></font></label>
<label class="progress-bar bg-success" id="progressbarli"></label>
</div>
<div class="input-group flex-nowrap">
<button type="button" class="btn btn-primary" onclick="OnShow()">下发</button>
</div>
</div>
</div>
<p></p>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
</div>
<script>
$(function () {
$("#myModalcxz").css("display", "block");
$.ajax({
type: "post",
url: "/app/SetFace/GetgujianinfoByName",
success: function (res) {
// console.log(res)
$("#myModalcxz").css("display", "block");
document.getElementById('firmware').innerHTML = "";
$("#firmware").append('<option value="' + 0 + '" >请选择固件</option>');
res.info.forEach(x => {
$("#firmware").append(
'<option class="Roomshow" value="' + x.filename + '" id="' + x.filename + '">' +
x.filename +
'</option>'
);
})
}
});
})
////固件查询
//$("#Guojingshow").change(function () {
// var myType1 = document.getElementById("Guojingshow");//获取select对象
// console.log(myType1)
// var index1 = myType1.selectedIndex;//获取选项中的索引selectIndex表示的是当前所选中的index
// var ApkName = myType1.options[index1].value;//获取固件名称
// console.log(ApkName)
// if (ApkName == 0) {
// $("#myModalcxz").css("display", "none");
// return
// }
// $.ajax({
// type: "post",
// url: "/app/SetFace/GetgujianinfoByName",
// data: { "ApkName": ApkName },
// success: function (res) {
// $("#myModalcxz").css("display", "block");
// document.getElementById('rlianjigujian').innerHTML = "";
// $("#rlianjigujian").append('<tr>' +
// ' <td class="mailbox-star">文件名</td>' +
// ' <td class="mailbox-name">文件大小</td>' +
// ' <td class="mailbox-attachment">文件日期</td>' +
// ' <td class="mailbox-date">备注</td>' +
// ' <td class="mailbox-date">操作</td>'
// +'</tr>'
// );
// $("#rlianjigujian").append('<tr>' +
// ' <td class="mailbox-star">' + res.info.filename + '</td>' +
// ' <td class="mailbox-name">' + res.info.firmwaresize + '</td>' +
// ' <td class="mailbox-attachment">' + shijiancuo(res.info.creationtime) + '</td>' +
// ' <td class="mailbox-date">' + res.info.remark + '</td>' +
// '<td class="mailbox-date">' +
// '<button class="btn btn-md btn-primary" type="button" id="btnAddShow" onclick="OnShow(' + "'" + res.info.filename + "'" + ',' + "'" + 1 + "'" +')" >下发</button>'
// + '</td>'
// +'</tr>');
// }
// });
//})
//固件条件查询
//function guojianxxcx() {
// var gujianxx = document.getElementById('gujianxx').value
// var wjianbzhu = document.getElementById('wjianbzhu').value
// console.log("文件名称" + gujianxx)
// console.log("文件备注" + wjianbzhu)
// $.ajax({
// type: "post",
// url: "/app/SetFace/GetgujianinfoByNamesd",
// data: { "ApkName": gujianxx, "wjianbhu": wjianbzhu },
// success: function (res) {
// $("#myModalcxz").css("display", "block");
// document.getElementById('rlianjigujian').innerHTML = "";
// $("#rlianjigujian").append('<tr>' +
// ' <td class="mailbox-star">文件名</td>' +
// ' <td class="mailbox-name">文件大小</td>' +
// ' <td class="mailbox-attachment">文件日期</td>' +
// ' <td class="mailbox-date">备注</td>' +
// ' <td class="mailbox-date">操作</td>'
// + '</tr>'
// );
// res.info.forEach(x => {
// $("#rlianjigujian").append('<tr>' +
// ' <td class="mailbox-star">' + x.filename + '</td>' +
// ' <td class="mailbox-name">' + x.firmwaresize + 'MB</td>' +
// ' <td class="mailbox-attachment">' + shijiancuo(x.creationtime) + '</td>' +
// ' <td class="mailbox-date">' + x.remark + '</td>' +
// '<td class="mailbox-date">' +
// '<button class="btn btn-md btn-primary" type="button" id="btnAddShow" onclick="OnShow(' + "'" + x.filename + "'" + ',' + "'" + 1 + "'" + ')" >下发</button>'
// + '</td>'
// + '</tr>');
// })
// }
// });
//}
//时间格式转换
function shijiancuo(timestamp) {
var d = new Date(parseInt(timestamp.replace("/Date(", "").replace(")/", ""), 10));
return d.getFullYear() + '-' + (+d.getMonth() + 1) + '-' + d.getDate() + ' ' + d.getHours() + ':' + d.getMinutes() + ':' + d.getSeconds();
}
function updateAKP() {
$("#myModal").css("display", "block");
$("#modal-body").html("查询中...");
$.ajax({
type: "post",
url: "/app/Face/updateAkps",
cache: false,
success: function (res) {
$("#modal-body").html(res);
}
});
}
// +
$("#OrgIds").change(function () {
var myType = document.getElementById("OrgIds");//获取select对象
console.log(myType)
// debugger
var index = myType.selectedIndex;//获取选项中的索引selectIndex表示的是当前所选中的index
var ApkName = myType.options[index].value;//获取固件名称
console.log(ApkName)
/* document.getElementById('OrgIdsShow').innerHTML = "";*/
document.getElementById('RoomIdshow').innerHTML = "";
if (ApkName == 0) {
alert("请选择酒店名称")
return;
}
$.ajax({
url: "/App/Face/officialHotel",
type: "post",
data: { "hotelId": ApkName },
success: function (res) {
$('#RoomIdshow').append('<option class="Roomshow" value="0" id="Room">请选择房间</option>')
res.forEach(x => {
$('#RoomIdshow').append('<option class="Roomshow" value="' + x.RoomId + '" id="' + x.RoomId + '">' +
x.ROOM_NUMBER +
'</option>'
);
})
}
});
})
//酒店条件查询
function judiannamecx() {
var jd = document.getElementById('OrgIdsjud').value
document.getElementById('OrgIds').innerHTML = "";
$.ajax({
url: "/App/SetFace/updateAPKsbyjdname",
type: "post",
data: { "hotelId": jd },
success: function (res) {
$('#OrgIds').append('<option class="Roomshow" value="0" id="Room">请选择酒店</option>')
res.forEach(x => {
$('#OrgIds').append('<option class="Roomshow" value="' + x.Id + '" id="' + x.RoomId + '">' +
x.Name +
'</option>'
);
});
}
});
}
//下发固件方法
function OnShow() {
var DomainNmae = $("#DomainNmaeinfo").val();
var FTPPort = $("#FTPPortinfo").val();
var UserNmae = $("#UserNmaeinfo").val();
var pwd = $("#pwdinfo").val();
var foder = $("#foderinfo").val();
var selectedValue = $("#firmware").val();
var roomidinfo = $("#RoomIdshow").val();
if (DomainNmae === "" || DomainNmae === "undefined") {
alert("请输入主机域名");
return;
}
if (FTPPort === "" || FTPPort === "undefined") {
alert("请输入服务器 FTP 连接端口");
return;
}
if (UserNmae === "" || UserNmae === "undefined") {
alert("服务器连接用户名");
return;
}
if (pwd === "" || pwd === "undefined") {
alert("请输入服务器连接密码");
return;
}
if (foder === "" || foder === "undefined") {
alert("请输入上传路径");
return;
}
if (roomidinfo === "请选择房间" || roomidinfo === 0) {
alert("请选择房间");
return;
}
if (selectedValue === "请选择固件" || selectedValue === 0) {
alert("请选择固件");
return;
}
var name = confirm('确定要下发固件名为' + selectedValue);
if (name) {
$.ajax({
url: "/App/Sendmessage/UpdateApk",
type: "post", // 提交方式
data: { "ApkName": selectedValue, "RoomidList": roomidinfo, "DomainNmae": DomainNmae, "FTPPort": FTPPort, "UserNmae": UserNmae, "pwd": pwd, "foder": foder },
success: function (res) { // 请求成功后的回调函数其中的参数data为controller返回的map,也就是说然后通过data这个参数取JSON数据中的值
if (res.isok == true) {
/* debugger*/
startIntervalQueryProgress(res.arr);
alert('升级固件中~')
}
else {
alert('升级固件失败')
}
}
});
}
}
let ok = true; //checked为布尔值 判断是否为全选
function checkAll() {
var hobby = document.getElementsByName("roles");
console.log(hobby);
for (var i in hobby) {
hobby[i].checked = ok;
}
ok = !ok;
};
/* 定时器方法*/
var gQueryProgressTimer = -1;
var gQueryProgressCnt = 0;
var countMax = 2 * 60 * 5; //5 分钟内差不多可以等到更新后的返回包,开始重启。
function startIntervalQueryProgress(msgidArr) {
/* gQueryProgressTimer =*/ window.setTimeout(aQueryProgress, 500, msgidArr);
}
/* 进度条方法*/
function aQueryProgress(msgidArr) {
$.ajax({
type: "post",
url: "/App/Sendmessage/GetSetAPKSandProgressData",
data: { "ApkName": msgidArr },
/* contentType: 'application/json',*/
/* cache: false,*/
success: function (res) {
if (res) {
let resultContent = "";
let resultyulian = "";
if (res.length > 0) {
let rlianjidata = JSON.parse(res.data)
if (res.length == 101) {
alert('升级固件成功~')
window.clearTimeout(gQueryProgressTimer);
console.log(rlianjidata.sn)
/* break;*/
} else {
resultContent = rlianjidata.msg.data.rate + '%'
resultyulian = "总共:" + Math.round(rlianjidata.msg.data.file_size / (1024 * 1024)) + "MB/已下载" + Math.round(rlianjidata.msg.data.dl_size / (1024 * 1024)) + "MB/需要时间" + rlianjidata.msg.data.left_time + "秒"
}
let pdiv = document.getElementById("progressbarsunji")
pdiv.style.width = resultContent
$("#progressbarsunji").html(resultContent);
$("#progressbarli").html(resultyulian);
/* $("#updateAKPcontentProgressPackage").html(resultContent);*/
}
}
//if (res) {
// let resultContent = "";
// let resultyulian = "";
// //for (var p in res) {
// // if (res[p].length > 0) {
// // /* resultContent += "\r\n\r\nMsgID: " + p + ",";*/
// // for (let i = 0; i < res[p].length; i++) {
// // let rlianjidata = JSON.parse(res[p][i].data)
// // /* debugger*/
// // if (res[p].length == 101) {
// // alert('升级固件成功~')
// // window.clearTimeout(gQueryProgressTimer);
// // console.log(rlianjidata.sn)
// // break;
// // } else {
// // resultContent = rlianjidata.msg.data.rate + '%'
// // resultyulian = "总共:" + Math.round(rlianjidata.msg.data.file_size / (1024 * 1024)) + "MB/已下载" + Math.round(rlianjidata.msg.data.dl_size / (1024 * 1024)) + "MB/需要时间" + rlianjidata.msg.data.left_time + "秒"
// // }
// // }//end of for
// // }//end of if (res[p].length > 0) {
// //}//end of for (var p in res) {
// if (resultContent == undefined) {
// resultContent = 0 + '%'
// }
// let pdiv = document.getElementById("progressbarsunji")
// pdiv.style.width = resultContent
// $("#progressbarsunji").html(resultContent);
// $("#progressbarli").html(resultyulian);
// //$("#updateAKPcontentProgressPackage").html(resultContent);
//}
}
});
gQueryProgressTimer = window.setTimeout(aQueryProgress, 500, msgidArr);
}
</script>

View File

@@ -0,0 +1,743 @@

@{
ViewBag.Title = "updateAPKs";
Layout = "~/Areas/App/Views/Shared/_Layout.cshtml";
List<Face.Domain.Entities.Hotels> Hotellist = (List<Face.Domain.Entities.Hotels>)ViewData["Hotelsp"];
List<Face.Domain.Application.FaceAll.fileawholelog> Akplist = (List<Face.Domain.Application.FaceAll.fileawholelog>)ViewData["ToBool"];
}
<div class="content-wrapper">
<section class="content" style="padding:0px;">
<div class="container-fluid">
<div class="row">
<div class="col-sm-8">
<!-- Default box -->
<div class="card">
<div class="card-header">
<span style="font-size:30px">批量下发固件</span>
<div class="card-tools">
<button type="button" class="btn btn-tool" data-card-widget="collapse" title="Collapse"></button>
<button type="button" class="btn btn-tool" data-card-widget="remove" title="Remove">
<i class="fas fa-times"></i>
</button>
</div>
</div>
@*内容筛选*@
<div>
</div>
<div style="display:none"> </div>
<div class="ibox-content" style="padding:0px;">
<div id="project">
<div class="card-body">
<form class="form-horizontal" id="AddresidentFrom">
<div class="form-group">
<p></p>
<div style="display:flex;">
<div class="col-md-6">
<label for="exampleInputFile"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">酒店名称</font></font></label>
<select class="form-control" id="OrgIds">
<option value="0">
请选择酒店
</option>
@{
List<int> sum = (List<int>)Session["list"];
foreach (int item in sum)
{
foreach (var iten in Hotellist)
{
if (iten.Id == item)
{
<option class="ComboBox" value="@iten.Id" id="@iten.Code">
@iten.Name
</option>
}
}
}
}
</select>
@if (Session["username"]?.ToString()?.ToLower() == "momo")
{
<input type="text" class="form-control" id="OrgIdsjud" placeholder="请输入酒店" onblur="judiannamecx()">
}
</div>
<div class="col-md-6">
<label for="exampleInputFile"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">房间</font></font></label>
<select class="form-control" id="RoomIdshow">
<option>请选择房间</option>'
</select>
</div>
</div>
<div style="display:flex;">
<div class="col-md-6">
<label for="exampleInputFile"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">人脸机序列号</font></font></label>
<input type="text" class="form-control" id="Rlianjichanxis" aria-describedby="emailHelp" onblur="rlianjichanxi()">
</div>
</div>
<div style="border: 1px solid #e4e6e8; margin: 10px;">
<div>
<label for="exampleInputFile" style="margin:10px;"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">固件信息</font></font></label>
<div style="display:flex;">
<div class="col-md-3">
<input type="text" class="form-control" id="gujianxx" placeholder="请填写文件名" aria-describedby="emailHelp" onblur="guojianxxcx()">
</div>
<div class="col-md-3">
<input type="text" class="form-control" id="wjianbzhu" placeholder="请填写文件备注" aria-describedby="emailHelp" onblur="guojianxxcx()">
</div>
</div>
@*<select class="form-control" id="Guojingshow">
<option value="0">请选择固件</option>
@foreach (var item in Akplist)
{
<option value="@item.id">@item.filename</option>
}
</select>*@
</div>
<p></p>
<div id="myModalcxz">
<div style="width: 100%;">
<div>
<div id="modal-body" style="padding:10px">
<table class="table table-bordered table-hover ">
<tbody id="rlianjigujian">
</tbody>
</table>
</div>
</div>
<div class="modal-footer">
</div>
</div>
</div>
</div>
</div>
<div class="col-md-12">
<div class="card card-primary card-outline">
<div class="card-body p-0">
<div class="table-responsive mailbox-messages">
<table class="table table-hover table-striped">
<tbody id="OrgIdsShow">
</tbody>
</table>
</div>
</div>
</div>
</div>
<p></p>
</form>
</div>
</div>
<div id="btn" onclick="tip()"></div>
</div>
</div>
</div>
</div>
<div class="col-sm-4" id="faceDetailsBox">
</div>
</div>
</section>
</div>
<script>
$(function () {
$("#myModalcxz").css("display", "block");
$.ajax({
type: "post",
url: "/app/SetFace/GetgujianinfoByName",
success: function (res) {
// console.log(res)
$("#myModalcxz").css("display", "block");
document.getElementById('rlianjigujian').innerHTML = "";
$("#rlianjigujian").append('<tr>' +
' <td class="mailbox-star">文件名</td>' +
' <td class="mailbox-name">文件大小</td>' +
' <td class="mailbox-attachment">文件日期</td>' +
' <td class="mailbox-date">备注</td>' +
' <td class="mailbox-date">操作</td>'
+ '</tr>'
);
res.info.forEach(x => {
$("#rlianjigujian").append('<tr>' +
' <td class="mailbox-star">' + x.filename + '</td>' +
' <td class="mailbox-name">' + x.firmwaresize + 'MB</td>' +
' <td class="mailbox-attachment">' + shijiancuo(x.creationtime) + '</td>' +
' <td class="mailbox-date">' + x.remark + '</td>' +
'<td class="mailbox-date">' +
'<button class="btn btn-md btn-primary" type="button" id="btnAddShow" onclick="OnShow(' + "'" + x.filename + "'" + ',' + "'" + 1 + "'" + ')" >下发</button>'
+ '</td>'
+ '</tr>');
})
}
});
})
////固件查询
//$("#Guojingshow").change(function () {
// var myType1 = document.getElementById("Guojingshow");//获取select对象
// console.log(myType1)
// var index1 = myType1.selectedIndex;//获取选项中的索引selectIndex表示的是当前所选中的index
// var ApkName = myType1.options[index1].value;//获取固件名称
// console.log(ApkName)
// if (ApkName == 0) {
// $("#myModalcxz").css("display", "none");
// return
// }
// $.ajax({
// type: "post",
// url: "/app/SetFace/GetgujianinfoByName",
// data: { "ApkName": ApkName },
// success: function (res) {
// $("#myModalcxz").css("display", "block");
// document.getElementById('rlianjigujian').innerHTML = "";
// $("#rlianjigujian").append('<tr>' +
// ' <td class="mailbox-star">文件名</td>' +
// ' <td class="mailbox-name">文件大小</td>' +
// ' <td class="mailbox-attachment">文件日期</td>' +
// ' <td class="mailbox-date">备注</td>' +
// ' <td class="mailbox-date">操作</td>'
// +'</tr>'
// );
// $("#rlianjigujian").append('<tr>' +
// ' <td class="mailbox-star">' + res.info.filename + '</td>' +
// ' <td class="mailbox-name">' + res.info.firmwaresize + '</td>' +
// ' <td class="mailbox-attachment">' + shijiancuo(res.info.creationtime) + '</td>' +
// ' <td class="mailbox-date">' + res.info.remark + '</td>' +
// '<td class="mailbox-date">' +
// '<button class="btn btn-md btn-primary" type="button" id="btnAddShow" onclick="OnShow(' + "'" + res.info.filename + "'" + ',' + "'" + 1 + "'" +')" >下发</button>'
// + '</td>'
// +'</tr>');
// }
// });
//})
//固件条件查询
function guojianxxcx() {
var gujianxx = document.getElementById('gujianxx').value
var wjianbzhu = document.getElementById('wjianbzhu').value
console.log("文件名称" + gujianxx)
console.log("文件备注" + wjianbzhu)
$.ajax({
type: "post",
url: "/app/SetFace/GetgujianinfoByNamesd",
data: { "ApkName": gujianxx, "wjianbhu": wjianbzhu },
success: function (res) {
$("#myModalcxz").css("display", "block");
document.getElementById('rlianjigujian').innerHTML = "";
$("#rlianjigujian").append('<tr>' +
' <td class="mailbox-star">文件名</td>' +
' <td class="mailbox-name">文件大小</td>' +
' <td class="mailbox-attachment">文件日期</td>' +
' <td class="mailbox-date">备注</td>' +
' <td class="mailbox-date">操作</td>'
+ '</tr>'
);
res.info.forEach(x => {
$("#rlianjigujian").append('<tr>' +
' <td class="mailbox-star">' + x.filename + '</td>' +
' <td class="mailbox-name">' + x.firmwaresize + 'MB</td>' +
' <td class="mailbox-attachment">' + shijiancuo(x.creationtime) + '</td>' +
' <td class="mailbox-date">' + x.remark + '</td>' +
'<td class="mailbox-date">' +
'<button class="btn btn-md btn-primary" type="button" id="btnAddShow" onclick="OnShow(' + "'" + x.filename + "'" + ',' + "'" + 1 + "'" + ')" >下发</button>'
+ '</td>'
+ '</tr>');
})
}
});
}
//时间格式转换
function shijiancuo(timestamp) {
var d = new Date(parseInt(timestamp.replace("/Date(", "").replace(")/", ""), 10));
return d.getFullYear() + '-' + (+d.getMonth() + 1) + '-' + d.getDate() + ' ' + d.getHours() + ':' + d.getMinutes() + ':' + d.getSeconds();
}
function updateAKP() {
$("#myModal").css("display", "block");
$("#modal-body").html("查询中...");
$.ajax({
type: "post",
url: "/app/Face/updateAkps",
cache: false,
success: function (res) {
$("#modal-body").html(res);
}
});
}
// +
$("#OrgIds").change(function () {
var myType = document.getElementById("OrgIds");//获取select对象
console.log(myType)
var index = myType.selectedIndex;//获取选项中的索引selectIndex表示的是当前所选中的index
var ApkName = myType.options[index].value;//获取固件名称
console.log(ApkName)
document.getElementById('OrgIdsShow').innerHTML = "";
document.getElementById('RoomIdshow').innerHTML = "";
if (ApkName == 0) {
alert("请选择酒店名称")
return;
}
$.ajax({
url: "/App/Face/officialHotel",
type: "post",
data: { "hotelId": ApkName },
success: function (res) {
// console.log(res)
$('#OrgIdsShow').append('<tr>' +
' <td>' +
//' <div class="icheck-primary" >' +
//'<input type="checkbox" onclick="checkAll()" /><i>全选</i>' +
//' </div>' +
' </td>' +
' <td class="mailbox-star" style="border-collapse:collapse">房间号码</td>' +
' <td class="mailbox-name">厂牌</td>' +
' <td class="mailbox-subject">人脸机Sn</td>' +
' <td class="mailbox-attachment">下发进度</td>' +
' <td class="mailbox-date">下载进度</td>' +
+'</tr>');
res.forEach(x => {
$('#OrgIdsShow').append('<tr>' +
' <td><div class="icheck-primary" ><input type="checkbox" name="roles" value="' + x.RoomId + '" id="check1"></div></td >' +
'<td class="mailbox-star" style="border-collapse:collapse">' + x.ROOM_NUMBER + '</td>' +
'<td class="mailbox-name">' + x.Factory + '</td>' +
'<td class="mailbox-subject">' +
'<b>' + x.SerialNo + '</b>' +
'</td>' +
' <td class="mailbox-attachment">' +
'<div class="progress"><div class="progress-bar bg-success" id="progressbarsunji' + x.RoomId + '" role="progressbar" style="width: 0%" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100">div></div > ' +
'</td > ' +
'<td class="mailbox-date">'
+ '<b id="progressbarli' + x.RoomId + '"></b>'
+ '</td > '
+ '</tr > ');
});
$('#RoomIdshow').append('<option class="Roomshow" value="0" id="Room">请选择房间</option>')
res.forEach(x => {
$('#RoomIdshow').append('<option class="Roomshow" value="' + x.RoomId + '" id="' + x.RoomId + '">' +
x.ROOM_NUMBER +
'</option>'
);
})
}
});
})
//酒店条件查询
function judiannamecx() {
var jd = document.getElementById('OrgIdsjud').value
document.getElementById('OrgIds').innerHTML = "";
$.ajax({
url: "/App/SetFace/updateAPKsbyjdname",
type: "post",
data: { "hotelId": jd },
success: function (res) {
//console.log(res)
/* window.location.replace("updateAPKs")*/
//$('#OrgIdsShow').append('<tr>' +
// ' <td>' +
// ' <div class="icheck-primary" >' +
// '<input type="checkbox" onclick="checkAll()" /><i>全选</i>' +
// ' </div>' +
// ' </td>' +
// ' <td class="mailbox-star" style="border-collapse:collapse">房间号码</td>' +
// ' <td class="mailbox-name">厂牌</td>' +
// ' <td class="mailbox-subject">人脸机Sn</td>' +
// ' <td class="mailbox-attachment">下发进度</td>' +
// ' <td class="mailbox-date">下载进度</td>' +
// +'</tr>');
debugger
$('#OrgIds').append('<option class="Roomshow" value="0" id="Room">请选择酒店</option>')
res.forEach(x => {
$('#OrgIds').append('<option class="Roomshow" value="' + x.Id + '" id="' + x.RoomId + '">' +
x.Name +
'</option>'
);
});
//$('#RoomIdshow').append('<option class="Roomshow" value="0" id="Room">请选择房间</option>')
//res.forEach(x => {
// $('#RoomIdshow').append('<option class="Roomshow" value="' + x.RoomId + '" id="' + x.RoomId + '">' +
// x.RoomId +
// '</option>'
// );
//})
}
});
}
//房间的条件查询
$('#RoomIdshow').change(function () {
var myType = document.getElementById("RoomIdshow");//获取select对象
var index = myType.selectedIndex;//获取选项中的索引selectIndex表示的是当前所选中的index
var code = myType.options[index].value;//获取房间编号
var myType1 = document.getElementById("OrgIds");//获取select对象
console.log(myType1)
var index1 = myType1.selectedIndex;//获取选项中的索引selectIndex表示的是当前所选中的index
var ApkName = myType1.options[index1].value;//获取固件名称
console.log(ApkName)
if (ApkName == 0) {
alert("选择酒店名称")
return;
}
if (code == 0) {
alert("请选择房间号码")
return;
}
$.ajax({
url: "/App/Face/RoomIdbyRoom",
type: "post",
data: {"Roomid": code, "ApkName": ApkName },
success: function (res) {
document.getElementById('OrgIdsShow').innerHTML = "";
// console.log(res)
$('#OrgIdsShow').append('<tr>' +
' <td>' +
//' <div class="icheck-primary" >' +
//'<input type="checkbox" onclick="checkAll()" /><i>全选</i>' +
//' </div>' +
' </td>' +
' <td class="mailbox-star" style="border-collapse:collapse">房间号码</td>' +
' <td class="mailbox-name">厂牌</td>' +
' <td class="mailbox-subject">人脸机Sn </td>' +
' <td class="mailbox-attachment">下发进度</td>' +
' <td class="mailbox-date">下载进度</td>' +
+'</tr>');
res.forEach(x => {
$('#OrgIdsShow').append('<tr>' +
' <td><div class="icheck-primary" ><input type="checkbox" name="roles" value="' + x.RoomId + '" id="check1"></div></td >' +
'<td class="mailbox-star" style="border-collapse:collapse">' + x.ROOM_NUMBER + '</td>' +
'<td class="mailbox-name">' + x.Factory + '</td>' +
'<td class="mailbox-subject">' +
'<b>' + x.SerialNo + '</b>' +
'</td>' +
' <td class="mailbox-attachment">' +
'<div class="progress"><div class="progress-bar bg-success" id="progressbarsunji' + x.RoomId + '" role="progressbar" style="width: 0%" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100">div></div > ' +
'</td > ' +
'<td class="mailbox-date">'
+ '<b id="progressbarli' + x.RoomId + '"></b>'
+ '</td > '
+ '</tr > ');
});
}
});
})
//人脸机查询
function rlianjichanxi() {
var sn = document.getElementById('Rlianjichanxis').value
var myType1 = document.getElementById("OrgIds");//获取select对象
console.log(myType1)
var index1 = myType1.selectedIndex;//获取选项中的索引selectIndex表示的是当前所选中的index
var ApkName = myType1.options[index1].value;//获取固件名称
console.log(ApkName)
if (ApkName == 0) {
alert("选择酒店名称")
return;
}
console.log(sn);
$.ajax({
url: "/App/Face/RoomIdbysn",
type: "post",
data: {"sn": sn, "ApkName": ApkName },
success: function (res) {
document.getElementById('OrgIdsShow').innerHTML = "";
// console.log(res)
$('#OrgIdsShow').append('<tr>' +
' <td>' +
//' <div class="icheck-primary" >' +
//'<input type="checkbox" onclick="checkAll()" /><i>全选</i>' +
//' </div>' +
' </td>' +
' <td class="mailbox-star" style="border-collapse:collapse">房间号码</td>' +
' <td class="mailbox-name">厂牌</td>' +
' <td class="mailbox-subject">人脸机Sn </td>' +
' <td class="mailbox-attachment">下发进度</td>' +
' <td class="mailbox-date">下载进度</td>' +
+'</tr>');
res.forEach(x => {
$('#OrgIdsShow').append('<tr>' +
' <td><div class="icheck-primary" ><input type="checkbox" name="roles" value="' + x.RoomId + '" id="check1"></div></td >' +
'<td class="mailbox-star" style="border-collapse:collapse">' + x.ROOM_NUMBER + '</td>' +
'<td class="mailbox-name">' + x.Factory + '</td>' +
'<td class="mailbox-subject">' +
'<b>' + x.SerialNo + '</b>' +
'</td>' +
' <td class="mailbox-attachment">' +
'<div class="progress"><div class="progress-bar bg-success" id="progressbarsunji' + x.RoomId + '" role="progressbar" style="width: 0%" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100">div></div > ' +
'</td > ' +
'<td class="mailbox-date">'
+ '<b id="progressbarli' + x.RoomId + '"></b>'
+ '</td > '
+ '</tr > ');
});
}
});
}
//厂牌条件查询
$('#brandID').change(function () {
var myType = document.getElementById("brandID");//获取select对象
var index = myType.selectedIndex;//获取选项中的索引selectIndex表示的是当前所选中的index
var code = myType.options[index].value;//获取酒店编号
console.log(index)
console.log(code)
var myType1 = document.getElementById("OrgIds");//获取select对象
console.log(myType1)
var index1 = myType1.selectedIndex;//获取选项中的索引selectIndex表示的是当前所选中的index
var ApkName = myType1.options[index1].value;//获取固件名称
console.log(ApkName)
if (ApkName == 0) {
alert("选择酒店名称")
return;
}
if (code==0) {
alert("请选择厂牌")
return;
}
$.ajax({
url: "/App/Face/RoomIdbybrandid",
type: "post",
data: {"brandid": code, "ApkName": ApkName },
success: function (res) {
document.getElementById('OrgIdsShow').innerHTML = "";
// console.log(res)
$('#OrgIdsShow').append('<tr>' +
' <td>' +
//' <div class="icheck-primary" >' +
//'<input type="checkbox" onclick="checkAll()" /><i>全选</i>' +
//' </div>' +
' </td>' +
' <td class="mailbox-star" style="border-collapse:collapse">房间号码</td>' +
' <td class="mailbox-name">厂牌</td>' +
' <td class="mailbox-subject">人脸机Sn </td>' +
' <td class="mailbox-attachment">下发进度</td>' +
' <td class="mailbox-date">下载进度</td>' +
+'</tr>');
res.forEach(x => {
$('#OrgIdsShow').append('<tr>' +
' <td><div class="icheck-primary" ><input type="checkbox" name="roles" value="' + x.RoomId + '" id="check1"></div></td >' +
'<td class="mailbox-star" style="border-collapse:collapse">' + x.ROOM_NUMBER + '</td>' +
'<td class="mailbox-name">' + x.Factory + '</td>' +
'<td class="mailbox-subject">' +
'<b>' + x.SerialNo + '</b>' +
'</td>' +
' <td class="mailbox-attachment">' +
'<div class="progress"><div class="progress-bar bg-success" id="progressbarsunji' + x.RoomId + '" role="progressbar" style="width: 0%" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100">div></div > ' +
'</td > ' +
'<td class="mailbox-date">'
+ '<b id="progressbarli' + x.RoomId + '"></b>'
+ '</td > '
+ '</tr > ');
});
}
});
})
var slist = '';
//下发固件方法
function OnShow(ApkName, id) {
/* debugger*/
let resultContent = 0;
let resultyulian = "";
var obj = document.getElementsByName('roles'); //选择所有name="'test'"的对象,返回数组
/* console.log(id)*/
//取到对象数组后,我们来循环检测它是不是被选中
var s = '';
for (var i = 0; i < obj.length; i++) {
if (obj[i].checked) {
if (s.length > 0) {
s += ",";
}
if (slist.length > 0) {
slist += ",";
}
s += obj[i].value; //如果选中将value添加到变量s中
slist += obj[i].value
}
}
debugger
var arrint = slist.split(',')
console.log(arrint)
let newList = Array.from(new Set(arrint))
console.log(newList)
for (var i = 0; i < newList.length; i++) {
let pdiv = document.getElementById("progressbarsunji" + newList[i])
pdiv.style.width = resultContent
$("#progressbarsunji" + newList[i]).html(resultContent);
$("#progressbarli" + newList[i]).html(resultyulian);
}
debugger
//那么现在来检测s的值就知道选中的复选框的值了
if (s == "") {
alert(s == '' ? '请您选择需要下发的房间!' : s);
}
else {
var arrintds = s.split(',')
if (arrintds.length <= 3) {
var name = confirm('确定要下发固件名为' + ApkName);
if (name) {
$.ajax({
url: "/App/Face/BatchSetAPKSand",
type: "post", // 提交方式
data: { "ApkName": ApkName, "RoomidList": s },
success: function (res) { // 请求成功后的回调函数其中的参数data为controller返回的map,也就是说然后通过data这个参数取JSON数据中的值
if (res.isok == true) {
startIntervalQueryProgress(res.arr);
alert('升级固件中~')
}
else {
alert('升级固件失败')
}
}
});
}
}
else {
alert('升级设备数量比较多请重新选择1~3个设备进行升级')
}
}
//stamp.disabled = false;
}
let ok = true; //checked为布尔值 判断是否为全选
function checkAll() {
var hobby = document.getElementsByName("roles");
console.log(hobby);
for (var i in hobby) {
hobby[i].checked = ok;
}
ok = !ok;
};
//定时器方法
/* var gQueryProgressTimer = -1;*/
//var gQueryProgressCnt = 0;
//var countMax = 2 * 60 * 5; //5 分钟内差不多可以等到更新后的返回包,开始重启。
function startIntervalQueryProgress(msgidArr) {
/* gQueryProgressTimer =*/ window.setTimeout(aQueryProgress, 500, msgidArr);
}
//进度条方法
function aQueryProgress(msgidArr) {
//gQueryProgressCnt++;
//if (gQueryProgressCnt >= countMax) {
// window.clearTimeout(gQueryProgressTimer);
// return;
//}
$.ajax({
type: "post",
url: "/app/Face/GetSetAPKSandProgressData",
data: JSON.stringify({ msgidList: msgidArr }),
contentType: 'application/json',
cache: false,
success: function (res) {
var arrint = slist.split(',')
var newList = Array.from(new Set(arrint))
/* console.log(newList)*/
if (res) {
let resultContent = "";
let resultyulian = "";
for (var p in res) {
if (res[p].length > 0) {
/* resultContent += "\r\n\r\nMsgID: " + p + ",";*/
for (let i = 0; i < res[p].length; i++) {
let rlianjidata = JSON.parse(res[p][i].data)
/* debugger*/
if (res[p].length == 101) {
alert('升级固件成功~')
window.clearTimeout(gQueryProgressTimer);
console.log(rlianjidata.sn)
break;
} else {
resultContent = rlianjidata.msg.data.rate + '%'
resultyulian = "总共:" + Math.round(rlianjidata.msg.data.file_size / (1024 * 1024)) + "MB/已下载" + Math.round(rlianjidata.msg.data.dl_size / (1024 * 1024)) + "MB/需要时间" + rlianjidata.msg.data.left_time + "秒"
}
}//end of for
}//end of if (res[p].length > 0) {
}//end of for (var p in res) {
if (resultContent == undefined) {
resultContent = 0 + '%'
}
for (var i = 0; i < newList.length; i++) {
let pdiv = document.getElementById("progressbarsunji" + newList[i])
pdiv.style.width = resultContent
$("#progressbarsunji" + newList[i]).html(resultContent);
$("#progressbarli" + newList[i]).html(resultyulian);
}
//$("#updateAKPcontentProgressPackage").html(resultContent);
}
}
});
gQueryProgressTimer = window.setTimeout(aQueryProgress, 500, msgidArr);
}
</script>