Compare commits
1 Commits
FuYuan_DPS
...
SanYing_DA
Author | SHA1 | Date | |
---|---|---|---|
aee2063646 |
@ -478,40 +478,8 @@ namespace Epost.Common
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -89,17 +89,17 @@ namespace Epost.BLL
|
||||
#endregion
|
||||
|
||||
#region 获取箱号显示标签
|
||||
public DataTable GetBoxAddress(string block, string area, int type)
|
||||
public DataTable GetBoxAddress(string block,string area,int type)
|
||||
{
|
||||
return dal.GetBoxAddress(block, area, type);
|
||||
return dal.GetBoxAddress(block,area,type);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 根据区域获取所有地址
|
||||
public DataTable getAddresslist(string block, string area, string type)
|
||||
public DataTable getAddresslist(string block, string area,string type)
|
||||
{
|
||||
return dal.getAddresslist(block, area, type);
|
||||
return dal.getAddresslist(block, area,type);
|
||||
}
|
||||
|
||||
#endregion
|
||||
@ -329,9 +329,9 @@ namespace Epost.BLL
|
||||
|
||||
|
||||
#region 获取错误信息的state
|
||||
public DataTable GetErrorState(string address, string ip)
|
||||
public DataTable GetErrorState(string address,string ip)
|
||||
{
|
||||
return dal.getErrorState(address, ip);
|
||||
return dal.getErrorState(address,ip);
|
||||
}
|
||||
#endregion
|
||||
|
||||
@ -374,17 +374,5 @@ namespace Epost.BLL
|
||||
return dal.GetAddressListByByPage(strWhere, orderby, startIndex, endIndex, out recordCount);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 根据订单获取要熄灭的标签
|
||||
public DataTable GetForcedendAddress(string orderid)
|
||||
{
|
||||
return dal.GetForcedendAddress(orderid);
|
||||
}
|
||||
|
||||
public DataTable GetForcedendAddress()
|
||||
{
|
||||
return dal.GetForcedendAddress();
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
@ -62,7 +62,7 @@ namespace Epost.BLL
|
||||
model.Command = "UNLOCK";
|
||||
model.Timeout = "0.5";
|
||||
list.Add(model);
|
||||
LED_OFF_CLEAR(item["ControlIP"].ToString());
|
||||
|
||||
}
|
||||
if (list.Any())
|
||||
{
|
||||
@ -511,7 +511,6 @@ namespace Epost.BLL
|
||||
model.ControlIP = item["ControlIP"].ToString();
|
||||
FORMATE_JOB_DATA(model);
|
||||
|
||||
LED_OFF_CLEAR(item["ControlIP"].ToString());
|
||||
}
|
||||
|
||||
}
|
||||
@ -565,14 +564,14 @@ namespace Epost.BLL
|
||||
model.Address = item.Address;
|
||||
model.Command = "REMOVE_JOB";
|
||||
model.Uid = item.ID;
|
||||
model.Type = "C";
|
||||
model.Type = "N";
|
||||
list.Add(model);
|
||||
LabelParamModel Unlockmodel = new LabelParamModel();
|
||||
Unlockmodel.ControlIP = item.ControlIP;
|
||||
Unlockmodel.Address = item.Address;
|
||||
Unlockmodel.Command = "UNLOCK";
|
||||
|
||||
Unlockmodel.Type = "C";
|
||||
Unlockmodel.Type = "N";
|
||||
Unlockmodel.Parameter = "11111000";
|
||||
list.Add(Unlockmodel);
|
||||
|
||||
@ -677,30 +676,6 @@ namespace Epost.BLL
|
||||
#endregion
|
||||
|
||||
#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)
|
||||
{
|
||||
|
||||
@ -762,55 +737,7 @@ namespace Epost.BLL
|
||||
#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
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -388,11 +388,11 @@ namespace Epost.BLL
|
||||
if (nowqty > jobmo.Quantity)
|
||||
{
|
||||
nowqty = nowqty - jobmo.Quantity;
|
||||
dal.UpdateWorkState_Car(jobmo.OrderID, jobmo.Quantity, jobmo.Sku, jobmo.ID, checkquaantity, model.UserCode);
|
||||
dal.UpdateWorkState_Car(jobmo.Matchid, jobmo.Quantity, jobmo.Sku, jobmo.ID, checkquaantity, model.UserCode);
|
||||
}
|
||||
else
|
||||
{
|
||||
dal.UpdateWorkState_Car(jobmo.OrderID, jobmo.Quantity, jobmo.Sku, jobmo.ID, checkquaantity, model.UserCode);
|
||||
dal.UpdateWorkState_Car(jobmo.Matchid, jobmo.Quantity, jobmo.Sku, jobmo.ID, checkquaantity, model.UserCode);
|
||||
nowqty = 0;
|
||||
}
|
||||
}
|
||||
@ -401,7 +401,7 @@ namespace Epost.BLL
|
||||
{
|
||||
foreach (JobModel jobmo in downlist.ToArray())
|
||||
{
|
||||
dal.UpdateWorkState_Car(jobmo.OrderID, jobmo.Quantity, jobmo.Sku, jobmo.ID, checkquaantity, model.UserCode);
|
||||
dal.UpdateWorkState_Car(jobmo.Matchid, jobmo.Quantity, jobmo.Sku, jobmo.ID, checkquaantity, model.UserCode);
|
||||
|
||||
}
|
||||
}
|
||||
@ -409,7 +409,7 @@ namespace Epost.BLL
|
||||
else
|
||||
{
|
||||
|
||||
dal.UpdateWorkState(model.OrderID, truequantity, model.Sku, model.ID, checkquaantity, model.UserCode);
|
||||
dal.UpdateWorkState_Car(model.Matchid, truequantity, model.Sku, model.ID, checkquaantity, model.UserCode);
|
||||
}
|
||||
|
||||
|
||||
@ -731,13 +731,13 @@ namespace Epost.BLL
|
||||
#endregion
|
||||
|
||||
#region 获取订单信息
|
||||
public List<JobModel> GetOrderList(string orderid, string block, string sku = "", string area = "", string UserCode = "")
|
||||
public List<JobModel> GetOrderList(string matchid, string block, string sku = "", string area = "", string UserCode = "")
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
List<JobModel> list = new List<JobModel>();
|
||||
DataTable OrderDt = dal.GetOrderList_Car(orderid, sku, area, block);
|
||||
DataTable OrderDt = dal.GetOrderList_Car(matchid, sku, area, block);
|
||||
bool isecho = false;
|
||||
//if (OrderDt == null || OrderDt.Rows.Count == 0)//回显
|
||||
//{
|
||||
@ -749,12 +749,12 @@ namespace Epost.BLL
|
||||
{
|
||||
string usercode = string.Empty;
|
||||
string lightcolor = string.Empty;
|
||||
//DataTable udt = dal.GetOrderUseerXCode(matchid, sku, area, block);
|
||||
//if (udt != null && udt.Rows.Count > 0)
|
||||
//{
|
||||
// usercode = udt.Rows[0]["usercode"].ToString();
|
||||
// lightcolor = udt.Rows[0]["lightcolor"].ToString();
|
||||
//}
|
||||
DataTable udt = dal.GetOrderUseerXCode(matchid, sku, area, block);
|
||||
if (udt != null && udt.Rows.Count > 0)
|
||||
{
|
||||
usercode = udt.Rows[0]["usercode"].ToString();
|
||||
lightcolor = udt.Rows[0]["lightcolor"].ToString();
|
||||
}
|
||||
if (string.IsNullOrEmpty(lightcolor))
|
||||
{
|
||||
lightcolor = EnumHelper.EMToDescriptionString(LightColor.Color.Red);
|
||||
@ -780,14 +780,7 @@ namespace Epost.BLL
|
||||
demodel.Area = item["Area"].ToString();
|
||||
demodel.Address = item["address"].ToString();
|
||||
demodel.UserCode = usercode;
|
||||
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.ColorCode = lightcolor;
|
||||
demodel.Bkaddress = "0";
|
||||
demodel.Addresstype = "1";
|
||||
demodel.ControlID = "";
|
||||
@ -808,10 +801,9 @@ namespace Epost.BLL
|
||||
// demodel.ColorCode = EnumHelper.EMToDescriptionString(LightColor.Color.Blue);
|
||||
//}
|
||||
list.Add(demodel);
|
||||
if (!isecho)
|
||||
{
|
||||
if (!isecho) {
|
||||
//修改数据为已读
|
||||
dal.UpOrder_Car(item["orderid"].ToString(), item["sku"].ToString(), item["id"].ToString());
|
||||
dal.UpOrder_Car(item["Matchid"].ToString(), item["sku"].ToString(), item["id"].ToString());
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
@ -821,7 +813,8 @@ namespace Epost.BLL
|
||||
LogHelper.WriteLogInfo("查询无任务================");
|
||||
|
||||
OrdersQueueModel qmodel = new OrdersQueueModel();
|
||||
qmodel.Orderid = orderid;
|
||||
qmodel.Sku = sku;
|
||||
qmodel.Matchid = matchid;
|
||||
qmodel.UserCode = UserCode;
|
||||
qmodel.Taskblock = block;
|
||||
qmodel.Taskarea = area;
|
||||
@ -846,10 +839,7 @@ namespace Epost.BLL
|
||||
}
|
||||
}
|
||||
|
||||
public DataTable GetOrderList(string Orderid, string area, string block)
|
||||
{
|
||||
return dal.GetOrderList(Orderid, area, block);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
@ -927,9 +917,9 @@ namespace Epost.BLL
|
||||
#endregion
|
||||
|
||||
#region 修改订单信息
|
||||
public bool Updatestate(string matchid, string readdate)
|
||||
public bool Updatestate(string matchid,string readdate)
|
||||
{
|
||||
return dal.Updatestate(matchid, readdate);
|
||||
return dal.Updatestate(matchid,readdate);
|
||||
}
|
||||
#endregion
|
||||
|
||||
@ -950,16 +940,6 @@ namespace Epost.BLL
|
||||
}
|
||||
#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()
|
||||
{
|
||||
@ -1004,7 +984,7 @@ namespace Epost.BLL
|
||||
|
||||
|
||||
|
||||
public bool IsFinishWorkByCar(int endcount, string matchid, string block = "")
|
||||
public bool IsFinishWorkByCar(int endcount, string matchid, string block="")
|
||||
{
|
||||
return dal.IsFinishWorkByCar(endcount, matchid, block);
|
||||
}
|
||||
@ -1024,7 +1004,7 @@ namespace Epost.BLL
|
||||
{
|
||||
return dal.GetMatchOrder();
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
#region 获取订单信息
|
||||
public DataTable GetOrderList_Car(string matchid, string sku, string sarea, string sblock)
|
||||
@ -1038,38 +1018,5 @@ namespace Epost.BLL
|
||||
return dal.GetOrderList_echo(matchid, sku, sarea, sblock);
|
||||
}
|
||||
#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
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -206,31 +206,6 @@ namespace Epost.BLL
|
||||
|
||||
}
|
||||
#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
|
||||
|
||||
#region 查询波次通道列表
|
||||
@ -359,7 +334,11 @@ namespace Epost.BLL
|
||||
|
||||
}
|
||||
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 任意回显标签拍下 熄灭回显设备
|
||||
//if (data.Loc == "check")//任意回显标签拍下 熄灭回显设备
|
||||
//{
|
||||
@ -419,8 +398,8 @@ namespace Epost.BLL
|
||||
}
|
||||
}
|
||||
downCacheDAL.UpdateJobDownModelList(new List<ResultMessageModel> { data }, EdownCommend.Execute);
|
||||
List<JobModel> finList = jobList.FindAll(m => m.Block == block && m.Area == area && m.State == 3);
|
||||
JobCache.UpdateJobModelList(finList, EcommendType.Execute);
|
||||
List<JobModel> rjob = job.FindAll(m => m.Block == data.Block && m.State == 3);
|
||||
JobCache.UpdateJobModelList(rjob, EcommendType.Execute);
|
||||
}
|
||||
#endregion
|
||||
|
||||
@ -443,58 +422,63 @@ namespace Epost.BLL
|
||||
List<JobModel> downlist = new List<JobModel>();
|
||||
JobModel model = job.FirstOrDefault();
|
||||
downlist.Add(model);
|
||||
model.State = 3;
|
||||
int endcount = 1;
|
||||
List<JobModel> manyList = job.FindAll(m => m.ManyState == 1 && m.Tolocation == model.Tolocation && m.Sku == model.Sku);
|
||||
#region 处理合并数据
|
||||
//int endcount = 1;
|
||||
//if (manyList.Any())//合并显示数据
|
||||
//{
|
||||
// endcount = manyList.Count;
|
||||
// downlist.AddRange(manyList);
|
||||
// LogHelper.WriteLogInfo("合并显示数据" + endcount + "============================");
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// downlist.Add(model);
|
||||
//}
|
||||
#endregion
|
||||
if (manyList.Any())//合并显示数据
|
||||
{
|
||||
endcount = manyList.Count;
|
||||
downlist.AddRange(manyList);
|
||||
LogHelper.WriteLogInfo("合并显示数据" + endcount + "============================");
|
||||
}
|
||||
else
|
||||
{
|
||||
downlist.Add(model);
|
||||
}
|
||||
|
||||
orderbll.UpdateOrderState_Car(downlist, model, truequantity, checkquantity);
|
||||
LogHelper.WriteLogInfo("拍下------" + data.Address + "------" + model.OrderID + "----" + model.State + "");
|
||||
//bool skuInish = dal.IsFinishWork(1, block, "", area, "", "", model.OrderID);
|
||||
bool skuInish = dal.IsFinishWork(1, block, "", area, "", "", "");
|
||||
LogHelper.WriteLogInfo("6------" + data.Address + "------" + model.Sku + "----" + model.State + "");
|
||||
bool skuInish = dal.IsFinishWork(1, block, "", area, model.Sku, "", model.Matchid);
|
||||
if (skuInish)
|
||||
{
|
||||
//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)
|
||||
//{
|
||||
LogHelper.WriteLogInfo(data.Address + "=========------------------" + data.Parameter);
|
||||
#region 修改任务队列状态
|
||||
OrdersQueueModel qumodel = new OrdersQueueModel();
|
||||
qumodel.State = 3;
|
||||
qumodel.Taskblock = block;
|
||||
qumodel.Taskarea = area;
|
||||
//qumodel.Orderid = model.OrderID;
|
||||
qumodel.Sku = model.Sku;
|
||||
qumodel.Matchid = model.Matchid;
|
||||
queueBLL.UpdateQueueTaskArea_Car(qumodel);
|
||||
#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);
|
||||
|
||||
//修改订单状态
|
||||
dal.UpdateState(model.Area, model.Block);
|
||||
|
||||
bool WorkArea = dal.IsFinishWorkArea("", "", "99", "", "", "");
|
||||
if (WorkArea)
|
||||
bool allfinish = dal.IsFinishWork_box("", 0, model.Matchid);
|
||||
if (allfinish)
|
||||
{
|
||||
comBLL.DISPLAY_LIGHT_BLOCK_Out("", model.Area, "0");
|
||||
//修改订单状态
|
||||
orderbll.UpdateOrderState_Car(downlist, model, 1, checkquantity);
|
||||
bool lbo = dal.UpdateLocation(block, area);
|
||||
dal.UpdateStateByCar(model.Matchid);
|
||||
content = "此运单号作业已完成\r\r";
|
||||
|
||||
ShowMessageModel_M showmodel = new ShowMessageModel_M();
|
||||
showmodel.Area = area;
|
||||
showmodel.Block = block;
|
||||
showmodel.Color = color;
|
||||
showmodel.Islock = true;
|
||||
showmodel.Title = model.Matchid;
|
||||
showmodel.No = "01";
|
||||
showmodel.IsTwinkle = 0;
|
||||
showmodel.Contents = content;
|
||||
showmodel.Type = 2;
|
||||
comBLL.ShowBoxMessage_M(showmodel);//点亮显示标签
|
||||
}
|
||||
//}
|
||||
}
|
||||
}
|
||||
|
||||
@ -531,37 +515,9 @@ namespace Epost.BLL
|
||||
//当前区没有作业
|
||||
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);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
}
|
||||
@ -580,44 +536,44 @@ namespace Epost.BLL
|
||||
#region 点亮设备
|
||||
public void displayOrder(DataTable queueDT, string nblock, string narea, List<LabelParamModel> list, OrdersQueueModel model)
|
||||
{
|
||||
model.Id = Convert.ToInt32(queueDT.Rows[0]["id"].ToString());
|
||||
#region 点亮任务
|
||||
List<JobModel> jobList = JobCache.GetPlanJobList();
|
||||
if (queueDT != null && queueDT.Rows.Count > 0)
|
||||
{
|
||||
|
||||
List<JobModel> isJobList = jobList.FindAll(p => p.Block == nblock && p.Area == narea && p.State != 3);
|
||||
ShowMessageModel showmodel = new ShowMessageModel();
|
||||
////获取当前区任务并加入缓存
|
||||
//if (!isJobList.Any())
|
||||
//{
|
||||
|
||||
//获取当前区任务并加入缓存
|
||||
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())
|
||||
{
|
||||
List<JobModel> isshowList = jobList.FindAll(p => p.Address == item.Address && p.ControlIP == item.ControlIP && p.State == 1);
|
||||
if (!isshowList.Any())
|
||||
if (item.State == 0)
|
||||
{
|
||||
#region
|
||||
#region 判断同一订单、同一货位多条数据 合并显示
|
||||
//List<JobModel> manyJoblist = nowJoblist.FindAll(m => m.Tolocation == item.Tolocation);
|
||||
List<JobModel> manyJoblist = nowJoblist.FindAll(m => m.Tolocation == item.Tolocation);
|
||||
int quantity = item.Quantity;
|
||||
//if (manyJoblist.Count > 1)//同一个货位的数据合并显示
|
||||
//{
|
||||
// quantity = 0;
|
||||
// if (manyJoblist.FindAll(m => m.State == 0).Any())
|
||||
// {
|
||||
// foreach (JobModel mitem in manyJoblist)
|
||||
// {
|
||||
// quantity += mitem.Quantity;
|
||||
// mitem.State = 1;
|
||||
// mitem.ManyState = 1;
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
|
||||
#region 判断同一订单、同一货位多条数据 合并显示
|
||||
if (manyJoblist.Count > 1)//同一个货位的数据合并显示
|
||||
{
|
||||
quantity = 0;
|
||||
if (manyJoblist.FindAll(m => m.State == 0).Any())
|
||||
{
|
||||
foreach (JobModel mitem in manyJoblist)
|
||||
{
|
||||
quantity += mitem.Quantity;
|
||||
mitem.State = 1;
|
||||
mitem.ManyState = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
LabelParamModel lamodel = new LabelParamModel();
|
||||
@ -625,104 +581,22 @@ namespace Epost.BLL
|
||||
lamodel.Address = address;
|
||||
lamodel.ControlIP = item.ControlIP.ToString();
|
||||
lamodel.Command = "DISPLAY_JOB";
|
||||
|
||||
|
||||
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.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.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";
|
||||
|
||||
lamodel.Type = "N";
|
||||
lamodel.Quantity = quantity.ToString();
|
||||
lamodel.Uid = item.ID;
|
||||
lamodel.Mode = queueDT.Rows[0]["lightcolor"].ToString() + "0";
|
||||
|
||||
list.Add(lamodel);
|
||||
|
||||
#region 点亮通道灯
|
||||
List<JobModel> isJobListss = jobList.FindAll(p => p.Area == narea && p.Block == nblock && p.State == 1);
|
||||
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
|
||||
|
||||
item.State = 1;
|
||||
item.ColorCode = queueDT.Rows[0]["lightcolor"].ToString();
|
||||
item.DisplayTime = DateTime.Now;
|
||||
#endregion
|
||||
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 点亮通道灯
|
||||
//comBLL.DISPLAY_LIGHT_BLOCK(model.Taskblock, model.Taskarea, "1");
|
||||
#endregion
|
||||
|
||||
}
|
||||
if (list != null && list.Count > 0)
|
||||
@ -731,14 +605,21 @@ namespace Epost.BLL
|
||||
comBLL.DISPLAY_JOBALL(list);
|
||||
}
|
||||
}
|
||||
//else
|
||||
//{//无任务
|
||||
// LogHelper.WriteLogInfo("点亮====无任务=======================");
|
||||
// model.State = 3;
|
||||
// queueBLL.UpdateQueueOrderState(model);//缓存队列状态修改
|
||||
//}
|
||||
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
|
||||
//{
|
||||
|
@ -127,9 +127,9 @@ namespace Epost.BLL
|
||||
}
|
||||
#endregion
|
||||
#region 修改作业全部完成
|
||||
public bool updateOrderQueueState()
|
||||
public bool updateOrderQueueState(string usercode, string block)
|
||||
{
|
||||
return dal.updateOrderQueueState();
|
||||
return dal.updateOrderQueueState(usercode,block);
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
@ -15,7 +15,7 @@ namespace Epost.DAL
|
||||
DataBaseOpration.OprationSqlDAL db = DB_DLL.GetInstance();
|
||||
|
||||
#region 查询设备所在区
|
||||
public DataTable getBlock(string address, string type, string controlip)
|
||||
public DataTable getBlock(string address,string type,string controlip)
|
||||
{
|
||||
string sql = "";
|
||||
if (string.IsNullOrEmpty(type))
|
||||
@ -40,7 +40,7 @@ namespace Epost.DAL
|
||||
#endregion
|
||||
|
||||
#region 根据地址查询货位信息
|
||||
public DataTable getLocationList(string address, string controlIP)
|
||||
public DataTable getLocationList(string address,string controlIP)
|
||||
{
|
||||
string sql = string.Format(" select * from addressstorage as addr left join controller as con on con.ID=addr.controlid where type=4 and address = '{0}' and ControlIP='{1}'",
|
||||
address,
|
||||
@ -94,12 +94,12 @@ namespace Epost.DAL
|
||||
#endregion
|
||||
|
||||
#region 根据地址、通道查询信息
|
||||
public DataTable getAddressListByway(string location, string block, string area, string way)
|
||||
public DataTable getAddressListByway(string location, string block, string area,string way)
|
||||
{
|
||||
string sql = string.Format(" select * from addressstorage where location = '{0}' and block='{1}' and area='{2}' and way='{3}'",
|
||||
location,
|
||||
block,
|
||||
area, way
|
||||
area,way
|
||||
);
|
||||
// LogHelper.WriteLogInfo("根据地址、通道查询信息:" + sql);
|
||||
return db.GetsqlForDT(sql);
|
||||
@ -158,34 +158,30 @@ namespace Epost.DAL
|
||||
|
||||
|
||||
#region 根据区域 查询显示箱号地址
|
||||
public DataTable GetBoxAddress(string block, string area, int type)
|
||||
public DataTable GetBoxAddress(string block,string area,int type)
|
||||
{
|
||||
string strwhere = string.Empty;
|
||||
if (!string.IsNullOrEmpty(area))
|
||||
{
|
||||
strwhere += " and area='" + area + "'";
|
||||
strwhere = " and area='"+area+"'";
|
||||
}
|
||||
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,
|
||||
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,
|
||||
block,
|
||||
|
||||
type);
|
||||
LogHelper.WriteLogInfo("根据区域 查询显示地址---通道灯" + sql);
|
||||
LogHelper.WriteLogInfo("根据区域 查询显示地址"+sql);
|
||||
return db.GetsqlForDT(sql);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 根据区域 查询显示箱号地址
|
||||
public DataTable getAddresslist(string block, string area, string type)
|
||||
public DataTable getAddresslist(string block, string area,string type)
|
||||
{
|
||||
|
||||
string sql = string.Format(" select * from V_Address where location in (select min(location) from V_Address group by address) and block = '{0}' and area = '{1}' and type ='{2}'",
|
||||
block,
|
||||
area, type);
|
||||
area,type);
|
||||
|
||||
// LogHelper.WriteLogInfo("根据区域 查询显示箱号地址" + sql);
|
||||
return db.GetsqlForDT(sql);
|
||||
@ -227,9 +223,9 @@ namespace Epost.DAL
|
||||
#endregion
|
||||
|
||||
#region 根据区域获取扫描枪地址
|
||||
public DataTable GetScanListByArea(string block, string area)
|
||||
public DataTable GetScanListByArea(string block,string area)
|
||||
{
|
||||
string sql = string.Format("select * from V_Address where type =6 and block='" + block + "' and area = '" + area + "'");
|
||||
string sql = string.Format("select * from V_Address where type =6 and block='"+block+"' and area = '"+area+"'");
|
||||
|
||||
return db.GetsqlForDT(sql);
|
||||
}
|
||||
@ -580,7 +576,7 @@ namespace Epost.DAL
|
||||
//}
|
||||
strSql.Append(" ) TT");
|
||||
string sq = strSql.Append(" WHERE TT.Row between {0} and {1}").ToString();
|
||||
string sq1 = string.Format(sq, startIndex, endIndex);
|
||||
string sq1= string.Format(sq, startIndex, endIndex);
|
||||
string sq3 = string.Format(sq, 0, 100000);
|
||||
|
||||
List<AddressstorageModel> list = ModelConvertHelper<AddressstorageModel>.ConvertToList(db.GetsqlForDT(sq1.ToString()));
|
||||
@ -813,20 +809,5 @@ namespace Epost.DAL
|
||||
}
|
||||
#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
|
||||
}
|
||||
}
|
||||
|
@ -139,14 +139,7 @@ namespace Epost.DAL.Cache
|
||||
|
||||
|
||||
}
|
||||
else if (CommendType.Equals(EcommendType.CompleteAll))
|
||||
{
|
||||
//删除作业任务 已完成
|
||||
foreach (var planitem in PlanJobList.ToArray())
|
||||
{
|
||||
PlanJobList.Remove(planitem);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@ -193,12 +186,7 @@ namespace Epost.DAL.Cache
|
||||
/// 作业完成
|
||||
/// </summary>
|
||||
[Description("作业完成")]
|
||||
Complete,
|
||||
/// <summary>
|
||||
/// 作业完成
|
||||
/// </summary>
|
||||
[Description("作业完成")]
|
||||
CompleteAll
|
||||
Complete
|
||||
|
||||
}
|
||||
}
|
@ -650,7 +650,6 @@ namespace Epost.DAL
|
||||
sendModel.W_unit = ControlDetail[i].W_unit;
|
||||
sendModel.W_quantity = ControlDetail[i].W_quantity;
|
||||
sendModel.Loc = ControlDetail[i].Loc;
|
||||
sendModel.PicChoose = ControlDetail[i].PicChoose;
|
||||
|
||||
sendModel.Timeout ="0.5";
|
||||
list.Add(sendModel);
|
||||
|
@ -10,7 +10,7 @@ namespace Epost.DAL
|
||||
public class DB_Oracle
|
||||
{
|
||||
private DataBaseOpration.OprationOraDAL db;
|
||||
//private string _strOracleMIDConnString = ConfigurationManager.ConnectionStrings["OraMidConnString"].ConnectionString;
|
||||
private string _strOracleMIDConnString = ConfigurationManager.ConnectionStrings["OraMidConnString"].ConnectionString;
|
||||
|
||||
public DB_Oracle()
|
||||
{
|
||||
@ -31,12 +31,12 @@ namespace Epost.DAL
|
||||
{
|
||||
|
||||
//如实例不存在,则New一个新实例,否则返回已有实例
|
||||
//if (db == null)
|
||||
//{
|
||||
if (db == null)
|
||||
{
|
||||
|
||||
// db = new DataBaseOpration.OprationOraDAL(_strOracleMIDConnString);
|
||||
db = new DataBaseOpration.OprationOraDAL(_strOracleMIDConnString);
|
||||
|
||||
//}
|
||||
}
|
||||
return db;
|
||||
|
||||
|
||||
|
@ -36,23 +36,19 @@ namespace Epost.DAL
|
||||
|
||||
|
||||
#region 获取订单信息
|
||||
public DataTable GetOrderList_Car(string orderid, string sku, string area, string block)
|
||||
public DataTable GetOrderList_Car(string matchid, string sku, string area, string block)
|
||||
{
|
||||
try
|
||||
{
|
||||
string strwhere = string.Empty;
|
||||
if (!string.IsNullOrEmpty(orderid))
|
||||
if (!string.IsNullOrEmpty(matchid))
|
||||
{
|
||||
strwhere = "and orderid= '" + orderid + "'";
|
||||
}
|
||||
if (!string.IsNullOrEmpty(sku))
|
||||
{
|
||||
strwhere = "and sku= '" + sku + "' ";
|
||||
strwhere = "and matchid= '" + matchid + "'";
|
||||
}
|
||||
string sql = string.Empty;
|
||||
if (!string.IsNullOrEmpty(area))
|
||||
{
|
||||
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 + "",
|
||||
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 + "",
|
||||
|
||||
sku,
|
||||
block, area);
|
||||
@ -60,7 +56,7 @@ namespace Epost.DAL
|
||||
}
|
||||
else
|
||||
{
|
||||
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 + "",
|
||||
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 + "",
|
||||
|
||||
sku,
|
||||
block);
|
||||
@ -78,27 +74,6 @@ 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
|
||||
|
||||
|
||||
@ -507,7 +482,7 @@ namespace Epost.DAL
|
||||
string sql = string.Empty;
|
||||
if (!string.IsNullOrEmpty(id))
|
||||
{
|
||||
sql = string.Format(" update orders set oprationstate=1,oprationtime='{0}' where orderid='{1}' and id='{2}'",
|
||||
sql = string.Format(" update orders set oprationstate=1,oprationtime='{0}' where matchid='{1}' and id='{2}'",
|
||||
DateTime.Now.ToString(),
|
||||
orderid,
|
||||
|
||||
@ -515,7 +490,7 @@ namespace Epost.DAL
|
||||
}
|
||||
else
|
||||
{
|
||||
sql = string.Format(" update orders set oprationstate=1,oprationtime='{0}' where orderid='{1}' and sku='{2}'",
|
||||
sql = string.Format(" update orders set oprationstate=1,oprationtime='{0}' where matchid='{1}' and sku='{2}'",
|
||||
DateTime.Now.ToString(),
|
||||
orderid,
|
||||
sku);
|
||||
@ -647,7 +622,7 @@ namespace Epost.DAL
|
||||
#endregion
|
||||
|
||||
#region 修改当前标签拣货状态
|
||||
public bool UpdateWorkState_Car(string orderid, int truequantity, string sku, string id, int checkquantity, string usercode = "")
|
||||
public bool UpdateWorkState_Car(string matchid, int truequantity, string sku, string id, int checkquantity, string usercode = "")
|
||||
{
|
||||
try
|
||||
{
|
||||
@ -671,59 +646,10 @@ namespace Epost.DAL
|
||||
// }
|
||||
// truequantity = trueqty + 1;
|
||||
// }
|
||||
string upsql = string.Format("update orders set oprationstate = '{3}' ,oprationtime='{0}',oprationcode='{5}',truequantity='{1}' where orderid='{2}' and id='{4}' ",
|
||||
string upsql = string.Format("update orders set oprationstate = '{3}' ,oprationtime='{0}',oprationcode='{5}',truequantity='{1}' where matchid='{2}' and id='{4}' ",
|
||||
DateTime.Now.ToString(),
|
||||
truequantity,
|
||||
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,
|
||||
matchid,
|
||||
oprationstate,
|
||||
id,
|
||||
// checkquantity,
|
||||
@ -792,7 +718,7 @@ namespace Epost.DAL
|
||||
#endregion
|
||||
|
||||
#region 修改当前小车拣货状态
|
||||
public bool UpdateStateByCar(string OrderID, string block = "", string sku = "")
|
||||
public bool UpdateStateByCar(string matchid, string block = "", string sku = "")
|
||||
{
|
||||
try
|
||||
{
|
||||
@ -805,39 +731,9 @@ namespace Epost.DAL
|
||||
{
|
||||
strwhere += " and sku='" + sku + "'";
|
||||
}
|
||||
string upsql = string.Format("update orders set state=3 where OrderID = '{0}'" + strwhere,
|
||||
OrderID);
|
||||
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);
|
||||
string upsql = string.Format("update orders set state=3 where matchid = '{0}'" + strwhere,
|
||||
matchid);
|
||||
LogHelper.WriteLogInfo("修改波次拣货状态:" + upsql);
|
||||
long x = db.UpdateSql(upsql);
|
||||
if (x > 0)
|
||||
return true;
|
||||
@ -1144,7 +1040,7 @@ namespace Epost.DAL
|
||||
#endregion
|
||||
|
||||
#region 判断当前sku是否为已完成
|
||||
public bool IsFinishWork(int endcount, string block, string usercode = "", string area = "", string sku = "", string shopid = "", string orderid = "")
|
||||
public bool IsFinishWork(int endcount, string block, string usercode = "", string area = "", string sku = "", string shopid = "", string matchid = "")
|
||||
{
|
||||
string strwheres = "";
|
||||
if (!string.IsNullOrEmpty(usercode))
|
||||
@ -1165,17 +1061,17 @@ namespace Epost.DAL
|
||||
{
|
||||
strwheres += " and shopid ='" + shopid + "'";
|
||||
}
|
||||
if (!string.IsNullOrEmpty(orderid))
|
||||
if (!string.IsNullOrEmpty(matchid))
|
||||
{
|
||||
strwheres += " and orderid ='" + orderid + "'";
|
||||
strwheres += " and matchid ='" + matchid + "'";
|
||||
}
|
||||
string sql = "select matchid, sku from V_orders where oprationstate <> 3 and state<>99 and block ='" + block + "' " + strwheres;
|
||||
|
||||
LogHelper.WriteLogInfo("判断当前通道是否为已完成" + sql);
|
||||
LogHelper.WriteLogInfo("判断当前sku是否为已完成" + sql);
|
||||
DataTable dt = db.GetsqlForDT(sql);
|
||||
if (dt == null || dt.Rows.Count == 0)
|
||||
{
|
||||
LogHelper.WriteLogInfo("判断当前通道是否为已完成true");
|
||||
LogHelper.WriteLogInfo("判断当前sku是否为已完成true");
|
||||
return true;
|
||||
|
||||
}
|
||||
@ -1187,59 +1083,6 @@ namespace Epost.DAL
|
||||
}
|
||||
#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 查询下一区段区号
|
||||
public int getOrderarea(string usercode, string block, string area)
|
||||
{
|
||||
@ -2708,7 +2551,7 @@ namespace Epost.DAL
|
||||
|
||||
public DataTable GetOrderMatchidInfo(string block, string area)
|
||||
{
|
||||
string sql = string.Format("select distinct matchid,ControlIP from v_orders where tolocation!='' and block='" + block + "' and area='" + area + "' ");
|
||||
string sql = string.Format("select distinct matchid,ControlIP from v_orders where (tolocation!='' or tolocation is not null) and block='" + block + "' and area='" + area + "' ");
|
||||
DataTable dt = db.GetsqlForDT(sql);
|
||||
return dt;
|
||||
}
|
||||
@ -2995,22 +2838,22 @@ namespace Epost.DAL
|
||||
#endregion
|
||||
|
||||
#region 判断订单状态为已完成
|
||||
public bool IsFinishWork_box(string boxcode, int endcount, string OrderID = "")
|
||||
public bool IsFinishWork_box(string boxcode, int endcount, string matchid = "")
|
||||
{
|
||||
string sql = string.Format("select OrderID from Orders where (OrderID='{0}') and oprationstate<>3",
|
||||
OrderID);
|
||||
string sql = string.Format("select matchid from Orders where (matchid='{0}') and oprationstate<>3",
|
||||
matchid);
|
||||
|
||||
|
||||
LogHelper.WriteLogInfo("判断单据状态为已完成" + sql);
|
||||
LogHelper.WriteLogInfo("判断整箱状态为已完成" + sql);
|
||||
DataTable dt = db.GetsqlForDT(sql);
|
||||
if (dt == null || dt.Rows.Count == endcount)
|
||||
{
|
||||
LogHelper.WriteLogInfo("判断单据状态为已完成true");
|
||||
LogHelper.WriteLogInfo("判断整箱状态为已完成true");
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
LogHelper.WriteLogInfo("判断单据状态为已完成false");
|
||||
LogHelper.WriteLogInfo("判断整箱状态为已完成false");
|
||||
|
||||
return false;
|
||||
}
|
||||
@ -3018,58 +2861,5 @@ namespace Epost.DAL
|
||||
#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
|
||||
}
|
||||
}
|
||||
|
@ -27,7 +27,7 @@ namespace Epost.DAL
|
||||
model.Location,
|
||||
model.Matchid,
|
||||
model.Lightcolor);
|
||||
LogHelper.WriteLogInfo("进入拣货队列=========" + sql);
|
||||
LogHelper.WriteLogInfo("进入拣货队列========="+sql);
|
||||
long x = db.InsertSql(sql);
|
||||
if (x > 0)
|
||||
return true;
|
||||
@ -43,7 +43,7 @@ namespace Epost.DAL
|
||||
}
|
||||
#endregion
|
||||
#region 获取任务信息
|
||||
public DataTable getQueuesOrderbyState(string state = "0")
|
||||
public DataTable getQueuesOrderbyState(string state="0")
|
||||
{
|
||||
string sql = string.Format("select * from OrdersQueue where state ='{0}'",
|
||||
state);
|
||||
@ -54,7 +54,7 @@ namespace Epost.DAL
|
||||
#endregion
|
||||
|
||||
#region 获取queue信息
|
||||
public DataTable getQueuesOrderbyState(string block, string area, string state)
|
||||
public DataTable getQueuesOrderbyState(string block,string area,string state)
|
||||
{
|
||||
string sql = string.Format("select * from OrdersQueue where (state ='{0}' or state='0') and taskblock='{1}' and taskarea='{2}' ",
|
||||
state,
|
||||
@ -68,19 +68,19 @@ namespace Epost.DAL
|
||||
#region 获取任务信息
|
||||
public DataTable getQueuesbyState()
|
||||
{
|
||||
string sql = "select * from OrdersQueue where state<>3";
|
||||
string sql = "select * from OrdersQueue where state<>0 and state<>3";
|
||||
return db.GetsqlForDT(sql);
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 获取任务信息
|
||||
public DataTable getOrderqueueByAddr(string addr, string ip)
|
||||
public DataTable getOrderqueueByAddr(string addr,string ip)
|
||||
{
|
||||
string sql = string.Format("select * from OrdersQueue where state=2 and taskarea='{0}' and taskblock='{1}'",
|
||||
string sql =string.Format("select * from OrdersQueue where state=2 and taskarea='{0}' and taskblock='{1}'",
|
||||
addr,
|
||||
ip);
|
||||
LogHelper.WriteLogInfo("获取==" + sql);
|
||||
LogHelper.WriteLogInfo("获取=="+sql);
|
||||
return db.GetsqlForDT(sql);
|
||||
|
||||
}
|
||||
@ -89,12 +89,7 @@ namespace Epost.DAL
|
||||
#region 获取当前区的作业状态
|
||||
public DataTable getQueueOrderState(OrdersQueueModel model)
|
||||
{
|
||||
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",
|
||||
string sql = string.Format("select * from OrdersQueue where taskblock='{0}' and taskarea='{1}' and state<>2 and state<>3 order by sort",
|
||||
model.Taskblock,
|
||||
model.Taskarea);
|
||||
return db.GetsqlForDT(sql);
|
||||
@ -112,10 +107,10 @@ namespace Epost.DAL
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool DeleteOrderQueue(string matchid, string CancelTime)
|
||||
public bool DeleteOrderQueue(string matchid,string CancelTime)
|
||||
{
|
||||
string sql = string.Format("delete from OrdersQueue where matchid='{0}' and Addtime='{1}'",
|
||||
matchid, CancelTime);
|
||||
matchid,CancelTime);
|
||||
long x = db.DeleteSql(sql);
|
||||
if (x > 0)
|
||||
return true;
|
||||
@ -127,7 +122,7 @@ namespace Epost.DAL
|
||||
#region 获取当前区的作业状态
|
||||
public DataTable getQueueState(OrdersQueueModel model)
|
||||
{
|
||||
string sql = string.Format("select * from OrdersQueue where state=1 and Taskblock='{0}' and Taskarea='{1}'",
|
||||
string sql = string.Format("select * from OrdersQueue where taskblock='{0}' and taskarea='{1}' and state=1",
|
||||
model.Taskblock,
|
||||
model.Taskarea);
|
||||
return db.GetsqlForDT(sql);
|
||||
@ -135,7 +130,7 @@ namespace Epost.DAL
|
||||
}
|
||||
#endregion
|
||||
#region 获取当前区的作业状态
|
||||
public DataTable getQueueState(string usercode, string matchid, string block, string area)
|
||||
public DataTable getQueueState(string usercode,string matchid,string block,string area)
|
||||
{
|
||||
string sql = string.Format("select * from ordersqueue where UserCode='{0}' and matchid='{1}' and Taskblock='{2}' and TaskArea='{3}' and state in(0,1)",
|
||||
usercode,
|
||||
@ -153,7 +148,7 @@ namespace Epost.DAL
|
||||
model.Taskblock,
|
||||
model.Taskarea,
|
||||
model.UserCode);
|
||||
DataTable dt = db.GetsqlForDT(sql);
|
||||
DataTable dt= db.GetsqlForDT(sql);
|
||||
|
||||
return dt;
|
||||
}
|
||||
@ -180,7 +175,7 @@ namespace Epost.DAL
|
||||
public bool updateOrderQueue(string block, string area)
|
||||
{
|
||||
string sql = string.Format("update ordersqueue set state = 0 where state=1 and taskblock='{0}' and TaskArea='{1}'",
|
||||
block, area);
|
||||
block,area);
|
||||
LogHelper.WriteLogInfo("换箱、拆箱后恢复作业" + sql);
|
||||
long x = db.UpdateSql(sql);
|
||||
if (x > 0)
|
||||
@ -191,10 +186,10 @@ namespace Epost.DAL
|
||||
#endregion
|
||||
|
||||
#region 修改作业全部完成
|
||||
public bool updateOrderQueueState()
|
||||
public bool updateOrderQueueState(string usercode, string block)
|
||||
{
|
||||
string sql = string.Format("update ordersqueue set state =3 where state<>3"
|
||||
);
|
||||
string sql = string.Format("update ordersqueue set state =3 where usercode='{0}' and taskblock ='{1}'",
|
||||
usercode, block);
|
||||
LogHelper.WriteLogInfo("修改作业全部完成" + sql);
|
||||
long x = db.UpdateSql(sql);
|
||||
if (x > 0)
|
||||
@ -216,11 +211,11 @@ namespace Epost.DAL
|
||||
#endregion
|
||||
|
||||
#region 获取sku是否正在作业
|
||||
public DataTable GetOrderQueue(string block, string area, string state)
|
||||
public DataTable GetOrderQueue(string block,string area,string state)
|
||||
{
|
||||
string sql = string.Format("select * from OrdersQueue where state <>'{0}' and taskblock='{1}' and taskarea='{2}'",
|
||||
state,
|
||||
block, area);
|
||||
block,area);
|
||||
LogHelper.WriteLogInfo("获取sku是否正在作业" + sql);
|
||||
return db.GetsqlForDT(sql);
|
||||
|
||||
@ -235,7 +230,7 @@ namespace Epost.DAL
|
||||
model.State);
|
||||
|
||||
|
||||
long x = db.UpdateSql(sql);
|
||||
long x= db.UpdateSql(sql);
|
||||
if (x > 0)
|
||||
return true;
|
||||
return false;
|
||||
@ -243,10 +238,10 @@ namespace Epost.DAL
|
||||
#endregion
|
||||
|
||||
#region 修改作业状态
|
||||
public bool UpdateQueueState(string id, string state)
|
||||
public bool UpdateQueueState(string id,string state)
|
||||
{
|
||||
string sql = string.Format("update OrdersQueue set state='{0}' where id ='{1}'",
|
||||
state, id);
|
||||
state,id);
|
||||
long x = db.UpdateSql(sql);
|
||||
if (x > 0)
|
||||
return true;
|
||||
@ -255,7 +250,7 @@ namespace Epost.DAL
|
||||
#endregion
|
||||
|
||||
#region 绑定箱号完成
|
||||
public bool UpdateBoxCode(string id, string boxcode)
|
||||
public bool UpdateBoxCode(string id,string boxcode)
|
||||
{
|
||||
string sql = string.Format("update OrdersQueue set state=3,boxcode='{0}' where id ='{1}'",
|
||||
boxcode,
|
||||
@ -274,7 +269,7 @@ namespace Epost.DAL
|
||||
model.Taskarea,
|
||||
model.Orderid,
|
||||
model.State);
|
||||
long x = db.UpdateSql(sql);
|
||||
long x= db.UpdateSql(sql);
|
||||
if (x > 0)
|
||||
return true;
|
||||
return false;
|
||||
@ -289,21 +284,19 @@ namespace Epost.DAL
|
||||
string strwhere = string.Empty;
|
||||
if (!string.IsNullOrEmpty(model.Taskblock))
|
||||
{
|
||||
strwhere = "and taskblock='" + model.Taskblock + "'";
|
||||
strwhere = "and taskblock='"+model.Taskblock+"'";
|
||||
}
|
||||
if (!string.IsNullOrEmpty(model.Taskarea))
|
||||
{
|
||||
strwhere += "and Taskarea='" + model.Taskarea + "'";
|
||||
}
|
||||
if (!string.IsNullOrEmpty(model.Orderid))
|
||||
{
|
||||
strwhere += "and Orderid='" + model.Orderid + "'";
|
||||
}
|
||||
string sql = string.Format("update OrdersQueue set state='{0}' where state<>3 " + strwhere,
|
||||
string sql = string.Format("update OrdersQueue set state='{0}' where state<>3 and sku = '{1}' and matchid='{2}' and usercode='{3}'"+ strwhere,
|
||||
model.State
|
||||
,model.Sku,
|
||||
model.Matchid,model.UserCode
|
||||
|
||||
);
|
||||
LogHelper.WriteLogInfo("修改作业区段" + sql);
|
||||
LogHelper.WriteLogInfo("修改作业区段"+sql);
|
||||
long x = db.UpdateSql(sql);
|
||||
if (x > 0)
|
||||
return true;
|
||||
@ -361,11 +354,11 @@ namespace Epost.DAL
|
||||
|
||||
|
||||
#region 删除queue
|
||||
public bool DelQueueOrder(string sku, string block)
|
||||
public bool DelQueueOrder(string sku,string block)
|
||||
{
|
||||
string sql = string.Format("delete from OrdersQueue where sku='{0}' and taskblock='{1}' and state<>3",
|
||||
sku, block);
|
||||
LogHelper.WriteLogInfo("删除queue" + sql);
|
||||
sku,block);
|
||||
LogHelper.WriteLogInfo("删除queue"+sql);
|
||||
long x = db.DeleteSql(sql);
|
||||
if (x > 0)
|
||||
return true;
|
||||
@ -395,7 +388,7 @@ namespace Epost.DAL
|
||||
#endregion
|
||||
|
||||
#region 删除queue
|
||||
public bool DeleteQueue(string block, string area)
|
||||
public bool DeleteQueue(string block,string area)
|
||||
{
|
||||
string sql = string.Format("delete from OrdersQueue where taskblock='{0}' and taskarea='{1}'",
|
||||
block, area);
|
||||
|
@ -99,14 +99,7 @@ namespace Epost.Model
|
||||
_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
|
||||
//{
|
||||
// get
|
||||
|
@ -37,41 +37,4 @@ 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -165,31 +165,7 @@ namespace Epost.DPS.Controllers
|
||||
#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;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -230,10 +230,6 @@
|
||||
</Compile>
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Startup.cs" />
|
||||
<Compile Include="WebService\WebService.asmx.cs">
|
||||
<DependentUpon>WebService.asmx</DependentUpon>
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Content\bootstrap-theme.css" />
|
||||
@ -858,7 +854,6 @@
|
||||
<Content Include="Content\code\themes\sand-signika.js.map" />
|
||||
<Content Include="Content\code\themes\skies.js.map" />
|
||||
<Content Include="Content\code\themes\sunset.js.map" />
|
||||
<Content Include="WebService\WebService.asmx" />
|
||||
<None Include="Properties\PublishProfiles\Toolsweb.pubxml" />
|
||||
<Content Include="Scripts\jquery\jquery-1.11.1.js" />
|
||||
<Content Include="Content\js\payment.js" />
|
||||
@ -959,7 +954,7 @@
|
||||
<AutoAssignPort>True</AutoAssignPort>
|
||||
<DevelopmentServerPort>52610</DevelopmentServerPort>
|
||||
<DevelopmentServerVPath>/</DevelopmentServerVPath>
|
||||
<IISUrl>http://localhost:63118/</IISUrl>
|
||||
<IISUrl>http://localhost:63119/</IISUrl>
|
||||
<NTLMAuthentication>False</NTLMAuthentication>
|
||||
<UseCustomServer>False</UseCustomServer>
|
||||
<CustomServerUrl>
|
||||
|
@ -11,7 +11,7 @@
|
||||
<SiteUrlToLaunchAfterPublish />
|
||||
<LaunchSiteAfterPublish>true</LaunchSiteAfterPublish>
|
||||
<ExcludeApp_Data>false</ExcludeApp_Data>
|
||||
<publishUrl>D:\驿传\抚远</publishUrl>
|
||||
<publishUrl>D:\驿传\SanYing_DAS-T后台</publishUrl>
|
||||
<DeleteExistingFiles>true</DeleteExistingFiles>
|
||||
<PrecompileBeforePublish>true</PrecompileBeforePublish>
|
||||
<EnableUpdateable>true</EnableUpdateable>
|
||||
|
@ -6,8 +6,8 @@
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<TimeStampOfAssociatedLegacyPublishXmlFile />
|
||||
<_PublishTargetUrl>D:\驿传\抚远</_PublishTargetUrl>
|
||||
<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>
|
||||
<_PublishTargetUrl>D:\驿传\SanYing_DAS-T后台</_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>
|
||||
<LastFailureDetails />
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
@ -33,19 +33,19 @@
|
||||
<publishTime>04/16/2023 15:06:26</publishTime>
|
||||
</File>
|
||||
<File Include="bin/App_global.asax.compiled">
|
||||
<publishTime>09/14/2023 15:14:45</publishTime>
|
||||
<publishTime>07/03/2023 13:53:15</publishTime>
|
||||
</File>
|
||||
<File Include="bin/App_global.asax.dll">
|
||||
<publishTime>09/14/2023 15:14:45</publishTime>
|
||||
<publishTime>07/03/2023 13:53:15</publishTime>
|
||||
</File>
|
||||
<File Include="bin/BouncyCastle.Crypto.dll">
|
||||
<publishTime>02/24/2020 15:29:24</publishTime>
|
||||
</File>
|
||||
<File Include="bin/Common.dll">
|
||||
<publishTime>09/01/2023 16:55:14</publishTime>
|
||||
<publishTime>07/03/2023 13:52:54</publishTime>
|
||||
</File>
|
||||
<File Include="bin/Common.pdb">
|
||||
<publishTime>09/01/2023 16:55:14</publishTime>
|
||||
<publishTime>07/03/2023 13:52:54</publishTime>
|
||||
</File>
|
||||
<File Include="bin/ComposerSDK.dll">
|
||||
<publishTime>04/16/2023 15:06:26</publishTime>
|
||||
@ -63,31 +63,31 @@
|
||||
<publishTime>10/23/2017 13:15:20</publishTime>
|
||||
</File>
|
||||
<File Include="bin/Epost.BLL.dll">
|
||||
<publishTime>09/14/2023 15:14:25</publishTime>
|
||||
<publishTime>07/03/2023 13:52:56</publishTime>
|
||||
</File>
|
||||
<File Include="bin/Epost.BLL.pdb">
|
||||
<publishTime>09/14/2023 15:14:25</publishTime>
|
||||
<publishTime>07/03/2023 13:52:56</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>09/14/2023 15:14:24</publishTime>
|
||||
<publishTime>07/03/2023 13:52:55</publishTime>
|
||||
</File>
|
||||
<File Include="bin/Epost.DAL.pdb">
|
||||
<publishTime>09/14/2023 15:14:24</publishTime>
|
||||
<publishTime>07/03/2023 13:52:55</publishTime>
|
||||
</File>
|
||||
<File Include="bin/Epost.DPS.dll">
|
||||
<publishTime>09/14/2023 15:14:32</publishTime>
|
||||
<publishTime>07/03/2023 13:53:00</publishTime>
|
||||
</File>
|
||||
<File Include="bin/Epost.DPS.pdb">
|
||||
<publishTime>09/14/2023 15:14:32</publishTime>
|
||||
<publishTime>07/03/2023 13:53:00</publishTime>
|
||||
</File>
|
||||
<File Include="bin/Epost.Model.dll">
|
||||
<publishTime>07/19/2023 15:37:56</publishTime>
|
||||
<publishTime>04/16/2023 17:10:57</publishTime>
|
||||
</File>
|
||||
<File Include="bin/Epost.Model.pdb">
|
||||
<publishTime>07/19/2023 15:37:56</publishTime>
|
||||
<publishTime>04/16/2023 17:10:57</publishTime>
|
||||
</File>
|
||||
<File Include="bin/Epost.TestToolsWeb.dll">
|
||||
<publishTime>09/06/2018 11:57:11</publishTime>
|
||||
@ -5652,7 +5652,7 @@
|
||||
<publishTime>04/16/2023 15:06:27</publishTime>
|
||||
</File>
|
||||
<File Include="PrecompiledApp.config">
|
||||
<publishTime>09/14/2023 15:14:36</publishTime>
|
||||
<publishTime>07/03/2023 13:53:05</publishTime>
|
||||
</File>
|
||||
<File Include="Scripts/ai.0.22.9-build00167.js">
|
||||
<publishTime>04/04/2018 15:45:12</publishTime>
|
||||
@ -7572,10 +7572,7 @@
|
||||
<publishTime>04/16/2023 15:06:27</publishTime>
|
||||
</File>
|
||||
<File Include="Web.config">
|
||||
<publishTime>08/31/2023 12:02:52</publishTime>
|
||||
</File>
|
||||
<File Include="WebService/WebService.asmx">
|
||||
<publishTime>07/19/2023 15:30:16</publishTime>
|
||||
<publishTime>04/16/2023 17:11:05</publishTime>
|
||||
</File>
|
||||
</ItemGroup>
|
||||
</Project>
|
@ -10,10 +10,12 @@
|
||||
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
|
||||
</configSections>
|
||||
<connectionStrings>
|
||||
<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="MysqlLocDPSConnection" connectionString="Server=localhost;Port=3306;Database=world;User=root; Password=antion;SslMode=None;Pooling=true;Allow User Variables=True;" />-->
|
||||
<add name="weijie_dpsEntities" connectionString="metadata=res://*/WJDB.csdl|res://*/WJDB.ssdl|res://*/WJDB.msl;provider=System.Data.SqlClient;provider connection string="data source=.;initial catalog=weijie_dps;user id=sa;password=123456;min pool size=4;max pool size=4;packet size=3072;MultipleActiveResultSets=True;App=EntityFramework"" providerName="System.Data.EntityClient" />
|
||||
<add name="SqlLocDPSConnection" connectionString="server=139.196.36.200;user id=EpostTest;password=antion;database=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="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="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" />
|
||||
|
||||
|
||||
</connectionStrings>
|
||||
@ -25,11 +27,11 @@
|
||||
<add key="ControlXML" value="/App_Data/EpostController.xml" />
|
||||
<add key="LabelXML" value="/App_Data/AddressStorage.xml" />
|
||||
<add key="ResultsXML" value="/App_Data/Results.xml" />
|
||||
<add key="WebAPIUrl" value="http://localhost:63118/api/WebAPI/ProcessingResult"/>
|
||||
<add key="WebAPIUrl" value="http://localhost:63119/api/WebAPI/ProcessingResult"/>
|
||||
<add key="ShowMode" value="1" />
|
||||
<add key="SetupMode" value="\Epost_P\Epost.TestToolsWeb\App_Data\SetupMode.txt" />
|
||||
<add key="CARID" value="" />
|
||||
<add key="ServerAPIURL" value="http://localhost:63118/api/WebAPI" />
|
||||
<add key="CARID" value="HT01" />
|
||||
<add key="ServerAPIURL" value="http://localhost:63119/api/WebAPI" />
|
||||
<add key="SleepTime" value="1" />
|
||||
</appSettings>
|
||||
<!--
|
||||
@ -46,12 +48,11 @@
|
||||
</customErrors>
|
||||
<authentication mode="None" />
|
||||
<compilation debug="true" targetFramework="4.6.1" />
|
||||
<httpRuntime targetFramework="4.5.2" requestValidationMode="2.0" />
|
||||
<httpRuntime targetFramework="4.5.2" />
|
||||
<httpModules>
|
||||
<add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule, Microsoft.AI.Web" />
|
||||
</httpModules>
|
||||
<sessionState mode="InProc" timeout="518400" />
|
||||
<pages validateRequest="false" />
|
||||
</system.web>
|
||||
<system.webServer>
|
||||
<modules>
|
||||
|
@ -1 +0,0 @@
|
||||
<%@ WebService Language="C#" CodeBehind="WebService.asmx.cs" Class="Epost.DPS.WebService.WebService" %>
|
@ -1,352 +0,0 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user