Compare commits
18 Commits
taitan_den
...
FuYuan_DPS
Author | SHA1 | Date | |
---|---|---|---|
a77604f299 | |||
7d3f50c97b | |||
29bfe4c6aa | |||
cc78693b7d | |||
7eff397fb5 | |||
07d01e0cd0 | |||
07985264fa | |||
b4fd2d4e05 | |||
ccbca85c55 | |||
53c4b66485 | |||
3648692781 | |||
e2c1d127a0 | |||
7e11ca5d4d | |||
70ebea6292 | |||
efe0835c4e | |||
c4fe9e1a9b | |||
c53719f69b | |||
2436a3805b |
@ -478,8 +478,40 @@ 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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -374,5 +374,17 @@ 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,6 +511,7 @@ namespace Epost.BLL
|
||||
model.ControlIP = item["ControlIP"].ToString();
|
||||
FORMATE_JOB_DATA(model);
|
||||
|
||||
LED_OFF_CLEAR(item["ControlIP"].ToString());
|
||||
}
|
||||
|
||||
}
|
||||
@ -564,14 +565,14 @@ namespace Epost.BLL
|
||||
model.Address = item.Address;
|
||||
model.Command = "REMOVE_JOB";
|
||||
model.Uid = item.ID;
|
||||
model.Type = "N";
|
||||
model.Type = "C";
|
||||
list.Add(model);
|
||||
LabelParamModel Unlockmodel = new LabelParamModel();
|
||||
Unlockmodel.ControlIP = item.ControlIP;
|
||||
Unlockmodel.Address = item.Address;
|
||||
Unlockmodel.Command = "UNLOCK";
|
||||
|
||||
Unlockmodel.Type = "N";
|
||||
Unlockmodel.Type = "C";
|
||||
Unlockmodel.Parameter = "11111000";
|
||||
list.Add(Unlockmodel);
|
||||
|
||||
@ -628,7 +629,7 @@ namespace Epost.BLL
|
||||
lablemodel.Command = "DISPLAY_JOB";
|
||||
lablemodel.Uid = show.Uid;
|
||||
if (string.IsNullOrEmpty(show.Uid))
|
||||
{ lablemodel.Uid = addritem["address"].ToString(); }
|
||||
{ lablemodel.Uid = show.No + addritem["address"].ToString(); }
|
||||
|
||||
lablemodel.Mode = show.Color + "0";
|
||||
if (addritem["addresstype"].ToString() == "2")
|
||||
@ -676,6 +677,30 @@ 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)
|
||||
{
|
||||
|
||||
@ -737,7 +762,55 @@ 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.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
|
||||
{
|
||||
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;
|
||||
}
|
||||
}
|
||||
@ -401,7 +401,7 @@ namespace Epost.BLL
|
||||
{
|
||||
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
|
||||
{
|
||||
|
||||
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,30 +731,30 @@ namespace Epost.BLL
|
||||
#endregion
|
||||
|
||||
#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
|
||||
{
|
||||
|
||||
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;
|
||||
if (OrderDt == null || OrderDt.Rows.Count == 0)//回显
|
||||
{
|
||||
OrderDt = dal.GetOrderList_echo(matchid, sku, area, block);
|
||||
isecho = true;
|
||||
//if (OrderDt == null || OrderDt.Rows.Count == 0)//回显
|
||||
//{
|
||||
// OrderDt = dal.GetOrderList_Car(matchid, sku, area, block);
|
||||
// isecho = true;
|
||||
|
||||
}
|
||||
//}
|
||||
if (OrderDt != null && OrderDt.Rows.Count > 0)
|
||||
{
|
||||
string usercode = string.Empty;
|
||||
string lightcolor = string.Empty;
|
||||
DataTable udt = dal.GetOrderUseerXCode(matchid, sku, area, block);
|
||||
if (udt != null && udt.Rows.Count > 0)
|
||||
{
|
||||
usercode = udt.Rows[0]["usercode"].ToString();
|
||||
lightcolor = udt.Rows[0]["lightcolor"].ToString();
|
||||
}
|
||||
//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);
|
||||
@ -767,27 +767,27 @@ namespace Epost.BLL
|
||||
demodel.BatchId = item["BatchId"].ToString();
|
||||
demodel.ID = item["ID"].ToString();
|
||||
demodel.GoodsName = item["GoodsName"].ToString();
|
||||
demodel.GoodsType = item["GoodsType"].ToString();
|
||||
demodel.Quantity = Convert.ToInt32(item["Quantity"].ToString());
|
||||
demodel.CheckQuantity = Convert.ToInt32(item["CheckQuantity"].ToString());
|
||||
demodel.Sku = item["Sku"].ToString();
|
||||
demodel.Tolocation = item["Tolocation"].ToString();
|
||||
demodel.Matchid = item["Matchid"].ToString();
|
||||
demodel.ShopID = item["shopid"].ToString();
|
||||
demodel.BoxCode = item["boxcode"].ToString();
|
||||
demodel.LotNo = item["LotNo"].ToString();
|
||||
demodel.Discount = item["Discount"].ToString();
|
||||
demodel.ProdArea = item["ProdArea"].ToString();
|
||||
demodel.ColorCode = item["corlorcode"].ToString();
|
||||
demodel.WholeUnit = item["WholeUnit"].ToString();
|
||||
demodel.Unit = item["Unit"].ToString();
|
||||
demodel.TrayCode = item["bkbarcode"].ToString();
|
||||
//demodel.TrayCode = item["bkbarcode"].ToString();
|
||||
#region 获取库位信息
|
||||
demodel.Block = item["Block"].ToString();
|
||||
demodel.Area = item["Area"].ToString();
|
||||
demodel.Address = item["address"].ToString();
|
||||
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.Addresstype = "1";
|
||||
demodel.ControlID = "";
|
||||
@ -802,15 +802,16 @@ namespace Epost.BLL
|
||||
demodel.TaskArea = Convert.ToInt32(item["area"].ToString());
|
||||
demodel.TaskBlock = Convert.ToInt32(item["block"].ToString());
|
||||
demodel.No = "01";
|
||||
if (isecho)
|
||||
{
|
||||
demodel.No = "04";
|
||||
demodel.ColorCode = EnumHelper.EMToDescriptionString(LightColor.Color.Blue);
|
||||
}
|
||||
//if (isecho)
|
||||
//{
|
||||
// demodel.No = "04";
|
||||
// demodel.ColorCode = EnumHelper.EMToDescriptionString(LightColor.Color.Blue);
|
||||
//}
|
||||
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
|
||||
}
|
||||
@ -820,8 +821,7 @@ namespace Epost.BLL
|
||||
LogHelper.WriteLogInfo("查询无任务================");
|
||||
|
||||
OrdersQueueModel qmodel = new OrdersQueueModel();
|
||||
qmodel.Sku = sku;
|
||||
qmodel.Matchid = matchid;
|
||||
qmodel.Orderid = orderid;
|
||||
qmodel.UserCode = UserCode;
|
||||
qmodel.Taskblock = block;
|
||||
qmodel.Taskarea = area;
|
||||
@ -846,7 +846,10 @@ namespace Epost.BLL
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public DataTable GetOrderList(string Orderid, string area, string block)
|
||||
{
|
||||
return dal.GetOrderList(Orderid, area, block);
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
@ -947,6 +950,16 @@ 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()
|
||||
{
|
||||
@ -1011,7 +1024,7 @@ namespace Epost.BLL
|
||||
{
|
||||
return dal.GetMatchOrder();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 获取订单信息
|
||||
public DataTable GetOrderList_Car(string matchid, string sku, string sarea, string sblock)
|
||||
@ -1025,5 +1038,38 @@ 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
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -1,11 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Data.Entity.Infrastructure;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Epost.Common;
|
||||
using Epost.DAL;
|
||||
using Epost.DAL.Cache;
|
||||
using Epost.DAL.Enum;
|
||||
using Epost.Model;
|
||||
@ -15,6 +17,7 @@ namespace Epost.BLL
|
||||
|
||||
public class OrderControlBLL
|
||||
{
|
||||
OrdersDAL dal = new OrdersDAL();
|
||||
OrderBLL orderbll = new OrderBLL();
|
||||
OrdersQueueBLL queueBLL = new OrdersQueueBLL();
|
||||
CommandBLL comBLL = new CommandBLL();
|
||||
@ -45,7 +48,7 @@ namespace Epost.BLL
|
||||
try
|
||||
{
|
||||
bool t = addrBLL.UpdateState();
|
||||
LogHelper.WriteLogInfo("初始化@@@@@@@@@@@@!----V20220705-1---");
|
||||
LogHelper.WriteLogInfo("初始化@@@@@@@@@@@@!----V20230418-1---");
|
||||
JobCache.ClearJobList();
|
||||
downCacheDAL.ClearJobDownList();
|
||||
locCache.ClearScanList();
|
||||
@ -55,12 +58,7 @@ namespace Epost.BLL
|
||||
UserCacheDAL.ClearUserCodeList();
|
||||
boxcache.ClearBoxList();
|
||||
ResultModel resultModel = comBLL.Initialization_M();
|
||||
GetOrderQueue(); //加载任务显示器信息
|
||||
|
||||
|
||||
|
||||
LogHelper.WriteLogInfo("初始化@@@@@@@@@@@@!----V20200727-1---");
|
||||
|
||||
//GetOrderQueue(); //加载任务显示器信息
|
||||
|
||||
|
||||
|
||||
@ -208,6 +206,31 @@ 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 查询波次通道列表
|
||||
@ -336,43 +359,57 @@ 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);
|
||||
}
|
||||
|
||||
if (data.Loc == "check")//任意回显标签拍下 熄灭回显设备
|
||||
{
|
||||
List<JobModel> rejob = jobList.FindAll(m => m.Block == block && m.Area == area && m.State == 1 && m.Sku == queueDT.Rows[0]["sku"].ToString());
|
||||
if (rejob.Any())
|
||||
{
|
||||
JobModel model = rejob.FirstOrDefault();
|
||||
comBLL.ClearArea_M(rejob);
|
||||
//熄灭通道灯
|
||||
comBLL.DISPLAY_LIGHT_BLOCK(block, area, "0");
|
||||
// comBLL.UNLOCK_M(rejob);
|
||||
#region 修改任务队列状态
|
||||
OrdersQueueModel qumodel = new OrdersQueueModel();
|
||||
qumodel.State = 3;
|
||||
qumodel.Taskblock = block;
|
||||
qumodel.Taskarea = area;
|
||||
qumodel.Sku = model.Sku;
|
||||
qumodel.Matchid = model.Matchid;
|
||||
qumodel.UserCode = model.UserCode;
|
||||
queueBLL.UpdateQueueTaskArea_Car(qumodel);
|
||||
#region 任意回显标签拍下 熄灭回显设备
|
||||
//if (data.Loc == "check")//任意回显标签拍下 熄灭回显设备
|
||||
//{
|
||||
// List<JobModel> rejob = jobList.FindAll(m => m.Block == block && m.Area == area && m.State == 1 && m.Sku == queueDT.Rows[0]["sku"].ToString());
|
||||
// if (rejob.Any())
|
||||
// {
|
||||
// JobModel model = rejob.FirstOrDefault();
|
||||
// comBLL.ClearArea_M(rejob);
|
||||
// //熄灭通道灯
|
||||
// comBLL.DISPLAY_LIGHT_BLOCK(block, area, "0");
|
||||
// // comBLL.UNLOCK_M(rejob);
|
||||
// #region 修改任务队列状态
|
||||
// OrdersQueueModel qumodel = new OrdersQueueModel();
|
||||
// qumodel.State = 3;
|
||||
// qumodel.Taskblock = block;
|
||||
// qumodel.Taskarea = area;
|
||||
// qumodel.Sku = model.Sku;
|
||||
// qumodel.Matchid = model.Matchid;
|
||||
// qumodel.UserCode = model.UserCode;
|
||||
// queueBLL.UpdateQueueTaskArea_Car(qumodel);
|
||||
|
||||
// #endregion
|
||||
// }
|
||||
// #region 清除当前区已做完的sku
|
||||
// JobCache.UpdateJobModelList(rejob, EcommendType.Execute);
|
||||
// #endregion
|
||||
//}
|
||||
#endregion
|
||||
}
|
||||
#region 清除当前区已做完的sku
|
||||
JobCache.UpdateJobModelList(rejob, EcommendType.Execute);
|
||||
#endregion
|
||||
}
|
||||
else if (data.Result == "4")//■按键拍下
|
||||
if (data.Result == "4")//■按键拍下
|
||||
{
|
||||
data.Parameter = "0";
|
||||
jobdown_start(data, job, block, area, jobList);
|
||||
}
|
||||
else if (type == "8")//波次完成拍下
|
||||
{
|
||||
List<UserCodeModel> ulist = UserCacheDAL.GetUserCodeList().FindAll(m => m.Block == data.Block);
|
||||
if (ulist.Any())
|
||||
{
|
||||
UserCodeModel umodel = ulist.FirstOrDefault();
|
||||
bool allfinish = dal.IsFinishWorkByCar(1, umodel.Matchid, data.Block);
|
||||
if (allfinish)
|
||||
{
|
||||
//判断整个波次是否已完成
|
||||
dal.UpdateStateByCar(umodel.Matchid);
|
||||
List<JobModel> rejob = job.FindAll(m => m.Block == data.Block && m.State == 3);
|
||||
if (rejob.Any()) { JobCache.UpdateJobModelList(rejob, EcommendType.Execute); }
|
||||
UserCacheDAL.UpdateUserCodeList(ulist, EUserCommend.Execute);//删除波次信息
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
LogHelper.WriteLogInfo("JOB_DOWN开始~~~~~~~~~~~~~~~~");
|
||||
@ -382,6 +419,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);
|
||||
}
|
||||
#endregion
|
||||
|
||||
@ -389,6 +428,8 @@ namespace Epost.BLL
|
||||
|
||||
public void jobdown_start(ResultMessageModel data, List<JobModel> job, string block, string area, List<JobModel> jobList)
|
||||
{
|
||||
var content = string.Empty;
|
||||
var color = EnumHelper.EMToDescriptionString(LightColor.Color.Green);
|
||||
int truequantity = 0;
|
||||
int checkquantity = 0;
|
||||
string scanstr = data.Parameter;
|
||||
@ -396,102 +437,70 @@ namespace Epost.BLL
|
||||
{
|
||||
truequantity = Convert.ToInt32(scanstr);
|
||||
}
|
||||
|
||||
if (job.Any())
|
||||
{
|
||||
List<JobModel> downlist = new List<JobModel>();
|
||||
JobModel model = job.FirstOrDefault();
|
||||
|
||||
//List<JobModel> manyList = job.FindAll(m => m.ManyState == 1 && m.Tolocation == model.Tolocation);
|
||||
downlist.Add(model);
|
||||
model.State = 3;
|
||||
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("合并显示数据=========="+ manyList .Count+ "==================");
|
||||
// LogHelper.WriteLogInfo("合并显示数据" + endcount + "============================");
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
downlist.Add(model);
|
||||
// downlist.Add(model);
|
||||
//}
|
||||
//修改订单状态
|
||||
orderbll.UpdateOrderState_Car(downlist, model, truequantity, checkquantity);
|
||||
LogHelper.WriteLogInfo(data.Address + "=========------------------" + data.Parameter);
|
||||
bool skuInish = orderbll.IsFinishWork(1, block, "", area, model.Sku);
|
||||
model.State = 3;
|
||||
if (skuInish)
|
||||
{
|
||||
LogHelper.WriteLogInfo("区SKU拣选完成--------------");
|
||||
//删除sku缓存信息
|
||||
List<ResultMessageModel> scanlist = downCacheDAL.GetPlanJobDownList().FindAll(p => p.Parameter == model.Sku && p.Command == "QUERY_SPECIAL_STATUS" && p.Area == area);
|
||||
downCacheDAL.UpdateJobDownModelList(scanlist, EdownCommend.Execute);
|
||||
//熄灭通道灯
|
||||
comBLL.DISPLAY_LIGHT_BLOCK(block, area, "0");
|
||||
|
||||
#region 熄灭当前区显示屏
|
||||
List<JobModel> offList = jobList.FindAll(m => m.Block == block && m.Area == area && m.State == 3 && m.Sku == model.Sku);
|
||||
if (offList.Any())
|
||||
{
|
||||
comBLL.LED_OFF_CLEAR(offList);
|
||||
}
|
||||
#endregion
|
||||
|
||||
orderbll.UpdateOrderState_Car(downlist, model, truequantity, checkquantity);
|
||||
LogHelper.WriteLogInfo("拍下------" + data.Address + "------" + model.OrderID + "----" + model.State + "");
|
||||
//bool skuInish = dal.IsFinishWork(1, block, "", area, "", "", model.OrderID);
|
||||
bool skuInish = dal.IsFinishWork(1, block, "", area, "", "", "");
|
||||
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)
|
||||
//{
|
||||
#region 修改任务队列状态
|
||||
OrdersQueueModel qumodel = new OrdersQueueModel();
|
||||
qumodel.State = 3;
|
||||
qumodel.Taskblock = block;
|
||||
qumodel.Taskarea = area;
|
||||
qumodel.Sku = model.Sku;
|
||||
qumodel.Matchid = model.Matchid;
|
||||
qumodel.UserCode = model.UserCode;
|
||||
//qumodel.Orderid = model.OrderID;
|
||||
queueBLL.UpdateQueueTaskArea_Car(qumodel);
|
||||
#endregion
|
||||
|
||||
#region 刷新波次信息
|
||||
showSummaryMes(model.Sku, block, area, Convert.ToInt32(block), null, model.Tolocation, model.Matchid);
|
||||
#endregion
|
||||
//修改订单状态
|
||||
dal.UpdateState(model.Area, model.Block);
|
||||
|
||||
Thread.Sleep(30);
|
||||
#region 整条通道当前用户所有任务分播结束
|
||||
bool blockfinish = orderbll.IsFinishWorkByCar(1, model.Matchid, block);
|
||||
if (blockfinish)
|
||||
bool WorkArea = dal.IsFinishWorkArea("", "", "99", "", "", "");
|
||||
if (WorkArea)
|
||||
{
|
||||
#region 点亮显示器
|
||||
ShowMessageModel_M show = new ShowMessageModel_M();
|
||||
show.Title = "当前波次分播完成";
|
||||
show.Contents = "拍下熄灭所有设备\r请扫描继续作业";
|
||||
show.Color = EnumHelper.EMToDescriptionString(LightColor.Color.Green);
|
||||
show.Qty = "0";
|
||||
show.Type = 8;
|
||||
show.Block = block;
|
||||
show.Islock = false;
|
||||
show.IsTwinkle = 1;
|
||||
show.No = "01";
|
||||
comBLL.ShowBoxMessage_M(show);
|
||||
#endregion
|
||||
|
||||
bool allfinish = orderbll.IsFinishWorkByCar(1, model.Matchid);
|
||||
if (allfinish)//判断整个波次是否已完成
|
||||
{ //更新state状态为已完成
|
||||
orderbll.UpdateStateByCar(model.Matchid);
|
||||
comBLL.DISPLAY_LIGHT_BLOCK_Out("", model.Area, "0");
|
||||
}
|
||||
//删除波次信息
|
||||
List<UserCodeModel> ulist = UserCacheDAL.GetUserCodeList().FindAll(m => m.Block == block);
|
||||
UserCacheDAL.UpdateUserCodeList(ulist, EUserCommend.Execute);
|
||||
|
||||
//}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 区内sku播完回传
|
||||
// orderbll.UpdateStateByCar(model.Matchid, "", model.Sku);
|
||||
|
||||
#endregion
|
||||
|
||||
#region 清除当前区已做完的sku
|
||||
JobCache.UpdateJobModelList(offList, EcommendType.Execute);
|
||||
#endregion
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
//删除已完成的拣选缓存信息
|
||||
List<JobModel> finjob = JobCache.GetPlanJobList().FindAll(m => m.Block == data.Block && m.Area == data.Area && m.State == 3);
|
||||
JobCache.UpdateJobModelList(finjob, EcommendType.Execute);
|
||||
|
||||
|
||||
}
|
||||
@ -522,9 +531,37 @@ 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
|
||||
|
||||
}
|
||||
@ -543,55 +580,34 @@ 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();
|
||||
List<JobModel> isJobList = jobList.FindAll(p => p.Block == nblock && p.Area == narea && p.State != 3);
|
||||
ShowMessageModel showmodel = new ShowMessageModel();
|
||||
//获取当前区任务并加入缓存
|
||||
if (!isJobList.Any())
|
||||
if (queueDT != null && queueDT.Rows.Count > 0)
|
||||
{
|
||||
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);
|
||||
if (nowJoblist.Any())
|
||||
{
|
||||
var nowmodel = nowJoblist.FirstOrDefault();
|
||||
|
||||
LogHelper.WriteLogInfo("进入任务点亮=====matchid=" + nowmodel.Matchid + "===orderid===" + nowmodel.OrderID + "=====sku==" + nowmodel.Sku + "========");
|
||||
#region 点亮任务标签
|
||||
foreach (JobModel item in nowJoblist.ToArray())
|
||||
{
|
||||
|
||||
#region 回显设备锁定
|
||||
if (queueDT.Rows[0]["lightcolor"].ToString() == EnumHelper.EMToDescriptionString(LightColor.Color.Blue))
|
||||
List<JobModel> isshowList = jobList.FindAll(p => p.Address == item.Address && p.ControlIP == item.ControlIP && p.State == 1);
|
||||
if (!isshowList.Any())
|
||||
{
|
||||
|
||||
LabelParamModel locklamodel = new LabelParamModel();
|
||||
locklamodel.Address = item.Address.ToString();
|
||||
locklamodel.ControlIP = item.ControlIP.ToString();
|
||||
locklamodel.Command = "LOCK";
|
||||
locklamodel.Parameter = "11111000";
|
||||
locklamodel.Type = "N";
|
||||
list.Add(locklamodel);
|
||||
|
||||
}
|
||||
#endregion
|
||||
// else
|
||||
//{
|
||||
|
||||
List<JobModel> manyJoblist = nowJoblist.FindAll(m => m.Tolocation == item.Tolocation);
|
||||
#region
|
||||
#region 判断同一订单、同一货位多条数据 合并显示
|
||||
//List<JobModel> manyJoblist = nowJoblist.FindAll(m => m.Tolocation == item.Tolocation);
|
||||
int quantity = item.Quantity;
|
||||
|
||||
LabelParamModel lamodel = new LabelParamModel();
|
||||
|
||||
lamodel.Address = item.Address.ToString();
|
||||
lamodel.ControlIP = item.ControlIP.ToString();
|
||||
lamodel.Command = "DISPLAY_JOB";
|
||||
|
||||
#region 同一个货位的数据合并显示
|
||||
//if (manyJoblist.Count > 1)
|
||||
//if (manyJoblist.Count > 1)//同一个货位的数据合并显示
|
||||
//{
|
||||
// quantity = 0;
|
||||
// if (manyJoblist.FindAll(m => m.State == 0).Any())
|
||||
// {
|
||||
// foreach (JobModel mitem in manyJoblist)
|
||||
@ -600,58 +616,139 @@ namespace Epost.BLL
|
||||
// mitem.State = 1;
|
||||
// mitem.ManyState = 1;
|
||||
// }
|
||||
|
||||
// }
|
||||
//}
|
||||
#endregion
|
||||
|
||||
lamodel.Uid = item.ID;
|
||||
lamodel.Type = "N";
|
||||
LabelParamModel lamodel = new LabelParamModel();
|
||||
string address = item.Address.ToString();
|
||||
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.Uid = item.ID;
|
||||
lamodel.Mode = queueDT.Rows[0]["lightcolor"].ToString() + "0";
|
||||
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";//多规
|
||||
}
|
||||
|
||||
list.Add(lamodel);
|
||||
//}
|
||||
|
||||
item.State = 1;
|
||||
item.ColorCode = queueDT.Rows[0]["lightcolor"].ToString();
|
||||
item.DisplayTime = DateTime.Now;
|
||||
else if (item.looklisten == "无")
|
||||
{
|
||||
lamodel.PicChoose = "05";//易混淆
|
||||
}
|
||||
#endregion
|
||||
#region 点亮通道灯
|
||||
comBLL.DISPLAY_LIGHT_BLOCK(model.Taskblock, model.Taskarea, "1");
|
||||
|
||||
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";
|
||||
|
||||
|
||||
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.DisplayTime = DateTime.Now;
|
||||
#endregion
|
||||
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
}
|
||||
if (list != null && list.Count > 0)
|
||||
{
|
||||
LogHelper.WriteLogInfo("添加到点亮的list————————————————————:" + list.Count);
|
||||
comBLL.DISPLAY_JOBALL(list);
|
||||
}
|
||||
}
|
||||
else
|
||||
{//无任务
|
||||
LogHelper.WriteLogInfo("点亮====无任务=======================");
|
||||
model.State = 3;
|
||||
}
|
||||
//else
|
||||
//{//无任务
|
||||
// LogHelper.WriteLogInfo("点亮====无任务=======================");
|
||||
// model.State = 3;
|
||||
// queueBLL.UpdateQueueOrderState(model);//缓存队列状态修改
|
||||
//}
|
||||
#endregion
|
||||
if (jobList.Any())
|
||||
{
|
||||
|
||||
var finishList = jobList.FindAll(p => p.State == 0);
|
||||
if (!finishList.Any())
|
||||
{
|
||||
queueBLL.UpdateQueueOrderState(model);//缓存队列状态修改
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
//else
|
||||
//{
|
||||
|
||||
LogHelper.WriteLogInfo("还有未完成任务" + isJobList.Count);
|
||||
foreach (JobModel item in isJobList)
|
||||
{
|
||||
LogHelper.WriteLogInfo("还有未完成任务"+item.Address+item.ID);
|
||||
}
|
||||
}
|
||||
// LogHelper.WriteLogInfo("还有未完成任务" + isJobList.Count);
|
||||
// foreach (JobModel item in isJobList)
|
||||
// {
|
||||
// LogHelper.WriteLogInfo("还有未完成任务" + item.Address + item.ID);
|
||||
// }
|
||||
//}
|
||||
}
|
||||
#endregion
|
||||
|
||||
@ -692,13 +789,168 @@ namespace Epost.BLL
|
||||
if (data.Type == "5")//中分扫描枪
|
||||
{
|
||||
|
||||
zhongfenBind(ulist, scanStr, data);
|
||||
//zhongfenBind(ulist, scanStr, data);
|
||||
downCacheDAL.UpdateJobDownModelList(new List<ResultMessageModel> { data }, EdownCommend.Execute);
|
||||
}
|
||||
else if (data.Type == "6")//播种扫描枪
|
||||
{
|
||||
|
||||
xifenBind(ulist, scanStr, data, matchid, isnum);
|
||||
var color = EnumHelper.EMToDescriptionString(LightColor.Color.Black);
|
||||
var i = 0;
|
||||
var content = string.Empty;
|
||||
var d = false;
|
||||
if (scanStr == "Finish")
|
||||
{
|
||||
dal.UpBkAddresss(data.Block, data.Area);
|
||||
DataTable Mdt = dal.GetOrderMatchidInfo(data.Block, data.Area);
|
||||
if (Mdt != null && Mdt.Rows.Count > 0)
|
||||
{
|
||||
LogHelper.WriteLogInfo("----开始强制结束----运单号:" + Mdt.Rows[0]["matchid"].ToString() + "");
|
||||
dal.UpOrdersMatchid(data.Block, data.Area, Mdt.Rows[0]["matchid"].ToString());
|
||||
|
||||
dal.UpOrdersqueue(data.Block, data.Area, Mdt.Rows[0]["matchid"].ToString());
|
||||
LabelParamModel model = new LabelParamModel();
|
||||
model.Address = "9999";
|
||||
model.ControlIP = Mdt.Rows[0]["ControlIP"].ToString();
|
||||
model.Parameter = "01";
|
||||
comBLL.REMOVE_JOB(model);
|
||||
comBLL.LED_OFF_CLEAR(Mdt.Rows[0]["ControlIP"].ToString());
|
||||
|
||||
color = EnumHelper.EMToDescriptionString(LightColor.Color.Green);
|
||||
scanStr = "强制结束成功";
|
||||
content = "运单号:" + Mdt.Rows[0]["matchid"].ToString() + "\r\r";
|
||||
}
|
||||
else
|
||||
{
|
||||
LogHelper.WriteLogInfo("----开始强制结束----无任务");
|
||||
scanStr = "当前无任务";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
DataTable ifdt = dal.GetOrdersMatchidIf(scanStr);//判断扫描的是否为运单号
|
||||
if (ifdt != null && ifdt.Rows.Count > 0)
|
||||
{
|
||||
DataTable bindt = dal.GetOrderMatchidBin(scanStr);
|
||||
if (bindt == null || bindt.Rows.Count <= 0)
|
||||
{
|
||||
DataTable IFmatchid = dal.GetOrderMatchidLocation(data.Block, data.Area);
|
||||
if (IFmatchid != null && IFmatchid.Rows.Count > 0)
|
||||
{
|
||||
LogHelper.WriteLogInfo("----------该运单号正在作业:" + IFmatchid.Rows[0]["matchid"].ToString() + "");
|
||||
scanStr = "当前运单:" + scanStr + "";
|
||||
content = "当前线路正在作业请勿扫描\r\r";
|
||||
}
|
||||
else
|
||||
{
|
||||
//循环为运单号分配货位
|
||||
DataTable noadddt = dal.GetAddressNolocation(data.Block, data.Area);
|
||||
foreach (DataRow item in ifdt.Rows)
|
||||
{
|
||||
if (noadddt.Rows.Count > i)
|
||||
{
|
||||
d = dal.UpOrderstolocation(item["shopid"].ToString(), noadddt.Rows[i]["location"].ToString(), scanStr);
|
||||
}
|
||||
i++;
|
||||
}
|
||||
if (d == true)
|
||||
{
|
||||
DataTable dtmt = dal.GetOrderinfoNumber(scanStr);
|
||||
|
||||
content = "车牌:" + dtmt.Rows[0]["clientname"].ToString() + "\r门店数:" + dtmt.Rows[0]["shopcount"].ToString() + "\r商品总数:" + dtmt.Rows[0]["qty"].ToString() + "";
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
LogHelper.WriteLogInfo("----------该运单号已绑定:" + scanStr + "");
|
||||
scanStr = "当前运单:" + scanStr + "";
|
||||
content = "该运单已绑定请勿重复扫描\r\r";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
DataTable skutb = dal.GetSku(scanStr);
|
||||
DataTable OrderDt = dal.GetOrderList_Car("", scanStr, data.Area, data.Block);
|
||||
if (OrderDt != null && OrderDt.Rows.Count > 0)
|
||||
{
|
||||
DataTable dd = dal.getQueueState(data.Block, data.Area, "3");
|
||||
|
||||
if (dd != null && dd.Rows.Count > 0)
|
||||
{
|
||||
content = "商品条码:" + skutb.Rows[0]["sku"].ToString() + "\r名称:" + skutb.Rows[0]["name"].ToString() + "\r";
|
||||
scanStr = "该商品正在作业" + dd.Rows[0]["Sku"].ToString() + ",请勿扫描";
|
||||
LogHelper.WriteLogInfo("该商品正在作业---sku:" + dd.Rows[0]["Sku"].ToString() + "");
|
||||
}
|
||||
else
|
||||
{
|
||||
comBLL.LED_OFF_CLEAR(OrderDt.Rows[0]["controlip"].ToString());
|
||||
|
||||
OrdersQueueModel qmodel = new OrdersQueueModel();
|
||||
qmodel.Taskblock = data.Block;
|
||||
qmodel.Taskarea = data.Area;
|
||||
qmodel.Matchid = OrderDt.Rows[0]["Matchid"].ToString();
|
||||
qmodel.Sku = scanStr;
|
||||
qmodel.Lightcolor = EnumHelper.EMToDescriptionString(LightColor.Color.Green);
|
||||
queueBLL.insertQueueOrders(qmodel);
|
||||
|
||||
#region 扫描sku点亮显示标签
|
||||
DataTable dt = dal.GetSkuQuantity(scanStr, OrderDt.Rows[0]["Matchid"].ToString());
|
||||
var sumqty = dt.Rows[0]["sumqty"].ToString();
|
||||
|
||||
string sizeinfo = string.Empty;
|
||||
if (skutb != null)
|
||||
{
|
||||
double bigqty = 0, midqty = 0, lastqty = 0;
|
||||
double bigsize = 0, midsize = 0;
|
||||
if (skutb.Rows.Count > 0)
|
||||
{
|
||||
bigsize = Convert.ToDouble(skutb.Rows[0]["plumn"].ToString());// 6
|
||||
midsize = Convert.ToDouble(skutb.Rows[0]["spec"].ToString());// 1
|
||||
if (bigsize != 0)
|
||||
{
|
||||
bigqty = (int)Math.Floor(Convert.ToDouble(sumqty) / bigsize);
|
||||
sumqty = (Convert.ToDouble(sumqty) - (bigqty * bigsize)).ToString();
|
||||
}
|
||||
if (midsize != 0)
|
||||
{
|
||||
midqty = (int)Math.Floor(Convert.ToDouble(sumqty) / midsize);
|
||||
sumqty = (Convert.ToDouble(sumqty) - (midqty * midsize)).ToString();
|
||||
}
|
||||
sizeinfo = "筐数:" + bigqty + "包数:" + midqty;
|
||||
}
|
||||
else
|
||||
{
|
||||
sizeinfo = "总数:" + sumqty;
|
||||
}
|
||||
content = "名称:" + skutb.Rows[0]["name"].ToString() + "\r " + sizeinfo + " \r";
|
||||
}
|
||||
#endregion
|
||||
scanStr = "当前商品:" + scanStr + "";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (skutb != null && skutb.Rows.Count > 0)
|
||||
{
|
||||
content = "名称:" + skutb.Rows[0]["name"].ToString() + "\r\r";
|
||||
}
|
||||
|
||||
scanStr = "条码:" + scanStr + ",无任务";
|
||||
LogHelper.WriteLogInfo("该条码无任务---条码:" + scanStr + "");
|
||||
}
|
||||
}
|
||||
}
|
||||
ShowMessageModel_M showmodel = new ShowMessageModel_M();
|
||||
showmodel.Area = data.Area;
|
||||
showmodel.Block = data.Block;
|
||||
showmodel.Color = color;
|
||||
showmodel.Islock = true;
|
||||
showmodel.Title = scanStr;
|
||||
showmodel.IsTwinkle = 0;
|
||||
showmodel.Contents = content;
|
||||
showmodel.Type = 2;
|
||||
comBLL.ShowBoxMessage_M(showmodel);//点亮显示标签
|
||||
|
||||
downCacheDAL.UpdateJobDownModelList(new List<ResultMessageModel> { data }, EdownCommend.Execute);
|
||||
}
|
||||
|
@ -127,9 +127,9 @@ namespace Epost.BLL
|
||||
}
|
||||
#endregion
|
||||
#region 修改作业全部完成
|
||||
public bool updateOrderQueueState(string usercode, string block)
|
||||
public bool updateOrderQueueState()
|
||||
{
|
||||
return dal.updateOrderQueueState(usercode,block);
|
||||
return dal.updateOrderQueueState();
|
||||
|
||||
}
|
||||
#endregion
|
||||
@ -222,7 +222,7 @@ namespace Epost.BLL
|
||||
public bool UpdateQueueState()
|
||||
{
|
||||
BoxPickBLL bll = new BoxPickBLL();
|
||||
dal.deleteBoxpick();
|
||||
//dal.deleteBoxpick();
|
||||
bool bo= dal.UpdateQueueState();
|
||||
//if (bo)
|
||||
//{
|
||||
|
@ -163,13 +163,17 @@ namespace Epost.DAL
|
||||
string strwhere = string.Empty;
|
||||
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,
|
||||
|
||||
type);
|
||||
LogHelper.WriteLogInfo("根据区域 查询显示地址"+sql);
|
||||
LogHelper.WriteLogInfo("根据区域 查询显示地址---通道灯" + sql);
|
||||
return db.GetsqlForDT(sql);
|
||||
}
|
||||
|
||||
@ -809,5 +813,20 @@ 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,7 +139,14 @@ namespace Epost.DAL.Cache
|
||||
|
||||
|
||||
}
|
||||
|
||||
else if (CommendType.Equals(EcommendType.CompleteAll))
|
||||
{
|
||||
//删除作业任务 已完成
|
||||
foreach (var planitem in PlanJobList.ToArray())
|
||||
{
|
||||
PlanJobList.Remove(planitem);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@ -186,7 +193,12 @@ namespace Epost.DAL.Cache
|
||||
/// 作业完成
|
||||
/// </summary>
|
||||
[Description("作业完成")]
|
||||
Complete
|
||||
Complete,
|
||||
/// <summary>
|
||||
/// 作业完成
|
||||
/// </summary>
|
||||
[Description("作业完成")]
|
||||
CompleteAll
|
||||
|
||||
}
|
||||
}
|
@ -650,6 +650,7 @@ 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,19 +36,23 @@ namespace Epost.DAL
|
||||
|
||||
|
||||
#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
|
||||
{
|
||||
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;
|
||||
if (!string.IsNullOrEmpty(area))
|
||||
{
|
||||
sql = string.Format("select id, ProdArea, LotNo, Matchid, orderid, barcode, BatchId, DownDate, Tolocation, Sku, GoodsName, Discount, Quantity, GoodsType, corlorcode, address, ControlIP,area, block,boxcode,bkbarcode,isnull(checkquantity,0) as checkquantity,wholeunit,unit,shopid,wmsboxcode from v_orders where state = 0 and oprationstate <>3 and sku = '{0}' and block = '{1}' and area='{2}' " + strwhere + "",
|
||||
sql = string.Format("select id,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,
|
||||
block, area);
|
||||
@ -56,7 +60,7 @@ namespace Epost.DAL
|
||||
}
|
||||
else
|
||||
{
|
||||
sql = string.Format("select id,ProdArea, LotNo, Matchid, orderid, barcode, BatchId, DownDate, Tolocation, Sku, GoodsName, Discount, Quantity, GoodsType, corlorcode, address, ControlIP, area , block,boxcode,bkbarcode,isnull(checkquantity,0) as checkquantity,wholeunit,unit,shopid,wmsboxcode from v_orders where state = 0 and oprationstate <>3 and sku = '{0}' and block = '{1}' " + strwhere + "",
|
||||
sql = string.Format("select id,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,
|
||||
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
|
||||
|
||||
|
||||
@ -90,7 +115,7 @@ namespace Epost.DAL
|
||||
string sql = string.Empty;
|
||||
if (!string.IsNullOrEmpty(area))
|
||||
{
|
||||
sql = string.Format("select id,ProdArea, LotNo, Matchid, orderid, barcode, BatchId, DownDate, Tolocation, Sku, GoodsName, Discount, Quantity, GoodsType, corlorcode, address, ControlIP,area, block,boxcode,bkbarcode,isnull(checkquantity,0) as checkquantity,wholeunit,unit,shopid,wmsboxcode from v_orders where state = 0 and sku = '{0}' and block = '{1}' and area='{2}' " + strwhere + "",
|
||||
sql = string.Format("select id,Matchid,orderid, barcode, BatchId, DownDate, Tolocation, Sku, GoodsName, Discount, Quantity, address, ControlIP,area, block,bkbarcode,wholeunit,unit,shopid,wmsboxcode from v_orders where state = 0 and sku = '{0}' and block = '{1}' and area='{2}' " + strwhere + "",
|
||||
|
||||
sku,
|
||||
block, area);
|
||||
@ -98,7 +123,7 @@ namespace Epost.DAL
|
||||
}
|
||||
else
|
||||
{
|
||||
sql = string.Format("select id,ProdArea, LotNo, Matchid, orderid, barcode, BatchId, DownDate, Tolocation, Sku, GoodsName, Discount, Quantity, GoodsType, corlorcode, address, ControlIP, area , block,boxcode,bkbarcode,isnull(checkquantity,0) as checkquantity,wholeunit,unit,shopid,wmsboxcode from v_orders where state = 0 and sku = '{0}' and block = '{1}' " + strwhere + "",
|
||||
sql = string.Format("select id,Matchid,orderid, barcode, BatchId, DownDate, Tolocation, Sku, GoodsName, Discount, Quantity, address, ControlIP, area , block,bkbarcode,wholeunit,unit,shopid,wmsboxcode from v_orders where state = 0 and sku = '{0}' and block = '{1}' " + strwhere + "",
|
||||
|
||||
sku,
|
||||
block);
|
||||
@ -482,7 +507,7 @@ namespace Epost.DAL
|
||||
string sql = string.Empty;
|
||||
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(),
|
||||
orderid,
|
||||
|
||||
@ -490,7 +515,7 @@ namespace Epost.DAL
|
||||
}
|
||||
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(),
|
||||
orderid,
|
||||
sku);
|
||||
@ -622,7 +647,7 @@ namespace Epost.DAL
|
||||
#endregion
|
||||
|
||||
#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
|
||||
{
|
||||
@ -646,16 +671,66 @@ namespace Epost.DAL
|
||||
// }
|
||||
// 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(),
|
||||
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,
|
||||
id,
|
||||
// checkquantity,
|
||||
usercode
|
||||
);
|
||||
long x = db.UpdateSql(upsql);
|
||||
LogHelper.WriteLogInfo("修改当前标签拣货状态:" + upsql + ",成功条数:" + x + "");
|
||||
if (x > 0)
|
||||
return true;
|
||||
return false;
|
||||
@ -717,7 +792,7 @@ namespace Epost.DAL
|
||||
#endregion
|
||||
|
||||
#region 修改当前小车拣货状态
|
||||
public bool UpdateStateByCar(string matchid, string block = "", string sku = "")
|
||||
public bool UpdateStateByCar(string OrderID, string block = "", string sku = "")
|
||||
{
|
||||
try
|
||||
{
|
||||
@ -730,9 +805,39 @@ namespace Epost.DAL
|
||||
{
|
||||
strwhere += " and sku='" + sku + "'";
|
||||
}
|
||||
string upsql = string.Format("update orders set state=3 where matchid = '{0}'" + strwhere,
|
||||
matchid);
|
||||
LogHelper.WriteLogInfo("修改波次拣货状态:" + upsql);
|
||||
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);
|
||||
long x = db.UpdateSql(upsql);
|
||||
if (x > 0)
|
||||
return true;
|
||||
@ -1039,7 +1144,7 @@ namespace Epost.DAL
|
||||
#endregion
|
||||
|
||||
#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 = "";
|
||||
if (!string.IsNullOrEmpty(usercode))
|
||||
@ -1060,17 +1165,17 @@ namespace Epost.DAL
|
||||
{
|
||||
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;
|
||||
|
||||
LogHelper.WriteLogInfo("判断当前sku是否为已完成" + sql);
|
||||
LogHelper.WriteLogInfo("判断当前通道是否为已完成" + sql);
|
||||
DataTable dt = db.GetsqlForDT(sql);
|
||||
if (dt == null || dt.Rows.Count == 0)
|
||||
{
|
||||
LogHelper.WriteLogInfo("判断当前sku是否为已完成true");
|
||||
LogHelper.WriteLogInfo("判断当前通道是否为已完成true");
|
||||
return true;
|
||||
|
||||
}
|
||||
@ -1082,6 +1187,59 @@ 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)
|
||||
{
|
||||
@ -2492,6 +2650,426 @@ namespace Epost.DAL
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 三迎
|
||||
//========三迎========
|
||||
|
||||
#region 查询扫描的是否为运单号
|
||||
public DataTable GetOrdersMatchidIf(string matchid)
|
||||
{
|
||||
string sql = string.Format("select distinct matchid,shopid,shopname,prino+0 from Orders where matchid='" + matchid + "' order by prino+0 asc");
|
||||
DataTable dt = db.GetsqlForDT(sql);
|
||||
return dt;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 查询可分配的货位
|
||||
public DataTable GetAddressNolocation(string block, string area)
|
||||
{
|
||||
string sql = string.Format("select * from Addressstorage where bkaddress='0' and type='1' and block='" + block + "' and area='" + area + "' order by location+1 asc");
|
||||
DataTable dt = db.GetsqlForDT(sql);
|
||||
return dt;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 为orders分配货位
|
||||
public bool UpOrderstolocation(string shopid, string tolocation, string matchid)
|
||||
{
|
||||
string sql = string.Format("update Orders set tolocation='" + tolocation + "' where shopid='" + shopid + "' and matchid='" + matchid + "'");
|
||||
long x = db.UpdateSql(sql);
|
||||
LogHelper.WriteLogInfo("为orders分配货位:" + sql + ",成功条数:" + x + "");
|
||||
if (x > 0)
|
||||
{
|
||||
sql = string.Format("update Addressstorage set bkaddress='" + shopid + "' where location='" + tolocation + "' and bkaddress='0' ");
|
||||
long b = db.UpdateSql(sql);
|
||||
LogHelper.WriteLogInfo("更新Addressstorage货位为已占用:" + sql + ",成功条数:" + b + "");
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 查询是否有正在作业的运单号
|
||||
public DataTable GetOrderMatchidBin(string matchid)
|
||||
{
|
||||
string sql = string.Format("select * from v_orders where tolocation!='' and matchid='" + matchid + "' ");
|
||||
DataTable dt = db.GetsqlForDT(sql);
|
||||
return dt;
|
||||
}
|
||||
|
||||
public DataTable GetOrderMatchidLocation(string block, string area)
|
||||
{
|
||||
string sql = string.Format("select * from v_orders where tolocation!='' and block='" + block + "' and area='" + area + "' ");
|
||||
DataTable dt = db.GetsqlForDT(sql);
|
||||
return dt;
|
||||
}
|
||||
|
||||
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 + "' ");
|
||||
DataTable dt = db.GetsqlForDT(sql);
|
||||
return dt;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 强制结束修改状态
|
||||
public bool UpOrdersMatchid(string block, string area, string matchid)
|
||||
{
|
||||
try
|
||||
{
|
||||
string sql = string.Format("update orders set state='3' where tolocation!='' and matchid='" + matchid + "' ");
|
||||
long x = db.UpdateSql(sql);
|
||||
LogHelper.WriteLogInfo("强制结束修改状态:" + sql + ",成功条数:" + x + "");
|
||||
if (x > 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.WriteLogInfo("强制结束修改状态异常:" + ex + "");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public bool UpBkAddresss(string block, string area)
|
||||
{
|
||||
string sql = string.Format("update Addressstorage set bkaddress='0' where block='" + block + "' and area='" + area + "' ");
|
||||
long x = db.UpdateSql(sql);
|
||||
LogHelper.WriteLogInfo("强制结束修改Addressstorage:" + sql + ",成功条数:" + x + "");
|
||||
if (x > 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public bool UpOrdersqueue(string block, string area, string matchid)
|
||||
{
|
||||
string sql = string.Format("update ordersqueue set state='3' where Taskblock='" + block + "' and Taskarea='" + area + "' and matchid='" + matchid + "' ");
|
||||
long x = db.UpdateSql(sql);
|
||||
LogHelper.WriteLogInfo("强制结束修改ordersqueue:" + sql + ",成功条数:" + x + "");
|
||||
if (x > 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 查询
|
||||
public DataTable GetSkuQuantity(string sku, string matchid)
|
||||
{
|
||||
string sql = string.Format("select sum(quantity) sumqty from Orders where sku='" + sku + "' and matchid='" + matchid + "' ");
|
||||
DataTable dt = db.GetsqlForDT(sql);
|
||||
return dt;
|
||||
}
|
||||
|
||||
public DataTable GetSku(string sku)
|
||||
{
|
||||
string sql = string.Format("select * from SkuInfo where sku = '" + sku + "' ");
|
||||
DataTable dt = db.GetsqlForDT(sql);
|
||||
return dt;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 释放播种位
|
||||
public bool UpdateLocation(string block, string area)
|
||||
{
|
||||
string sql = string.Format("update Addressstorage set bkaddress='0' where block='" + block + "' and area='" + area + "' and type='1' ");
|
||||
long x = db.UpdateSql(sql);
|
||||
LogHelper.WriteLogInfo("运单完成-释放播种位:" + sql + ",条数:" + x + "");
|
||||
if (x > 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region MyRegion
|
||||
public bool UpdateWorkState_DPS(string matchid, int truequantity, string sku, int batchid, int checkquantity, string usercode = "")
|
||||
{
|
||||
try
|
||||
{
|
||||
lock (uplock)
|
||||
{
|
||||
int oprationstate = 3;
|
||||
|
||||
string upsql = string.Format("update Orders set oprationstate = '{3}' ,oprationtime='{0}',oprationcode='{5}',truequantity=quantity where matchid='{2}' and id='{4}' ",
|
||||
DateTime.Now.ToString(),
|
||||
truequantity,
|
||||
matchid,
|
||||
oprationstate,
|
||||
batchid,
|
||||
//checkquantity,
|
||||
usercode
|
||||
);
|
||||
LogHelper.WriteLogInfo("-修改orders" + upsql);
|
||||
long x = db.UpdateSql(upsql);
|
||||
if (x > 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
LogHelper.WriteLogInfo("修改orders异常:" + upsql, LogHelper.Log_Type.ERROR);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.WriteLogInfo("修改当前标签拣货状态异常:" + ex.Message);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region
|
||||
public DataTable GetOrderinfoNumber(string matchid)
|
||||
{
|
||||
string sql = string.Format("select distinct matchid,clientname,COUNT(distinct shopid) 'shopcount',count(distinct sku) qty from Orders where matchid='" + matchid + "' and isnull(tolocation,0)>0 group by matchid,clientname");
|
||||
DataTable dt = db.GetsqlForDT(sql);
|
||||
return dt;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region MyRegion
|
||||
public bool ImportOrderinfo(DataTable ds, Dictionary<string, string> diclist)
|
||||
{
|
||||
|
||||
bool bo = db.UpdateData(ds, "orders", diclist);
|
||||
if (bo)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
LogHelper.WriteLogInfo("添加取消订单失败");
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
#region 数据维护
|
||||
public bool DelOrderSku()
|
||||
{
|
||||
try
|
||||
{
|
||||
string sql = string.Format("delete from Orders where sku not in (select sku from SkuInfo) ");
|
||||
long x = db.DeleteSql(sql);
|
||||
LogHelper.WriteLogInfo("数据维护:" + sql + ",成功条数:" + x + "");
|
||||
if (x > 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.WriteLogInfo("数据维护异常:" + ex + "", LogHelper.Log_Type.ERROR);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 导入数据清理之前orders
|
||||
public void DelOrdersBeforeDate()
|
||||
{
|
||||
try
|
||||
{
|
||||
string sql = string.Format("insert into Ordershis select * from Orders");
|
||||
long x = db.InsertSql(sql);
|
||||
LogHelper.WriteLogInfo("导入数据清理之前orders:" + sql + ",成功条数:" + x + "");
|
||||
if (x > 0)
|
||||
{
|
||||
sql = string.Format("delete from Orders");
|
||||
x = db.DeleteSql(sql);
|
||||
LogHelper.WriteLogInfo("清理orders数据:" + sql + ",成功条数:" + x + "");
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.WriteLogInfo("导入数据清理之前orders异常:" + ex.Message + "", LogHelper.Log_Type.ERROR);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
#region 运单用时
|
||||
public List<OrdersModel> GetMatchUserTimeByPage(string strWhere, string orderby, int startIndex, int endIndex, out int recordCount)
|
||||
{
|
||||
|
||||
try
|
||||
{
|
||||
StringBuilder strSql = new StringBuilder();
|
||||
strSql.Append("SELECT * FROM ( ");
|
||||
strSql.Append(" SELECT ROW_NUMBER() OVER (");
|
||||
if (!string.IsNullOrEmpty(orderby.Trim()))
|
||||
{
|
||||
strSql.Append("order by T." + orderby);
|
||||
}
|
||||
else
|
||||
{
|
||||
strSql.Append("order by matchid asc");
|
||||
}
|
||||
strSql.Append(")AS Row,matchid as matchid,clientname as clientname,count(distinct(shopid)) as ShopCount,MIN(CONVERT(datetime,oprationtime)) AS starttime,MAX(CONVERT(datetime,oprationtime)) AS endtime,DATEDIFF(MINUTE,MIN(CONVERT(datetime,oprationtime)),MAX(CONVERT(datetime,oprationtime))) AS UseTime FROM Ordershis where 1=1 " + strWhere + " GROUP BY matchid,clientname ");
|
||||
strSql.Append(" ) TT");
|
||||
strSql.AppendFormat(" WHERE TT.Row between {0} and {1}", startIndex, endIndex);
|
||||
List<OrdersModel> list = ModelConvertHelper<OrdersModel>.ConvertToList(db.GetsqlForDT(strSql.ToString()));
|
||||
|
||||
strSql.Remove(0, strSql.Length);
|
||||
strSql.Append("SELECT count(distinct matchid) FROM Ordershis");
|
||||
if (!string.IsNullOrEmpty(strWhere.Trim()))
|
||||
{
|
||||
strSql.AppendFormat(" WHERE 1=1 {0}", strWhere);
|
||||
}
|
||||
|
||||
object obj = db.GetsqlForDT(strSql.ToString()).Rows[0][0];
|
||||
if (obj != null)
|
||||
recordCount = Convert.ToInt32(obj);
|
||||
else
|
||||
recordCount = 0;
|
||||
|
||||
return list;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.WriteLog(GetType(), ex.Message);
|
||||
recordCount = 0;
|
||||
return new List<Model.OrdersModel>();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
public DataTable GetMatchUserTime_DT(string strWhere)
|
||||
{
|
||||
try
|
||||
{
|
||||
string sql = string.Format("SELECT matchid as matchid,clientname as clientname,count(distinct(shopid)) as ShopCount,MIN(CONVERT(datetime,oprationtime)) AS starttime,MAX(CONVERT(datetime,oprationtime)) AS endtime,DATEDIFF(MINUTE,MIN(CONVERT(datetime,oprationtime)),MAX(CONVERT(datetime,oprationtime))) AS UseTime FROM Ordershis where 1=1 " + strWhere + " GROUP BY matchid,clientname ");
|
||||
|
||||
return db.GetsqlForDT(sql.ToString());
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.WriteLog(GetType(), ex.Message);
|
||||
return new DataTable();
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 获取当前区的作业状态
|
||||
public DataTable getQueueState(string block, string area, string state)
|
||||
{
|
||||
string sql = string.Format("select * from OrdersQueue where taskblock='{0}' and taskarea='{1}' and state!='" + state + "' order by sort",
|
||||
block,
|
||||
area);
|
||||
return db.GetsqlForDT(sql);
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 判断订单状态为已完成
|
||||
public bool IsFinishWork_box(string boxcode, int endcount, string OrderID = "")
|
||||
{
|
||||
string sql = string.Format("select OrderID from Orders where (OrderID='{0}') and oprationstate<>3",
|
||||
OrderID);
|
||||
|
||||
|
||||
LogHelper.WriteLogInfo("判断单据状态为已完成" + sql);
|
||||
DataTable dt = db.GetsqlForDT(sql);
|
||||
if (dt == null || dt.Rows.Count == endcount)
|
||||
{
|
||||
LogHelper.WriteLogInfo("判断单据状态为已完成true");
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
LogHelper.WriteLogInfo("判断单据状态为已完成false");
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
#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
|
||||
}
|
||||
}
|
||||
|
@ -68,7 +68,7 @@ namespace Epost.DAL
|
||||
#region 获取任务信息
|
||||
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);
|
||||
|
||||
}
|
||||
@ -89,7 +89,12 @@ namespace Epost.DAL
|
||||
#region 获取当前区的作业状态
|
||||
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.Taskarea);
|
||||
return db.GetsqlForDT(sql);
|
||||
@ -122,7 +127,7 @@ namespace Epost.DAL
|
||||
#region 获取当前区的作业状态
|
||||
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.Taskarea);
|
||||
return db.GetsqlForDT(sql);
|
||||
@ -186,10 +191,10 @@ namespace Epost.DAL
|
||||
#endregion
|
||||
|
||||
#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}'",
|
||||
usercode, block);
|
||||
string sql = string.Format("update ordersqueue set state =3 where state<>3"
|
||||
);
|
||||
LogHelper.WriteLogInfo("修改作业全部完成" + sql);
|
||||
long x = db.UpdateSql(sql);
|
||||
if (x > 0)
|
||||
@ -290,10 +295,12 @@ namespace Epost.DAL
|
||||
{
|
||||
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.Sku,
|
||||
model.Matchid,model.UserCode
|
||||
|
||||
);
|
||||
LogHelper.WriteLogInfo("修改作业区段" + sql);
|
||||
|
@ -99,7 +99,14 @@ 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,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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -165,7 +165,31 @@ 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,6 +230,10 @@
|
||||
</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" />
|
||||
@ -854,6 +858,7 @@
|
||||
<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" />
|
||||
@ -870,6 +875,18 @@
|
||||
<Content Include="Views\_ViewStart.cshtml" />
|
||||
<Content Include="Views\Home\Index.cshtml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Log\fonts\glyphicons-halflings-regular.woff" />
|
||||
<Content Include="Log\fonts\glyphicons-halflings-regular.ttf" />
|
||||
<Content Include="Log\fonts\glyphicons-halflings-regular.eot" />
|
||||
<Content Include="packages.config" />
|
||||
<None Include="Project_Readme.html" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="App_Data\" />
|
||||
<Folder Include="File\" />
|
||||
<Folder Include="Models\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Common\Epost.Common.csproj">
|
||||
<Project>{44c36ca3-d672-40d1-ac94-91115de29a2d}</Project>
|
||||
@ -888,18 +905,6 @@
|
||||
<Name>Epost.Model</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Log\fonts\glyphicons-halflings-regular.woff" />
|
||||
<Content Include="Log\fonts\glyphicons-halflings-regular.ttf" />
|
||||
<Content Include="Log\fonts\glyphicons-halflings-regular.eot" />
|
||||
<Content Include="packages.config" />
|
||||
<None Include="Project_Readme.html" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="App_Data\" />
|
||||
<Folder Include="File\" />
|
||||
<Folder Include="Models\" />
|
||||
</ItemGroup>
|
||||
<PropertyGroup>
|
||||
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
|
||||
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
|
||||
@ -954,7 +959,7 @@
|
||||
<AutoAssignPort>True</AutoAssignPort>
|
||||
<DevelopmentServerPort>52610</DevelopmentServerPort>
|
||||
<DevelopmentServerVPath>/</DevelopmentServerVPath>
|
||||
<IISUrl>http://localhost:63119/</IISUrl>
|
||||
<IISUrl>http://localhost:63118/</IISUrl>
|
||||
<NTLMAuthentication>False</NTLMAuthentication>
|
||||
<UseCustomServer>False</UseCustomServer>
|
||||
<CustomServerUrl>
|
||||
|
@ -10,7 +10,7 @@
|
||||
<WebStackScaffolding_LayoutPageFile>~/Views/Shared/_EpostLayoutPage.cshtml</WebStackScaffolding_LayoutPageFile>
|
||||
<WebStackScaffolding_IsAsyncSelected>False</WebStackScaffolding_IsAsyncSelected>
|
||||
<WebStackScaffolding_ViewDialogWidth>600</WebStackScaffolding_ViewDialogWidth>
|
||||
<NameOfLastUsedPublishProfile>E:\WORK\代码管理\播种\T系列分支\Epost.TestToolsWeb\Properties\PublishProfiles\Toolsweb.pubxml</NameOfLastUsedPublishProfile>
|
||||
<NameOfLastUsedPublishProfile>D:\驿传\Epost\T_DAS_PTL\Epost.TestToolsWeb\Properties\PublishProfiles\Toolsweb.pubxml</NameOfLastUsedPublishProfile>
|
||||
<LastActiveSolutionConfig>Debug|Any CPU</LastActiveSolutionConfig>
|
||||
<Use64BitIISExpress />
|
||||
<IISExpressSSLPort />
|
||||
|
@ -9,13 +9,13 @@
|
||||
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
|
||||
<LastUsedPlatform>Any CPU</LastUsedPlatform>
|
||||
<SiteUrlToLaunchAfterPublish />
|
||||
<LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
|
||||
<ExcludeApp_Data>False</ExcludeApp_Data>
|
||||
<publishUrl>D:\驿传\T系列</publishUrl>
|
||||
<DeleteExistingFiles>True</DeleteExistingFiles>
|
||||
<PrecompileBeforePublish>True</PrecompileBeforePublish>
|
||||
<EnableUpdateable>True</EnableUpdateable>
|
||||
<DebugSymbols>False</DebugSymbols>
|
||||
<LaunchSiteAfterPublish>true</LaunchSiteAfterPublish>
|
||||
<ExcludeApp_Data>false</ExcludeApp_Data>
|
||||
<publishUrl>D:\驿传\抚远</publishUrl>
|
||||
<DeleteExistingFiles>true</DeleteExistingFiles>
|
||||
<PrecompileBeforePublish>true</PrecompileBeforePublish>
|
||||
<EnableUpdateable>true</EnableUpdateable>
|
||||
<DebugSymbols>false</DebugSymbols>
|
||||
<WDPMergeOption>DonotMerge</WDPMergeOption>
|
||||
</PropertyGroup>
|
||||
</Project>
|
File diff suppressed because it is too large
Load Diff
@ -10,12 +10,10 @@
|
||||
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
|
||||
</configSections>
|
||||
<connectionStrings>
|
||||
<add name="weijie_dpsEntities" connectionString="metadata=res://*/WJDB.csdl|res://*/WJDB.ssdl|res://*/WJDB.msl;provider=System.Data.SqlClient;provider connection string="data source=.;initial catalog=weijie_dps;user id=sa;password=123456;min pool size=4;max pool size=4;packet size=3072;MultipleActiveResultSets=True;App=EntityFramework"" providerName="System.Data.EntityClient" />
|
||||
<add name="SqlLocDPSConnection" connectionString="server=139.196.36.200;user id=EpostTest;password=antion;database=EpostTest_T;min pool size=512;max pool size=512;packet size=3072" providerName="System.Data.SqlClient" />
|
||||
<add name="MysqlLocDPSConnection" connectionString="Server=localhost;Port=3306;Database=world;User=root; Password=antion;SslMode=None;Pooling=true;Allow User Variables=True;" />
|
||||
<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="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>
|
||||
@ -27,11 +25,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://192.168.3.65:8051/api/WebAPI/ProcessingResult"/>
|
||||
<add key="WebAPIUrl" value="http://localhost:63118/api/WebAPI/ProcessingResult"/>
|
||||
<add key="ShowMode" value="1" />
|
||||
<add key="SetupMode" value="\Epost_P\Epost.TestToolsWeb\App_Data\SetupMode.txt" />
|
||||
<add key="CARID" value="HT01" />
|
||||
<add key="ServerAPIURL" value="http://192.168.3.65:8051/api/WebAPI" />
|
||||
<add key="CARID" value="" />
|
||||
<add key="ServerAPIURL" value="http://localhost:63118/api/WebAPI" />
|
||||
<add key="SleepTime" value="1" />
|
||||
</appSettings>
|
||||
<!--
|
||||
@ -48,11 +46,12 @@
|
||||
</customErrors>
|
||||
<authentication mode="None" />
|
||||
<compilation debug="true" targetFramework="4.6.1" />
|
||||
<httpRuntime targetFramework="4.5.2" />
|
||||
<httpRuntime targetFramework="4.5.2" requestValidationMode="2.0" />
|
||||
<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
Epost.TestToolsWeb/WebService/WebService.asmx
Normal file
1
Epost.TestToolsWeb/WebService/WebService.asmx
Normal file
@ -0,0 +1 @@
|
||||
<%@ WebService Language="C#" CodeBehind="WebService.asmx.cs" Class="Epost.DPS.WebService.WebService" %>
|
352
Epost.TestToolsWeb/WebService/WebService.asmx.cs
Normal file
352
Epost.TestToolsWeb/WebService/WebService.asmx.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user