6 Commits

Author SHA1 Message Date
jl
7c1ab8ce69 2024-09-05 13:36:12 +08:00
jl
d5e45f63b4 2024-09-02 16:42:28 +08:00
jl
406c7a9733 2023-04-21 17:29:50 +08:00
jl
ba8edecb11 Merge branch 'master' of https://e.coding.net/antion-01/T_DAS_PTL/T-DAS 2023-04-19 15:22:10 +08:00
jl
9019532c9f 2023-04-19 15:21:58 +08:00
2436a3805b 2023-04-16 15:14:57 +08:00
24 changed files with 2297 additions and 1777 deletions

Binary file not shown.

Binary file not shown.

View File

@ -182,10 +182,18 @@ namespace Epost.BLL
return dal.GetAreaList();
}
#endregion
#region
public List<AddressstorageModel> GetAreaList(string block = "")
public List<AddressstorageModel> GetAreaList(string block = "", string shelfid = "")
{
return dal.GetAreaList(block);
return dal.GetAreaList(block, shelfid);
}
#endregion
#region
public List<AddressstorageModel> GetshelfidList(string block = "")
{
return dal.GetshelfidList(block);
}
#endregion
#region
@ -374,25 +382,5 @@ namespace Epost.BLL
return dal.GetAddressListByByPage(strWhere, orderby, startIndex, endIndex, out recordCount);
}
#endregion
#region
#region
public DataTable QueryAddrList(string strwhere)
{
return dal.QueryAddrList(strwhere);
}
#endregion
#region
public DataTable QueryControlList(string strwhere)
{
return dal.QueryControlList(strwhere);
}
#endregion
#endregion
}
}

View File

@ -19,13 +19,11 @@ namespace Epost.BLL
public class CommandBLL
{
CommandDAL dal = new CommandDAL();
XgateCacheDAL xageDAL = new XgateCacheDAL();
AddressstorageBLL addrBLL = new AddressstorageBLL();
public static DataTable Controls = new DataTable();
public static DataTable Labels = new DataTable();
JobDownCacheDAL JobCache = new JobDownCacheDAL();
OrdersDAL orderDal = new OrdersDAL();
ConfigurationOperator txtbll = new ConfigurationOperator();
string IP = ConfigurationManager.AppSettings["WebAPIUrl"];
#region
@ -151,23 +149,7 @@ namespace Epost.BLL
}
}
#endregion
#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)
{
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;
}
#endregion
#region
public string GETDISPLAYJOBPAR(string no, string Lightcolor, string IsTwinkle, string location, string Quantity, string Rfcode)
{
string parar = no + Lightcolor + IsTwinkle + "30NQ" + location + "\n" + Quantity + "\n" + Rfcode + "\n";
return parar;
}
#endregion
#endregion
#region
public void clearALL_M()
@ -188,10 +170,7 @@ namespace Epost.BLL
}
#endregion
#region M系列
#endregion
#region
public bool FORMATE_JOB_DATA(LabelParamModel model)
@ -214,37 +193,6 @@ namespace Epost.BLL
}
#endregion
#region
public bool ENTER_CONFIG_MODE(LabelParamModel model)
{
return dal.ENTER_CONFIG_MODE(model);
}
#endregion
#region
public bool SET_ADDRESS(LabelParamModel model)
{
return dal.SET_ADDRESS(model);
}
#endregion
#region
public bool DELETE_ADDRESS(LabelParamModel model)
{
return dal.DELETE_ADDRESS(model);
}
#endregion
#region 退
public bool EXIT_CONFIG_MODE(LabelParamModel model)
{
return dal.EXIT_CONFIG_MODE(model);
}
#endregion
#region ()
public void DISPLAY_JOB_M(LabelParamModel model, bool clear = false, bool islock = false )
{
@ -307,7 +255,6 @@ namespace Epost.BLL
}
#endregion
#region ()
public void LED_ON_M(LabelParamModel model, bool islock = false)
{
@ -353,6 +300,7 @@ namespace Epost.BLL
dal.DISPLAY_JOBALL(list);
}
#endregion
#region LED_OFF()
public void LED_OFF_M(List<JobModel> list)
{
@ -371,8 +319,6 @@ namespace Epost.BLL
}
#endregion
#region LED_OFF()
public void LED_OFF_CLEAR(string ip)
{
@ -385,6 +331,7 @@ namespace Epost.BLL
dal.Send(clearModel);
}
#endregion
#region LED_OFF()
public void LED_OFF_CLEAR(List<JobModel> offList)
{
@ -407,7 +354,6 @@ namespace Epost.BLL
dal.SendALL(list);
}
#endregion
#region ()
public bool DISPLAY_JOB(LabelParamModel model)
@ -424,6 +370,7 @@ namespace Epost.BLL
dal.DISPLAY_JOBALL(model);
}
#endregion
#region
public ResultModel SendALL_Init(List<LabelParamModel> model)
{
@ -439,6 +386,7 @@ namespace Epost.BLL
return dal.REMOVE_JOB(model);
}
#endregion
#region
public bool DISPLAY_LIGHT(LabelParamModel model)
{
@ -455,8 +403,6 @@ namespace Epost.BLL
}
#endregion
#region
public bool UNLOCK(LabelParamModel model)
{
@ -465,30 +411,6 @@ namespace Epost.BLL
}
#endregion
#region 使
public bool SET_SCANDEVICE_ON(LabelParamModel model)
{
return dal.SET_SCANDEVICE_ON(model);
}
#endregion
#region 使
public bool SET_SCANDEVICE_OFF(LabelParamModel model)
{
return dal.SET_SCANDEVICE_OFF(model);
}
#endregion
#region
public bool SET_SCANDEVICE_CLEAR(LabelParamModel model)
{
return dal.SET_SCANDEVICE_CLEAR(model);
}
#endregion
#region
public bool SLEEP(LabelParamModel model)
{
@ -612,6 +534,7 @@ namespace Epost.BLL
}
#endregion
#region
public void ShowBoxMessage_M(ShowMessageModel_M show)
{
@ -715,7 +638,15 @@ namespace Epost.BLL
LabelParamModel model = new LabelParamModel();
model.Address = addritem["address"].ToString();
model.ControlIP = addritem["controlip"].ToString();
model.Parameter =show.No;
model.Parameter =show.No;
model.Uid = show.Uid;
if (string.IsNullOrEmpty(show.Uid))
{ model.Uid = addritem["address"].ToString(); }
model.Type = "N";
if (addritem["addresstype"].ToString() == "2")
{
model.Type = "C";
}
model.Command = "REMOVE_JOB";
model.Timeout = "0.5";
list.Add(model);
@ -734,7 +665,7 @@ namespace Epost.BLL
#endregion
#endregion

View File

@ -115,6 +115,9 @@
<Compile Include="UserBLL.cs" />
<Compile Include="WmsBLL.cs" />
<Compile Include="WmsTaskBLL.cs" />
<Compile Include="Work_DisplayJobThread.cs" />
<Compile Include="Work_JobDownThread.cs" />
<Compile Include="Work_ScanThread.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Common\Epost.Common.csproj">

View File

@ -30,44 +30,7 @@ namespace Epost.BLL
UserModelCacheDAL UserCacheDAL = new UserModelCacheDAL();
private static object lockbox = new object();
#region
public void BindBoxCode()
{
lock (lockbox)
{
try
{
//查询待绑定的订单/设备
DataTable qudt = queueboxBLL.getQueuesbyState();
if (qudt != null && qudt.Rows.Count > 0)
{
foreach (DataRow item in qudt.Rows)
{
LabelParamModel model = new LabelParamModel();
string address = item["address"].ToString();
model.Address = address;
model.ControlIP = item["controlip"].ToString();
// model.Parameter = "0100000100030CQ请扫描箱号/托盘号\n\n\n\n\n\n门店编号" + item["shopid"].ToString() + "\n\n\n\n";
model.Parameter = comBLL.GETDISPLAYJOBPAR_CN("01", "001000", "0", "请扫描箱号/托盘号", "", "", "", "", "门店编号:" + item["shopid"].ToString(), "");
comBLL.DISPLAY_JOB_M(model, true, true);
queueboxBLL.UpdateQueueState(item["id"].ToString(), "1");
}
}
//点亮设备
}
catch (Exception ex)
{
LogHelper.WriteLogInfo("绑定箱号异常:" + ex.Message);
}
}
}
#endregion
#region
public DataTable getControlList(int type = 0)
@ -499,27 +462,14 @@ namespace Epost.BLL
//点亮当前货位对应设备提示扫箱号
LabelParamModel model = new LabelParamModel();
model.Address = address;
model.ControlIP = controlip;
// model.Parameter = "0700000100330CQ请扫描箱号!\n\n\n\n\n\n\n\n\n\n";
model.Parameter = comBLL.GETDISPLAYJOBPAR_CN("07", "000100", "3", "请扫描箱号!", "", "", "", "", "门店号:" + shopid + "\r箱 号:" + boxcode + "\r托盘号:" + traycode, "");
model.ControlIP = controlip;
// model.Parameter = comBLL.GETDISPLAYJOBPAR_CN("07", "000100", "3", "请扫描箱号!", "", "", "", "", "门店号:" + shopid + "\r箱 号:" + boxcode + "\r托盘号:" + traycode, "");
comBLL.DISPLAY_JOB_M(model, true, true);
}
#endregion
#region
public void changeNumErr(string address, string controlip)
{
//点亮当前货位对应设备提示扫箱号
LabelParamModel model = new LabelParamModel();
model.Address = address;
model.ControlIP = controlip;
model.Parameter = comBLL.GETDISPLAYJOBPAR_CN("05", "000100", "3", "修改数量超出需求数量!", "", "", "", "", "", "");
comBLL.DISPLAY_JOB_M(model, true, false);
}
#endregion
#region
public void displayJob_err(string address, string controlip, JobModel job)
@ -530,15 +480,9 @@ namespace Epost.BLL
lamodel.ControlIP = controlip;
lamodel.Command = "DISPLAY_JOB";
string qty = ConvertHexHelper.ConvertString(job.Quantity.ToString(), 10, 16); //拣货数量
string CheckQuantity = ConvertHexHelper.ConvertString(job.CheckQuantity.ToString(), 10, 16); //拣货数量
// lamodel.Parameter = "01" + EnumHelper.EMToDescriptionString(LightColor.Color.Green) + "030NQ" +item.Zone +"\n" + qty;
//lamodel.Parameter = "0100" + queueDT.Rows[0]["lightcolor"].ToString() + "030CQ" + item.GoodsName + "\n\n" + CheckQuantity + "\n" + item.WholeUnit + "\n" + qty + "\n" + item.Unit + "\n" + item.Sku + "\n\n\n\n";
lamodel.Parameter = comBLL.GETDISPLAYJOBPAR_CN("01", job.ColorCode, "0", job.GoodsName, CheckQuantity, job.WholeUnit, qty, job.Unit, job.Sku, job.UserCode);//item.UserCode
string CheckQuantity = ConvertHexHelper.ConvertString(job.CheckQuantity.ToString(), 10, 16); //拣货数量
// lamodel.Parameter = comBLL.GETDISPLAYJOBPAR_CN("01", job.ColorCode, "0", job.GoodsName, CheckQuantity, job.WholeUnit, qty, job.Unit, job.Sku, job.UserCode);//item.UserCode
comBLL.DISPLAY_JOB_M(lamodel, true, false);
}
#endregion
public void BindJobListBySku(string sku)
@ -556,13 +500,11 @@ namespace Epost.BLL
LocCacheDAL.UpdateLocModelList(new List<OrderListModel> { data }, ELCommend.Update);
}
}
}
catch (Exception ex)
{
LogHelper.WriteLogInfo("绑定任务异常:" + ex.Message);
}
}
public bool bindOrder(string sku, string block, string matchid = "", string usercode = "", string area = "", int sort = 0, string lightColor = "010000")
{
@ -581,8 +523,6 @@ namespace Epost.BLL
bool qubo = queueBLL.insertQueueOrders(unmodel);
return qubo;
}
public void bindShop(string shopcode, string usercode, List<ResultMessageModel> list, ResultMessageModel data)
{
@ -984,9 +924,9 @@ namespace Epost.BLL
return dal.getOrderListBysku(block, sku);
}
public bool UpOrderStateBybat(string batchid)
public bool UpOrderStateBybat(string id)
{
return dal.UpOrderStateBybat(batchid);
return dal.UpOrderStateBybat(id);
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,244 @@
using Epost.Common;
using Epost.DAL.Cache;
using Epost.DAL.Enum;
using Epost.Model;
using Epost.Model.resource;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Threading;
namespace Epost.BLL
{
public class Work_DisplayJobThread
{
public string tblock, id;
public bool OrisShow = false;
OrderBLL orderbll = new OrderBLL();
OrdersQueueBLL queueBLL = new OrdersQueueBLL();
CommandBLL comBLL = new CommandBLL();
JobModelCacheDAL JobCache = new JobModelCacheDAL();
AddressstorageBLL addrBLL = new AddressstorageBLL();
WorkIngCacheDAL workbll = new WorkIngCacheDAL();
public void Displayjob()
{
GetWorkList(tblock);
}
#region
private void GetWorkList(object block)
{
string cm = "";
cm = "lockdisJob" + block;
object c = (Object)cm;
lock (c)
{
while (OrisShow)
{
try
{
string workstate = workbll.GetWorkState();
if (!string.IsNullOrEmpty(workstate))
{
OrisShow = true;
DisplayJob_M(block.ToString());
Thread.Sleep(50);
}
else
{
OrisShow = false;
}
}
catch (Exception ex)
{
LogHelper.WriteLogInfo(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + ":程序异常!\r\n" + ex.Message);
}
}
}
}
#endregion
#region M系列
public void DisplayJob_M(string tblock)
{
try
{
string[] nlist = tblock.Split('|');
string nblock = nlist[0];
string shelfid = nlist[1];
List<AddressstorageModel> Arealist = addrBLL.GetAreaList(nblock, shelfid);
foreach (AddressstorageModel item in Arealist)
{
OrdersQueueModel model = new OrdersQueueModel(); ;
model.Taskarea = item.area;
model.Taskblock = nblock;
#region
DataTable queueDT = queueBLL.getQueueOrderState(model);
if (queueDT != null && queueDT.Rows.Count > 0)
{
//当前区没有作业
if (queueDT.Rows[0]["state"].ToString() == "0")
{
#region
ShowMessageModel_M showmodel = new ShowMessageModel_M();
showmodel.Area = shelfid;
showmodel.Block = nblock;
showmodel.Color = queueDT.Rows[0]["lightcolor"].ToString();//EnumHelper.EMToDescriptionString(LightColor.Color.Red);
showmodel.Contents = queueDT.Rows[0]["sku"].ToString();
showmodel.Title = queueDT.Rows[0]["Shopid"].ToString();
showmodel.Islock = true;
showmodel.IsTwinkle = 0;
showmodel.Type = 8;
DataTable sudt = orderbll.GetSumList("", queueDT.Rows[0]["sku"].ToString(), nblock);
if (sudt != null && sudt.Rows.Count > 0)
{
showmodel.Qty = sudt.Rows[0]["SumQuantity"].ToString();
}
comBLL.ShowBoxMessage_M(showmodel);//点亮显示标签
#endregion
displayOrder(queueDT, nblock, item.area, model);
}
}
#endregion
}
}
catch (Exception ex)
{
LogHelper.WriteLogInfo("标签控制异常:" + ex.Message);
}
}
#endregion
#region
public void displayOrder(DataTable queueDT, string nblock, string narea, OrdersQueueModel model)
{
List<LabelParamModel> list = new List<LabelParamModel>();
model.Id = Convert.ToInt32(queueDT.Rows[0]["id"].ToString());
#region
List<JobModel> jobList = JobCache.GetPlanJobList();
List<JobModel> isJobList = jobList.FindAll(p => p.Block == nblock && p.Area == narea && p.State != 3);
ShowMessageModel showmodel = new ShowMessageModel();
//获取当前区任务并加入缓存
if (!isJobList.Any())
{
model.State = 1;
orderbll.GetOrderList(queueDT.Rows[0]["matchid"].ToString(), nblock, queueDT.Rows[0]["sku"].ToString(), narea, queueDT.Rows[0]["usercode"].ToString());
List<JobModel> nowJoblist = jobList.FindAll(p => p.State == 0 && p.Block == model.Taskblock && p.Area == model.Taskarea);
if (nowJoblist.Any())
{
var nowmodel = nowJoblist.FirstOrDefault();
LogHelper.WriteLogInfo("进入任务点亮=====matchid=" + nowmodel.Matchid + "===orderid===" + nowmodel.OrderID + "=====sku==" + nowmodel.Sku + "========");
#region
foreach (JobModel item in nowJoblist.ToArray())
{
#region
if (queueDT.Rows[0]["lightcolor"].ToString() == EnumHelper.EMToDescriptionString(LightColor.Color.Blue))
{
LabelParamModel locklamodel = new LabelParamModel();
locklamodel.Address = item.Address.ToString();
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();
lamodel.Address = item.Address.ToString();
lamodel.ControlIP = item.ControlIP.ToString();
lamodel.Command = "DISPLAY_JOB";
#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
lamodel.Type = "N";
lamodel.Quantity = quantity.ToString();
lamodel.Uid = "U" + 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;
}
#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
{//无任务
LogHelper.WriteLogInfo("点亮====无任务=======================");
model.State = 3;
}
#endregion
if (jobList.Any())
{
var finishList = jobList.FindAll(p => p.State == 0);
if (!finishList.Any())
{
queueBLL.UpdateQueueOrderState(model);//缓存队列状态修改
}
}
}
else
{
LogHelper.WriteLogInfo("还有未完成任务" + isJobList.Count);
foreach (JobModel item in isJobList)
{
LogHelper.WriteLogInfo("还有未完成任务" + item.Address + item.ID);
}
}
}
#endregion
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,564 @@
using Epost.Common;
using Epost.DAL.Cache;
using Epost.DAL.Enum;
using Epost.Model;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace Epost.BLL
{
public class Work_ScanThread
{
public string tblock, id;
public bool OrisShow = false;
OrderBLL orderbll = new OrderBLL();
OrdersQueueBLL queueBLL = new OrdersQueueBLL();
CommandBLL comBLL = new CommandBLL();
JobDownCacheDAL downCacheDAL = new JobDownCacheDAL();
JobModelCacheDAL JobCache = new JobModelCacheDAL();
AddressstorageBLL addrBLL = new AddressstorageBLL();
private static object lockscanList = new object();
public static bool OrcheckisShow = false;
WorkIngCacheDAL workbll = new WorkIngCacheDAL();
SkuInfoBLL skuBLL = new SkuInfoBLL();
UserModelCacheDAL UserCacheDAL = new UserModelCacheDAL();
public void ScanList()
{
GetScanList(tblock);
}
#region
private void GetScanList(object block)
{
string job = "";
job = "lockScan" + block;
object cJob = (object)job;
lock (cJob)
{
while (OrisShow)
{
try
{
string workstate = workbll.GetWorkState();
if (!string.IsNullOrEmpty(workstate))
{
OrisShow = true;
JobScanList(block.ToString());
Thread.Sleep(50);
}
else
{
OrisShow = false;
}
}
catch (Exception ex)
{
LogHelper.WriteLogInfo(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "ScanList异常\r\n" + ex.Message);
}
}
}
}
#endregion
#region
public ResultModel JobScanList(string tblock)
{
lock (lockscanList)
{
string[] nlist = tblock.Split('|');
string nblock = nlist[0];
string shelfid = nlist[1];
ResultModel resmodel = new ResultModel();
resmodel.result = "0";
try
{
List<AddressstorageModel> Arealist = addrBLL.GetAreaList(nblock, shelfid);
foreach (AddressstorageModel item in Arealist)
{
List<ResultMessageModel> sacnList = downCacheDAL.GetPlanJobDownList().FindAll(m => m.Status == "0" && m.Block == item.block && m.Area == item.area && m.Command == "QUERY_SPECIAL_STATUS");
if (sacnList != null && sacnList.Count > 0)
{
foreach (ResultMessageModel data in sacnList.ToArray())
{
switch (data.Command)
{
case "QUERY_SPECIAL_STATUS":
BindJobList(data);
break;
default:
break;
}
}
}
}
return resmodel;
}
catch (Exception ex)
{
resmodel.result = "-1";
resmodel.msg = "扫描异常";
LogHelper.WriteLogInfo("扫描异常:" + ex.Message);
return resmodel;
}
}
}
#endregion
#region
public ResultModel BindJobList(ResultMessageModel data)
{
ResultModel res = new ResultModel();
res.result = "0";
try
{
string sblock = data.Block;
string scanStr = data.Parameter.Trim();
string sarea = data.Area;
string name = string.Empty;
string matchid = string.Empty;
#region
List<UserCodeModel> ulist = UserCacheDAL.GetUserCodeList().FindAll(m => m.Block == sblock && m.Area == sarea);//
bool isnum = ConvertHexHelper.IsNum(scanStr.Substring(0, 1));//判断扫描首字母是否是数字
if (!ulist.Any())
{
//手动加波次信息
DataTable matdt = orderbll.GetMatchOrderList();
if (matdt != null && matdt.Rows.Count > 0)
{
UserCodeModel umodel = new UserCodeModel();
umodel.Matchid = matdt.Rows[0]["matchid"].ToString();
umodel.Block = sblock;
umodel.Area = sarea;
UserCacheDAL.UpdateUserCodeList(new List<UserCodeModel> { umodel }, EUserCommend.Create);
}
}
ulist = UserCacheDAL.GetUserCodeList().FindAll(m => m.Block == sblock && m.Area == sarea);
if (ulist.Any())
{ matchid = ulist.FirstOrDefault().Matchid; }
#endregion
if (data.Type == "5")//中分扫描枪
{
zhongfenBind(ulist, scanStr, data);
downCacheDAL.UpdateJobDownModelList(new List<ResultMessageModel> { data }, EdownCommend.Execute);
}
else if (data.Type == "6")//播种扫描枪
{
xifenBind(ulist, scanStr, data, matchid, isnum);
downCacheDAL.UpdateJobDownModelList(new List<ResultMessageModel> { data }, EdownCommend.Execute);
}
return res;
}
catch (Exception ex)
{
res.result = "-1";
res.msg = "绑定任务异常";
LogHelper.WriteLogInfo("绑定任务异常:" + ex.Message);
return res;
}
}
#endregion
#region
public void zhongfenBind(List<UserCodeModel> ulist, string scanStr, ResultMessageModel data)
{
//if (ulist.Any())
//{
// UserCodeModel usermodel = ulist.FirstOrDefault();
//if (string.IsNullOrEmpty(usermodel.ZfCode) && 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.Type =2;
// show.Area = sarea;
// 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())
{
UserCodeModel umodel = ulist.FirstOrDefault();
umodel.ZfCode = scanStr;
#region
ShowMessageModel_M show = new ShowMessageModel_M();
show.Title = "请扫描sku开始作业";
show.Contents = "";
show.Color = EnumHelper.EMToDescriptionString(LightColor.Color.Red);
show.Block = data.Block;
show.Area = data.Area;
show.Type = 2;
show.Islock = true;
comBLL.ShowBoxMessage_M(show);
#endregion
}
downCacheDAL.UpdateJobDownModelList(new List<ResultMessageModel> { data }, EdownCommend.Execute);
#endregion
}
else
{
#region sku
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();
}
LogHelper.WriteLogInfo("中分" + data.Parameter + "===SKU" + scanStr);
DataTable skudt = orderbll.GetSumList("", scanStr, data.Block);
if (skudt != null && skudt.Rows.Count > 0)
{
//规格
int discount = Convert.ToInt32(skudt.Rows[0]["discount"].ToString());
//整件总数
int SumCkQuantity = 0;//= Convert.ToInt32(skudt.Rows[0]["SumCkQuantity"].ToString());
//散件总数
int SumQuantity = Convert.ToInt32(skudt.Rows[0]["SumQuantity"].ToString());
if (discount != 1)
{
if (SumQuantity >= discount)
{
SumCkQuantity = SumQuantity / discount;
SumQuantity = SumQuantity % discount;
}
}
ShowMessageModel_M show = new ShowMessageModel_M();
show.Title = skudt.Rows[0]["sku_goodsname"].ToString();
show.Color = EnumHelper.EMToDescriptionString(LightColor.Color.Red);
show.Block = data.Block;
show.Islock = true;
show.Contents = data.Parameter + "(" + scanStr + ")\r" + "规格:" + discount;
show.Qty = SumQuantity.ToString();
show.Wholeqty = SumCkQuantity;
show.Unit = "件";
show.Wholeunit = "箱";
show.Type = 2;
comBLL.ShowBoxMessage_M(show);
}
else
{
ShowMessageModel_M show = new ShowMessageModel_M();
show.Title = "SKU" + scanStr + "无任务!";
show.Color = EnumHelper.EMToDescriptionString(LightColor.Color.Red);
show.Block = data.Block;
show.Islock = true;
show.Contents = "请扫描其他商品!";
show.Type = 2;
comBLL.ShowBoxMessage_M(show);
}
#endregion
}
}
#endregion
#region
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())
{
UserCodeModel umodel = ulist.FirstOrDefault();
umodel.UserCode = scanStr;
#region
ShowMessageModel_M show = new ShowMessageModel_M();
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);
#endregion
}
else
{
#region
List<ResultMessageModel> hangList = downCacheDAL.GetPlanJobDownList().FindAll(m => m.Parameter == "888888");
if (hangList.Any())
{
#region
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();
ShowMessageModel_M show = new ShowMessageModel_M();
show.Block = data.Block;
show.Area = data.Area;
show.Type = 8;
comBLL.RemoveBoxMessage_M(show);
// 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]["sku"].ToString()&&p.Block == data.Block);
downCacheDAL.UpdateJobDownModelList(sdown, EdownCommend.Execute);
}
downCacheDAL.UpdateJobDownModelList(hangList, EdownCommend.Execute);
#endregion
}
else if (isnum)//sku
{
#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))
{ //重复扫描
//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);
}
else
{
DataTable OrderDt = orderbll.GetOrderList_Car(matchid, scanStr, data.Area, data.Block);
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();
qmodel.Sku = scanStr;
qmodel.Taskblock = data.Block;
qmodel.Taskarea = data.Area;
qmodel.UserCode = umodel.UserCode;
qmodel.Matchid = umodel.Matchid;
qmodel.Shopid = OrderDt.Rows[0]["GoodsName"].ToString();
qmodel.Location = location;
qmodel.Lightcolor = EnumHelper.EMToDescriptionString(LightColor.Color.Red);
queueBLL.insertQueueOrders(qmodel);
}
else
{
LogHelper.WriteLogInfo("未扫描波次信息", LogHelper.Log_Type.ERROR);
}
}
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.Shopid = echoDt.Rows[0]["GoodsName"].ToString();
qmodel.Lightcolor = EnumHelper.EMToDescriptionString(LightColor.Color.Green);
queueBLL.insertQueueOrders(qmodel);
}
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);
}
#endregion
}
}
#endregion
}
#endregion
}
}
#endregion
#region SKU挂起/
public void Hangup_SKU(string sku, string block, string area, ResultMessageModel data = null)
{
List<LabelParamModel> list = new List<LabelParamModel>();
//查询当前通道sku是否有任务
DataTable dt = orderbll.getOrderListBysku(block, sku);
if (dt != null && dt.Rows.Count > 0)
{
// 将当前通道所有sku正在亮的设备熄灭
foreach (DataRow item in dt.Rows)
{
LabelParamModel lamodel = new LabelParamModel();
lamodel.Address = item["address"].ToString(); ;
lamodel.ControlIP = item["ControlIP"].ToString();
lamodel.Command = "REMOVE_JOB";
lamodel.Parameter = "";
lamodel.Uid = "U" + item["id"].ToString();
lamodel.Type = "N";
list.Add(lamodel);
if (item["oprationstate"].ToString() == "1")
{
orderbll.UpOrderStateBybat(item["id"].ToString());
}
}
if (list != null && list.Count > 0)
{
LogHelper.WriteLogInfo("挂起list——" + sku + "——————————————————:" + list.Count);
comBLL.DISPLAY_JOBALL(list);
}
}
//删除缓存中sku记录
List<JobModel> jobList = JobCache.GetPlanJobList();
List<JobModel> relist = jobList.FindAll(m => m.Sku == sku && m.Block == block);
JobModel model = new JobModel();
if (relist.Any())
{
model = relist.FirstOrDefault();
JobCache.UpdateJobModelList(relist, EcommendType.Complete);
//删除Orderqueue中sku的记录
bool bo = queueBLL.DelQueueOrder(sku, block);
LogHelper.WriteLogInfo("删除queue返回" + bo);
}
else
{
ShowMessageModel_M show = new ShowMessageModel_M();
show.Title = "挂起商品:" + sku + "错误!";
show.Color = EnumHelper.EMToDescriptionString(LightColor.Color.Red);
show.Block = block;
show.Area = area;
show.Type = 8;
show.Islock = true;
comBLL.ShowBoxMessage_M(show);
}
//downCacheDAL.GetPlanJobDownList().FindAll(p => p.Parameter == sku && p.Block == block);
}
#endregion
}
}

View File

@ -257,13 +257,19 @@ namespace Epost.DAL
return db.GetsqlForDT(sql);
}
#endregion
#region
public List<AddressstorageModel> GetAreaList(string block = "")
public List<AddressstorageModel> GetAreaList(string block, string shelfid)
{
string strwhere = string.Empty;
if (!string.IsNullOrEmpty(block))
{
strwhere = "and block ='" + block + "'";
strwhere += "and block ='" + block + "'";
}
if (!string.IsNullOrEmpty(shelfid))
{
strwhere += "and shelfid ='" + shelfid + "'";
}
string sql = string.Format("select area,block from Addressstorage where type=1 " + strwhere + " group by area,block");
DataTable dt = db.GetsqlForDT(sql);
@ -271,6 +277,22 @@ namespace Epost.DAL
return ModelConvertHelper<AddressstorageModel>.ConvertToList(dt);
}
#endregion
#region
public List<AddressstorageModel> GetshelfidList(string block)
{
string strwhere = string.Empty;
if (!string.IsNullOrEmpty(block))
{
strwhere += "and block ='" + block + "'";
}
string sql = string.Format("select shelfid,block from Addressstorage where type=1 " + strwhere + " group by shelfid,block");
DataTable dt = db.GetsqlForDT(sql);
return ModelConvertHelper<AddressstorageModel>.ConvertToList(dt);
}
#endregion
#region
public DataTable GetWayList()
{
@ -809,26 +831,5 @@ namespace Epost.DAL
}
#endregion
#region
#region
public DataTable QueryAddrList(string strwhere)
{
string sql = string.Format("select * from v_address where 1=1 " + strwhere);
return db.GetsqlForDT(sql);
}
#endregion
#region
public DataTable QueryControlList(string strwhere)
{
string sql = string.Format(" select distinct controlip ,port,waveno,address from v_address where 1=1 " + strwhere);
return db.GetsqlForDT(sql);
}
#endregion
#endregion
}
}

View File

@ -1,99 +0,0 @@
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; }
}
}

View File

@ -0,0 +1,94 @@
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 WorkIngCacheDAL
{
private static object lockobj = new object();
public static string workingstate = string.Empty;
#region
public string GetWorkState()
{
//读取数据库 处理异常断电等情况------待开发
return workingstate;
}
#endregion
#region
public void ClearWork()
{
workingstate = "";
}
#endregion
#region Job缓存处理方法
/// <summary>
/// Job缓存处理方法
/// </summary>
/// <param name="JobParam"></param>
/// <param name="CommendType"></param>
/// <returns></returns>
public bool UpdateWorkModel(WorkEcommendType CommendType)
{
lock (lockobj)
{
if (CommendType.Equals(WorkEcommendType.Create))
{
workingstate = "Start";
}
else if (CommendType.Equals(WorkEcommendType.Complete))
{
workingstate = "";
}
return true;
}
}
#endregion
}
public enum WorkEcommendType
{
/// <summary>
/// 开始作业
/// </summary>
[Description("开始作业")]
Create,
/// <summary>
/// 结束作业
/// </summary>
[Description("结束作业")]
Complete
}
}

View File

@ -82,10 +82,6 @@
<HintPath>..\packages\EntityFramework.6.1.3\lib\net45\EntityFramework.SqlServer.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="LightContrl, Version=3.0.2.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\DLL\LightContrl.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System.Configuration" />
@ -110,12 +106,12 @@
<Compile Include="Cache\EPlightCacheDAL.cs" />
<Compile Include="Cache\JobDownCacheDAL.cs" />
<Compile Include="Cache\JobModelCacheDAL.cs" />
<Compile Include="Cache\LightControlCacheDAL.cs" />
<Compile Include="Cache\LocationCacheDAL.cs" />
<Compile Include="Cache\ScanModelCacheDAL.cs" />
<Compile Include="Cache\ShowMesCacheDAL.cs" />
<Compile Include="Cache\UserLoginCacheDAL.cs" />
<Compile Include="Cache\UserModelCacheDAL.cs" />
<Compile Include="Cache\WorkIngCacheDAL.cs" />
<Compile Include="Cache\XgateCacheDAL.cs" />
<Compile Include="CommandDAL.cs" />
<Compile Include="DB.cs" />

View File

@ -48,7 +48,7 @@ namespace Epost.DAL
string sql = string.Empty;
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 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 + " order by layer,slist ",
sku,
block, area);
@ -56,7 +56,7 @@ namespace Epost.DAL
}
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 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 + " order by layer,slist ",
sku,
block);
@ -90,7 +90,7 @@ namespace Epost.DAL
string sql = string.Empty;
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 sku = '{0}' and block = '{1}' and area='{2}' " + strwhere + "",
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 sku = '{0}' and block = '{1}' and area='{2}' " + strwhere + " order by layer,slist ",
sku,
block, area);
@ -98,7 +98,7 @@ namespace Epost.DAL
}
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 sku = '{0}' and block = '{1}' " + strwhere + "",
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 sku = '{0}' and block = '{1}' " + strwhere + " order by layer,slist ",
sku,
block);
@ -158,7 +158,7 @@ namespace Epost.DAL
strwhere += " and matchid = '" + matchid + "'";
}
string sql = string.Format("select sum(Quantity) as SumQuantity, Sum(checkquantity) as SumCkQuantity,boxweight, Discount,unit,wholeunit,matchid ,goodscode,goodsname from v_orders where readtime= (select top 1 readtime from orders where state=0) and (oprationstate = 0 or oprationstate=1) and sku='{0}' and block='{1}' " + strwhere + " group by sku,boxweight, Discount,goodsname,unit,wholeunit,matchid ,goodscode",
string sql = string.Format("select sum(Quantity) as SumQuantity, Sum(checkquantity) as SumCkQuantity,boxweight, Discount,unit,wholeunit,matchid ,goodscode,goodsname from v_orders where sku='{0}' and block='{1}' " + strwhere + " group by sku,boxweight, Discount,goodsname,unit,wholeunit,matchid ,goodscode",
sku,
block);
LogHelper.WriteLogInfo("获取订单信息-中分" + sql);
@ -529,12 +529,12 @@ namespace Epost.DAL
#endregion
#region --使
public bool UpOrderStateBybat(string batchid)
public bool UpOrderStateBybat(string id)
{
try
{
string sql = string.Format(" update orders set oprationstate=0,oprationtime='' where batchid='{0}' and state<>3",
batchid);
string sql = string.Format(" update orders set oprationstate=0,oprationtime='' where id='{0}' and state<>3",
id);
long x = db.UpdateSql(sql);
if (x > 0)
return true;
@ -1247,7 +1247,7 @@ namespace Epost.DAL
#region sku对应的所有任务
public DataTable getOrderListBysku(string block, string sku)
{
string sql = string.Format("select * from v_orders where block = '{0}' and sku ='{1}' ",
string sql = string.Format("select * from v_orders where block = '{0}' and sku ='{1}' order by layer,slist ",
block,
sku);
LogHelper.WriteLogInfo("查询sku对应的所有任务:" + sql);

View File

@ -9,18 +9,10 @@ namespace Epost.Model
public class OrderModel
{
private string _wallNo = string.Empty;
private string _location = string.Empty;
private string _lightColor = string.Empty;
private string _lightType = string.Empty;
private string _brightness = string.Empty;
private string _status = string.Empty;
private string _OrderNO = string.Empty;
private string _State = string.Empty;// 1亮灯 0灭灯
public string wallNo { get => _wallNo; set => _wallNo = value; }
public string lcation { get => _location; set => _location = value; }
public string lightColor { get => _lightColor; set => _lightColor = value; }
public string lightType { get => _lightType; set => _lightType = value; }
public string brightness { get => _brightness; set => _brightness = value; }
public string status { get => _status; set => _status = value; }
public string OrderNO { get => _OrderNO; set => _OrderNO = value; }
public string State { get => _State; set => _State = value; }
}
}

View File

@ -37,91 +37,4 @@ 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; }
}
}

View File

@ -41,7 +41,6 @@ namespace Epost.TestToolsWeb.Controllers
public ActionResult Index()
{
ViewBag.isClear = isClear;
ViewBag.isWork = isWork;

View File

@ -5,305 +5,167 @@ using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web.Http;
using LightContrl;
using Epost.DAL.Cache;
using System.Net;
using Microsoft.Owin.BuilderProperties;
using System.Net.Http;
using System.Web.Http;
namespace Epost.DPS.Controllers
{
[RoutePrefix("api/TaskAPI")]
[RoutePrefix("api/WebAPI")]
public class ServerController : ApiController
{
AddressstorageBLL addrbll = new AddressstorageBLL();
LightControlCacheDAL cachedal = new LightControlCacheDAL();
MainControl lig = new MainControl();
#region
[Route("CONNECT")]
[HttpPost]
public ResultLightModel CONNECT([FromBody] List<reqmodel> data)
{
ResultLightModel res = new ResultLightModel();
try
{
LogHelper.WriteLogInfo("CONNECT请求" + JsonHelper.SerializeObject(data));
if (data.Any() && data.Count > 0)
{
foreach (var item in data)
{
if (item.status == "1")//连接
{
DataTable dt = addrbll.QueryControlList(" and waveno ='" + item.wallNo + "'");
if (dt != null && dt.Rows.Count > 0)
{
foreach (DataRow rowitem in dt.Rows)
{
private static object lockinit = new object();
string ipaddress = rowitem["controlip"].ToString().Trim();
List<LightcontrolModel> conlist = cachedal.GetControlList().FindAll(o => o.controlip == ipaddress);
if (conlist != null && conlist.Count > 0)
{
LogHelper.WriteLogInfo(ipaddress + "已连接!");
res.resultCode = "0";
res.resultMsg = "成功!";
return res;
}
else
{
int port = Convert.ToInt32(rowitem["port"].ToString().Trim());
int timeout = 2000;
bool bo = lig.Connect(ipaddress, port, timeout);//timeout 毫秒
if (bo)
{
LightcontrolModel model = new LightcontrolModel();
model.controlip = ipaddress;
model.maincontrol = lig;
model.port = port;
cachedal.UpdateControlList(new List<LightcontrolModel> { model }, EcontrolCommend.Create);
res.resultCode = "0";
res.resultMsg = "成功!";
}
else
{
res.resultCode = "-1";
res.resultMsg = "连接失败" + ipaddress;
LogHelper.WriteLogInfo("连接失败" + ipaddress);
return res;
}
}
}
}
else
{
res.resultCode = "-1";
res.resultMsg = "播种墙号错误";
LogHelper.WriteLogInfo("播种墙号错误");
return res;
}
}
else {
LogHelper.WriteLogInfo("断开连接");
List<LightcontrolModel> conlist = cachedal.GetControlList();
if (conlist.Any() && conlist.Count > 0)
{
foreach (LightcontrolModel con in conlist)
{
bool b= con.maincontrol.DisConnect(con.controlip,con.port);
LogHelper.WriteLogInfo(b+"断开连接"+ con.controlip+"=="+con.port);
}
}
cachedal.ClearControlList();
res.resultCode = "0";
res.resultMsg = "断开连接成功!";
}
}
}
return res;
}
catch (Exception ex)
{
LogHelper.WriteLogInfo(ex.ToString(), LogHelper.Log_Type.ERROR);
res.resultMsg = "请求接口异常!";
res.resultCode = "-1";
OrderControlBLL contrbll = new OrderControlBLL();
}
return res;
}
#endregion
#region
[Route("LEDON")]
[HttpPost]
public ResultLightModel LEDON([FromBody] List<reqmodel> data)
{
ResultLightModel res = new ResultLightModel();
try
{
LogHelper.WriteLogInfo("LEDON请求" + JsonHelper.SerializeObject(data));
if (data.Any() && data.Count > 0)
{
foreach (var item in data)
{
//根据播种墙号查询灯带IP
DataTable dt = addrbll.QueryControlList(" and waveno ='" + item.wallNo + "'");
if (dt != null && dt.Rows.Count > 0)
{
foreach (DataRow rowitem in dt.Rows)
{
string ipaddress = rowitem["controlip"].ToString().Trim();
List<LightcontrolModel> conlist = cachedal.GetControlList().FindAll(o => o.controlip == ipaddress);
if (conlist != null && conlist.Count > 0)
{
MainControl control = conlist.FirstOrDefault().maincontrol;
bool bo = false;
string Address = dt.Rows[0]["address"].ToString().Trim();
string resstr = string.Empty;
if (item.lightType == "0")
{
bo = control.LED_OFF(ipaddress, Address,ref resstr);
}
else
{
bo = control.LED_ON(ipaddress, Address, ref resstr, "3", "0" , item.lightColor.Trim());
}
if (bo)
{
res.resultCode = "0";
res.resultMsg = "成功!";
}
else
{
res.resultCode = "-1";
res.resultMsg = "失败";
LogHelper.WriteLogInfo(ipaddress+"失败!" +resstr);
}
}
else
{
res.resultCode = "-1";
res.resultMsg = "请先连接设备";
LogHelper.WriteLogInfo("请先连接设备!");
}
}
}
else
{
res.resultCode = "-1";
res.resultMsg = "播种墙号错误!";
LogHelper.WriteLogInfo("播种墙号错误", LogHelper.Log_Type.ERROR);
}
}
}
else
{
res.resultCode = "-1";
res.resultMsg = "请求参数错误!";
LogHelper.WriteLogInfo("请求参数错误!");
}
return res;
}
catch (Exception ex)
{
LogHelper.WriteLogInfo(ex.ToString(), LogHelper.Log_Type.ERROR);
res.resultMsg = "请求接口异常!";
res.resultCode = "-1";
}
return res;
}
#endregion
#region /
//初始化
[Route("DISPLAYJOB")]
[HttpPost]
public ResultLightModel DISPLAYJOB([FromBody] List<DisplayjobModelReq> data)
public ResultModel DISPLAYJOB(OrderModel model)
{
ResultLightModel res = new ResultLightModel();
try
lock (lockinit)
{
LogHelper.WriteLogInfo("DISPLAYJOB请求" + JsonHelper.SerializeObject(data));
if (data.Any() && data.Count > 0)
ResultModel res = new ResultModel();
try
{
foreach (DisplayjobModelReq item in data)
{
//根据播种墙号查询灯带IP
DataTable dt = addrbll.QueryControlList(" and waveno ='" + item.wallNo + "'");
if (dt != null && dt.Rows.Count > 0)
{
foreach (DataRow rowitem in dt.Rows)
{
string ipaddress = rowitem["controlip"].ToString().Trim();
List<LightcontrolModel> conlist = cachedal.GetControlList().FindAll(o => o.controlip == ipaddress);
if (conlist != null && conlist.Count > 0)
{
MainControl control = conlist.FirstOrDefault().maincontrol;
DataTable locdt = addrbll.QueryAddrList(" and waveno ='" + item.wallNo + "' and location ='" + item.location + "' and controlip='" + ipaddress + "'");
if (locdt != null && locdt.Rows.Count > 0)
{
List<LightParagraph> list = new List<LightParagraph>();
string address = locdt.Rows[0]["address"].ToString().Trim();
foreach (DataRow locitem in locdt.Rows)
{
//根据播种墙号、格口号查询播种墙ip及灯带地址
LogHelper.WriteLogInfo(JsonHelper.SerializeObject(model));
res.result = "0";
res.msg = "成功!";
return res;
LightParagraph show = new LightParagraph();
show.WayNu = Convert.ToInt32(locitem["wayno"].ToString().Trim());
show.LightBeganNu = locitem["beginno"].ToString().Trim();
show.LightEndNu = locitem["endno"].ToString().Trim();
show.LightColor = item.lightColor.Trim(); //1:蓝色 2:绿色 3青色 4:红色 5紫色 6黄色 7白色
show.Brightness = item.brightness.Trim();//亮度 1-9
list.Add(show);
}
string resstr = string.Empty;
bool bo = control.LED_By_Paragraph(ipaddress, address, list,ref resstr);
if (bo)
{
LogHelper.WriteLogInfo("成功" + ipaddress+"list:"+JsonHelper.SerializeObject(list));
res.resultCode = "0";
res.resultMsg = "成功!";
}
else
{
LogHelper.WriteLogInfo("失败"+ ipaddress + "list:" + JsonHelper.SerializeObject(list),LogHelper.Log_Type.ERROR);
res.resultCode = "-1";
res.resultMsg = resstr;
return res;
}
}
}
else
{
res.resultCode = "-1";
res.resultMsg = "请先连接设备!";
LogHelper.WriteLogInfo("请先连接设备!");
}
}
}
else
{
res.resultCode = "-1";
res.resultMsg = "播种墙号错误!";
LogHelper.WriteLogInfo("播种墙号错误!");
}
}
}
catch (Exception ex)
{
LogHelper.WriteLogInfo("GetDataList异常" + ex.Message);
res.msg = "请求异常!";
res.result = "-1";
return res;
}
}
}
//初始化
[Route("ClearALL")]
[HttpPost]
public ResultModel ClearALL()
{
lock (lockinit)
{
ResultModel res = new ResultModel();
try
{
res = contrbll.ClearALL();
return res;
}
catch (Exception ex)
{
LogHelper.WriteLogInfo("GetDataList异常" + ex.Message);
res.msg = "请求异常!";
res.result = "-1";
return res;
}
}
}
[Route("StartWork")]
[HttpPost]
public ResultModel StartWork()
{
lock (lockinit)
{
ResultModel res = new ResultModel();
try
{
contrbll.StartWork();
res.msg = "成功!";
res.result = "0";
}
catch (Exception ex)
{
LogHelper.WriteLogInfo("启动作业异常" + ex.ToString(), LogHelper.Log_Type.ERROR);
res.msg = "启动作业异常!";
res.result = "-1";
}
return res;
}
catch (Exception ex)
}
#region
[Route("TestStart")]
[HttpPost]
public ResultModel TestStart()
{
lock (lockinit)
{
LogHelper.WriteLogInfo(ex.ToString(), LogHelper.Log_Type.ERROR);
res.resultMsg = "请求接口异常!";
res.resultCode = "-1";
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;
}
}
return res;
}
#endregion
#region
[Route("TestEnd")]
[HttpPost]
public ResultModel TestEnd()
{
lock (lockinit)
{
ResultModel res = new ResultModel();
contrbll.TestEnd();
res.msg = "成功!";
res.result = "0";
return res;
}
}
#endregion
#region
[Route("EndWork")]
[HttpPost]
public ResultModel EndWork()
{
lock (lockinit)
{
ResultModel res = new ResultModel();
contrbll.EndWork();
res.msg = "成功!";
res.result = "0";
return res;
}
}
#endregion
}

View File

@ -61,10 +61,6 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\DLL\ExcelIntOut.dll</HintPath>
</Reference>
<Reference Include="LightContrl, Version=3.0.2.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\DLL\LightContrl.dll</HintPath>
</Reference>
<Reference Include="Microsoft.AI.Agent.Intercept, Version=1.2.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.ApplicationInsights.Agent.Intercept.1.2.1\lib\net45\Microsoft.AI.Agent.Intercept.dll</HintPath>
<Private>True</Private>
@ -874,6 +870,18 @@
<Content Include="Views\_ViewStart.cshtml" />
<Content Include="Views\Home\Index.cshtml" />
</ItemGroup>
<ItemGroup>
<Content Include="Log\fonts\glyphicons-halflings-regular.woff" />
<Content Include="Log\fonts\glyphicons-halflings-regular.ttf" />
<Content Include="Log\fonts\glyphicons-halflings-regular.eot" />
<Content Include="packages.config" />
<None Include="Project_Readme.html" />
</ItemGroup>
<ItemGroup>
<Folder Include="App_Data\" />
<Folder Include="File\" />
<Folder Include="Models\" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Common\Epost.Common.csproj">
<Project>{44c36ca3-d672-40d1-ac94-91115de29a2d}</Project>
@ -892,18 +900,6 @@
<Name>Epost.Model</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Content Include="Log\fonts\glyphicons-halflings-regular.woff" />
<Content Include="Log\fonts\glyphicons-halflings-regular.ttf" />
<Content Include="Log\fonts\glyphicons-halflings-regular.eot" />
<Content Include="packages.config" />
<None Include="Project_Readme.html" />
</ItemGroup>
<ItemGroup>
<Folder Include="App_Data\" />
<Folder Include="File\" />
<Folder Include="Models\" />
</ItemGroup>
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>

View File

@ -11,7 +11,7 @@
<WebStackScaffolding_IsAsyncSelected>False</WebStackScaffolding_IsAsyncSelected>
<WebStackScaffolding_ViewDialogWidth>600</WebStackScaffolding_ViewDialogWidth>
<NameOfLastUsedPublishProfile>E:\WORK\代码管理\T系列\播种\Epost.TestToolsWeb\Properties\PublishProfiles\Toolsweb.pubxml</NameOfLastUsedPublishProfile>
<LastActiveSolutionConfig>Release|Any CPU</LastActiveSolutionConfig>
<LastActiveSolutionConfig>Debug|Any CPU</LastActiveSolutionConfig>
<Use64BitIISExpress />
<IISExpressSSLPort />
<IISExpressAnonymousAuthentication />

View File

@ -27,23 +27,10 @@ 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();
}
}
}
}

View File

@ -7,7 +7,7 @@
<PropertyGroup>
<TimeStampOfAssociatedLegacyPublishXmlFile />
<_PublishTargetUrl>D:\驿传\T系列</_PublishTargetUrl>
<History>True|2023-04-23T07:53:28.0062911Z;True|2023-04-22T10:28:09.9896404+08:00;True|2023-04-20T10:35:53.5768979+08:00;True|2022-07-15T16:41:13.9750291+08:00;True|2022-07-14T14:02:20.7983427+08:00;True|2022-07-13T17:40:22.7531000+08:00;True|2022-07-13T17:34:22.9908701+08:00;True|2022-07-13T17:30:06.3588502+08:00;True|2022-07-11T10:32:06.9053981+08:00;True|2021-04-26T10:07:37.4889549+08:00;True|2021-04-09T10:32:51.9130162+08:00;True|2021-04-09T10:31:50.4974012+08:00;</History>
<History>True|2024-09-01T02:13:37.1598955Z;True|2024-08-31T17:27:57.5375469+08:00;True|2022-07-15T16:41:13.9750291+08:00;True|2022-07-14T14:02:20.7983427+08:00;True|2022-07-13T17:40:22.7531000+08:00;True|2022-07-13T17:34:22.9908701+08:00;True|2022-07-13T17:30:06.3588502+08:00;True|2022-07-11T10:32:06.9053981+08:00;True|2021-04-26T10:07:37.4889549+08:00;True|2021-04-09T10:32:51.9130162+08:00;True|2021-04-09T10:31:50.4974012+08:00;</History>
<LastFailureDetails />
</PropertyGroup>
<ItemGroup>
@ -33,19 +33,19 @@
<publishTime>04/04/2018 15:45:12</publishTime>
</File>
<File Include="bin/App_global.asax.compiled">
<publishTime>04/23/2023 15:53:24</publishTime>
<publishTime>09/01/2024 13:28:03</publishTime>
</File>
<File Include="bin/App_global.asax.dll">
<publishTime>04/23/2023 15:53:24</publishTime>
<publishTime>09/01/2024 13:28:02</publishTime>
</File>
<File Include="bin/BouncyCastle.Crypto.dll">
<publishTime>02/24/2020 15:29:24</publishTime>
</File>
<File Include="bin/Common.dll">
<publishTime>04/23/2023 15:53:13</publishTime>
<publishTime>09/01/2024 10:13:03</publishTime>
</File>
<File Include="bin/Common.pdb">
<publishTime>04/23/2023 15:53:13</publishTime>
<publishTime>09/01/2024 10:13:03</publishTime>
</File>
<File Include="bin/ComposerSDK.dll">
<publishTime>04/29/2020 16:50:14</publishTime>
@ -63,31 +63,31 @@
<publishTime>10/23/2017 13:15:20</publishTime>
</File>
<File Include="bin/Epost.BLL.dll">
<publishTime>04/23/2023 15:53:14</publishTime>
<publishTime>09/01/2024 13:27:54</publishTime>
</File>
<File Include="bin/Epost.BLL.pdb">
<publishTime>04/23/2023 15:53:14</publishTime>
<publishTime>09/01/2024 13:27:54</publishTime>
</File>
<File Include="bin/Epost.BLL.XmlSerializers.dll">
<publishTime>08/26/2020 18:09:48</publishTime>
</File>
<File Include="bin/Epost.DAL.dll">
<publishTime>04/23/2023 15:53:14</publishTime>
<publishTime>09/01/2024 11:27:24</publishTime>
</File>
<File Include="bin/Epost.DAL.pdb">
<publishTime>04/23/2023 15:53:14</publishTime>
<publishTime>09/01/2024 11:27:24</publishTime>
</File>
<File Include="bin/Epost.DPS.dll">
<publishTime>04/23/2023 15:53:16</publishTime>
<publishTime>09/01/2024 13:27:56</publishTime>
</File>
<File Include="bin/Epost.DPS.pdb">
<publishTime>04/23/2023 15:53:16</publishTime>
<publishTime>09/01/2024 13:27:56</publishTime>
</File>
<File Include="bin/Epost.Model.dll">
<publishTime>04/22/2023 10:27:45</publishTime>
<publishTime>08/31/2024 17:27:44</publishTime>
</File>
<File Include="bin/Epost.Model.pdb">
<publishTime>04/22/2023 10:27:45</publishTime>
<publishTime>08/31/2024 17:27:44</publishTime>
</File>
<File Include="bin/Epost.TestToolsWeb.dll">
<publishTime>09/06/2018 11:57:11</publishTime>
@ -113,12 +113,6 @@
<File Include="bin/ICSharpCode.SharpZipLib.pdb">
<publishTime>08/09/2019 08:40:22</publishTime>
</File>
<File Include="bin/LightContrl.dll">
<publishTime>04/22/2023 10:23:53</publishTime>
</File>
<File Include="bin/LightContrl.pdb">
<publishTime>04/22/2023 10:23:53</publishTime>
</File>
<File Include="bin/log4net.dll">
<publishTime>03/08/2017 19:26:22</publishTime>
</File>
@ -5658,7 +5652,7 @@
<publishTime>05/30/2022 16:58:47</publishTime>
</File>
<File Include="PrecompiledApp.config">
<publishTime>04/23/2023 15:53:18</publishTime>
<publishTime>09/01/2024 13:27:58</publishTime>
</File>
<File Include="Scripts/ai.0.22.9-build00167.js">
<publishTime>04/04/2018 15:45:12</publishTime>
@ -7578,7 +7572,7 @@
<publishTime>07/04/2022 14:22:38</publishTime>
</File>
<File Include="Web.config">
<publishTime>04/22/2023 10:27:50</publishTime>
<publishTime>08/31/2024 19:13:15</publishTime>
</File>
</ItemGroup>
</Project>

View File

@ -11,7 +11,7 @@
</configSections>
<connectionStrings>
<add name="weijie_dpsEntities" connectionString="metadata=res://*/WJDB.csdl|res://*/WJDB.ssdl|res://*/WJDB.msl;provider=System.Data.SqlClient;provider connection string=&quot;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&quot;" providerName="System.Data.EntityClient" />
<add name="SqlLocDPSConnection" connectionString="server=139.196.36.200;user id=EpostTest;password=antion;database=taitan_dengdai;min pool size=512;max pool size=512;packet size=3072" providerName="System.Data.SqlClient" />
<add name="SqlLocDPSConnection" connectionString="server=139.196.36.200;user id=EpostTest;password=antion;database=BJ_ZhongLiang_DAS;min pool size=512;max pool size=512;packet size=3072" providerName="System.Data.SqlClient" />
<add name="MysqlLocDPSConnection" connectionString="Server=localhost;Port=3306;Database=world;User=root; Password=antion;SslMode=None;Pooling=true;Allow User Variables=True;" />
<add name="WMSConnection" connectionString="data source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=139.196.36.200)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=EpostDB)));user id=C##Test;password=test" />
@ -32,9 +32,7 @@
<add key="SetupMode" value="\Epost_P\Epost.TestToolsWeb\App_Data\SetupMode.txt" />
<add key="CARID" value="HT01" />
<add key="ServerAPIURL" value="http://192.168.3.65:8051/api/WebAPI" />
<add key="SleepTime" value="1" />
<add key="SleepTime" value="1" />
</appSettings>
<!--
有关 web.config 更改的说明,请参见 http://go.microsoft.com/fwlink/?LinkId=235367。
@ -57,18 +55,6 @@
<sessionState mode="InProc" timeout="518400" />
</system.web>
<system.webServer>
<!-- 跨域访问配置 -->
<httpProtocol>
<customHeaders>
<!--相应类型(值为逗号分隔的一个字符串,表明服务器支持的所有跨域请求的方法)-->
<add name="Access-Control-Allow-Methods" value="GET, POST, PUT, DELETE, OPTIONS"/>
<!--响应头设置Content-Type只限于三个值application/x-www-form-urlencoded、multipart/form-data、text/plain-->
<add name="Access-Control-Allow-Headers" value="*"/>
<!--允许跨域访问的网址-->
<add name="Access-Control-Allow-Origin" value="*"/>
<!--<add name="Access-Control-Allow-Origin" value="http://www.yabyy.com,http://bbs.yabyy.com"/>-->
</customHeaders>
</httpProtocol>
<modules>
<remove name="FormsAuthentication" />
<remove name="ApplicationInsightsWebTracking" />
@ -175,8 +161,21 @@
<filter type="log4net.Filter.LoggerMatchFilter">
<loggerToMatch value="System_Log" />
</filter>
<filter type="log4net.Filter.DenyAllFilter" />
</appender>
<filter type="log4net.Filter.DenyAllFilter" />
</appender>
<appender name="SystemLogAppender_LightUp" type="log4net.Appender.RollingFileAppender">
<file value="Log/System_Log/" />
<appendToFile value="true" />