This commit is contained in:
jl
2025-06-23 18:50:32 +08:00
parent f7a87c41ff
commit 81ef9284b7
6 changed files with 117 additions and 90 deletions

View File

@ -30,61 +30,63 @@ namespace Epost.BLL
public ResultModel Initialization_T(bool isback = true)
{
ResultModel resultModel = new ResultModel();
List<LabelParamModel> list = new List<LabelParamModel>();
try
{
DataTable dt = addrBLL.getControlList();
bool result = false;
if (dt != null && dt.Rows.Count > 0)
{
foreach (DataRow item in dt.Rows)
{
LabelParamModel model = new LabelParamModel();
model.ControlIP = item["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 = item["ControlIP"].ToString();
model.Address = "9999";
model.Command = "CONNECT";
model.Parameter = IP;
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);
model = new LabelParamModel();
model.ControlIP = item["ControlIP"].ToString();
model.Address = "9999";
model.Command = "LED_OFF";
model.Timeout = "0.5";
list.Add(model);
//List<LabelParamModel> list = new List<LabelParamModel>();
//try
//{
// DataTable dt = addrBLL.getControlList();
// bool result = false;
// if (dt != null && dt.Rows.Count > 0)
// {
// foreach (DataRow item in dt.Rows)
// {
// LabelParamModel model = new LabelParamModel();
// model.ControlIP = item["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 = item["ControlIP"].ToString();
// model.Address = "9999";
// model.Command = "CONNECT";
// model.Parameter = IP;
// 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);
// model = new LabelParamModel();
// model.ControlIP = item["ControlIP"].ToString();
// model.Address = "9999";
// model.Command = "LED_OFF";
// model.Timeout = "0.5";
// list.Add(model);
}
if (list.Any())
{
resultModel = SendALL_Init(list);
}
// }
// if (list.Any())
// {
// resultModel = SendALL_Init(list);
// }
}
return resultModel;
// }
// return resultModel;
}
catch (Exception ex)
{
//}
//catch (Exception ex)
//{
resultModel.result = "0";
resultModel.msg = "初始化失败!";
LogHelper.WriteLogInfo("初始化异常:" + ex.Message);
// resultModel.result = "0";
// resultModel.msg = "初始化失败!";
// LogHelper.WriteLogInfo("初始化异常:" + ex.Message);
}
//}
resultModel.result = "0";
resultModel.msg = "成功";
return resultModel;
}
#endregion

View File

@ -96,6 +96,19 @@ namespace Epost.BLL
logBLL.InsertErrorLog(error_model);
}
public void SaveShowMesError(string Title, string Remark, string type = "999")
{
ErrorLogBLL logBLL = new ErrorLogBLL();
ErrorLogModel error_model = new ErrorLogModel();
error_model.Type = type;
error_model.Title = Title;
error_model.Remark = Remark;
logBLL.InsertErrorLog(error_model);
}
}
}

View File

@ -28,6 +28,7 @@ namespace Epost.BLL
WorkIngCacheDAL workbll = new WorkIngCacheDAL();
SkuInfoBLL skuBLL = new SkuInfoBLL();
UserModelCacheDAL UserCacheDAL = new UserModelCacheDAL();
ErrorLogBLL logBLL = new ErrorLogBLL();
public void ScanList()
{
GetScanList(tblock);
@ -142,15 +143,19 @@ namespace Epost.BLL
{
//手动加波次信息
DataTable matdt = orderbll.GetMatchOrderList();
if (matdt != null && matdt.Rows.Count > 0)
{
UserCodeModel umodel = new UserCodeModel();
umodel.Matchid = matdt.Rows[0]["matchid"].ToString();
umodel.Block = sblock;
umodel.Area = sarea;
UserCacheDAL.UpdateUserCodeList(new List<UserCodeModel> { umodel }, EUserCommend.Create);
}
if (matdt != null && matdt.Rows.Count > 0)
{
UserCodeModel umodel = new UserCodeModel();
umodel.Matchid = matdt.Rows[0]["matchid"].ToString();
umodel.Block = sblock;
umodel.Area = sarea;
UserCacheDAL.UpdateUserCodeList(new List<UserCodeModel> { umodel }, EUserCommend.Create);
}
else {
logBLL.SaveShowMesError("无待拣选的波次", "无待拣选的波次");
}
}
ulist = UserCacheDAL.GetUserCodeList().FindAll(m => m.Block == sblock && m.Area == sarea);
if (ulist.Any())
{ matchid = ulist.FirstOrDefault().Matchid; }
@ -346,11 +351,13 @@ namespace Epost.BLL
{
//无待启动的商品
LogHelper.WriteLogInfo("无待启动的商品,请先扫描商品"+scanStr,LogHelper.Log_Type.ERROR);
logBLL.SaveShowMesError("无待启动的商品,请先扫描商品", "无待启动的商品,请先扫描商品");
}
}
else {
//无此工号
LogHelper.WriteLogInfo("扫描工号不存在"+scanStr, LogHelper.Log_Type.ERROR);
logBLL.SaveShowMesError("扫描工号不存在" , "扫描工号不存在" + scanStr);
}
@ -453,6 +460,8 @@ namespace Epost.BLL
else
{
LogHelper.WriteLogInfo("未扫描波次信息", LogHelper.Log_Type.ERROR);
logBLL.SaveShowMesError("无波次信息!", "无波次信息");
}
}
@ -484,6 +493,7 @@ namespace Epost.BLL
else
{
LogHelper.WriteLogInfo("未扫描波次信息", LogHelper.Log_Type.ERROR);
logBLL.SaveShowMesError("无波次信息!", "无波次信息");
}
}
@ -491,16 +501,18 @@ namespace Epost.BLL
{
//提示无任务
ShowMessageModel_M show = new ShowMessageModel_M();
show.Title = "商品:" + scanStr + "无任务!";
show.Color = EnumHelper.EMToDescriptionString(LightColor.Color.Red);
show.Block = data.Block;
show.Area = data.Area;
show.Type = 8;
show.Islock = false;
comBLL.ShowBoxMessage_M(show);
downCacheDAL.UpdateJobDownModelList(new List<ResultMessageModel> { data }, EdownCommend.Execute);
}
//ShowMessageModel_M show = new ShowMessageModel_M();
//show.Title = "商品:" + scanStr + "无任务!";
//show.Color = EnumHelper.EMToDescriptionString(LightColor.Color.Red);
//show.Block = data.Block;
//show.Area = data.Area;
//show.Type = 8;
//show.Islock = false;
//comBLL.ShowBoxMessage_M(show);
//downCacheDAL.UpdateJobDownModelList(new List<ResultMessageModel> { data }, EdownCommend.Execute);
logBLL.SaveShowMesError("商品:" + scanStr + "无任务!", "商品:" + scanStr + "无任务!");
}
#endregion
}