Compare commits
17 Commits
master
...
FuYuan_DPS
Author | SHA1 | Date | |
---|---|---|---|
a77604f299 | |||
7d3f50c97b | |||
29bfe4c6aa | |||
cc78693b7d | |||
7eff397fb5 | |||
07d01e0cd0 | |||
07985264fa | |||
b4fd2d4e05 | |||
ccbca85c55 | |||
53c4b66485 | |||
3648692781 | |||
e2c1d127a0 | |||
7e11ca5d4d | |||
70ebea6292 | |||
efe0835c4e | |||
c4fe9e1a9b | |||
c53719f69b |
@ -478,9 +478,41 @@ 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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -15,7 +15,7 @@ namespace Epost.BLL
|
||||
{
|
||||
AddressstorageDAL dal = new AddressstorageDAL();
|
||||
|
||||
|
||||
|
||||
|
||||
#region 查询设备所在区
|
||||
public DataTable getBlock(string address, string type, string controlip)
|
||||
@ -39,7 +39,7 @@ namespace Epost.BLL
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region 根据货位号查询标签地址
|
||||
public DataTable getAddressList(string location)
|
||||
{
|
||||
@ -54,7 +54,7 @@ namespace Epost.BLL
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
#region 根据小车编号获取控制器Ip地址
|
||||
public DataTable getIP(string carid)
|
||||
@ -89,17 +89,17 @@ namespace Epost.BLL
|
||||
#endregion
|
||||
|
||||
#region 获取箱号显示标签
|
||||
public DataTable GetBoxAddress(string block,string area,int type)
|
||||
public DataTable GetBoxAddress(string block, string area, int type)
|
||||
{
|
||||
return dal.GetBoxAddress(block,area,type);
|
||||
return dal.GetBoxAddress(block, area, type);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 根据区域获取所有地址
|
||||
public DataTable getAddresslist(string block, string area,string type)
|
||||
public DataTable getAddresslist(string block, string area, string type)
|
||||
{
|
||||
return dal.getAddresslist(block, area,type);
|
||||
return dal.getAddresslist(block, area, type);
|
||||
}
|
||||
|
||||
#endregion
|
||||
@ -152,7 +152,7 @@ namespace Epost.BLL
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region 获取所有地址
|
||||
public DataTable getAddressList()
|
||||
{
|
||||
@ -182,18 +182,10 @@ namespace Epost.BLL
|
||||
return dal.GetAreaList();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 获取所有小区
|
||||
public List<AddressstorageModel> GetAreaList(string block = "", string shelfid = "")
|
||||
public List<AddressstorageModel> GetAreaList(string block = "")
|
||||
{
|
||||
return dal.GetAreaList(block, shelfid);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 获取所有小区
|
||||
public List<AddressstorageModel> GetshelfidList(string block = "")
|
||||
{
|
||||
return dal.GetshelfidList(block);
|
||||
return dal.GetAreaList(block);
|
||||
}
|
||||
#endregion
|
||||
#region 获取所有通道
|
||||
@ -337,9 +329,9 @@ namespace Epost.BLL
|
||||
|
||||
|
||||
#region 获取错误信息的state
|
||||
public DataTable GetErrorState(string address,string ip)
|
||||
public DataTable GetErrorState(string address, string ip)
|
||||
{
|
||||
return dal.getErrorState(address,ip);
|
||||
return dal.getErrorState(address, ip);
|
||||
}
|
||||
#endregion
|
||||
|
||||
@ -382,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
|
||||
}
|
||||
}
|
||||
|
@ -19,11 +19,13 @@ namespace Epost.BLL
|
||||
public class CommandBLL
|
||||
{
|
||||
CommandDAL dal = new CommandDAL();
|
||||
|
||||
XgateCacheDAL xageDAL = new XgateCacheDAL();
|
||||
AddressstorageBLL addrBLL = new AddressstorageBLL();
|
||||
public static DataTable Controls = new DataTable();
|
||||
public static DataTable Labels = new DataTable();
|
||||
|
||||
JobDownCacheDAL JobCache = new JobDownCacheDAL();
|
||||
OrdersDAL orderDal = new OrdersDAL();
|
||||
ConfigurationOperator txtbll = new ConfigurationOperator();
|
||||
string IP = ConfigurationManager.AppSettings["WebAPIUrl"];
|
||||
|
||||
#region 初始化数据
|
||||
@ -60,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())
|
||||
{
|
||||
@ -125,7 +127,7 @@ namespace Epost.BLL
|
||||
lablemodel.Mode = "10";
|
||||
list.Add(lablemodel);
|
||||
}
|
||||
|
||||
|
||||
//result= combll.DISPLAY_JOB(model);
|
||||
|
||||
}
|
||||
@ -149,7 +151,23 @@ namespace Epost.BLL
|
||||
}
|
||||
|
||||
}
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region 获取参数中文
|
||||
public string GETDISPLAYJOBPAR_CN(string no, string Lightcolor, string IsTwinkle, string Title, string BigQuantity, string BigUnit, string Quantity, string Unit, string Content, string Rfcode)
|
||||
{
|
||||
string parar = no + "00" + Lightcolor + IsTwinkle + "30CQ" + Title + "\n\n" + BigQuantity + "\n" + BigUnit + "\n" + Quantity + "\n" + Unit + "\n" + Content + "\n00\n\n" + Rfcode + "\n"; ;
|
||||
return parar;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 获取参数数字
|
||||
public string GETDISPLAYJOBPAR(string no, string Lightcolor, string IsTwinkle, string location, string Quantity, string Rfcode)
|
||||
{
|
||||
string parar = no + Lightcolor + IsTwinkle + "30NQ" + location + "\n" + Quantity + "\n" + Rfcode + "\n";
|
||||
return parar;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 清除
|
||||
public void clearALL_M()
|
||||
@ -170,7 +188,10 @@ namespace Epost.BLL
|
||||
|
||||
|
||||
}
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
|
||||
#region M系列
|
||||
|
||||
#region 格式化任务数据
|
||||
public bool FORMATE_JOB_DATA(LabelParamModel model)
|
||||
@ -193,8 +214,39 @@ namespace Epost.BLL
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 进入设置模式
|
||||
public bool ENTER_CONFIG_MODE(LabelParamModel model)
|
||||
{
|
||||
|
||||
|
||||
return dal.ENTER_CONFIG_MODE(model);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 设置地址 (传参地址 内容)
|
||||
public bool SET_ADDRESS(LabelParamModel model)
|
||||
{
|
||||
return dal.SET_ADDRESS(model);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 删除地址 (传参地址 内容)
|
||||
public bool DELETE_ADDRESS(LabelParamModel model)
|
||||
{
|
||||
return dal.DELETE_ADDRESS(model);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 退出设置模式
|
||||
public bool EXIT_CONFIG_MODE(LabelParamModel model)
|
||||
{
|
||||
|
||||
return dal.EXIT_CONFIG_MODE(model);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 任务指令(传参地址)
|
||||
public void DISPLAY_JOB_M(LabelParamModel model, bool clear = false, bool islock = false )
|
||||
public void DISPLAY_JOB_M(LabelParamModel model, bool clear = false, bool islock = false)
|
||||
{
|
||||
List<LabelParamModel> list = new List<LabelParamModel>();
|
||||
if (clear)
|
||||
@ -207,14 +259,14 @@ namespace Epost.BLL
|
||||
clearModel.Command = "REMOVE_JOB";
|
||||
clearModel.Timeout = "0.5";
|
||||
clearModel.Type = model.Type;
|
||||
// dal.REMOVE_JOB(clearModel);
|
||||
// dal.REMOVE_JOB(clearModel);
|
||||
list.Add(clearModel);
|
||||
}
|
||||
LabelParamModel DisplayModel = new LabelParamModel();
|
||||
DisplayModel.Address = model.Address;
|
||||
DisplayModel.ControlIP = model.ControlIP;
|
||||
DisplayModel.Content =model.Content;
|
||||
DisplayModel.Title =model.Title;
|
||||
DisplayModel.Content = model.Content;
|
||||
DisplayModel.Title = model.Title;
|
||||
DisplayModel.Loc = model.Loc;
|
||||
DisplayModel.Quantity = model.Quantity;
|
||||
DisplayModel.Uid = model.Uid;
|
||||
@ -255,6 +307,7 @@ namespace Epost.BLL
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
#region 任务指令(传参地址)
|
||||
public void LED_ON_M(LabelParamModel model, bool islock = false)
|
||||
{
|
||||
@ -300,7 +353,6 @@ namespace Epost.BLL
|
||||
dal.DISPLAY_JOBALL(list);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region LED_OFF(传参地址)
|
||||
public void LED_OFF_M(List<JobModel> list)
|
||||
{
|
||||
@ -310,15 +362,17 @@ namespace Epost.BLL
|
||||
LabelParamModel clearModel = new LabelParamModel();
|
||||
clearModel.Address = model.Address;
|
||||
clearModel.ControlIP = model.ControlIP;
|
||||
|
||||
|
||||
clearModel.Command = "LED_OFF";
|
||||
clearModel.Timeout = "0.5";
|
||||
clearModel.Timeout = "0.5";
|
||||
sendlist.Add(clearModel);
|
||||
}
|
||||
dal.DISPLAY_JOBALL(sendlist);
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
#region LED_OFF(传参地址)
|
||||
public void LED_OFF_CLEAR(string ip)
|
||||
{
|
||||
@ -331,7 +385,6 @@ namespace Epost.BLL
|
||||
dal.Send(clearModel);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region LED_OFF(传参地址)
|
||||
public void LED_OFF_CLEAR(List<JobModel> offList)
|
||||
{
|
||||
@ -348,13 +401,14 @@ namespace Epost.BLL
|
||||
clearModel.Timeout = "0.5";
|
||||
list.Add(clearModel);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
dal.SendALL(list);
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
#region 任务指令(传参地址)
|
||||
public bool DISPLAY_JOB(LabelParamModel model)
|
||||
{
|
||||
@ -370,7 +424,6 @@ namespace Epost.BLL
|
||||
dal.DISPLAY_JOBALL(model);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 初始化
|
||||
public ResultModel SendALL_Init(List<LabelParamModel> model)
|
||||
{
|
||||
@ -378,7 +431,7 @@ namespace Epost.BLL
|
||||
return dal.SendALL_Init(model);
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
#region 移除任务指令(传参地址)
|
||||
public bool REMOVE_JOB(LabelParamModel model)
|
||||
{
|
||||
@ -386,7 +439,6 @@ namespace Epost.BLL
|
||||
return dal.REMOVE_JOB(model);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 通道灯命令
|
||||
public bool DISPLAY_LIGHT(LabelParamModel model)
|
||||
{
|
||||
@ -403,6 +455,8 @@ namespace Epost.BLL
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
#region 终端解锁指令
|
||||
public bool UNLOCK(LabelParamModel model)
|
||||
{
|
||||
@ -411,6 +465,30 @@ namespace Epost.BLL
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 扫描枪使能
|
||||
public bool SET_SCANDEVICE_ON(LabelParamModel model)
|
||||
{
|
||||
|
||||
return dal.SET_SCANDEVICE_ON(model);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 扫描枪不使能
|
||||
public bool SET_SCANDEVICE_OFF(LabelParamModel model)
|
||||
{
|
||||
|
||||
return dal.SET_SCANDEVICE_OFF(model);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 清除扫描枪
|
||||
public bool SET_SCANDEVICE_CLEAR(LabelParamModel model)
|
||||
{
|
||||
|
||||
return dal.SET_SCANDEVICE_CLEAR(model);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 休眠
|
||||
public bool SLEEP(LabelParamModel model)
|
||||
{
|
||||
@ -431,8 +509,9 @@ namespace Epost.BLL
|
||||
|
||||
LabelParamModel model = new LabelParamModel();
|
||||
model.ControlIP = item["ControlIP"].ToString();
|
||||
FORMATE_JOB_DATA(model);
|
||||
FORMATE_JOB_DATA(model);
|
||||
|
||||
LED_OFF_CLEAR(item["ControlIP"].ToString());
|
||||
}
|
||||
|
||||
}
|
||||
@ -475,7 +554,7 @@ namespace Epost.BLL
|
||||
{
|
||||
// DataTable dt = addrBLL.getAddresslist(block,area,type);
|
||||
|
||||
if(offList.Any())
|
||||
if (offList.Any())
|
||||
{
|
||||
List<LabelParamModel> list = new List<LabelParamModel>();
|
||||
foreach (JobModel item in offList)
|
||||
@ -486,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);
|
||||
|
||||
@ -534,29 +613,28 @@ namespace Epost.BLL
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 点亮显示标签
|
||||
public void ShowBoxMessage_M(ShowMessageModel_M show)
|
||||
{
|
||||
//获取作业区对应的显示标签地址
|
||||
DataTable showaddrDT = addrBLL.GetBoxAddress(show.Block,show.Area,show.Type);
|
||||
//获取作业区对应的显示标签地址
|
||||
DataTable showaddrDT = addrBLL.GetBoxAddress(show.Block, show.Area, show.Type);
|
||||
if (showaddrDT != null && showaddrDT.Rows.Count > 0)
|
||||
{
|
||||
foreach (DataRow addritem in showaddrDT.Rows)
|
||||
{
|
||||
|
||||
|
||||
LabelParamModel lablemodel = new LabelParamModel();
|
||||
lablemodel.Address = addritem["address"].ToString();
|
||||
lablemodel.ControlIP = addritem["controlip"].ToString();
|
||||
lablemodel.Command = "DISPLAY_JOB";
|
||||
lablemodel.Uid =show.Uid;
|
||||
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")
|
||||
{
|
||||
|
||||
{
|
||||
|
||||
lablemodel.Type = "C";
|
||||
lablemodel.Loc = show.Location;
|
||||
lablemodel.Title = show.Title;
|
||||
@ -569,13 +647,13 @@ namespace Epost.BLL
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
{
|
||||
lablemodel.Type = "N";
|
||||
lablemodel.Quantity = show.Qty;
|
||||
lablemodel.Quantity = show.Qty;
|
||||
lablemodel.Loc = show.Location;
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
DISPLAY_JOB_M(lablemodel, true, show.Islock);
|
||||
LogHelper.WriteLogInfo("点亮显示标签" + addritem["address"].ToString());
|
||||
|
||||
@ -599,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)
|
||||
{
|
||||
|
||||
@ -614,7 +716,7 @@ namespace Epost.BLL
|
||||
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;
|
||||
model.Parameter = ConvertHexHelper.ConvertString(item["addresstype"].ToString(), 10, 16).ToString().PadLeft(2, '0') + isoff;
|
||||
list.Add(model);
|
||||
}
|
||||
|
||||
@ -634,16 +736,16 @@ namespace Epost.BLL
|
||||
List<LabelParamModel> list = new List<LabelParamModel>();
|
||||
foreach (DataRow addritem in showaddrDT.Rows)
|
||||
{
|
||||
|
||||
|
||||
LabelParamModel model = new LabelParamModel();
|
||||
model.Address = addritem["address"].ToString();
|
||||
model.ControlIP = addritem["controlip"].ToString();
|
||||
model.Parameter =show.No;
|
||||
model.Parameter = show.No;
|
||||
model.Command = "REMOVE_JOB";
|
||||
model.Timeout = "0.5";
|
||||
list.Add(model);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (list != null && list.Count > 0)
|
||||
{
|
||||
LogHelper.WriteLogInfo("熄灭点亮的list———————:" + list.Count);
|
||||
@ -651,16 +753,64 @@ namespace Epost.BLL
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
#region 强制结束灭灯
|
||||
public ResultModel Forcedend(string orderid)
|
||||
{
|
||||
ResultModel resultModel = new ResultModel();
|
||||
List<LabelParamModel> list = new List<LabelParamModel>();
|
||||
try
|
||||
{
|
||||
DataTable dt = addrBLL.GetForcedendAddress(orderid);
|
||||
|
||||
if (dt != null && dt.Rows.Count > 0)
|
||||
{
|
||||
foreach (DataRow item in dt.Rows)
|
||||
{
|
||||
LabelParamModel model = new LabelParamModel();
|
||||
model.ControlIP = item["ControlIP"].ToString();
|
||||
model.Address = item["address"].ToString();
|
||||
model.Command = "FORMAT_JOB_DATA";
|
||||
model.Parameter = "50";
|
||||
model.Timeout = "0.5";
|
||||
list.Add(model);
|
||||
model = new LabelParamModel();
|
||||
model.ControlIP = item["ControlIP"].ToString();
|
||||
model.Address = "9999";
|
||||
model.Parameter = "11111000";
|
||||
model.Command = "UNLOCK";
|
||||
model.Timeout = "0.5";
|
||||
list.Add(model);
|
||||
LED_OFF_CLEAR(item["ControlIP"].ToString());
|
||||
}
|
||||
if (list.Any())
|
||||
{
|
||||
resultModel = SendALL_Init(list);
|
||||
}
|
||||
|
||||
}
|
||||
return resultModel;
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
resultModel.result = "0";
|
||||
resultModel.msg = "强制结束熄灭失败!";
|
||||
LogHelper.WriteLogInfo("强制结束异常:" + ex.Message);
|
||||
|
||||
}
|
||||
return resultModel;
|
||||
}
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -115,8 +115,6 @@
|
||||
<Compile Include="UserBLL.cs" />
|
||||
<Compile Include="WmsBLL.cs" />
|
||||
<Compile Include="WmsTaskBLL.cs" />
|
||||
<Compile Include="Work_DisplayJobThread.cs" />
|
||||
<Compile Include="Work_JobDownThread.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Common\Epost.Common.csproj">
|
||||
|
@ -18,19 +18,56 @@ namespace Epost.BLL
|
||||
{
|
||||
BoxPickBLL pickBLL = new BoxPickBLL();
|
||||
OrdersDAL dal = new OrdersDAL();
|
||||
|
||||
|
||||
OrdersQueueBLL queueBLL = new OrdersQueueBLL();
|
||||
BoxQueueBLL queueboxBLL = new BoxQueueBLL();
|
||||
CommandDAL comDAL = new CommandDAL();
|
||||
CommandBLL comBLL = new CommandBLL();
|
||||
CommandBLL comBLL = new CommandBLL();
|
||||
AddressstorageBLL addrBLL = new AddressstorageBLL();
|
||||
JobModelCacheDAL JobCache = new JobModelCacheDAL();
|
||||
JobModelCacheDAL JobCache = new JobModelCacheDAL();
|
||||
JobDownCacheDAL downCacheDAL = new JobDownCacheDAL();
|
||||
LocationCacheDAL LocCacheDAL = new LocationCacheDAL();
|
||||
UserModelCacheDAL UserCacheDAL = new UserModelCacheDAL();
|
||||
private static object lockbox = new object();
|
||||
UserModelCacheDAL UserCacheDAL = new UserModelCacheDAL();
|
||||
private static object lockbox = new object();
|
||||
|
||||
|
||||
#region 绑定箱号
|
||||
public void BindBoxCode()
|
||||
{
|
||||
lock (lockbox)
|
||||
{
|
||||
|
||||
try
|
||||
{
|
||||
|
||||
//查询待绑定的订单/设备
|
||||
DataTable qudt = queueboxBLL.getQueuesbyState();
|
||||
if (qudt != null && qudt.Rows.Count > 0)
|
||||
{
|
||||
foreach (DataRow item in qudt.Rows)
|
||||
{
|
||||
LabelParamModel model = new LabelParamModel();
|
||||
string address = item["address"].ToString();
|
||||
model.Address = address;
|
||||
model.ControlIP = item["controlip"].ToString();
|
||||
// model.Parameter = "0100000100030CQ请扫描箱号/托盘号\n\n\n\n\n\n门店编号:" + item["shopid"].ToString() + "\n\n\n\n";
|
||||
model.Parameter = comBLL.GETDISPLAYJOBPAR_CN("01", "001000", "0", "请扫描箱号/托盘号", "", "", "", "", "门店编号:" + item["shopid"].ToString(), "");
|
||||
comBLL.DISPLAY_JOB_M(model, true, true);
|
||||
queueboxBLL.UpdateQueueState(item["id"].ToString(), "1");
|
||||
}
|
||||
|
||||
}
|
||||
//点亮设备
|
||||
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.WriteLogInfo("绑定箱号异常:" + ex.Message);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 查询控制器列表
|
||||
public DataTable getControlList(int type = 0)
|
||||
@ -73,7 +110,7 @@ namespace Epost.BLL
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
#region 拆单
|
||||
public bool packOrder(ResultMessageModel data, List<JobModel> job, string block, string area, string type)
|
||||
{
|
||||
@ -219,9 +256,9 @@ namespace Epost.BLL
|
||||
return false;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
|
||||
#region 删除任务
|
||||
public void REMOVE_JOB(string address, string ip, string no)
|
||||
@ -351,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;
|
||||
}
|
||||
}
|
||||
@ -364,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);
|
||||
|
||||
}
|
||||
}
|
||||
@ -372,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);
|
||||
}
|
||||
|
||||
|
||||
@ -416,11 +453,11 @@ namespace Epost.BLL
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//换箱
|
||||
#region 换箱
|
||||
public void changeBox_ClearJOB(string sblock, string sarea, string address, string controlip)
|
||||
@ -462,14 +499,27 @@ namespace Epost.BLL
|
||||
//点亮当前货位对应设备提示扫箱号
|
||||
LabelParamModel model = new LabelParamModel();
|
||||
model.Address = address;
|
||||
model.ControlIP = controlip;
|
||||
// model.Parameter = comBLL.GETDISPLAYJOBPAR_CN("07", "000100", "3", "请扫描箱号!", "", "", "", "", "门店号:" + shopid + "\r箱 号:" + boxcode + "\r托盘号:" + traycode, "");
|
||||
model.ControlIP = controlip;
|
||||
// model.Parameter = "0700000100330CQ请扫描箱号!\n\n\n\n\n\n\n\n\n\n";
|
||||
model.Parameter = comBLL.GETDISPLAYJOBPAR_CN("07", "000100", "3", "请扫描箱号!", "", "", "", "", "门店号:" + shopid + "\r箱 号:" + boxcode + "\r托盘号:" + traycode, "");
|
||||
comBLL.DISPLAY_JOB_M(model, true, true);
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
#region 修改数量异常提示
|
||||
public void changeNumErr(string address, string controlip)
|
||||
{
|
||||
//点亮当前货位对应设备提示扫箱号
|
||||
LabelParamModel model = new LabelParamModel();
|
||||
model.Address = address;
|
||||
model.ControlIP = controlip;
|
||||
model.Parameter = comBLL.GETDISPLAYJOBPAR_CN("05", "000100", "3", "修改数量超出需求数量!", "", "", "", "", "", "");
|
||||
comBLL.DISPLAY_JOB_M(model, true, false);
|
||||
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 恢复当前标签拣货
|
||||
public void displayJob_err(string address, string controlip, JobModel job)
|
||||
@ -480,15 +530,21 @@ namespace Epost.BLL
|
||||
lamodel.ControlIP = controlip;
|
||||
lamodel.Command = "DISPLAY_JOB";
|
||||
string qty = ConvertHexHelper.ConvertString(job.Quantity.ToString(), 10, 16); //拣货数量
|
||||
string CheckQuantity = ConvertHexHelper.ConvertString(job.CheckQuantity.ToString(), 10, 16); //拣货数量
|
||||
// lamodel.Parameter = comBLL.GETDISPLAYJOBPAR_CN("01", job.ColorCode, "0", job.GoodsName, CheckQuantity, job.WholeUnit, qty, job.Unit, job.Sku, job.UserCode);//item.UserCode
|
||||
string CheckQuantity = ConvertHexHelper.ConvertString(job.CheckQuantity.ToString(), 10, 16); //拣货数量
|
||||
// lamodel.Parameter = "01" + EnumHelper.EMToDescriptionString(LightColor.Color.Green) + "030NQ" +item.Zone +"\n" + qty;
|
||||
//lamodel.Parameter = "0100" + queueDT.Rows[0]["lightcolor"].ToString() + "030CQ" + item.GoodsName + "\n\n" + CheckQuantity + "\n" + item.WholeUnit + "\n" + qty + "\n" + item.Unit + "\n" + item.Sku + "\n\n\n\n";
|
||||
lamodel.Parameter = comBLL.GETDISPLAYJOBPAR_CN("01", job.ColorCode, "0", job.GoodsName, CheckQuantity, job.WholeUnit, qty, job.Unit, job.Sku, job.UserCode);//item.UserCode
|
||||
|
||||
|
||||
comBLL.DISPLAY_JOB_M(lamodel, true, false);
|
||||
|
||||
|
||||
}
|
||||
#endregion
|
||||
public void BindJobListBySku(string sku)
|
||||
{
|
||||
try
|
||||
{
|
||||
{
|
||||
List<OrderListModel> dnList = LocCacheDAL.GetLocationList().FindAll(m => m.State == 0 && m.Sku == sku);
|
||||
if (dnList.Any())
|
||||
{
|
||||
@ -500,11 +556,13 @@ namespace Epost.BLL
|
||||
LocCacheDAL.UpdateLocModelList(new List<OrderListModel> { data }, ELCommend.Update);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.WriteLogInfo("绑定任务异常:" + ex.Message);
|
||||
}
|
||||
|
||||
}
|
||||
public bool bindOrder(string sku, string block, string matchid = "", string usercode = "", string area = "", int sort = 0, string lightColor = "010000")
|
||||
{
|
||||
@ -523,6 +581,8 @@ namespace Epost.BLL
|
||||
bool qubo = queueBLL.insertQueueOrders(unmodel);
|
||||
return qubo;
|
||||
}
|
||||
|
||||
|
||||
public void bindShop(string shopcode, string usercode, List<ResultMessageModel> list, ResultMessageModel data)
|
||||
{
|
||||
|
||||
@ -569,9 +629,9 @@ namespace Epost.BLL
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#region 清除显示标签
|
||||
@ -671,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);
|
||||
@ -707,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 = "";
|
||||
@ -742,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) {
|
||||
//修改数据为已读
|
||||
dal.UpOrder_Car(item["Matchid"].ToString(), item["sku"].ToString(), item["id"].ToString());
|
||||
if (!isecho)
|
||||
{
|
||||
//修改数据为已读
|
||||
dal.UpOrder_Car(item["orderid"].ToString(), item["sku"].ToString(), item["id"].ToString());
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
@ -760,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;
|
||||
@ -786,7 +846,10 @@ namespace Epost.BLL
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public DataTable GetOrderList(string Orderid, string area, string block)
|
||||
{
|
||||
return dal.GetOrderList(Orderid, area, block);
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
@ -848,7 +911,7 @@ namespace Epost.BLL
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
#region 修改订单信息
|
||||
public bool UpdateOrderstate(string orderid)
|
||||
{
|
||||
@ -864,9 +927,9 @@ namespace Epost.BLL
|
||||
#endregion
|
||||
|
||||
#region 修改订单信息
|
||||
public bool Updatestate(string matchid,string readdate)
|
||||
public bool Updatestate(string matchid, string readdate)
|
||||
{
|
||||
return dal.Updatestate(matchid,readdate);
|
||||
return dal.Updatestate(matchid, readdate);
|
||||
}
|
||||
#endregion
|
||||
|
||||
@ -887,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()
|
||||
{
|
||||
@ -931,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);
|
||||
}
|
||||
@ -945,13 +1018,13 @@ namespace Epost.BLL
|
||||
{
|
||||
return dal.IsFinishWork(endcount, block, usercode, area, sku, shopid, matchid);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public DataTable GetMatchOrder()
|
||||
{
|
||||
return dal.GetMatchOrder();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 获取订单信息
|
||||
public DataTable GetOrderList_Car(string matchid, string sku, string sarea, string sblock)
|
||||
@ -965,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
|
||||
|
||||
}
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -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)
|
||||
//{
|
||||
|
@ -1,229 +0,0 @@
|
||||
using Epost.Common;
|
||||
using Epost.DAL.Cache;
|
||||
using Epost.DAL.Enum;
|
||||
using Epost.Model;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
|
||||
|
||||
namespace Epost.BLL
|
||||
{
|
||||
public class Work_DisplayJobThread
|
||||
{
|
||||
public string tblock, id;
|
||||
public bool OrisShow = false;
|
||||
OrderBLL orderbll = new OrderBLL();
|
||||
OrdersQueueBLL queueBLL = new OrdersQueueBLL();
|
||||
CommandBLL comBLL = new CommandBLL();
|
||||
JobModelCacheDAL JobCache = new JobModelCacheDAL();
|
||||
private static object lockobj = new object();
|
||||
AddressstorageBLL addrBLL = new AddressstorageBLL();
|
||||
WorkIngCacheDAL workbll = new WorkIngCacheDAL();
|
||||
public void Displayjob()
|
||||
{
|
||||
GetWorkList(tblock);
|
||||
}
|
||||
|
||||
|
||||
#region 获取订单信息
|
||||
private void GetWorkList(object block)
|
||||
{
|
||||
|
||||
lock (lockobj)
|
||||
{
|
||||
while (OrisShow)
|
||||
{
|
||||
|
||||
try
|
||||
{
|
||||
|
||||
string workstate = workbll.GetWorkState();
|
||||
if (!string.IsNullOrEmpty(workstate))
|
||||
{
|
||||
OrisShow = true;
|
||||
DisplayJob_M(block.ToString());
|
||||
Thread.Sleep(50);
|
||||
}
|
||||
else
|
||||
{
|
||||
OrisShow = false;
|
||||
}
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.WriteLogInfo(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + ":程序异常!\r\n" + ex.Message);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
|
||||
#region 标签控制M系列
|
||||
public void DisplayJob_M(string tblock)
|
||||
{
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
string[] nlist = tblock.Split('|');
|
||||
string nblock = nlist[0];
|
||||
string shelfid = nlist[1];
|
||||
List<AddressstorageModel> Arealist = addrBLL.GetAreaList(nblock, shelfid);
|
||||
foreach (AddressstorageModel item in Arealist)
|
||||
{
|
||||
OrdersQueueModel model = new OrdersQueueModel(); ;
|
||||
model.Taskarea = item.area;
|
||||
model.Taskblock = nblock;
|
||||
#region 开始作业
|
||||
DataTable queueDT = queueBLL.getQueueOrderState(model);
|
||||
if (queueDT != null && queueDT.Rows.Count > 0)
|
||||
{
|
||||
//当前区没有作业
|
||||
if (queueDT.Rows[0]["state"].ToString() == "0")
|
||||
{
|
||||
displayOrder(queueDT, nblock, item.area, model);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.WriteLogInfo("标签控制异常:" + ex.Message);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region 点亮设备
|
||||
public void displayOrder(DataTable queueDT, string nblock, string narea, OrdersQueueModel model)
|
||||
{
|
||||
List<LabelParamModel> list = new List<LabelParamModel>();
|
||||
model.Id = Convert.ToInt32(queueDT.Rows[0]["id"].ToString());
|
||||
#region 点亮任务
|
||||
List<JobModel> jobList = JobCache.GetPlanJobList();
|
||||
List<JobModel> isJobList = jobList.FindAll(p => p.Block == nblock && p.Area == narea && p.State != 3);
|
||||
ShowMessageModel showmodel = new ShowMessageModel();
|
||||
//获取当前区任务并加入缓存
|
||||
if (!isJobList.Any())
|
||||
{
|
||||
model.State = 1;
|
||||
orderbll.GetOrderList(queueDT.Rows[0]["matchid"].ToString(), nblock, queueDT.Rows[0]["sku"].ToString(), narea, queueDT.Rows[0]["usercode"].ToString());
|
||||
List<JobModel> nowJoblist = jobList.FindAll(p => p.State == 0 && p.Block == model.Taskblock && p.Area == model.Taskarea);
|
||||
if (nowJoblist.Any())
|
||||
{
|
||||
var nowmodel = nowJoblist.FirstOrDefault();
|
||||
|
||||
LogHelper.WriteLogInfo("进入任务点亮=====matchid=" + nowmodel.Matchid + "===orderid===" + nowmodel.OrderID + "=====sku==" + nowmodel.Sku + "========");
|
||||
#region 点亮任务标签
|
||||
foreach (JobModel item in nowJoblist.ToArray())
|
||||
{
|
||||
|
||||
#region 回显设备锁定
|
||||
if (queueDT.Rows[0]["lightcolor"].ToString() == EnumHelper.EMToDescriptionString(LightColor.Color.Blue))
|
||||
{
|
||||
|
||||
LabelParamModel locklamodel = new LabelParamModel();
|
||||
locklamodel.Address = item.Address.ToString();
|
||||
locklamodel.ControlIP = item.ControlIP.ToString();
|
||||
locklamodel.Command = "LOCK";
|
||||
locklamodel.Parameter = "11111000";
|
||||
locklamodel.Type = "N";
|
||||
list.Add(locklamodel);
|
||||
|
||||
}
|
||||
#endregion
|
||||
// else
|
||||
//{
|
||||
|
||||
List<JobModel> manyJoblist = nowJoblist.FindAll(m => m.Tolocation == item.Tolocation);
|
||||
int quantity = item.Quantity;
|
||||
|
||||
LabelParamModel lamodel = new LabelParamModel();
|
||||
|
||||
lamodel.Address = item.Address.ToString();
|
||||
lamodel.ControlIP = item.ControlIP.ToString();
|
||||
lamodel.Command = "DISPLAY_JOB";
|
||||
|
||||
#region 同一个货位的数据合并显示
|
||||
//if (manyJoblist.Count > 1)
|
||||
//{
|
||||
// if (manyJoblist.FindAll(m => m.State == 0).Any())
|
||||
// {
|
||||
// foreach (JobModel mitem in manyJoblist)
|
||||
// {
|
||||
// quantity += mitem.Quantity;
|
||||
// mitem.State = 1;
|
||||
// mitem.ManyState = 1;
|
||||
// }
|
||||
|
||||
// }
|
||||
//}
|
||||
#endregion
|
||||
|
||||
lamodel.Type = "N";
|
||||
lamodel.Quantity = quantity.ToString();
|
||||
lamodel.Uid = "U" + item.ID;
|
||||
lamodel.Mode = queueDT.Rows[0]["lightcolor"].ToString() + "0";
|
||||
|
||||
list.Add(lamodel);
|
||||
//}
|
||||
|
||||
item.State = 1;
|
||||
item.ColorCode = queueDT.Rows[0]["lightcolor"].ToString();
|
||||
item.DisplayTime = DateTime.Now;
|
||||
}
|
||||
#endregion
|
||||
#region 点亮通道灯
|
||||
comBLL.DISPLAY_LIGHT_BLOCK(model.Taskblock, model.Taskarea, "1");
|
||||
#endregion
|
||||
if (list != null && list.Count > 0)
|
||||
{
|
||||
LogHelper.WriteLogInfo("添加到点亮的list————————————————————:" + list.Count);
|
||||
comBLL.DISPLAY_JOBALL(list);
|
||||
}
|
||||
}
|
||||
else
|
||||
{//无任务
|
||||
LogHelper.WriteLogInfo("点亮====无任务=======================");
|
||||
model.State = 3;
|
||||
}
|
||||
#endregion
|
||||
if (jobList.Any())
|
||||
{
|
||||
|
||||
var finishList = jobList.FindAll(p => p.State == 0);
|
||||
if (!finishList.Any())
|
||||
{
|
||||
queueBLL.UpdateQueueOrderState(model);//缓存队列状态修改
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
LogHelper.WriteLogInfo("还有未完成任务" + isJobList.Count);
|
||||
foreach (JobModel item in isJobList)
|
||||
{
|
||||
LogHelper.WriteLogInfo("还有未完成任务" + item.Address + item.ID);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@ -9,13 +9,13 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace Epost.DAL
|
||||
{
|
||||
public class AddressstorageDAL
|
||||
public class AddressstorageDAL
|
||||
{
|
||||
//DB db = new DB();
|
||||
DataBaseOpration.OprationSqlDAL db = DB_DLL.GetInstance();
|
||||
|
||||
#region 查询设备所在区
|
||||
public DataTable getBlock(string address,string type,string controlip)
|
||||
public DataTable getBlock(string address, string type, string controlip)
|
||||
{
|
||||
string sql = "";
|
||||
if (string.IsNullOrEmpty(type))
|
||||
@ -40,13 +40,13 @@ namespace Epost.DAL
|
||||
#endregion
|
||||
|
||||
#region 根据地址查询货位信息
|
||||
public DataTable getLocationList(string address,string controlIP)
|
||||
public DataTable getLocationList(string address, string controlIP)
|
||||
{
|
||||
string sql = string.Format(" select * from addressstorage as addr left join controller as con on con.ID=addr.controlid where type=4 and address = '{0}' and ControlIP='{1}'",
|
||||
address,
|
||||
controlIP
|
||||
);
|
||||
// LogHelper.WriteLogInfo("根据地址查询货位信息" + sql);
|
||||
// LogHelper.WriteLogInfo("根据地址查询货位信息" + sql);
|
||||
return db.GetsqlForDT(sql);
|
||||
}
|
||||
|
||||
@ -71,9 +71,9 @@ namespace Epost.DAL
|
||||
{
|
||||
string sql = string.Format(" select * from v_address where location = '{0}'",
|
||||
location
|
||||
|
||||
|
||||
);
|
||||
// LogHelper.WriteLogInfo("根据货位号查询标签地址" + sql);
|
||||
// LogHelper.WriteLogInfo("根据货位号查询标签地址" + sql);
|
||||
return db.GetsqlForDT(sql);
|
||||
}
|
||||
|
||||
@ -92,16 +92,16 @@ namespace Epost.DAL
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region 根据地址、通道查询信息
|
||||
public DataTable getAddressListByway(string location, string block, string area,string way)
|
||||
public DataTable getAddressListByway(string location, string block, string area, string way)
|
||||
{
|
||||
string sql = string.Format(" select * from addressstorage where location = '{0}' and block='{1}' and area='{2}' and way='{3}'",
|
||||
location,
|
||||
block,
|
||||
area,way
|
||||
area, way
|
||||
);
|
||||
// LogHelper.WriteLogInfo("根据地址、通道查询信息:" + sql);
|
||||
// LogHelper.WriteLogInfo("根据地址、通道查询信息:" + sql);
|
||||
return db.GetsqlForDT(sql);
|
||||
}
|
||||
|
||||
@ -111,7 +111,7 @@ namespace Epost.DAL
|
||||
public DataTable getControlList()
|
||||
{
|
||||
string sql = string.Format("select * from Controller");
|
||||
// LogHelper.WriteLogInfo("获取控制器列表" + sql);
|
||||
// LogHelper.WriteLogInfo("获取控制器列表" + sql);
|
||||
return db.GetsqlForDT(sql);
|
||||
}
|
||||
#endregion
|
||||
@ -158,32 +158,36 @@ namespace Epost.DAL
|
||||
|
||||
|
||||
#region 根据区域 查询显示箱号地址
|
||||
public DataTable GetBoxAddress(string block,string area,int type)
|
||||
public DataTable GetBoxAddress(string block, string area, int type)
|
||||
{
|
||||
string strwhere = string.Empty;
|
||||
if (!string.IsNullOrEmpty(area))
|
||||
{
|
||||
strwhere = " and area='"+area+"'";
|
||||
strwhere += " and area='" + area + "'";
|
||||
}
|
||||
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);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region 根据区域 查询显示箱号地址
|
||||
public DataTable getAddresslist(string block, string area,string type)
|
||||
public DataTable getAddresslist(string block, string area, string type)
|
||||
{
|
||||
|
||||
|
||||
string sql = string.Format(" select * from V_Address where location in (select min(location) from V_Address group by address) and block = '{0}' and area = '{1}' and type ='{2}'",
|
||||
block,
|
||||
area,type);
|
||||
|
||||
// LogHelper.WriteLogInfo("根据区域 查询显示箱号地址" + sql);
|
||||
area, type);
|
||||
|
||||
// LogHelper.WriteLogInfo("根据区域 查询显示箱号地址" + sql);
|
||||
return db.GetsqlForDT(sql);
|
||||
}
|
||||
|
||||
@ -195,7 +199,7 @@ namespace Epost.DAL
|
||||
string sql = string.Format("select * from V_Address where block='{0}' and area='{1}' and type in(2,4)",
|
||||
block,
|
||||
area);
|
||||
// LogHelper.WriteLogInfo("根据区域 查询显示箱号地址" + sql);
|
||||
// LogHelper.WriteLogInfo("根据区域 查询显示箱号地址" + sql);
|
||||
return db.GetsqlForDT(sql);
|
||||
}
|
||||
|
||||
@ -206,7 +210,7 @@ namespace Epost.DAL
|
||||
public DataTable GetScanList()
|
||||
{
|
||||
string sql = string.Format("select * from V_Address where type =6");
|
||||
|
||||
|
||||
return db.GetsqlForDT(sql);
|
||||
}
|
||||
|
||||
@ -223,9 +227,9 @@ namespace Epost.DAL
|
||||
#endregion
|
||||
|
||||
#region 根据区域获取扫描枪地址
|
||||
public DataTable GetScanListByArea(string block,string area)
|
||||
public DataTable GetScanListByArea(string block, string area)
|
||||
{
|
||||
string sql = string.Format("select * from V_Address where type =6 and block='"+block+"' and area = '"+area+"'");
|
||||
string sql = string.Format("select * from V_Address where type =6 and block='" + block + "' and area = '" + area + "'");
|
||||
|
||||
return db.GetsqlForDT(sql);
|
||||
}
|
||||
@ -253,23 +257,17 @@ namespace Epost.DAL
|
||||
#region 获取所有小区
|
||||
public DataTable GetAreaList()
|
||||
{
|
||||
string sql = string.Format("select area,block from Addressstorage where type=1 group by area,block");
|
||||
string sql = string.Format("select area,block from Addressstorage where type=1 group by area,block");
|
||||
return db.GetsqlForDT(sql);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 获取所有小区
|
||||
public List<AddressstorageModel> GetAreaList(string block, string shelfid)
|
||||
public List<AddressstorageModel> GetAreaList(string block = "")
|
||||
{
|
||||
string strwhere = string.Empty;
|
||||
if (!string.IsNullOrEmpty(block))
|
||||
{
|
||||
strwhere += "and block ='" + block + "'";
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(shelfid))
|
||||
{
|
||||
strwhere += "and shelfid ='" + shelfid + "'";
|
||||
strwhere = "and block ='" + block + "'";
|
||||
}
|
||||
string sql = string.Format("select area,block from Addressstorage where type=1 " + strwhere + " group by area,block");
|
||||
DataTable dt = db.GetsqlForDT(sql);
|
||||
@ -277,32 +275,16 @@ namespace Epost.DAL
|
||||
return ModelConvertHelper<AddressstorageModel>.ConvertToList(dt);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 获取所有小区
|
||||
public List<AddressstorageModel> GetshelfidList(string block)
|
||||
{
|
||||
string strwhere = string.Empty;
|
||||
if (!string.IsNullOrEmpty(block))
|
||||
{
|
||||
strwhere += "and block ='" + block + "'";
|
||||
}
|
||||
|
||||
string sql = string.Format("select shelfid,block from Addressstorage where type=1 " + strwhere + " group by shelfid,block");
|
||||
DataTable dt = db.GetsqlForDT(sql);
|
||||
|
||||
return ModelConvertHelper<AddressstorageModel>.ConvertToList(dt);
|
||||
}
|
||||
#endregion
|
||||
#region 获取所有通道
|
||||
public DataTable GetWayList()
|
||||
{
|
||||
string sql = string.Format("select way from Addressstorage group by way");
|
||||
string sql = string.Format("select way from Addressstorage group by way");
|
||||
return db.GetsqlForDT(sql);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 分页获取数据列表
|
||||
|
||||
|
||||
public List<AddressstorageModel> GetCityListByPage(string strWhere, string orderby, int startIndex, int endIndex, out int recordCount)
|
||||
{
|
||||
|
||||
@ -326,7 +308,7 @@ namespace Epost.DAL
|
||||
}
|
||||
strSql.Append(" ) TT");
|
||||
strSql.AppendFormat(" WHERE TT.Row between {0} and {1}", startIndex, endIndex);
|
||||
List<AddressstorageModel> list = ModelConvertHelper<AddressstorageModel>.ConvertToList(db.GetsqlForDT(strSql.ToString()));
|
||||
List<AddressstorageModel> list = ModelConvertHelper<AddressstorageModel>.ConvertToList(db.GetsqlForDT(strSql.ToString()));
|
||||
|
||||
strSql.Remove(0, strSql.Length);
|
||||
strSql.Append("SELECT COUNT(*) FROM Addressstorage AS T ");
|
||||
@ -355,12 +337,12 @@ namespace Epost.DAL
|
||||
|
||||
//---
|
||||
#region 获取每个小区对应的每个大区(根据小区从小到大排序对应的大区)
|
||||
public List<AddressstorageModel> GetBlockByAreaList()
|
||||
public List<AddressstorageModel> GetBlockByAreaList()
|
||||
{
|
||||
//string sql = string.Format("select cast(area as Int) as 'Area_area',block from Addressstorage group by block,area order by 'Area_area',block");
|
||||
string sql = string.Format("select cast(way as Int) as 'Area_area',area from Addressstorage where type in(1,2) group by way,area order by Area_area,area");
|
||||
List<AddressstorageModel> list = ModelConvertHelper<AddressstorageModel>.ConvertToList(db.GetsqlForDT(sql));
|
||||
|
||||
|
||||
return list;
|
||||
}
|
||||
#endregion
|
||||
@ -450,7 +432,7 @@ namespace Epost.DAL
|
||||
#region 根据条件删除货位
|
||||
public bool Locational_Binding_Save(string one, string two, string three, string four, string five, string six)
|
||||
{
|
||||
|
||||
|
||||
#region one
|
||||
string sql1 = "update Addressstorage ";
|
||||
try
|
||||
@ -598,7 +580,7 @@ namespace Epost.DAL
|
||||
//}
|
||||
strSql.Append(" ) TT");
|
||||
string sq = strSql.Append(" WHERE TT.Row between {0} and {1}").ToString();
|
||||
string sq1= string.Format(sq, startIndex, endIndex);
|
||||
string sq1 = string.Format(sq, startIndex, endIndex);
|
||||
string sq3 = string.Format(sq, 0, 100000);
|
||||
|
||||
List<AddressstorageModel> list = ModelConvertHelper<AddressstorageModel>.ConvertToList(db.GetsqlForDT(sq1.ToString()));
|
||||
@ -661,7 +643,7 @@ namespace Epost.DAL
|
||||
);
|
||||
// LogHelper.WriteLogInfo("根据地址查询货位信息" + sql);
|
||||
return db.GetsqlForDT(sql);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
@ -684,7 +666,7 @@ namespace Epost.DAL
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 设置所有的设备都为1
|
||||
@ -831,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
|
||||
|
||||
}
|
||||
}
|
@ -1,94 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Epost.DAL.Cache
|
||||
{
|
||||
public class WorkIngCacheDAL
|
||||
{
|
||||
private static object lockobj = new object();
|
||||
public static string workingstate = string.Empty;
|
||||
|
||||
|
||||
#region 获取计划任务列表
|
||||
public string GetWorkState()
|
||||
{
|
||||
|
||||
|
||||
|
||||
//读取数据库 处理异常断电等情况------待开发
|
||||
return workingstate;
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
#region 初始化任务列表
|
||||
public void ClearWork()
|
||||
{
|
||||
|
||||
|
||||
workingstate = "";
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
#region Job缓存处理方法
|
||||
/// <summary>
|
||||
/// Job缓存处理方法
|
||||
/// </summary>
|
||||
/// <param name="JobParam"></param>
|
||||
/// <param name="CommendType"></param>
|
||||
/// <returns></returns>
|
||||
public bool UpdateWorkModel(WorkEcommendType CommendType)
|
||||
{
|
||||
|
||||
lock (lockobj)
|
||||
{
|
||||
|
||||
if (CommendType.Equals(WorkEcommendType.Create))
|
||||
{
|
||||
workingstate = "Start";
|
||||
}
|
||||
|
||||
else if (CommendType.Equals(WorkEcommendType.Complete))
|
||||
{
|
||||
|
||||
workingstate = "";
|
||||
|
||||
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
public enum WorkEcommendType
|
||||
{
|
||||
/// <summary>
|
||||
/// 开始作业
|
||||
/// </summary>
|
||||
[Description("开始作业")]
|
||||
Create,
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 结束作业
|
||||
/// </summary>
|
||||
[Description("结束作业")]
|
||||
Complete
|
||||
|
||||
|
||||
}
|
||||
}
|
@ -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;
|
||||
|
||||
|
||||
|
@ -111,7 +111,6 @@
|
||||
<Compile Include="Cache\ShowMesCacheDAL.cs" />
|
||||
<Compile Include="Cache\UserLoginCacheDAL.cs" />
|
||||
<Compile Include="Cache\UserModelCacheDAL.cs" />
|
||||
<Compile Include="Cache\WorkIngCacheDAL.cs" />
|
||||
<Compile Include="Cache\XgateCacheDAL.cs" />
|
||||
<Compile Include="CommandDAL.cs" />
|
||||
<Compile Include="DB.cs" />
|
||||
|
@ -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,15 +507,15 @@ 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,
|
||||
|
||||
|
||||
id);
|
||||
}
|
||||
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
|
||||
}
|
||||
}
|
||||
|
@ -9,7 +9,7 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace Epost.DAL
|
||||
{
|
||||
public class OrdersQueueDAL
|
||||
public class OrdersQueueDAL
|
||||
{
|
||||
DataBaseOpration.OprationSqlDAL db = DB_DLL.GetInstance();
|
||||
#region 添加任务信息
|
||||
@ -27,7 +27,7 @@ namespace Epost.DAL
|
||||
model.Location,
|
||||
model.Matchid,
|
||||
model.Lightcolor);
|
||||
LogHelper.WriteLogInfo("进入拣货队列========="+sql);
|
||||
LogHelper.WriteLogInfo("进入拣货队列=========" + sql);
|
||||
long x = db.InsertSql(sql);
|
||||
if (x > 0)
|
||||
return true;
|
||||
@ -43,18 +43,18 @@ namespace Epost.DAL
|
||||
}
|
||||
#endregion
|
||||
#region 获取任务信息
|
||||
public DataTable getQueuesOrderbyState(string state="0")
|
||||
public DataTable getQueuesOrderbyState(string state = "0")
|
||||
{
|
||||
string sql = string.Format("select * from OrdersQueue where state ='{0}'",
|
||||
state);
|
||||
// LogHelper.WriteLogInfo("获取正在绑定的信息" + sql);
|
||||
// LogHelper.WriteLogInfo("获取正在绑定的信息" + sql);
|
||||
return db.GetsqlForDT(sql);
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 获取queue信息
|
||||
public DataTable getQueuesOrderbyState(string block,string area,string state)
|
||||
public DataTable getQueuesOrderbyState(string block, string area, string state)
|
||||
{
|
||||
string sql = string.Format("select * from OrdersQueue where (state ='{0}' or state='0') and taskblock='{1}' and taskarea='{2}' ",
|
||||
state,
|
||||
@ -68,19 +68,19 @@ namespace Epost.DAL
|
||||
#region 获取任务信息
|
||||
public DataTable getQueuesbyState()
|
||||
{
|
||||
string sql = "select * from OrdersQueue where state<>0 and state<>3";
|
||||
string sql = "select * from OrdersQueue where state<>3";
|
||||
return db.GetsqlForDT(sql);
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 获取任务信息
|
||||
public DataTable getOrderqueueByAddr(string addr,string ip)
|
||||
public DataTable getOrderqueueByAddr(string addr, string ip)
|
||||
{
|
||||
string sql =string.Format("select * from OrdersQueue where state=2 and taskarea='{0}' and taskblock='{1}'",
|
||||
string sql = string.Format("select * from OrdersQueue where state=2 and taskarea='{0}' and taskblock='{1}'",
|
||||
addr,
|
||||
ip);
|
||||
LogHelper.WriteLogInfo("获取=="+sql);
|
||||
LogHelper.WriteLogInfo("获取==" + sql);
|
||||
return db.GetsqlForDT(sql);
|
||||
|
||||
}
|
||||
@ -89,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);
|
||||
@ -107,10 +112,10 @@ namespace Epost.DAL
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool DeleteOrderQueue(string matchid,string CancelTime)
|
||||
public bool DeleteOrderQueue(string matchid, string CancelTime)
|
||||
{
|
||||
string sql = string.Format("delete from OrdersQueue where matchid='{0}' and Addtime='{1}'",
|
||||
matchid,CancelTime);
|
||||
matchid, CancelTime);
|
||||
long x = db.DeleteSql(sql);
|
||||
if (x > 0)
|
||||
return true;
|
||||
@ -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);
|
||||
@ -130,7 +135,7 @@ namespace Epost.DAL
|
||||
}
|
||||
#endregion
|
||||
#region 获取当前区的作业状态
|
||||
public DataTable getQueueState(string usercode,string matchid,string block,string area)
|
||||
public DataTable getQueueState(string usercode, string matchid, string block, string area)
|
||||
{
|
||||
string sql = string.Format("select * from ordersqueue where UserCode='{0}' and matchid='{1}' and Taskblock='{2}' and TaskArea='{3}' and state in(0,1)",
|
||||
usercode,
|
||||
@ -142,14 +147,14 @@ namespace Epost.DAL
|
||||
}
|
||||
#endregion
|
||||
#region 获取用户下的所有sku
|
||||
public DataTable getQueueSKU(OrdersQueueModel model)
|
||||
public DataTable getQueueSKU(OrdersQueueModel model)
|
||||
{
|
||||
string sql = string.Format("select sku from OrdersQueue where taskblock = '{0}' and taskarea = '{1}' and UserCode = '{2}'",
|
||||
model.Taskblock,
|
||||
model.Taskarea,
|
||||
model.UserCode);
|
||||
DataTable dt= db.GetsqlForDT(sql);
|
||||
|
||||
DataTable dt = db.GetsqlForDT(sql);
|
||||
|
||||
return dt;
|
||||
}
|
||||
#endregion
|
||||
@ -175,7 +180,7 @@ namespace Epost.DAL
|
||||
public bool updateOrderQueue(string block, string area)
|
||||
{
|
||||
string sql = string.Format("update ordersqueue set state = 0 where state=1 and taskblock='{0}' and TaskArea='{1}'",
|
||||
block,area);
|
||||
block, area);
|
||||
LogHelper.WriteLogInfo("换箱、拆箱后恢复作业" + sql);
|
||||
long x = db.UpdateSql(sql);
|
||||
if (x > 0)
|
||||
@ -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)
|
||||
@ -211,11 +216,11 @@ namespace Epost.DAL
|
||||
#endregion
|
||||
|
||||
#region 获取sku是否正在作业
|
||||
public DataTable GetOrderQueue(string block,string area,string state)
|
||||
public DataTable GetOrderQueue(string block, string area, string state)
|
||||
{
|
||||
string sql = string.Format("select * from OrdersQueue where state <>'{0}' and taskblock='{1}' and taskarea='{2}'",
|
||||
state,
|
||||
block,area);
|
||||
block, area);
|
||||
LogHelper.WriteLogInfo("获取sku是否正在作业" + sql);
|
||||
return db.GetsqlForDT(sql);
|
||||
|
||||
@ -230,7 +235,7 @@ namespace Epost.DAL
|
||||
model.State);
|
||||
|
||||
|
||||
long x= db.UpdateSql(sql);
|
||||
long x = db.UpdateSql(sql);
|
||||
if (x > 0)
|
||||
return true;
|
||||
return false;
|
||||
@ -238,10 +243,10 @@ namespace Epost.DAL
|
||||
#endregion
|
||||
|
||||
#region 修改作业状态
|
||||
public bool UpdateQueueState(string id,string state)
|
||||
public bool UpdateQueueState(string id, string state)
|
||||
{
|
||||
string sql = string.Format("update OrdersQueue set state='{0}' where id ='{1}'",
|
||||
state,id);
|
||||
state, id);
|
||||
long x = db.UpdateSql(sql);
|
||||
if (x > 0)
|
||||
return true;
|
||||
@ -250,7 +255,7 @@ namespace Epost.DAL
|
||||
#endregion
|
||||
|
||||
#region 绑定箱号完成
|
||||
public bool UpdateBoxCode(string id,string boxcode)
|
||||
public bool UpdateBoxCode(string id, string boxcode)
|
||||
{
|
||||
string sql = string.Format("update OrdersQueue set state=3,boxcode='{0}' where id ='{1}'",
|
||||
boxcode,
|
||||
@ -269,11 +274,11 @@ namespace Epost.DAL
|
||||
model.Taskarea,
|
||||
model.Orderid,
|
||||
model.State);
|
||||
long x= db.UpdateSql(sql);
|
||||
long x = db.UpdateSql(sql);
|
||||
if (x > 0)
|
||||
return true;
|
||||
return false;
|
||||
|
||||
|
||||
|
||||
}
|
||||
#endregion
|
||||
@ -284,19 +289,21 @@ namespace Epost.DAL
|
||||
string strwhere = string.Empty;
|
||||
if (!string.IsNullOrEmpty(model.Taskblock))
|
||||
{
|
||||
strwhere = "and taskblock='"+model.Taskblock+"'";
|
||||
strwhere = "and taskblock='" + model.Taskblock + "'";
|
||||
}
|
||||
if (!string.IsNullOrEmpty(model.Taskarea))
|
||||
{
|
||||
strwhere += "and Taskarea='" + model.Taskarea + "'";
|
||||
}
|
||||
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);
|
||||
LogHelper.WriteLogInfo("修改作业区段" + sql);
|
||||
long x = db.UpdateSql(sql);
|
||||
if (x > 0)
|
||||
return true;
|
||||
@ -305,7 +312,7 @@ namespace Epost.DAL
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
#region 恢复作业
|
||||
public bool UpdateQueueState()
|
||||
{
|
||||
@ -354,11 +361,11 @@ namespace Epost.DAL
|
||||
|
||||
|
||||
#region 删除queue
|
||||
public bool DelQueueOrder(string sku,string block)
|
||||
public bool DelQueueOrder(string sku, string block)
|
||||
{
|
||||
string sql = string.Format("delete from OrdersQueue where sku='{0}' and taskblock='{1}' and state<>3",
|
||||
sku,block);
|
||||
LogHelper.WriteLogInfo("删除queue"+sql);
|
||||
sku, block);
|
||||
LogHelper.WriteLogInfo("删除queue" + sql);
|
||||
long x = db.DeleteSql(sql);
|
||||
if (x > 0)
|
||||
return true;
|
||||
@ -380,7 +387,7 @@ namespace Epost.DAL
|
||||
}
|
||||
else
|
||||
{
|
||||
return 1;
|
||||
return 1;
|
||||
|
||||
}
|
||||
|
||||
@ -388,7 +395,7 @@ namespace Epost.DAL
|
||||
#endregion
|
||||
|
||||
#region 删除queue
|
||||
public bool DeleteQueue(string block,string area)
|
||||
public bool DeleteQueue(string block, string area)
|
||||
{
|
||||
string sql = string.Format("delete from OrdersQueue where taskblock='{0}' and taskarea='{1}'",
|
||||
block, area);
|
||||
|
@ -99,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" />
|
||||
@ -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