From 786c5ca17012ff3a01faf466b751bdbe70629b97 Mon Sep 17 00:00:00 2001
From: wankeda <Administrator@DESKTOP-HAU3ST3>
Date: 星期一, 25 八月 2025 15:25:46 +0800
Subject: [PATCH] 1
---
代码管理/NEWCode/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskCZService.cs | 486 +++++++++++++++++++++++++++++++++++++++++++++++------
1 files changed, 425 insertions(+), 61 deletions(-)
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/NEWCode/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskCZService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/NEWCode/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskCZService.cs"
index d485293..565b952 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/NEWCode/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskCZService.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/NEWCode/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskCZService.cs"
@@ -26,16 +26,39 @@
using WIDESEAWCS_ITaskInfoRepository;
using WIDESEAWCS_ITaskInfoService;
using WIDESEAWCS_Model.Models;
-
+using WIDESEAWCS_ISystemServices;
+using WIDESEAWCS_ISystemRepository;
+using WIDESEA_Common;
+using WIDESEA_Core.Enums;
+using SqlSugar.Extensions;
+using System.Threading.Tasks;
+using System.Reflection.Emit;
+using WIDESEAWCS_Core.Enums;
+using OfficeOpenXml.FormulaParsing.Excel.Functions.RefAndLookup;
+using OfficeOpenXml.FormulaParsing.Excel.Functions.Numeric;
+using WIDESEAWCS_Core.Tool;
+using System.Net;
+using System.Web;
+using WIDESEAWCS_TaskInfoRepository;
namespace WIDESEAWCS_TaskInfoService
{
public class TaskCZService : ServiceBase<DtCZTask, ITaskCZRepository>, ITaskCZService
{
private readonly ITaskRepository _taskRepository;
+ private readonly ITaskService _taskService;
+ private readonly ITaskCZDetailsRepository _detailsRepository;
+ private readonly IDt_StationinfoRepository _stationinfoRepository;
+ private readonly ITaskHtyRepository _taskHtyRepository;
+ private readonly ITaskHtyService _taskHtyService;
- public TaskCZService(ITaskCZRepository BaseDal, ITaskRepository taskRepository) : base(BaseDal)
+ public TaskCZService(ITaskCZRepository BaseDal, ITaskHtyService taskHtyService, ITaskHtyRepository taskHtyRepository, IDt_StationinfoRepository stationinfoRepository, ITaskService taskService, ITaskRepository taskRepository, ITaskCZDetailsRepository detailsRepository) : base(BaseDal)
{
_taskRepository = taskRepository;
+ _detailsRepository = detailsRepository;
+ _taskService = taskService;
+ _stationinfoRepository = stationinfoRepository;
+ _taskHtyRepository = taskHtyRepository;
+ _taskHtyService = taskHtyService;
}
public Task<WebResponseContent> AddTaskCZAsync(CZTaskDto dto)
@@ -47,6 +70,11 @@
if (task != null)
{
response.Error("浠诲姟宸插瓨鍦紝璇峰嬁閲嶅娣诲姞锛�");
+ }
+ var station = _stationinfoRepository.QueryFirst(x => x.StationCode == dto.InputValue);
+ if (station == null)
+ {
+ response.Error("鍙枡鏈哄彴涓嶅瓨鍦�");
}
var taskModel = new DtCZTask()
{
@@ -78,6 +106,31 @@
return Task.FromResult(response);
}
+
+ public Task<WebResponseContent> DeleteTaskCZAsync(CZTaskDto dto)
+ {
+ var response = new WebResponseContent();
+ try
+ {
+ var task = BaseDal.QueryFirst(x => (x.TaskTaskID == dto.DTaskId) || (x.TaskEndAddress == dto.InputValue) || (x.TaskType == dto.TaskType));
+ if (task == null)
+ {
+ response.Error("鍒犻櫎浠诲姟涓嶅瓨鍦�");
+ return Task.FromResult(response);
+ }
+ var isTrue = BaseDal.DeleteData(task);
+ if (isTrue)
+ response.OK("浠诲姟鍒犻櫎鎴愬姛锛佽閲嶆柊涓嬪彂");
+ else
+ response.Error("浠诲姟鍒犻櫎澶辫触锛佽鎿嶄綔绯荤粺鍒犻櫎");
+ }
+ catch (System.Exception ex)
+ {
+ response.Error(ex.Message);
+ }
+ return Task.FromResult(response);
+ }
+
/// <summary>
/// 瀹屾垚浠诲姟
/// </summary>
@@ -88,60 +141,75 @@
WebResponseContent response = new WebResponseContent();
try
{
- var czTask = BaseDal.QueryFirst(x => x.TaskTaskID == dto.TaskId);
- if (czTask == null)
+ //ConsoleHelper.WriteErrorLine($"{nameof(dto.TaskId)}");
+ WriteLog.Info("浠诲姟瀹屾垚").Write($"浠诲姟鍙穥dto.TaskId}", "浠诲姟瀹屾垚");
+ if (dto.Floor == 1)
{
- response.Error("浠诲姟涓嶅瓨鍦紒");
- return Task.FromResult(response);
- }
- if (dto.Tags.Contains("姝f瀬"))
- {
- czTask.TaskZJFinishNumber += 1;
- }
- else
- {
- czTask.TaskFJFinishNumber += 1;
- }
- if (czTask.TaskZJFinishNumber == czTask.TaskNumber || czTask.TaskFJFinishNumber == czTask.TaskNumber)
- {
- czTask.TaskStatus = TaskInStatusEnum.InFinish.ToString();
- czTask.TaskEndDate = DateTime.Now;
- }
- else
- {
+ var czTask = BaseDal.QueryFirst(x => x.TaskTaskID == dto.TaskId);
+ if (czTask == null)
+ {
+ response.Error("浠诲姟涓嶅瓨鍦紒");
+ return Task.FromResult(response);
+ }
czTask.TaskStatus = TaskInStatusEnum.Line_InExecuting.ToString();
- }
-
-
- if (dto.FinishNum is < 1 or > 4)
- throw new ArgumentException("鍙傛暟閿欒锛丗inishNum 蹇呴』涓� 1-4");
-
- var detail = dto.FinishNum == 1
- ? new CZTaskBarCodeDto()
- : JsonSerializer.Deserialize<CZTaskBarCodeDto>(czTask.DtCZTaskDetails) ?? new CZTaskBarCodeDto();
-
- var property = dto.FinishNum switch
- {
- 1 => nameof(CZTaskBarCodeDto.BarCode1),
- 2 => nameof(CZTaskBarCodeDto.BarCode2),
- 3 => nameof(CZTaskBarCodeDto.BarCode3),
- 4 => nameof(CZTaskBarCodeDto.BarCode4),
- _ => throw new ArgumentOutOfRangeException("鍙傛暟閿欒锛佽妫�鏌ャ�怓inishNum銆戯紒")
- };
-
- typeof(CZTaskBarCodeDto).GetProperty(property)?.SetValue(detail, dto.MaterialBarcode);
-
- czTask.DtCZTaskDetails = JsonSerializer.Serialize(detail);
-
- var isTrue = BaseDal.UpdateData(czTask);
- if (isTrue)
- {
- response.OK("浠诲姟瀹屾垚鎴愬姛锛�");
+ var details = new DtCZTaskDetails()
+ {
+ MaterialBarCode = dto.MaterialBarcode,
+ MaterialType = dto.ProductCode,
+ TaskDescription = "鍒涙櫤鎻愪氦浠诲姟瀹屾垚",
+ TaskEndAddress = czTask.TaskEndAddress,
+ TaskName = czTask.TaskName,
+ TaskType = czTask.TaskType,
+ TaskStatus = czTask.TaskStatus,
+ TaskTaskID = czTask.TaskTaskID,
+ };
+ _detailsRepository.AddData(details);
+ var isTrue = BaseDal.UpdateData(czTask);
+ if (isTrue)
+ {
+ response.OK("浠诲姟瀹屾垚鎴愬姛锛�");
+ }
+ else
+ {
+ response.Error("浠诲姟瀹屾垚澶辫触锛�");
+ }
}
else
{
- response.Error("浠诲姟瀹屾垚澶辫触锛�");
+ Dt_Task task = _taskRepository.QueryFirst(x => x.TaskNum == dto.TaskId.ObjToInt());
+ if (task == null)
+ {
+ response.Error("浠诲姟涓嶅瓨鍦紒");
+ return Task.FromResult(response);
+ }
+ WriteLog.Info("1").Write($"浠诲姟鍙穥task.TaskNum}", "1");
+ task.TaskState = TaskInStatusEnum.AGV_InFinish.ObjToInt();
+ if (task.SourceAddress.Contains("SL-0"))
+ {
+ var address = task.SourceAddress.Split("||");
+ Dt_Stationinfo Stationinfo = _stationinfoRepository.QueryFirst(x => x.StationCode == address[0]);
+ Dt_Stationinfo Stationinfo1 = _stationinfoRepository.QueryFirst(x => x.StationCode == address[1]);
+ Stationinfo.Location_state = LocationStatusEnum.Free.ObjToInt();
+ _stationinfoRepository.UpdateData(Stationinfo);
+ Stationinfo1.Location_state = LocationStatusEnum.Free.ObjToInt();
+ _stationinfoRepository.UpdateData(Stationinfo1);
+ }
+ if (task.TargetAddress.Contains("SL-0"))
+ {
+ var address = task.TargetAddress.Split("||");
+ Dt_Stationinfo Stationinfo = _stationinfoRepository.QueryFirst(x => x.StationCode == address[0]);
+ Dt_Stationinfo Stationinfo1 = _stationinfoRepository.QueryFirst(x => x.StationCode == address[1]);
+ Stationinfo.Location_state = LocationStatusEnum.InStock.ObjToInt();
+ _stationinfoRepository.UpdateData(Stationinfo);
+ Stationinfo1.Location_state = LocationStatusEnum.InStock.ObjToInt();
+ _stationinfoRepository.UpdateData(Stationinfo1);
+ }
+ _taskHtyService.AddTask_Hty(task, OperateTypeEnum.鑷姩瀹屾垚);
+ _taskService.DeleteData(task);
+ response.OK("浠诲姟瀹屾垚鎴愬姛锛�");
+ WriteLog.Info("浠诲姟瀹屾垚鎴愬姛").Write($"浠诲姟鍙穥task.TaskId}", "浠诲姟瀹屾垚鎴愬姛");
}
+
}
catch (Exception ex)
{
@@ -151,7 +219,7 @@
}
/// <summary>
- /// 杈撻�佺嚎鍥炴祦
+ /// 绌烘墭鍥炴祦 AGV浠诲姟瀹屾垚涔嬪悗闇�鏇存柊缂撳瓨鏋剁姸鎬�
/// </summary>
/// <param name="saveModel"></param>
/// <returns></returns>
@@ -160,22 +228,318 @@
WebResponseContent webResponseContent = new WebResponseContent();
try
{
+ //閫氳繃绔欑偣琛ㄥ垽鏂紦瀛樻灦鏄偅涓尯鍩熷幓閭f潯杈撻�佺嚎鍥炴祦鍙c�傘�傘�傘�傘�傘�傘�傘�傘�傘�傘��
string Saddress = saveModel.MainData["sourceAddress"].ToString();
- string Taddress = saveModel.MainData["targetAddress"].ToString();
-
- Dt_Task task = _taskRepository.QueryFirst(x => x.SourceAddress == Saddress && x.TaskState == (int)TaskInStatusEnum.InPending && x.TargetAddress == "WaitBind");
- if (task == null)
+ string Saddress1 = saveModel.MainData["sourceAddress1"].ToString();
+ //string Taddress = saveModel.MainData["targetAddress"].ToString();
+ if (Saddress == Saddress1)
{
- webResponseContent.Error("浠诲姟涓嶅瓨鍦紒");
+ webResponseContent.Error("鍚屼竴缂撳瓨鏋朵笉鑳芥壂鎻忎袱娆★紒");
return Task.FromResult(webResponseContent);
}
- task.TargetAddress = Taddress;
- task.TaskState = (int)TaskInStatusEnum.InNew;
- var isTrue = _taskRepository.UpdateData(task);
- if (isTrue)
+ Dt_Task task = _taskRepository.QueryFirst(x => x.SourceAddress == Saddress || x.SourceAddress == Saddress1 || x.TargetAddress == Saddress || x.TargetAddress == Saddress1);
+ if (task != null)
{
- webResponseContent.OK("浠诲姟涓嬪彂鎴愬姛锛�");
+ webResponseContent.Error("姝ょ紦瀛樻灦宸插瓨鍦ㄤ换鍔★紒");
+ return Task.FromResult(webResponseContent);
}
+ Dt_Stationinfo Stationinfo = _stationinfoRepository.QueryFirst(x => x.StationCode == Saddress && x.Enable);
+ Dt_Stationinfo Stationinfo1 = _stationinfoRepository.QueryFirst(x => x.StationCode == Saddress1 && x.Enable);
+ if (Stationinfo == null || Stationinfo1 == null)
+ {
+ webResponseContent.Error("鏈壘鍒版璧风偣缂撳瓨鏋�,鎴栨缂撳瓨鏋跺凡琚鐢紒");
+ return Task.FromResult(webResponseContent);
+ }
+ Stationinfo.Location_state = LocationStatusEnum.Lock.ObjToInt();
+ _stationinfoRepository.UpdateData(Stationinfo);
+ Stationinfo1.Location_state = LocationStatusEnum.Lock.ObjToInt();
+ _stationinfoRepository.UpdateData(Stationinfo1);
+ Dt_Task dt_Task = new Dt_Task();
+ {
+ dt_Task.TaskNum = _taskService.GetTaskNum();
+ dt_Task.CreateDate = DateTime.Now;
+ dt_Task.Creater = "system";
+ dt_Task.CurrentAddress = Stationinfo.StationCode + "||" + Stationinfo1.StationCode;
+ dt_Task.SourceAddress = Stationinfo.StationCode + "||" + Stationinfo1.StationCode;
+ dt_Task.TaskState = (int)TaskInStatusEnum.InNew;
+ //dt_Task.TaskType = (int)TaskOutboundTypeEnum.Outbound;
+ dt_Task.Grade = 1;
+ dt_Task.PalletCode = "";
+ if (Stationinfo.Area == "A鍖�")
+ {
+ dt_Task.TargetAddress = "ZJXL-KPHLS001";
+ dt_Task.NextAddress = "ZJXL-KPHLX001";
+ dt_Task.TaskType = 64;
+ }
+ else
+ {
+ dt_Task.TargetAddress = "FJXL-KPHLS001";
+ dt_Task.NextAddress = "FJXL-KPHLX001";
+ dt_Task.TaskType = 256;
+ }
+ dt_Task.NextAddress = dt_Task.TargetAddress;
+ dt_Task.Barcode = "";
+ dt_Task.Roadway = "AGV";
+ dt_Task.WMSId = 0;
+ dt_Task.Remark = "绌烘墭鍥炴祦";
+ dt_Task.Floor = 3;
+ }
+ var isTrue = _taskRepository.AddData(dt_Task);
+
+ Dt_Task dt_Tasks = new Dt_Task();
+ {
+ dt_Tasks.TaskNum = _taskService.GetTaskNum();
+ dt_Tasks.CreateDate = DateTime.Now;
+ dt_Tasks.Creater = "system";
+ if (Stationinfo.Area == "A鍖�")
+ {
+ dt_Tasks.CurrentAddress = "ZJXL-KPHLX001";
+ }
+ else
+ {
+ dt_Tasks.CurrentAddress = "FJXL-KPHLX001";
+ }
+ dt_Tasks.SourceAddress = dt_Tasks.CurrentAddress;
+ dt_Tasks.TaskState = (int)TaskInStatusEnum.InPending;
+ dt_Tasks.TaskType = 16;
+ dt_Tasks.Grade = 1;
+ dt_Tasks.PalletCode = "";
+ if (dt_Task.CurrentAddress.Contains("ZJ"))
+ {
+ dt_Tasks.TargetAddress = "ZJSL-WLX002";
+ }
+ else
+ {
+ dt_Tasks.TargetAddress = "FJSL-WLS002";
+ }
+ dt_Tasks.NextAddress = dt_Tasks.TargetAddress;
+ dt_Tasks.Barcode = "";
+ dt_Tasks.Roadway = "AGV";
+ dt_Tasks.WMSId = 0;
+ dt_Tasks.Remark = "绌烘墭鍥炴祦";
+ dt_Tasks.Floor = 3;
+ }
+
+ var isTrue1 = _taskRepository.AddData(dt_Tasks);
+ webResponseContent.OK("浠诲姟涓嬪彂鎴愬姛锛�");
+ }
+ catch (Exception ex)
+ {
+ webResponseContent.Error(ex.Message);
+ }
+ return Task.FromResult(webResponseContent);
+ }
+ /// <summary>
+ /// 鐑樼儰鍑烘枡 AGV浠诲姟瀹屾垚涔嬪悗闇�鏇存柊缂撳瓨鏋剁姸鎬�
+ /// </summary>
+ /// <param name="sourceAddress"></param>
+ /// <returns></returns>
+ public Task<WebResponseContent> OutBoundTask(SaveModel saveModel)
+ {
+ WebResponseContent webResponseContent = new WebResponseContent();
+ try
+ {
+ string Saddress = saveModel.MainData["sourceAddress"].ToString();
+ Dt_Task task = _taskRepository.QueryFirst(x => x.SourceAddress == Saddress);
+ if (task != null)
+ {
+ webResponseContent.Error("璧风偣宸插瓨鍦ㄤ换鍔★紒");
+ return Task.FromResult(webResponseContent);
+ }
+ //var station = _stationinfoRepository.QueryFirst(x => x.StationCode == Saddress);
+ //// 鏌ユ壘涓や釜鍙敤鐨勭┖缂撳瓨鏋�
+ //var freeStations = _stationinfoRepository
+ // .QueryData(x => x.Location_state == LocationStatusEnum.Free.ObjToInt() && x.Enable && x.Remark == station.Remark && x.Area == station.Area)// && x.Stationtype == station.Stationtype
+ // .Take(2) // 鍙彇鍓嶄袱涓�
+ // .ToList();
+
+ //int floor = 0;
+ //if (station.Area.Contains("A鍖�"))
+ //{
+ // floor = 32;
+ //}
+ //else
+ //{
+ // floor = 128;
+ //}
+ //if (freeStations.Count < 2)
+ //{
+ // webResponseContent.Error("鏈壘鍒拌冻澶熺殑绌虹紦瀛樻灦锛�");
+ // return Task.FromResult(webResponseContent);
+ //}
+ //// 妫�鏌ヨ繖涓や釜缂撳瓨鏋舵槸鍚﹁浠诲姟鍗犵敤
+ //var stationCodes = freeStations.Select(s => s.StationCode).ToList();
+ //freeStations[0].Location_state = LocationStatusEnum.Lock.ObjToInt();
+ //_stationinfoRepository.UpdateData(freeStations[0]);
+ //freeStations[1].Location_state = LocationStatusEnum.Lock.ObjToInt();
+ //_stationinfoRepository.UpdateData(freeStations[1]);
+ ////stationCodes.
+ //var tasks = _taskRepository.QueryData(x => stationCodes.Contains(x.SourceAddress) || stationCodes.Contains(x.TargetAddress)).ToList();
+ //if (tasks.Any())
+ //{
+ // webResponseContent.Error("閮ㄥ垎缂撳瓨鏋跺凡琚崰鐢紝鏃犳硶浣跨敤锛�");
+ // return Task.FromResult(webResponseContent);
+ //}
+
+ Dt_Task dt_Task = new Dt_Task()
+ {
+ TaskNum = _taskService.GetTaskNum(),
+ CreateDate = DateTime.Now,
+ Creater = "system",
+ CurrentAddress = Saddress,
+ SourceAddress = Saddress,
+ TaskState = (int)TaskInStatusEnum.AGV_Queue,
+ TaskType = 0,//floor
+ Grade = 1,
+ PalletCode = "",
+ Floor = 3,
+ TargetAddress = "",//string.Join("||", freeStations.Select(s => s.StationCode))
+ NextAddress = "",//string.Join("||", freeStations.Select(s => s.StationCode))
+ Barcode = "",
+ Roadway = "AGV",
+ WMSId = 0,
+ Remark = "绌烘墭鍥炴祦"
+ };
+ var isTrue = _taskRepository.AddData(dt_Task);
+ webResponseContent.OK("浠诲姟涓嬪彂鎴愬姛锛�");
+ }
+ catch (Exception ex)
+ {
+ webResponseContent.Error(ex.Message);
+ }
+ return Task.FromResult(webResponseContent);
+ }
+ /// <summary>
+ /// 鐑樼儰鍥炵倝 AGV浠诲姟瀹屾垚涔嬪悗闇�鏇存柊缂撳瓨鏋剁姸鎬�
+ /// </summary>
+ /// <param name="saveModel"></param>
+ /// <returns></returns>
+ public Task<WebResponseContent> OutBoundTasks(SaveModel saveModel)
+ {
+ WebResponseContent webResponseContent = new WebResponseContent();
+ try
+ {
+ //閫氳繃绔欑偣琛ㄥ垽鏂紦瀛樻灦鏄偅涓尯鍩熷幓閭f潯杈撻�佺嚎鍥炴祦鍙c�傘�傘�傘�傘�傘�傘�傘�傘�傘�傘��
+ string Saddress = saveModel.MainData["sourceAddress"].ToString();
+ string Saddress1 = saveModel.MainData["sourceAddress1"].ToString();
+ string Taddress = saveModel.MainData["targetAddress"].ToString();
+ if (Saddress == Saddress1)
+ {
+ webResponseContent.Error("鍚屼竴缂撳瓨鏋朵笉鑳芥壂鎻忎袱娆★紒");
+ return Task.FromResult(webResponseContent);
+ }
+ Dt_Stationinfo Stationinfo = _stationinfoRepository.QueryFirst(x => x.StationCode == Saddress && x.Enable);
+ Dt_Stationinfo Stationinfo1 = _stationinfoRepository.QueryFirst(x => x.StationCode == Saddress1 && x.Enable);
+ if (Stationinfo == null || Stationinfo1 == null)
+ {
+ webResponseContent.Error("鏈壘鍒版璧风偣缂撳瓨鏋�,鎴栨缂撳瓨鏋跺凡琚鐢紒");
+ return Task.FromResult(webResponseContent);
+ }
+ Stationinfo.Location_state = LocationStatusEnum.Lock.ObjToInt();
+ _stationinfoRepository.UpdateData(Stationinfo);
+ Stationinfo1.Location_state = LocationStatusEnum.Lock.ObjToInt();
+ _stationinfoRepository.UpdateData(Stationinfo1);
+ Dt_Task dt_Task = new Dt_Task();
+ {
+ dt_Task.TaskNum = _taskService.GetTaskNum();
+ dt_Task.CreateDate = DateTime.Now;
+ dt_Task.Creater = "system";
+ dt_Task.CurrentAddress = Stationinfo.StationCode + "||" + Stationinfo1.StationCode;
+ dt_Task.SourceAddress = Stationinfo.StationCode + "||" + Stationinfo1.StationCode;
+ dt_Task.TaskState = (int)TaskInStatusEnum.InNew;
+ //dt_Task.TaskType = (int)TaskOutboundTypeEnum.Outbound;
+ dt_Task.Grade = 1;
+ dt_Task.PalletCode = "";
+ if (Stationinfo.Area == "A鍖�")
+ {
+ dt_Task.TargetAddress = "ZJXL-KPHLS001";
+ dt_Task.NextAddress = "ZJXL-KPHLX001";
+ dt_Task.TaskType = 64;
+ }
+ else
+ {
+ dt_Task.TargetAddress = "FJXL-KPHLS001";
+ dt_Task.NextAddress = "FJXL-KPHLX001";
+ dt_Task.TaskType = 256;
+ }
+ dt_Task.Barcode = "";
+ dt_Task.Roadway = "AGV";
+ dt_Task.WMSId = 0;
+ dt_Task.Remark = "鐑樼儰鍥炵倝";
+ dt_Task.Floor = 3;
+ }
+ var isTrue = _taskRepository.AddData(dt_Task);
+
+ Dt_Task dt_Tasks = new Dt_Task();
+ {
+ dt_Tasks.TaskNum = _taskService.GetTaskNum();
+ dt_Tasks.CreateDate = DateTime.Now;
+ dt_Tasks.Creater = "system";
+ if (Stationinfo.Area == "A鍖�")
+ {
+ dt_Tasks.CurrentAddress = "ZJXL-KPHLX001";
+ }
+ else
+ {
+ dt_Tasks.CurrentAddress = "FJXL-KPHLX001";
+ }
+ dt_Tasks.SourceAddress = dt_Tasks.CurrentAddress;
+ dt_Tasks.TaskState = (int)TaskInStatusEnum.InPending;
+ dt_Tasks.TaskType = 8;
+ dt_Tasks.Grade = 1;
+ dt_Tasks.PalletCode = "";
+ dt_Tasks.TargetAddress = Taddress;
+ dt_Tasks.NextAddress = Taddress;
+ dt_Tasks.Barcode = "";
+ dt_Tasks.Roadway = "AGV";
+ dt_Tasks.WMSId = 0;
+ dt_Tasks.Remark = "鐑樼儰鍥炵倝";
+ dt_Task.Floor = 3;
+ }
+ var isTrue1 = _taskRepository.AddData(dt_Tasks);
+ webResponseContent.OK("浠诲姟涓嬪彂鎴愬姛锛�");
+ }
+ catch (Exception ex)
+ {
+ webResponseContent.Error(ex.Message);
+ }
+ return Task.FromResult(webResponseContent);
+ }
+
+ /// <summary>
+ /// 鏆傚瓨鍖洪�佹枡
+ /// </summary>
+ /// <param name="saveModel"></param>
+ /// <returns></returns>
+ public Task<WebResponseContent> TemporarilyTasks(SaveModel saveModel)
+ {
+ WebResponseContent webResponseContent = new WebResponseContent();
+ try
+ {
+ string sourceAddress = saveModel.MainData["sourceAddress"].ToString();
+ string targetAddress = saveModel.MainData["targetAddress"].ToString();
+ Dt_Task dt_Tasks = new Dt_Task();
+ {
+ dt_Tasks.TaskNum = _taskService.GetTaskNum();
+ dt_Tasks.CreateDate = DateTime.Now;
+ dt_Tasks.Creater = "system";
+ dt_Tasks.CurrentAddress = sourceAddress;
+ dt_Tasks.SourceAddress = sourceAddress;
+ dt_Tasks.TaskState = (int)TaskInStatusEnum.InNew;
+ dt_Tasks.TaskType = 4;
+ dt_Tasks.Grade = 1;
+ dt_Tasks.PalletCode = "";
+ dt_Tasks.TargetAddress = targetAddress;
+ dt_Tasks.NextAddress = targetAddress;
+ dt_Tasks.Barcode = "";
+ dt_Tasks.Roadway = "AGV";
+ dt_Tasks.WMSId = 0;
+ dt_Tasks.Remark = "鏆傚瓨鍖洪�佹枡";
+ dt_Tasks.Floor = 3;
+ }
+
+ var isTrue1 = _taskRepository.AddData(dt_Tasks);
+ webResponseContent.OK("浠诲姟涓嬪彂鎴愬姛锛�");
}
catch (Exception ex)
{
--
Gitblit v1.9.3