This commit is contained in:
jl
2025-06-05 15:11:19 +08:00
parent 285bae186b
commit 8c1493f76e
17 changed files with 351 additions and 273 deletions

View File

@ -105,6 +105,7 @@
<Compile Include="ModelConvertHelper.cs" />
<Compile Include="OrderBLL.cs" />
<Compile Include="OrderControlBLL.cs" />
<Compile Include="Print_BoxBLL.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="RoleInfoBLL.cs" />
<Compile Include="ShopBLL.cs" />

View File

@ -28,6 +28,7 @@ namespace Epost.BLL
JobDownCacheDAL downCacheDAL = new JobDownCacheDAL();
LocationCacheDAL LocCacheDAL = new LocationCacheDAL();
UserModelCacheDAL UserCacheDAL = new UserModelCacheDAL();
Print_BoxDAL boxdal = new Print_BoxDAL();
private static object lockbox = new object();
@ -159,65 +160,37 @@ namespace Epost.BLL
}
#endregion
#region \ type:1 2
public bool ChangeBox(ResultMessageModel data, int type, string block = "", string area = "")
#region type:1 2
public bool ChangeBox(JobModel model,int type=1)
{
bool bo = false;
DataTable dt = queueboxBLL.getOrderqueueByAddr(data.Address, data.IP, "3");
if (type == 1)
{
dt = queueboxBLL.getOrderqueueByAddr(data.Address, data.IP);
}
int boxcount = dal.GetStoreInfo(model.ShopID);
if (dt != null && dt.Rows.Count > 0)
int newno = boxcount + 1;
//更新订单表这个门店的箱号信息
//生成箱号
DateTimeOffset now = DateTimeOffset.UtcNow;
long millisecondsTimestamp = now.ToUnixTimeMilliseconds();
string boxcode = model.ShopID + "-" + millisecondsTimestamp +"-"+ newno.ToString();
int totalcount = 0;
if (type == 2)
{
string shopcode = dt.Rows[0]["shopid"].ToString();
List<ResultMessageModel> dnList = downCacheDAL.GetPlanJobDownList().FindAll(m => m.Status == "2" && m.Command == "QUERY_SPECIAL_STATUS" && m.Parameter.Contains(shopcode));
string boxcode = string.Empty;//箱号
string traycode = string.Empty;//托盘号
if (dnList.Any())
totalcount = newno;
}
model.BoxCode = boxcode;
bool bo = dal.ChangeBox(model.ShopID, boxcode, newno, totalcount);
if (bo)
{ bool boxbo = boxdal.InsertPrint(model, newno, totalcount);
if (!boxbo)
{
foreach (ResultMessageModel item in dnList)
{
if (item.Parameter.Contains("C"))
{
boxcode = item.Parameter;
}
else if (item.Parameter.Contains("P"))
{
traycode = item.Parameter;
}
}
if (type == 1)
{
bo = queueboxBLL.UpdateBoxCode(dt.Rows[0]["id"].ToString(), boxcode, traycode);
}
string matchid = dt.Rows[0]["matchid"].ToString();
bo = dal.bindBox(boxcode, matchid, shopcode, traycode);
if (bo)
{
if (type == 2)
{
//当前区恢复作业,设备灯亮起
queueBLL.updateOrderQueue(block, area);
}
}
else
{
LogHelper.WriteLogInfo("绑定箱号执行失败!");
}
downCacheDAL.UpdateJobDownModelList(dnList, EdownCommend.Execute);
LogHelper.WriteLogInfo("添加箱号打印失败"+ boxcode, LogHelper.Log_Type.ERROR);
}
return bo;
}
else
{
return false;
else {
LogHelper.WriteLogInfo("换箱失败" + boxcode, LogHelper.Log_Type.ERROR);
}
return bo;
}
#endregion
@ -677,14 +650,14 @@ namespace Epost.BLL
{
List<JobModel> list = new List<JobModel>();
DataTable OrderDt = dal.GetOrderList_Car(matchid, sku, area, block);
DataTable OrderDt = dal.GetOrderList_Car(matchid, sku, area, block, UserCode);
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_echo(matchid, sku, area, block, UserCode);
// isecho = true;
}
//}
if (OrderDt != null && OrderDt.Rows.Count > 0)
{
string usercode = string.Empty;
@ -740,11 +713,11 @@ 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) {
//修改数据为已读
@ -963,7 +936,7 @@ namespace Epost.BLL
#region
public DataTable GetOrderList_Car(string matchid, string sku, string sarea, string sblock)
{
return dal.GetOrderList_Car(matchid, sku, sarea, sblock);
return dal.GetOrderList_Car(matchid, sku, sarea, sblock,"");
}
#endregion
#region

View File

@ -246,5 +246,14 @@ namespace Epost.BLL
}
#endregion
#region
public bool UpdateQueueByUser(string usercode,string color)
{
return dal.UpdateQueueByUser(usercode,color);
}
#endregion
}
}

37
Epost.BLL/Print_BoxBLL.cs Normal file
View File

@ -0,0 +1,37 @@
using Epost.DAL;
using Epost.Model;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Epost.BLL
{
public class Print_BoxBLL
{
Print_BoxDAL dal = new Print_BoxDAL();
#region
public DataTable GetPrintList(string block)
{
return dal.GetPrintList(block);
}
#endregion
#region
public bool UpPrintList(string id)
{
return dal.UpPrintList(id);
}
#endregion
#region
public bool InsertPrint(JobModel model, int boxno, int totalcount)
{
return dal.InsertPrint(model, boxno,totalcount);
}
#endregion
}
}

View File

@ -95,55 +95,7 @@ namespace Epost.BLL
//当前区没有作业
if (queueDT.Rows[0]["state"].ToString() == "0")
{
#region
ShowMessageModel_M showmodel = new ShowMessageModel_M();
showmodel.Area = shelfid;
showmodel.Block = nblock;
showmodel.Color = queueDT.Rows[0]["lightcolor"].ToString();//EnumHelper.EMToDescriptionString(LightColor.Color.Red);
showmodel.Title = queueDT.Rows[0]["Shopid"].ToString();
showmodel.Islock = true;
showmodel.IsTwinkle = 0;
showmodel.Type = 8;
DataTable skudt = orderbll.GetSumList(queueDT.Rows[0]["matchid"].ToString(), queueDT.Rows[0]["sku"].ToString(), nblock, shelfid);
if (queueDT.Rows[0]["lightcolor"].ToString() == "1")
{
showmodel.Islock = false;
}
else if (queueDT.Rows[0]["lightcolor"].ToString() == EnumHelper.EMToDescriptionString(LightColor.Color.Blue))
{
//复核显示
skudt = orderbll.GetSumList_Echo(queueDT.Rows[0]["matchid"].ToString(), queueDT.Rows[0]["sku"].ToString(), nblock, shelfid);
showmodel.Title = "回显:"+queueDT.Rows[0]["Shopid"].ToString();
}
if (skudt != null && skudt.Rows.Count > 0)
{
showmodel.Qty = skudt.Rows[0]["SumQuantity"].ToString();
int discount = Convert.ToInt32(skudt.Rows[0]["discount"].ToString());
//整件总数
int SumCkQuantity = 0;//= Convert.ToInt32(skudt.Rows[0]["SumCkQuantity"].ToString());
//散件总数
int SumQuantity = Convert.ToInt32(skudt.Rows[0]["SumQuantity"].ToString());
int zcount = Convert.ToInt32(skudt.Rows[0]["SumQuantity"].ToString());
if (discount != 1)
{
if (SumQuantity >= discount)
{
SumCkQuantity = SumQuantity / discount;
SumQuantity = SumQuantity % discount;
}
}
showmodel.Qty = SumQuantity.ToString();
showmodel.Wholeqty = SumCkQuantity;
showmodel.Unit = "件";
showmodel.Wholeunit = "箱";
showmodel.Contents = queueDT.Rows[0]["sku"].ToString() + "\r规格 " + discount + " \r总数量" + zcount; ;
}
comBLL.ShowBoxMessage_M(showmodel);//点亮显示标签
#endregion
displayOrder(queueDT, nblock, item.area, model);
}
}
@ -173,8 +125,8 @@ namespace Epost.BLL
List<JobModel> isJobList = jobList.FindAll(p => p.Block == nblock && p.Area == narea && p.State != 3);
ShowMessageModel showmodel = new ShowMessageModel();
//获取当前区任务并加入缓存
if (!isJobList.Any())
{
//if (!isJobList.Any())
//{
model.State = 1;
orderbll.GetOrderList(queueDT.Rows[0]["matchid"].ToString(), nblock, queueDT.Rows[0]["sku"].ToString(), narea, queueDT.Rows[0]["usercode"].ToString());
List<JobModel> nowJoblist = jobList.FindAll(p => p.State == 0 && p.Block == model.Taskblock && p.Area == model.Taskarea);
@ -187,20 +139,20 @@ namespace Epost.BLL
foreach (JobModel item in nowJoblist.ToArray())
{
#region
if (queueDT.Rows[0]["lightcolor"].ToString() == EnumHelper.EMToDescriptionString(LightColor.Color.Blue))
{
//#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);
// 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
//}
//#endregion
// else
//{
@ -260,16 +212,16 @@ namespace Epost.BLL
queueBLL.UpdateQueueOrderState(model);//缓存队列状态修改
}
}
}
else
{
//}
//else
//{
LogHelper.WriteLogInfo("还有未完成任务" + isJobList.Count);
foreach (JobModel item in isJobList)
{
LogHelper.WriteLogInfo("还有未完成任务" + item.Address + item.ID);
}
}
// LogHelper.WriteLogInfo("还有未完成任务" + isJobList.Count);
// foreach (JobModel item in isJobList)
// {
// LogHelper.WriteLogInfo("还有未完成任务" + item.Address + item.ID);
// }
//}
}
#endregion
}

View File

@ -9,6 +9,7 @@ using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using static Epost.DAL.Enum.LightColor;
namespace Epost.BLL
{
@ -154,7 +155,7 @@ namespace Epost.BLL
qmodel.Taskarea = area;
qmodel.Taskblock = block;
List<JobModel> endjoblist = jobList.FindAll(m => m.Block == block && m.Area == area && (m.State == 1 || m.State == 0));
List<JobModel> job = jobList.FindAll(m => m.Block == block && m.Area == area && (m.State == 1 || m.State == 0) && m.Address == data.Address && m.ControlIP == data.IP);
List<JobModel> job = jobList.FindAll(m => m.Block == block && m.Area == area && m.State == 1 && m.Address == data.Address && m.ControlIP == data.IP);
List<JobModel> finjob = jobList.FindAll(m => m.Block == block && m.Area == area && (m.State == 3) && m.Address == data.Address && m.ControlIP == data.IP);
if (finjob.Any())
@ -165,46 +166,26 @@ namespace Epost.BLL
qmodel.Matchid = finmodel.Matchid;
}
DataTable queueDT = queueBLL.getQueueOrderState(qmodel);
if (queueDT != null && queueDT.Rows.Count > 0)
{
skulist = queueDT.Rows[0]["sku"].ToString();
LogHelper.WriteLogInfo("=======" + qmodel.UserCode + "=====" + area + "区===sku=" + skulist);
}
//DataTable queueDT = queueBLL.getQueueOrderState(qmodel);
//if (queueDT != null && queueDT.Rows.Count > 0)
//{
// skulist = queueDT.Rows[0]["sku"].ToString();
// LogHelper.WriteLogInfo("=======" + qmodel.UserCode + "=====" + area + "区===sku=" + skulist);
//}
if (type == "8")// 订单显示器熄灭回显设备
{
LogHelper.WriteLogInfo("显示器拍下");
List<JobModel> rejob = jobList.FindAll(m => m.Block == block && m.Area == area && m.State == 1 && m.Sku == queueDT.Rows[0]["sku"].ToString()&&m.ColorCode=="1");
if (rejob.Any())
{
LogHelper.WriteLogInfo("显示器拍下=="+rejob.Count);
JobModel model = rejob.FirstOrDefault();
comBLL.ClearArea_M(rejob);
//熄灭通道灯
comBLL.DISPLAY_LIGHT_BLOCK(block, area, "0");
// comBLL.UNLOCK_M(rejob);
#region
OrdersQueueModel qumodel = new OrdersQueueModel();
qumodel.State = 3;
qumodel.Taskblock = block;
qumodel.Taskarea = area;
qumodel.Sku = model.Sku;
qumodel.Matchid = model.Matchid;
qumodel.UserCode = model.UserCode;
queueBLL.UpdateQueueTaskArea_Car(qumodel);
#endregion
}
#region sku
JobCache.UpdateJobModelList(rejob, EcommendType.Execute);
#endregion
}
else if (data.Uid == "09" + "-" + data.Address)//完成灯拍下
{
LogHelper.WriteLogInfo(data.Address+"end拍下");
}
else if (data.Result == "4")//■按键拍下
{
data.Parameter = "0";
jobdown_start(data, job, block, area, jobList);
jobdown_start(data, job, block, area, jobList, 2);
}
else
{
@ -220,7 +201,7 @@ namespace Epost.BLL
#region
public void jobdown_start(ResultMessageModel data, List<JobModel> job, string block, string area, List<JobModel> jobList)
public void jobdown_start(ResultMessageModel data, List<JobModel> job, string block, string area, List<JobModel> jobList,int type=1)
{
int truequantity = 0;
int checkquantity = 0;
@ -248,8 +229,9 @@ namespace Epost.BLL
//修改订单状态
orderbll.UpdateOrderState_Car(downlist, model, truequantity, checkquantity);
LogHelper.WriteLogInfo(data.Address + "=========------------------" + data.Parameter);
bool skuInish = orderbll.IsFinishWork(1, block, "", area, model.Sku,"", model.Matchid);
bool skuInish = orderbll.IsSkuFinishWork(model.Sku,model.Matchid);
model.State = 3;
if (skuInish)
{
LogHelper.WriteLogInfo("区SKU拣选完成--------------");
@ -265,17 +247,15 @@ namespace Epost.BLL
{
comBLL.LED_OFF_CLEAR(offList);
}
ShowMessageModel_M show = new ShowMessageModel_M();
show.Title = "分播完成";
show.Contents = "请扫描继续作业";
show.Color = EnumHelper.EMToDescriptionString(LightColor.Color.Green);
show.Type = 8;
show.Block = block;
show.Area = area;
show.Islock = false;
show.IsTwinkle = 1;
comBLL.ShowBoxMessage_M(show);
LabelParamModel lamodel = new LabelParamModel();
lamodel.Address = data.Address;
lamodel.ControlIP = data.IP.ToString();
lamodel.Command = "DISPLAY_JOB";
lamodel.Type = "N";
lamodel.Uid = "09" + "-" + data.Address;
lamodel.Mode =model.ColorCode + "3";
lamodel.Quantity = " end";
comBLL.DISPLAY_JOB(lamodel);
#endregion
#region
@ -288,48 +268,7 @@ namespace Epost.BLL
qumodel.UserCode = model.UserCode;
queueBLL.UpdateQueueTaskArea_Car(qumodel);
#endregion
Thread.Sleep(30);
#region
//bool blockfinish = orderbll.IsFinishWorkByCar(1, model.Matchid, block);
//if (blockfinish)
//{
// #region 点亮显示器
// show.Title = "当前波次分播完成";
// show.Contents = "拍下熄灭所有设备\r请扫描继续作业";
// show.Color = EnumHelper.EMToDescriptionString(LightColor.Color.Green);
// show.Qty = "0";
// show.Type = 8;
// show.Block = block;
// show.Islock = false;
// show.IsTwinkle = 1;
// comBLL.ShowBoxMessage_M(show);
// #endregion
// bool allfinish = orderbll.IsFinishWorkByCar(1, model.Matchid);
// if (allfinish)//判断整个波次是否已完成
// { //更新state状态为已完成
// orderbll.UpdateStateByCar(model.Matchid);
// }
// //删除波次信息
// List<UserCodeModel> ulist = UserCacheDAL.GetUserCodeList().FindAll(m => m.Block == block);
// UserCacheDAL.UpdateUserCodeList(ulist, EUserCommend.Execute);
//}
#endregion
#region sku播完回传
bool skubo = orderbll.IsSkuFinishWork(model.Sku, model.Matchid);
if (skubo)
{
LogHelper.WriteLogInfo(model.Sku + "Sku播种完成" + model.Matchid);
orderbll.UpdateStateByCar(model.Matchid, model.Sku);
}
#endregion
#region sku
JobCache.UpdateJobModelList(offList, EcommendType.Execute);
@ -337,6 +276,21 @@ namespace Epost.BLL
}
bool shopfinish = orderbll.IsFinishWork(1, block, "", area,"", model.ShopID, model.Matchid);
if (shopfinish)
{
LogHelper.WriteLogInfo("门店拣选完成换箱" + model.ShopID);
orderbll.ChangeBox(model, 2);
}
else {
#region
if (type == 2)
{
LogHelper.WriteLogInfo("开始换箱" + model.ShopID);
orderbll.ChangeBox(model);
}
#endregion
}
}

View File

@ -336,17 +336,25 @@ namespace Epost.BLL
{
UserCodeModel umodel = ulist.FirstOrDefault();
umodel.UserCode = scanStr;
#region
ShowMessageModel_M show = new ShowMessageModel_M();
show.Title = "请扫描sku开始作业";
show.Contents = "";
show.Color = EnumHelper.EMToDescriptionString(LightColor.Color.Red);
show.Block = data.Block;
show.Area = data.Area;
show.Type = 8;
show.Islock = true;
comBLL.ShowBoxMessage_M(show);
#endregion
//根据工号查询对应灯色
UserBLL userbll = new UserBLL();
DataTable userdt= userbll.getUserColor(scanStr);
if (userdt != null && userdt.Rows.Count > 0)
{
bool bo= queueBLL.UpdateQueueByUser(scanStr, userdt.Rows[0]["lightcolor"].ToString());
if (!bo)
{
//无待启动的商品
LogHelper.WriteLogInfo("无待启动的商品,请先扫描商品"+scanStr,LogHelper.Log_Type.ERROR);
}
}
else {
//无此工号
LogHelper.WriteLogInfo("扫描工号不存在"+scanStr, LogHelper.Log_Type.ERROR);
}
}
downCacheDAL.UpdateJobDownModelList(new List<ResultMessageModel> { data }, EdownCommend.Execute);
#endregion
@ -402,7 +410,7 @@ namespace Epost.BLL
location = data.Parameter;// sinfodt.Rows[0]["tolocation"].ToString();
}
data.Parameter = scanStr;
DataTable skudt = queueBLL.GetOrderQueue(data.Block, data.Area, "3");
DataTable skudt = queueBLL.GetOrderQueue(data.Block, data.Area, "2");
List<ResultMessageModel> scanlist = downCacheDAL.GetPlanJobDownList().FindAll(m => m.Address == data.Address && m.Parameter == scanStr && m.Parameter != "888888" && m.Block == data.Block && m.Area == data.Area);
if (scanlist.Count > 1 || (skudt != null && skudt.Rows.Count > 0))
@ -432,10 +440,11 @@ namespace Epost.BLL
qmodel.Sku = scanStr;
qmodel.Taskblock = data.Block;
qmodel.Taskarea = data.Area;
qmodel.UserCode = umodel.UserCode;
//qmodel.UserCode = umodel.UserCode;
qmodel.Matchid = umodel.Matchid;
qmodel.Shopid = OrderDt.Rows[0]["GoodsName"].ToString();
qmodel.Location = location;
qmodel.State = 2;
qmodel.Lightcolor = EnumHelper.EMToDescriptionString(LightColor.Color.Red);
queueBLL.insertQueueOrders(qmodel);

View File

@ -578,23 +578,27 @@ namespace Epost.DAL
sendModel.Address = model.Address;
sendModel.Command = model.Command;
sendModel.Parameter = model.Parameter;
sendModel.Type = model.Type;
sendModel.Uid = model.Uid;
sendModel.Quantity = model.Quantity;
sendModel.Timeout = model.Timeout;
sendModel.Mode = model.Mode;
try
{
string postStr = JsonHelper.SerializeObject(sendModel);
result = http.HttpPost_Old(ControlIP, postStr);
resultModel = JsonHelper.DeserializeObject<ResultsModel>(result);
LogHelper.WriteLogInfo("---------------------------------------" + ControlIP+"-----------"+ postStr);
LogHelper.WriteLogInfo("---------------------------------------" + ControlIP + "-----------" + postStr);
if (!resultModel.Status.Equals("OK"))
{
LogHelper.WriteLogInfo("发送指令失败-发送指令:" + postStr);
LogHelper.WriteLogInfo("发送指令失败-返回信息:" + result);
LogHelper.WriteLogInfo("发送指令失败-发送指令:" + postStr, Log_Type.ERROR);
LogHelper.WriteLogInfo("发送指令失败-返回信息:" + result, Log_Type.ERROR);
}
}
catch (Exception e)
{
LogHelper.WriteLogInfo("发送指令异常:" + e.Message);
LogHelper.WriteLogInfo("发送指令异常:" + e.Message, Log_Type.ERROR);
// throw;
}
if (resultModel != null && resultModel.Status.Equals("OK"))

View File

@ -131,6 +131,7 @@
<Compile Include="OrcaleDB.cs" />
<Compile Include="OrdersDAL.cs" />
<Compile Include="PressureTestDAL.cs" />
<Compile Include="Print_BoxDAL.cs" />
<Compile Include="Properties\Class1.cs" />
<Compile Include="ControlDAL.cs" />
<Compile Include="LabelDAL.cs" />

View File

@ -36,7 +36,7 @@ namespace Epost.DAL
#region
public DataTable GetOrderList_Car(string matchid, string sku, string area, string block)
public DataTable GetOrderList_Car(string matchid, string sku, string area, string block,string usercode)
{
try
{
@ -45,10 +45,15 @@ namespace Epost.DAL
{
strwhere = "and matchid= '" + matchid + "'";
}
if (!string.IsNullOrEmpty(usercode))
{
strwhere += "and info= '" + usercode + "'";
}
string sql = string.Empty;
if (!string.IsNullOrEmpty(area))
{
sql = string.Format("select id, Matchid, orderid, barcode, BatchId, DownDate, Tolocation, Sku, GoodsName, Discount, Quantity, corlorcode, address, ControlIP,area, block,boxcode,isnull(checkquantity,0) as checkquantity,wholeunit,unit,shopid,wmsboxcode,shopname from v_orders where state = 0 and oprationstate <>3 and sku = '{0}' and block = '{1}' and area='{2}' " + strwhere + " order by layer,slist ",
sql = string.Format("select id, Matchid, orderid, barcode, BatchId, DownDate, Tolocation, Sku, GoodsName, Discount, Quantity, corlorcode, address, ControlIP,area, block,boxcode,isnull(checkquantity,0) as checkquantity,wholeunit,unit,shopid,wmsboxcode,shopname from v_orders where state = 0 and oprationstate <>3 and sku = '{0}' and block = '{1}' and area='{2}' " + strwhere + " order by layer,slist ",
sku,
block, area);
@ -1068,17 +1073,17 @@ namespace Epost.DAL
}
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;
}
else
{
LogHelper.WriteLogInfo("判断订单状态为已完成false");
LogHelper.WriteLogInfo("判断当前门店是否为已完成false");
return false;
}
}
@ -2539,6 +2544,46 @@ namespace Epost.DAL
}
#endregion
#region
public bool ChangeBox(string shopid, string boxcode,int boxno,int totalcount)
{
string upstr = string.Empty;
if (totalcount != 0)
{
upstr = ",totalcount='"+totalcount+"'";
}
string sql = string.Format("update orders set boxcode='{0}',state =3 where shopid = '{1}' and oprationstate=3 and (boxcode is null or boxcode='') ",
boxcode, shopid);
long x = db.UpdateSql(sql);
LogHelper.WriteLogInfo(x+"换箱" +sql);
if (x > 0)
{
string newsql = string.Format("update orders set boxno='{0}'" + upstr + " where shopid = '{1}' ",
boxno, shopid);
long l = db.UpdateSql(newsql);
LogHelper.WriteLogInfo(l + "更新箱数" + newsql);
return true;
}
else { return false; }
}
#endregion
#region
public int GetStoreInfo(string shopid)
{
string sql = string.Format("select top 1 isnull(max(boxno),0) as boxno from orders where shopid = '{0}' and state = 0 ",
shopid);
DataTable dt= db.GetsqlForDT(sql);
if (dt != null && dt.Rows.Count > 0)
{
return Convert.ToInt32(dt.Rows[0]["boxno"].ToString()) ;
}
else { return 0; }
}
#endregion
}
}

View File

@ -89,7 +89,7 @@ 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 sql = string.Format("select * from OrdersQueue where taskblock='{0}' and taskarea='{1}' and state=0 order by sort",
model.Taskblock,
model.Taskarea);
return db.GetsqlForDT(sql);
@ -213,7 +213,7 @@ namespace Epost.DAL
#region sku是否正在作业
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}'",
string sql = string.Format("select * from OrdersQueue where state ='{0}' and taskblock='{1}' and taskarea='{2}'",
state,
block,area);
LogHelper.WriteLogInfo("获取sku是否正在作业" + sql);
@ -408,5 +408,18 @@ namespace Epost.DAL
}
#endregion
#region
public bool UpdateQueueByUser(string usercode,string color)
{
string sql = string.Format("update OrdersQueue set state = 0,usercode ='{0}',lightcolor='{1}' where state=2 ",
usercode,color);
long x= db.UpdateSql(sql);
if (x > 0)
return true;
return false;
}
#endregion
}
}

76
Epost.DAL/Print_BoxDAL.cs Normal file
View File

@ -0,0 +1,76 @@
using Epost.Common;
using Epost.Model;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Epost.DAL
{
public class Print_BoxDAL
{
DataBaseOpration.OprationSqlDAL db = DB_DLL.GetInstance();
#region
public DataTable GetPrintList(string block)
{
try
{
string strwhere = string.Empty;
if (!string.IsNullOrEmpty(block))
{
strwhere = strwhere + " and block='" + block + "'";
}
string sql = string.Format("select id, orderid, city , fdate , boxcode, shopname, shopid, orderway, boxno,isnull(totalcount,0) as totalcount , warehouseid, state,block,printstate,senddate,loc from print_box where state=0 " + strwhere + " order by id");
return db.GetsqlForDT(sql);
}
catch (Exception ex)
{
LogHelper.WriteLogInfo("Box获取打印列表异常" + ex.Message, LogHelper.Log_Type.ERROR);
return null;
}
}
#endregion
#region
public bool UpPrintList(string id)
{
try
{
string sql = string.Format("update print_box set state=1 where id='{0}'",
id);
long x = db.UpdateSql(sql);
if (x > 0)
return true;
return false;
}
catch (Exception ex)
{
LogHelper.WriteLogInfo("Box修改打印状态异常" + ex.Message, LogHelper.Log_Type.ERROR);
return false;
}
}
#endregion
#region
public bool InsertPrint(JobModel model, int boxno, int totalcount)
{
try
{
string sql = string.Format("insert into print_box(orderid ,city,fdate,boxcode,shopname,shopid,orderway,boxno,warehouseid,state,block,senddate,totalcount,matchid,loc) values('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}','{8}','{9}','{10}','{11}','{12}','{13}','{14}') ",
model.OrderID, model.ProdArea,DateTime.Now.ToString(), model.BoxCode, model.Shopname, model.ShopID, model.Orderway, boxno, "", "0", "", "", totalcount, model.Matchid, "");
long x = db.UpdateSql(sql);
if (x > 0)
return true;
return false;
}
catch (Exception ex)
{
LogHelper.WriteLogInfo("Box修改打印状态异常" + ex.Message, LogHelper.Log_Type.ERROR);
return false;
}
}
#endregion
}
}

View File

@ -48,6 +48,8 @@ namespace Epost.Model
private string _Unit = string.Empty;//小单位
private string _UserCode = string.Empty;//工号
private string _no = string.Empty;//任务序号
private string _shopname = string.Empty;
private string _orderway = string.Empty;
public string BatchId
{
get
@ -389,6 +391,8 @@ 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 Shopname { get => _shopname; set => _shopname = value; }
public string Orderway { get => _orderway; set => _orderway = value; }
}
}

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<UseIISExpress>true</UseIISExpress>
@ -11,7 +11,7 @@
<WebStackScaffolding_IsAsyncSelected>False</WebStackScaffolding_IsAsyncSelected>
<WebStackScaffolding_ViewDialogWidth>600</WebStackScaffolding_ViewDialogWidth>
<NameOfLastUsedPublishProfile>E:\WORK\代码管理\T系列\播种\Epost.TestToolsWeb\Properties\PublishProfiles\Toolsweb.pubxml</NameOfLastUsedPublishProfile>
<LastActiveSolutionConfig>Debug|Any CPU</LastActiveSolutionConfig>
<LastActiveSolutionConfig>Release|Any CPU</LastActiveSolutionConfig>
<Use64BitIISExpress />
<IISExpressSSLPort />
<IISExpressAnonymousAuthentication />

View File

@ -11,7 +11,7 @@
<SiteUrlToLaunchAfterPublish />
<LaunchSiteAfterPublish>true</LaunchSiteAfterPublish>
<ExcludeApp_Data>false</ExcludeApp_Data>
<publishUrl>D:\驿传\Wuxidingshi_DAS</publishUrl>
<publishUrl>D:\驿传\GuangzhouHuiFeng_DAS</publishUrl>
<DeleteExistingFiles>true</DeleteExistingFiles>
<PrecompileBeforePublish>true</PrecompileBeforePublish>
<EnableUpdateable>true</EnableUpdateable>

View File

@ -6,8 +6,8 @@
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<TimeStampOfAssociatedLegacyPublishXmlFile />
<_PublishTargetUrl>D:\驿传\Wuxidingshi_DAS</_PublishTargetUrl>
<History>True|2025-01-16T07:37:40.8814043Z;True|2024-12-19T15:11:44.2536385+08:00;True|2024-12-10T19:10:26.6514077+08:00;True|2024-12-10T18:30:34.7211512+08:00;True|2024-12-09T14:06:46.4112259+08:00;True|2024-12-03T14:23:26.2134334+08:00;True|2024-11-27T18:53:48.7373661+08:00;True|2024-11-27T14:27:33.0840789+08:00;True|2024-11-27T14:08:15.6442660+08:00;True|2024-11-27T12:10:03.9412549+08:00;True|2024-11-27T11:45:31.3775097+08:00;True|2024-11-27T11:32:00.8297320+08:00;True|2024-11-23T20:50:04.5476409+08:00;False|2024-11-04T17:48:25.2781696+08:00;True|2024-11-01T16:04:56.3535724+08:00;True|2024-09-01T10:13:37.1598955+08:00;True|2024-08-31T17:27:57.5375469+08:00;True|2022-07-15T16:41:13.9750291+08:00;True|2022-07-14T14:02:20.7983427+08:00;True|2022-07-13T17:40:22.7531000+08:00;True|2022-07-13T17:34:22.9908701+08:00;True|2022-07-13T17:30:06.3588502+08:00;True|2022-07-11T10:32:06.9053981+08:00;True|2021-04-26T10:07:37.4889549+08:00;True|2021-04-09T10:32:51.9130162+08:00;True|2021-04-09T10:31:50.4974012+08:00;</History>
<_PublishTargetUrl>D:\驿传\GuangzhouHuiFeng_DAS</_PublishTargetUrl>
<History>True|2025-06-04T07:01:49.8008687Z||;True|2025-01-16T15:37:40.8814043+08:00||;True|2024-12-19T15:11:44.2536385+08:00||;True|2024-12-10T19:10:26.6514077+08:00||;True|2024-12-10T18:30:34.7211512+08:00||;True|2024-12-09T14:06:46.4112259+08:00||;True|2024-12-03T14:23:26.2134334+08:00||;True|2024-11-27T18:53:48.7373661+08:00||;True|2024-11-27T14:27:33.0840789+08:00||;True|2024-11-27T14:08:15.6442660+08:00||;True|2024-11-27T12:10:03.9412549+08:00||;True|2024-11-27T11:45:31.3775097+08:00||;True|2024-11-27T11:32:00.8297320+08:00||;True|2024-11-23T20:50:04.5476409+08:00||;False|2024-11-04T17:48:25.2781696+08:00||;True|2024-11-01T16:04:56.3535724+08:00||;True|2024-09-01T10:13:37.1598955+08:00||;True|2024-08-31T17:27:57.5375469+08:00||;True|2022-07-15T16:41:13.9750291+08:00||;True|2022-07-14T14:02:20.7983427+08:00||;True|2022-07-13T17:40:22.7531000+08:00||;True|2022-07-13T17:34:22.9908701+08:00||;True|2022-07-13T17:30:06.3588502+08:00||;True|2022-07-11T10:32:06.9053981+08:00||;True|2021-04-26T10:07:37.4889549+08:00||;True|2021-04-09T10:32:51.9130162+08:00||;True|2021-04-09T10:31:50.4974012+08:00||;</History>
<LastFailureDetails />
</PropertyGroup>
<ItemGroup>
@ -33,19 +33,19 @@
<publishTime>04/04/2018 15:45:12</publishTime>
</File>
<File Include="bin/App_global.asax.compiled">
<publishTime>01/16/2025 15:49:24</publishTime>
<publishTime>06/05/2025 15:04:03</publishTime>
</File>
<File Include="bin/App_global.asax.dll">
<publishTime>01/16/2025 15:49:24</publishTime>
<publishTime>06/05/2025 15:04:03</publishTime>
</File>
<File Include="bin/BouncyCastle.Crypto.dll">
<publishTime>02/24/2020 15:29:24</publishTime>
</File>
<File Include="bin/Common.dll">
<publishTime>01/16/2025 15:37:17</publishTime>
<publishTime>06/04/2025 18:11:41</publishTime>
</File>
<File Include="bin/Common.pdb">
<publishTime>01/16/2025 15:37:17</publishTime>
<publishTime>06/04/2025 18:11:41</publishTime>
</File>
<File Include="bin/ComposerSDK.dll">
<publishTime>04/29/2020 16:50:14</publishTime>
@ -63,31 +63,31 @@
<publishTime>10/23/2017 13:15:20</publishTime>
</File>
<File Include="bin/Epost.BLL.dll">
<publishTime>01/16/2025 15:37:18</publishTime>
<publishTime>06/05/2025 15:03:46</publishTime>
</File>
<File Include="bin/Epost.BLL.pdb">
<publishTime>01/16/2025 15:37:18</publishTime>
<publishTime>06/05/2025 15:03:46</publishTime>
</File>
<File Include="bin/Epost.BLL.XmlSerializers.dll">
<publishTime>08/26/2020 18:09:48</publishTime>
</File>
<File Include="bin/Epost.DAL.dll">
<publishTime>01/16/2025 15:37:17</publishTime>
<publishTime>06/05/2025 15:03:45</publishTime>
</File>
<File Include="bin/Epost.DAL.pdb">
<publishTime>01/16/2025 15:37:17</publishTime>
<publishTime>06/05/2025 15:03:45</publishTime>
</File>
<File Include="bin/Epost.DPS.dll">
<publishTime>01/16/2025 15:37:21</publishTime>
<publishTime>06/05/2025 15:03:50</publishTime>
</File>
<File Include="bin/Epost.DPS.pdb">
<publishTime>01/16/2025 15:37:21</publishTime>
<publishTime>06/05/2025 15:03:50</publishTime>
</File>
<File Include="bin/Epost.Model.dll">
<publishTime>01/16/2025 15:37:16</publishTime>
<publishTime>06/04/2025 18:11:40</publishTime>
</File>
<File Include="bin/Epost.Model.pdb">
<publishTime>01/16/2025 15:37:16</publishTime>
<publishTime>06/04/2025 18:11:40</publishTime>
</File>
<File Include="bin/Epost.TestToolsWeb.dll">
<publishTime>09/06/2018 11:57:11</publishTime>
@ -5652,7 +5652,7 @@
<publishTime>05/30/2022 16:58:47</publishTime>
</File>
<File Include="PrecompiledApp.config">
<publishTime>01/16/2025 15:49:18</publishTime>
<publishTime>06/05/2025 15:03:52</publishTime>
</File>
<File Include="Scripts/ai.0.22.9-build00167.js">
<publishTime>04/04/2018 15:45:12</publishTime>
@ -7572,7 +7572,7 @@
<publishTime>07/04/2022 14:22:38</publishTime>
</File>
<File Include="Web.config">
<publishTime>01/16/2025 15:37:22</publishTime>
<publishTime>06/04/2025 15:01:24</publishTime>
</File>
</ItemGroup>
</Project>

View File

@ -11,7 +11,7 @@
</configSections>
<connectionStrings>
<add name="weijie_dpsEntities" connectionString="metadata=res://*/WJDB.csdl|res://*/WJDB.ssdl|res://*/WJDB.msl;provider=System.Data.SqlClient;provider connection string=&quot;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&quot;" providerName="System.Data.EntityClient" />
<add name="SqlLocDPSConnection" connectionString="server=139.196.36.200;user id=EpostTest;password=antion;database=WuXi_DingShi_DAS;min pool size=512;max pool size=512;packet size=3072" providerName="System.Data.SqlClient" />
<add name="SqlLocDPSConnection" connectionString="server=DESKTOP-IC0279A\SQLEXPRESS;user id=sa;password=epost123;database=GuangZhouHuiFeng_DAS;min pool size=512;max pool size=512;packet size=3072" providerName="System.Data.SqlClient" />
<add name="MysqlLocDPSConnection" connectionString="Server=localhost;Port=3306;Database=world;User=root; Password=antion;SslMode=None;Pooling=true;Allow User Variables=True;" />
<add name="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" />
@ -27,11 +27,11 @@
<add key="ControlXML" value="/App_Data/EpostController.xml" />
<add key="LabelXML" value="/App_Data/AddressStorage.xml" />
<add key="ResultsXML" value="/App_Data/Results.xml" />
<add key="WebAPIUrl" value="http://192.168.0.20:8045/api/WebAPI/ProcessingResult"/>
<add key="WebAPIUrl" value="http://192.168.0.20:8033/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.0.20:8045/api/WebAPI" />
<add key="SleepTime" value="1" />
</appSettings>
<!--