using System;
|
using System.Collections;
|
using System.Collections.Generic;
|
using System.Data;
|
using System.Data.SqlTypes;
|
using System.Linq;
|
using System.Text;
|
using System.Threading.Tasks;
|
using Commom.Utility;
|
using Common;
|
//using Microsoft.Build.Utilities;
|
using Model;
|
using Model.WcsModel;
|
using Newtonsoft.Json;
|
using NLog;
|
using NPOI.SS.Formula.Functions;
|
using NPOI.SS.UserModel;
|
using static NPOI.HSSF.Util.HSSFColor;
|
|
namespace BLL.DAL
|
{
|
public class DAL_TaskMonitor
|
{
|
/// <summary>
|
/// 获取任务控制信息
|
/// </summary>
|
/// <param name="Json"></param>
|
/// <param name="pageInfo"></param>
|
/// <returns></returns>
|
public IList<WCSTasks> GetList(AjaxGetTaskList Json, ref PageInfo pageInfo)
|
{
|
try
|
{
|
StringBuilder strSql = new StringBuilder();
|
List<SqlParam> para = new List<SqlParam>();
|
|
// 0 未下发 1 已下发 2 ? 3已完成
|
strSql.Append("select Id,TaskNo,CASE Type when '0' then '入库' when '1' then '出库' when '2' then '移库' else Type end as Type,");
|
strSql.Append("Status,IsSuccess,Information,Origin,SyncWms,StartLocat,EndLocat as EndLocate,PalletNo,TopTime,CancelDate,Levels,FinishDate,CreateTime,Demo ");
|
strSql.Append(" from WCSTasks where IsDel = '0' ");
|
|
|
if (!string.IsNullOrWhiteSpace(Json.TaskNo))
|
{
|
strSql.Append(" and TaskNo like '%" + Json.TaskNo + "%' ");
|
}
|
if (!string.IsNullOrWhiteSpace(Json.TaskType))
|
{
|
strSql.Append(" and Type = '" + Json.TaskType + "' ");
|
}
|
if (!string.IsNullOrWhiteSpace(Json.Origin))
|
{
|
strSql.Append(" and Origin = '" + Json.Origin + "' ");
|
}
|
if (!string.IsNullOrWhiteSpace(Json.SyncWms))
|
{
|
strSql.Append(" and SyncWms = '" + Json.SyncWms + "' ");
|
}
|
if (!string.IsNullOrWhiteSpace(Json.Status))
|
{
|
strSql.Append(" and Status = '" + Json.Status + "' ");
|
}
|
if (!string.IsNullOrWhiteSpace(Json.StartLocat))
|
{
|
strSql.Append(" and StartLocat like '%" + Json.StartLocat + "%' ");
|
}
|
if (!string.IsNullOrWhiteSpace(Json.PalletNo))
|
{
|
strSql.Append(" and PalletNo like '%" + Json.PalletNo + "%' ");
|
}
|
if (!string.IsNullOrWhiteSpace(Json.EndLocat))
|
{
|
strSql.Append(" and EndLocat like '%" + Json.EndLocat + "%' ");
|
}
|
//strSql.Append(" order by Levels,Status ");
|
|
SqlParam[] param = null;
|
if (para != null)
|
{
|
param = para.ToArray();
|
}
|
|
DataTable dt = DataFactory.SqlDataBase().GetPageList(strSql.ToString(), param, "Levels,TopTime desc,StartLocat asc,ISNULL(FinishDate,GETDATE())", "desc", ref pageInfo);
|
return ModelConvertHelper<WCSTasks>.DataTableToModel(dt);
|
}
|
catch
|
{
|
throw new NotImplementedException();
|
}
|
}
|
|
/// <summary>
|
/// 获取任务控制信息明细
|
/// </summary>
|
/// <param name="Json"></param>
|
/// <param name="pageInfo"></param>
|
/// <returns></returns>
|
public IList<WCSTasksMonitor> GetDetailList(AjaxGetTaskDetailList Json, ref PageInfo pageInfo)
|
{
|
try
|
{
|
StringBuilder strSql = new StringBuilder();
|
List<SqlParam> para = new List<SqlParam>();
|
|
//
|
strSql.Append("select Id,TaskNo,PlcId,PlcName,StartLocat,EndLocat,InteractiveMsg,ErrorMsg,IsDel,CreateTime,CreateUser,UpdateTime,UpdateUser from WCSTasksMonitor where IsDel = '0' ");
|
if (!string.IsNullOrWhiteSpace(Json.TaskNo))
|
{
|
strSql.Append(" and TaskNo = '" + Json.TaskNo + "' ");
|
}
|
DataTable dt = DataFactory.SqlDataBase().GetPageList(strSql.ToString(), null, "CreateTime", "desc", ref pageInfo);
|
return ModelConvertHelper<WCSTasksMonitor>.DataTableToModel(dt);
|
}
|
catch
|
{
|
throw new NotImplementedException();
|
}
|
}
|
|
|
/// <summary>
|
/// 手动添加任务 liudl Del 20231026
|
/// </summary>
|
/// <param name="model"></param>
|
/// <param name="loginUser"></param>
|
/// <returns></returns>
|
public bool Add(TaskMonitorModel model, string loginUser)
|
{
|
bool result = false;
|
try
|
{
|
Hashtable ht = new Hashtable();
|
|
ht["TaskType"] = model.TaskType.AddQuotes();
|
ht["InitialAddre"] = "'" + model.InitialAddre + "'";
|
ht["Palno"] = "'" + model.Palno + "'";
|
ht["TargetAddre"] = "'" + model.TargetAddre + "'";
|
ht["State"] = "'0'";
|
ht["IsSucceed"] = "'" + model.IsSucceed + "'";
|
ht["ErrorStr"] = "'" + model.ErrorStr + "'";
|
ht["PriorityLevel"] = model.PriorityLevel;
|
ht["Source"] = "'手动'";
|
ht["Demo"] = "'" + model.Demo + "'";
|
ht["Levels"] = "'0'";
|
|
ht["CreateUser"] = "'" + loginUser + "'";
|
ht["CreateTime"] = "Getdate()";
|
|
|
int _ret = DataFactory.SqlDataBase().InsertByHashtableNullParam("TaskMonitor", ht);
|
|
if (_ret == 1) result = true;
|
|
return result;
|
|
}
|
catch
|
{
|
return result;
|
}
|
}
|
|
/// <summary>
|
/// 手动添加任务
|
/// </summary>
|
/// <param name="models"></param>
|
/// <param name="loginName">登录人</param>
|
/// <returns></returns>
|
public bool AddTask(WCSTasks models, string loginName)
|
{
|
bool result = false;
|
int upt = 0;
|
try
|
{
|
StringBuilder sqlString = new StringBuilder();
|
DALWcsMessage wcsEdit = new DALWcsMessage();
|
|
sqlString.Clear();
|
// 验证任务是否已存在
|
sqlString.Append($"select count(Id) from WCSTasks where PalletNo = '{models.PalletNo}' adn (Status = '0' or Status = '1') ;");
|
DataTable dt = DataFactory.SqlDataBase().GetDataTableBySQL(sqlString);
|
if (dt != null)
|
{
|
if (dt.Rows[0][0].ToString() != "0")
|
{
|
throw new Exception("等待或正在执行任务中托盘号:" + models.PalletNo + ";已存在!");
|
}
|
}
|
|
models.TaskNo = GetTaskNo();
|
string strry = "";
|
if (models.Type == "0" || models.Type == "2")//0入 1出 2移
|
{
|
sqlString.Clear();
|
//验证目标位置是否可用
|
sqlString.Append($"select * from WCSStorageLocat where IsDel = '0' and LocatNo = '{models.EndLocate}' and Status = '0'");
|
dt = DataFactory.SqlDataBase().GetDataTableBySQL(sqlString);
|
if (dt == null || dt.Rows.Count == 0)
|
{
|
throw new Exception("目标位置不是空储位 不可入库或移库");
|
}
|
|
models.Levels = "1.5";
|
|
#region 目标巷道
|
|
var str = int.Parse(models.EndLocate.Substring(0, 2));
|
if (str == 1 || str == 2)
|
{
|
models.EndRoadway = "R01";
|
}
|
else if (str == 3 || str == 4)
|
{
|
models.EndRoadway = "R02";
|
}
|
else if (str == 5 || str == 6)
|
{
|
models.EndRoadway = "R03";
|
}
|
else if (str == 7 || str == 8)
|
{
|
models.EndRoadway = "R04";
|
}
|
else if (str == 9 || str == 10)
|
{
|
models.EndRoadway = "R05";
|
}
|
else if (str == 11 || str == 12)
|
{
|
models.EndRoadway = "R06";
|
}
|
else if (str == 13 || str == 14)
|
{
|
models.EndRoadway = "R07";
|
}
|
|
#endregion
|
}
|
if (models.Type == "1" || models.Type == "2")
|
{
|
sqlString.Clear();
|
//验证起始位置是否可用
|
sqlString.Append($"select * from WCSStorageLocat where IsDel = '0' and LocatNo = '{models.StartLocate}' and Status = '1'");
|
dt = DataFactory.SqlDataBase().GetDataTableBySQL(sqlString);
|
if (dt == null || dt.Rows.Count == 0)
|
{
|
throw new Exception("起始位置不是有物品 不可出库或移库");
|
}
|
|
models.Levels = "2";
|
|
#region 起始巷道
|
|
var str = int.Parse(models.StartLocate.Substring(0, 2));
|
if (str == 1 || str == 2)
|
{
|
models.StartRoadway = "R01";
|
}
|
else if (str == 3 || str == 4)
|
{
|
models.StartRoadway = "R02";
|
}
|
else if (str == 5 || str == 6)
|
{
|
models.StartRoadway = "R03";
|
}
|
else if (str == 7 || str == 8)
|
{
|
models.StartRoadway = "R04";
|
}
|
else if (str == 9 || str == 10)
|
{
|
models.StartRoadway = "R05";
|
}
|
else if (str == 11 || str == 12)
|
{
|
models.StartRoadway = "R06";
|
}
|
else if (str == 13 || str == 14)
|
{
|
models.StartRoadway = "R07";
|
}
|
|
#endregion
|
}
|
|
if (models.Type == "0" || models.Type == "2")
|
{
|
//验证目标储位是否为空
|
if (!string.IsNullOrEmpty(models.EndLocate))
|
{
|
strry = IsLocatTrue(models.Type, models.EndLocate, "目标位置", loginName);
|
}
|
}
|
if (models.Type == "1" || models.Type == "2")
|
{
|
//验证起始储位是否为空
|
if (!string.IsNullOrEmpty(models.StartLocat))
|
{
|
strry = IsLocatTrue(models.Type, models.StartLocat, "起始位置", loginName);
|
}
|
}
|
|
if (!string.IsNullOrEmpty(strry))
|
{
|
throw new Exception(strry);
|
}
|
|
//修改储位状态
|
switch (models.Type)
|
{
|
case "0": //入库
|
wcsEdit.EditLocaetStatus("0", "0", "", models.EndLocate);
|
break;
|
case "1": //出库
|
wcsEdit.EditLocaetStatus("1", "0", models.StartLocat, "");
|
break;
|
case "2": //移库
|
wcsEdit.EditLocaetStatus("2", "0", models.StartLocat, models.EndLocate);
|
break;
|
default:
|
break;
|
}
|
|
WcsBoxInfo box = new WcsBoxInfo();
|
if (models.Type == "0")
|
{
|
//获取对应箱码信息
|
sqlString.Clear();
|
sqlString.Append($"select top 1 * from WCSBoxInfo where IsDel = '0' and PalletNo = '{models.PalletNo}' order by Id desc");
|
DataTable boxtable = DataFactory.SqlDataBase().GetDataTableBySQL(sqlString);
|
if (boxtable.Rows.Count > 0)
|
{
|
box = (WcsBoxInfo)DataTableHelper.DataTableToIList<BoxInfo>(boxtable); //转换集合
|
}
|
}
|
|
// 新增任务
|
sqlString.Clear();
|
sqlString.Append("INSERT INTO WCSTasks (TaskNo,Type,Status,Origin,StartRoadway,StartLocat,EndLocat,EndRoadway,PalletNo,");
|
sqlString.Append("LotNo,SupplierLot,SkuNo,SkuName,Qty,IsSuccess,SyncWms,Demo,Levels,CreateUser,PalletType) VALUES (");
|
sqlString.Append($"'{models.TaskNo}','{models.Type}','0','{models.Origin}','{models.StartRoadway}','{models.StartLocate}',");
|
sqlString.Append($"'{models.EndLocate}','{models.EndRoadway}','{models.PalletNo}','{box.LotNo}','{models.SupplierLot}',");
|
sqlString.Append($"'{box.SkuNo}','{box.SkuName}','{models.Qty}','0','0','','{models.Levels}','{loginName}','0');");
|
var num = DataFactory.SqlDataBase().ExecuteBySql(sqlString);
|
|
if (num == 1)
|
{
|
DAL_OperationRecord oper = new DAL_OperationRecord();
|
var operation = new OperationModel()
|
{
|
MenuName = "任务管理",
|
FkNo = models.TaskNo + "-" + models.PalletNo,
|
Msg = "新增任务信息",
|
Type = "新增",
|
};
|
oper.AddOperation(operation, loginName);
|
result = true;
|
}
|
|
return result;
|
}
|
catch (Exception e)
|
{
|
throw new Exception(e.Message);
|
}
|
}
|
|
/// <summary>
|
/// 编辑备注
|
/// </summary>
|
/// <param name="models"></param>
|
/// <param name="loginName">登录人</param>
|
/// <returns></returns>
|
public bool UpdateTaskDemo(WCSTasks models, string loginName)
|
{
|
bool result = false;
|
try
|
{
|
StringBuilder sqlString = new StringBuilder();
|
// 编辑任务备注
|
sqlString.Append($"Update WCSTasks set Demo = '{models.Demo}',UpdateUser = '{loginName}',UpdateTime = '{DateTime.Now}' where TaskNo = '{models.TaskNo}' ");
|
var num = DataFactory.SqlDataBase().ExecuteBySql(sqlString);
|
|
if (num == 1)
|
{
|
DAL_OperationRecord oper = new DAL_OperationRecord();
|
var operation = new OperationModel()
|
{
|
MenuName = "任务管理",
|
FkNo = models.TaskNo + "-" + models.PalletNo,
|
Msg = "编辑任务备注",
|
Type = "编辑",
|
};
|
oper.AddOperation(operation, loginName);
|
result = true;
|
}
|
|
return result;
|
}
|
catch (Exception e)
|
{
|
throw new Exception(e.Message);
|
}
|
}
|
|
/// <summary>
|
/// 手动完成任务
|
/// </summary>
|
/// <param name="Id"></param>
|
/// <param name="loginName"></param>
|
/// <returns></returns>
|
public bool TaskMonitorComplete(string[] Id, string loginName, bool tuoji)
|
{
|
DALWcsMessage wcsEdit = new DALWcsMessage();
|
bool result = false;
|
try
|
{
|
int dt = DataFactory.SqlDataBase().IsExist("WCSTasks", "Id", Id);
|
if (dt >= Id.Length)
|
{
|
int i = 0;
|
while (i < Id.Length)
|
{
|
StringBuilder sql = new StringBuilder();
|
// 获取当前任务详细信息
|
sql.Append($"select * from WCSTasks where Id = '{Id[i]}';");
|
DataTable monitorDt = DataFactory.SqlDataBase().GetDataTableBySQL(sql);
|
if (monitorDt != null && monitorDt.Rows.Count > 0)
|
{
|
if (monitorDt.Rows[0]["Status"].ToString() != "1")
|
{
|
i++;
|
continue;
|
}
|
|
// 回传WMS任务完成
|
if (tuoji)
|
{
|
var wcsSql = new DALWcsMessage();
|
if (monitorDt.Rows[0]["Origin"].ToString() == "WMS") // WMS下发的任务
|
{
|
var task = new TaskReques
|
{
|
taskNo = monitorDt.Rows[0]["TaskNo"].ToString(),
|
PalletNo = monitorDt.Rows[0]["PalletNo"].ToString(),
|
TaskType = monitorDt.Rows[0]["Type"].ToString(),
|
TaskStatus = "2",
|
};
|
|
wcsSql.RequestTasks(task);
|
}
|
|
}
|
|
|
//修改储位状态
|
switch (monitorDt.Rows[0]["Type"].ToString())
|
{
|
case "0": //入库
|
wcsEdit.EditLocaetStatus("0", "2", "", monitorDt.Rows[0]["EndLocat"].ToString());
|
break;
|
case "1": //出库
|
wcsEdit.EditLocaetStatus("1", "2", monitorDt.Rows[0]["StartLocat"].ToString(), "");
|
break;
|
case "2": //移库
|
wcsEdit.EditLocaetStatus("2", "2", monitorDt.Rows[0]["StartLocat"].ToString(), monitorDt.Rows[0]["EndLocat"].ToString());
|
break;
|
default:
|
break;
|
}
|
|
sql.Clear();
|
|
// 修改任务状态
|
sql.Append($"update WCSTasks set Status=2,FinishDate = getdate() where Id='{Id[i]}';");
|
int _ret = DataFactory.SqlDataBase().ExecuteBySql(sql);
|
if (_ret >= 1)
|
{
|
DAL_OperationRecord oper = new DAL_OperationRecord();
|
var operation = new OperationModel()
|
{
|
MenuName = "任务管理",
|
FkNo = monitorDt.Rows[0]["TaskNo"].ToString() + "-" + monitorDt.Rows[0]["PalletNo"].ToString(),
|
Msg = "手动完成任务信息",
|
Type = "完成",
|
};
|
oper.AddOperation(operation, loginName);
|
result = true;
|
}
|
}
|
i++;
|
}
|
|
}
|
return result;
|
}
|
catch
|
{
|
return result;
|
}
|
}
|
|
/// <summary>
|
/// 取消任务
|
/// </summary>
|
/// <param name="Id"></param>
|
/// <param name="loginName"></param>
|
/// <returns></returns>
|
public bool TaskMonitorCancel(string[] Id, string loginName)
|
{
|
DALWcsMessage wcsEdit = new DALWcsMessage();
|
bool result = false;
|
try
|
{
|
int dt = DataFactory.SqlDataBase().IsExist("WCSTasks", "Id", Id);
|
if (dt >= Id.Length)
|
{
|
int i = 0;
|
while (i < Id.Length)
|
{
|
StringBuilder sql = new StringBuilder();
|
// 获取当前任务详细信息
|
sql.Append($"select * from WCSTasks where Id = '{Id[i]}';");
|
DataTable monitorDt = DataFactory.SqlDataBase().GetDataTableBySQL(sql);
|
if (monitorDt != null && monitorDt.Rows.Count > 0)
|
{
|
if (monitorDt.Rows[0]["Status"].ToString() != "0")
|
{
|
i++;
|
continue;
|
}
|
// 完成上架任务
|
var wcsSql = new DALWcsMessage();
|
if (monitorDt.Rows[0]["Origin"].ToString() == "WMS")
|
{
|
var task = new TaskReques
|
{
|
taskNo = monitorDt.Rows[0]["TaskNo"].ToString(),
|
PalletNo = monitorDt.Rows[0]["PalletNo"].ToString(),
|
TaskType = monitorDt.Rows[0]["Type"].ToString(),
|
TaskStatus = "4",
|
};
|
|
wcsSql.RequestTasks(task);
|
}
|
|
//修改储位状态
|
switch (monitorDt.Rows[0]["Type"].ToString())
|
{
|
case "0": //入库
|
wcsEdit.EditLocaetStatus("0", "2", "", monitorDt.Rows[0]["EndLocat"].ToString());
|
break;
|
case "1": //出库
|
wcsEdit.EditLocaetStatus("1", "2", monitorDt.Rows[0]["StartLocat"].ToString(), "");
|
break;
|
case "2": //移库
|
wcsEdit.EditLocaetStatus("2", "2", monitorDt.Rows[0]["StartLocat"].ToString(), monitorDt.Rows[0]["EndLocat"].ToString());
|
break;
|
default:
|
break;
|
}
|
|
|
sql.Clear();
|
// 修改任务状态
|
sql.Append("update WCSTasks set Status = 4,CancelDate=getdate() where Id='" + Id[i] + "'");
|
int _ret = DataFactory.SqlDataBase().ExecuteBySql(sql);
|
if (_ret >= 1)
|
{
|
DAL_OperationRecord oper = new DAL_OperationRecord();
|
var operation = new OperationModel()
|
{
|
MenuName = "任务管理",
|
FkNo = monitorDt.Rows[0]["TaskNo"].ToString() + "-" + monitorDt.Rows[0]["PalletNo"].ToString(),
|
Msg = "手动取消任务信息",
|
Type = "取消",
|
};
|
oper.AddOperation(operation, loginName);
|
result = true;
|
}
|
}
|
|
i++;
|
|
}
|
|
}
|
return result;
|
|
}
|
catch
|
{
|
return result;
|
}
|
}
|
|
/// <summary>
|
/// 手动再次回传WMS
|
/// </summary>
|
/// <param name="Id">任务ID集合</param>
|
/// <param name="loginName"></param>
|
/// <returns></returns>
|
public bool TaskMonitorBackhaul(string[] Id, string loginName)
|
{
|
bool result = false;
|
try
|
{
|
int dt = DataFactory.SqlDataBase().IsExist("WCSTasks", "Id", Id);
|
if (dt >= Id.Length)
|
{
|
int i = 0;
|
while (i < Id.Length)
|
{
|
StringBuilder sql = new StringBuilder();
|
// 获取当前任务详细信息
|
sql.Append($"select * from WCSTasks where Id = '{Id[i]}' and IsSuccess = '1';");
|
DataTable monitorDt = DataFactory.SqlDataBase().GetDataTableBySQL(sql);
|
if (monitorDt != null && monitorDt.Rows.Count > 0)
|
{
|
string taskStatus = monitorDt.Rows[0]["Status"].ToString();
|
if (taskStatus == "0" || taskStatus == "1" || taskStatus == "4")
|
{
|
i++;
|
continue;
|
}
|
DAL_OperationRecord oper = new DAL_OperationRecord();
|
var operation = new OperationModel()
|
{
|
MenuName = "任务管理",
|
FkNo = monitorDt.Rows[0]["TaskNo"].ToString() + "-" + monitorDt.Rows[0]["PalletNo"].ToString(),
|
Msg = "手动回传任务信息",
|
Type = "回传",
|
};
|
oper.AddOperation(operation, loginName);
|
// 完成上架任务
|
var wcsSql = new DALWcsMessage();
|
if (monitorDt.Rows[0]["Origin"].ToString() == "WMS")
|
{
|
var task = new TaskReques
|
{
|
taskNo = monitorDt.Rows[0]["TaskNo"].ToString(),
|
PalletNo = monitorDt.Rows[0]["PalletNo"].ToString(),
|
TaskType = monitorDt.Rows[0]["Type"].ToString(),
|
TaskStatus = monitorDt.Rows[0]["Status"].ToString(), // 获取再次
|
};
|
|
result = wcsSql.RequestTasks(task);
|
}
|
}
|
|
i++;
|
|
}
|
|
}
|
return result;
|
|
}
|
catch
|
{
|
return result;
|
}
|
}
|
|
/// <summary>
|
/// 同步WMS
|
/// </summary>
|
/// <param name="Id">任务ID集合</param>
|
/// <param name="loginName"></param>
|
/// <param name="tuoji"></param>
|
/// <returns></returns>
|
public bool TaskMonitorBackhaul1(string[] Id, string loginName, bool tuoji)
|
{
|
NLog.Logger logger = LogManager.GetCurrentClassLogger();
|
bool result = false;
|
try
|
{
|
if (tuoji == false)
|
{
|
throw new Exception("WMS系统已脱机,请恢复后点击!");
|
}
|
|
int dt = DataFactory.SqlDataBase().IsExist("WCSTasks", "Id", Id);
|
if (dt >= Id.Length)
|
{
|
int i = 0;
|
while (i < Id.Length)
|
{
|
string returnStr = "";
|
StringBuilder sql = new StringBuilder();
|
// 获取当前任务详细信息
|
sql.Append($"select * from WCSTasks where Id = '{Id[i]}';");
|
DataTable monitorDt = DataFactory.SqlDataBase().GetDataTableBySQL(sql);
|
|
if (monitorDt != null && monitorDt.Rows.Count > 0)
|
{
|
//根据当前任务获取同托盘是否存在之前未同步任务
|
sql.Clear();
|
sql.Append($"select * from WCSTasks where PalletNo = '{monitorDt.Rows[0]["PalletNo"].ToString()}' and SyncWms = '0' and Id != '{Id[i]}' order by CreateTime;");
|
DataTable palletTasks = DataFactory.SqlDataBase().GetDataTableBySQL(sql);
|
if (palletTasks != null && palletTasks.Rows.Count > 0)
|
{
|
for (int a = 0; a < palletTasks.Rows.Count; a++)
|
{
|
//判断当前同步任务的时间是否早于其它同托盘任务时间
|
if (Convert.ToDateTime(palletTasks.Rows[a]["CreateTime"]) < Convert.ToDateTime(monitorDt.Rows[0]["CreateTime"]))
|
{
|
throw new Exception("请按照时间进行依次同步!");
|
}
|
}
|
}
|
|
string taskStatus = monitorDt.Rows[0]["Status"].ToString();
|
if (taskStatus != "2")
|
{
|
i++;
|
continue;
|
}
|
#region 调用wms接口
|
//获取当前托盘箱码
|
List<BoxInfo> boxList = new List<BoxInfo>();
|
|
//根据任务的托盘、批次与物料进行获取箱码信息
|
sql.Clear();
|
sql.Append($"select * from WCSBoxInfo where IsDel = '0' and PalletNo = '{monitorDt.Rows[0]["PalletNo"].ToString()}' and LotNo = '{monitorDt.Rows[0]["LotNo"].ToString()}' and SkuNo = '{monitorDt.Rows[0]["SkuNo"].ToString()}'");
|
DataTable boxDt = DataFactory.SqlDataBase().GetDataTableBySQL(sql);
|
|
|
if (boxDt.Rows.Count > 0)
|
{
|
|
boxList = (List<BoxInfo>)DataTableHelper.DataTableToIList<BoxInfo>(boxDt); //转换集合
|
}
|
|
|
WmsTaskModel model = new WmsTaskModel()
|
{
|
TaskNo = monitorDt.Rows[0]["TaskNo"].ToString(), //任务号
|
Type = monitorDt.Rows[0]["Type"].ToString(), //任务类型
|
StartLocat = monitorDt.Rows[0]["StartLocat"].ToString(), //起始位置
|
EndLocat = monitorDt.Rows[0]["EndLocat"].ToString(), //目标位置
|
PalletNo = monitorDt.Rows[0]["PalletNo"].ToString(), //托盘编码
|
FinishDate = Convert.ToDateTime(monitorDt.Rows[0]["FinishDate"]), //完成时间
|
WCSName = loginName, //操作人
|
|
SkuNo = monitorDt.Rows[0]["SkuNo"].ToString(), //物料编码
|
SkuName = monitorDt.Rows[0]["SkuName"].ToString(), //物料名称
|
Standard = boxDt.Rows.Count == 0 ? "" : boxDt.Rows[0]["Standard"].ToString(), //规格
|
LotNo = monitorDt.Rows[0]["LotNo"].ToString(), //批次
|
SupplierLot = monitorDt.Rows[0]["SupplierLot"].ToString(), //供货批次
|
LotText = boxDt.Rows.Count == 0 ? "" : boxDt.Rows[0]["LotText"].ToString(), //批次描述
|
PackageStandard = boxDt.Rows.Count == 0 ? "" : boxDt.Rows[0]["PackageStandard"].ToString(), //包装规格
|
PalletType = monitorDt.Rows[0]["PalletType"].ToString(), //托盘类型
|
Qty = decimal.Parse(monitorDt.Rows[0]["Qty"].ToString()), //数量`
|
|
BoxInfoList = boxList //箱码集合
|
};
|
string json = JsonConvert.SerializeObject(model);
|
logger.Error(monitorDt.Rows[0]["TaskNo"].ToString() + "箱码及任务信息:" + json);
|
var response = Utility.Extra.HttpHelper.DoPost(DataFactory.GetWmsURL() + "/api/DownAPi/ReceiveWCSTaskSync", json);
|
logger.Error(monitorDt.Rows[0]["TaskNo"].ToString() + "同步任务:" + response);
|
PalletTasks taskModels = JsonConvert.DeserializeObject<PalletTasks>(response);
|
|
|
if (taskModels.StatusCode == "0")
|
{
|
StringBuilder sqlString = new StringBuilder();
|
//修改当前任务 是否同步状态改为已同步
|
sqlString.Append($"Update WCSTasks set IsSuccess = '0',SyncWms = '1' where TaskNo = '{monitorDt.Rows[0]["TaskNo"]}';");
|
DataFactory.SqlDataBase().ExecuteBySql(sqlString);
|
result = true;
|
}
|
else
|
{
|
returnStr = "-1:" + taskModels.Message;
|
}
|
|
#endregion
|
|
|
#region 操作日志
|
|
DAL_OperationRecord oper = new DAL_OperationRecord();
|
var operation = new OperationModel()
|
{
|
MenuName = "任务管理",
|
FkNo = monitorDt.Rows[0]["TaskNo"].ToString() + "-" + monitorDt.Rows[0]["PalletNo"].ToString(),
|
Msg = "手动同步任务信息",
|
Type = "同步",
|
};
|
oper.AddOperation(operation, loginName);
|
|
#endregion
|
}
|
|
i++;
|
|
}
|
|
}
|
return result;
|
|
}
|
catch
|
{
|
return result;
|
}
|
}
|
/// <summary>
|
/// 置顶任务
|
/// </summary>
|
/// <param name="Id">任务ID集合</param>
|
/// <param name="loginName"></param>
|
/// <returns></returns>
|
public bool StickyAlarm(string[] Id, string loginName)
|
{
|
bool result = false;
|
try
|
{
|
int dt = DataFactory.SqlDataBase().IsExist("WCSTasks", "Id", Id);
|
if (dt >= Id.Length)
|
{
|
int i = 0;
|
while (i < Id.Length)
|
{
|
StringBuilder sql = new StringBuilder();
|
// 获取当前任务详细信息
|
sql.Append($"select * from WCSTasks where Id = '{Id[i]}';");
|
DataTable monitorDt = DataFactory.SqlDataBase().GetDataTableBySQL(sql);
|
if (monitorDt != null && monitorDt.Rows.Count > 0)
|
{
|
//验证是否为深度2的且存在深度1任务
|
var shen = int.Parse(monitorDt.Rows[0]["StartLocat"].ToString().Substring(6, 2)).ToString();
|
if (shen == "2")
|
{
|
StringBuilder sql1 = new StringBuilder();
|
var Locat = monitorDt.Rows[0]["StartLocat"].ToString().Substring(0, 7).ToString() + "1";
|
// 获取当前任务详细信息
|
sql1.Append($"select * from WCSTasks where IsDel = '0' and Levels = '2' and StartLocat = '{Locat}';");//and Status = '0'
|
DataTable monitorDt1 = DataFactory.SqlDataBase().GetDataTableBySQL(sql1);
|
if (monitorDt1 != null && monitorDt1.Rows.Count > 0)
|
{
|
//验证外侧是否有不是等待执行状态的任务
|
sql1.Clear();
|
sql1.Append($"select * from WCSTasks where IsDel = '0' and Status = '0' and Levels = '2' and StartLocat = '{Locat}';");
|
DataTable monitorDt2 = DataFactory.SqlDataBase().GetDataTableBySQL(sql1);
|
if (monitorDt2 != null && monitorDt2.Rows.Count > 0)
|
{
|
sql.Clear();
|
sql.Append("update WCSTasks set Levels = '1',TopTime=getdate() where Id='" + monitorDt1.Rows[0]["Id"].ToString() + "'");
|
}
|
else
|
{
|
i++;
|
continue;
|
}
|
|
//result = false;
|
//break;
|
}
|
}
|
else
|
{
|
sql.Clear();
|
}
|
|
if (monitorDt.Rows[0]["Status"].ToString() != "0")
|
{
|
i++;
|
continue;
|
}
|
|
|
// 修改任务状态
|
sql.Append("update WCSTasks set Levels = '1',TopTime=getdate() where Id='" + Id[i] + "'");
|
int _ret = DataFactory.SqlDataBase().ExecuteBySql(sql);
|
if (_ret >= 1)
|
{
|
DAL_OperationRecord oper = new DAL_OperationRecord();
|
var operation = new OperationModel()
|
{
|
MenuName = "任务管理",
|
FkNo = monitorDt.Rows[0]["TaskNo"].ToString() + "-" + monitorDt.Rows[0]["PalletNo"].ToString(),
|
Msg = "置顶任务信息",
|
Type = "置顶",
|
};
|
oper.AddOperation(operation, loginName);
|
result = true;
|
}
|
}
|
|
i++;
|
|
}
|
|
}
|
return result;
|
|
}
|
catch
|
{
|
return result;
|
}
|
}
|
/// <summary>
|
/// 取消置顶任务
|
/// </summary>
|
/// <param name="Id">任务ID集合</param>
|
/// <param name="loginName"></param>
|
/// <returns></returns>
|
public bool NotStickyAlarm(string[] Id, string loginName)
|
{
|
bool result = false;
|
try
|
{
|
int dt = DataFactory.SqlDataBase().IsExist("WCSTasks", "Id", Id);
|
if (dt >= Id.Length)
|
{
|
int i = 0;
|
while (i < Id.Length)
|
{
|
StringBuilder sql = new StringBuilder();
|
// 获取当前任务详细信息
|
sql.Append($"select * from WCSTasks where Id = '{Id[i]}';");
|
DataTable monitorDt = DataFactory.SqlDataBase().GetDataTableBySQL(sql);
|
if (monitorDt != null && monitorDt.Rows.Count > 0)
|
{
|
|
//验证是否为深度1的且存在深度2的置顶任务
|
var shen = int.Parse(monitorDt.Rows[0]["StartLocat"].ToString().Substring(6, 2)).ToString();
|
if (shen == "1")
|
{
|
StringBuilder sql1 = new StringBuilder();
|
var Locat = monitorDt.Rows[0]["StartLocat"].ToString().Substring(0, 7).ToString() + "2";
|
// 获取当前任务详细信息
|
sql1.Append($"select * from WCSTasks where IsDel = '0' and Status = '0' and Levels = '1' and StartLocat = '{Locat}';");//and Status = '0'
|
DataTable monitorDt1 = DataFactory.SqlDataBase().GetDataTableBySQL(sql1);
|
if (monitorDt1 != null && monitorDt1.Rows.Count > 0)
|
{
|
//验证外侧是否有不是等待执行状态的任务
|
/*sql1.Clear();
|
sql1.Append($"select * from WCSTasks where IsDel = '0' and Status = '0' and Levels = '1' and StartLocat = '{Locat}';");
|
DataTable monitorDt2 = DataFactory.SqlDataBase().GetDataTableBySQL(sql1);
|
if (monitorDt2 != null && monitorDt2.Rows.Count > 0)
|
{*/
|
sql.Clear();
|
sql.Append("update WCSTasks set Levels = '2',TopTime=NULL where Id='" + monitorDt1.Rows[0]["Id"].ToString() + "'");
|
/*}
|
else
|
{
|
i++;
|
continue;
|
}*/
|
//result = false;
|
//break;
|
}
|
}
|
else
|
{
|
sql.Clear();
|
}
|
|
if (monitorDt.Rows[0]["Status"].ToString() != "0")
|
{
|
i++;
|
continue;
|
}
|
|
//sql.Clear();
|
// 修改任务状态
|
sql.Append("update WCSTasks set Levels = '2',TopTime=NULL where Id='" + Id[i] + "'");
|
int _ret = DataFactory.SqlDataBase().ExecuteBySql(sql);
|
if (_ret >= 1)
|
{
|
DAL_OperationRecord oper = new DAL_OperationRecord();
|
var operation = new OperationModel()
|
{
|
MenuName = "任务管理",
|
FkNo = monitorDt.Rows[0]["TaskNo"].ToString() + "-" + monitorDt.Rows[0]["PalletNo"].ToString(),
|
Msg = "取消置顶任务信息",
|
Type = "取消置顶",
|
};
|
oper.AddOperation(operation, loginName);
|
result = true;
|
}
|
}
|
|
i++;
|
|
}
|
|
}
|
return result;
|
|
}
|
catch
|
{
|
return result;
|
}
|
}
|
/// <summary>
|
/// 获取最新任务号
|
/// </summary>
|
/// <returns></returns>
|
public string GetTaskNo()
|
{
|
try
|
{
|
var taskStr = "";
|
//TK2023091900003
|
var codeFlag = "CS";
|
var time = DateTime.Now.ToString("yyyyMMdd").Trim();
|
|
|
StringBuilder sqlString = new StringBuilder();
|
// 验证任务是否已存在
|
sqlString.Append($"select TaskNo from WCSTasks where TaskNo like '{codeFlag + time}%' order by TaskNo desc;");
|
|
DataTable dt = DataFactory.SqlDataBase().GetDataTableBySQL(sqlString);
|
if (dt.Rows.Count != 0)
|
{
|
var s = dt.Rows[0];
|
var maxNo = dt.Rows[0][0].ToString();
|
if (string.IsNullOrWhiteSpace(maxNo))
|
{
|
taskStr = codeFlag + time + "00001";
|
}
|
else
|
{
|
int lastNo = Convert.ToInt32(maxNo.Substring(10, 5)) + 1;
|
taskStr = codeFlag + time + (lastNo.ToString().PadLeft(5, '0'));
|
|
}
|
}
|
else
|
{
|
taskStr = codeFlag + time + "00001";
|
}
|
|
|
return taskStr;
|
}
|
catch (Exception e)
|
{
|
throw new Exception(e.Message);
|
}
|
}
|
|
/// <summary>
|
/// 根据深度1验证深度2是否可移入移出或出库。
|
/// </summary>
|
/// <param name="type">任务类型</param>
|
/// <param name="locatNo">储位地址</param>
|
/// <param name="msg">消息</param>
|
/// <param name="loginName">操作人</param>
|
/// <returns></returns>
|
public string IsLocatTrue(string type, string locatNo, string msg, string loginName)
|
{
|
try
|
{
|
StringBuilder sqlString = new StringBuilder();
|
var strry = "";
|
|
#region 仅提示
|
//验证是否为深度2
|
//if (int.Parse(locatNo.Substring(6, 2)).ToString() == "2")
|
//{
|
// string locat01 = locatNo.Substring(0, 6).ToString() + "01";
|
// //获取储位深度1状态
|
// sqlString.Clear();
|
// sqlString.Append($"select * from WCSStorageLocat where IsDel = '0' and LocatNo = '{locat01}'");
|
// DataTable dt = DataFactory.SqlDataBase().GetDataTableBySQL(sqlString);
|
// WCSStorageLocat locat = (WCSStorageLocat)DataTableHelper.DataTableToIList<WCSStorageLocat>(dt);
|
|
// //若深度1为空储位 可进行移库 若为其它异常
|
// if (locat.Status != "0" || locat.Flag != "0")
|
// {
|
// strry = "储位:" + locat01 + "非空储位无法进行移、入、出库操作!";
|
// }
|
//}
|
//else (int.Parse(locatNo.Substring(6, 2)).ToString() == "1")
|
//{
|
// //获取储位深度2状态
|
// sqlString.Clear();
|
// sqlString.Append($"select * from WCSStorageLocat where IsDel = '0' and LocatNo = '{locatNo}'");
|
// DataTable dt = DataFactory.SqlDataBase().GetDataTableBySQL(sqlString);
|
// WCSStorageLocat locat = (WCSStorageLocat)DataTableHelper.DataTableToIList<WCSStorageLocat>(dt);
|
|
// //深度2必须为有物品
|
// if (locat.Status != "1")
|
// {
|
// strry = "当前里储位不是有物品 不可存放在外储位!";
|
// }
|
//}
|
|
#endregion
|
|
#region 创建对应任务
|
|
//判断是否为入库任务
|
var end = int.Parse(locatNo.Substring(6, 2)).ToString();
|
//验证是否为深度2
|
if (end == "2")
|
{
|
//验证深度1是否为有物品 若有物品则创建对应移库任务。
|
string locat01 = locatNo.Substring(0, 6).ToString() + "01";
|
//获取储位深度1状态
|
sqlString.Clear();
|
sqlString.Append($"select * from WCSStorageLocat where IsDel = '0' and LocatNo = '{locat01}'");
|
DataTable dt = DataFactory.SqlDataBase().GetDataTableBySQL(sqlString);
|
WCSStorageLocat locat = (WCSStorageLocat)DataTableHelper.DataTableToIList<WCSStorageLocat>(dt);
|
|
if (type == "0")
|
{
|
//若深度1为空储位 可进行移库 若为其它异常
|
if (locat.Status != "0" || locat.Flag != "0")
|
{
|
strry = "入库时 目标储位 外深度不是空储位!";
|
}
|
}
|
else if (type == "1")
|
{
|
|
|
//若深度1为空储位 可进行移库 若为其它异常
|
if (locat.Status == "1")
|
{
|
//创建对应移库任务
|
strry = LocatTrueTask(locat01, loginName);
|
}
|
else if (locat.Status == "0")
|
{
|
}
|
else
|
{
|
strry = "只有深度1为有物品时可进行移库!";
|
}
|
}
|
else if (type == "2")
|
{
|
//验证是起始或目标位置
|
if (msg == "起始位置")
|
{
|
//若深度1为空储位 可进行移库 若为其它异常
|
if (locat.Status == "1")
|
{
|
//创建对应移库任务
|
strry = LocatTrueTask(locat01, loginName);
|
}
|
else if (locat.Status == "0")
|
{
|
//深度1为空储位不管
|
}
|
else
|
{
|
strry = "只有深度1为有物品时可进行移库!";
|
}
|
}
|
else if (msg == "目标位置")
|
{
|
//若深度1为空储位 可进行移库 若为其它异常
|
if (locat.Status != "0" || locat.Flag != "0")
|
{
|
strry = "入库时 目标储位 外深度不是空储位!";
|
}
|
}
|
}
|
}
|
else
|
{
|
//获取储位深度2状态
|
sqlString.Clear();
|
sqlString.Append($"select * from WCSStorageLocat where IsDel = '0' and LocatNo = '{locatNo}'");
|
DataTable dt = DataFactory.SqlDataBase().GetDataTableBySQL(sqlString);
|
WCSStorageLocat locat = (WCSStorageLocat)DataTableHelper.DataTableToIList<WCSStorageLocat>(dt);
|
|
//深度2必须为有物品
|
if (locat.Status != "1")
|
{
|
strry = "当前里储位不是有物品 不可存放在外储位!";
|
}
|
}
|
|
|
#endregion
|
return strry;
|
}
|
catch (Exception ex)
|
{
|
throw ex;
|
}
|
}
|
|
/// <summary>
|
/// 根据起始位置获取对应移库储位
|
/// </summary>
|
/// <returns></returns>
|
public string GetYKLocatNo(string locatNo, string roadway)
|
{
|
try
|
{
|
StringBuilder sqlString = new StringBuilder();
|
string nowAddress = "";
|
|
// 获取移库目标储位
|
var row = int.Parse(locatNo.Substring(0, 2));
|
var lie = int.Parse(locatNo.Substring(2, 2));
|
var ceng = int.Parse(locatNo.Substring(4, 2));
|
|
//根据起始位置获取移库信息
|
sqlString.Clear();
|
sqlString.Append($"select LocatNo,[Row],[Column],Layer, (ABS(Row-{row}) + ABS([Column]-{lie}) + ABS(Layer-{ceng})) as distNum from SysStorageLocat where Flag = '0' and Status = '0' and Depth = '02' and RoadwayNo = '{roadway}'order by distNum");
|
|
DataTable dt = DataFactory.SqlDataBase().GetDataTableBySQL(sqlString);
|
List<WCSStorageLocat> addressModels = (List<WCSStorageLocat>)DataTableHelper.DataTableToIList<WCSStorageLocat>(dt);
|
if (addressModels.Count > 0) // 判断同巷道内排空库位
|
{
|
var listLocaete = new List<string>();
|
foreach (var item in addressModels)
|
{
|
// 目标内库位对应的外库位
|
string addressee = item.LocatNo.Substring(0, 6) + "01";
|
|
// 判断目标库位的外库位是否存在货物 (正常情况下正在移入情况不存在,因为移库先移入里面,后移入外面)
|
//SlotStatus 0: 空储位 1:有货 2:正在入库 3:正在出库 4:正在移入 5:正在移出
|
sqlString.Clear();
|
sqlString.Append($"select count(*) from SysStorageLocat where LocatNo = '{addressee}' and Status = '0' and Flag in ('0','1') ; ");
|
DataTable dt1= DataFactory.SqlDataBase().GetDataTableBySQL(sqlString);
|
List<WCSStorageLocat> models1 = (List<WCSStorageLocat>)DataTableHelper.DataTableToIList<WCSStorageLocat>(dt1);
|
if (models1.Count == 0)
|
{
|
continue;
|
}
|
else
|
{
|
nowAddress = item.LocatNo;
|
break;
|
}
|
}
|
}
|
if (nowAddress == "")
|
{
|
// 判断同巷道外排空库位
|
sqlString.Clear();
|
sqlString.Append($"select LocatNo,[Row],[Column],Layer, (ABS(Row-{row}) + ABS([Column]-{lie}) + ABS(Layer-{ceng})) as distNum from SysStorageLocat where Flag = '0' and Status = '0' and Depth = '01' and RoadwayNo = '{roadway}' order by distNum;");
|
DataTable dt2 = DataFactory.SqlDataBase().GetDataTableBySQL(sqlString);
|
List<WCSStorageLocat> models2 = (List<WCSStorageLocat>)DataTableHelper.DataTableToIList<WCSStorageLocat>(dt2);
|
if (models2.Count > 0)
|
{
|
nowAddress = models2[0].LocatNo;
|
}
|
else
|
{
|
// 库内不存在空储位
|
nowAddress = "";
|
}
|
}
|
|
return nowAddress;
|
|
}
|
catch (Exception ex)
|
{
|
throw ex;
|
}
|
}
|
|
/// <summary>
|
/// 创建对应移库任务
|
/// </summary>
|
/// <param name="startLocat">起始位置</param>
|
/// <param name="loginName">操作人</param>
|
/// <returns></returns>
|
public string LocatTrueTask(string startLocat, string loginName)
|
{
|
try
|
{
|
WCSTasks models = new WCSTasks();
|
StringBuilder sqlString = new StringBuilder();
|
DALWcsMessage wcsEdit = new DALWcsMessage();
|
|
string str = "";
|
|
#region 起始巷道
|
var start = int.Parse(startLocat.Substring(0, 2));
|
if (start == 1 || start == 2)
|
{
|
models.StartRoadway = "R01";
|
}
|
else if (start == 3 || start == 4)
|
{
|
models.StartRoadway = "R02";
|
}
|
else if (start == 5 || start == 6)
|
{
|
models.StartRoadway = "R03";
|
}
|
else if (start == 7 || start == 8)
|
{
|
models.StartRoadway = "R04";
|
}
|
else if (start == 9 || start == 10)
|
{
|
models.StartRoadway = "R05";
|
}
|
else if (start == 11 || start == 12)
|
{
|
models.StartRoadway = "R06";
|
}
|
else if (start == 13 || start == 14)
|
{
|
models.StartRoadway = "R07";
|
}
|
#endregion
|
|
//获取移库目标位置
|
models.EndLocate = GetYKLocatNo(startLocat, models.StartRoadway);
|
|
models.TaskNo = GetTaskNo();
|
models.StartLocat = startLocat;
|
models.Type = "2";
|
|
|
#region 目标巷道
|
var end = int.Parse(models.EndLocate.Substring(0, 2));
|
if (end == 1 || end == 2)
|
{
|
models.EndRoadway = "R01";
|
}
|
else if (end == 3 || end == 4)
|
{
|
models.EndRoadway = "R02";
|
}
|
else if (end == 5 || end == 6)
|
{
|
models.EndRoadway = "R03";
|
}
|
else if (end == 7 || end == 8)
|
{
|
models.EndRoadway = "R04";
|
}
|
else if (end == 9 || end == 10)
|
{
|
models.EndRoadway = "R05";
|
}
|
else if (end == 11 || end == 12)
|
{
|
models.EndRoadway = "R06";
|
}
|
else if (end == 13 || end == 14)
|
{
|
models.EndRoadway = "R07";
|
}
|
#endregion
|
|
|
//修改储位状态
|
switch (models.Type)
|
{
|
case "0": //入库
|
wcsEdit.EditLocaetStatus("0", "0", "", models.EndLocate);
|
break;
|
case "1": //出库
|
wcsEdit.EditLocaetStatus("1", "0", models.StartLocat, "");
|
break;
|
case "2": //移库
|
wcsEdit.EditLocaetStatus("2", "0", models.StartLocat, models.EndLocate);
|
break;
|
default:
|
break;
|
}
|
|
//创建移库任务
|
// 新增任务
|
sqlString.Clear();
|
sqlString.Append("INSERT INTO WCSTasks (TaskNo,Type,Status,Origin,StartRoadway,StartLocat,EndLocat,EndRoadway,PalletNo,");
|
sqlString.Append("LotNo,SupplierLot,SkuNo,SkuName,Qty,IsSuccess,SyncWms,Demo,Levels,CreateUser,PalletType) VALUES (");
|
sqlString.Append($"'{models.TaskNo}','{models.Type}','0','WCS','{models.StartRoadway}','{models.StartLocate}',");
|
sqlString.Append($"'{models.EndLocate}','{models.EndRoadway}','','','',");
|
sqlString.Append($"'','','','0','0','','2','{loginName}','0');");
|
var num = DataFactory.SqlDataBase().ExecuteBySql(sqlString);
|
|
if (num <= 0)
|
{
|
str = "创建任务失败";
|
}
|
return str;
|
}
|
catch (Exception ex)
|
{
|
throw ex;
|
}
|
}
|
}
|
}
|