This commit is contained in:
@ -478,9 +478,41 @@ namespace Epost.Common
|
|||||||
return model;
|
return model;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static string ModelToXml<T>(T model)
|
||||||
|
{
|
||||||
|
MemoryStream stream = new MemoryStream();
|
||||||
|
XmlSerializer xmlSer = new XmlSerializer(typeof(T));
|
||||||
|
xmlSer.Serialize(stream, model);
|
||||||
|
|
||||||
|
stream.Position = 0;
|
||||||
|
StreamReader sr = new StreamReader(stream);
|
||||||
|
return sr.ReadToEnd();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 将实体对象转换成XML
|
||||||
|
/// </summary>
|
||||||
|
/// <typeparam name="T">实体类型</typeparam>
|
||||||
|
/// <param name="obj">实体对象</param>
|
||||||
|
public static string XmlSerialize<T>(T obj)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
using (StringWriter sw = new StringWriter())
|
||||||
|
{
|
||||||
|
Type t = obj.GetType();
|
||||||
|
XmlSerializer serializer = new XmlSerializer(obj.GetType());
|
||||||
|
serializer.Serialize(sw, obj);
|
||||||
|
sw.Close();
|
||||||
|
return sw.ToString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
throw new Exception("将实体对象转换成XML异常", ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -18,17 +18,17 @@ namespace Epost.BLL
|
|||||||
{
|
{
|
||||||
BoxPickBLL pickBLL = new BoxPickBLL();
|
BoxPickBLL pickBLL = new BoxPickBLL();
|
||||||
OrdersDAL dal = new OrdersDAL();
|
OrdersDAL dal = new OrdersDAL();
|
||||||
|
|
||||||
OrdersQueueBLL queueBLL = new OrdersQueueBLL();
|
OrdersQueueBLL queueBLL = new OrdersQueueBLL();
|
||||||
BoxQueueBLL queueboxBLL = new BoxQueueBLL();
|
BoxQueueBLL queueboxBLL = new BoxQueueBLL();
|
||||||
CommandDAL comDAL = new CommandDAL();
|
CommandDAL comDAL = new CommandDAL();
|
||||||
CommandBLL comBLL = new CommandBLL();
|
CommandBLL comBLL = new CommandBLL();
|
||||||
AddressstorageBLL addrBLL = new AddressstorageBLL();
|
AddressstorageBLL addrBLL = new AddressstorageBLL();
|
||||||
JobModelCacheDAL JobCache = new JobModelCacheDAL();
|
JobModelCacheDAL JobCache = new JobModelCacheDAL();
|
||||||
JobDownCacheDAL downCacheDAL = new JobDownCacheDAL();
|
JobDownCacheDAL downCacheDAL = new JobDownCacheDAL();
|
||||||
LocationCacheDAL LocCacheDAL = new LocationCacheDAL();
|
LocationCacheDAL LocCacheDAL = new LocationCacheDAL();
|
||||||
UserModelCacheDAL UserCacheDAL = new UserModelCacheDAL();
|
UserModelCacheDAL UserCacheDAL = new UserModelCacheDAL();
|
||||||
private static object lockbox = new object();
|
private static object lockbox = new object();
|
||||||
|
|
||||||
#region 绑定箱号
|
#region 绑定箱号
|
||||||
public void BindBoxCode()
|
public void BindBoxCode()
|
||||||
@ -110,7 +110,7 @@ namespace Epost.BLL
|
|||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
#region 拆单
|
#region 拆单
|
||||||
public bool packOrder(ResultMessageModel data, List<JobModel> job, string block, string area, string type)
|
public bool packOrder(ResultMessageModel data, List<JobModel> job, string block, string area, string type)
|
||||||
{
|
{
|
||||||
@ -256,9 +256,9 @@ namespace Epost.BLL
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#region 删除任务
|
#region 删除任务
|
||||||
public void REMOVE_JOB(string address, string ip, string no)
|
public void REMOVE_JOB(string address, string ip, string no)
|
||||||
@ -388,11 +388,11 @@ namespace Epost.BLL
|
|||||||
if (nowqty > jobmo.Quantity)
|
if (nowqty > jobmo.Quantity)
|
||||||
{
|
{
|
||||||
nowqty = nowqty - jobmo.Quantity;
|
nowqty = nowqty - jobmo.Quantity;
|
||||||
dal.UpdateWorkState_Car(jobmo.Matchid, jobmo.Quantity, jobmo.Sku, jobmo.ID, checkquaantity, model.UserCode);
|
dal.UpdateWorkState_Car(jobmo.OrderID, jobmo.Quantity, jobmo.Sku, jobmo.ID, checkquaantity, model.UserCode);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dal.UpdateWorkState_Car(jobmo.Matchid, jobmo.Quantity, jobmo.Sku, jobmo.ID, checkquaantity, model.UserCode);
|
dal.UpdateWorkState_Car(jobmo.OrderID, jobmo.Quantity, jobmo.Sku, jobmo.ID, checkquaantity, model.UserCode);
|
||||||
nowqty = 0;
|
nowqty = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -453,11 +453,11 @@ namespace Epost.BLL
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//换箱
|
//换箱
|
||||||
#region 换箱
|
#region 换箱
|
||||||
public void changeBox_ClearJOB(string sblock, string sarea, string address, string controlip)
|
public void changeBox_ClearJOB(string sblock, string sarea, string address, string controlip)
|
||||||
@ -544,7 +544,7 @@ namespace Epost.BLL
|
|||||||
public void BindJobListBySku(string sku)
|
public void BindJobListBySku(string sku)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
List<OrderListModel> dnList = LocCacheDAL.GetLocationList().FindAll(m => m.State == 0 && m.Sku == sku);
|
List<OrderListModel> dnList = LocCacheDAL.GetLocationList().FindAll(m => m.State == 0 && m.Sku == sku);
|
||||||
if (dnList.Any())
|
if (dnList.Any())
|
||||||
{
|
{
|
||||||
@ -629,9 +629,9 @@ namespace Epost.BLL
|
|||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#region 清除显示标签
|
#region 清除显示标签
|
||||||
@ -731,30 +731,30 @@ namespace Epost.BLL
|
|||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region 获取订单信息
|
#region 获取订单信息
|
||||||
public List<JobModel> GetOrderList(string matchid, string block, string sku = "", string area = "", string UserCode = "")
|
public List<JobModel> GetOrderList(string orderid, string block, string sku = "", string area = "", string UserCode = "")
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
||||||
List<JobModel> list = new List<JobModel>();
|
List<JobModel> list = new List<JobModel>();
|
||||||
DataTable OrderDt = dal.GetOrderList_Car(matchid, sku, area, block);
|
DataTable OrderDt = dal.GetOrderList_Car(orderid, sku, area, block);
|
||||||
bool isecho = false;
|
bool isecho = false;
|
||||||
//if (OrderDt == null || OrderDt.Rows.Count == 0)//回显
|
//if (OrderDt == null || OrderDt.Rows.Count == 0)//回显
|
||||||
//{
|
//{
|
||||||
// OrderDt = dal.GetOrderList_Car(matchid, sku, area, block);
|
// OrderDt = dal.GetOrderList_Car(matchid, sku, area, block);
|
||||||
// isecho = true;
|
// isecho = true;
|
||||||
|
|
||||||
//}
|
//}
|
||||||
if (OrderDt != null && OrderDt.Rows.Count > 0)
|
if (OrderDt != null && OrderDt.Rows.Count > 0)
|
||||||
{
|
{
|
||||||
string usercode = string.Empty;
|
string usercode = string.Empty;
|
||||||
string lightcolor = string.Empty;
|
string lightcolor = string.Empty;
|
||||||
DataTable udt = dal.GetOrderUseerXCode(matchid, sku, area, block);
|
//DataTable udt = dal.GetOrderUseerXCode(matchid, sku, area, block);
|
||||||
if (udt != null && udt.Rows.Count > 0)
|
//if (udt != null && udt.Rows.Count > 0)
|
||||||
{
|
//{
|
||||||
usercode = udt.Rows[0]["usercode"].ToString();
|
// usercode = udt.Rows[0]["usercode"].ToString();
|
||||||
lightcolor = udt.Rows[0]["lightcolor"].ToString();
|
// lightcolor = udt.Rows[0]["lightcolor"].ToString();
|
||||||
}
|
//}
|
||||||
if (string.IsNullOrEmpty(lightcolor))
|
if (string.IsNullOrEmpty(lightcolor))
|
||||||
{
|
{
|
||||||
lightcolor = EnumHelper.EMToDescriptionString(LightColor.Color.Red);
|
lightcolor = EnumHelper.EMToDescriptionString(LightColor.Color.Red);
|
||||||
@ -780,7 +780,14 @@ namespace Epost.BLL
|
|||||||
demodel.Area = item["Area"].ToString();
|
demodel.Area = item["Area"].ToString();
|
||||||
demodel.Address = item["address"].ToString();
|
demodel.Address = item["address"].ToString();
|
||||||
demodel.UserCode = usercode;
|
demodel.UserCode = usercode;
|
||||||
demodel.ColorCode = lightcolor;
|
demodel.ColorCode = item["labelcolor"].ToString();
|
||||||
|
demodel.looklisten = item["looklisten"].ToString();
|
||||||
|
demodel.labelIP = item["labelIP"].ToString();
|
||||||
|
demodel.labelno = item["labelno"].ToString();
|
||||||
|
demodel.genericname = item["genericname"].ToString();
|
||||||
|
demodel.manufactname = item["manufactname"].ToString();
|
||||||
|
demodel.batchno = item["batchno"].ToString();
|
||||||
|
demodel.Spec = item["Spec"].ToString();
|
||||||
demodel.Bkaddress = "0";
|
demodel.Bkaddress = "0";
|
||||||
demodel.Addresstype = "1";
|
demodel.Addresstype = "1";
|
||||||
demodel.ControlID = "";
|
demodel.ControlID = "";
|
||||||
@ -801,9 +808,10 @@ namespace Epost.BLL
|
|||||||
// demodel.ColorCode = EnumHelper.EMToDescriptionString(LightColor.Color.Blue);
|
// demodel.ColorCode = EnumHelper.EMToDescriptionString(LightColor.Color.Blue);
|
||||||
//}
|
//}
|
||||||
list.Add(demodel);
|
list.Add(demodel);
|
||||||
if (!isecho) {
|
if (!isecho)
|
||||||
//修改数据为已读
|
{
|
||||||
dal.UpOrder_Car(item["Matchid"].ToString(), item["sku"].ToString(), item["id"].ToString());
|
//修改数据为已读
|
||||||
|
dal.UpOrder_Car(item["Matchid"].ToString(), item["sku"].ToString(), item["id"].ToString());
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
@ -813,8 +821,7 @@ namespace Epost.BLL
|
|||||||
LogHelper.WriteLogInfo("查询无任务================");
|
LogHelper.WriteLogInfo("查询无任务================");
|
||||||
|
|
||||||
OrdersQueueModel qmodel = new OrdersQueueModel();
|
OrdersQueueModel qmodel = new OrdersQueueModel();
|
||||||
qmodel.Sku = sku;
|
qmodel.Orderid = orderid;
|
||||||
qmodel.Matchid = matchid;
|
|
||||||
qmodel.UserCode = UserCode;
|
qmodel.UserCode = UserCode;
|
||||||
qmodel.Taskblock = block;
|
qmodel.Taskblock = block;
|
||||||
qmodel.Taskarea = area;
|
qmodel.Taskarea = area;
|
||||||
@ -839,7 +846,10 @@ namespace Epost.BLL
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public DataTable GetOrderList(string area, string block)
|
||||||
|
{
|
||||||
|
return dal.GetOrderList(area, block);
|
||||||
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
@ -901,7 +911,7 @@ namespace Epost.BLL
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region 修改订单信息
|
#region 修改订单信息
|
||||||
public bool UpdateOrderstate(string orderid)
|
public bool UpdateOrderstate(string orderid)
|
||||||
{
|
{
|
||||||
@ -917,9 +927,9 @@ namespace Epost.BLL
|
|||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region 修改订单信息
|
#region 修改订单信息
|
||||||
public bool Updatestate(string matchid,string readdate)
|
public bool Updatestate(string matchid, string readdate)
|
||||||
{
|
{
|
||||||
return dal.Updatestate(matchid,readdate);
|
return dal.Updatestate(matchid, readdate);
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
@ -940,6 +950,16 @@ namespace Epost.BLL
|
|||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region
|
||||||
|
public bool ImportOrderinfo(DataTable ds, Dictionary<string, string> diclist)
|
||||||
|
{
|
||||||
|
bool bo = false;
|
||||||
|
if (ds != null && ds.Rows.Count > 0)
|
||||||
|
{
|
||||||
|
bo = dal.ImportOrderinfo(ds, diclist);
|
||||||
|
}
|
||||||
|
return bo;
|
||||||
|
}
|
||||||
|
|
||||||
public DataTable GetMatchOrderList()
|
public DataTable GetMatchOrderList()
|
||||||
{
|
{
|
||||||
@ -984,7 +1004,7 @@ namespace Epost.BLL
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
public bool IsFinishWorkByCar(int endcount, string matchid, string block="")
|
public bool IsFinishWorkByCar(int endcount, string matchid, string block = "")
|
||||||
{
|
{
|
||||||
return dal.IsFinishWorkByCar(endcount, matchid, block);
|
return dal.IsFinishWorkByCar(endcount, matchid, block);
|
||||||
}
|
}
|
||||||
@ -998,13 +1018,13 @@ namespace Epost.BLL
|
|||||||
{
|
{
|
||||||
return dal.IsFinishWork(endcount, block, usercode, area, sku, shopid, matchid);
|
return dal.IsFinishWork(endcount, block, usercode, area, sku, shopid, matchid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public DataTable GetMatchOrder()
|
public DataTable GetMatchOrder()
|
||||||
{
|
{
|
||||||
return dal.GetMatchOrder();
|
return dal.GetMatchOrder();
|
||||||
}
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
#region 获取订单信息
|
#region 获取订单信息
|
||||||
public DataTable GetOrderList_Car(string matchid, string sku, string sarea, string sblock)
|
public DataTable GetOrderList_Car(string matchid, string sku, string sarea, string sblock)
|
||||||
@ -1018,5 +1038,10 @@ namespace Epost.BLL
|
|||||||
return dal.GetOrderList_echo(matchid, sku, sarea, sblock);
|
return dal.GetOrderList_echo(matchid, sku, sarea, sblock);
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
public DataTable GetDataIfRepeat(string transderMid, string transderDid)
|
||||||
|
{
|
||||||
|
return dal.GetDataIfRepeat(transderMid, transderDid);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -334,11 +334,7 @@ namespace Epost.BLL
|
|||||||
|
|
||||||
}
|
}
|
||||||
DataTable queueDT = queueBLL.getQueueOrderState(qmodel);
|
DataTable queueDT = queueBLL.getQueueOrderState(qmodel);
|
||||||
if (queueDT != null && queueDT.Rows.Count > 0)
|
|
||||||
{
|
|
||||||
skulist = queueDT.Rows[0]["sku"].ToString();
|
|
||||||
LogHelper.WriteLogInfo("=======" + qmodel.UserCode + "=====" + area + "区===sku=" + skulist);
|
|
||||||
}
|
|
||||||
#region 任意回显标签拍下 熄灭回显设备
|
#region 任意回显标签拍下 熄灭回显设备
|
||||||
//if (data.Loc == "check")//任意回显标签拍下 熄灭回显设备
|
//if (data.Loc == "check")//任意回显标签拍下 熄灭回显设备
|
||||||
//{
|
//{
|
||||||
@ -422,62 +418,50 @@ namespace Epost.BLL
|
|||||||
List<JobModel> downlist = new List<JobModel>();
|
List<JobModel> downlist = new List<JobModel>();
|
||||||
JobModel model = job.FirstOrDefault();
|
JobModel model = job.FirstOrDefault();
|
||||||
downlist.Add(model);
|
downlist.Add(model);
|
||||||
int endcount = 1;
|
|
||||||
List<JobModel> manyList = job.FindAll(m => m.ManyState == 1 && m.Tolocation == model.Tolocation && m.Sku == model.Sku);
|
List<JobModel> manyList = job.FindAll(m => m.ManyState == 1 && m.Tolocation == model.Tolocation && m.Sku == model.Sku);
|
||||||
if (manyList.Any())//合并显示数据
|
#region 处理合并数据
|
||||||
{
|
//int endcount = 1;
|
||||||
endcount = manyList.Count;
|
//if (manyList.Any())//合并显示数据
|
||||||
downlist.AddRange(manyList);
|
//{
|
||||||
LogHelper.WriteLogInfo("合并显示数据" + endcount + "============================");
|
// endcount = manyList.Count;
|
||||||
}
|
// downlist.AddRange(manyList);
|
||||||
else
|
// LogHelper.WriteLogInfo("合并显示数据" + endcount + "============================");
|
||||||
{
|
//}
|
||||||
downlist.Add(model);
|
//else
|
||||||
}
|
//{
|
||||||
|
// downlist.Add(model);
|
||||||
|
//}
|
||||||
|
#endregion
|
||||||
|
|
||||||
orderbll.UpdateOrderState_Car(downlist, model, truequantity, checkquantity);
|
orderbll.UpdateOrderState_Car(downlist, model, truequantity, checkquantity);
|
||||||
LogHelper.WriteLogInfo("6------" + data.Address + "------" + model.Sku + "----" + model.State + "");
|
LogHelper.WriteLogInfo("标记------" + data.Address + "------" + model.Sku + "----" + model.State + "");
|
||||||
bool skuInish = dal.IsFinishWork(1, block, "", area, model.Sku, "", model.Matchid);
|
bool skuInish = dal.IsFinishWork(1, block, "", area, model.Sku, "", model.OrderID);
|
||||||
if (skuInish)
|
if (skuInish)
|
||||||
{
|
{
|
||||||
LogHelper.WriteLogInfo(data.Address + "=========------------------" + data.Parameter);
|
LogHelper.WriteLogInfo(data.Address + "=========------------------" + data.Parameter);
|
||||||
#region 修改任务队列状态
|
|
||||||
OrdersQueueModel qumodel = new OrdersQueueModel();
|
|
||||||
qumodel.State = 3;
|
|
||||||
qumodel.Taskblock = block;
|
|
||||||
qumodel.Taskarea = area;
|
|
||||||
qumodel.Sku = model.Sku;
|
|
||||||
qumodel.Matchid = model.Matchid;
|
|
||||||
queueBLL.UpdateQueueTaskArea_Car(qumodel);
|
|
||||||
#endregion
|
|
||||||
Thread.Sleep(30);
|
|
||||||
LogHelper.WriteLogInfo("区SKU拣选完成--------------");
|
LogHelper.WriteLogInfo("区SKU拣选完成--------------");
|
||||||
//删除sku缓存信息
|
//删除sku缓存信息
|
||||||
List<ResultMessageModel> scanlist = downCacheDAL.GetPlanJobDownList().FindAll(p => p.Parameter == model.Sku && p.Command == "QUERY_SCAN_STATUS" && p.Area == area);
|
List<JobModel> rjob = jobList.FindAll(m => m.Block == data.Block && m.Area == data.Area && m.Sku == model.Sku);
|
||||||
downCacheDAL.UpdateJobDownModelList(scanlist, EdownCommend.Execute);
|
|
||||||
List<JobModel> rjob = jobList.FindAll(m => m.Block == data.Block && m.Sku == model.Sku);
|
|
||||||
JobCache.UpdateJobModelList(rjob, EcommendType.Execute);
|
JobCache.UpdateJobModelList(rjob, EcommendType.Execute);
|
||||||
|
|
||||||
bool allfinish = dal.IsFinishWork_box("", 0, model.Matchid);
|
bool allfinish = dal.IsFinishWork_box("", 0, model.OrderID);
|
||||||
if (allfinish)
|
if (allfinish)
|
||||||
{
|
{
|
||||||
//修改订单状态
|
#region 修改任务队列状态
|
||||||
orderbll.UpdateOrderState_Car(downlist, model, 1, checkquantity);
|
OrdersQueueModel qumodel = new OrdersQueueModel();
|
||||||
bool lbo = dal.UpdateLocation(block, area);
|
qumodel.State = 3;
|
||||||
dal.UpdateStateByCar(model.Matchid);
|
qumodel.Taskblock = block;
|
||||||
content = "此运单号作业已完成\r\r";
|
qumodel.Taskarea = area;
|
||||||
|
qumodel.Orderid = model.OrderID;
|
||||||
|
queueBLL.UpdateQueueTaskArea_Car(qumodel);
|
||||||
|
#endregion
|
||||||
|
|
||||||
ShowMessageModel_M showmodel = new ShowMessageModel_M();
|
//修改订单状态
|
||||||
showmodel.Area = area;
|
dal.UpdateStateByCar(model.OrderID);
|
||||||
showmodel.Block = block;
|
comBLL.DISPLAY_LIGHT_BLOCK(model.Block, data.Area, "0");
|
||||||
showmodel.Color = color;
|
|
||||||
showmodel.Islock = true;
|
|
||||||
showmodel.Title = model.Matchid;
|
|
||||||
showmodel.No = "01";
|
|
||||||
showmodel.IsTwinkle = 0;
|
|
||||||
showmodel.Contents = content;
|
|
||||||
showmodel.Type = 2;
|
|
||||||
comBLL.ShowBoxMessage_M(showmodel);//点亮显示标签
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -517,6 +501,21 @@ namespace Epost.BLL
|
|||||||
{
|
{
|
||||||
displayOrder(queueDT, nblock, narea, list, model);
|
displayOrder(queueDT, nblock, narea, list, model);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
@ -545,57 +544,123 @@ namespace Epost.BLL
|
|||||||
if (!isJobList.Any())
|
if (!isJobList.Any())
|
||||||
{
|
{
|
||||||
model.State = 1;
|
model.State = 1;
|
||||||
orderbll.GetOrderList(queueDT.Rows[0]["matchid"].ToString(), nblock, queueDT.Rows[0]["sku"].ToString(), narea, queueDT.Rows[0]["usercode"].ToString());
|
orderbll.GetOrderList(queueDT.Rows[0]["Orderid"].ToString(), nblock, "", narea, queueDT.Rows[0]["usercode"].ToString());
|
||||||
List<JobModel> nowJoblist = jobList.FindAll(p => p.State == 0 && p.Block == model.Taskblock && p.Area == model.Taskarea);
|
List<JobModel> nowJoblist = jobList.FindAll(p => p.State == 0 && p.Block == model.Taskblock && p.Area == model.Taskarea);
|
||||||
if (nowJoblist.Any())
|
if (nowJoblist.Any())
|
||||||
{
|
{
|
||||||
var nowmodel = nowJoblist.FirstOrDefault();
|
var nowmodel = nowJoblist.FirstOrDefault();
|
||||||
|
|
||||||
LogHelper.WriteLogInfo("进入任务点亮=====matchid=" + nowmodel.Matchid + "===orderid===" + nowmodel.OrderID + "=====sku==" + nowmodel.Sku + "========");
|
LogHelper.WriteLogInfo("进入任务点亮=====matchid=" + nowmodel.Matchid + "===orderid===" + nowmodel.OrderID + "=====");
|
||||||
#region 点亮任务标签
|
#region 点亮任务标s签
|
||||||
foreach (JobModel item in nowJoblist.ToArray())
|
foreach (JobModel item in nowJoblist.ToArray())
|
||||||
{
|
{
|
||||||
if (item.State == 0)
|
if (item.State == 0)
|
||||||
{
|
{
|
||||||
List<JobModel> manyJoblist = nowJoblist.FindAll(m => m.Tolocation == item.Tolocation);
|
|
||||||
int quantity = item.Quantity;
|
|
||||||
|
|
||||||
#region 判断同一订单、同一货位多条数据 合并显示
|
#region 判断同一订单、同一货位多条数据 合并显示
|
||||||
if (manyJoblist.Count > 1)//同一个货位的数据合并显示
|
//List<JobModel> manyJoblist = nowJoblist.FindAll(m => m.Tolocation == item.Tolocation);
|
||||||
{
|
int quantity = item.Quantity;
|
||||||
quantity = 0;
|
//if (manyJoblist.Count > 1)//同一个货位的数据合并显示
|
||||||
if (manyJoblist.FindAll(m => m.State == 0).Any())
|
//{
|
||||||
{
|
// quantity = 0;
|
||||||
foreach (JobModel mitem in manyJoblist)
|
// if (manyJoblist.FindAll(m => m.State == 0).Any())
|
||||||
{
|
// {
|
||||||
quantity += mitem.Quantity;
|
// foreach (JobModel mitem in manyJoblist)
|
||||||
mitem.State = 1;
|
// {
|
||||||
mitem.ManyState = 1;
|
// quantity += mitem.Quantity;
|
||||||
}
|
// mitem.State = 1;
|
||||||
}
|
// mitem.ManyState = 1;
|
||||||
}
|
// }
|
||||||
|
// }
|
||||||
|
//}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
//if (item.Tolocation.Contains("-"))
|
||||||
|
//{
|
||||||
|
// var aryloc = item.Tolocation.Split('-');
|
||||||
|
//}
|
||||||
LabelParamModel lamodel = new LabelParamModel();
|
LabelParamModel lamodel = new LabelParamModel();
|
||||||
string address = item.Address.ToString();
|
string address = item.Address.ToString();
|
||||||
lamodel.Address = address;
|
lamodel.Address = address;
|
||||||
lamodel.ControlIP = item.ControlIP.ToString();
|
lamodel.ControlIP = item.ControlIP.ToString();
|
||||||
lamodel.Command = "DISPLAY_JOB";
|
lamodel.Command = "DISPLAY_JOB";
|
||||||
lamodel.Uid = item.ID;
|
|
||||||
lamodel.Type = "N";
|
|
||||||
|
lamodel.Title = item.genericname;
|
||||||
|
lamodel.Content = "" + item.Sku.Substring(item.Sku.Length - 4, 4) + "\t" + item.Spec + "\r" + item.GoodsName + "\r批号 " + item.batchno + "\t" + item.manufactname.Substring(0, 4) + "";
|
||||||
|
var aryloc = item.Tolocation.Split('-');
|
||||||
|
lamodel.Loc = "" + aryloc[1].ToString() + "-" + aryloc[2].ToString() + "";
|
||||||
|
lamodel.W_quantity = aryloc[3].ToString();
|
||||||
lamodel.Quantity = quantity.ToString();
|
lamodel.Quantity = quantity.ToString();
|
||||||
|
lamodel.Unit = "盒";
|
||||||
|
lamodel.PicChoose = "";
|
||||||
|
#region 看似听似
|
||||||
|
if (item.looklisten == "18")
|
||||||
|
{
|
||||||
|
lamodel.PicChoose = "02";//听似
|
||||||
|
}
|
||||||
|
else if (item.looklisten == "17")
|
||||||
|
{
|
||||||
|
lamodel.PicChoose = "03";//看似
|
||||||
|
}
|
||||||
|
else if (item.looklisten == "16")
|
||||||
|
{
|
||||||
|
lamodel.PicChoose = "04";//多规
|
||||||
|
}
|
||||||
|
|
||||||
|
else if (item.looklisten == "无")
|
||||||
|
{
|
||||||
|
lamodel.PicChoose = "05";//易混淆
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
lamodel.Uid = item.ID;
|
lamodel.Uid = item.ID;
|
||||||
lamodel.Mode = queueDT.Rows[0]["lightcolor"].ToString() + "0";
|
lamodel.Type = "C";
|
||||||
|
string color = EnumHelper.EMToDescriptionString(LightColor.Color.Red);
|
||||||
|
|
||||||
|
#region 标签颜色
|
||||||
|
if (item.ColorCode == "1")
|
||||||
|
{
|
||||||
|
color = EnumHelper.EMToDescriptionString(LightColor.Color.Red);
|
||||||
|
}
|
||||||
|
else if (item.ColorCode == "2")
|
||||||
|
{
|
||||||
|
color = EnumHelper.EMToDescriptionString(LightColor.Color.Blue);
|
||||||
|
}
|
||||||
|
else if (item.ColorCode == "3")
|
||||||
|
{
|
||||||
|
color = EnumHelper.EMToDescriptionString(LightColor.Color.Green);
|
||||||
|
}
|
||||||
|
else if (item.ColorCode == "4")
|
||||||
|
{
|
||||||
|
color = EnumHelper.EMToDescriptionString(LightColor.Color.Cyan);
|
||||||
|
}
|
||||||
|
else if (item.ColorCode == "5")
|
||||||
|
{
|
||||||
|
color = EnumHelper.EMToDescriptionString(LightColor.Color.Yellow);
|
||||||
|
}
|
||||||
|
else if (item.ColorCode == "6")
|
||||||
|
{
|
||||||
|
color = EnumHelper.EMToDescriptionString(LightColor.Color.White);
|
||||||
|
}
|
||||||
|
else if (item.ColorCode == "7")
|
||||||
|
{
|
||||||
|
color = EnumHelper.EMToDescriptionString(LightColor.Color.Pink);
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
lamodel.Mode = color + "0";
|
||||||
|
|
||||||
|
|
||||||
list.Add(lamodel);
|
list.Add(lamodel);
|
||||||
|
|
||||||
item.State = 1;
|
item.State = 1;
|
||||||
item.ColorCode = queueDT.Rows[0]["lightcolor"].ToString();
|
|
||||||
item.DisplayTime = DateTime.Now;
|
item.DisplayTime = DateTime.Now;
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
#region 点亮通道灯
|
#region 点亮通道灯
|
||||||
//comBLL.DISPLAY_LIGHT_BLOCK(model.Taskblock, model.Taskarea, "1");
|
comBLL.DISPLAY_LIGHT_BLOCK(model.Taskblock, model.Taskarea, "1");
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -650,6 +650,7 @@ namespace Epost.DAL
|
|||||||
sendModel.W_unit = ControlDetail[i].W_unit;
|
sendModel.W_unit = ControlDetail[i].W_unit;
|
||||||
sendModel.W_quantity = ControlDetail[i].W_quantity;
|
sendModel.W_quantity = ControlDetail[i].W_quantity;
|
||||||
sendModel.Loc = ControlDetail[i].Loc;
|
sendModel.Loc = ControlDetail[i].Loc;
|
||||||
|
sendModel.PicChoose = ControlDetail[i].PicChoose;
|
||||||
|
|
||||||
sendModel.Timeout ="0.5";
|
sendModel.Timeout ="0.5";
|
||||||
list.Add(sendModel);
|
list.Add(sendModel);
|
||||||
|
@ -10,7 +10,7 @@ namespace Epost.DAL
|
|||||||
public class DB_Oracle
|
public class DB_Oracle
|
||||||
{
|
{
|
||||||
private DataBaseOpration.OprationOraDAL db;
|
private DataBaseOpration.OprationOraDAL db;
|
||||||
private string _strOracleMIDConnString = ConfigurationManager.ConnectionStrings["OraMidConnString"].ConnectionString;
|
//private string _strOracleMIDConnString = ConfigurationManager.ConnectionStrings["OraMidConnString"].ConnectionString;
|
||||||
|
|
||||||
public DB_Oracle()
|
public DB_Oracle()
|
||||||
{
|
{
|
||||||
@ -31,12 +31,12 @@ namespace Epost.DAL
|
|||||||
{
|
{
|
||||||
|
|
||||||
//如实例不存在,则New一个新实例,否则返回已有实例
|
//如实例不存在,则New一个新实例,否则返回已有实例
|
||||||
if (db == null)
|
//if (db == null)
|
||||||
{
|
//{
|
||||||
|
|
||||||
db = new DataBaseOpration.OprationOraDAL(_strOracleMIDConnString);
|
// db = new DataBaseOpration.OprationOraDAL(_strOracleMIDConnString);
|
||||||
|
|
||||||
}
|
//}
|
||||||
return db;
|
return db;
|
||||||
|
|
||||||
|
|
||||||
|
@ -36,19 +36,23 @@ namespace Epost.DAL
|
|||||||
|
|
||||||
|
|
||||||
#region 获取订单信息
|
#region 获取订单信息
|
||||||
public DataTable GetOrderList_Car(string matchid, string sku, string area, string block)
|
public DataTable GetOrderList_Car(string orderid, string sku, string area, string block)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
string strwhere = string.Empty;
|
string strwhere = string.Empty;
|
||||||
if (!string.IsNullOrEmpty(matchid))
|
if (!string.IsNullOrEmpty(orderid))
|
||||||
{
|
{
|
||||||
strwhere = "and matchid= '" + matchid + "'";
|
strwhere = "and orderid= '" + orderid + "'";
|
||||||
|
}
|
||||||
|
if (!string.IsNullOrEmpty(sku))
|
||||||
|
{
|
||||||
|
strwhere = "and sku= '" + sku + "' ";
|
||||||
}
|
}
|
||||||
string sql = string.Empty;
|
string sql = string.Empty;
|
||||||
if (!string.IsNullOrEmpty(area))
|
if (!string.IsNullOrEmpty(area))
|
||||||
{
|
{
|
||||||
sql = string.Format("select id, Matchid, orderid, barcode, BatchId, DownDate, Tolocation, Sku, GoodsName, Discount, Quantity, address, ControlIP,area, block,unit,shopid from v_orders where state = 0 and oprationstate <>3 and sku = '{0}' and block = '{1}' and area='{2}' " + strwhere + "",
|
sql = string.Format("select id,transderDid,orderid,Sku,genericname,GoodsName,Spec,unit,batchno,manufactname,Quantity,stockquantity,shopname,Tolocation,labelcolor,looklisten,labelIP,labelno,Matchid,barcode,BatchId,DownDate,Discount,address,ControlIP,area,block,shopid from v_orders where state = 0 and oprationstate <>3 and block = '{1}' and area='{2}' " + strwhere + "",
|
||||||
|
|
||||||
sku,
|
sku,
|
||||||
block, area);
|
block, area);
|
||||||
@ -56,7 +60,7 @@ namespace Epost.DAL
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
sql = string.Format("select id, Matchid, orderid, barcode, BatchId, DownDate, Tolocation, Sku, GoodsName, Discount, Quantity, address, ControlIP, area , block,unit,shopid from v_orders where state = 0 and oprationstate <>3 and sku = '{0}' and block = '{1}' " + strwhere + "",
|
sql = string.Format("select id,transderDid,orderid,Sku,genericname,GoodsName,Spec,unit,batchno,manufactname,Quantity,stockquantity,shopname,Tolocation,labelcolor,looklisten,labelIP,labelno,Matchid,barcode,BatchId,DownDate,Discount,address,ControlIP,area,block,shopid from v_orders where state = 0 and oprationstate <>3 and sku = '{0}' and block = '{1}' " + strwhere + "",
|
||||||
|
|
||||||
sku,
|
sku,
|
||||||
block);
|
block);
|
||||||
@ -74,6 +78,24 @@ namespace Epost.DAL
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public DataTable GetOrderList(string area, string block)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
string strwhere = string.Empty;
|
||||||
|
|
||||||
|
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 <>3 and block = '{0}' and area='{1}' " + strwhere + "",
|
||||||
|
|
||||||
|
block, area);
|
||||||
|
return db.GetsqlForDT(sql);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
LogHelper.WriteLogInfo("获取订单信息异常:" + ex.Message);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
@ -622,7 +644,7 @@ namespace Epost.DAL
|
|||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region 修改当前标签拣货状态
|
#region 修改当前标签拣货状态
|
||||||
public bool UpdateWorkState_Car(string matchid, int truequantity, string sku, string id, int checkquantity, string usercode = "")
|
public bool UpdateWorkState_Car(string orderid, int truequantity, string sku, string id, int checkquantity, string usercode = "")
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@ -646,10 +668,10 @@ namespace Epost.DAL
|
|||||||
// }
|
// }
|
||||||
// truequantity = trueqty + 1;
|
// truequantity = trueqty + 1;
|
||||||
// }
|
// }
|
||||||
string upsql = string.Format("update orders set oprationstate = '{3}' ,oprationtime='{0}',oprationcode='{5}',truequantity='{1}' where matchid='{2}' and id='{4}' ",
|
string upsql = string.Format("update orders set oprationstate = '{3}' ,oprationtime='{0}',oprationcode='{5}',truequantity='{1}' where orderid='{2}' and id='{4}' ",
|
||||||
DateTime.Now.ToString(),
|
DateTime.Now.ToString(),
|
||||||
truequantity,
|
truequantity,
|
||||||
matchid,
|
orderid,
|
||||||
oprationstate,
|
oprationstate,
|
||||||
id,
|
id,
|
||||||
// checkquantity,
|
// checkquantity,
|
||||||
@ -718,7 +740,7 @@ namespace Epost.DAL
|
|||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region 修改当前小车拣货状态
|
#region 修改当前小车拣货状态
|
||||||
public bool UpdateStateByCar(string matchid, string block = "", string sku = "")
|
public bool UpdateStateByCar(string OrderID, string block = "", string sku = "")
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@ -731,9 +753,9 @@ namespace Epost.DAL
|
|||||||
{
|
{
|
||||||
strwhere += " and sku='" + sku + "'";
|
strwhere += " and sku='" + sku + "'";
|
||||||
}
|
}
|
||||||
string upsql = string.Format("update orders set state=3 where matchid = '{0}'" + strwhere,
|
string upsql = string.Format("update orders set state=3 where OrderID = '{0}'" + strwhere,
|
||||||
matchid);
|
OrderID);
|
||||||
LogHelper.WriteLogInfo("修改波次拣货状态:" + upsql);
|
LogHelper.WriteLogInfo("修改单据拣货状态:" + upsql);
|
||||||
long x = db.UpdateSql(upsql);
|
long x = db.UpdateSql(upsql);
|
||||||
if (x > 0)
|
if (x > 0)
|
||||||
return true;
|
return true;
|
||||||
@ -1040,7 +1062,7 @@ namespace Epost.DAL
|
|||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region 判断当前sku是否为已完成
|
#region 判断当前sku是否为已完成
|
||||||
public bool IsFinishWork(int endcount, string block, string usercode = "", string area = "", string sku = "", string shopid = "", string matchid = "")
|
public bool IsFinishWork(int endcount, string block, string usercode = "", string area = "", string sku = "", string shopid = "", string orderid = "")
|
||||||
{
|
{
|
||||||
string strwheres = "";
|
string strwheres = "";
|
||||||
if (!string.IsNullOrEmpty(usercode))
|
if (!string.IsNullOrEmpty(usercode))
|
||||||
@ -1061,9 +1083,9 @@ namespace Epost.DAL
|
|||||||
{
|
{
|
||||||
strwheres += " and shopid ='" + shopid + "'";
|
strwheres += " and shopid ='" + shopid + "'";
|
||||||
}
|
}
|
||||||
if (!string.IsNullOrEmpty(matchid))
|
if (!string.IsNullOrEmpty(orderid))
|
||||||
{
|
{
|
||||||
strwheres += " and matchid ='" + matchid + "'";
|
strwheres += " and orderid ='" + orderid + "'";
|
||||||
}
|
}
|
||||||
string sql = "select matchid, sku from V_orders where oprationstate <> 3 and state<>99 and block ='" + block + "' " + strwheres;
|
string sql = "select matchid, sku from V_orders where oprationstate <> 3 and state<>99 and block ='" + block + "' " + strwheres;
|
||||||
|
|
||||||
@ -2838,22 +2860,22 @@ namespace Epost.DAL
|
|||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region 判断订单状态为已完成
|
#region 判断订单状态为已完成
|
||||||
public bool IsFinishWork_box(string boxcode, int endcount, string matchid = "")
|
public bool IsFinishWork_box(string boxcode, int endcount, string OrderID = "")
|
||||||
{
|
{
|
||||||
string sql = string.Format("select matchid from Orders where (matchid='{0}') and oprationstate<>3",
|
string sql = string.Format("select OrderID from Orders where (OrderID='{0}') and oprationstate<>3",
|
||||||
matchid);
|
OrderID);
|
||||||
|
|
||||||
|
|
||||||
LogHelper.WriteLogInfo("判断整箱状态为已完成" + sql);
|
LogHelper.WriteLogInfo("判断单据状态为已完成" + sql);
|
||||||
DataTable dt = db.GetsqlForDT(sql);
|
DataTable dt = db.GetsqlForDT(sql);
|
||||||
if (dt == null || dt.Rows.Count == endcount)
|
if (dt == null || dt.Rows.Count == endcount)
|
||||||
{
|
{
|
||||||
LogHelper.WriteLogInfo("判断整箱状态为已完成true");
|
LogHelper.WriteLogInfo("判断单据状态为已完成true");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
LogHelper.WriteLogInfo("判断整箱状态为已完成false");
|
LogHelper.WriteLogInfo("判断单据状态为已完成false");
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -2861,5 +2883,12 @@ namespace Epost.DAL
|
|||||||
#endregion
|
#endregion
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
public DataTable GetDataIfRepeat(string transderMid, string transderDid)
|
||||||
|
{
|
||||||
|
string sql = string.Format("select distinct orderid,transderDid from Orders where orderid='" + transderMid + "' and transderDid='" + transderDid + "' ");
|
||||||
|
DataTable dt = db.GetsqlForDT(sql);
|
||||||
|
return dt;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -68,7 +68,7 @@ namespace Epost.DAL
|
|||||||
#region 获取任务信息
|
#region 获取任务信息
|
||||||
public DataTable getQueuesbyState()
|
public DataTable getQueuesbyState()
|
||||||
{
|
{
|
||||||
string sql = "select * from OrdersQueue where state<>0 and state<>3";
|
string sql = "select * from OrdersQueue where state<>3";
|
||||||
return db.GetsqlForDT(sql);
|
return db.GetsqlForDT(sql);
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -290,10 +290,9 @@ namespace Epost.DAL
|
|||||||
{
|
{
|
||||||
strwhere += "and Taskarea='" + model.Taskarea + "'";
|
strwhere += "and Taskarea='" + model.Taskarea + "'";
|
||||||
}
|
}
|
||||||
string sql = string.Format("update OrdersQueue set state='{0}' where state<>3 and sku = '{1}' and matchid='{2}' and usercode='{3}'"+ strwhere,
|
string sql = string.Format("update OrdersQueue set state='{0}' where state<>3 and orderid='{1}' and usercode='{2}'" + strwhere,
|
||||||
model.State
|
model.State,
|
||||||
,model.Sku,
|
model.Orderid,model.UserCode
|
||||||
model.Matchid,model.UserCode
|
|
||||||
|
|
||||||
);
|
);
|
||||||
LogHelper.WriteLogInfo("修改作业区段"+sql);
|
LogHelper.WriteLogInfo("修改作业区段"+sql);
|
||||||
|
@ -99,7 +99,14 @@ namespace Epost.Model
|
|||||||
_GoodsName = value;
|
_GoodsName = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
public string looklisten { get; set; }
|
||||||
|
public string labelIP { get; set; }
|
||||||
|
public string labelno { get; set; }
|
||||||
|
public string genericname { get; set; }
|
||||||
|
public string manufactname { get; set; }
|
||||||
|
public string batchno { get; set; }
|
||||||
|
public string transderDid { get; set; }
|
||||||
|
public string Spec { get; set; }
|
||||||
//public string Discount
|
//public string Discount
|
||||||
//{
|
//{
|
||||||
// get
|
// get
|
||||||
|
@ -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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -230,6 +230,10 @@
|
|||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
<Compile Include="Startup.cs" />
|
<Compile Include="Startup.cs" />
|
||||||
|
<Compile Include="WebService\WebService.asmx.cs">
|
||||||
|
<DependentUpon>WebService.asmx</DependentUpon>
|
||||||
|
<SubType>Component</SubType>
|
||||||
|
</Compile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Content Include="Content\bootstrap-theme.css" />
|
<Content Include="Content\bootstrap-theme.css" />
|
||||||
@ -854,6 +858,7 @@
|
|||||||
<Content Include="Content\code\themes\sand-signika.js.map" />
|
<Content Include="Content\code\themes\sand-signika.js.map" />
|
||||||
<Content Include="Content\code\themes\skies.js.map" />
|
<Content Include="Content\code\themes\skies.js.map" />
|
||||||
<Content Include="Content\code\themes\sunset.js.map" />
|
<Content Include="Content\code\themes\sunset.js.map" />
|
||||||
|
<Content Include="WebService\WebService.asmx" />
|
||||||
<None Include="Properties\PublishProfiles\Toolsweb.pubxml" />
|
<None Include="Properties\PublishProfiles\Toolsweb.pubxml" />
|
||||||
<Content Include="Scripts\jquery\jquery-1.11.1.js" />
|
<Content Include="Scripts\jquery\jquery-1.11.1.js" />
|
||||||
<Content Include="Content\js\payment.js" />
|
<Content Include="Content\js\payment.js" />
|
||||||
@ -954,7 +959,7 @@
|
|||||||
<AutoAssignPort>True</AutoAssignPort>
|
<AutoAssignPort>True</AutoAssignPort>
|
||||||
<DevelopmentServerPort>52610</DevelopmentServerPort>
|
<DevelopmentServerPort>52610</DevelopmentServerPort>
|
||||||
<DevelopmentServerVPath>/</DevelopmentServerVPath>
|
<DevelopmentServerVPath>/</DevelopmentServerVPath>
|
||||||
<IISUrl>http://localhost:63119/</IISUrl>
|
<IISUrl>http://localhost:63118/</IISUrl>
|
||||||
<NTLMAuthentication>False</NTLMAuthentication>
|
<NTLMAuthentication>False</NTLMAuthentication>
|
||||||
<UseCustomServer>False</UseCustomServer>
|
<UseCustomServer>False</UseCustomServer>
|
||||||
<CustomServerUrl>
|
<CustomServerUrl>
|
||||||
|
@ -10,12 +10,10 @@
|
|||||||
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
|
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
|
||||||
</configSections>
|
</configSections>
|
||||||
<connectionStrings>
|
<connectionStrings>
|
||||||
<add name="weijie_dpsEntities" connectionString="metadata=res://*/WJDB.csdl|res://*/WJDB.ssdl|res://*/WJDB.msl;provider=System.Data.SqlClient;provider connection string="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=FuYuan;min pool size=512;max pool size=512;packet size=3072" providerName="System.Data.SqlClient" />
|
||||||
<add name="SqlLocDPSConnection" connectionString="server=139.196.36.200;user id=EpostTest;password=antion;database=BaBi_DAS;min pool size=512;max pool size=512;packet size=3072" providerName="System.Data.SqlClient" />
|
<!--<add name="MysqlLocDPSConnection" connectionString="Server=localhost;Port=3306;Database=world;User=root; Password=antion;SslMode=None;Pooling=true;Allow User Variables=True;" />-->
|
||||||
<add name="MysqlLocDPSConnection" connectionString="Server=localhost;Port=3306;Database=world;User=root; Password=antion;SslMode=None;Pooling=true;Allow User Variables=True;" />
|
|
||||||
|
|
||||||
<add name="WMSConnection" connectionString="data source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=139.196.36.200)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=EpostDB)));user id=C##Test;password=test" />
|
<!--<add name="OraMidConnString" connectionString="data source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=139.196.36.200)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=EpostDB)));user id=C##Test;password=test" />-->
|
||||||
<add name="OraMidConnString" connectionString="data source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=139.196.36.200)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=EpostDB)));user id=C##Test;password=test" />
|
|
||||||
|
|
||||||
|
|
||||||
</connectionStrings>
|
</connectionStrings>
|
||||||
@ -27,7 +25,7 @@
|
|||||||
<add key="ControlXML" value="/App_Data/EpostController.xml" />
|
<add key="ControlXML" value="/App_Data/EpostController.xml" />
|
||||||
<add key="LabelXML" value="/App_Data/AddressStorage.xml" />
|
<add key="LabelXML" value="/App_Data/AddressStorage.xml" />
|
||||||
<add key="ResultsXML" value="/App_Data/Results.xml" />
|
<add key="ResultsXML" value="/App_Data/Results.xml" />
|
||||||
<add key="WebAPIUrl" value="http://localhost:63119/api/WebAPI/ProcessingResult"/>
|
<add key="WebAPIUrl" value="http://localhost:63118/api/WebAPI/ProcessingResult"/>
|
||||||
<add key="ShowMode" value="1" />
|
<add key="ShowMode" value="1" />
|
||||||
<add key="SetupMode" value="\Epost_P\Epost.TestToolsWeb\App_Data\SetupMode.txt" />
|
<add key="SetupMode" value="\Epost_P\Epost.TestToolsWeb\App_Data\SetupMode.txt" />
|
||||||
<add key="CARID" value="HT01" />
|
<add key="CARID" value="HT01" />
|
||||||
@ -48,11 +46,12 @@
|
|||||||
</customErrors>
|
</customErrors>
|
||||||
<authentication mode="None" />
|
<authentication mode="None" />
|
||||||
<compilation debug="true" targetFramework="4.6.1" />
|
<compilation debug="true" targetFramework="4.6.1" />
|
||||||
<httpRuntime targetFramework="4.5.2" />
|
<httpRuntime targetFramework="4.5.2" requestValidationMode="2.0" />
|
||||||
<httpModules>
|
<httpModules>
|
||||||
<add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule, Microsoft.AI.Web" />
|
<add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule, Microsoft.AI.Web" />
|
||||||
</httpModules>
|
</httpModules>
|
||||||
<sessionState mode="InProc" timeout="518400" />
|
<sessionState mode="InProc" timeout="518400" />
|
||||||
|
<pages validateRequest="false" />
|
||||||
</system.web>
|
</system.web>
|
||||||
<system.webServer>
|
<system.webServer>
|
||||||
<modules>
|
<modules>
|
||||||
|
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" %>
|
153
Epost.TestToolsWeb/WebService/WebService.asmx.cs
Normal file
153
Epost.TestToolsWeb/WebService/WebService.asmx.cs
Normal file
@ -0,0 +1,153 @@
|
|||||||
|
using Epost.BLL;
|
||||||
|
using Epost.Common;
|
||||||
|
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.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();
|
||||||
|
|
||||||
|
[WebMethod]
|
||||||
|
public string ReceiveDataInfo_XML(string action, string messages)
|
||||||
|
{
|
||||||
|
LogHelper.WriteLogInfo("WebService请求报文:");
|
||||||
|
LogHelper.WriteLogInfo("action:" + action + "");
|
||||||
|
LogHelper.WriteLogInfo("messages:" + messages + "");
|
||||||
|
|
||||||
|
main main = new main();
|
||||||
|
msg msg = new msg();
|
||||||
|
var resultxml = string.Empty;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
DataTable queuedt = queueBLL.getQueuesbyState();
|
||||||
|
if (queuedt == null || queuedt.Rows.Count <= 0)
|
||||||
|
{
|
||||||
|
if (!string.IsNullOrEmpty(messages))
|
||||||
|
{
|
||||||
|
LogHelper.WriteLogInfo("======开始处理数据======");
|
||||||
|
DataSet set = XmlHelper.GetDataSetStrXml(messages);
|
||||||
|
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)
|
||||||
|
{
|
||||||
|
DataTable dt = bll.GetDataIfRepeat(item["transderMid"].ToString(), item["transderDid"].ToString());
|
||||||
|
if (dt == null || dt.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["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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
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("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.XmlSerialize(main);
|
||||||
|
LogHelper.WriteLogInfo("数据异常:数据处理失败,请重试!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
msg.Status = "erro";
|
||||||
|
msg.Message = "数据异常/当前存在拣药任务";
|
||||||
|
main.msg = msg;
|
||||||
|
LogHelper.WriteLogInfo("数据异常/当前存在拣药任务");
|
||||||
|
return resultxml = XmlHelper.ModelToXml(main);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
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