This commit is contained in:
jl
2024-01-04 15:30:23 +08:00
parent 40557a235e
commit 36a20b88ce
10 changed files with 316 additions and 286 deletions

View File

@ -36,53 +36,50 @@ namespace Epost.BLL
public ResultModel Initialization_M(bool isback = true) public ResultModel Initialization_M(bool isback = true)
{ {
ResultModel resultModel = new ResultModel(); ResultModel resultModel = new ResultModel();
resultModel.result = "0";
resultModel.msg = "成功";
List<LabelParamModel> list = new List<LabelParamModel>(); List<LabelParamModel> list = new List<LabelParamModel>();
try try
{ {
DataTable dt = addrBLL.QueryControlList(""); 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)
{ {
LabelParamModel model = new LabelParamModel();
model.ControlIP = item["ControlIP"].ToString();
model.Address = "9999";
model.Command = "FORMAT_JOB_DATA";
model.Parameter = "50";
model.Timeout = "0.5";
list.Add(model);
model = new LabelParamModel();
model.ControlIP = item["ControlIP"].ToString();
model.Address = "9999";
model.Command = "CONNECT";
model.Parameter = IP;
model.Timeout = "0.5";
list.Add(model);
model = new LabelParamModel();
model.ControlIP = item["ControlIP"].ToString();
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.Command = "UNLOCK";
model.Timeout = "0.5";
list.Add(model);
}
string ipaddress = item["controlip"].ToString().Trim(); if (list.Any())
List<LightcontrolModel> conlist = cachedal.GetControlList().FindAll(o => o.controlip == ipaddress); {
if (conlist != null && conlist.Count > 0) resultModel = SendALL_Init(list);
{
LogHelper.WriteLogInfo(ipaddress + "已连接!");
}
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);
}
else
{
LogHelper.WriteLogInfo("连接失败" + ipaddress);
resultModel.result = "-1";
resultModel.msg = "连接失败" + ipaddress;
return resultModel;
}
}
} }
} }
return resultModel; return resultModel;
} }
@ -96,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
@ -513,35 +576,32 @@ namespace Epost.BLL
#region #region
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)
// {
// LabelParamModel model = new LabelParamModel();
// model.ControlIP = item["ControlIP"].ToString();
// FORMATE_JOB_DATA(model);
// }
//}
List<LightcontrolModel> conlist = cachedal.GetControlList();
if (conlist.Any() && conlist.Count > 0)
{ {
Ledonoff_dengdai("0",""); foreach (DataRow item in dt.Rows)
Thread.Sleep(500);
foreach (LightcontrolModel con in conlist)
{ {
bool b = con.maincontrol.DisConnect(con.controlip, con.port);
LogHelper.WriteLogInfo(b + "断开连接" + con.controlip + "==" + con.port); LabelParamModel model = new LabelParamModel();
model.ControlIP = item["ControlIP"].ToString();
FORMATE_JOB_DATA(model);
LED_OFF_CLEAR(item["ControlIP"].ToString());
} }
} }
cachedal.ClearControlList(); //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

View File

@ -12,9 +12,10 @@ using static Epost.DAL.Enum.SqlLogType;
namespace Epost.BLL 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);
}
} }
} }

View File

@ -375,10 +375,10 @@ namespace Epost.BLL
#endregion #endregion
#region #region
public void UpdateOrderState_Car(string matchid,string fromlocation,string oprationstate) public void UpdateOrderState_Car(string matchid,string tolocation, string oprationstate)
{ {
dal.UpdateWorkState_Car(matchid, fromlocation, oprationstate); dal.UpdateWorkState_Car(matchid, tolocation, oprationstate);
@ -719,6 +719,9 @@ namespace Epost.BLL
demodel.Tolocation = item["fromlocation"].ToString(); demodel.Tolocation = item["fromlocation"].ToString();
demodel.Sku = item["sku"].ToString(); demodel.Sku = item["sku"].ToString();
demodel.Matchid = matchid; demodel.Matchid = matchid;
demodel.FromTolocation = item["tolocation"].ToString();
demodel.ControlIP = item["ControlIP"].ToString();
demodel.Address = item["Address"].ToString();
#region #region
demodel.Block = item["Block"].ToString(); demodel.Block = item["Block"].ToString();
demodel.Area = item["Area"].ToString(); demodel.Area = item["Area"].ToString();
@ -730,7 +733,7 @@ namespace Epost.BLL
//修改数据为已读 //修改数据为已读
// 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.Tolocation, "1"); UpdateOrderState_Car(matchid, demodel.FromTolocation, "1");
#endregion #endregion
} }
} }

View File

@ -29,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();
@ -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(); //加载任务显示器信息
@ -564,19 +564,27 @@ namespace Epost.BLL
{ {
#region #region
//先熄灭 //先熄灭
comBLL.Ledonoff_dengdai("0", ""); //comBLL.Ledonoff_dengdai("0", "");
//Thread.Sleep(100);
//comBLL.display_dengdai(item.Tolocation, "2");
comBLL.LED_OFF_CLEAR(item.ControlIP);
Thread.Sleep(100); Thread.Sleep(100);
comBLL.display_dengdai(item.Tolocation, "2"); LabelParamModel lamodel = new LabelParamModel();
lamodel.Address = item.Address;
lamodel.ControlIP = item.ControlIP;
lamodel.Parameter = "40000001";
comBLL.LED_ON_M(lamodel);
#endregion #endregion
item.State = 3; item.State = 3;
item.DisplayTime = DateTime.Now; item.DisplayTime = DateTime.Now;
#region #region
orderbll.UpdateOrderState_Car(item.Matchid, item.Tolocation, "3"); orderbll.UpdateOrderState_Car(item.Matchid, item.FromTolocation, "3");
model.State = 3; model.State = 3;
bool allfinish = orderbll.IsFinishWorkByCar(1, item.Matchid); bool allfinish = orderbll.IsFinishWorkByCar(1, item.Matchid);
if (allfinish)//判断整个波次是否已完成 if (allfinish)//判断整个波次是否已完成
{ //更新state状态为已完成 { //更新state状态为已完成
orderbll.UpdateStateByCar(item.Matchid); // orderbll.UpdateStateByCar(item.Matchid);
// comBLL.Ledonoff_dengdai("0", "");
//删除波次信息 //删除波次信息
List<UserCodeModel> ulist = UserCacheDAL.GetUserCodeList(); List<UserCodeModel> ulist = UserCacheDAL.GetUserCodeList();
UserCacheDAL.UpdateUserCodeList(ulist, EUserCommend.Execute); UserCacheDAL.UpdateUserCodeList(ulist, EUserCommend.Execute);
@ -621,11 +629,11 @@ 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") //扫描分播墙号 if (scanStr.Substring(0, 1) == "S"&&scanStr.Length==3) //扫描分播墙号
{ {
UserCodeModel umodel = new UserCodeModel(); UserCodeModel umodel = new UserCodeModel();
umodel.Matchid = data.Parameter;//分播墙号 umodel.Matchid = data.Parameter;//分播墙号
@ -634,10 +642,12 @@ namespace Epost.BLL
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); LogHelper.WriteLogInfo("扫描播种墙号" + data.Parameter);
logBLL.SaveShowMesError("请扫描物料开始分播", "请扫描物料开始分播");
} }
else else
{ {
LogHelper.WriteLogInfo(scanStr + "请扫描正确的播种墙号"); LogHelper.WriteLogInfo(scanStr + "请扫描正确的播种墙号");
logBLL.SaveShowMesError("请扫描正确的播种墙号", "请扫描正确的播种墙号");
} }
downCacheDAL.UpdateJobDownModelList(new List<ResultMessageModel> { data }, EdownCommend.Execute); downCacheDAL.UpdateJobDownModelList(new List<ResultMessageModel> { data }, EdownCommend.Execute);
} }
@ -792,150 +802,99 @@ 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())
if (scanStr.Substring(0, 1) == "U")
{ {
#region UserCodeModel umodel = ulist.FirstOrDefault();
if (ulist.Any()) if (scanStr.Substring(0, 1) == "U")
{ {
UserCodeModel umodel = ulist.FirstOrDefault();
umodel.UserCode = scanStr;
#region #region
ShowMessageModel_M show = new ShowMessageModel_M(); umodel.UserCode = scanStr;
show.Title = "请扫描sku开始作业"; downCacheDAL.UpdateJobDownModelList(new List<ResultMessageModel> { data }, EdownCommend.Execute);
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 #endregion
} }
downCacheDAL.UpdateJobDownModelList(new List<ResultMessageModel> { data }, EdownCommend.Execute); else if (scanStr.Substring(0, 1) == "S" && scanStr.Length == 3) //扫描分播墙号
#endregion
}
else
{
#region
List<ResultMessageModel> hangList = downCacheDAL.GetPlanJobDownList().FindAll(m => m.Parameter == "888888");
if (hangList.Any())
{ {
umodel.Matchid = scanStr;
#region downCacheDAL.UpdateJobDownModelList(new List<ResultMessageModel> { data }, EdownCommend.Execute);
LogHelper.WriteLogInfo("挂起" + data.Parameter + "-------通道" + data.Block);
LabelParamModel FORMATEModel = new LabelParamModel();
FORMATEModel.ControlIP = data.IP;
comBLL.FORMATE_JOB_DATA(FORMATEModel);
DataTable qdt = queueBLL.getQueuesOrderbyState(data.Block, data.Area, "1");
if (qdt != null && qdt.Rows.Count > 0)
{
scanStr = qdt.Rows[0]["sku"].ToString();
// data.Parameter = scanStr;
Hangup_SKU(scanStr, data.Block, data.Area);
//删除sku对应缓存
List<ResultMessageModel> sdown = downCacheDAL.GetPlanJobDownList().FindAll(p => p.Parameter == scanStr || p.Parameter == qdt.Rows[0]["location"].ToString());
downCacheDAL.UpdateJobDownModelList(sdown, EdownCommend.Execute);
}
downCacheDAL.UpdateJobDownModelList(hangList, EdownCommend.Execute);
//刷新波次
GetMatchOrder();
#endregion
} }
else if (isnum)//sku else
{ {
#region SKU
//根据扫描商品内码获取商品码
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");
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)) #region
{ //重复扫描 List<ResultMessageModel> hangList = downCacheDAL.GetPlanJobDownList().FindAll(m => m.Parameter == "888888");
//ShowMessageModel_M show = new ShowMessageModel_M(); if (hangList.Any())
//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);
}
else
{ {
DataTable OrderDt = orderbll.GetOrderList_Car(matchid, scanStr, data.Area, data.Block); #region
if (OrderDt != null && OrderDt.Rows.Count > 0) LogHelper.WriteLogInfo("挂起" + data.Parameter + "-------通道" + data.Block);
LabelParamModel FORMATEModel = new LabelParamModel();
FORMATEModel.ControlIP = data.IP;
comBLL.FORMATE_JOB_DATA(FORMATEModel);
DataTable qdt = queueBLL.getQueuesOrderbyState(data.Block, data.Area, "1");
if (qdt != null && qdt.Rows.Count > 0)
{ {
scanStr = qdt.Rows[0]["sku"].ToString();
if (ulist.Any()) // data.Parameter = scanStr;
{ Hangup_SKU(scanStr, data.Block, data.Area);
UserCodeModel umodel = ulist.FirstOrDefault(); //删除sku对应缓存
OrdersQueueModel qmodel = new OrdersQueueModel(); List<ResultMessageModel> sdown = downCacheDAL.GetPlanJobDownList().FindAll(p => p.Parameter == scanStr || p.Parameter == qdt.Rows[0]["location"].ToString());
qmodel.Sku = scanStr; downCacheDAL.UpdateJobDownModelList(sdown, EdownCommend.Execute);
qmodel.Taskblock = data.Block; }
qmodel.Taskarea = data.Area; downCacheDAL.UpdateJobDownModelList(hangList, EdownCommend.Execute);
qmodel.UserCode = umodel.UserCode; //刷新波次
qmodel.Matchid = umodel.Matchid; GetMatchOrder();
qmodel.Location = scanStr; #endregion
qmodel.Lightcolor = EnumHelper.EMToDescriptionString(LightColor.Color.Red);
queueBLL.insertQueueOrders(qmodel);
//提示需要拣货总量/商品名称
//showSummaryMes(scanStr, data.Block, data.Area, 1, data, "", OrderDt.Rows[0]["matchid"].ToString());
} }
else else if (isnum)//sku
{ {
LogHelper.WriteLogInfo("未扫描波次信息", LogHelper.Log_Type.ERROR); #region SKU
} //根据扫描商品内码获取商品码
data.ScanCode = data.Parameter;
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);
if (scanlist.Count > 1 || (skudt != null && skudt.Rows.Count > 0))
{
downCacheDAL.UpdateJobDownModelList(new List<ResultMessageModel> { data }, EdownCommend.Execute);
} }
else else
{ {
DataTable OrderDt = orderbll.GetOrderList_Car(matchid, scanStr, data.Area, data.Block);
if (OrderDt != null && OrderDt.Rows.Count > 0)
{
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 = scanStr;
qmodel.Lightcolor = EnumHelper.EMToDescriptionString(LightColor.Color.Red);
queueBLL.insertQueueOrders(qmodel);
}
else
{
logBLL.SaveShowMesError("扫描:" + scanStr + "无任务!", "扫描:" + scanStr + "无任务!");
downCacheDAL.UpdateJobDownModelList(new List<ResultMessageModel> { data }, EdownCommend.Execute);
//提示无任务 }
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);
} }
#endregion
} }
#endregion #endregion
} }
#endregion
} }
} }
#endregion #endregion

View File

@ -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"))
//{ //{

View File

@ -10,24 +10,21 @@ using static Epost.DAL.Enum.SqlLogType;
namespace Epost.DAL 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);
}
} }
} }

View File

@ -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 distinct fromlocation,sku,block,area from v_orders where state = 0 and oprationstate <>3 and (sku = '{0}' or fromlocation='{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 distinct fromlocation,block,area from v_orders where state = 0 and oprationstate <>3 (and sku = '{0}'or fromlocation='{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,17 +622,17 @@ namespace Epost.DAL
#endregion #endregion
#region #region
public bool UpdateWorkState_Car(string matchid,string fromlocation,string oprationstate ) public bool UpdateWorkState_Car(string matchid,string tolocation, string oprationstate )
{ {
try try
{ {
lock (uplock) lock (uplock)
{ {
string upsql = string.Format("update orders set oprationstate = '{0}' ,oprationtime='{1}' ,truequantity=quantity where matchid='{2}' and fromlocation='{3}' ", string upsql = string.Format("update orders set oprationstate = '{0}' ,oprationtime='{1}' ,truequantity=quantity where matchid='{2}' and tolocation='{3}' ",
oprationstate, oprationstate,
DateTime.Now.ToString(), DateTime.Now.ToString(),
matchid, matchid,
fromlocation tolocation
); );
long x = db.UpdateSql(upsql); long x = db.UpdateSql(upsql);
if (x > 0) if (x > 0)

View File

@ -6,18 +6,17 @@ using System.Threading.Tasks;
namespace Epost.Model 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; }
} }
} }

View File

@ -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

View File

@ -7,7 +7,7 @@
<PropertyGroup> <PropertyGroup>
<TimeStampOfAssociatedLegacyPublishXmlFile /> <TimeStampOfAssociatedLegacyPublishXmlFile />
<_PublishTargetUrl>D:\驿传\T系列\taitan_songjiang_dengdai</_PublishTargetUrl> <_PublishTargetUrl>D:\驿传\T系列\taitan_songjiang_dengdai</_PublishTargetUrl>
<History>True|2023-11-30T11:07:23.8812051Z;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> <History>True|2023-12-29T09:18:53.8690686Z;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 /> <LastFailureDetails />
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
@ -33,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>11/30/2023 19:14:26</publishTime> <publishTime>12/29/2023 17:18:49</publishTime>
</File> </File>
<File Include="bin/App_global.asax.dll"> <File Include="bin/App_global.asax.dll">
<publishTime>11/30/2023 19:14:26</publishTime> <publishTime>12/29/2023 17:18:49</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>11/30/2023 19:07:11</publishTime> <publishTime>12/29/2023 17:18:37</publishTime>
</File> </File>
<File Include="bin/Common.pdb"> <File Include="bin/Common.pdb">
<publishTime>11/30/2023 19:07:11</publishTime> <publishTime>12/29/2023 17:18:37</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>
@ -63,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>11/30/2023 19:07:11</publishTime> <publishTime>12/29/2023 17:18:38</publishTime>
</File> </File>
<File Include="bin/Epost.BLL.pdb"> <File Include="bin/Epost.BLL.pdb">
<publishTime>11/30/2023 19:07:11</publishTime> <publishTime>12/29/2023 17:18:38</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>11/30/2023 19:07:11</publishTime> <publishTime>12/29/2023 17:18:38</publishTime>
</File> </File>
<File Include="bin/Epost.DAL.pdb"> <File Include="bin/Epost.DAL.pdb">
<publishTime>11/30/2023 19:07:11</publishTime> <publishTime>12/29/2023 17:18:38</publishTime>
</File> </File>
<File Include="bin/Epost.DPS.dll"> <File Include="bin/Epost.DPS.dll">
<publishTime>11/30/2023 19:14:06</publishTime> <publishTime>12/29/2023 17:18:41</publishTime>
</File> </File>
<File Include="bin/Epost.DPS.pdb"> <File Include="bin/Epost.DPS.pdb">
<publishTime>11/30/2023 19:14:06</publishTime> <publishTime>12/29/2023 17:18:41</publishTime>
</File> </File>
<File Include="bin/Epost.Model.dll"> <File Include="bin/Epost.Model.dll">
<publishTime>11/30/2023 19:07:11</publishTime> <publishTime>12/15/2023 16:56:36</publishTime>
</File> </File>
<File Include="bin/Epost.Model.pdb"> <File Include="bin/Epost.Model.pdb">
<publishTime>11/30/2023 19:07:11</publishTime> <publishTime>12/15/2023 16:56:36</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>
@ -5658,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>11/30/2023 19:14:22</publishTime> <publishTime>12/29/2023 17:18: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>