Compare commits
5 Commits
ZhuYou_Wcs
...
taitan_den
Author | SHA1 | Date | |
---|---|---|---|
9d64ef5d7a | |||
6d016714ad | |||
8c07d147d5 | |||
3a08c033ba | |||
ab8ac9cce6 |
BIN
DLL/LightContrl.dll
Normal file
BIN
DLL/LightContrl.dll
Normal file
Binary file not shown.
BIN
DLL/LightContrl.pdb
Normal file
BIN
DLL/LightContrl.pdb
Normal file
Binary file not shown.
@ -374,5 +374,25 @@ namespace Epost.BLL
|
||||
return dal.GetAddressListByByPage(strWhere, orderby, startIndex, endIndex, out recordCount);
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
#region 灯带
|
||||
|
||||
#region 查询设备信息
|
||||
public DataTable QueryAddrList(string strwhere)
|
||||
{
|
||||
return dal.QueryAddrList(strwhere);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region 查询设备信息
|
||||
public DataTable QueryControlList(string strwhere)
|
||||
{
|
||||
return dal.QueryControlList(strwhere);
|
||||
}
|
||||
#endregion
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
@ -41,7 +41,6 @@ namespace Epost.BLL
|
||||
public ResultModel ClearALL()
|
||||
{
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
bool t = addrBLL.UpdateState();
|
||||
|
@ -809,5 +809,26 @@ namespace Epost.DAL
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
#region 灯带
|
||||
#region 查询设备信息
|
||||
public DataTable QueryAddrList(string strwhere)
|
||||
{
|
||||
string sql = string.Format("select * from v_address where 1=1 " + strwhere);
|
||||
return db.GetsqlForDT(sql);
|
||||
}
|
||||
|
||||
#endregion
|
||||
#region 查询设备信息
|
||||
public DataTable QueryControlList(string strwhere)
|
||||
{
|
||||
string sql = string.Format(" select distinct controlip ,port,waveno,address from v_address where 1=1 " + strwhere);
|
||||
return db.GetsqlForDT(sql);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
|
99
Epost.DAL/Cache/LightControlCacheDAL.cs
Normal file
99
Epost.DAL/Cache/LightControlCacheDAL.cs
Normal file
@ -0,0 +1,99 @@
|
||||
using LightContrl;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Epost.DAL.Cache
|
||||
{
|
||||
public class LightControlCacheDAL
|
||||
{
|
||||
|
||||
private static object lockconobj = new object();
|
||||
public static List<LightcontrolModel> MainControlList = new List<LightcontrolModel>();//
|
||||
|
||||
#region 获取计划任务列表
|
||||
public List<LightcontrolModel> GetControlList()
|
||||
{
|
||||
return MainControlList;
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
#region 初始化任务列表
|
||||
public void ClearControlList()
|
||||
{
|
||||
foreach (var planitem in MainControlList.ToArray())
|
||||
{
|
||||
MainControlList.Remove(planitem);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Job缓存处理方法
|
||||
/// <summary>
|
||||
/// Job缓存处理方法
|
||||
/// </summary>
|
||||
/// <param name="JobParam"></param>
|
||||
/// <param name="ECommend"></param>
|
||||
/// <returns></returns>
|
||||
public bool UpdateControlList(List<LightcontrolModel> JobParam, EcontrolCommend CommendType)
|
||||
{
|
||||
|
||||
lock (lockconobj)
|
||||
{
|
||||
|
||||
if (CommendType.Equals(EcontrolCommend.Create))
|
||||
{
|
||||
|
||||
MainControlList.AddRange(JobParam);
|
||||
}
|
||||
|
||||
else if (CommendType.Equals(EcontrolCommend.Execute))
|
||||
{
|
||||
foreach (var planitem in MainControlList.ToArray())
|
||||
{
|
||||
MainControlList.Remove(planitem);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
public enum EcontrolCommend
|
||||
{
|
||||
/// <summary>
|
||||
/// 创建
|
||||
/// </summary>
|
||||
[Description("创建")]
|
||||
Create,
|
||||
/// <summary>
|
||||
/// 删除
|
||||
/// </summary>
|
||||
[Description("删除")]
|
||||
Execute
|
||||
}
|
||||
|
||||
public class LightcontrolModel
|
||||
{
|
||||
private string _controlip = string.Empty;
|
||||
private int _port ;
|
||||
MainControl _maincontrol = new MainControl();
|
||||
|
||||
public MainControl maincontrol { get => _maincontrol; set => _maincontrol = value; }
|
||||
public string controlip { get => _controlip; set => _controlip = value; }
|
||||
public int port { get => _port; set => _port = value; }
|
||||
}
|
||||
}
|
@ -82,6 +82,10 @@
|
||||
<HintPath>..\packages\EntityFramework.6.1.3\lib\net45\EntityFramework.SqlServer.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="LightContrl, Version=3.0.2.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\DLL\LightContrl.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.ComponentModel.DataAnnotations" />
|
||||
<Reference Include="System.Configuration" />
|
||||
@ -106,6 +110,7 @@
|
||||
<Compile Include="Cache\EPlightCacheDAL.cs" />
|
||||
<Compile Include="Cache\JobDownCacheDAL.cs" />
|
||||
<Compile Include="Cache\JobModelCacheDAL.cs" />
|
||||
<Compile Include="Cache\LightControlCacheDAL.cs" />
|
||||
<Compile Include="Cache\LocationCacheDAL.cs" />
|
||||
<Compile Include="Cache\ScanModelCacheDAL.cs" />
|
||||
<Compile Include="Cache\ShowMesCacheDAL.cs" />
|
||||
|
@ -9,10 +9,18 @@ namespace Epost.Model
|
||||
public class OrderModel
|
||||
{
|
||||
|
||||
private string _OrderNO = string.Empty;
|
||||
private string _State = string.Empty;// 1亮灯 0灭灯
|
||||
private string _wallNo = string.Empty;
|
||||
private string _location = string.Empty;
|
||||
private string _lightColor = string.Empty;
|
||||
private string _lightType = string.Empty;
|
||||
private string _brightness = string.Empty;
|
||||
private string _status = string.Empty;
|
||||
|
||||
public string OrderNO { get => _OrderNO; set => _OrderNO = value; }
|
||||
public string State { get => _State; set => _State = value; }
|
||||
public string wallNo { get => _wallNo; set => _wallNo = value; }
|
||||
public string lcation { get => _location; set => _location = value; }
|
||||
public string lightColor { get => _lightColor; set => _lightColor = value; }
|
||||
public string lightType { get => _lightType; set => _lightType = value; }
|
||||
public string brightness { get => _brightness; set => _brightness = value; }
|
||||
public string status { get => _status; set => _status = value; }
|
||||
}
|
||||
}
|
||||
|
@ -37,4 +37,91 @@ namespace Epost.Model
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class SerResultModel
|
||||
{
|
||||
private string _resultCode = string.Empty;
|
||||
private string _resultMsg = string.Empty;
|
||||
|
||||
public string resultCode { get => _resultCode; set => _resultCode = value; }
|
||||
public string resultMsg { get => _resultMsg; set => _resultMsg = value; }
|
||||
}
|
||||
|
||||
public class TaskReqModel
|
||||
{
|
||||
private string matchid = string.Empty;
|
||||
private string orderid = string.Empty;
|
||||
private string sku = string.Empty;
|
||||
private string tolocation = string.Empty;
|
||||
private string originalBatch = string.Empty;
|
||||
private string block = string.Empty;
|
||||
private string area = string.Empty;
|
||||
private string _id = string.Empty;
|
||||
public string Matchid { get => matchid; set => matchid = value; }
|
||||
public string Orderid { get => orderid; set => orderid = value; }
|
||||
public string Sku { get => sku; set => sku = value; }
|
||||
public string Tolocation { get => tolocation; set => tolocation = value; }
|
||||
public string OriginalBatch { get => originalBatch; set => originalBatch = value; }
|
||||
public string Block { get => block; set => block = value; }
|
||||
public string Area { get => area; set => area = value; }
|
||||
public string id { get => _id; set => _id = value; }
|
||||
}
|
||||
|
||||
|
||||
|
||||
public class ResultLightModel
|
||||
{
|
||||
private string _resultCode = string.Empty;
|
||||
private string _resultMsg = string.Empty;
|
||||
|
||||
public string resultCode
|
||||
{
|
||||
get
|
||||
{
|
||||
return _resultCode;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
_resultCode = value;
|
||||
}
|
||||
}
|
||||
|
||||
public string resultMsg
|
||||
{
|
||||
get
|
||||
{
|
||||
return _resultMsg;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
_resultMsg = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public class reqmodel
|
||||
{
|
||||
public string wallNo { get; set; }
|
||||
public string lightType { get; set; }
|
||||
public string lightColor { get; set; }
|
||||
public string status { get; set; }
|
||||
}
|
||||
|
||||
|
||||
|
||||
public class DisplayjobModelReq
|
||||
{
|
||||
public string wallNo { get; set; }
|
||||
public string location { get; set; }
|
||||
public string lightColor { get; set; }
|
||||
public string lightType { get; set; }
|
||||
public string brightness { get; set; }
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -41,6 +41,7 @@ namespace Epost.TestToolsWeb.Controllers
|
||||
public ActionResult Index()
|
||||
{
|
||||
|
||||
|
||||
|
||||
ViewBag.isClear = isClear;
|
||||
ViewBag.isWork = isWork;
|
||||
|
@ -5,167 +5,305 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Net.Http;
|
||||
|
||||
using System.Web.Http;
|
||||
using LightContrl;
|
||||
|
||||
using Epost.DAL.Cache;
|
||||
using System.Net;
|
||||
using Microsoft.Owin.BuilderProperties;
|
||||
|
||||
namespace Epost.DPS.Controllers
|
||||
{
|
||||
[RoutePrefix("api/WebAPI")]
|
||||
[RoutePrefix("api/TaskAPI")]
|
||||
public class ServerController : ApiController
|
||||
{
|
||||
private static object lockinit = new object();
|
||||
AddressstorageBLL addrbll = new AddressstorageBLL();
|
||||
LightControlCacheDAL cachedal = new LightControlCacheDAL();
|
||||
MainControl lig = new MainControl();
|
||||
#region 连接
|
||||
[Route("CONNECT")]
|
||||
[HttpPost]
|
||||
public ResultLightModel CONNECT([FromBody] List<reqmodel> data)
|
||||
{
|
||||
ResultLightModel res = new ResultLightModel();
|
||||
try
|
||||
{
|
||||
LogHelper.WriteLogInfo("CONNECT请求" + JsonHelper.SerializeObject(data));
|
||||
if (data.Any() && data.Count > 0)
|
||||
{
|
||||
foreach (var item in data)
|
||||
{
|
||||
if (item.status == "1")//连接
|
||||
{
|
||||
DataTable dt = addrbll.QueryControlList(" and waveno ='" + item.wallNo + "'");
|
||||
if (dt != null && dt.Rows.Count > 0)
|
||||
{
|
||||
foreach (DataRow rowitem in dt.Rows)
|
||||
{
|
||||
|
||||
OrderControlBLL contrbll = new OrderControlBLL();
|
||||
string ipaddress = rowitem["controlip"].ToString().Trim();
|
||||
List<LightcontrolModel> conlist = cachedal.GetControlList().FindAll(o => o.controlip == ipaddress);
|
||||
if (conlist != null && conlist.Count > 0)
|
||||
{
|
||||
LogHelper.WriteLogInfo(ipaddress + "已连接!");
|
||||
res.resultCode = "0";
|
||||
res.resultMsg = "成功!";
|
||||
return res;
|
||||
}
|
||||
else
|
||||
{
|
||||
int port = Convert.ToInt32(rowitem["port"].ToString().Trim());
|
||||
int timeout = 2000;
|
||||
bool bo = lig.Connect(ipaddress, port, timeout);//timeout 毫秒
|
||||
if (bo)
|
||||
{
|
||||
LightcontrolModel model = new LightcontrolModel();
|
||||
model.controlip = ipaddress;
|
||||
model.maincontrol = lig;
|
||||
model.port = port;
|
||||
cachedal.UpdateControlList(new List<LightcontrolModel> { model }, EcontrolCommend.Create);
|
||||
res.resultCode = "0";
|
||||
res.resultMsg = "成功!";
|
||||
}
|
||||
else
|
||||
{
|
||||
res.resultCode = "-1";
|
||||
res.resultMsg = "连接失败" + ipaddress;
|
||||
LogHelper.WriteLogInfo("连接失败" + ipaddress);
|
||||
return res;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
res.resultCode = "-1";
|
||||
res.resultMsg = "播种墙号错误";
|
||||
LogHelper.WriteLogInfo("播种墙号错误");
|
||||
return res;
|
||||
}
|
||||
}
|
||||
else {
|
||||
LogHelper.WriteLogInfo("断开连接");
|
||||
List<LightcontrolModel> conlist = cachedal.GetControlList();
|
||||
if (conlist.Any() && conlist.Count > 0)
|
||||
{
|
||||
foreach (LightcontrolModel con in conlist)
|
||||
{
|
||||
bool b= con.maincontrol.DisConnect(con.controlip,con.port);
|
||||
LogHelper.WriteLogInfo(b+"断开连接"+ con.controlip+"=="+con.port);
|
||||
}
|
||||
}
|
||||
cachedal.ClearControlList();
|
||||
res.resultCode = "0";
|
||||
res.resultMsg = "断开连接成功!";
|
||||
}
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.WriteLogInfo(ex.ToString(), LogHelper.Log_Type.ERROR);
|
||||
res.resultMsg = "请求接口异常!";
|
||||
res.resultCode = "-1";
|
||||
|
||||
//初始化
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 全亮全灭
|
||||
[Route("LEDON")]
|
||||
[HttpPost]
|
||||
public ResultLightModel LEDON([FromBody] List<reqmodel> data)
|
||||
{
|
||||
ResultLightModel res = new ResultLightModel();
|
||||
try
|
||||
{
|
||||
LogHelper.WriteLogInfo("LEDON请求" + JsonHelper.SerializeObject(data));
|
||||
if (data.Any() && data.Count > 0)
|
||||
{
|
||||
foreach (var item in data)
|
||||
{
|
||||
|
||||
//根据播种墙号查询灯带IP
|
||||
DataTable dt = addrbll.QueryControlList(" and waveno ='" + item.wallNo + "'");
|
||||
if (dt != null && dt.Rows.Count > 0)
|
||||
{
|
||||
foreach (DataRow rowitem in dt.Rows)
|
||||
{
|
||||
string ipaddress = rowitem["controlip"].ToString().Trim();
|
||||
List<LightcontrolModel> conlist = cachedal.GetControlList().FindAll(o => o.controlip == ipaddress);
|
||||
if (conlist != null && conlist.Count > 0)
|
||||
{
|
||||
|
||||
MainControl control = conlist.FirstOrDefault().maincontrol;
|
||||
bool bo = false;
|
||||
string Address = dt.Rows[0]["address"].ToString().Trim();
|
||||
string resstr = string.Empty;
|
||||
if (item.lightType == "0")
|
||||
{
|
||||
|
||||
bo = control.LED_OFF(ipaddress, Address,ref resstr);
|
||||
}
|
||||
else
|
||||
{
|
||||
bo = control.LED_ON(ipaddress, Address, ref resstr, "3", "0" , item.lightColor.Trim());
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (bo)
|
||||
{
|
||||
res.resultCode = "0";
|
||||
res.resultMsg = "成功!";
|
||||
}
|
||||
else
|
||||
{
|
||||
res.resultCode = "-1";
|
||||
res.resultMsg = "失败";
|
||||
LogHelper.WriteLogInfo(ipaddress+"失败!" +resstr);
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
res.resultCode = "-1";
|
||||
res.resultMsg = "请先连接设备";
|
||||
LogHelper.WriteLogInfo("请先连接设备!");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
res.resultCode = "-1";
|
||||
res.resultMsg = "播种墙号错误!";
|
||||
LogHelper.WriteLogInfo("播种墙号错误", LogHelper.Log_Type.ERROR);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
res.resultCode = "-1";
|
||||
res.resultMsg = "请求参数错误!";
|
||||
LogHelper.WriteLogInfo("请求参数错误!");
|
||||
}
|
||||
|
||||
|
||||
return res;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.WriteLogInfo(ex.ToString(), LogHelper.Log_Type.ERROR);
|
||||
res.resultMsg = "请求接口异常!";
|
||||
res.resultCode = "-1";
|
||||
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 根据货位点亮/熄灭格口
|
||||
[Route("DISPLAYJOB")]
|
||||
[HttpPost]
|
||||
public ResultModel DISPLAYJOB(OrderModel model)
|
||||
public ResultLightModel DISPLAYJOB([FromBody] List<DisplayjobModelReq> data)
|
||||
{
|
||||
lock (lockinit)
|
||||
ResultLightModel res = new ResultLightModel();
|
||||
try
|
||||
{
|
||||
ResultModel res = new ResultModel();
|
||||
try
|
||||
LogHelper.WriteLogInfo("DISPLAYJOB请求" + JsonHelper.SerializeObject(data));
|
||||
if (data.Any() && data.Count > 0)
|
||||
{
|
||||
LogHelper.WriteLogInfo(JsonHelper.SerializeObject(model));
|
||||
res.result = "0";
|
||||
res.msg = "成功!";
|
||||
return res;
|
||||
foreach (DisplayjobModelReq item in data)
|
||||
{
|
||||
//根据播种墙号查询灯带IP
|
||||
DataTable dt = addrbll.QueryControlList(" and waveno ='" + item.wallNo + "'");
|
||||
if (dt != null && dt.Rows.Count > 0)
|
||||
{
|
||||
foreach (DataRow rowitem in dt.Rows)
|
||||
{
|
||||
string ipaddress = rowitem["controlip"].ToString().Trim();
|
||||
List<LightcontrolModel> conlist = cachedal.GetControlList().FindAll(o => o.controlip == ipaddress);
|
||||
if (conlist != null && conlist.Count > 0)
|
||||
{
|
||||
MainControl control = conlist.FirstOrDefault().maincontrol;
|
||||
DataTable locdt = addrbll.QueryAddrList(" and waveno ='" + item.wallNo + "' and location ='" + item.location + "' and controlip='" + ipaddress + "'");
|
||||
if (locdt != null && locdt.Rows.Count > 0)
|
||||
{
|
||||
List<LightParagraph> list = new List<LightParagraph>();
|
||||
string address = locdt.Rows[0]["address"].ToString().Trim();
|
||||
foreach (DataRow locitem in locdt.Rows)
|
||||
{
|
||||
//根据播种墙号、格口号查询播种墙ip及灯带地址
|
||||
|
||||
LightParagraph show = new LightParagraph();
|
||||
show.WayNu = Convert.ToInt32(locitem["wayno"].ToString().Trim());
|
||||
show.LightBeganNu = locitem["beginno"].ToString().Trim();
|
||||
show.LightEndNu = locitem["endno"].ToString().Trim();
|
||||
show.LightColor = item.lightColor.Trim(); //1:蓝色 2:绿色 3:青色 4:红色 5:紫色 6黄色 7白色
|
||||
show.Brightness = item.brightness.Trim();//亮度 1-9
|
||||
list.Add(show);
|
||||
|
||||
}
|
||||
string resstr = string.Empty;
|
||||
bool bo = control.LED_By_Paragraph(ipaddress, address, list,ref resstr);
|
||||
if (bo)
|
||||
{
|
||||
LogHelper.WriteLogInfo("成功" + ipaddress+"list:"+JsonHelper.SerializeObject(list));
|
||||
res.resultCode = "0";
|
||||
res.resultMsg = "成功!";
|
||||
}
|
||||
else
|
||||
{
|
||||
LogHelper.WriteLogInfo("失败"+ ipaddress + "list:" + JsonHelper.SerializeObject(list),LogHelper.Log_Type.ERROR);
|
||||
res.resultCode = "-1";
|
||||
res.resultMsg = resstr;
|
||||
return res;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
res.resultCode = "-1";
|
||||
res.resultMsg = "请先连接设备!";
|
||||
LogHelper.WriteLogInfo("请先连接设备!");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
res.resultCode = "-1";
|
||||
res.resultMsg = "播种墙号错误!";
|
||||
LogHelper.WriteLogInfo("播种墙号错误!");
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.WriteLogInfo("GetDataList异常:" + ex.Message);
|
||||
res.msg = "请求异常!";
|
||||
res.result = "-1";
|
||||
return res;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
//初始化
|
||||
[Route("ClearALL")]
|
||||
[HttpPost]
|
||||
public ResultModel ClearALL()
|
||||
{
|
||||
lock (lockinit)
|
||||
{
|
||||
ResultModel res = new ResultModel();
|
||||
try
|
||||
{
|
||||
|
||||
res = contrbll.ClearALL();
|
||||
return res;
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.WriteLogInfo("GetDataList异常:" + ex.Message);
|
||||
res.msg = "请求异常!";
|
||||
res.result = "-1";
|
||||
return res;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
[Route("StartWork")]
|
||||
[HttpPost]
|
||||
public ResultModel StartWork()
|
||||
{
|
||||
lock (lockinit)
|
||||
{
|
||||
ResultModel res = new ResultModel();
|
||||
try
|
||||
{
|
||||
contrbll.StartWork();
|
||||
res.msg = "成功!";
|
||||
res.result = "0";
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
LogHelper.WriteLogInfo("启动作业异常" + ex.ToString(), LogHelper.Log_Type.ERROR);
|
||||
res.msg = "启动作业异常!";
|
||||
res.result = "-1";
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#region 设备检测
|
||||
[Route("TestStart")]
|
||||
[HttpPost]
|
||||
public ResultModel TestStart()
|
||||
{
|
||||
lock (lockinit)
|
||||
catch (Exception ex)
|
||||
{
|
||||
ResultModel res = new ResultModel();
|
||||
try
|
||||
{
|
||||
ResultModel result = contrbll.TestStart();
|
||||
|
||||
return result;
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.WriteLogInfo("GetDataList异常:" + ex.Message);
|
||||
res.msg = "请求异常!";
|
||||
res.result = "-1";
|
||||
return res;
|
||||
|
||||
}
|
||||
LogHelper.WriteLogInfo(ex.ToString(), LogHelper.Log_Type.ERROR);
|
||||
res.resultMsg = "请求接口异常!";
|
||||
res.resultCode = "-1";
|
||||
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 停止检测
|
||||
[Route("TestEnd")]
|
||||
[HttpPost]
|
||||
public ResultModel TestEnd()
|
||||
{
|
||||
lock (lockinit)
|
||||
{
|
||||
ResultModel res = new ResultModel();
|
||||
contrbll.TestEnd();
|
||||
res.msg = "成功!";
|
||||
res.result = "0";
|
||||
return res;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
#region 停止作业
|
||||
[Route("EndWork")]
|
||||
[HttpPost]
|
||||
public ResultModel EndWork()
|
||||
{
|
||||
lock (lockinit)
|
||||
{
|
||||
ResultModel res = new ResultModel();
|
||||
contrbll.EndWork();
|
||||
res.msg = "成功!";
|
||||
res.result = "0";
|
||||
return res;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
@ -61,6 +61,10 @@
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\DLL\ExcelIntOut.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="LightContrl, Version=3.0.2.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\DLL\LightContrl.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.AI.Agent.Intercept, Version=1.2.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.ApplicationInsights.Agent.Intercept.1.2.1\lib\net45\Microsoft.AI.Agent.Intercept.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
|
@ -10,8 +10,8 @@
|
||||
<WebStackScaffolding_LayoutPageFile>~/Views/Shared/_EpostLayoutPage.cshtml</WebStackScaffolding_LayoutPageFile>
|
||||
<WebStackScaffolding_IsAsyncSelected>False</WebStackScaffolding_IsAsyncSelected>
|
||||
<WebStackScaffolding_ViewDialogWidth>600</WebStackScaffolding_ViewDialogWidth>
|
||||
<NameOfLastUsedPublishProfile>E:\WORK\代码管理\播种\T系列分支\Epost.TestToolsWeb\Properties\PublishProfiles\Toolsweb.pubxml</NameOfLastUsedPublishProfile>
|
||||
<LastActiveSolutionConfig>Debug|Any CPU</LastActiveSolutionConfig>
|
||||
<NameOfLastUsedPublishProfile>E:\WORK\代码管理\T系列\播种\Epost.TestToolsWeb\Properties\PublishProfiles\Toolsweb.pubxml</NameOfLastUsedPublishProfile>
|
||||
<LastActiveSolutionConfig>Release|Any CPU</LastActiveSolutionConfig>
|
||||
<Use64BitIISExpress />
|
||||
<IISExpressSSLPort />
|
||||
<IISExpressAnonymousAuthentication />
|
||||
|
@ -27,10 +27,23 @@ namespace Epost.TestToolsWeb
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 跨域设置
|
||||
/// </summary>
|
||||
public void Application_BeginRequest()
|
||||
{
|
||||
//OPTIONS请求方法的主要作用:
|
||||
//1、获取服务器支持的HTTP方法;也就是黑客经常用的方法。
|
||||
//2、用来检查服务器的性能。如Ajax进行跨域请求是的预检,需要想另外一个域名的资源发送OPTIONS请求头,用以判断发送的请求是否安全
|
||||
if (Request.Headers.AllKeys.Contains("Origin") && Request.HttpMethod == "OPTIONS")
|
||||
{
|
||||
//表示对输出的内容进行缓冲,执行page.Response.Flush()时,会等所有内容缓冲完毕,将内容发送到客户端
|
||||
//这样就不会出错,造成页面卡死状态,让用户无限制等下去
|
||||
Response.Flush();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -7,7 +7,8 @@
|
||||
<PropertyGroup>
|
||||
<TimeStampOfAssociatedLegacyPublishXmlFile />
|
||||
<_PublishTargetUrl>D:\驿传\T系列</_PublishTargetUrl>
|
||||
<History>True|2022-07-15T08:41:13.9750291Z;True|2022-07-14T14:02:20.7983427+08:00;True|2022-07-13T17:40:22.7531000+08:00;True|2022-07-13T17:34:22.9908701+08:00;True|2022-07-13T17:30:06.3588502+08:00;True|2022-07-11T10:32:06.9053981+08:00;True|2021-04-26T10:07:37.4889549+08:00;True|2021-04-09T10:32:51.9130162+08:00;True|2021-04-09T10:31:50.4974012+08:00;</History>
|
||||
<History>True|2023-04-23T07:53:28.0062911Z;True|2023-04-22T10:28:09.9896404+08:00;True|2023-04-20T10:35:53.5768979+08:00;True|2022-07-15T16:41:13.9750291+08:00;True|2022-07-14T14:02:20.7983427+08:00;True|2022-07-13T17:40:22.7531000+08:00;True|2022-07-13T17:34:22.9908701+08:00;True|2022-07-13T17:30:06.3588502+08:00;True|2022-07-11T10:32:06.9053981+08:00;True|2021-04-26T10:07:37.4889549+08:00;True|2021-04-09T10:32:51.9130162+08:00;True|2021-04-09T10:31:50.4974012+08:00;</History>
|
||||
<LastFailureDetails />
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<File Include="ApplicationInsights.config">
|
||||
@ -32,19 +33,19 @@
|
||||
<publishTime>04/04/2018 15:45:12</publishTime>
|
||||
</File>
|
||||
<File Include="bin/App_global.asax.compiled">
|
||||
<publishTime>07/15/2022 16:57:09</publishTime>
|
||||
<publishTime>04/23/2023 15:53:24</publishTime>
|
||||
</File>
|
||||
<File Include="bin/App_global.asax.dll">
|
||||
<publishTime>07/15/2022 16:57:09</publishTime>
|
||||
<publishTime>04/23/2023 15:53:24</publishTime>
|
||||
</File>
|
||||
<File Include="bin/BouncyCastle.Crypto.dll">
|
||||
<publishTime>02/24/2020 15:29:24</publishTime>
|
||||
</File>
|
||||
<File Include="bin/Common.dll">
|
||||
<publishTime>07/15/2022 16:40:17</publishTime>
|
||||
<publishTime>04/23/2023 15:53:13</publishTime>
|
||||
</File>
|
||||
<File Include="bin/Common.pdb">
|
||||
<publishTime>07/15/2022 16:40:17</publishTime>
|
||||
<publishTime>04/23/2023 15:53:13</publishTime>
|
||||
</File>
|
||||
<File Include="bin/ComposerSDK.dll">
|
||||
<publishTime>04/29/2020 16:50:14</publishTime>
|
||||
@ -62,31 +63,31 @@
|
||||
<publishTime>10/23/2017 13:15:20</publishTime>
|
||||
</File>
|
||||
<File Include="bin/Epost.BLL.dll">
|
||||
<publishTime>07/15/2022 16:56:59</publishTime>
|
||||
<publishTime>04/23/2023 15:53:14</publishTime>
|
||||
</File>
|
||||
<File Include="bin/Epost.BLL.pdb">
|
||||
<publishTime>07/15/2022 16:56:59</publishTime>
|
||||
<publishTime>04/23/2023 15:53:14</publishTime>
|
||||
</File>
|
||||
<File Include="bin/Epost.BLL.XmlSerializers.dll">
|
||||
<publishTime>08/26/2020 18:09:48</publishTime>
|
||||
</File>
|
||||
<File Include="bin/Epost.DAL.dll">
|
||||
<publishTime>07/15/2022 16:40:18</publishTime>
|
||||
<publishTime>04/23/2023 15:53:14</publishTime>
|
||||
</File>
|
||||
<File Include="bin/Epost.DAL.pdb">
|
||||
<publishTime>07/15/2022 16:40:18</publishTime>
|
||||
<publishTime>04/23/2023 15:53:14</publishTime>
|
||||
</File>
|
||||
<File Include="bin/Epost.DPS.dll">
|
||||
<publishTime>07/15/2022 16:57:02</publishTime>
|
||||
<publishTime>04/23/2023 15:53:16</publishTime>
|
||||
</File>
|
||||
<File Include="bin/Epost.DPS.pdb">
|
||||
<publishTime>07/15/2022 16:57:02</publishTime>
|
||||
<publishTime>04/23/2023 15:53:16</publishTime>
|
||||
</File>
|
||||
<File Include="bin/Epost.Model.dll">
|
||||
<publishTime>07/14/2022 16:43:42</publishTime>
|
||||
<publishTime>04/22/2023 10:27:45</publishTime>
|
||||
</File>
|
||||
<File Include="bin/Epost.Model.pdb">
|
||||
<publishTime>07/14/2022 16:43:42</publishTime>
|
||||
<publishTime>04/22/2023 10:27:45</publishTime>
|
||||
</File>
|
||||
<File Include="bin/Epost.TestToolsWeb.dll">
|
||||
<publishTime>09/06/2018 11:57:11</publishTime>
|
||||
@ -112,6 +113,12 @@
|
||||
<File Include="bin/ICSharpCode.SharpZipLib.pdb">
|
||||
<publishTime>08/09/2019 08:40:22</publishTime>
|
||||
</File>
|
||||
<File Include="bin/LightContrl.dll">
|
||||
<publishTime>04/22/2023 10:23:53</publishTime>
|
||||
</File>
|
||||
<File Include="bin/LightContrl.pdb">
|
||||
<publishTime>04/22/2023 10:23:53</publishTime>
|
||||
</File>
|
||||
<File Include="bin/log4net.dll">
|
||||
<publishTime>03/08/2017 19:26:22</publishTime>
|
||||
</File>
|
||||
@ -5651,7 +5658,7 @@
|
||||
<publishTime>05/30/2022 16:58:47</publishTime>
|
||||
</File>
|
||||
<File Include="PrecompiledApp.config">
|
||||
<publishTime>07/15/2022 16:57:03</publishTime>
|
||||
<publishTime>04/23/2023 15:53:18</publishTime>
|
||||
</File>
|
||||
<File Include="Scripts/ai.0.22.9-build00167.js">
|
||||
<publishTime>04/04/2018 15:45:12</publishTime>
|
||||
@ -7571,7 +7578,7 @@
|
||||
<publishTime>07/04/2022 14:22:38</publishTime>
|
||||
</File>
|
||||
<File Include="Web.config">
|
||||
<publishTime>07/12/2022 15:10:39</publishTime>
|
||||
<publishTime>04/22/2023 10:27:50</publishTime>
|
||||
</File>
|
||||
</ItemGroup>
|
||||
</Project>
|
@ -11,7 +11,7 @@
|
||||
</configSections>
|
||||
<connectionStrings>
|
||||
<add name="weijie_dpsEntities" connectionString="metadata=res://*/WJDB.csdl|res://*/WJDB.ssdl|res://*/WJDB.msl;provider=System.Data.SqlClient;provider connection string="data source=.;initial catalog=weijie_dps;user id=sa;password=123456;min pool size=4;max pool size=4;packet size=3072;MultipleActiveResultSets=True;App=EntityFramework"" providerName="System.Data.EntityClient" />
|
||||
<add name="SqlLocDPSConnection" connectionString="server=139.196.36.200;user id=EpostTest;password=antion;database=EpostTest_T;min pool size=512;max pool size=512;packet size=3072" providerName="System.Data.SqlClient" />
|
||||
<add name="SqlLocDPSConnection" connectionString="server=139.196.36.200;user id=EpostTest;password=antion;database=taitan_dengdai;min pool size=512;max pool size=512;packet size=3072" providerName="System.Data.SqlClient" />
|
||||
<add name="MysqlLocDPSConnection" connectionString="Server=localhost;Port=3306;Database=world;User=root; Password=antion;SslMode=None;Pooling=true;Allow User Variables=True;" />
|
||||
|
||||
<add name="WMSConnection" connectionString="data source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=139.196.36.200)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=EpostDB)));user id=C##Test;password=test" />
|
||||
@ -32,7 +32,9 @@
|
||||
<add key="SetupMode" value="\Epost_P\Epost.TestToolsWeb\App_Data\SetupMode.txt" />
|
||||
<add key="CARID" value="HT01" />
|
||||
<add key="ServerAPIURL" value="http://192.168.3.65:8051/api/WebAPI" />
|
||||
<add key="SleepTime" value="1" />
|
||||
<add key="SleepTime" value="1" />
|
||||
|
||||
|
||||
</appSettings>
|
||||
<!--
|
||||
有关 web.config 更改的说明,请参见 http://go.microsoft.com/fwlink/?LinkId=235367。
|
||||
@ -55,6 +57,18 @@
|
||||
<sessionState mode="InProc" timeout="518400" />
|
||||
</system.web>
|
||||
<system.webServer>
|
||||
<!-- 跨域访问配置 -->
|
||||
<httpProtocol>
|
||||
<customHeaders>
|
||||
<!--相应类型(值为逗号分隔的一个字符串,表明服务器支持的所有跨域请求的方法)-->
|
||||
<add name="Access-Control-Allow-Methods" value="GET, POST, PUT, DELETE, OPTIONS"/>
|
||||
<!--响应头设置(Content-Type:只限于三个值application/x-www-form-urlencoded、multipart/form-data、text/plain)-->
|
||||
<add name="Access-Control-Allow-Headers" value="*"/>
|
||||
<!--允许跨域访问的网址-->
|
||||
<add name="Access-Control-Allow-Origin" value="*"/>
|
||||
<!--<add name="Access-Control-Allow-Origin" value="http://www.yabyy.com,http://bbs.yabyy.com"/>-->
|
||||
</customHeaders>
|
||||
</httpProtocol>
|
||||
<modules>
|
||||
<remove name="FormsAuthentication" />
|
||||
<remove name="ApplicationInsightsWebTracking" />
|
||||
@ -161,21 +175,8 @@
|
||||
<filter type="log4net.Filter.LoggerMatchFilter">
|
||||
<loggerToMatch value="System_Log" />
|
||||
</filter>
|
||||
<filter type="log4net.Filter.DenyAllFilter" />
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</appender>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<filter type="log4net.Filter.DenyAllFilter" />
|
||||
</appender>
|
||||
<appender name="SystemLogAppender_LightUp" type="log4net.Appender.RollingFileAppender">
|
||||
<file value="Log/System_Log/" />
|
||||
<appendToFile value="true" />
|
||||
|
Reference in New Issue
Block a user