9 Commits

Author SHA1 Message Date
a77604f299 2023-11-07 16:04:21 +08:00
7d3f50c97b 2023-09-14 13:27:34 +08:00
jl
29bfe4c6aa 2023-09-14 10:49:07 +08:00
cc78693b7d 更改接口灭灯功能 2023-09-06 12:44:42 +08:00
7eff397fb5 2023-08-31 13:26:37 +08:00
07d01e0cd0 2023-08-30 17:23:23 +08:00
07985264fa 2023-08-14 14:57:24 +08:00
b4fd2d4e05 2023-07-26 13:09:49 +08:00
ccbca85c55 2023-07-18 11:18:52 +08:00
21 changed files with 1256 additions and 290 deletions

View File

@ -478,8 +478,40 @@ namespace Epost.Common
return model; return model;
} }
public static string ModelToXml<T>(T model)
{
MemoryStream stream = new MemoryStream();
XmlSerializer xmlSer = new XmlSerializer(typeof(T));
xmlSer.Serialize(stream, model);
stream.Position = 0;
StreamReader sr = new StreamReader(stream);
return sr.ReadToEnd();
}
/// <summary>
/// 将实体对象转换成XML
/// </summary>
/// <typeparam name="T">实体类型</typeparam>
/// <param name="obj">实体对象</param>
public static string XmlSerialize<T>(T obj)
{
try
{
using (StringWriter sw = new StringWriter())
{
Type t = obj.GetType();
XmlSerializer serializer = new XmlSerializer(obj.GetType());
serializer.Serialize(sw, obj);
sw.Close();
return sw.ToString();
}
}
catch (Exception ex)
{
throw new Exception("将实体对象转换成XML异常", ex);
}
}
} }

View File

@ -374,5 +374,17 @@ namespace Epost.BLL
return dal.GetAddressListByByPage(strWhere, orderby, startIndex, endIndex, out recordCount); return dal.GetAddressListByByPage(strWhere, orderby, startIndex, endIndex, out recordCount);
} }
#endregion #endregion
#region
public DataTable GetForcedendAddress(string orderid)
{
return dal.GetForcedendAddress(orderid);
}
public DataTable GetForcedendAddress()
{
return dal.GetForcedendAddress();
}
#endregion
} }
} }

View File

@ -62,7 +62,7 @@ namespace Epost.BLL
model.Command = "UNLOCK"; model.Command = "UNLOCK";
model.Timeout = "0.5"; model.Timeout = "0.5";
list.Add(model); list.Add(model);
LED_OFF_CLEAR(item["ControlIP"].ToString());
} }
if (list.Any()) if (list.Any())
{ {
@ -511,6 +511,7 @@ namespace Epost.BLL
model.ControlIP = item["ControlIP"].ToString(); model.ControlIP = item["ControlIP"].ToString();
FORMATE_JOB_DATA(model); FORMATE_JOB_DATA(model);
LED_OFF_CLEAR(item["ControlIP"].ToString());
} }
} }
@ -564,14 +565,14 @@ namespace Epost.BLL
model.Address = item.Address; model.Address = item.Address;
model.Command = "REMOVE_JOB"; model.Command = "REMOVE_JOB";
model.Uid = item.ID; model.Uid = item.ID;
model.Type = "N"; model.Type = "C";
list.Add(model); list.Add(model);
LabelParamModel Unlockmodel = new LabelParamModel(); LabelParamModel Unlockmodel = new LabelParamModel();
Unlockmodel.ControlIP = item.ControlIP; Unlockmodel.ControlIP = item.ControlIP;
Unlockmodel.Address = item.Address; Unlockmodel.Address = item.Address;
Unlockmodel.Command = "UNLOCK"; Unlockmodel.Command = "UNLOCK";
Unlockmodel.Type = "N"; Unlockmodel.Type = "C";
Unlockmodel.Parameter = "11111000"; Unlockmodel.Parameter = "11111000";
list.Add(Unlockmodel); list.Add(Unlockmodel);
@ -676,6 +677,30 @@ namespace Epost.BLL
#endregion #endregion
#region #region
public bool DISPLAY_LIGHT_BLOCK_Out(string block, string area, string isoff)
{
DataTable dt = addrBLL.GetBoxAddress(block, area, 6);
List<LabelParamModel> list = new List<LabelParamModel>();
if (dt != null && dt.Rows.Count > 0)
{
foreach (DataRow item in dt.Rows)
{
LabelParamModel model = new LabelParamModel();
model.Command = "DISPLAY_LIGHT";
model.Timeout = "0.5";
model.Type = "T";
model.Address = item["address"].ToString();
model.ControlIP = item["ControlIP"].ToString();
model.Parameter = ConvertHexHelper.ConvertString(item["addresstype"].ToString(), 10, 16).ToString().PadLeft(2, '0') + isoff;
list.Add(model);
}
dal.SendALL(list);
}
return true;
}
public bool DISPLAY_LIGHT_BLOCK(string block, string area, string isoff) public bool DISPLAY_LIGHT_BLOCK(string block, string area, string isoff)
{ {
@ -737,7 +762,55 @@ namespace Epost.BLL
#endregion #endregion
#region
public ResultModel Forcedend(string orderid)
{
ResultModel resultModel = new ResultModel();
List<LabelParamModel> list = new List<LabelParamModel>();
try
{
DataTable dt = addrBLL.GetForcedendAddress(orderid);
if (dt != null && dt.Rows.Count > 0)
{
foreach (DataRow item in dt.Rows)
{
LabelParamModel model = new LabelParamModel();
model.ControlIP = item["ControlIP"].ToString();
model.Address = item["address"].ToString();
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.Parameter = "11111000";
model.Command = "UNLOCK";
model.Timeout = "0.5";
list.Add(model);
LED_OFF_CLEAR(item["ControlIP"].ToString());
}
if (list.Any())
{
resultModel = SendALL_Init(list);
}
}
return resultModel;
}
catch (Exception ex)
{
resultModel.result = "0";
resultModel.msg = "强制结束熄灭失败!";
LogHelper.WriteLogInfo("强制结束异常:" + ex.Message);
}
return resultModel;
}
#endregion
} }
} }

View File

@ -388,11 +388,11 @@ namespace Epost.BLL
if (nowqty > jobmo.Quantity) if (nowqty > jobmo.Quantity)
{ {
nowqty = nowqty - jobmo.Quantity; nowqty = nowqty - jobmo.Quantity;
dal.UpdateWorkState_Car(jobmo.Matchid, jobmo.Quantity, jobmo.Sku, jobmo.ID, checkquaantity, model.UserCode); dal.UpdateWorkState_Car(jobmo.OrderID, jobmo.Quantity, jobmo.Sku, jobmo.ID, checkquaantity, model.UserCode);
} }
else else
{ {
dal.UpdateWorkState_Car(jobmo.Matchid, jobmo.Quantity, jobmo.Sku, jobmo.ID, checkquaantity, model.UserCode); dal.UpdateWorkState_Car(jobmo.OrderID, jobmo.Quantity, jobmo.Sku, jobmo.ID, checkquaantity, model.UserCode);
nowqty = 0; nowqty = 0;
} }
} }
@ -401,7 +401,7 @@ namespace Epost.BLL
{ {
foreach (JobModel jobmo in downlist.ToArray()) foreach (JobModel jobmo in downlist.ToArray())
{ {
dal.UpdateWorkState_Car(jobmo.Matchid, jobmo.Quantity, jobmo.Sku, jobmo.ID, checkquaantity, model.UserCode); dal.UpdateWorkState_Car(jobmo.OrderID, jobmo.Quantity, jobmo.Sku, jobmo.ID, checkquaantity, model.UserCode);
} }
} }
@ -409,7 +409,7 @@ namespace Epost.BLL
else else
{ {
dal.UpdateWorkState_Car(model.Matchid, truequantity, model.Sku, model.ID, checkquaantity, model.UserCode); dal.UpdateWorkState(model.OrderID, truequantity, model.Sku, model.ID, checkquaantity, model.UserCode);
} }
@ -731,13 +731,13 @@ namespace Epost.BLL
#endregion #endregion
#region #region
public List<JobModel> GetOrderList(string matchid, string block, string sku = "", string area = "", string UserCode = "") public List<JobModel> GetOrderList(string orderid, string block, string sku = "", string area = "", string UserCode = "")
{ {
try try
{ {
List<JobModel> list = new List<JobModel>(); List<JobModel> list = new List<JobModel>();
DataTable OrderDt = dal.GetOrderList_Car(matchid, sku, area, block); DataTable OrderDt = dal.GetOrderList_Car(orderid, sku, area, block);
bool isecho = false; bool isecho = false;
//if (OrderDt == null || OrderDt.Rows.Count == 0)//回显 //if (OrderDt == null || OrderDt.Rows.Count == 0)//回显
//{ //{
@ -749,12 +749,12 @@ namespace Epost.BLL
{ {
string usercode = string.Empty; string usercode = string.Empty;
string lightcolor = string.Empty; string lightcolor = string.Empty;
DataTable udt = dal.GetOrderUseerXCode(matchid, sku, area, block); //DataTable udt = dal.GetOrderUseerXCode(matchid, sku, area, block);
if (udt != null && udt.Rows.Count > 0) //if (udt != null && udt.Rows.Count > 0)
{ //{
usercode = udt.Rows[0]["usercode"].ToString(); // usercode = udt.Rows[0]["usercode"].ToString();
lightcolor = udt.Rows[0]["lightcolor"].ToString(); // lightcolor = udt.Rows[0]["lightcolor"].ToString();
} //}
if (string.IsNullOrEmpty(lightcolor)) if (string.IsNullOrEmpty(lightcolor))
{ {
lightcolor = EnumHelper.EMToDescriptionString(LightColor.Color.Red); lightcolor = EnumHelper.EMToDescriptionString(LightColor.Color.Red);
@ -780,7 +780,14 @@ namespace Epost.BLL
demodel.Area = item["Area"].ToString(); demodel.Area = item["Area"].ToString();
demodel.Address = item["address"].ToString(); demodel.Address = item["address"].ToString();
demodel.UserCode = usercode; demodel.UserCode = usercode;
demodel.ColorCode = lightcolor; demodel.ColorCode = item["labelcolor"].ToString();
demodel.looklisten = item["looklisten"].ToString();
demodel.labelIP = item["labelIP"].ToString();
demodel.labelno = item["labelno"].ToString();
demodel.genericname = item["genericname"].ToString();
demodel.manufactname = item["manufactname"].ToString();
demodel.batchno = item["batchno"].ToString();
demodel.Spec = item["Spec"].ToString();
demodel.Bkaddress = "0"; demodel.Bkaddress = "0";
demodel.Addresstype = "1"; demodel.Addresstype = "1";
demodel.ControlID = ""; demodel.ControlID = "";
@ -801,9 +808,10 @@ namespace Epost.BLL
// demodel.ColorCode = EnumHelper.EMToDescriptionString(LightColor.Color.Blue); // demodel.ColorCode = EnumHelper.EMToDescriptionString(LightColor.Color.Blue);
//} //}
list.Add(demodel); list.Add(demodel);
if (!isecho) { if (!isecho)
{
//修改数据为已读 //修改数据为已读
dal.UpOrder_Car(item["Matchid"].ToString(), item["sku"].ToString(), item["id"].ToString()); dal.UpOrder_Car(item["orderid"].ToString(), item["sku"].ToString(), item["id"].ToString());
} }
#endregion #endregion
} }
@ -813,8 +821,7 @@ namespace Epost.BLL
LogHelper.WriteLogInfo("查询无任务================"); LogHelper.WriteLogInfo("查询无任务================");
OrdersQueueModel qmodel = new OrdersQueueModel(); OrdersQueueModel qmodel = new OrdersQueueModel();
qmodel.Sku = sku; qmodel.Orderid = orderid;
qmodel.Matchid = matchid;
qmodel.UserCode = UserCode; qmodel.UserCode = UserCode;
qmodel.Taskblock = block; qmodel.Taskblock = block;
qmodel.Taskarea = area; qmodel.Taskarea = area;
@ -839,7 +846,10 @@ namespace Epost.BLL
} }
} }
public DataTable GetOrderList(string Orderid, string area, string block)
{
return dal.GetOrderList(Orderid, area, block);
}
#endregion #endregion
@ -940,6 +950,16 @@ namespace Epost.BLL
} }
#endregion #endregion
#region
public bool ImportOrderinfo(DataTable ds, Dictionary<string, string> diclist)
{
bool bo = false;
if (ds != null && ds.Rows.Count > 0)
{
bo = dal.ImportOrderinfo(ds, diclist);
}
return bo;
}
public DataTable GetMatchOrderList() public DataTable GetMatchOrderList()
{ {
@ -1004,7 +1024,7 @@ namespace Epost.BLL
{ {
return dal.GetMatchOrder(); return dal.GetMatchOrder();
} }
#endregion
#region #region
public DataTable GetOrderList_Car(string matchid, string sku, string sarea, string sblock) public DataTable GetOrderList_Car(string matchid, string sku, string sarea, string sblock)
@ -1018,5 +1038,38 @@ namespace Epost.BLL
return dal.GetOrderList_echo(matchid, sku, sarea, sblock); return dal.GetOrderList_echo(matchid, sku, sarea, sblock);
} }
#endregion #endregion
public DataTable GetDataIfRepeat(string transderMid, string transderDid)
{
return dal.GetDataIfRepeat(transderMid, transderDid);
}
public bool UpOrdersState(string orderid)
{
return dal.UpOrdersState(orderid);
}
#region
public DataTable GetlocationInfo(string location)
{
return dal.GetlocationInfo(location);
}
#endregion
public bool UpOrdersState(string Area,string block)
{
return dal.UpdateState(Area, block);
}
public bool IsFinishWorkArea(string block, string usercode = "", string area = "", string sku = "", string shopid = "", string orderid = "")
{
return dal.IsFinishWorkArea(block,usercode,area,sku,shopid,orderid);
}
#region
public bool UpOrdersWaitState(string orderid)
{
return dal.UpOrdersWaitState(orderid);
}
#endregion
} }
} }

View File

@ -206,6 +206,31 @@ namespace Epost.BLL
} }
#endregion #endregion
#region
public ResultModel Forcedend(string orderid)
{
try
{
List<JobModel> jobList = JobCache.GetPlanJobList().FindAll(x => x.OrderID == orderid);
ResultModel resultModel = comBLL.Forcedend(orderid);
comBLL.ClearArea_M(jobList);
JobCache.UpdateJobModelList(jobList, EcommendType.Execute);
return resultModel;
}
catch (Exception ex)
{
LogHelper.WriteLogInfo("强制结束熄灭标签异常" + ex.ToString());
ResultModel resultModel = new ResultModel();
resultModel.result = "-1";
resultModel.msg = "强制结束熄灭标签异常:" + ex.ToString() + "";
return resultModel;
}
}
#endregion.
#endregion #endregion
#region #region
@ -334,11 +359,7 @@ namespace Epost.BLL
} }
DataTable queueDT = queueBLL.getQueueOrderState(qmodel); DataTable queueDT = queueBLL.getQueueOrderState(qmodel);
if (queueDT != null && queueDT.Rows.Count > 0)
{
skulist = queueDT.Rows[0]["sku"].ToString();
LogHelper.WriteLogInfo("=======" + qmodel.UserCode + "=====" + area + "区===sku=" + skulist);
}
#region #region
//if (data.Loc == "check")//任意回显标签拍下 熄灭回显设备 //if (data.Loc == "check")//任意回显标签拍下 熄灭回显设备
//{ //{
@ -398,8 +419,8 @@ namespace Epost.BLL
} }
} }
downCacheDAL.UpdateJobDownModelList(new List<ResultMessageModel> { data }, EdownCommend.Execute); downCacheDAL.UpdateJobDownModelList(new List<ResultMessageModel> { data }, EdownCommend.Execute);
List<JobModel> rjob = job.FindAll(m => m.Block == data.Block && m.State == 3); List<JobModel> finList = jobList.FindAll(m => m.Block == block && m.Area == area && m.State == 3);
JobCache.UpdateJobModelList(rjob, EcommendType.Execute); JobCache.UpdateJobModelList(finList, EcommendType.Execute);
} }
#endregion #endregion
@ -422,63 +443,58 @@ namespace Epost.BLL
List<JobModel> downlist = new List<JobModel>(); List<JobModel> downlist = new List<JobModel>();
JobModel model = job.FirstOrDefault(); JobModel model = job.FirstOrDefault();
downlist.Add(model); downlist.Add(model);
int endcount = 1; model.State = 3;
List<JobModel> manyList = job.FindAll(m => m.ManyState == 1 && m.Tolocation == model.Tolocation && m.Sku == model.Sku); List<JobModel> manyList = job.FindAll(m => m.ManyState == 1 && m.Tolocation == model.Tolocation && m.Sku == model.Sku);
if (manyList.Any())//合并显示数 #region
{ //int endcount = 1;
endcount = manyList.Count; //if (manyList.Any())//合并显示数据
downlist.AddRange(manyList); //{
LogHelper.WriteLogInfo("合并显示数据" + endcount + "============================"); // endcount = manyList.Count;
} // downlist.AddRange(manyList);
else // LogHelper.WriteLogInfo("合并显示数据" + endcount + "============================");
{ //}
downlist.Add(model); //else
} //{
// downlist.Add(model);
//}
#endregion
orderbll.UpdateOrderState_Car(downlist, model, truequantity, checkquantity); orderbll.UpdateOrderState_Car(downlist, model, truequantity, checkquantity);
LogHelper.WriteLogInfo("6------" + data.Address + "------" + model.Sku + "----" + model.State + ""); LogHelper.WriteLogInfo("拍下------" + data.Address + "------" + model.OrderID + "----" + model.State + "");
bool skuInish = dal.IsFinishWork(1, block, "", area, model.Sku, "", model.Matchid); //bool skuInish = dal.IsFinishWork(1, block, "", area, "", "", model.OrderID);
bool skuInish = dal.IsFinishWork(1, block, "", area, "", "", "");
if (skuInish) if (skuInish)
{ {
LogHelper.WriteLogInfo(data.Address + "=========------------------" + data.Parameter); //LogHelper.WriteLogInfo(data.Address + "=========------------------" + data.Parameter);
comBLL.DISPLAY_LIGHT_BLOCK(model.Block, data.Area, "0");
LogHelper.WriteLogInfo("通道拣货完成--------------");
//删除sku缓存信息
//List<JobModel> rjob = jobList.FindAll(m => m.Block == data.Block && m.Area == data.Area && m.Sku == model.Sku);
//JobCache.UpdateJobModelList(rjob, EcommendType.Execute);
//bool allfinish = dal.IsFinishWork_box("", 0, model.OrderID);
//if (allfinish)
//{
#region #region
OrdersQueueModel qumodel = new OrdersQueueModel(); OrdersQueueModel qumodel = new OrdersQueueModel();
qumodel.State = 3; qumodel.State = 3;
qumodel.Taskblock = block; qumodel.Taskblock = block;
qumodel.Taskarea = area; qumodel.Taskarea = area;
qumodel.Sku = model.Sku; //qumodel.Orderid = model.OrderID;
qumodel.Matchid = model.Matchid;
queueBLL.UpdateQueueTaskArea_Car(qumodel); queueBLL.UpdateQueueTaskArea_Car(qumodel);
#endregion #endregion
Thread.Sleep(30);
LogHelper.WriteLogInfo("区SKU拣选完成--------------");
//删除sku缓存信息
List<ResultMessageModel> scanlist = downCacheDAL.GetPlanJobDownList().FindAll(p => p.Parameter == model.Sku && p.Command == "QUERY_SCAN_STATUS" && p.Area == area);
downCacheDAL.UpdateJobDownModelList(scanlist, EdownCommend.Execute);
List<JobModel> rjob = jobList.FindAll(m => m.Block == data.Block && m.Sku == model.Sku);
JobCache.UpdateJobModelList(rjob, EcommendType.Execute);
bool allfinish = dal.IsFinishWork_box("", 0, model.Matchid);
if (allfinish)
{
//修改订单状态 //修改订单状态
orderbll.UpdateOrderState_Car(downlist, model, 1, checkquantity); dal.UpdateState(model.Area, model.Block);
bool lbo = dal.UpdateLocation(block, area);
dal.UpdateStateByCar(model.Matchid);
content = "此运单号作业已完成\r\r";
ShowMessageModel_M showmodel = new ShowMessageModel_M(); bool WorkArea = dal.IsFinishWorkArea("", "", "99", "", "", "");
showmodel.Area = area; if (WorkArea)
showmodel.Block = block; {
showmodel.Color = color; comBLL.DISPLAY_LIGHT_BLOCK_Out("", model.Area, "0");
showmodel.Islock = true;
showmodel.Title = model.Matchid;
showmodel.No = "01";
showmodel.IsTwinkle = 0;
showmodel.Contents = content;
showmodel.Type = 2;
comBLL.ShowBoxMessage_M(showmodel);//点亮显示标签
} }
//}
} }
} }
@ -515,9 +531,37 @@ namespace Epost.BLL
//当前区没有作业 //当前区没有作业
if (queueDT.Rows[0]["state"].ToString() == "0") if (queueDT.Rows[0]["state"].ToString() == "0")
{ {
model.Id = Convert.ToInt32(queueDT.Rows[0]["id"].ToString());
model.State = 1;
//orderbll.GetOrderList(queueDT.Rows[0]["Orderid"].ToString(), nblock, "", narea, queueDT.Rows[0]["usercode"].ToString());
//orderbll.GetOrderList("", nblock, "", narea, queueDT.Rows[0]["usercode"].ToString());
queueBLL.UpdateQueueOrderState(model);//缓存队列状态修改
}
DataTable orderdt = orderbll.GetOrderList("", narea, nblock);
if (orderdt != null && orderdt.Rows.Count > 0)
{
orderbll.GetOrderList("", nblock, "", narea, queueDT.Rows[0]["usercode"].ToString());
}
}
else
{
DataTable QueueDt = queueBLL.getQueueState(model);
if (QueueDt == null || QueueDt.Rows.Count <= 0)
{
DataTable orderdt = orderbll.GetOrderList("", narea, nblock);
if (orderdt != null && orderdt.Rows.Count > 0)
{
OrdersQueueModel qmodel = new OrdersQueueModel();
qmodel.Taskblock = nblock;
qmodel.Taskarea = narea;
qmodel.UserCode = "";
//qmodel.Orderid = orderdt.Rows[0]["orderid"].ToString();
queueBLL.insertQueueOrders(qmodel);
}
}
}
displayOrder(queueDT, nblock, narea, list, model); displayOrder(queueDT, nblock, narea, list, model);
}
}
#endregion #endregion
} }
@ -536,44 +580,44 @@ namespace Epost.BLL
#region #region
public void displayOrder(DataTable queueDT, string nblock, string narea, List<LabelParamModel> list, OrdersQueueModel model) public void displayOrder(DataTable queueDT, string nblock, string narea, List<LabelParamModel> list, OrdersQueueModel model)
{ {
model.Id = Convert.ToInt32(queueDT.Rows[0]["id"].ToString());
#region #region
List<JobModel> jobList = JobCache.GetPlanJobList(); List<JobModel> jobList = JobCache.GetPlanJobList();
List<JobModel> isJobList = jobList.FindAll(p => p.Block == nblock && p.Area == narea && p.State != 3); if (queueDT != null && queueDT.Rows.Count > 0)
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()); ShowMessageModel showmodel = new ShowMessageModel();
////获取当前区任务并加入缓存
//if (!isJobList.Any())
//{
List<JobModel> nowJoblist = jobList.FindAll(p => p.State == 0 && p.Block == model.Taskblock && p.Area == model.Taskarea); List<JobModel> nowJoblist = jobList.FindAll(p => p.State == 0 && p.Block == model.Taskblock && p.Area == model.Taskarea);
if (nowJoblist.Any()) if (nowJoblist.Any())
{ {
var nowmodel = nowJoblist.FirstOrDefault(); var nowmodel = nowJoblist.FirstOrDefault();
LogHelper.WriteLogInfo("进入任务点亮=====matchid=" + nowmodel.Matchid + "===orderid===" + nowmodel.OrderID + "=====sku==" + nowmodel.Sku + "========");
#region #region
foreach (JobModel item in nowJoblist.ToArray()) foreach (JobModel item in nowJoblist.ToArray())
{ {
if (item.State == 0) List<JobModel> isshowList = jobList.FindAll(p => p.Address == item.Address && p.ControlIP == item.ControlIP && p.State == 1);
if (!isshowList.Any())
{ {
List<JobModel> manyJoblist = nowJoblist.FindAll(m => m.Tolocation == item.Tolocation); #region
int quantity = item.Quantity;
#region #region
if (manyJoblist.Count > 1)//同一个货位的数据合并显示 //List<JobModel> manyJoblist = nowJoblist.FindAll(m => m.Tolocation == item.Tolocation);
{ int quantity = item.Quantity;
quantity = 0; //if (manyJoblist.Count > 1)//同一个货位的数据合并显示
if (manyJoblist.FindAll(m => m.State == 0).Any()) //{
{ // quantity = 0;
foreach (JobModel mitem in manyJoblist) // if (manyJoblist.FindAll(m => m.State == 0).Any())
{ // {
quantity += mitem.Quantity; // foreach (JobModel mitem in manyJoblist)
mitem.State = 1; // {
mitem.ManyState = 1; // quantity += mitem.Quantity;
} // mitem.State = 1;
} // mitem.ManyState = 1;
} // }
// }
//}
#endregion #endregion
LabelParamModel lamodel = new LabelParamModel(); LabelParamModel lamodel = new LabelParamModel();
@ -581,23 +625,105 @@ namespace Epost.BLL
lamodel.Address = address; lamodel.Address = address;
lamodel.ControlIP = item.ControlIP.ToString(); lamodel.ControlIP = item.ControlIP.ToString();
lamodel.Command = "DISPLAY_JOB"; lamodel.Command = "DISPLAY_JOB";
lamodel.Uid = item.ID;
lamodel.Type = "N";
lamodel.Title = item.genericname;
string manufactname = string.Empty;
if (!string.IsNullOrEmpty(item.manufactname) && item.manufactname.Length > 4)
{
manufactname = item.manufactname.Substring(0, 4);
}
lamodel.Content = "" + item.Sku.Substring(item.Sku.Length - 4, 4) + "\\t" + item.Spec + "\r" + item.GoodsName + "\r批号" + item.batchno + " " + manufactname + "";
var aryloc = item.Tolocation.Split('-');
lamodel.Loc = "" + aryloc[0].ToString() + "-" + aryloc[1].ToString() + "";
lamodel.W_quantity = aryloc[2].ToString();
lamodel.Quantity = quantity.ToString(); lamodel.Quantity = quantity.ToString();
lamodel.Unit = item.Unit;
lamodel.PicChoose = "";
#region
if (item.looklisten == "18")
{
lamodel.PicChoose = "02";//听似
}
else if (item.looklisten == "17")
{
lamodel.PicChoose = "03";//看似
}
else if (item.looklisten == "16")
{
lamodel.PicChoose = "04";//多规
}
else if (item.looklisten == "无")
{
lamodel.PicChoose = "05";//易混淆
}
#endregion
lamodel.Uid = item.ID; lamodel.Uid = item.ID;
lamodel.Mode = queueDT.Rows[0]["lightcolor"].ToString() + "0"; lamodel.Type = "C";
string color = EnumHelper.EMToDescriptionString(LightColor.Color.Red);
#region
if (item.ColorCode == "1")
{
color = EnumHelper.EMToDescriptionString(LightColor.Color.Red);
}
else if (item.ColorCode == "2")
{
color = EnumHelper.EMToDescriptionString(LightColor.Color.Blue);
}
else if (item.ColorCode == "3")
{
color = EnumHelper.EMToDescriptionString(LightColor.Color.Green);
}
else if (item.ColorCode == "4")
{
color = EnumHelper.EMToDescriptionString(LightColor.Color.Cyan);
}
else if (item.ColorCode == "5")
{
color = EnumHelper.EMToDescriptionString(LightColor.Color.Yellow);
}
else if (item.ColorCode == "6")
{
color = EnumHelper.EMToDescriptionString(LightColor.Color.White);
}
else if (item.ColorCode == "7")
{
color = EnumHelper.EMToDescriptionString(LightColor.Color.Pink);
}
#endregion
lamodel.Mode = color + "0";
list.Add(lamodel); list.Add(lamodel);
item.State = 1; #region
item.ColorCode = queueDT.Rows[0]["lightcolor"].ToString(); List<JobModel> isJobListss = jobList.FindAll(p => p.Area == narea && p.Block == nblock && p.State == 1);
item.DisplayTime = DateTime.Now; if (!isJobListss.Any())
{
comBLL.DISPLAY_LIGHT_BLOCK(model.Taskblock, model.Taskarea, "F");
}
List<JobModel> isJobLists = jobList.FindAll(p => p.Area == narea && p.State == 1);
if (!isJobLists.Any())
{
comBLL.DISPLAY_LIGHT_BLOCK_Out("", model.Taskarea, "F");
} }
#endregion #endregion
#region
//comBLL.DISPLAY_LIGHT_BLOCK(model.Taskblock, model.Taskarea, "1"); item.State = 1;
item.DisplayTime = DateTime.Now;
#endregion #endregion
}
#endregion
} }
if (list != null && list.Count > 0) if (list != null && list.Count > 0)
{ {
@ -605,21 +731,14 @@ namespace Epost.BLL
comBLL.DISPLAY_JOBALL(list); comBLL.DISPLAY_JOBALL(list);
} }
} }
else //else
{//无任务 //{//无任务
LogHelper.WriteLogInfo("点亮====无任务======================="); // LogHelper.WriteLogInfo("点亮====无任务=======================");
model.State = 3; // model.State = 3;
} // queueBLL.UpdateQueueOrderState(model);//缓存队列状态修改
//}
#endregion #endregion
if (jobList.Any())
{
var finishList = jobList.FindAll(p => p.State == 0);
if (!finishList.Any())
{
queueBLL.UpdateQueueOrderState(model);//缓存队列状态修改
}
}
} }
//else //else
//{ //{

View File

@ -127,9 +127,9 @@ namespace Epost.BLL
} }
#endregion #endregion
#region #region
public bool updateOrderQueueState(string usercode, string block) public bool updateOrderQueueState()
{ {
return dal.updateOrderQueueState(usercode,block); return dal.updateOrderQueueState();
} }
#endregion #endregion

View File

@ -163,13 +163,17 @@ namespace Epost.DAL
string strwhere = string.Empty; string strwhere = string.Empty;
if (!string.IsNullOrEmpty(area)) if (!string.IsNullOrEmpty(area))
{ {
strwhere = " and area='"+area+"'"; strwhere += " and area='" + area + "'";
} }
string sql = string.Format("select address,bkaddress,state,type,area,way,shelfid,ControlID,location,layer,slist,block,addresstype,ControlIP,ControlType,info from V_address where type='{1}' and block='{0}' " + strwhere, if (!string.IsNullOrEmpty(block))
{
strwhere += " and block='" + block + "'";
}
string sql = string.Format("select address,bkaddress,state,type,area,way,shelfid,ControlID,location,layer,slist,block,addresstype,ControlIP,ControlType,info from V_address where type='{1}' " + strwhere,
block, block,
type); type);
LogHelper.WriteLogInfo("根据区域 查询显示地址"+sql); LogHelper.WriteLogInfo("根据区域 查询显示地址---通道灯" + sql);
return db.GetsqlForDT(sql); return db.GetsqlForDT(sql);
} }
@ -809,5 +813,20 @@ namespace Epost.DAL
} }
#endregion #endregion
#region
public DataTable GetForcedendAddress(string orderid)
{
string sql = string.Format("select distinct ControlIP,address from v_orders where orderid='" + orderid + "' and oprationstate!=3");
DataTable dt = db.GetsqlForDT(sql);
return dt;
}
public DataTable GetForcedendAddress()
{
string sql = string.Format("select distinct ControlIP from v_orders ");
DataTable dt = db.GetsqlForDT(sql);
return dt;
}
#endregion
} }
} }

View File

@ -139,7 +139,14 @@ namespace Epost.DAL.Cache
} }
else if (CommendType.Equals(EcommendType.CompleteAll))
{
//删除作业任务 已完成
foreach (var planitem in PlanJobList.ToArray())
{
PlanJobList.Remove(planitem);
}
}
return true; return true;
} }
} }
@ -186,7 +193,12 @@ namespace Epost.DAL.Cache
/// 作业完成 /// 作业完成
/// </summary> /// </summary>
[Description("作业完成")] [Description("作业完成")]
Complete Complete,
/// <summary>
/// 作业完成
/// </summary>
[Description("作业完成")]
CompleteAll
} }
} }

View File

@ -650,6 +650,7 @@ namespace Epost.DAL
sendModel.W_unit = ControlDetail[i].W_unit; sendModel.W_unit = ControlDetail[i].W_unit;
sendModel.W_quantity = ControlDetail[i].W_quantity; sendModel.W_quantity = ControlDetail[i].W_quantity;
sendModel.Loc = ControlDetail[i].Loc; sendModel.Loc = ControlDetail[i].Loc;
sendModel.PicChoose = ControlDetail[i].PicChoose;
sendModel.Timeout ="0.5"; sendModel.Timeout ="0.5";
list.Add(sendModel); list.Add(sendModel);

View File

@ -10,7 +10,7 @@ namespace Epost.DAL
public class DB_Oracle public class DB_Oracle
{ {
private DataBaseOpration.OprationOraDAL db; private DataBaseOpration.OprationOraDAL db;
private string _strOracleMIDConnString = ConfigurationManager.ConnectionStrings["OraMidConnString"].ConnectionString; //private string _strOracleMIDConnString = ConfigurationManager.ConnectionStrings["OraMidConnString"].ConnectionString;
public DB_Oracle() public DB_Oracle()
{ {
@ -31,12 +31,12 @@ namespace Epost.DAL
{ {
//如实例不存在则New一个新实例否则返回已有实例 //如实例不存在则New一个新实例否则返回已有实例
if (db == null) //if (db == null)
{ //{
db = new DataBaseOpration.OprationOraDAL(_strOracleMIDConnString); // db = new DataBaseOpration.OprationOraDAL(_strOracleMIDConnString);
} //}
return db; return db;

View File

@ -36,19 +36,23 @@ namespace Epost.DAL
#region #region
public DataTable GetOrderList_Car(string matchid, string sku, string area, string block) public DataTable GetOrderList_Car(string orderid, string sku, string area, string block)
{ {
try try
{ {
string strwhere = string.Empty; string strwhere = string.Empty;
if (!string.IsNullOrEmpty(matchid)) if (!string.IsNullOrEmpty(orderid))
{ {
strwhere = "and matchid= '" + matchid + "'"; strwhere = "and orderid= '" + orderid + "'";
}
if (!string.IsNullOrEmpty(sku))
{
strwhere = "and sku= '" + sku + "' ";
} }
string sql = string.Empty; string sql = string.Empty;
if (!string.IsNullOrEmpty(area)) if (!string.IsNullOrEmpty(area))
{ {
sql = string.Format("select id, Matchid, orderid, barcode, BatchId, DownDate, Tolocation, Sku, GoodsName, Discount, Quantity, address, ControlIP,area, block,unit,shopid from v_orders where state = 0 and oprationstate <>3 and sku = '{0}' and block = '{1}' and area='{2}' " + strwhere + "", sql = string.Format("select id,transderDid,orderid,Sku,genericname,GoodsName,Spec,Unit,batchno,manufactname,Quantity,stockquantity,shopname,Tolocation,labelcolor,looklisten,labelIP,labelno,Matchid,barcode,BatchId,DownDate,Discount,address,ControlIP,area,block,shopid from v_orders where state = 0 and oprationstate =0 and block = '{1}' and area='{2}' " + strwhere + "",
sku, sku,
block, area); block, area);
@ -56,7 +60,7 @@ namespace Epost.DAL
} }
else else
{ {
sql = string.Format("select id, Matchid, orderid, barcode, BatchId, DownDate, Tolocation, Sku, GoodsName, Discount, Quantity, address, ControlIP, area , block,unit,shopid from v_orders where state = 0 and oprationstate <>3 and sku = '{0}' and block = '{1}' " + strwhere + "", sql = string.Format("select id,transderDid,orderid,Sku,genericname,GoodsName,Spec,Unit,batchno,manufactname,Quantity,stockquantity,shopname,Tolocation,labelcolor,looklisten,labelIP,labelno,Matchid,barcode,BatchId,DownDate,Discount,address,ControlIP,area,block,shopid from v_orders where state = 0 and oprationstate =0 and sku = '{0}' and block = '{1}' " + strwhere + "",
sku, sku,
block); block);
@ -74,6 +78,27 @@ namespace Epost.DAL
} }
} }
public DataTable GetOrderList(string Orderid, string area, string block)
{
try
{
string strwhere = string.Empty;
if (!string.IsNullOrEmpty(Orderid))
{
strwhere += " and orderid='" + Orderid + "'";
}
string sql = string.Format("select id,transderDid,orderid,Sku,genericname,GoodsName,Spec,unit,batchno,manufactname,Quantity,stockquantity,shopname,Tolocation,labelcolor,looklisten,labelIP,labelno,Matchid,barcode,BatchId,DownDate,Discount,address,ControlIP,area,block,shopid from v_orders where state = 0 and oprationstate=0 and block = '{0}' and area='{1}' " + strwhere + "",
block, area);
return db.GetsqlForDT(sql);
}
catch (Exception ex)
{
LogHelper.WriteLogInfo("获取订单信息异常:" + ex.Message);
return null;
}
}
#endregion #endregion
@ -482,7 +507,7 @@ namespace Epost.DAL
string sql = string.Empty; string sql = string.Empty;
if (!string.IsNullOrEmpty(id)) if (!string.IsNullOrEmpty(id))
{ {
sql = string.Format(" update orders set oprationstate=1,oprationtime='{0}' where matchid='{1}' and id='{2}'", sql = string.Format(" update orders set oprationstate=1,oprationtime='{0}' where orderid='{1}' and id='{2}'",
DateTime.Now.ToString(), DateTime.Now.ToString(),
orderid, orderid,
@ -490,7 +515,7 @@ namespace Epost.DAL
} }
else else
{ {
sql = string.Format(" update orders set oprationstate=1,oprationtime='{0}' where matchid='{1}' and sku='{2}'", sql = string.Format(" update orders set oprationstate=1,oprationtime='{0}' where orderid='{1}' and sku='{2}'",
DateTime.Now.ToString(), DateTime.Now.ToString(),
orderid, orderid,
sku); sku);
@ -622,7 +647,7 @@ namespace Epost.DAL
#endregion #endregion
#region #region
public bool UpdateWorkState_Car(string matchid, int truequantity, string sku, string id, int checkquantity, string usercode = "") public bool UpdateWorkState_Car(string orderid, int truequantity, string sku, string id, int checkquantity, string usercode = "")
{ {
try try
{ {
@ -646,10 +671,59 @@ namespace Epost.DAL
// } // }
// truequantity = trueqty + 1; // truequantity = trueqty + 1;
// } // }
string upsql = string.Format("update orders set oprationstate = '{3}' ,oprationtime='{0}',oprationcode='{5}',truequantity='{1}' where matchid='{2}' and id='{4}' ", string upsql = string.Format("update orders set oprationstate = '{3}' ,oprationtime='{0}',oprationcode='{5}',truequantity='{1}' where orderid='{2}' and id='{4}' ",
DateTime.Now.ToString(), DateTime.Now.ToString(),
truequantity, truequantity,
matchid, orderid,
oprationstate,
id,
// checkquantity,
usercode
);
long x = db.UpdateSql(upsql);
LogHelper.WriteLogInfo("修改当前标签拣货状态:" + upsql + ",成功条数:" + x + "");
if (x > 0)
return true;
return false;
}
}
catch (Exception ex)
{
LogHelper.WriteLogInfo("修改当前标签拣货状态异常:" + ex.Message);
return false;
}
}
public bool UpdateWorkState(string orderid, int truequantity, string sku, string id, int checkquantity, string usercode = "")
{
try
{
lock (uplock)
{
int oprationstate = 3;
// string sql = string.Format("select quantity,truequantity from orders where matchid='{0}' and sku = '{1}' and batchid='{2}'",
// matchid,
// sku,
// batchid);
//DataTable dt= db.GetsqlForDT(sql);
// if (dt!=null&&dt.Rows.Count > 0)
// {
// int trueqty =Convert.ToInt32( dt.Rows[0]["truequantity"].ToString());
// int quantity =Convert.ToInt32( dt.Rows[0]["quantity"].ToString());
// if (trueqty + 1 == quantity)
// {
// oprationstate = 3;
// }
// truequantity = trueqty + 1;
// }
string upsql = string.Format("update orders set oprationstate = '{3}' ,oprationtime='{0}',oprationcode='{5}',truequantity=quantity where orderid='{2}' and id='{4}' ",
DateTime.Now.ToString(),
truequantity,
orderid,
oprationstate, oprationstate,
id, id,
// checkquantity, // checkquantity,
@ -718,7 +792,7 @@ namespace Epost.DAL
#endregion #endregion
#region #region
public bool UpdateStateByCar(string matchid, string block = "", string sku = "") public bool UpdateStateByCar(string OrderID, string block = "", string sku = "")
{ {
try try
{ {
@ -731,9 +805,39 @@ namespace Epost.DAL
{ {
strwhere += " and sku='" + sku + "'"; strwhere += " and sku='" + sku + "'";
} }
string upsql = string.Format("update orders set state=3 where matchid = '{0}'" + strwhere, string upsql = string.Format("update orders set state=3 where OrderID = '{0}'" + strwhere,
matchid); OrderID);
LogHelper.WriteLogInfo("修改波次拣货状态:" + upsql); LogHelper.WriteLogInfo("修改单据拣货状态:" + upsql);
long x = db.UpdateSql(upsql);
if (x > 0)
return true;
return false;
}
catch (Exception ex)
{
LogHelper.WriteLogInfo("修改当前小车拣货状态:" + ex.Message);
return false;
}
}
public bool UpdateState(string area, string block = "", string sku = "")
{
try
{
string strwhere = string.Empty;
if (!string.IsNullOrEmpty(block))
{
strwhere = " and block='" + block + "'";
}
if (!string.IsNullOrEmpty(sku))
{
strwhere += " and sku='" + sku + "'";
}
string upsql = string.Format("update v_orders set state=3 where area ='" + area + "' " + strwhere);
LogHelper.WriteLogInfo("修改通道拣货状态:" + upsql);
long x = db.UpdateSql(upsql); long x = db.UpdateSql(upsql);
if (x > 0) if (x > 0)
return true; return true;
@ -1040,7 +1144,7 @@ namespace Epost.DAL
#endregion #endregion
#region sku是否为已完成 #region sku是否为已完成
public bool IsFinishWork(int endcount, string block, string usercode = "", string area = "", string sku = "", string shopid = "", string matchid = "") public bool IsFinishWork(int endcount, string block, string usercode = "", string area = "", string sku = "", string shopid = "", string orderid = "")
{ {
string strwheres = ""; string strwheres = "";
if (!string.IsNullOrEmpty(usercode)) if (!string.IsNullOrEmpty(usercode))
@ -1061,17 +1165,17 @@ namespace Epost.DAL
{ {
strwheres += " and shopid ='" + shopid + "'"; strwheres += " and shopid ='" + shopid + "'";
} }
if (!string.IsNullOrEmpty(matchid)) if (!string.IsNullOrEmpty(orderid))
{ {
strwheres += " and matchid ='" + matchid + "'"; strwheres += " and orderid ='" + orderid + "'";
} }
string sql = "select matchid, sku from V_orders where oprationstate <> 3 and state<>99 and block ='" + block + "' " + strwheres; string sql = "select matchid, sku from V_orders where oprationstate <> 3 and state<>99 and block ='" + block + "' " + strwheres;
LogHelper.WriteLogInfo("判断当前sku是否为已完成" + sql); LogHelper.WriteLogInfo("判断当前通道是否为已完成" + sql);
DataTable dt = db.GetsqlForDT(sql); DataTable dt = db.GetsqlForDT(sql);
if (dt == null || dt.Rows.Count == 0) if (dt == null || dt.Rows.Count == 0)
{ {
LogHelper.WriteLogInfo("判断当前sku是否为已完成true"); LogHelper.WriteLogInfo("判断当前通道是否为已完成true");
return true; return true;
} }
@ -1083,6 +1187,59 @@ namespace Epost.DAL
} }
#endregion #endregion
#region
public bool IsFinishWorkArea(string block, string usercode = "", string area = "", string sku = "", string shopid = "", string orderid = "")
{
string strwheres = "";
if (!string.IsNullOrEmpty(usercode))
{
strwheres = " and sku in(select sku from ordersqueue where usercode = '" + usercode + "')";
}
if (!string.IsNullOrEmpty(sku))
{
strwheres += " and sku ='" + sku + "'";
}
if (!string.IsNullOrEmpty(block))
{
strwheres += " and block ='" + block + "'";
}
if (!string.IsNullOrEmpty(area))
{
strwheres += " and area ='" + area + "'";
}
if (!string.IsNullOrEmpty(orderid))
{
strwheres += " and orderid ='" + orderid + "'";
}
if (!string.IsNullOrEmpty(shopid))
{
strwheres += " and shopid ='" + shopid + "'";
}
if (!string.IsNullOrEmpty(orderid))
{
strwheres += " and orderid ='" + orderid + "'";
}
string sql = "select matchid, sku from V_orders where oprationstate <> 3 and state<>99 " + strwheres;
LogHelper.WriteLogInfo("判断阴凉区是否为已完成" + sql);
DataTable dt = db.GetsqlForDT(sql);
if (dt == null || dt.Rows.Count == 0)
{
LogHelper.WriteLogInfo("判断阴凉区是否为已完成true");
return true;
}
else
{
LogHelper.WriteLogInfo("判断阴凉区是否为已完成false");
return false;
}
}
#endregion
#region #region
public int getOrderarea(string usercode, string block, string area) public int getOrderarea(string usercode, string block, string area)
{ {
@ -2838,22 +2995,22 @@ namespace Epost.DAL
#endregion #endregion
#region #region
public bool IsFinishWork_box(string boxcode, int endcount, string matchid = "") public bool IsFinishWork_box(string boxcode, int endcount, string OrderID = "")
{ {
string sql = string.Format("select matchid from Orders where (matchid='{0}') and oprationstate<>3", string sql = string.Format("select OrderID from Orders where (OrderID='{0}') and oprationstate<>3",
matchid); OrderID);
LogHelper.WriteLogInfo("判断整箱状态为已完成" + sql); LogHelper.WriteLogInfo("判断单据状态为已完成" + sql);
DataTable dt = db.GetsqlForDT(sql); DataTable dt = db.GetsqlForDT(sql);
if (dt == null || dt.Rows.Count == endcount) if (dt == null || dt.Rows.Count == endcount)
{ {
LogHelper.WriteLogInfo("判断整箱状态为已完成true"); LogHelper.WriteLogInfo("判断单据状态为已完成true");
return true; return true;
} }
else else
{ {
LogHelper.WriteLogInfo("判断整箱状态为已完成false"); LogHelper.WriteLogInfo("判断单据状态为已完成false");
return false; return false;
} }
@ -2861,5 +3018,58 @@ namespace Epost.DAL
#endregion #endregion
#endregion #endregion
public DataTable GetDataIfRepeat(string transderMid, string transderDid)
{
string sql = string.Format("select distinct orderid,transderDid from Orders where orderid='" + transderMid + "' and transderDid='" + transderDid + "' ");
DataTable dt = db.GetsqlForDT(sql);
return dt;
}
public bool UpOrdersState(string orderid)
{
string strwhere = string.Empty;
if (!string.IsNullOrEmpty(orderid))
{
strwhere += " and orderid='" + orderid + "'";
}
string sql = string.Format("update Orders set oprationstate='3',quantity=truequantity,state='3' where 1=1 " + strwhere + "");
long x = db.UpdateSql(sql);
LogHelper.WriteLogInfo("接口灭灯-修改状态:" + sql + ",执行条数:" + x + "");
if (x > 0)
{
return true;
}
else
{
return false;
}
}
#region
public DataTable GetlocationInfo(string location)
{
string sql = string.Format("select location from Addressstorage where location='" + location + "' ");
DataTable dt = db.GetsqlForDT(sql);
return dt;
}
#endregion
#region
public bool UpOrdersWaitState(string orderid)
{
string sql = string.Format("update Orders set oprationstate='3' where orderid='" + orderid + "' and state!=1 ");
long x = db.UpdateSql(sql);
LogHelper.WriteLogInfo("接口灭灯-一对多标签-修改等待亮灯的状态:" + sql + ",执行条数:" + x + "");
if (x > 0)
{
return true;
}
else
{
return false;
}
}
#endregion
} }
} }

View File

@ -68,7 +68,7 @@ namespace Epost.DAL
#region #region
public DataTable getQueuesbyState() public DataTable getQueuesbyState()
{ {
string sql = "select * from OrdersQueue where state<>0 and state<>3"; string sql = "select * from OrdersQueue where state<>3";
return db.GetsqlForDT(sql); return db.GetsqlForDT(sql);
} }
@ -89,7 +89,12 @@ namespace Epost.DAL
#region #region
public DataTable getQueueOrderState(OrdersQueueModel model) public DataTable getQueueOrderState(OrdersQueueModel model)
{ {
string sql = string.Format("select * from OrdersQueue where taskblock='{0}' and taskarea='{1}' and state<>2 and state<>3 order by sort", string strwhere = string.Empty;
if (!string.IsNullOrEmpty(model.Orderid))
{
strwhere += " and orderid='" + model.Orderid + "'";
}
string sql = string.Format("select * from OrdersQueue where taskblock='{0}' and taskarea='{1}' and state<>2 and state<>3 " + strwhere + " order by sort",
model.Taskblock, model.Taskblock,
model.Taskarea); model.Taskarea);
return db.GetsqlForDT(sql); return db.GetsqlForDT(sql);
@ -122,7 +127,7 @@ namespace Epost.DAL
#region #region
public DataTable getQueueState(OrdersQueueModel model) public DataTable getQueueState(OrdersQueueModel model)
{ {
string sql = string.Format("select * from OrdersQueue where taskblock='{0}' and taskarea='{1}' and state=1", string sql = string.Format("select * from OrdersQueue where state=1 and Taskblock='{0}' and Taskarea='{1}'",
model.Taskblock, model.Taskblock,
model.Taskarea); model.Taskarea);
return db.GetsqlForDT(sql); return db.GetsqlForDT(sql);
@ -186,10 +191,10 @@ namespace Epost.DAL
#endregion #endregion
#region #region
public bool updateOrderQueueState(string usercode, string block) public bool updateOrderQueueState()
{ {
string sql = string.Format("update ordersqueue set state =3 where usercode='{0}' and taskblock ='{1}'", string sql = string.Format("update ordersqueue set state =3 where state<>3"
usercode, block); );
LogHelper.WriteLogInfo("修改作业全部完成" + sql); LogHelper.WriteLogInfo("修改作业全部完成" + sql);
long x = db.UpdateSql(sql); long x = db.UpdateSql(sql);
if (x > 0) if (x > 0)
@ -290,10 +295,12 @@ namespace Epost.DAL
{ {
strwhere += "and Taskarea='" + model.Taskarea + "'"; strwhere += "and Taskarea='" + model.Taskarea + "'";
} }
string sql = string.Format("update OrdersQueue set state='{0}' where state<>3 and sku = '{1}' and matchid='{2}' and usercode='{3}'"+ strwhere, if (!string.IsNullOrEmpty(model.Orderid))
{
strwhere += "and Orderid='" + model.Orderid + "'";
}
string sql = string.Format("update OrdersQueue set state='{0}' where state<>3 " + strwhere,
model.State model.State
,model.Sku,
model.Matchid,model.UserCode
); );
LogHelper.WriteLogInfo("修改作业区段" + sql); LogHelper.WriteLogInfo("修改作业区段" + sql);

View File

@ -99,7 +99,14 @@ namespace Epost.Model
_GoodsName = value; _GoodsName = value;
} }
} }
public string looklisten { get; set; }
public string labelIP { get; set; }
public string labelno { get; set; }
public string genericname { get; set; }
public string manufactname { get; set; }
public string batchno { get; set; }
public string transderDid { get; set; }
public string Spec { get; set; }
//public string Discount //public string Discount
//{ //{
// get // get

View File

@ -37,4 +37,41 @@ namespace Epost.Model
} }
} }
} }
public class main
{
public msg msg { get; set; }
}
public class msg
{
private string _result = string.Empty;
private string _msg = string.Empty;
public string Status
{
get
{
return _result;
}
set
{
_result = value;
}
}
public string Message
{
get
{
return _msg;
}
set
{
_msg = value;
}
}
}
} }

View File

@ -165,7 +165,31 @@ namespace Epost.DPS.Controllers
#endregion #endregion
[Route("CloseLight")]
[HttpPost]
public ResultModel CloseLight(string orderid)
{
lock (lockinit)
{
ResultModel res = new ResultModel();
try
{
res = contrbll.Forcedend(orderid);
return res;
}
catch (Exception ex)
{
LogHelper.WriteLogInfo("GetDataList异常" + ex.Message);
res.msg = "请求异常!";
res.result = "-1";
return res;
}
}
}
} }

View File

@ -230,6 +230,10 @@
</Compile> </Compile>
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Startup.cs" /> <Compile Include="Startup.cs" />
<Compile Include="WebService\WebService.asmx.cs">
<DependentUpon>WebService.asmx</DependentUpon>
<SubType>Component</SubType>
</Compile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Content Include="Content\bootstrap-theme.css" /> <Content Include="Content\bootstrap-theme.css" />
@ -854,6 +858,7 @@
<Content Include="Content\code\themes\sand-signika.js.map" /> <Content Include="Content\code\themes\sand-signika.js.map" />
<Content Include="Content\code\themes\skies.js.map" /> <Content Include="Content\code\themes\skies.js.map" />
<Content Include="Content\code\themes\sunset.js.map" /> <Content Include="Content\code\themes\sunset.js.map" />
<Content Include="WebService\WebService.asmx" />
<None Include="Properties\PublishProfiles\Toolsweb.pubxml" /> <None Include="Properties\PublishProfiles\Toolsweb.pubxml" />
<Content Include="Scripts\jquery\jquery-1.11.1.js" /> <Content Include="Scripts\jquery\jquery-1.11.1.js" />
<Content Include="Content\js\payment.js" /> <Content Include="Content\js\payment.js" />
@ -954,7 +959,7 @@
<AutoAssignPort>True</AutoAssignPort> <AutoAssignPort>True</AutoAssignPort>
<DevelopmentServerPort>52610</DevelopmentServerPort> <DevelopmentServerPort>52610</DevelopmentServerPort>
<DevelopmentServerVPath>/</DevelopmentServerVPath> <DevelopmentServerVPath>/</DevelopmentServerVPath>
<IISUrl>http://localhost:63119/</IISUrl> <IISUrl>http://localhost:63118/</IISUrl>
<NTLMAuthentication>False</NTLMAuthentication> <NTLMAuthentication>False</NTLMAuthentication>
<UseCustomServer>False</UseCustomServer> <UseCustomServer>False</UseCustomServer>
<CustomServerUrl> <CustomServerUrl>

View File

@ -11,7 +11,7 @@
<SiteUrlToLaunchAfterPublish /> <SiteUrlToLaunchAfterPublish />
<LaunchSiteAfterPublish>true</LaunchSiteAfterPublish> <LaunchSiteAfterPublish>true</LaunchSiteAfterPublish>
<ExcludeApp_Data>false</ExcludeApp_Data> <ExcludeApp_Data>false</ExcludeApp_Data>
<publishUrl>D:\驿传\SanYing_DAS-T后台</publishUrl> <publishUrl>D:\驿传\抚远</publishUrl>
<DeleteExistingFiles>true</DeleteExistingFiles> <DeleteExistingFiles>true</DeleteExistingFiles>
<PrecompileBeforePublish>true</PrecompileBeforePublish> <PrecompileBeforePublish>true</PrecompileBeforePublish>
<EnableUpdateable>true</EnableUpdateable> <EnableUpdateable>true</EnableUpdateable>

View File

@ -6,8 +6,8 @@
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup> <PropertyGroup>
<TimeStampOfAssociatedLegacyPublishXmlFile /> <TimeStampOfAssociatedLegacyPublishXmlFile />
<_PublishTargetUrl>D:\驿传\SanYing_DAS-T后台</_PublishTargetUrl> <_PublishTargetUrl>D:\驿传\抚远</_PublishTargetUrl>
<History>True|2023-07-03T05:53:41.0701316Z;True|2023-04-27T20:14:15.0331014+08:00;True|2023-04-21T16:37:45.9559800+08:00;True|2023-04-20T19:12:32.4520337+08:00;True|2023-04-20T18:51:17.9201241+08:00;True|2023-04-20T16:36:34.8353434+08:00;True|2023-04-19T11:42:01.7398184+08:00;True|2023-04-19T11:37:42.0024926+08:00;True|2023-04-18T15:36:56.8763198+08:00;True|2023-04-18T14:56:45.8672402+08:00;True|2023-04-17T10:51:00.4138485+08:00;True|2023-04-16T18:42:38.2510554+08:00;False|2023-04-16T18:42:10.5319125+08:00;True|2023-04-16T18:32:05.9038034+08:00;True|2023-04-16T17:11:22.6510841+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-09-14T07:16:49.3254427Z;True|2023-09-14T15:15:13.5226711+08:00;True|2023-09-14T13:29:32.8021478+08:00;True|2023-09-13T10:41:55.1565224+08:00;True|2023-09-11T11:07:13.1727541+08:00;True|2023-09-04T13:33:29.7459963+08:00;True|2023-09-01T16:56:41.0563400+08:00;False|2023-09-01T16:55:48.4344805+08:00;True|2023-09-01T13:48:48.7619456+08:00;False|2023-09-01T13:47:55.1222255+08:00;True|2023-08-31T12:12:45.4579572+08:00;False|2023-08-31T12:03:58.6171819+08:00;False|2023-08-31T12:03:32.2416438+08:00;True|2023-08-29T14:40:55.7436382+08:00;True|2023-08-29T13:53:07.9540335+08:00;True|2023-08-28T18:11:01.9231397+08:00;True|2023-08-28T14:56:19.8843265+08:00;True|2023-08-23T11:17:33.7204155+08:00;True|2023-08-11T10:59:03.8399200+08:00;True|2023-08-10T10:43:16.0729140+08:00;True|2023-08-08T15:22:08.0127989+08:00;True|2023-08-08T13:59:07.6838749+08:00;True|2023-08-08T13:57:15.7160673+08:00;True|2023-08-03T15:39:49.2488696+08:00;True|2023-08-03T13:13:24.0839734+08:00;True|2023-08-02T14:19:21.5188473+08:00;True|2023-08-02T10:44:46.7436910+08:00;True|2023-08-01T10:42:26.5280618+08:00;True|2023-07-28T15:54:24.3172356+08:00;True|2023-07-25T17:25:54.2443213+08:00;True|2023-07-25T17:24:33.4620388+08:00;True|2023-07-19T16:26:31.8476193+08:00;True|2023-07-19T16:04:27.8753884+08:00;True|2023-07-19T15:38:50.9706808+08:00;True|2023-07-03T13:53:41.0701316+08:00;True|2023-04-27T20:14:15.0331014+08:00;True|2023-04-21T16:37:45.9559800+08:00;True|2023-04-20T19:12:32.4520337+08:00;True|2023-04-20T18:51:17.9201241+08:00;True|2023-04-20T16:36:34.8353434+08:00;True|2023-04-19T11:42:01.7398184+08:00;True|2023-04-19T11:37:42.0024926+08:00;True|2023-04-18T15:36:56.8763198+08:00;True|2023-04-18T14:56:45.8672402+08:00;True|2023-04-17T10:51:00.4138485+08:00;True|2023-04-16T18:42:38.2510554+08:00;False|2023-04-16T18:42:10.5319125+08:00;True|2023-04-16T18:32:05.9038034+08:00;True|2023-04-16T17:11:22.6510841+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/16/2023 15:06:26</publishTime> <publishTime>04/16/2023 15:06:26</publishTime>
</File> </File>
<File Include="bin/App_global.asax.compiled"> <File Include="bin/App_global.asax.compiled">
<publishTime>07/03/2023 13:53:15</publishTime> <publishTime>09/14/2023 15:14:45</publishTime>
</File> </File>
<File Include="bin/App_global.asax.dll"> <File Include="bin/App_global.asax.dll">
<publishTime>07/03/2023 13:53:15</publishTime> <publishTime>09/14/2023 15:14:45</publishTime>
</File> </File>
<File Include="bin/BouncyCastle.Crypto.dll"> <File Include="bin/BouncyCastle.Crypto.dll">
<publishTime>02/24/2020 15:29:24</publishTime> <publishTime>02/24/2020 15:29:24</publishTime>
</File> </File>
<File Include="bin/Common.dll"> <File Include="bin/Common.dll">
<publishTime>07/03/2023 13:52:54</publishTime> <publishTime>09/01/2023 16:55:14</publishTime>
</File> </File>
<File Include="bin/Common.pdb"> <File Include="bin/Common.pdb">
<publishTime>07/03/2023 13:52:54</publishTime> <publishTime>09/01/2023 16:55:14</publishTime>
</File> </File>
<File Include="bin/ComposerSDK.dll"> <File Include="bin/ComposerSDK.dll">
<publishTime>04/16/2023 15:06:26</publishTime> <publishTime>04/16/2023 15:06:26</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>07/03/2023 13:52:56</publishTime> <publishTime>09/14/2023 15:14:25</publishTime>
</File> </File>
<File Include="bin/Epost.BLL.pdb"> <File Include="bin/Epost.BLL.pdb">
<publishTime>07/03/2023 13:52:56</publishTime> <publishTime>09/14/2023 15:14:25</publishTime>
</File> </File>
<File Include="bin/Epost.BLL.XmlSerializers.dll"> <File Include="bin/Epost.BLL.XmlSerializers.dll">
<publishTime>08/26/2020 18:09:48</publishTime> <publishTime>08/26/2020 18:09:48</publishTime>
</File> </File>
<File Include="bin/Epost.DAL.dll"> <File Include="bin/Epost.DAL.dll">
<publishTime>07/03/2023 13:52:55</publishTime> <publishTime>09/14/2023 15:14:24</publishTime>
</File> </File>
<File Include="bin/Epost.DAL.pdb"> <File Include="bin/Epost.DAL.pdb">
<publishTime>07/03/2023 13:52:55</publishTime> <publishTime>09/14/2023 15:14:24</publishTime>
</File> </File>
<File Include="bin/Epost.DPS.dll"> <File Include="bin/Epost.DPS.dll">
<publishTime>07/03/2023 13:53:00</publishTime> <publishTime>09/14/2023 15:14:32</publishTime>
</File> </File>
<File Include="bin/Epost.DPS.pdb"> <File Include="bin/Epost.DPS.pdb">
<publishTime>07/03/2023 13:53:00</publishTime> <publishTime>09/14/2023 15:14:32</publishTime>
</File> </File>
<File Include="bin/Epost.Model.dll"> <File Include="bin/Epost.Model.dll">
<publishTime>04/16/2023 17:10:57</publishTime> <publishTime>07/19/2023 15:37:56</publishTime>
</File> </File>
<File Include="bin/Epost.Model.pdb"> <File Include="bin/Epost.Model.pdb">
<publishTime>04/16/2023 17:10:57</publishTime> <publishTime>07/19/2023 15:37:56</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>
@ -5652,7 +5652,7 @@
<publishTime>04/16/2023 15:06:27</publishTime> <publishTime>04/16/2023 15:06:27</publishTime>
</File> </File>
<File Include="PrecompiledApp.config"> <File Include="PrecompiledApp.config">
<publishTime>07/03/2023 13:53:05</publishTime> <publishTime>09/14/2023 15:14:36</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>
@ -7572,7 +7572,10 @@
<publishTime>04/16/2023 15:06:27</publishTime> <publishTime>04/16/2023 15:06:27</publishTime>
</File> </File>
<File Include="Web.config"> <File Include="Web.config">
<publishTime>04/16/2023 17:11:05</publishTime> <publishTime>08/31/2023 12:02:52</publishTime>
</File>
<File Include="WebService/WebService.asmx">
<publishTime>07/19/2023 15:30:16</publishTime>
</File> </File>
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -10,12 +10,10 @@
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --> <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
</configSections> </configSections>
<connectionStrings> <connectionStrings>
<add name="weijie_dpsEntities" connectionString="metadata=res://*/WJDB.csdl|res://*/WJDB.ssdl|res://*/WJDB.msl;provider=System.Data.SqlClient;provider connection string=&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=FuYuan;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=BaBi_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="MysqlLocDPSConnection" connectionString="Server=localhost;Port=3306;Database=world;User=root; Password=antion;SslMode=None;Pooling=true;Allow User Variables=True;" />
<add name="WMSConnection" connectionString="data source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=139.196.36.200)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=EpostDB)));user id=C##Test;password=test" /> <!--<add name="OraMidConnString" connectionString="data source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=139.196.36.200)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=EpostDB)));user id=C##Test;password=test" />-->
<add name="OraMidConnString" 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" />
</connectionStrings> </connectionStrings>
@ -27,11 +25,11 @@
<add key="ControlXML" value="/App_Data/EpostController.xml" /> <add key="ControlXML" value="/App_Data/EpostController.xml" />
<add key="LabelXML" value="/App_Data/AddressStorage.xml" /> <add key="LabelXML" value="/App_Data/AddressStorage.xml" />
<add key="ResultsXML" value="/App_Data/Results.xml" /> <add key="ResultsXML" value="/App_Data/Results.xml" />
<add key="WebAPIUrl" value="http://localhost:63119/api/WebAPI/ProcessingResult"/> <add key="WebAPIUrl" value="http://localhost:63118/api/WebAPI/ProcessingResult"/>
<add key="ShowMode" value="1" /> <add key="ShowMode" value="1" />
<add key="SetupMode" value="\Epost_P\Epost.TestToolsWeb\App_Data\SetupMode.txt" /> <add key="SetupMode" value="\Epost_P\Epost.TestToolsWeb\App_Data\SetupMode.txt" />
<add key="CARID" value="HT01" /> <add key="CARID" value="" />
<add key="ServerAPIURL" value="http://localhost:63119/api/WebAPI" /> <add key="ServerAPIURL" value="http://localhost:63118/api/WebAPI" />
<add key="SleepTime" value="1" /> <add key="SleepTime" value="1" />
</appSettings> </appSettings>
<!-- <!--
@ -48,11 +46,12 @@
</customErrors> </customErrors>
<authentication mode="None" /> <authentication mode="None" />
<compilation debug="true" targetFramework="4.6.1" /> <compilation debug="true" targetFramework="4.6.1" />
<httpRuntime targetFramework="4.5.2" /> <httpRuntime targetFramework="4.5.2" requestValidationMode="2.0" />
<httpModules> <httpModules>
<add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule, Microsoft.AI.Web" /> <add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule, Microsoft.AI.Web" />
</httpModules> </httpModules>
<sessionState mode="InProc" timeout="518400" /> <sessionState mode="InProc" timeout="518400" />
<pages validateRequest="false" />
</system.web> </system.web>
<system.webServer> <system.webServer>
<modules> <modules>

View File

@ -0,0 +1 @@
<%@ WebService Language="C#" CodeBehind="WebService.asmx.cs" Class="Epost.DPS.WebService.WebService" %>

View File

@ -0,0 +1,352 @@
using Epost.BLL;
using Epost.Common;
using Epost.DAL;
using Epost.DAL.Cache;
using Epost.Model;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Security.Policy;
using System.Web;
using System.Web.Helpers;
using System.Web.Razor.Tokenizer.Symbols;
using System.Web.Services;
namespace Epost.DPS.WebService
{
/// <summary>
/// WebService 的摘要说明
/// </summary>
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.ComponentModel.ToolboxItem(false)]
// 若要允许使用 ASP.NET AJAX 从脚本中调用此 Web 服务,请取消注释以下行。
// [System.Web.Script.Services.ScriptService]
public class WebService : System.Web.Services.WebService
{
OrderBLL bll = new OrderBLL();
OrdersQueueBLL queueBLL = new OrdersQueueBLL();
CommandDAL dal = new CommandDAL();
CommandBLL combll = new CommandBLL();
AddressstorageBLL addbll = new AddressstorageBLL();
private object obj = new object();
JobModelCacheDAL JobCache = new JobModelCacheDAL();
[WebMethod]
public string ReceiveDataInfo_XML(string action, string messages)
{
lock (obj)
{
LogHelper.WriteLogInfo("WebService请求报文");
LogHelper.WriteLogInfo("action" + action + "");
LogHelper.WriteLogInfo("messages" + messages + "");
main main = new main();
msg msg = new msg();
var resultxml = string.Empty;
try
{
if (!string.IsNullOrEmpty(messages))
{
bool flag = true;
string mms = string.Empty;
LogHelper.WriteLogInfo("======开始处理数据======");
DataSet set = XmlHelper.GetDataSetStrXml(messages.Replace("&", "").Replace("#", "").Replace("△", "").Replace("☆", "").Replace("=", "").Replace("】", "").Replace("【", "").Replace(" ", "").Replace("\"", "").Replace("", ":").Replace("", "(").Replace("", ")").Replace("×", "x").Replace("ω", "w").Replace("α", "a"));
if (set != null && set.Tables.Count > 0 && set.Tables[0].Rows.Count > 0)
{
var ReturnDt = set.Tables["pick"];
DataTable dtResult = ReturnDt.Clone();
foreach (DataRow item in ReturnDt.Rows)
{
#region /
//灭灯
if (item["TaskType"].ToString() == "Y")
{
List<LabelParamModel> list = new List<LabelParamModel>();
//熄灭指定订单任务
if (item["Current"].ToString() == "Y")
{
List<JobModel> jobWaitList = JobCache.GetPlanJobList().FindAll(p => p.OrderID == item["transderMid"].ToString() && p.State != 1);
LogHelper.WriteLogInfo("熄灭指定订单亮灯任务---一对多标签---修改等待亮灯的状态---订单号:" + item["transderMid"].ToString() + "---条数:" + jobWaitList.Count + "");
JobCache.UpdateJobModelList(jobWaitList, EcommendType.Execute);
bll.UpOrdersWaitState(item["transderMid"].ToString());
List<JobModel> jobList = JobCache.GetPlanJobList().FindAll(p => p.OrderID == item["transderMid"].ToString());
LogHelper.WriteLogInfo("熄灭指定订单亮灯任务---订单号:" + item["transderMid"].ToString() + "---条数:" + jobList.Count + "");
if (jobList != null && jobList.Count > 0)
{
foreach (var itemlist in jobList)
{
LabelParamModel model = new LabelParamModel();
model.ControlIP = itemlist.ControlIP.ToString();
model.Address = itemlist.Address.ToString();
model.Command = "REMOVE_JOB";
model.Uid = itemlist.ID.ToString();
model.Type = "C";
list.Add(model);
itemlist.State = 3;
List<JobModel> downlist = new List<JobModel>();
downlist.Add(itemlist);
bll.UpdateOrderState_Car(downlist, itemlist, itemlist.Quantity, 0);
List<JobModel> ExjobList = JobCache.GetPlanJobList().FindAll(p => p.Block == itemlist.Block && p.Area == itemlist.Area && p.State != 3);
if (!ExjobList.Any())
{
LogHelper.WriteLogInfo("熄灭指定订单任务-熄灭通道灯:" + itemlist.Block + "++++" + itemlist.Area + "");
combll.DISPLAY_LIGHT_BLOCK(itemlist.Block, itemlist.Area, "0");
bool skuInish = bll.IsFinishWork(1, itemlist.Block, "", itemlist.Area, "", "", "");
if (skuInish)
{
LogHelper.WriteLogInfo("通道拣货完成--------------");
#region
OrdersQueueModel qumodel = new OrdersQueueModel();
qumodel.State = 3;
qumodel.Taskblock = itemlist.Block;
qumodel.Taskarea = itemlist.Area;
queueBLL.UpdateQueueTaskArea_Car(qumodel);
#endregion
bool WorkArea = bll.IsFinishWorkArea("", "", "99", "", "", "");
if (WorkArea)
{
LogHelper.WriteLogInfo("阴凉区完成--------------");
if (WorkArea)
{
combll.DISPLAY_LIGHT_BLOCK_Out("", itemlist.Area, "0");
}
}
}
}
}
dal.SendALL(list);
bool b = bll.UpOrdersState(item["transderMid"].ToString());
JobCache.UpdateJobModelList(jobList, EcommendType.Execute);
flag = false;
}
else
{
msg.Status = "erro";
msg.Message = "标签熄灭失败:当前标签未亮灯!";
main.msg = msg;
resultxml = XmlHelper.ModelToXml(main);
LogHelper.WriteLogInfo("标签熄灭失败:当前标签未亮灯!");
return resultxml;
}
}
//熄灭全部
else if (item["Current"].ToString() == "N")
{
List<JobModel> jobList = JobCache.GetPlanJobList();
if (jobList != null && jobList.Count > 0)
{
DataTable dt = addbll.GetForcedendAddress();
foreach (DataRow additem in dt.Rows)
{
LabelParamModel model = new LabelParamModel();
model.ControlIP = additem["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 = additem["ControlIP"].ToString();
model.Address = "9999";
model.Parameter = "11111000";
model.Command = "UNLOCK";
model.Timeout = "0.5";
list.Add(model);
combll.LED_OFF_CLEAR(additem["ControlIP"].ToString());
}
dal.SendALL(list);
bool b = bll.UpOrdersState("");
//修改队列状态
queueBLL.updateOrderQueueState();
JobCache.UpdateJobModelList(jobList, EcommendType.CompleteAll);
flag = false;
}
else
{
msg.Status = "erro";
msg.Message = "标签熄灭失败:当前标签未亮灯!";
main.msg = msg;
resultxml = XmlHelper.ModelToXml(main);
LogHelper.WriteLogInfo("标签熄灭失败:当前标签未亮灯!");
return resultxml;
}
}
else
{
msg.Status = "erro";
msg.Message = "数据异常Current参数为空或参数不正确";
main.msg = msg;
resultxml = XmlHelper.ModelToXml(main);
LogHelper.WriteLogInfo("数据异常Current参数为空或参数不正确");
return resultxml;
}
}
else if (item["TaskType"].ToString() == "N")
{
DataTable dt = bll.GetDataIfRepeat(item["transderMid"].ToString(), item["transderDid"].ToString());
if (dt == null || dt.Rows.Count <= 0)
{
DataTable locdt = bll.GetlocationInfo(item["areaId"].ToString());
if (locdt != null && locdt.Rows.Count > 0)
{
DataRow dataRow = dtResult.NewRow();
dataRow["transderMid"] = item["transderMid"].ToString();
dataRow["transderDid"] = item["transderDid"].ToString();
dataRow["drugCode"] = item["drugCode"].ToString();
dataRow["drugCommName"] = item["drugCommName"].ToString();
dataRow["drugName"] = item["drugName"].ToString();
dataRow["drugSpec"] = item["drugSpec"].ToString();
dataRow["Unit"] = item["Unit"].ToString();
dataRow["manufactName"] = item["manufactName"].ToString();
dataRow["batchNo"] = item["batchNo"].ToString();
dataRow["expire"] = item["expire"].ToString();
dataRow["areaId"] = item["areaId"].ToString();
dataRow["pickQty"] = item["pickQty"].ToString();
dataRow["stock"] = item["stock"].ToString();
dataRow["drugStoreName"] = item["drugStoreName"].ToString();
dataRow["labelColor"] = item["labelColor"].ToString();
dataRow["lookListen"] = item["lookListen"].ToString();
dataRow["labelIP"] = item["labelIP"].ToString();
dataRow["labelNo"] = item["labelNo"].ToString();
dtResult.Rows.Add(dataRow);
}
else
{
LogHelper.WriteLogInfo("" + item["areaId"].ToString() + ",该货位不存在");
}
}
else
{
mms += "主键重复 (" + item["transderMid"].ToString() + "-" + item["transderDid"].ToString() + ")";
}
}
else
{
msg.Status = "erro";
msg.Message = "数据异常TaskType参数为空或参数不正确";
main.msg = msg;
resultxml = XmlHelper.ModelToXml(main);
LogHelper.WriteLogInfo("数据异常TaskType参数为空或参数不正确");
}
#endregion
}
#region
if (!string.IsNullOrEmpty(mms))
{
mms = mms.Substring(0, mms.Length - 1);
msg.Status = "erro";
msg.Message = "数据异常:" + mms + "";
main.msg = msg;
resultxml = XmlHelper.ModelToXml(main);
LogHelper.WriteLogInfo("数据异常:" + mms + "");
}
else
{
if (flag)
{
Dictionary<string, string> diclist = new Dictionary<string, string>();
diclist.Add("transderMid", "orderid");
diclist.Add("transderDid", "transderDid");
diclist.Add("drugCode", "sku");
diclist.Add("drugCommName", "genericname");
diclist.Add("drugName", "goodsname");
diclist.Add("drugSpec", "Spec");
diclist.Add("Unit", "unit");
diclist.Add("manufactName", "manufactname");
diclist.Add("batchNo", "batchno");
diclist.Add("expire", "orderdate");
diclist.Add("areaId", "tolocation");
diclist.Add("pickQty", "quantity");
diclist.Add("stock", "stockquantity");
diclist.Add("drugStoreName", "shopname");
diclist.Add("labelColor", "labelcolor");
diclist.Add("lookListen", "looklisten");
diclist.Add("labelIP", "labelIP");
diclist.Add("labelNo", "labelno");
bool b = bll.ImportOrderinfo(dtResult, diclist);
if (b)
{
msg.Status = "ok";
msg.Message = "接收成功";
main.msg = msg;
resultxml = XmlHelper.ModelToXml(main);
LogHelper.WriteLogInfo("接收成功");
}
else
{
msg.Status = "erro";
msg.Message = "数据异常:数据接收失败,请检查货位和标签对应关系是否正确,请重试!";
main.msg = msg;
resultxml = XmlHelper.ModelToXml(main);
LogHelper.WriteLogInfo("数据异常:数据接收失败,请重试!");
}
}
else
{
msg.Status = "ok";
msg.Message = "熄灭成功";
main.msg = msg;
resultxml = XmlHelper.ModelToXml(main);
LogHelper.WriteLogInfo("熄灭成功");
return resultxml;
}
}
#endregion
}
else
{
msg.Status = "erro";
msg.Message = "数据异常解析XML失败请检查XML格式后再进行推送";
main.msg = msg;
resultxml = XmlHelper.ModelToXml(main);
LogHelper.WriteLogInfo("数据异常解析XML失败请检查XML格式后再进行推送");
}
}
else
{
msg.Status = "erro";
msg.Message = "数据异常未在XML内获取到数据请检查后再进行推送";
main.msg = msg;
resultxml = XmlHelper.ModelToXml(main);
LogHelper.WriteLogInfo("数据异常未在XML内获取到数据请检查后再进行推送");
}
return resultxml;
}
catch (Exception ex)
{
msg.Status = "erro";
msg.Message = "数据异常:" + ex.Message + "";
main.msg = msg;
LogHelper.WriteLogInfo("数据异常:" + ex.Message + "");
return resultxml = XmlHelper.ModelToXml(main);
}
}
}
}
}