Compare commits
10 Commits
master
...
taitan_den
Author | SHA1 | Date | |
---|---|---|---|
36e123d79e | |||
c82154ff51 | |||
a3c29b5bf8 | |||
36a20b88ce | |||
40557a235e | |||
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);
|
return dal.GetAddressListByByPage(strWhere, orderby, startIndex, endIndex, out recordCount);
|
||||||
}
|
}
|
||||||
#endregion
|
#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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,6 +4,7 @@ using Epost.DAL;
|
|||||||
using Epost.DAL.Cache;
|
using Epost.DAL.Cache;
|
||||||
using Epost.DAL.Enum;
|
using Epost.DAL.Enum;
|
||||||
using Epost.Model;
|
using Epost.Model;
|
||||||
|
using LightContrl;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Configuration;
|
using System.Configuration;
|
||||||
@ -11,6 +12,7 @@ using System.Data;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using static Epost.Common.LogHelper;
|
using static Epost.Common.LogHelper;
|
||||||
|
|
||||||
@ -28,6 +30,8 @@ namespace Epost.BLL
|
|||||||
ConfigurationOperator txtbll = new ConfigurationOperator();
|
ConfigurationOperator txtbll = new ConfigurationOperator();
|
||||||
string IP = ConfigurationManager.AppSettings["WebAPIUrl"];
|
string IP = ConfigurationManager.AppSettings["WebAPIUrl"];
|
||||||
|
|
||||||
|
LightControlCacheDAL cachedal = new LightControlCacheDAL();
|
||||||
|
MainControl lig = new MainControl();
|
||||||
#region 初始化数据
|
#region 初始化数据
|
||||||
public ResultModel Initialization_M(bool isback = true)
|
public ResultModel Initialization_M(bool isback = true)
|
||||||
{
|
{
|
||||||
@ -36,7 +40,6 @@ namespace Epost.BLL
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
DataTable dt = addrBLL.getControlList();
|
DataTable dt = addrBLL.getControlList();
|
||||||
bool result = false;
|
|
||||||
if (dt != null && dt.Rows.Count > 0)
|
if (dt != null && dt.Rows.Count > 0)
|
||||||
{
|
{
|
||||||
foreach (DataRow item in dt.Rows)
|
foreach (DataRow item in dt.Rows)
|
||||||
@ -58,6 +61,13 @@ namespace Epost.BLL
|
|||||||
model = new LabelParamModel();
|
model = new LabelParamModel();
|
||||||
model.ControlIP = item["ControlIP"].ToString();
|
model.ControlIP = item["ControlIP"].ToString();
|
||||||
model.Address = "9999";
|
model.Address = "9999";
|
||||||
|
model.Parameter = "job";
|
||||||
|
model.Command = "START_POLLING";
|
||||||
|
model.Timeout = "0.03";
|
||||||
|
list.Add(model);
|
||||||
|
model = new LabelParamModel();
|
||||||
|
model.ControlIP = item["ControlIP"].ToString();
|
||||||
|
model.Address = "9999";
|
||||||
model.Parameter = "11111000";
|
model.Parameter = "11111000";
|
||||||
model.Command = "UNLOCK";
|
model.Command = "UNLOCK";
|
||||||
model.Timeout = "0.5";
|
model.Timeout = "0.5";
|
||||||
@ -83,6 +93,72 @@ namespace Epost.BLL
|
|||||||
}
|
}
|
||||||
return resultModel;
|
return resultModel;
|
||||||
}
|
}
|
||||||
|
//public ResultModel Initialization_M(bool isback = true)
|
||||||
|
//{
|
||||||
|
// ResultModel resultModel = new ResultModel();
|
||||||
|
// resultModel.result = "0";
|
||||||
|
// resultModel.msg = "成功";
|
||||||
|
// List<LabelParamModel> list = new List<LabelParamModel>();
|
||||||
|
// try
|
||||||
|
// {
|
||||||
|
// DataTable dt = addrBLL.QueryControlList("");
|
||||||
|
|
||||||
|
// if (dt != null && dt.Rows.Count > 0)
|
||||||
|
// {
|
||||||
|
// foreach (DataRow item in dt.Rows)
|
||||||
|
// {
|
||||||
|
|
||||||
|
|
||||||
|
// string ipaddress = item["controlip"].ToString().Trim();
|
||||||
|
// List<LightcontrolModel> conlist = cachedal.GetControlList().FindAll(o => o.controlip == ipaddress);
|
||||||
|
// if (conlist != null && conlist.Count > 0)
|
||||||
|
// {
|
||||||
|
// LogHelper.WriteLogInfo(ipaddress + "已连接!");
|
||||||
|
// Ledonoff_dengdai("0", "");
|
||||||
|
|
||||||
|
// }
|
||||||
|
// else
|
||||||
|
// {
|
||||||
|
// int port = Convert.ToInt32(item["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);
|
||||||
|
// Ledonoff_dengdai("0", "");
|
||||||
|
// }
|
||||||
|
// else
|
||||||
|
// {
|
||||||
|
// LogHelper.WriteLogInfo("连接失败" + ipaddress);
|
||||||
|
// resultModel.result = "-1";
|
||||||
|
// resultModel.msg = "连接失败" + ipaddress;
|
||||||
|
// return resultModel;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
// return resultModel;
|
||||||
|
|
||||||
|
// }
|
||||||
|
// catch (Exception ex)
|
||||||
|
// {
|
||||||
|
|
||||||
|
// resultModel.result = "0";
|
||||||
|
// resultModel.msg = "初始化失败!";
|
||||||
|
// LogHelper.WriteLogInfo("初始化异常:" + ex.Message);
|
||||||
|
|
||||||
|
// }
|
||||||
|
// return resultModel;
|
||||||
|
//}
|
||||||
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region 设备检测 查询所有标签
|
#region 设备检测 查询所有标签
|
||||||
@ -154,9 +230,9 @@ namespace Epost.BLL
|
|||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region 获取参数中文
|
#region 获取参数中文
|
||||||
public string GETDISPLAYJOBPAR_CN(string no,string Lightcolor,string IsTwinkle,string Title,string BigQuantity, string BigUnit,string Quantity, string Unit,string Content,string Rfcode)
|
public string GETDISPLAYJOBPAR_CN(string no, string Lightcolor, string IsTwinkle, string Title, string BigQuantity, string BigUnit, string Quantity, string Unit, string Content, string Rfcode)
|
||||||
{
|
{
|
||||||
string parar = no+"00" + Lightcolor + IsTwinkle+"30CQ" + Title + "\n\n" + BigQuantity + "\n" + BigUnit + "\n" + Quantity + "\n" + Unit + "\n" + Content + "\n00\n\n" + Rfcode + "\n"; ;
|
string parar = no + "00" + Lightcolor + IsTwinkle + "30CQ" + Title + "\n\n" + BigQuantity + "\n" + BigUnit + "\n" + Quantity + "\n" + Unit + "\n" + Content + "\n00\n\n" + Rfcode + "\n"; ;
|
||||||
return parar;
|
return parar;
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
@ -246,7 +322,7 @@ namespace Epost.BLL
|
|||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region 任务指令(传参地址)
|
#region 任务指令(传参地址)
|
||||||
public void DISPLAY_JOB_M(LabelParamModel model, bool clear = false, bool islock = false )
|
public void DISPLAY_JOB_M(LabelParamModel model, bool clear = false, bool islock = false)
|
||||||
{
|
{
|
||||||
List<LabelParamModel> list = new List<LabelParamModel>();
|
List<LabelParamModel> list = new List<LabelParamModel>();
|
||||||
if (clear)
|
if (clear)
|
||||||
@ -265,8 +341,8 @@ namespace Epost.BLL
|
|||||||
LabelParamModel DisplayModel = new LabelParamModel();
|
LabelParamModel DisplayModel = new LabelParamModel();
|
||||||
DisplayModel.Address = model.Address;
|
DisplayModel.Address = model.Address;
|
||||||
DisplayModel.ControlIP = model.ControlIP;
|
DisplayModel.ControlIP = model.ControlIP;
|
||||||
DisplayModel.Content =model.Content;
|
DisplayModel.Content = model.Content;
|
||||||
DisplayModel.Title =model.Title;
|
DisplayModel.Title = model.Title;
|
||||||
DisplayModel.Loc = model.Loc;
|
DisplayModel.Loc = model.Loc;
|
||||||
DisplayModel.Quantity = model.Quantity;
|
DisplayModel.Quantity = model.Quantity;
|
||||||
DisplayModel.Uid = model.Uid;
|
DisplayModel.Uid = model.Uid;
|
||||||
@ -501,7 +577,6 @@ namespace Epost.BLL
|
|||||||
public void CloseALL_M()
|
public void CloseALL_M()
|
||||||
{
|
{
|
||||||
DataTable dt = addrBLL.getControlList();
|
DataTable dt = addrBLL.getControlList();
|
||||||
|
|
||||||
if (dt != null && dt.Rows.Count > 0)
|
if (dt != null && dt.Rows.Count > 0)
|
||||||
{
|
{
|
||||||
foreach (DataRow item in dt.Rows)
|
foreach (DataRow item in dt.Rows)
|
||||||
@ -510,17 +585,116 @@ namespace Epost.BLL
|
|||||||
LabelParamModel model = new LabelParamModel();
|
LabelParamModel model = new LabelParamModel();
|
||||||
model.ControlIP = item["ControlIP"].ToString();
|
model.ControlIP = item["ControlIP"].ToString();
|
||||||
FORMATE_JOB_DATA(model);
|
FORMATE_JOB_DATA(model);
|
||||||
|
LED_OFF_CLEAR(item["ControlIP"].ToString());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
//List<LightcontrolModel> conlist = cachedal.GetControlList();
|
||||||
|
//if (conlist.Any() && conlist.Count > 0)
|
||||||
|
//{
|
||||||
|
// Ledonoff_dengdai("0","");
|
||||||
|
// Thread.Sleep(500);
|
||||||
|
// foreach (LightcontrolModel con in conlist)
|
||||||
|
// {
|
||||||
|
// bool b = con.maincontrol.DisConnect(con.controlip, con.port);
|
||||||
|
// LogHelper.WriteLogInfo(b + "断开连接" + con.controlip + "==" + con.port);
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
//cachedal.ClearControlList();
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
#region 亮灭灯带所有格口
|
||||||
|
public void Ledonoff_dengdai(string lightType, string lightcolor)
|
||||||
|
{
|
||||||
|
DataTable dt = addrBLL.QueryControlList(" ");
|
||||||
|
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 (lightType == "0")
|
||||||
|
{
|
||||||
|
|
||||||
|
bo = control.LED_OFF(ipaddress, Address, ref resstr);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
bo = control.LED_ON(ipaddress, Address, ref resstr, "3", "0", lightcolor);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region 点亮/熄灭灯带格口
|
||||||
|
public void display_dengdai(string location,string color)
|
||||||
|
{
|
||||||
|
DataTable dt = addrBLL.QueryControlList("");
|
||||||
|
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 location ='" + 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 = color; //1:蓝色 2:绿色 3:青色 4:红色 5:紫色 6黄色 7白色
|
||||||
|
show.Brightness = "9";//亮度 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));
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
LogHelper.WriteLogInfo("失败" + ipaddress + "list:" + JsonHelper.SerializeObject(list), LogHelper.Log_Type.ERROR);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
|
||||||
|
LogHelper.WriteLogInfo("请先连接设备!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
#region 根据区解锁标签
|
#region 根据区解锁标签
|
||||||
public void UNLOCK_M(List<JobModel> offList)
|
public void UNLOCK_M(List<JobModel> offList)
|
||||||
{
|
{
|
||||||
@ -553,7 +727,7 @@ namespace Epost.BLL
|
|||||||
{
|
{
|
||||||
// DataTable dt = addrBLL.getAddresslist(block,area,type);
|
// DataTable dt = addrBLL.getAddresslist(block,area,type);
|
||||||
|
|
||||||
if(offList.Any())
|
if (offList.Any())
|
||||||
{
|
{
|
||||||
List<LabelParamModel> list = new List<LabelParamModel>();
|
List<LabelParamModel> list = new List<LabelParamModel>();
|
||||||
foreach (JobModel item in offList)
|
foreach (JobModel item in offList)
|
||||||
@ -616,7 +790,7 @@ namespace Epost.BLL
|
|||||||
public void ShowBoxMessage_M(ShowMessageModel_M show)
|
public void ShowBoxMessage_M(ShowMessageModel_M show)
|
||||||
{
|
{
|
||||||
//获取作业区对应的显示标签地址
|
//获取作业区对应的显示标签地址
|
||||||
DataTable showaddrDT = addrBLL.GetBoxAddress(show.Block,show.Area,show.Type);
|
DataTable showaddrDT = addrBLL.GetBoxAddress(show.Block, show.Area, show.Type);
|
||||||
if (showaddrDT != null && showaddrDT.Rows.Count > 0)
|
if (showaddrDT != null && showaddrDT.Rows.Count > 0)
|
||||||
{
|
{
|
||||||
foreach (DataRow addritem in showaddrDT.Rows)
|
foreach (DataRow addritem in showaddrDT.Rows)
|
||||||
@ -626,7 +800,7 @@ namespace Epost.BLL
|
|||||||
lablemodel.Address = addritem["address"].ToString();
|
lablemodel.Address = addritem["address"].ToString();
|
||||||
lablemodel.ControlIP = addritem["controlip"].ToString();
|
lablemodel.ControlIP = addritem["controlip"].ToString();
|
||||||
lablemodel.Command = "DISPLAY_JOB";
|
lablemodel.Command = "DISPLAY_JOB";
|
||||||
lablemodel.Uid =show.Uid;
|
lablemodel.Uid = show.Uid;
|
||||||
if (string.IsNullOrEmpty(show.Uid))
|
if (string.IsNullOrEmpty(show.Uid))
|
||||||
{ lablemodel.Uid = addritem["address"].ToString(); }
|
{ lablemodel.Uid = addritem["address"].ToString(); }
|
||||||
|
|
||||||
@ -691,7 +865,7 @@ namespace Epost.BLL
|
|||||||
model.Type = "T";
|
model.Type = "T";
|
||||||
model.Address = item["address"].ToString();
|
model.Address = item["address"].ToString();
|
||||||
model.ControlIP = item["ControlIP"].ToString();
|
model.ControlIP = item["ControlIP"].ToString();
|
||||||
model.Parameter = ConvertHexHelper.ConvertString(item["addresstype"].ToString(), 10, 16).ToString().PadLeft(2,'0')+ isoff;
|
model.Parameter = ConvertHexHelper.ConvertString(item["addresstype"].ToString(), 10, 16).ToString().PadLeft(2, '0') + isoff;
|
||||||
list.Add(model);
|
list.Add(model);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -715,7 +889,7 @@ namespace Epost.BLL
|
|||||||
LabelParamModel model = new LabelParamModel();
|
LabelParamModel model = new LabelParamModel();
|
||||||
model.Address = addritem["address"].ToString();
|
model.Address = addritem["address"].ToString();
|
||||||
model.ControlIP = addritem["controlip"].ToString();
|
model.ControlIP = addritem["controlip"].ToString();
|
||||||
model.Parameter =show.No;
|
model.Parameter = show.No;
|
||||||
model.Command = "REMOVE_JOB";
|
model.Command = "REMOVE_JOB";
|
||||||
model.Timeout = "0.5";
|
model.Timeout = "0.5";
|
||||||
list.Add(model);
|
list.Add(model);
|
||||||
|
@ -79,6 +79,9 @@
|
|||||||
<HintPath>..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.SqlServer.dll</HintPath>
|
<HintPath>..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.SqlServer.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
|
<Reference Include="LightContrl">
|
||||||
|
<HintPath>..\DLL\LightContrl.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
<Reference Include="System.ComponentModel.DataAnnotations" />
|
<Reference Include="System.ComponentModel.DataAnnotations" />
|
||||||
<Reference Include="System.Configuration" />
|
<Reference Include="System.Configuration" />
|
||||||
|
@ -15,6 +15,7 @@ namespace Epost.BLL
|
|||||||
public class ErrorLogBLL
|
public class ErrorLogBLL
|
||||||
{
|
{
|
||||||
ErrorLogDAL dal = new ErrorLogDAL();
|
ErrorLogDAL dal = new ErrorLogDAL();
|
||||||
|
|
||||||
#region 添加日志
|
#region 添加日志
|
||||||
public bool InsertErrorLog(ErrorLogModel model)
|
public bool InsertErrorLog(ErrorLogModel model)
|
||||||
{
|
{
|
||||||
@ -79,23 +80,51 @@ namespace Epost.BLL
|
|||||||
|
|
||||||
public void SaveSysytemError(string caozuo, string error)
|
public void SaveSysytemError(string caozuo, string error)
|
||||||
{
|
{
|
||||||
|
string username = string.Empty;
|
||||||
|
|
||||||
ErrorLogBLL logBLL = new ErrorLogBLL();
|
ErrorLogBLL logBLL = new ErrorLogBLL();
|
||||||
ErrorLogModel error_model = new ErrorLogModel();
|
ErrorLogModel error_model = new ErrorLogModel();
|
||||||
error_model.Type = "2";
|
error_model.Type = "2";
|
||||||
error_model.Remark = caozuo + "" + error;
|
error_model.Title = caozuo;
|
||||||
|
error_model.Remark = error;
|
||||||
|
error_model.UserName = username;
|
||||||
logBLL.InsertErrorLog(error_model);
|
logBLL.InsertErrorLog(error_model);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SaveOperateError(string caozuo, string error)
|
public void SaveOperateError(string caozuo, string error)
|
||||||
{
|
{
|
||||||
|
string username = string.Empty;
|
||||||
|
|
||||||
ErrorLogBLL logBLL = new ErrorLogBLL();
|
ErrorLogBLL logBLL = new ErrorLogBLL();
|
||||||
|
|
||||||
ErrorLogModel error_model = new ErrorLogModel();
|
ErrorLogModel error_model = new ErrorLogModel();
|
||||||
error_model.Type = "3";
|
error_model.Type = "3";
|
||||||
error_model.Remark = caozuo + "操作" + error;
|
error_model.Title = caozuo;
|
||||||
|
error_model.Remark = error;
|
||||||
|
error_model.UserName = username;
|
||||||
logBLL.InsertErrorLog(error_model);
|
logBLL.InsertErrorLog(error_model);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
public long DeleteLog(string type)
|
||||||
|
{
|
||||||
|
|
||||||
|
long x = dal.DeleteLog(type);
|
||||||
|
return x;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SaveShowMesError(string Title, string Remark, string type = "999")
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
ErrorLogBLL logBLL = new ErrorLogBLL();
|
||||||
|
ErrorLogModel error_model = new ErrorLogModel();
|
||||||
|
error_model.Type = type;
|
||||||
|
error_model.Title = Title;
|
||||||
|
error_model.Remark = Remark;
|
||||||
|
|
||||||
|
logBLL.InsertErrorLog(error_model);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -375,42 +375,11 @@ namespace Epost.BLL
|
|||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region 修改订单状态
|
#region 修改订单状态
|
||||||
public void UpdateOrderState_Car(List<JobModel> downlist, JobModel model, int truequantity, int checkquaantity = 0)
|
public void UpdateOrderState_Car(string matchid,string tolocation, string oprationstate)
|
||||||
{
|
|
||||||
if (downlist.Count > 1)
|
|
||||||
{
|
|
||||||
int nowqty = truequantity;
|
|
||||||
if (truequantity != downlist.Sum(m => m.Quantity))
|
|
||||||
{
|
|
||||||
foreach (JobModel jobmo in downlist.ToArray())
|
|
||||||
{
|
{
|
||||||
|
|
||||||
if (nowqty > jobmo.Quantity)
|
dal.UpdateWorkState_Car(matchid, tolocation, oprationstate);
|
||||||
{
|
|
||||||
nowqty = nowqty - jobmo.Quantity;
|
|
||||||
dal.UpdateWorkState_Car(jobmo.Matchid, jobmo.Quantity, jobmo.Sku, jobmo.ID, checkquaantity, model.UserCode);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
dal.UpdateWorkState_Car(jobmo.Matchid, jobmo.Quantity, jobmo.Sku, jobmo.ID, checkquaantity, model.UserCode);
|
|
||||||
nowqty = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
foreach (JobModel jobmo in downlist.ToArray())
|
|
||||||
{
|
|
||||||
dal.UpdateWorkState_Car(jobmo.Matchid, jobmo.Quantity, jobmo.Sku, jobmo.ID, checkquaantity, model.UserCode);
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
|
|
||||||
dal.UpdateWorkState_Car(model.Matchid, truequantity, model.Sku, model.ID, checkquaantity, model.UserCode);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -738,80 +707,33 @@ namespace Epost.BLL
|
|||||||
|
|
||||||
List<JobModel> list = new List<JobModel>();
|
List<JobModel> list = new List<JobModel>();
|
||||||
DataTable OrderDt = dal.GetOrderList_Car(matchid, sku, area, block);
|
DataTable OrderDt = dal.GetOrderList_Car(matchid, sku, area, block);
|
||||||
bool isecho = false;
|
|
||||||
if (OrderDt == null || OrderDt.Rows.Count == 0)//回显
|
|
||||||
{
|
|
||||||
OrderDt = dal.GetOrderList_echo(matchid, sku, area, block);
|
|
||||||
isecho = true;
|
|
||||||
|
|
||||||
}
|
|
||||||
if (OrderDt != null && OrderDt.Rows.Count > 0)
|
if (OrderDt != null && OrderDt.Rows.Count > 0)
|
||||||
{
|
{
|
||||||
string usercode = string.Empty;
|
|
||||||
string lightcolor = string.Empty;
|
|
||||||
DataTable udt = dal.GetOrderUseerXCode(matchid, sku, area, block);
|
|
||||||
if (udt != null && udt.Rows.Count > 0)
|
|
||||||
{
|
|
||||||
usercode = udt.Rows[0]["usercode"].ToString();
|
|
||||||
lightcolor = udt.Rows[0]["lightcolor"].ToString();
|
|
||||||
}
|
|
||||||
if (string.IsNullOrEmpty(lightcolor))
|
|
||||||
{
|
|
||||||
lightcolor = EnumHelper.EMToDescriptionString(LightColor.Color.Red);
|
|
||||||
}
|
|
||||||
foreach (DataRow item in OrderDt.Rows)
|
foreach (DataRow item in OrderDt.Rows)
|
||||||
{
|
{
|
||||||
#region 任务缓存信息
|
#region 任务缓存信息
|
||||||
JobModel demodel = new JobModel();
|
JobModel demodel = new JobModel();
|
||||||
demodel.OrderID = item["orderid"].ToString();
|
demodel.Tolocation = item["fromlocation"].ToString();
|
||||||
demodel.BatchId = item["BatchId"].ToString();
|
demodel.Sku = item["sku"].ToString();
|
||||||
demodel.ID = item["ID"].ToString();
|
demodel.Matchid = matchid;
|
||||||
demodel.GoodsName = item["GoodsName"].ToString();
|
demodel.FromTolocation = item["tolocation"].ToString();
|
||||||
demodel.GoodsType = item["GoodsType"].ToString();
|
demodel.ControlIP = item["ControlIP"].ToString();
|
||||||
demodel.Quantity = Convert.ToInt32(item["Quantity"].ToString());
|
demodel.Address = item["Address"].ToString();
|
||||||
demodel.CheckQuantity = Convert.ToInt32(item["CheckQuantity"].ToString());
|
|
||||||
demodel.Sku = item["Sku"].ToString();
|
|
||||||
demodel.Tolocation = item["Tolocation"].ToString();
|
|
||||||
demodel.Matchid = item["Matchid"].ToString();
|
|
||||||
demodel.ShopID = item["shopid"].ToString();
|
|
||||||
demodel.BoxCode = item["boxcode"].ToString();
|
|
||||||
demodel.LotNo = item["LotNo"].ToString();
|
|
||||||
demodel.Discount = item["Discount"].ToString();
|
|
||||||
demodel.ProdArea = item["ProdArea"].ToString();
|
|
||||||
demodel.ColorCode = item["corlorcode"].ToString();
|
|
||||||
demodel.WholeUnit = item["WholeUnit"].ToString();
|
|
||||||
demodel.Unit = item["Unit"].ToString();
|
|
||||||
demodel.TrayCode = item["bkbarcode"].ToString();
|
|
||||||
#region 获取库位信息
|
#region 获取库位信息
|
||||||
demodel.Block = item["Block"].ToString();
|
demodel.Block = item["Block"].ToString();
|
||||||
demodel.Area = item["Area"].ToString();
|
demodel.Area = item["Area"].ToString();
|
||||||
demodel.Address = item["address"].ToString();
|
|
||||||
demodel.UserCode = usercode;
|
|
||||||
demodel.ColorCode = lightcolor;
|
|
||||||
demodel.Bkaddress = "0";
|
|
||||||
demodel.Addresstype = "1";
|
|
||||||
demodel.ControlID = "";
|
|
||||||
demodel.ControlIP = item["ControlIP"].ToString();
|
|
||||||
//demodel.Layer = item["Layer"].ToString();
|
|
||||||
//demodel.Slist = item["Slist"].ToString();
|
|
||||||
//demodel.Zone = item["zone"].ToString();
|
|
||||||
//demodel.TaskType =Convert.ToInt32(item["tasktype"].ToString());
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
demodel.State = 0;
|
demodel.State = 0;
|
||||||
demodel.TaskArea = Convert.ToInt32(item["area"].ToString());
|
demodel.TaskArea = Convert.ToInt32(item["area"].ToString());
|
||||||
demodel.TaskBlock = Convert.ToInt32(item["block"].ToString());
|
demodel.TaskBlock = Convert.ToInt32(item["block"].ToString());
|
||||||
demodel.No = "01";
|
|
||||||
if (isecho)
|
|
||||||
{
|
|
||||||
demodel.No = "04";
|
|
||||||
demodel.ColorCode = EnumHelper.EMToDescriptionString(LightColor.Color.Blue);
|
|
||||||
}
|
|
||||||
list.Add(demodel);
|
list.Add(demodel);
|
||||||
if (!isecho) {
|
|
||||||
//修改数据为已读
|
//修改数据为已读
|
||||||
dal.UpOrder_Car(item["Matchid"].ToString(), item["sku"].ToString(), item["id"].ToString());
|
// dal.UpOrder_Car(item["Matchid"].ToString(), item["sku"].ToString(), item["id"].ToString());
|
||||||
}
|
UpdateOrderState_Car(matchid, demodel.FromTolocation, "1");
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1025,5 +947,26 @@ namespace Epost.BLL
|
|||||||
return dal.GetOrderList_echo(matchid, sku, sarea, sblock);
|
return dal.GetOrderList_echo(matchid, sku, sarea, sblock);
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region 修改小格口号
|
||||||
|
public bool UpdateSkuLoc(string sku, string smallloc)
|
||||||
|
{
|
||||||
|
return dal.UpdateSkuLoc(sku,smallloc);
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region 查询小格口是否都已绑定
|
||||||
|
public bool getSmallLocList(string loc)
|
||||||
|
{
|
||||||
|
return dal.getSmallLocList(loc);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
#region 打印箱号 释放格口
|
||||||
|
public bool CreateBoxInfo(string boxcode, string loc, string type)
|
||||||
|
{
|
||||||
|
return dal.CreateBoxInfo(boxcode, loc, type);
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -9,6 +9,7 @@ using Epost.Common;
|
|||||||
using Epost.DAL.Cache;
|
using Epost.DAL.Cache;
|
||||||
using Epost.DAL.Enum;
|
using Epost.DAL.Enum;
|
||||||
using Epost.Model;
|
using Epost.Model;
|
||||||
|
using Epost.Model.resource;
|
||||||
|
|
||||||
namespace Epost.BLL
|
namespace Epost.BLL
|
||||||
{
|
{
|
||||||
@ -28,7 +29,7 @@ namespace Epost.BLL
|
|||||||
ShowMesCacheDAL msgCache = new ShowMesCacheDAL();
|
ShowMesCacheDAL msgCache = new ShowMesCacheDAL();
|
||||||
LocationCacheDAL locCache = new LocationCacheDAL();
|
LocationCacheDAL locCache = new LocationCacheDAL();
|
||||||
BoxCodeCacheDAL boxcache = new BoxCodeCacheDAL();
|
BoxCodeCacheDAL boxcache = new BoxCodeCacheDAL();
|
||||||
|
ErrorLogBLL logBLL = new ErrorLogBLL();
|
||||||
|
|
||||||
private static object lockobj = new object();
|
private static object lockobj = new object();
|
||||||
private static object lockJobDown = new object();
|
private static object lockJobDown = new object();
|
||||||
@ -41,7 +42,6 @@ namespace Epost.BLL
|
|||||||
public ResultModel ClearALL()
|
public ResultModel ClearALL()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
bool t = addrBLL.UpdateState();
|
bool t = addrBLL.UpdateState();
|
||||||
@ -55,7 +55,7 @@ namespace Epost.BLL
|
|||||||
UserCacheDAL.ClearUserCodeList();
|
UserCacheDAL.ClearUserCodeList();
|
||||||
boxcache.ClearBoxList();
|
boxcache.ClearBoxList();
|
||||||
ResultModel resultModel = comBLL.Initialization_M();
|
ResultModel resultModel = comBLL.Initialization_M();
|
||||||
GetOrderQueue(); //加载任务显示器信息
|
// GetOrderQueue(); //加载任务显示器信息
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -389,109 +389,109 @@ namespace Epost.BLL
|
|||||||
|
|
||||||
public void jobdown_start(ResultMessageModel data, List<JobModel> job, string block, string area, List<JobModel> jobList)
|
public void jobdown_start(ResultMessageModel data, List<JobModel> job, string block, string area, List<JobModel> jobList)
|
||||||
{
|
{
|
||||||
int truequantity = 0;
|
//int truequantity = 0;
|
||||||
int checkquantity = 0;
|
//int checkquantity = 0;
|
||||||
string scanstr = data.Parameter;
|
//string scanstr = data.Parameter;
|
||||||
if (!string.IsNullOrEmpty(scanstr))
|
//if (!string.IsNullOrEmpty(scanstr))
|
||||||
{
|
|
||||||
truequantity = Convert.ToInt32(scanstr);
|
|
||||||
}
|
|
||||||
if (job.Any())
|
|
||||||
{
|
|
||||||
List<JobModel> downlist = new List<JobModel>();
|
|
||||||
JobModel model = job.FirstOrDefault();
|
|
||||||
|
|
||||||
//List<JobModel> manyList = job.FindAll(m => m.ManyState == 1 && m.Tolocation == model.Tolocation);
|
|
||||||
//if (manyList.Any())//合并显示数据
|
|
||||||
//{
|
//{
|
||||||
|
// truequantity = Convert.ToInt32(scanstr);
|
||||||
// downlist.AddRange(manyList);
|
|
||||||
// LogHelper.WriteLogInfo("合并显示数据=========="+ manyList .Count+ "==================");
|
|
||||||
//}
|
//}
|
||||||
//else
|
//if (job.Any())
|
||||||
//{
|
//{
|
||||||
downlist.Add(model);
|
// List<JobModel> downlist = new List<JobModel>();
|
||||||
|
// JobModel model = job.FirstOrDefault();
|
||||||
|
|
||||||
|
// //List<JobModel> manyList = job.FindAll(m => m.ManyState == 1 && m.Tolocation == model.Tolocation);
|
||||||
|
// //if (manyList.Any())//合并显示数据
|
||||||
|
// //{
|
||||||
|
|
||||||
|
// // downlist.AddRange(manyList);
|
||||||
|
// // LogHelper.WriteLogInfo("合并显示数据=========="+ manyList .Count+ "==================");
|
||||||
|
// //}
|
||||||
|
// //else
|
||||||
|
// //{
|
||||||
|
// downlist.Add(model);
|
||||||
|
// // }
|
||||||
|
// //修改订单状态
|
||||||
|
// orderbll.UpdateOrderState_Car(downlist, model, truequantity, checkquantity);
|
||||||
|
// LogHelper.WriteLogInfo(data.Address + "=========------------------" + data.Parameter);
|
||||||
|
// bool skuInish = orderbll.IsFinishWork(1, block, "", area, model.Sku);
|
||||||
|
// model.State = 3;
|
||||||
|
// if (skuInish)
|
||||||
|
// {
|
||||||
|
// LogHelper.WriteLogInfo("区SKU拣选完成--------------");
|
||||||
|
// //删除sku缓存信息
|
||||||
|
// List<ResultMessageModel> scanlist = downCacheDAL.GetPlanJobDownList().FindAll(p => p.Parameter == model.Sku && p.Command == "QUERY_SPECIAL_STATUS" && p.Area == area);
|
||||||
|
// downCacheDAL.UpdateJobDownModelList(scanlist, EdownCommend.Execute);
|
||||||
|
// //熄灭通道灯
|
||||||
|
// comBLL.DISPLAY_LIGHT_BLOCK(block, area, "0");
|
||||||
|
|
||||||
|
// #region 熄灭当前区显示屏
|
||||||
|
// List<JobModel> offList = jobList.FindAll(m => m.Block == block && m.Area == area && m.State == 3 && m.Sku == model.Sku);
|
||||||
|
// if (offList.Any())
|
||||||
|
// {
|
||||||
|
// comBLL.LED_OFF_CLEAR(offList);
|
||||||
// }
|
// }
|
||||||
//修改订单状态
|
// #endregion
|
||||||
orderbll.UpdateOrderState_Car(downlist, model, truequantity, checkquantity);
|
|
||||||
LogHelper.WriteLogInfo(data.Address + "=========------------------" + data.Parameter);
|
|
||||||
bool skuInish = orderbll.IsFinishWork(1, block, "", area, model.Sku);
|
|
||||||
model.State = 3;
|
|
||||||
if (skuInish)
|
|
||||||
{
|
|
||||||
LogHelper.WriteLogInfo("区SKU拣选完成--------------");
|
|
||||||
//删除sku缓存信息
|
|
||||||
List<ResultMessageModel> scanlist = downCacheDAL.GetPlanJobDownList().FindAll(p => p.Parameter == model.Sku && p.Command == "QUERY_SPECIAL_STATUS" && p.Area == area);
|
|
||||||
downCacheDAL.UpdateJobDownModelList(scanlist, EdownCommend.Execute);
|
|
||||||
//熄灭通道灯
|
|
||||||
comBLL.DISPLAY_LIGHT_BLOCK(block, area, "0");
|
|
||||||
|
|
||||||
#region 熄灭当前区显示屏
|
// #region 修改任务队列状态
|
||||||
List<JobModel> offList = jobList.FindAll(m => m.Block == block && m.Area == area && m.State == 3 && m.Sku == model.Sku);
|
// OrdersQueueModel qumodel = new OrdersQueueModel();
|
||||||
if (offList.Any())
|
// qumodel.State = 3;
|
||||||
{
|
// qumodel.Taskblock = block;
|
||||||
comBLL.LED_OFF_CLEAR(offList);
|
// qumodel.Taskarea = area;
|
||||||
}
|
// qumodel.Sku = model.Sku;
|
||||||
#endregion
|
// qumodel.Matchid = model.Matchid;
|
||||||
|
// qumodel.UserCode = model.UserCode;
|
||||||
|
// queueBLL.UpdateQueueTaskArea_Car(qumodel);
|
||||||
|
// #endregion
|
||||||
|
|
||||||
#region 修改任务队列状态
|
// #region 刷新波次信息
|
||||||
OrdersQueueModel qumodel = new OrdersQueueModel();
|
// showSummaryMes(model.Sku, block, area, Convert.ToInt32(block), null, model.Tolocation, model.Matchid);
|
||||||
qumodel.State = 3;
|
// #endregion
|
||||||
qumodel.Taskblock = block;
|
|
||||||
qumodel.Taskarea = area;
|
|
||||||
qumodel.Sku = model.Sku;
|
|
||||||
qumodel.Matchid = model.Matchid;
|
|
||||||
qumodel.UserCode = model.UserCode;
|
|
||||||
queueBLL.UpdateQueueTaskArea_Car(qumodel);
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region 刷新波次信息
|
// Thread.Sleep(30);
|
||||||
showSummaryMes(model.Sku, block, area, Convert.ToInt32(block), null, model.Tolocation, model.Matchid);
|
// #region 整条通道当前用户所有任务分播结束
|
||||||
#endregion
|
// bool blockfinish = orderbll.IsFinishWorkByCar(1, model.Matchid, block);
|
||||||
|
// if (blockfinish)
|
||||||
|
// {
|
||||||
|
// #region 点亮显示器
|
||||||
|
// ShowMessageModel_M show = new ShowMessageModel_M();
|
||||||
|
// show.Title = "当前波次分播完成";
|
||||||
|
// show.Contents = "拍下熄灭所有设备\r请扫描继续作业";
|
||||||
|
// show.Color = EnumHelper.EMToDescriptionString(LightColor.Color.Green);
|
||||||
|
// show.Qty = "0";
|
||||||
|
// show.Type = 8;
|
||||||
|
// show.Block = block;
|
||||||
|
// show.Islock = false;
|
||||||
|
// show.IsTwinkle = 1;
|
||||||
|
// show.No = "01";
|
||||||
|
// comBLL.ShowBoxMessage_M(show);
|
||||||
|
// #endregion
|
||||||
|
|
||||||
Thread.Sleep(30);
|
// bool allfinish = orderbll.IsFinishWorkByCar(1, model.Matchid);
|
||||||
#region 整条通道当前用户所有任务分播结束
|
// if (allfinish)//判断整个波次是否已完成
|
||||||
bool blockfinish = orderbll.IsFinishWorkByCar(1, model.Matchid, block);
|
// { //更新state状态为已完成
|
||||||
if (blockfinish)
|
// orderbll.UpdateStateByCar(model.Matchid);
|
||||||
{
|
// }
|
||||||
#region 点亮显示器
|
// //删除波次信息
|
||||||
ShowMessageModel_M show = new ShowMessageModel_M();
|
// List<UserCodeModel> ulist = UserCacheDAL.GetUserCodeList().FindAll(m => m.Block == block);
|
||||||
show.Title = "当前波次分播完成";
|
// UserCacheDAL.UpdateUserCodeList(ulist, EUserCommend.Execute);
|
||||||
show.Contents = "拍下熄灭所有设备\r请扫描继续作业";
|
|
||||||
show.Color = EnumHelper.EMToDescriptionString(LightColor.Color.Green);
|
|
||||||
show.Qty = "0";
|
|
||||||
show.Type = 8;
|
|
||||||
show.Block = block;
|
|
||||||
show.Islock = false;
|
|
||||||
show.IsTwinkle = 1;
|
|
||||||
show.No = "01";
|
|
||||||
comBLL.ShowBoxMessage_M(show);
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
bool allfinish = orderbll.IsFinishWorkByCar(1, model.Matchid);
|
// }
|
||||||
if (allfinish)//判断整个波次是否已完成
|
// #endregion
|
||||||
{ //更新state状态为已完成
|
|
||||||
orderbll.UpdateStateByCar(model.Matchid);
|
|
||||||
}
|
|
||||||
//删除波次信息
|
|
||||||
List<UserCodeModel> ulist = UserCacheDAL.GetUserCodeList().FindAll(m => m.Block == block);
|
|
||||||
UserCacheDAL.UpdateUserCodeList(ulist, EUserCommend.Execute);
|
|
||||||
|
|
||||||
}
|
// #region 区内sku播完回传
|
||||||
#endregion
|
// // orderbll.UpdateStateByCar(model.Matchid, "", model.Sku);
|
||||||
|
|
||||||
#region 区内sku播完回传
|
// #endregion
|
||||||
// orderbll.UpdateStateByCar(model.Matchid, "", model.Sku);
|
|
||||||
|
|
||||||
#endregion
|
// #region 清除当前区已做完的sku
|
||||||
|
// JobCache.UpdateJobModelList(offList, EcommendType.Execute);
|
||||||
|
// #endregion
|
||||||
|
|
||||||
#region 清除当前区已做完的sku
|
// }
|
||||||
JobCache.UpdateJobModelList(offList, EcommendType.Execute);
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
}
|
// }
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -562,71 +562,38 @@ namespace Epost.BLL
|
|||||||
#region 点亮任务标签
|
#region 点亮任务标签
|
||||||
foreach (JobModel item in nowJoblist.ToArray())
|
foreach (JobModel item in nowJoblist.ToArray())
|
||||||
{
|
{
|
||||||
|
#region 点亮灯带格口
|
||||||
#region 回显设备锁定
|
//先熄灭
|
||||||
if (queueDT.Rows[0]["lightcolor"].ToString() == EnumHelper.EMToDescriptionString(LightColor.Color.Blue))
|
//comBLL.Ledonoff_dengdai("0", "");
|
||||||
{
|
//Thread.Sleep(100);
|
||||||
|
//comBLL.display_dengdai(item.Tolocation, "2");
|
||||||
LabelParamModel locklamodel = new LabelParamModel();
|
comBLL.LED_OFF_CLEAR(item.ControlIP);
|
||||||
locklamodel.Address = item.Address.ToString();
|
Thread.Sleep(100);
|
||||||
locklamodel.ControlIP = item.ControlIP.ToString();
|
|
||||||
locklamodel.Command = "LOCK";
|
|
||||||
locklamodel.Parameter = "11111000";
|
|
||||||
locklamodel.Type = "N";
|
|
||||||
list.Add(locklamodel);
|
|
||||||
|
|
||||||
}
|
|
||||||
#endregion
|
|
||||||
// else
|
|
||||||
//{
|
|
||||||
|
|
||||||
List<JobModel> manyJoblist = nowJoblist.FindAll(m => m.Tolocation == item.Tolocation);
|
|
||||||
int quantity = item.Quantity;
|
|
||||||
|
|
||||||
LabelParamModel lamodel = new LabelParamModel();
|
LabelParamModel lamodel = new LabelParamModel();
|
||||||
|
lamodel.Address = item.Address;
|
||||||
lamodel.Address = item.Address.ToString();
|
lamodel.ControlIP = item.ControlIP;
|
||||||
lamodel.ControlIP = item.ControlIP.ToString();
|
lamodel.Parameter = "40000001";
|
||||||
lamodel.Command = "DISPLAY_JOB";
|
comBLL.LED_ON_M(lamodel);
|
||||||
|
|
||||||
#region 同一个货位的数据合并显示
|
|
||||||
//if (manyJoblist.Count > 1)
|
|
||||||
//{
|
|
||||||
// if (manyJoblist.FindAll(m => m.State == 0).Any())
|
|
||||||
// {
|
|
||||||
// foreach (JobModel mitem in manyJoblist)
|
|
||||||
// {
|
|
||||||
// quantity += mitem.Quantity;
|
|
||||||
// mitem.State = 1;
|
|
||||||
// mitem.ManyState = 1;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
#endregion
|
#endregion
|
||||||
|
item.State = 3;
|
||||||
lamodel.Uid = item.ID;
|
|
||||||
lamodel.Type = "N";
|
|
||||||
lamodel.Quantity = quantity.ToString();
|
|
||||||
lamodel.Uid = item.ID;
|
|
||||||
lamodel.Mode = queueDT.Rows[0]["lightcolor"].ToString() + "0";
|
|
||||||
|
|
||||||
list.Add(lamodel);
|
|
||||||
//}
|
|
||||||
|
|
||||||
item.State = 1;
|
|
||||||
item.ColorCode = queueDT.Rows[0]["lightcolor"].ToString();
|
|
||||||
item.DisplayTime = DateTime.Now;
|
item.DisplayTime = DateTime.Now;
|
||||||
|
#region 更新订单状态
|
||||||
|
orderbll.UpdateOrderState_Car(item.Matchid, item.FromTolocation, "3");
|
||||||
|
model.State = 3;
|
||||||
|
bool allfinish = orderbll.IsFinishWorkByCar(1, item.Matchid);
|
||||||
|
if (allfinish)//判断整个波次是否已完成
|
||||||
|
{ //更新state状态为已完成
|
||||||
|
// orderbll.UpdateStateByCar(item.Matchid);
|
||||||
|
// comBLL.Ledonoff_dengdai("0", "");
|
||||||
|
//删除波次信息
|
||||||
|
List<UserCodeModel> ulist = UserCacheDAL.GetUserCodeList();
|
||||||
|
UserCacheDAL.UpdateUserCodeList(ulist, EUserCommend.Execute);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
#region 点亮通道灯
|
|
||||||
comBLL.DISPLAY_LIGHT_BLOCK(model.Taskblock, model.Taskarea, "1");
|
|
||||||
#endregion
|
|
||||||
if (list != null && list.Count > 0)
|
|
||||||
{
|
|
||||||
LogHelper.WriteLogInfo("添加到点亮的list————————————————————:" + list.Count);
|
|
||||||
comBLL.DISPLAY_JOBALL(list);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{//无任务
|
{//无任务
|
||||||
@ -634,22 +601,15 @@ namespace Epost.BLL
|
|||||||
model.State = 3;
|
model.State = 3;
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
if (jobList.Any())
|
|
||||||
{
|
|
||||||
|
|
||||||
var finishList = jobList.FindAll(p => p.State == 0);
|
|
||||||
if (!finishList.Any())
|
|
||||||
{
|
|
||||||
queueBLL.UpdateQueueOrderState(model);//缓存队列状态修改
|
queueBLL.UpdateQueueOrderState(model);//缓存队列状态修改
|
||||||
}
|
}
|
||||||
}
|
else
|
||||||
}
|
{
|
||||||
else {
|
|
||||||
|
|
||||||
LogHelper.WriteLogInfo("还有未完成任务" + isJobList.Count);
|
LogHelper.WriteLogInfo("还有未完成任务" + isJobList.Count);
|
||||||
foreach (JobModel item in isJobList)
|
foreach (JobModel item in isJobList)
|
||||||
{
|
{
|
||||||
LogHelper.WriteLogInfo("还有未完成任务"+item.Address+item.ID);
|
LogHelper.WriteLogInfo("还有未完成任务" + item.Address + item.ID);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -669,33 +629,36 @@ namespace Epost.BLL
|
|||||||
string matchid = string.Empty;
|
string matchid = string.Empty;
|
||||||
#region 提示请扫描波次号
|
#region 提示请扫描波次号
|
||||||
List<UserCodeModel> ulist = UserCacheDAL.GetUserCodeList().FindAll(m => m.Block == sblock && m.Area == sarea);//
|
List<UserCodeModel> ulist = UserCacheDAL.GetUserCodeList().FindAll(m => m.Block == sblock && m.Area == sarea);//
|
||||||
bool isnum = ConvertHexHelper.IsNum(scanStr.Substring(0, 1));//判断扫描首字母是否是数字
|
bool isnum = true;//ConvertHexHelper.IsNum(scanStr.Substring(0, 1));//判断扫描首字母是否是数字
|
||||||
|
|
||||||
if (!ulist.Any())
|
if (!ulist.Any())
|
||||||
{
|
{
|
||||||
//手动加波次信息
|
if (scanStr.Substring(0, 1) == "S"&&scanStr.Length==3) //扫描分播墙号
|
||||||
DataTable matdt = orderbll.GetMatchOrderList();
|
|
||||||
if (matdt != null && matdt.Rows.Count > 0)
|
|
||||||
{
|
{
|
||||||
UserCodeModel umodel = new UserCodeModel();
|
UserCodeModel umodel = new UserCodeModel();
|
||||||
umodel.Matchid = matdt.Rows[0]["matchid"].ToString();
|
umodel.Matchid = data.Parameter;//分播墙号
|
||||||
|
matchid = data.Parameter;
|
||||||
umodel.Block = sblock;
|
umodel.Block = sblock;
|
||||||
umodel.Area = sarea;
|
umodel.Area = sarea;
|
||||||
UserCacheDAL.UpdateUserCodeList(new List<UserCodeModel> { umodel }, EUserCommend.Create);
|
UserCacheDAL.UpdateUserCodeList(new List<UserCodeModel> { umodel }, EUserCommend.Create);
|
||||||
|
LogHelper.WriteLogInfo("扫描播种墙号" + data.Parameter);
|
||||||
|
logBLL.SaveShowMesError("请扫描物料开始分播", "请扫描物料开始分播");
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
LogHelper.WriteLogInfo(scanStr + "请扫描正确的播种墙号");
|
||||||
|
logBLL.SaveShowMesError("请扫描正确的播种墙号", "请扫描正确的播种墙号");
|
||||||
}
|
}
|
||||||
|
downCacheDAL.UpdateJobDownModelList(new List<ResultMessageModel> { data }, EdownCommend.Execute);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
ulist = UserCacheDAL.GetUserCodeList().FindAll(m => m.Block == sblock && m.Area == sarea);
|
ulist = UserCacheDAL.GetUserCodeList().FindAll(m => m.Block == sblock && m.Area == sarea);
|
||||||
if (ulist.Any())
|
if (ulist.Any())
|
||||||
{ matchid = ulist.FirstOrDefault().Matchid; }
|
{ matchid = ulist.FirstOrDefault().Matchid; }
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
if (data.Type == "5")//中分扫描枪
|
if (data.Type == "6")//播种扫描枪
|
||||||
{
|
|
||||||
|
|
||||||
zhongfenBind(ulist, scanStr, data);
|
|
||||||
downCacheDAL.UpdateJobDownModelList(new List<ResultMessageModel> { data }, EdownCommend.Execute);
|
|
||||||
}
|
|
||||||
else if (data.Type == "6")//播种扫描枪
|
|
||||||
{
|
{
|
||||||
|
|
||||||
xifenBind(ulist, scanStr, data, matchid, isnum);
|
xifenBind(ulist, scanStr, data, matchid, isnum);
|
||||||
@ -703,7 +666,7 @@ namespace Epost.BLL
|
|||||||
downCacheDAL.UpdateJobDownModelList(new List<ResultMessageModel> { data }, EdownCommend.Execute);
|
downCacheDAL.UpdateJobDownModelList(new List<ResultMessageModel> { data }, EdownCommend.Execute);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
@ -781,7 +744,7 @@ namespace Epost.BLL
|
|||||||
{
|
{
|
||||||
foreach (AddressstorageModel item in Arealist)
|
foreach (AddressstorageModel item in Arealist)
|
||||||
{
|
{
|
||||||
DataTable skudt = orderbll.GetSumList("", scanStr, item.block,item.area);
|
DataTable skudt = orderbll.GetSumList("", scanStr, item.block, item.area);
|
||||||
if (skudt != null && skudt.Rows.Count > 0)
|
if (skudt != null && skudt.Rows.Count > 0)
|
||||||
{
|
{
|
||||||
//规格
|
//规格
|
||||||
@ -839,57 +802,26 @@ namespace Epost.BLL
|
|||||||
#region 细分播种
|
#region 细分播种
|
||||||
public void xifenBind(List<UserCodeModel> ulist, string scanStr, ResultMessageModel data, string matchid, bool isnum)
|
public void xifenBind(List<UserCodeModel> ulist, string scanStr, ResultMessageModel data, string matchid, bool isnum)
|
||||||
{
|
{
|
||||||
//if (ulist.Any())
|
|
||||||
//{
|
|
||||||
// UserCodeModel usermodel = ulist.FirstOrDefault();
|
|
||||||
//if (string.IsNullOrEmpty(usermodel.UserCode) && scanStr.Substring(0, 1) != "U")//
|
|
||||||
//{
|
|
||||||
// #region 提示先扫描工号
|
|
||||||
// ShowMessageModel_M show = new ShowMessageModel_M();
|
|
||||||
// show.Title = "请先扫描工号!";
|
|
||||||
// show.Contents = "";
|
|
||||||
// show.Color = EnumHelper.EMToDescriptionString(LightColor.Color.Red);
|
|
||||||
// show.Block = sblock;
|
|
||||||
// show.Area = sarea;
|
|
||||||
// show.Type = 8;
|
|
||||||
// show.Islock = true;
|
|
||||||
// comBLL.ShowBoxMessage_M(show);
|
|
||||||
// downCacheDAL.UpdateJobDownModelList(new List<ResultMessageModel> { data }, EdownCommend.Execute);
|
|
||||||
// #endregion
|
|
||||||
//}
|
|
||||||
//else
|
|
||||||
//{
|
|
||||||
|
|
||||||
if (scanStr.Substring(0, 1) == "U")
|
|
||||||
{
|
|
||||||
#region 扫描工号
|
|
||||||
if (ulist.Any())
|
if (ulist.Any())
|
||||||
{
|
{
|
||||||
UserCodeModel umodel = ulist.FirstOrDefault();
|
UserCodeModel umodel = ulist.FirstOrDefault();
|
||||||
umodel.UserCode = scanStr;
|
if (scanStr.Substring(0, 1) == "U")
|
||||||
|
{
|
||||||
#region 扫描工号
|
#region 扫描工号
|
||||||
ShowMessageModel_M show = new ShowMessageModel_M();
|
umodel.UserCode = scanStr;
|
||||||
show.Title = "请扫描sku开始作业!";
|
|
||||||
show.Contents = "";
|
|
||||||
show.Color = EnumHelper.EMToDescriptionString(LightColor.Color.Red);
|
|
||||||
show.Block = data.Block;
|
|
||||||
show.Area = data.Area;
|
|
||||||
show.Type = 8;
|
|
||||||
show.Islock = true;
|
|
||||||
|
|
||||||
comBLL.ShowBoxMessage_M(show);
|
|
||||||
#endregion
|
|
||||||
}
|
|
||||||
downCacheDAL.UpdateJobDownModelList(new List<ResultMessageModel> { data }, EdownCommend.Execute);
|
downCacheDAL.UpdateJobDownModelList(new List<ResultMessageModel> { data }, EdownCommend.Execute);
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
|
else if (scanStr.Substring(0, 1) == "S" && scanStr.Length == 3) //扫描分播墙号
|
||||||
|
{
|
||||||
|
umodel.Matchid = scanStr;
|
||||||
|
downCacheDAL.UpdateJobDownModelList(new List<ResultMessageModel> { data }, EdownCommend.Execute);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
||||||
#region 扫描商品
|
#region 扫描商品
|
||||||
|
|
||||||
List<ResultMessageModel> hangList = downCacheDAL.GetPlanJobDownList().FindAll(m => m.Parameter == "888888");
|
List<ResultMessageModel> hangList = downCacheDAL.GetPlanJobDownList().FindAll(m => m.Parameter == "888888");
|
||||||
|
|
||||||
if (hangList.Any())
|
if (hangList.Any())
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -918,121 +850,107 @@ namespace Epost.BLL
|
|||||||
|
|
||||||
}
|
}
|
||||||
else if (isnum)//sku
|
else if (isnum)//sku
|
||||||
|
{
|
||||||
|
if (data.Parameter.Length <= 2)
|
||||||
|
{
|
||||||
|
#region 扫描小格口号
|
||||||
|
DataTable quedt = queueBLL.getQueueList();
|
||||||
|
if (quedt != null && quedt.Rows.Count > 0)
|
||||||
|
{
|
||||||
|
LogHelper.WriteLogInfo(quedt.Rows[0]["sku"].ToString() + "绑定小格口" + data.Parameter);
|
||||||
|
//更新订单记录
|
||||||
|
orderbll.UpdateSkuLoc(quedt.Rows[0]["sku"].ToString(), data.Parameter);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
LogHelper.WriteLogInfo("没有可绑定物料" + data.Parameter);
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
}
|
||||||
|
else if (data.Parameter.Length > 2 && data.Parameter.Length <= 5)
|
||||||
|
{
|
||||||
|
LogHelper.WriteLogInfo("扫描满箱");
|
||||||
|
FinshLoc(data.Parameter);
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
#region 扫描SKU
|
#region 扫描SKU
|
||||||
//根据扫描商品内码获取商品码
|
//根据扫描商品内码获取商品码
|
||||||
data.ScanCode = data.Parameter;
|
data.ScanCode = data.Parameter;
|
||||||
DataTable sinfodt = skuBLL.GetSkuInfoList(data.Parameter);
|
|
||||||
string location = string.Empty;
|
|
||||||
if (sinfodt != null && sinfodt.Rows.Count > 0)
|
|
||||||
{
|
|
||||||
scanStr = sinfodt.Rows[0]["sku"].ToString();
|
|
||||||
location = data.Parameter;// sinfodt.Rows[0]["tolocation"].ToString();
|
|
||||||
}
|
|
||||||
data.Parameter = scanStr;
|
|
||||||
DataTable skudt = queueBLL.GetOrderQueue(data.Block, data.Area, "3");
|
DataTable skudt = queueBLL.GetOrderQueue(data.Block, data.Area, "3");
|
||||||
List<ResultMessageModel> scanlist = downCacheDAL.GetPlanJobDownList().FindAll(m => m.Address == data.Address && m.Parameter == scanStr && m.Parameter != "888888" && m.Block == data.Block && m.Area == data.Area);
|
List<ResultMessageModel> scanlist = downCacheDAL.GetPlanJobDownList().FindAll(m => m.Address == data.Address && m.Parameter == scanStr && m.Parameter != "888888" && m.Block == data.Block && m.Area == data.Area);
|
||||||
|
|
||||||
if (scanlist.Count > 1 || (skudt != null && skudt.Rows.Count > 0))
|
if (scanlist.Count > 1 || (skudt != null && skudt.Rows.Count > 0))
|
||||||
{ //重复扫描
|
{
|
||||||
//ShowMessageModel_M show = new ShowMessageModel_M();
|
|
||||||
//show.Title = scanStr + "重复扫描/已拣配!";
|
|
||||||
//show.Color = EnumHelper.EMToDescriptionString(LightColor.Color.Red);
|
|
||||||
//show.Block = sblock;
|
|
||||||
//show.Area = sarea;
|
|
||||||
//show.Type = 8;
|
|
||||||
//comBLL.ShowBoxMessage_M(show);
|
|
||||||
downCacheDAL.UpdateJobDownModelList(new List<ResultMessageModel> { data }, EdownCommend.Execute);
|
downCacheDAL.UpdateJobDownModelList(new List<ResultMessageModel> { data }, EdownCommend.Execute);
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
||||||
DataTable OrderDt = orderbll.GetOrderList_Car(matchid, scanStr, data.Area, data.Block);
|
DataTable OrderDt = orderbll.GetOrderList_Car(matchid, scanStr, data.Area, data.Block);
|
||||||
if (OrderDt != null && OrderDt.Rows.Count > 0)
|
if (OrderDt != null && OrderDt.Rows.Count > 0)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (ulist.Any())
|
|
||||||
{
|
|
||||||
UserCodeModel umodel = ulist.FirstOrDefault();
|
|
||||||
data.Port = OrderDt.Rows[0]["matchid"].ToString();
|
|
||||||
OrdersQueueModel qmodel = new OrdersQueueModel();
|
OrdersQueueModel qmodel = new OrdersQueueModel();
|
||||||
qmodel.Sku = scanStr;
|
qmodel.Sku = scanStr;
|
||||||
qmodel.Taskblock = data.Block;
|
qmodel.Taskblock = data.Block;
|
||||||
qmodel.Taskarea = data.Area;
|
qmodel.Taskarea = data.Area;
|
||||||
qmodel.UserCode = umodel.UserCode;
|
qmodel.UserCode = umodel.UserCode;
|
||||||
qmodel.Matchid = umodel.Matchid;
|
qmodel.Matchid = umodel.Matchid;
|
||||||
qmodel.Location = location;
|
qmodel.Location = scanStr;
|
||||||
qmodel.Lightcolor = EnumHelper.EMToDescriptionString(LightColor.Color.Red);
|
qmodel.Lightcolor = EnumHelper.EMToDescriptionString(LightColor.Color.Red);
|
||||||
queueBLL.insertQueueOrders(qmodel);
|
queueBLL.insertQueueOrders(qmodel);
|
||||||
//提示需要拣货总量/商品名称
|
|
||||||
showSummaryMes(scanStr, data.Block, data.Area, 1, data, "", OrderDt.Rows[0]["matchid"].ToString());
|
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
LogHelper.WriteLogInfo("未扫描波次信息", LogHelper.Log_Type.ERROR);
|
logBLL.SaveShowMesError("扫描:" + scanStr + "无任务!", "扫描:" + scanStr + "无任务!");
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
#region 回显
|
|
||||||
DataTable echoDt = orderbll.GetOrderList_echo(matchid, scanStr, data.Area, data.Block);
|
|
||||||
if (echoDt != null && echoDt.Rows.Count > 0)
|
|
||||||
{
|
|
||||||
|
|
||||||
if (ulist.Any())
|
|
||||||
{
|
|
||||||
UserCodeModel umodel = ulist.FirstOrDefault();
|
|
||||||
data.Port = echoDt.Rows[0]["matchid"].ToString();
|
|
||||||
OrdersQueueModel qmodel = new OrdersQueueModel();
|
|
||||||
qmodel.Sku = scanStr;
|
|
||||||
qmodel.Taskblock = data.Block;
|
|
||||||
qmodel.Taskarea = data.Area;
|
|
||||||
qmodel.UserCode = umodel.UserCode;
|
|
||||||
qmodel.Matchid = umodel.Matchid;
|
|
||||||
// qmodel.Location = location;
|
|
||||||
qmodel.Lightcolor = EnumHelper.EMToDescriptionString(LightColor.Color.Blue);
|
|
||||||
queueBLL.insertQueueOrders(qmodel);
|
|
||||||
//提示需要拣货总量/商品名称
|
|
||||||
Mes_Echo(scanStr, data.Block, data.Area, 1, data, "", echoDt.Rows[0]["matchid"].ToString(), false);
|
|
||||||
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
LogHelper.WriteLogInfo("未扫描波次信息", LogHelper.Log_Type.ERROR);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
|
|
||||||
//提示无任务
|
|
||||||
ShowMessageModel_M show = new ShowMessageModel_M();
|
|
||||||
show.Title = "商品:" + scanStr + "当前区无任务!";
|
|
||||||
show.Color = EnumHelper.EMToDescriptionString(LightColor.Color.Red);
|
|
||||||
show.Block = data.Block;
|
|
||||||
show.Area = data.Area;
|
|
||||||
show.Type = 8;
|
|
||||||
show.Islock = false;
|
|
||||||
comBLL.ShowBoxMessage_M(show);
|
|
||||||
downCacheDAL.UpdateJobDownModelList(new List<ResultMessageModel> { data }, EdownCommend.Execute);
|
downCacheDAL.UpdateJobDownModelList(new List<ResultMessageModel> { data }, EdownCommend.Execute);
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region 满箱打印标签
|
||||||
|
public bool FinshLoc(string loc)
|
||||||
|
{
|
||||||
|
bool isfin = orderbll.getSmallLocList(loc);
|
||||||
|
if (isfin)
|
||||||
|
{
|
||||||
|
DataTable locdt= addrBLL.GetALLList(" and location='"+loc+"'");
|
||||||
|
string type = string.Empty;
|
||||||
|
if (locdt != null && locdt.Rows.Count > 0)
|
||||||
|
{
|
||||||
|
type = locdt.Rows[0]["addresstype"].ToString();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
//生成唯一箱号条码
|
||||||
|
string boxcode = ((DateTime.Now.ToUniversalTime().Ticks - 621355968000000000) / 10000000).ToString() + loc;
|
||||||
|
LogHelper.WriteLogInfo(boxcode.ToString());
|
||||||
|
bool bo = orderbll.CreateBoxInfo(boxcode, loc, type);
|
||||||
|
return bo;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
logBLL.SaveShowMesError("小格口未完全绑定", "小格口未完全绑定,请绑定后再释放!");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region 复核显示
|
#region 复核显示
|
||||||
@ -1088,7 +1006,7 @@ namespace Epost.BLL
|
|||||||
if (data != null)
|
if (data != null)
|
||||||
{
|
{
|
||||||
|
|
||||||
show.Contents = data.ScanCode + "(" + scanStr + ")" + "\r"+ mes;
|
show.Contents = data.ScanCode + "(" + scanStr + ")" + "\r" + mes;
|
||||||
sku = data.Parameter;
|
sku = data.Parameter;
|
||||||
}
|
}
|
||||||
show.Color = EnumHelper.EMToDescriptionString(LightColor.Color.Blue);
|
show.Color = EnumHelper.EMToDescriptionString(LightColor.Color.Blue);
|
||||||
@ -1262,11 +1180,11 @@ namespace Epost.BLL
|
|||||||
|
|
||||||
if (qdt != null && qdt.Rows.Count > 0)
|
if (qdt != null && qdt.Rows.Count > 0)
|
||||||
{
|
{
|
||||||
show.Contents = qdt.Rows[0]["location"].ToString() + "(" + scanStr + ")" + "\r"+ mes;//sudt.Rows[0]["goodscode"].ToString().Replace(';','\r');
|
show.Contents = qdt.Rows[0]["location"].ToString() + "(" + scanStr + ")" + "\r" + mes;//sudt.Rows[0]["goodscode"].ToString().Replace(';','\r');
|
||||||
}
|
}
|
||||||
if (data != null)
|
if (data != null)
|
||||||
{
|
{
|
||||||
show.Contents = data.ScanCode + "(" + scanStr + ")" + "\r"+ mes;// sudt.Rows[0]["goodscode"].ToString().Replace(';', '\r');
|
show.Contents = data.ScanCode + "(" + scanStr + ")" + "\r" + mes;// sudt.Rows[0]["goodscode"].ToString().Replace(';', '\r');
|
||||||
sku = data.Parameter;
|
sku = data.Parameter;
|
||||||
}
|
}
|
||||||
show.Color = EnumHelper.EMToDescriptionString(LightColor.Color.Green);
|
show.Color = EnumHelper.EMToDescriptionString(LightColor.Color.Green);
|
||||||
|
@ -246,5 +246,14 @@ namespace Epost.BLL
|
|||||||
|
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region 获取最新一条记录
|
||||||
|
public DataTable getQueueList()
|
||||||
|
{
|
||||||
|
|
||||||
|
return dal.getQueueList();
|
||||||
|
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -696,7 +696,7 @@ namespace Epost.DAL
|
|||||||
#region 获取所有地址列表
|
#region 获取所有地址列表
|
||||||
public DataTable GetALLList(string strwhere)
|
public DataTable GetALLList(string strwhere)
|
||||||
{
|
{
|
||||||
string sql = string.Format("select * from v_address where 1=1 " + strwhere + " ");
|
string sql = string.Format("select * from addressstorage where 1=1 " + strwhere + " ");
|
||||||
|
|
||||||
DataTable dt = db.GetsqlForDT(sql);
|
DataTable dt = db.GetsqlForDT(sql);
|
||||||
return dt;
|
return dt;
|
||||||
@ -809,5 +809,26 @@ namespace Epost.DAL
|
|||||||
}
|
}
|
||||||
#endregion
|
#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,address from v_address where type<>6 " + 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; }
|
||||||
|
}
|
||||||
|
}
|
@ -317,7 +317,7 @@ namespace Epost.DAL
|
|||||||
{
|
{
|
||||||
var sdlist = alllist.FirstOrDefault(x => x.Key == item["ControlIP"].ToString());
|
var sdlist = alllist.FirstOrDefault(x => x.Key == item["ControlIP"].ToString());
|
||||||
HttpHelper http = new HttpHelper();
|
HttpHelper http = new HttpHelper();
|
||||||
string ControlIP = "http://" + item["ControlIP"].ToString() + ":8000/param/";
|
string ControlIP = "http://" + item["ControlIP"].ToString() + ":81/cgi-bin/rpc.cgi";
|
||||||
// LogHelper.WriteLogInfo(ControlIP + "***************");
|
// LogHelper.WriteLogInfo(ControlIP + "***************");
|
||||||
string result = "";
|
string result = "";
|
||||||
List<SendParamModel> list = new List<SendParamModel>();
|
List<SendParamModel> list = new List<SendParamModel>();
|
||||||
@ -363,7 +363,7 @@ namespace Epost.DAL
|
|||||||
foreach (ResultsModel res in resultModel)
|
foreach (ResultsModel res in resultModel)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (res.Status == "ERROR")
|
if (res.Status == "ERROR"&&res.Command!= "START_POLLING")
|
||||||
{
|
{
|
||||||
LogHelper.WriteLogInfo("初始化指令" + postStr);
|
LogHelper.WriteLogInfo("初始化指令" + postStr);
|
||||||
rest.result = "-1";
|
rest.result = "-1";
|
||||||
@ -572,7 +572,7 @@ namespace Epost.DAL
|
|||||||
{
|
{
|
||||||
ResultsModel resultModel = new ResultsModel();
|
ResultsModel resultModel = new ResultsModel();
|
||||||
HttpHelper http = new HttpHelper();
|
HttpHelper http = new HttpHelper();
|
||||||
string ControlIP = "http://" + model.ControlIP + ":8000/param/";
|
string ControlIP = "http://" + model.ControlIP + ":81/cgi-bin/rpc.cgi";
|
||||||
string result = "";
|
string result = "";
|
||||||
SendParamModel sendModel = new SendParamModel();
|
SendParamModel sendModel = new SendParamModel();
|
||||||
sendModel.Address = model.Address;
|
sendModel.Address = model.Address;
|
||||||
@ -627,7 +627,7 @@ namespace Epost.DAL
|
|||||||
{
|
{
|
||||||
var sdlist = alllist.FirstOrDefault(x => x.Key == item["ControlIP"].ToString());
|
var sdlist = alllist.FirstOrDefault(x => x.Key == item["ControlIP"].ToString());
|
||||||
HttpHelper http = new HttpHelper();
|
HttpHelper http = new HttpHelper();
|
||||||
string ControlIP = "http://" + item["ControlIP"].ToString() + ":8000/param/";
|
string ControlIP = "http://" + item["ControlIP"].ToString() + ":81/cgi-bin/rpc.cgi";
|
||||||
// LogHelper.WriteLogInfo(ControlIP + "***************");
|
// LogHelper.WriteLogInfo(ControlIP + "***************");
|
||||||
string result = "";
|
string result = "";
|
||||||
List<SendParamModel> list = new List<SendParamModel>();
|
List<SendParamModel> list = new List<SendParamModel>();
|
||||||
@ -671,8 +671,8 @@ namespace Epost.DAL
|
|||||||
LogHelper.WriteLogInfo("点亮指令" + postStr);
|
LogHelper.WriteLogInfo("点亮指令" + postStr);
|
||||||
ErrorLogDAL errdal = new ErrorLogDAL();
|
ErrorLogDAL errdal = new ErrorLogDAL();
|
||||||
ErrorLogModel errmodel = new ErrorLogModel();
|
ErrorLogModel errmodel = new ErrorLogModel();
|
||||||
errmodel.Address = res.Address;
|
errmodel.Remark = res.Address;
|
||||||
errmodel.ControlIP = item["ControlIP"].ToString();
|
errmodel.Title = item["ControlIP"].ToString();
|
||||||
|
|
||||||
//if (res.Parameter.Contains("E16"))
|
//if (res.Parameter.Contains("E16"))
|
||||||
//{
|
//{
|
||||||
|
@ -82,6 +82,10 @@
|
|||||||
<HintPath>..\packages\EntityFramework.6.1.3\lib\net45\EntityFramework.SqlServer.dll</HintPath>
|
<HintPath>..\packages\EntityFramework.6.1.3\lib\net45\EntityFramework.SqlServer.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</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" />
|
||||||
<Reference Include="System.ComponentModel.DataAnnotations" />
|
<Reference Include="System.ComponentModel.DataAnnotations" />
|
||||||
<Reference Include="System.Configuration" />
|
<Reference Include="System.Configuration" />
|
||||||
@ -106,6 +110,7 @@
|
|||||||
<Compile Include="Cache\EPlightCacheDAL.cs" />
|
<Compile Include="Cache\EPlightCacheDAL.cs" />
|
||||||
<Compile Include="Cache\JobDownCacheDAL.cs" />
|
<Compile Include="Cache\JobDownCacheDAL.cs" />
|
||||||
<Compile Include="Cache\JobModelCacheDAL.cs" />
|
<Compile Include="Cache\JobModelCacheDAL.cs" />
|
||||||
|
<Compile Include="Cache\LightControlCacheDAL.cs" />
|
||||||
<Compile Include="Cache\LocationCacheDAL.cs" />
|
<Compile Include="Cache\LocationCacheDAL.cs" />
|
||||||
<Compile Include="Cache\ScanModelCacheDAL.cs" />
|
<Compile Include="Cache\ScanModelCacheDAL.cs" />
|
||||||
<Compile Include="Cache\ShowMesCacheDAL.cs" />
|
<Compile Include="Cache\ShowMesCacheDAL.cs" />
|
||||||
|
@ -13,21 +13,18 @@ namespace Epost.DAL
|
|||||||
public class ErrorLogDAL
|
public class ErrorLogDAL
|
||||||
{
|
{
|
||||||
DataBaseOpration.OprationSqlDAL db = DB_DLL.GetInstance();
|
DataBaseOpration.OprationSqlDAL db = DB_DLL.GetInstance();
|
||||||
|
|
||||||
#region 添加日志
|
#region 添加日志
|
||||||
public bool InsertErrorLog(ErrorLogModel model)
|
public bool InsertErrorLog(ErrorLogModel model)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
||||||
string sql = string.Format("insert into errorlog(username,ControlIP,ControlID,Address,ErrorDate,Type,BkAddress,Remark) values('{0}','{1}','{2}','{3}','{4}',{5},'{6}','{7}')",
|
string sql = string.Format("insert into errorlog(username,ErrorDate,Type,title,Remark) values('{0}','{1}','{2}','{3}','{4}')",
|
||||||
model.UserName,
|
model.UserName,
|
||||||
model.ControlIP,
|
|
||||||
model.ControlID,
|
|
||||||
model.Address,
|
|
||||||
DateTime.Now.ToString(),
|
DateTime.Now.ToString(),
|
||||||
model.Type,
|
model.Type,
|
||||||
model.BkAddress,
|
model.Title,
|
||||||
model.Remark);
|
model.Remark);
|
||||||
int x = db.InsertSql(sql);
|
int x = db.InsertSql(sql);
|
||||||
if (x > 0)
|
if (x > 0)
|
||||||
@ -84,7 +81,7 @@ namespace Epost.DAL
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
strSql.Append("order by Id asc");
|
strSql.Append("order by Id desc");
|
||||||
}
|
}
|
||||||
strSql.Append(")AS Row, T.* from ErrorLog T WITH(NOLOCK) ");
|
strSql.Append(")AS Row, T.* from ErrorLog T WITH(NOLOCK) ");
|
||||||
if (!string.IsNullOrEmpty(strWhere.Trim()))
|
if (!string.IsNullOrEmpty(strWhere.Trim()))
|
||||||
@ -114,10 +111,25 @@ namespace Epost.DAL
|
|||||||
{
|
{
|
||||||
LogHelper.WriteLog(GetType(), ex.Message);
|
LogHelper.WriteLog(GetType(), ex.Message);
|
||||||
recordCount = 0;
|
recordCount = 0;
|
||||||
return new List<Model.ErrorLogModel>();
|
return new List<ErrorLogModel>();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
public long DeleteLog(string type)
|
||||||
|
{
|
||||||
|
string strwhere = string.Empty;
|
||||||
|
if (!string.IsNullOrEmpty(type))
|
||||||
|
{
|
||||||
|
strwhere = " and type ='" + type + "'";
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
string sql = string.Format("delete from errorlog where 1=1 " + strwhere + "");
|
||||||
|
return db.DeleteSql(sql);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -48,7 +48,7 @@ namespace Epost.DAL
|
|||||||
string sql = string.Empty;
|
string sql = string.Empty;
|
||||||
if (!string.IsNullOrEmpty(area))
|
if (!string.IsNullOrEmpty(area))
|
||||||
{
|
{
|
||||||
sql = string.Format("select id, ProdArea, LotNo, Matchid, orderid, barcode, BatchId, DownDate, Tolocation, Sku, GoodsName, Discount, Quantity, GoodsType, corlorcode, address, ControlIP,area, block,boxcode,bkbarcode,isnull(checkquantity,0) as checkquantity,wholeunit,unit,shopid,wmsboxcode from v_orders where state = 0 and oprationstate <>3 and sku = '{0}' and block = '{1}' and area='{2}' " + strwhere + "",
|
sql = string.Format("select distinct tolocation,fromlocation,sku,block,area,address,controlip from v_orders where state = 0 and oprationstate <>3 and (sku = '{0}' or tolocation='{0}') and block = '{1}' and area='{2}' " + strwhere + "",
|
||||||
|
|
||||||
sku,
|
sku,
|
||||||
block, area);
|
block, area);
|
||||||
@ -56,7 +56,7 @@ namespace Epost.DAL
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
sql = string.Format("select id,ProdArea, LotNo, Matchid, orderid, barcode, BatchId, DownDate, Tolocation, Sku, GoodsName, Discount, Quantity, GoodsType, corlorcode, address, ControlIP, area , block,boxcode,bkbarcode,isnull(checkquantity,0) as checkquantity,wholeunit,unit,shopid,wmsboxcode from v_orders where state = 0 and oprationstate <>3 and sku = '{0}' and block = '{1}' " + strwhere + "",
|
sql = string.Format("select distinct tolocation,fromlocation,block,area ,address,controlip from v_orders where state = 0 and oprationstate <>3 (and sku = '{0}'or tolocation='{0}') and block = '{1}' " + strwhere + "",
|
||||||
|
|
||||||
sku,
|
sku,
|
||||||
block);
|
block);
|
||||||
@ -622,38 +622,17 @@ namespace Epost.DAL
|
|||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region 修改当前标签拣货状态
|
#region 修改当前标签拣货状态
|
||||||
public bool UpdateWorkState_Car(string matchid, int truequantity, string sku, string id, int checkquantity, string usercode = "")
|
public bool UpdateWorkState_Car(string matchid,string tolocation, string oprationstate )
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
lock (uplock)
|
lock (uplock)
|
||||||
{
|
{
|
||||||
int oprationstate = 3;
|
string upsql = string.Format("update orders set oprationstate = '{0}' ,oprationtime='{1}' ,truequantity=quantity where matchid='{2}' and tolocation='{3}' ",
|
||||||
// string sql = string.Format("select quantity,truequantity from orders where matchid='{0}' and sku = '{1}' and batchid='{2}'",
|
|
||||||
// matchid,
|
|
||||||
// sku,
|
|
||||||
// batchid);
|
|
||||||
|
|
||||||
//DataTable dt= db.GetsqlForDT(sql);
|
|
||||||
// if (dt!=null&&dt.Rows.Count > 0)
|
|
||||||
// {
|
|
||||||
// int trueqty =Convert.ToInt32( dt.Rows[0]["truequantity"].ToString());
|
|
||||||
// int quantity =Convert.ToInt32( dt.Rows[0]["quantity"].ToString());
|
|
||||||
|
|
||||||
// if (trueqty + 1 == quantity)
|
|
||||||
// {
|
|
||||||
// oprationstate = 3;
|
|
||||||
// }
|
|
||||||
// truequantity = trueqty + 1;
|
|
||||||
// }
|
|
||||||
string upsql = string.Format("update orders set oprationstate = '{3}' ,oprationtime='{0}',oprationcode='{5}',truequantity='{1}' where matchid='{2}' and id='{4}' ",
|
|
||||||
DateTime.Now.ToString(),
|
|
||||||
truequantity,
|
|
||||||
matchid,
|
|
||||||
oprationstate,
|
oprationstate,
|
||||||
id,
|
DateTime.Now.ToString(),
|
||||||
// checkquantity,
|
matchid,
|
||||||
usercode
|
tolocation
|
||||||
);
|
);
|
||||||
long x = db.UpdateSql(upsql);
|
long x = db.UpdateSql(upsql);
|
||||||
if (x > 0)
|
if (x > 0)
|
||||||
@ -2492,6 +2471,100 @@ namespace Epost.DAL
|
|||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region 修改小格口号
|
||||||
|
public bool UpdateSkuLoc(string sku,string smallloc)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
string sql = string.Format(" update orders set partcode = '{0}' where sku='{1}' and (partcode is null or partcode='')",
|
||||||
|
smallloc,
|
||||||
|
sku);
|
||||||
|
|
||||||
|
long x = db.UpdateSql(sql);
|
||||||
|
LogHelper.WriteLogInfo(x+"修改小格口信息"+sql);
|
||||||
|
if (x > 0)
|
||||||
|
return true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
LogHelper.WriteLogInfo("修改小格口号出错1" + ex.Message);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
#region 查询小格口是否都已绑定
|
||||||
|
public bool getSmallLocList(string loc)
|
||||||
|
{
|
||||||
|
string sql = string.Format("select top 1 * from orders where (partcode is null or partcode='') and oprationstate=3 and fromlocation='{0}'", loc);
|
||||||
|
DataTable dt = db.GetsqlForDT(sql);
|
||||||
|
if (dt != null && dt.Rows.Count > 0)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
#region 生成箱号
|
||||||
|
public bool CreateBoxInfo(string boxcode, string loc, string type)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
|
||||||
|
//添加打印信息
|
||||||
|
string printsql = string.Format("insert into print_sku(orderid,matchid,state,addtime,type) values('{0}','{1}','{2}','{3}','{4}')",
|
||||||
|
boxcode, loc, "0", DateTime.Now.ToString(), type);
|
||||||
|
int x = db.InsertSql(printsql);
|
||||||
|
if (x > 0)
|
||||||
|
{
|
||||||
|
//更新订单状态为已完成
|
||||||
|
string sql = string.Format("update orders set state =3,boxcode='{0}' where fromlocation='{1}' and state<>3 and oprationstate=3",
|
||||||
|
boxcode, loc);
|
||||||
|
long y = db.UpdateSql(sql);
|
||||||
|
LogHelper.WriteLogInfo(y + "更新订单完成" + sql);
|
||||||
|
//查询此货位是否存在未播商品
|
||||||
|
//string querysql = string.Format("select * from orders where oprationstate<>3 and fromlocation='{0}'",loc);
|
||||||
|
//DataTable querydt = db.GetsqlForDT(querysql);
|
||||||
|
//if (querydt != null && querydt.Rows.Count > 0)
|
||||||
|
//{
|
||||||
|
// LogHelper.WriteLogInfo(loc+"还有商品未分配完,不释放格口");
|
||||||
|
// //不释放格口
|
||||||
|
// return true;
|
||||||
|
//}
|
||||||
|
//else {
|
||||||
|
// //释放格口
|
||||||
|
// string upsql = string.Format("update addressstorage set bkaddress=0,addresstype='' where location='{0}'", loc);
|
||||||
|
// long b = db.UpdateSql(upsql);
|
||||||
|
// if (b > 0)
|
||||||
|
// {
|
||||||
|
// return true;
|
||||||
|
// }
|
||||||
|
// else
|
||||||
|
// {
|
||||||
|
// LogHelper.WriteLogInfo("释放格口失败" + upsql);
|
||||||
|
// return false;
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
LogHelper.WriteLogInfo("添加打印箱标签失败" + printsql);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
|
||||||
|
LogHelper.WriteLogInfo("完成格口异常" + ex.ToString());
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -408,5 +408,14 @@ namespace Epost.DAL
|
|||||||
|
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region 获取最新一条记录
|
||||||
|
public DataTable getQueueList()
|
||||||
|
{
|
||||||
|
string sql = string.Format("select top 1 * from OrdersQueue where state=3 order by id desc");
|
||||||
|
return db.GetsqlForDT(sql);
|
||||||
|
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,16 +8,15 @@ namespace Epost.Model
|
|||||||
{
|
{
|
||||||
public class ErrorLogModel
|
public class ErrorLogModel
|
||||||
{
|
{
|
||||||
private int _ID ;
|
private int _ID;
|
||||||
private string _ControlIP = string.Empty;
|
|
||||||
private string _ControlID = string.Empty;
|
|
||||||
private string _Address = string.Empty;
|
|
||||||
private DateTime _ErrorDate;
|
private DateTime _ErrorDate;
|
||||||
private string _Type = string.Empty;
|
private string _Type = string.Empty;
|
||||||
private string _BkAddress = string.Empty;
|
|
||||||
private string _Remark = string.Empty;
|
private string _Remark = string.Empty;
|
||||||
private long _Row = 0;
|
private long _Row = 0;
|
||||||
private string _UserName = string.Empty;
|
private string _UserName = string.Empty;
|
||||||
|
private string _Title = string.Empty;
|
||||||
public int _PageIndex = 0;
|
public int _PageIndex = 0;
|
||||||
public int _PageSize = 0;
|
public int _PageSize = 0;
|
||||||
|
|
||||||
@ -69,44 +68,7 @@ namespace Epost.Model
|
|||||||
_UserName = value;
|
_UserName = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public string ControlIP
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return _ControlIP;
|
|
||||||
}
|
|
||||||
|
|
||||||
set
|
|
||||||
{
|
|
||||||
_ControlIP = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public string ControlID
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return _ControlID;
|
|
||||||
}
|
|
||||||
|
|
||||||
set
|
|
||||||
{
|
|
||||||
_ControlID = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public string Address
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return _Address;
|
|
||||||
}
|
|
||||||
|
|
||||||
set
|
|
||||||
{
|
|
||||||
_Address = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public DateTime ErrorDate
|
public DateTime ErrorDate
|
||||||
{
|
{
|
||||||
@ -134,18 +96,6 @@ namespace Epost.Model
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public string BkAddress
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return _BkAddress;
|
|
||||||
}
|
|
||||||
|
|
||||||
set
|
|
||||||
{
|
|
||||||
_BkAddress = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public string Remark
|
public string Remark
|
||||||
{
|
{
|
||||||
@ -172,5 +122,7 @@ namespace Epost.Model
|
|||||||
_ID = value;
|
_ID = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public string Title { get => _Title; set => _Title = value; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -13,6 +13,8 @@ namespace Epost.Model
|
|||||||
|
|
||||||
private string _BatchId = string.Empty;
|
private string _BatchId = string.Empty;
|
||||||
private string _Tolocation = string.Empty;
|
private string _Tolocation = string.Empty;
|
||||||
|
private string _FromTolocation = string.Empty;
|
||||||
|
|
||||||
private string _Sku = string.Empty;
|
private string _Sku = string.Empty;
|
||||||
private string _GoodsName = string.Empty;
|
private string _GoodsName = string.Empty;
|
||||||
private string _Discount = string.Empty;//规格
|
private string _Discount = string.Empty;//规格
|
||||||
@ -74,6 +76,19 @@ namespace Epost.Model
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public string FromTolocation
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return _FromTolocation;
|
||||||
|
}
|
||||||
|
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_FromTolocation = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public string Sku
|
public string Sku
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
|
@ -9,10 +9,18 @@ namespace Epost.Model
|
|||||||
public class OrderModel
|
public class OrderModel
|
||||||
{
|
{
|
||||||
|
|
||||||
private string _OrderNO = string.Empty;
|
private string _wallNo = string.Empty;
|
||||||
private string _State = string.Empty;// 1亮灯 0灭灯
|
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 wallNo { get => _wallNo; set => _wallNo = value; }
|
||||||
public string State { get => _State; set => _State = 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; }
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -42,6 +42,7 @@ namespace Epost.TestToolsWeb.Controllers
|
|||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
ViewBag.isClear = isClear;
|
ViewBag.isClear = isClear;
|
||||||
ViewBag.isWork = isWork;
|
ViewBag.isWork = isWork;
|
||||||
return View();
|
return View();
|
||||||
|
@ -5,46 +5,311 @@ using System;
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Data;
|
using System.Data;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Net;
|
|
||||||
using System.Net.Http;
|
|
||||||
using System.Web.Http;
|
using System.Web.Http;
|
||||||
|
using LightContrl;
|
||||||
|
|
||||||
|
using Epost.DAL.Cache;
|
||||||
|
using System.Net;
|
||||||
|
using Microsoft.Owin.BuilderProperties;
|
||||||
|
|
||||||
namespace Epost.DPS.Controllers
|
namespace Epost.DPS.Controllers
|
||||||
{
|
{
|
||||||
[RoutePrefix("api/WebAPI")]
|
[RoutePrefix("api/WebAPI")]
|
||||||
public class ServerController : ApiController
|
public class ServerController : ApiController
|
||||||
{
|
{
|
||||||
|
AddressstorageBLL addrbll = new AddressstorageBLL();
|
||||||
|
LightControlCacheDAL cachedal = new LightControlCacheDAL();
|
||||||
private static object lockinit = new object();
|
private static object lockinit = new object();
|
||||||
|
|
||||||
|
|
||||||
OrderControlBLL contrbll = new OrderControlBLL();
|
OrderControlBLL contrbll = new OrderControlBLL();
|
||||||
|
|
||||||
//初始化
|
MainControl lig = new MainControl();
|
||||||
[Route("DISPLAYJOB")]
|
#region 连接
|
||||||
|
[Route("CONNECT")]
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
public ResultModel DISPLAYJOB(OrderModel model)
|
public ResultLightModel CONNECT([FromBody] List<reqmodel> data)
|
||||||
{
|
{
|
||||||
lock (lockinit)
|
ResultLightModel res = new ResultLightModel();
|
||||||
{
|
|
||||||
ResultModel res = new ResultModel();
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
LogHelper.WriteLogInfo(JsonHelper.SerializeObject(model));
|
LogHelper.WriteLogInfo("CONNECT请求" + JsonHelper.SerializeObject(data));
|
||||||
res.result = "0";
|
if (data.Any() && data.Count > 0)
|
||||||
res.msg = "成功!";
|
{
|
||||||
return res;
|
foreach (var item in data)
|
||||||
|
{
|
||||||
|
if (item.status == "1")//连接
|
||||||
|
{
|
||||||
|
DataTable dt = addrbll.QueryControlList(" ");
|
||||||
|
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)
|
||||||
|
{
|
||||||
|
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)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
LogHelper.WriteLogInfo("GetDataList异常:" + ex.Message);
|
LogHelper.WriteLogInfo(ex.ToString(), LogHelper.Log_Type.ERROR);
|
||||||
res.msg = "请求异常!";
|
res.resultMsg = "请求接口异常!";
|
||||||
res.result = "-1";
|
res.resultCode = "-1";
|
||||||
|
|
||||||
|
}
|
||||||
return res;
|
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(" ");
|
||||||
|
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 ResultLightModel DISPLAYJOB([FromBody] List<DisplayjobModelReq> data)
|
||||||
|
{
|
||||||
|
ResultLightModel res = new ResultLightModel();
|
||||||
|
try
|
||||||
|
{
|
||||||
|
LogHelper.WriteLogInfo("DISPLAYJOB请求" + JsonHelper.SerializeObject(data));
|
||||||
|
if (data.Any() && data.Count > 0)
|
||||||
|
{
|
||||||
|
foreach (DisplayjobModelReq item in data)
|
||||||
|
{
|
||||||
|
//根据播种墙号查询灯带IP
|
||||||
|
DataTable dt = addrbll.QueryControlList("");
|
||||||
|
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 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("播种墙号错误!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
LogHelper.WriteLogInfo(ex.ToString(), LogHelper.Log_Type.ERROR);
|
||||||
|
res.resultMsg = "请求接口异常!";
|
||||||
|
res.resultCode = "-1";
|
||||||
|
|
||||||
|
}
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
//初始化
|
//初始化
|
||||||
[Route("ClearALL")]
|
[Route("ClearALL")]
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
@ -96,58 +361,6 @@ namespace Epost.DPS.Controllers
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#region 设备检测
|
|
||||||
[Route("TestStart")]
|
|
||||||
[HttpPost]
|
|
||||||
public ResultModel TestStart()
|
|
||||||
{
|
|
||||||
lock (lockinit)
|
|
||||||
{
|
|
||||||
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;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#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 停止作业
|
#region 停止作业
|
||||||
[Route("EndWork")]
|
[Route("EndWork")]
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
@ -163,10 +376,5 @@ namespace Epost.DPS.Controllers
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -61,6 +61,10 @@
|
|||||||
<SpecificVersion>False</SpecificVersion>
|
<SpecificVersion>False</SpecificVersion>
|
||||||
<HintPath>..\DLL\ExcelIntOut.dll</HintPath>
|
<HintPath>..\DLL\ExcelIntOut.dll</HintPath>
|
||||||
</Reference>
|
</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">
|
<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>
|
<HintPath>..\packages\Microsoft.ApplicationInsights.Agent.Intercept.1.2.1\lib\net45\Microsoft.AI.Agent.Intercept.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
|
@ -10,8 +10,8 @@
|
|||||||
<WebStackScaffolding_LayoutPageFile>~/Views/Shared/_EpostLayoutPage.cshtml</WebStackScaffolding_LayoutPageFile>
|
<WebStackScaffolding_LayoutPageFile>~/Views/Shared/_EpostLayoutPage.cshtml</WebStackScaffolding_LayoutPageFile>
|
||||||
<WebStackScaffolding_IsAsyncSelected>False</WebStackScaffolding_IsAsyncSelected>
|
<WebStackScaffolding_IsAsyncSelected>False</WebStackScaffolding_IsAsyncSelected>
|
||||||
<WebStackScaffolding_ViewDialogWidth>600</WebStackScaffolding_ViewDialogWidth>
|
<WebStackScaffolding_ViewDialogWidth>600</WebStackScaffolding_ViewDialogWidth>
|
||||||
<NameOfLastUsedPublishProfile>E:\WORK\代码管理\播种\T系列分支\Epost.TestToolsWeb\Properties\PublishProfiles\Toolsweb.pubxml</NameOfLastUsedPublishProfile>
|
<NameOfLastUsedPublishProfile>E:\WORK\代码管理\T系列\播种\Epost.TestToolsWeb\Properties\PublishProfiles\Toolsweb.pubxml</NameOfLastUsedPublishProfile>
|
||||||
<LastActiveSolutionConfig>Debug|Any CPU</LastActiveSolutionConfig>
|
<LastActiveSolutionConfig>Release|Any CPU</LastActiveSolutionConfig>
|
||||||
<Use64BitIISExpress />
|
<Use64BitIISExpress />
|
||||||
<IISExpressSSLPort />
|
<IISExpressSSLPort />
|
||||||
<IISExpressAnonymousAuthentication />
|
<IISExpressAnonymousAuthentication />
|
||||||
|
@ -28,8 +28,21 @@ 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();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -9,13 +9,13 @@
|
|||||||
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
|
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
|
||||||
<LastUsedPlatform>Any CPU</LastUsedPlatform>
|
<LastUsedPlatform>Any CPU</LastUsedPlatform>
|
||||||
<SiteUrlToLaunchAfterPublish />
|
<SiteUrlToLaunchAfterPublish />
|
||||||
<LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
|
<LaunchSiteAfterPublish>true</LaunchSiteAfterPublish>
|
||||||
<ExcludeApp_Data>False</ExcludeApp_Data>
|
<ExcludeApp_Data>false</ExcludeApp_Data>
|
||||||
<publishUrl>D:\驿传\T系列</publishUrl>
|
<publishUrl>D:\驿传\T系列\taitan_songjiang_dengdai</publishUrl>
|
||||||
<DeleteExistingFiles>True</DeleteExistingFiles>
|
<DeleteExistingFiles>true</DeleteExistingFiles>
|
||||||
<PrecompileBeforePublish>True</PrecompileBeforePublish>
|
<PrecompileBeforePublish>true</PrecompileBeforePublish>
|
||||||
<EnableUpdateable>True</EnableUpdateable>
|
<EnableUpdateable>true</EnableUpdateable>
|
||||||
<DebugSymbols>False</DebugSymbols>
|
<DebugSymbols>false</DebugSymbols>
|
||||||
<WDPMergeOption>DonotMerge</WDPMergeOption>
|
<WDPMergeOption>DonotMerge</WDPMergeOption>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
</Project>
|
</Project>
|
@ -6,8 +6,9 @@
|
|||||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TimeStampOfAssociatedLegacyPublishXmlFile />
|
<TimeStampOfAssociatedLegacyPublishXmlFile />
|
||||||
<_PublishTargetUrl>D:\驿传\T系列</_PublishTargetUrl>
|
<_PublishTargetUrl>D:\驿传\T系列\taitan_songjiang_dengdai</_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|2025-01-10T07:38:19.0722445Z;True|2024-12-27T16:58:01.4437668+08:00;True|2023-12-29T17:18:53.8690686+08:00;True|2023-12-26T15:40:46.3666722+08:00;True|2023-12-25T15:43:42.7553160+08:00;True|2023-12-15T15:23:23.0482897+08:00;True|2023-12-15T13:44:34.3203359+08:00;False|2023-12-15T13:42:34.6149508+08:00;True|2023-12-14T17:25:24.5353788+08:00;True|2023-11-30T19:07:23.8812051+08:00;True|2023-04-23T15:53:28.0062911+08:00;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>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<File Include="ApplicationInsights.config">
|
<File Include="ApplicationInsights.config">
|
||||||
@ -32,19 +33,19 @@
|
|||||||
<publishTime>04/04/2018 15:45:12</publishTime>
|
<publishTime>04/04/2018 15:45:12</publishTime>
|
||||||
</File>
|
</File>
|
||||||
<File Include="bin/App_global.asax.compiled">
|
<File Include="bin/App_global.asax.compiled">
|
||||||
<publishTime>07/15/2022 16:57:09</publishTime>
|
<publishTime>01/10/2025 15:44:50</publishTime>
|
||||||
</File>
|
</File>
|
||||||
<File Include="bin/App_global.asax.dll">
|
<File Include="bin/App_global.asax.dll">
|
||||||
<publishTime>07/15/2022 16:57:09</publishTime>
|
<publishTime>01/10/2025 15:44:50</publishTime>
|
||||||
</File>
|
</File>
|
||||||
<File Include="bin/BouncyCastle.Crypto.dll">
|
<File Include="bin/BouncyCastle.Crypto.dll">
|
||||||
<publishTime>02/24/2020 15:29:24</publishTime>
|
<publishTime>02/24/2020 15:29:24</publishTime>
|
||||||
</File>
|
</File>
|
||||||
<File Include="bin/Common.dll">
|
<File Include="bin/Common.dll">
|
||||||
<publishTime>07/15/2022 16:40:17</publishTime>
|
<publishTime>01/10/2025 15:37:54</publishTime>
|
||||||
</File>
|
</File>
|
||||||
<File Include="bin/Common.pdb">
|
<File Include="bin/Common.pdb">
|
||||||
<publishTime>07/15/2022 16:40:17</publishTime>
|
<publishTime>01/10/2025 15:37:54</publishTime>
|
||||||
</File>
|
</File>
|
||||||
<File Include="bin/ComposerSDK.dll">
|
<File Include="bin/ComposerSDK.dll">
|
||||||
<publishTime>04/29/2020 16:50:14</publishTime>
|
<publishTime>04/29/2020 16:50:14</publishTime>
|
||||||
@ -62,31 +63,31 @@
|
|||||||
<publishTime>10/23/2017 13:15:20</publishTime>
|
<publishTime>10/23/2017 13:15:20</publishTime>
|
||||||
</File>
|
</File>
|
||||||
<File Include="bin/Epost.BLL.dll">
|
<File Include="bin/Epost.BLL.dll">
|
||||||
<publishTime>07/15/2022 16:56:59</publishTime>
|
<publishTime>01/10/2025 15:44:40</publishTime>
|
||||||
</File>
|
</File>
|
||||||
<File Include="bin/Epost.BLL.pdb">
|
<File Include="bin/Epost.BLL.pdb">
|
||||||
<publishTime>07/15/2022 16:56:59</publishTime>
|
<publishTime>01/10/2025 15:44:40</publishTime>
|
||||||
</File>
|
</File>
|
||||||
<File Include="bin/Epost.BLL.XmlSerializers.dll">
|
<File Include="bin/Epost.BLL.XmlSerializers.dll">
|
||||||
<publishTime>08/26/2020 18:09:48</publishTime>
|
<publishTime>08/26/2020 18:09:48</publishTime>
|
||||||
</File>
|
</File>
|
||||||
<File Include="bin/Epost.DAL.dll">
|
<File Include="bin/Epost.DAL.dll">
|
||||||
<publishTime>07/15/2022 16:40:18</publishTime>
|
<publishTime>01/10/2025 15:37:54</publishTime>
|
||||||
</File>
|
</File>
|
||||||
<File Include="bin/Epost.DAL.pdb">
|
<File Include="bin/Epost.DAL.pdb">
|
||||||
<publishTime>07/15/2022 16:40:18</publishTime>
|
<publishTime>01/10/2025 15:37:54</publishTime>
|
||||||
</File>
|
</File>
|
||||||
<File Include="bin/Epost.DPS.dll">
|
<File Include="bin/Epost.DPS.dll">
|
||||||
<publishTime>07/15/2022 16:57:02</publishTime>
|
<publishTime>01/10/2025 15:44:42</publishTime>
|
||||||
</File>
|
</File>
|
||||||
<File Include="bin/Epost.DPS.pdb">
|
<File Include="bin/Epost.DPS.pdb">
|
||||||
<publishTime>07/15/2022 16:57:02</publishTime>
|
<publishTime>01/10/2025 15:44:42</publishTime>
|
||||||
</File>
|
</File>
|
||||||
<File Include="bin/Epost.Model.dll">
|
<File Include="bin/Epost.Model.dll">
|
||||||
<publishTime>07/14/2022 16:43:42</publishTime>
|
<publishTime>01/10/2025 15:37:53</publishTime>
|
||||||
</File>
|
</File>
|
||||||
<File Include="bin/Epost.Model.pdb">
|
<File Include="bin/Epost.Model.pdb">
|
||||||
<publishTime>07/14/2022 16:43:42</publishTime>
|
<publishTime>01/10/2025 15:37:53</publishTime>
|
||||||
</File>
|
</File>
|
||||||
<File Include="bin/Epost.TestToolsWeb.dll">
|
<File Include="bin/Epost.TestToolsWeb.dll">
|
||||||
<publishTime>09/06/2018 11:57:11</publishTime>
|
<publishTime>09/06/2018 11:57:11</publishTime>
|
||||||
@ -112,6 +113,12 @@
|
|||||||
<File Include="bin/ICSharpCode.SharpZipLib.pdb">
|
<File Include="bin/ICSharpCode.SharpZipLib.pdb">
|
||||||
<publishTime>08/09/2019 08:40:22</publishTime>
|
<publishTime>08/09/2019 08:40:22</publishTime>
|
||||||
</File>
|
</File>
|
||||||
|
<File Include="bin/LightContrl.dll">
|
||||||
|
<publishTime>12/27/2024 16:54:16</publishTime>
|
||||||
|
</File>
|
||||||
|
<File Include="bin/LightContrl.pdb">
|
||||||
|
<publishTime>12/27/2024 16:54:16</publishTime>
|
||||||
|
</File>
|
||||||
<File Include="bin/log4net.dll">
|
<File Include="bin/log4net.dll">
|
||||||
<publishTime>03/08/2017 19:26:22</publishTime>
|
<publishTime>03/08/2017 19:26:22</publishTime>
|
||||||
</File>
|
</File>
|
||||||
@ -5651,7 +5658,7 @@
|
|||||||
<publishTime>05/30/2022 16:58:47</publishTime>
|
<publishTime>05/30/2022 16:58:47</publishTime>
|
||||||
</File>
|
</File>
|
||||||
<File Include="PrecompiledApp.config">
|
<File Include="PrecompiledApp.config">
|
||||||
<publishTime>07/15/2022 16:57:03</publishTime>
|
<publishTime>01/10/2025 15:44:44</publishTime>
|
||||||
</File>
|
</File>
|
||||||
<File Include="Scripts/ai.0.22.9-build00167.js">
|
<File Include="Scripts/ai.0.22.9-build00167.js">
|
||||||
<publishTime>04/04/2018 15:45:12</publishTime>
|
<publishTime>04/04/2018 15:45:12</publishTime>
|
||||||
@ -7571,7 +7578,7 @@
|
|||||||
<publishTime>07/04/2022 14:22:38</publishTime>
|
<publishTime>07/04/2022 14:22:38</publishTime>
|
||||||
</File>
|
</File>
|
||||||
<File Include="Web.config">
|
<File Include="Web.config">
|
||||||
<publishTime>07/12/2022 15:10:39</publishTime>
|
<publishTime>01/10/2025 15:38:00</publishTime>
|
||||||
</File>
|
</File>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
@ -11,7 +11,7 @@
|
|||||||
</configSections>
|
</configSections>
|
||||||
<connectionStrings>
|
<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="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=.;user id=sa;password=123456;database=taitan_dengdai_songjiang;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="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" />
|
<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" />
|
||||||
@ -33,6 +33,8 @@
|
|||||||
<add key="CARID" value="HT01" />
|
<add key="CARID" value="HT01" />
|
||||||
<add key="ServerAPIURL" value="http://192.168.3.65:8051/api/WebAPI" />
|
<add key="ServerAPIURL" value="http://192.168.3.65:8051/api/WebAPI" />
|
||||||
<add key="SleepTime" value="1" />
|
<add key="SleepTime" value="1" />
|
||||||
|
|
||||||
|
|
||||||
</appSettings>
|
</appSettings>
|
||||||
<!--
|
<!--
|
||||||
有关 web.config 更改的说明,请参见 http://go.microsoft.com/fwlink/?LinkId=235367。
|
有关 web.config 更改的说明,请参见 http://go.microsoft.com/fwlink/?LinkId=235367。
|
||||||
@ -55,6 +57,18 @@
|
|||||||
<sessionState mode="InProc" timeout="518400" />
|
<sessionState mode="InProc" timeout="518400" />
|
||||||
</system.web>
|
</system.web>
|
||||||
<system.webServer>
|
<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>
|
<modules>
|
||||||
<remove name="FormsAuthentication" />
|
<remove name="FormsAuthentication" />
|
||||||
<remove name="ApplicationInsightsWebTracking" />
|
<remove name="ApplicationInsightsWebTracking" />
|
||||||
@ -162,20 +176,7 @@
|
|||||||
<loggerToMatch value="System_Log" />
|
<loggerToMatch value="System_Log" />
|
||||||
</filter>
|
</filter>
|
||||||
<filter type="log4net.Filter.DenyAllFilter" />
|
<filter type="log4net.Filter.DenyAllFilter" />
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</appender>
|
</appender>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<appender name="SystemLogAppender_LightUp" type="log4net.Appender.RollingFileAppender">
|
<appender name="SystemLogAppender_LightUp" type="log4net.Appender.RollingFileAppender">
|
||||||
<file value="Log/System_Log/" />
|
<file value="Log/System_Log/" />
|
||||||
<appendToFile value="true" />
|
<appendToFile value="true" />
|
||||||
|
Reference in New Issue
Block a user