6 Commits

Author SHA1 Message Date
jl
36bbcd0b71 2024-04-02 16:19:03 +08:00
jl
8235f16d38 2024-02-26 10:54:49 +08:00
jl
0d46fcfe0b 2024-01-23 17:15:53 +08:00
jl
ae55e77ef8 2024-01-17 15:56:28 +08:00
jl
9d5221ba0d 2024-01-12 16:53:44 +08:00
95aaa6d25c 2023-12-15 11:57:07 +08:00
9 changed files with 778 additions and 863 deletions

View File

@ -740,7 +740,16 @@ namespace Epost.BLL
LabelParamModel model = new LabelParamModel();
model.Address = addritem["address"].ToString();
model.ControlIP = addritem["controlip"].ToString();
model.Parameter = show.No;
model.Uid = show.Uid;
if (string.IsNullOrEmpty(show.Uid))
{ model.Uid = show.No + addritem["address"].ToString(); }
model.Type = "N";
if (addritem["addresstype"].ToString() == "2")
{
model.Type = "C";
}
model.Parameter = model.Uid;
model.Command = "REMOVE_JOB";
model.Timeout = "0.5";
list.Add(model);

View File

@ -792,8 +792,9 @@ namespace Epost.BLL
demodel.Addresstype = "1";
demodel.ControlID = "";
demodel.ControlIP = item["ControlIP"].ToString();
//demodel.Layer = item["Layer"].ToString();
//demodel.Slist = item["Slist"].ToString();
demodel.Layer = item["Layer"].ToString();
demodel.Slist = item["Slist"].ToString();
demodel.clientcode = item["clientcode"].ToString();
//demodel.Zone = item["zone"].ToString();
//demodel.TaskType =Convert.ToInt32(item["tasktype"].ToString());

View File

@ -1,4 +1,5 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Data.Entity.Infrastructure;
@ -11,6 +12,7 @@ using Epost.DAL;
using Epost.DAL.Cache;
using Epost.DAL.Enum;
using Epost.Model;
using static Epost.DAL.Enum.LightColor;
namespace Epost.BLL
{
@ -474,18 +476,24 @@ namespace Epost.BLL
//List<JobModel> rjob = jobList.FindAll(m => m.Block == data.Block && m.Area == data.Area && m.Sku == model.Sku);
//JobCache.UpdateJobModelList(rjob, EcommendType.Execute);
//bool allfinish = dal.IsFinishWork_box("", 0, model.OrderID);
//if (allfinish)
//{
#region
OrdersQueueModel qumodel = new OrdersQueueModel();
#region
OrdersQueueModel qumodel = new OrdersQueueModel();
qumodel.State = 3;
qumodel.Taskblock = block;
qumodel.Taskarea = area;
//qumodel.Orderid = model.OrderID;
queueBLL.UpdateQueueTaskArea_Car(qumodel);
#endregion
bool allfinish = dal.IsFinishWork_box("", 0, model.OrderID);
if (allfinish)
{
LogHelper.WriteLogInfo("订单拣选完成");
ShowMessageModel_M showmodel = new ShowMessageModel_M();
showmodel.Type = 2;
comBLL.RemoveBoxMessage_M(showmodel);
}
//修改订单状态
dal.UpdateState(model.Area, model.Block);
@ -585,7 +593,7 @@ namespace Epost.BLL
if (queueDT != null && queueDT.Rows.Count > 0)
{
ShowMessageModel showmodel = new ShowMessageModel();
////获取当前区任务并加入缓存
//if (!isJobList.Any())
//{
@ -594,7 +602,7 @@ namespace Epost.BLL
if (nowJoblist.Any())
{
var nowmodel = nowJoblist.FirstOrDefault();
string showmes = string.Empty;
#region
foreach (JobModel item in nowJoblist.ToArray())
{
@ -633,10 +641,11 @@ namespace Epost.BLL
{
manufactname = item.manufactname.Substring(0, 4);
}
lamodel.Content = "" + item.Sku.Substring(item.Sku.Length - 4, 4) + "\\t" + item.Spec + "\r" + item.GoodsName + "\r批号" + item.batchno + " " + manufactname + "";
// lamodel.Content = "" + item.Sku.Substring(item.Sku.Length - 4, 4) + "\\t" + item.Spec + "\r" + item.GoodsName + "\r批号" + item.batchno + " " + manufactname + "";
lamodel.Content = "" + item.GoodsName + "\r" + item.Spec + "\r" + manufactname + "";
var aryloc = item.Tolocation.Split('-');
lamodel.Loc = "" + aryloc[0].ToString() + "-" + aryloc[1].ToString() + "";
lamodel.W_quantity = aryloc[2].ToString();
lamodel.Loc = "" + aryloc[0].ToString();
lamodel.W_quantity = item.Slist;
lamodel.Quantity = quantity.ToString();
lamodel.Unit = item.Unit;
lamodel.PicChoose = "";
@ -719,7 +728,7 @@ namespace Epost.BLL
item.DisplayTime = DateTime.Now;
#endregion
showmes = item.clientcode;
}
#endregion
@ -729,6 +738,34 @@ namespace Epost.BLL
{
LogHelper.WriteLogInfo("添加到点亮的list————————————————————" + list.Count);
comBLL.DISPLAY_JOBALL(list);
//点亮显示器
if (!string.IsNullOrEmpty(showmes))
{
LogHelper.WriteLogInfo("下发异常货位信息"+showmes);
if (showmes.Length > 30)
{
string newstr = showmes.Substring(30, showmes.Length - 30);
if (newstr.Length > 30)
{
showmes = showmes.Substring(0, 30) + "\r" + newstr.Substring(0, 30) + "\r" + newstr.Substring(30, newstr.Length - 30);
}
else
{
showmes = showmes.Substring(0, 30) + "\r" + newstr;
}
}
ShowMessageModel_M showmodel = new ShowMessageModel_M();
showmodel.Color = EnumHelper.EMToDescriptionString(LightColor.Color.Red);
showmodel.Islock = true;
showmodel.Title = "下发货位异常信息";
showmodel.IsTwinkle = 0;
showmodel.Contents = showmes;
showmodel.Type = 2;
comBLL.ShowBoxMessage_M(showmodel);//点亮显示标签
}
}
}
//else

View File

@ -52,7 +52,7 @@ namespace Epost.DAL
string sql = string.Empty;
if (!string.IsNullOrEmpty(area))
{
sql = string.Format("select id,transderDid,orderid,Sku,genericname,GoodsName,Spec,Unit,batchno,manufactname,Quantity,stockquantity,shopname,Tolocation,labelcolor,looklisten,labelIP,labelno,Matchid,barcode,BatchId,DownDate,Discount,address,ControlIP,area,block,shopid from v_orders where state = 0 and oprationstate =0 and block = '{1}' and area='{2}' " + strwhere + "",
sql = string.Format("select id,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,slist,layer,clientcode from v_orders where state = 0 and oprationstate =0 and block = '{1}' and area='{2}' " + strwhere + " order by layer+1, slist+1",
sku,
block, area);
@ -60,7 +60,7 @@ namespace Epost.DAL
}
else
{
sql = string.Format("select id,transderDid,orderid,Sku,genericname,GoodsName,Spec,Unit,batchno,manufactname,Quantity,stockquantity,shopname,Tolocation,labelcolor,looklisten,labelIP,labelno,Matchid,barcode,BatchId,DownDate,Discount,address,ControlIP,area,block,shopid from v_orders where state = 0 and oprationstate =0 and sku = '{0}' and block = '{1}' " + strwhere + "",
sql = string.Format("select id,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,slist,layer,clientcode from v_orders where state = 0 and oprationstate =0 and sku = '{0}' and block = '{1}' " + strwhere + " order by layer+1,slist+1",
sku,
block);
@ -87,7 +87,7 @@ namespace Epost.DAL
{
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 + "",
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 + " order by Tolocation",
block, area);
return db.GetsqlForDT(sql);
@ -834,9 +834,8 @@ namespace Epost.DAL
if (!string.IsNullOrEmpty(sku))
{
strwhere += " and sku='" + sku + "'";
}
string upsql = string.Format("update v_orders set state=3 where area ='" + area + "' " + strwhere);
}
string upsql = string.Format("update v_orders set state=3 where area ='" + area + "' and state<>99 " + strwhere);
LogHelper.WriteLogInfo("修改通道拣货状态:" + upsql);
long x = db.UpdateSql(upsql);
if (x > 0)

View File

@ -48,6 +48,7 @@ namespace Epost.Model
private string _Unit = string.Empty;//小单位
private string _UserCode = string.Empty;//工号
private string _no = string.Empty;//任务序号
private string _clientcode = string.Empty;//货位不存在提示
public string BatchId
{
get
@ -396,6 +397,7 @@ namespace Epost.Model
public string UserCode { get => _UserCode; set => _UserCode = value; }
public string No { get => _no; set => _no = value; }
public string ID { get => _ID; set => _ID = value; }
public string clientcode { get => _clientcode; set => _clientcode = value; }
}
}

View File

@ -9,6 +9,7 @@ using Epost.Common;
using System.Web.Helpers;
using System.Data;
using System.Configuration;
using System.Text.RegularExpressions;
namespace Epost.TestToolsWeb.Tests.Controllers
{
@ -19,14 +20,16 @@ namespace Epost.TestToolsWeb.Tests.Controllers
[TestMethod]
public void d()
{
string sku = "211100";
if (sku.Substring(0, 1) == "2" && sku.Substring(1, 1) != "5")
string showmes = "211100|总|938275908324|93875|934725";
if (!Regex.IsMatch(showmes, @"[\u4e00-\u9fa5]"))
{
if (sku.Length >= 7)
{
sku = sku.Substring(1, 6);
}
}
}
else {
LogHelper.WriteLogInfo("dasf");
}
}
}
}

View File

@ -10,8 +10,8 @@
<WebStackScaffolding_LayoutPageFile>~/Views/Shared/_EpostLayoutPage.cshtml</WebStackScaffolding_LayoutPageFile>
<WebStackScaffolding_IsAsyncSelected>False</WebStackScaffolding_IsAsyncSelected>
<WebStackScaffolding_ViewDialogWidth>600</WebStackScaffolding_ViewDialogWidth>
<NameOfLastUsedPublishProfile>D:\驿传\Epost\T_DAS_PTL\Epost.TestToolsWeb\Properties\PublishProfiles\Toolsweb.pubxml</NameOfLastUsedPublishProfile>
<LastActiveSolutionConfig>Debug|Any CPU</LastActiveSolutionConfig>
<NameOfLastUsedPublishProfile>E:\WORK\代码管理\T系列\播种\Epost.TestToolsWeb\Properties\PublishProfiles\Toolsweb.pubxml</NameOfLastUsedPublishProfile>
<LastActiveSolutionConfig>Release|Any CPU</LastActiveSolutionConfig>
<Use64BitIISExpress />
<IISExpressSSLPort />
<IISExpressAnonymousAuthentication />

View File

@ -3,11 +3,13 @@ using Epost.Common;
using Epost.DAL;
using Epost.DAL.Cache;
using Epost.Model;
using PTLSystems.Service.PublicF;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Security.Policy;
using System.Text.RegularExpressions;
using System.Web;
using System.Web.Helpers;
using System.Web.Razor.Tokenizer.Symbols;
@ -59,157 +61,21 @@ namespace Epost.DPS.WebService
{
var ReturnDt = set.Tables["pick"];
DataTable dtResult = ReturnDt.Clone();
string str = string.Empty;
foreach (DataRow item in ReturnDt.Rows)
{
#region /
//灭灯
if (item["TaskType"].ToString() == "Y")
DataTable dt = bll.GetDataIfRepeat(item["transderMid"].ToString(), item["transderDid"].ToString());
if (dt == null || dt.Rows.Count <= 0)
{
List<LabelParamModel> list = new List<LabelParamModel>();
//熄灭指定订单任务
if (item["Current"].ToString() == "Y")
DataTable locdt = bll.GetlocationInfo(item["areaId"].ToString());
if (!Regex.IsMatch(item["areaId"].ToString(), @"[\u4e00-\u9fa5]"))
{
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)
{
locdt.Columns.Add("strinfo", typeof(string));
DataRow dataRow = dtResult.NewRow();
dataRow["transderMid"] = item["transderMid"].ToString();
dataRow["transderDid"] = item["transderDid"].ToString();
@ -229,30 +95,26 @@ namespace Epost.DPS.WebService
dataRow["lookListen"] = item["lookListen"].ToString();
dataRow["labelIP"] = item["labelIP"].ToString();
dataRow["labelNo"] = item["labelNo"].ToString();
dataRow["strinfo"] = dataRow["strinfo"] + str;
dtResult.Rows.Add(dataRow);
}
else
{
LogHelper.WriteLogInfo("" + item["areaId"].ToString() + ",该货位不存在");
str = str + item["areaId"].ToString() + "|";
}
}
else
{
mms += "主键重复 (" + item["transderMid"].ToString() + "-" + item["transderDid"].ToString() + ")";
}
else { LogHelper.WriteLogInfo("" + item["areaId"].ToString() + ",货位包含中文"); }
}
else
{
msg.Status = "erro";
msg.Message = "数据异常TaskType参数为空或参数不正确";
main.msg = msg;
resultxml = XmlHelper.ModelToXml(main);
LogHelper.WriteLogInfo("数据异常TaskType参数为空或参数不正确");
mms += "主键重复 (" + item["transderMid"].ToString() + "-" + item["transderDid"].ToString() + ")";
}
#endregion
}
#region
if (!string.IsNullOrEmpty(mms))
{
@ -287,7 +149,7 @@ namespace Epost.DPS.WebService
diclist.Add("lookListen", "looklisten");
diclist.Add("labelIP", "labelIP");
diclist.Add("labelNo", "labelno");
diclist.Add("strinfo", "clientcode");
bool b = bll.ImportOrderinfo(dtResult, diclist);
if (b)
{
@ -348,5 +210,7 @@ namespace Epost.DPS.WebService
}
}
}
}
}