From ec3daa05f122738f18d4474b9257e4cf794dc5cf Mon Sep 17 00:00:00 2001
From: Admin <Admin@ADMIN>
Date: 星期五, 06 三月 2026 10:36:01 +0800
Subject: [PATCH] 接口新增
---
项目代码/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Partial/Dt_TaskService.cs | 95 +++++++++++++++++++++++++++++++++++++++++------
1 files changed, 83 insertions(+), 12 deletions(-)
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Partial/Dt_TaskService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Partial/Dt_TaskService.cs"
index 2191322..47c2219 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Partial/Dt_TaskService.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Partial/Dt_TaskService.cs"
@@ -1,6 +1,8 @@
锘縰sing log4net.Core;
using Masuit.Tools;
using System.Collections.Generic;
+using System.Linq;
+using System.Net;
using WIDESEA_Common;
using WIDESEA_Core.Const;
using WIDESEA_DTO.WMS;
@@ -39,10 +41,23 @@
var inWheelsInfo = _InWheels_MesRepository.QueryFirst(x => x.Wheels_CurrentStatue == "0");
//鏌ヨ鍒涘缓鐨勫埗鍔ㄧ洏淇℃伅
+ var inZDPInfo = _InZdp_MesRepository.QueryFirst(x => x.Zdp_CurrentStatue == "0");
+
+ //鏌ヨ鍒涘缓鐨勫埗鍔ㄧ洏淇℃伅
//var inBrakeInfo = _InWheels_MesRepository.QueryFirst(x => x.Wheels_CurrentStatue == "0");
//if (inBrakeInfo == null) throw new Exception("褰撳墠鏃犺溅杞垨鍒跺姩鐩樺叆搴撲俊鎭�");
- if (inWheelsInfo == null /*&& inBrakeInfo == null*/) throw new Exception("褰撳墠鏃犺溅杞垨鍒跺姩鐩樺叆搴撲俊鎭�");
+ //褰撹溅杞俊鎭笌鍒跺姩鐩樹俊鎭悓鏃跺嚭鐜伴渶瑕佸叆搴撶殑锛屽垯涓嶅彲鍏ュ簱
+ if(inWheelsInfo != null && inZDPInfo != null) throw new Exception("褰撳墠鍑虹幇鍒跺姩鐩樹笌杞﹁疆鍚屾椂鍏ュ簱鐢宠锛岀敵璇烽敊璇紝璇风‘淇濆彧鏈変竴涓墽琛屽叆搴�");
+
+ if (inWheelsInfo == null && inZDPInfo == null) throw new Exception("褰撳墠鏃犺溅杞垨鍒跺姩鐩樺叆搴撲俊鎭�");
+
+ //榛樿涓鸿溅杞叆搴擄紝浣嗘槸褰撹溅杞俊鎭负绌哄垯涓哄埗鍔ㄧ洏鍏ュ簱
+ int rktype = 1;
+ if(inWheelsInfo == null)
+ {
+ rktype = 2;
+ }
var newtask = new Dt_Task
{
@@ -54,16 +69,16 @@
MaterialNo = "",
NextAddress = input.Roadways,
OrderNo = null,
- PalletCode = inWheelsInfo.Wheels_Num,
+ PalletCode = rktype==1?inWheelsInfo.Wheels_Num: inZDPInfo.Zdp_code,
SourceAddress = input.Position,
TaskState = (int)TaskInStatusEnum.InNew,
- TaskType = (int)TaskInboundTypeEnum.InWheels, //inWheelsInfo == null ? (int)TaskInboundTypeEnum.InBrake :
+ TaskType = rktype == 1 ? (int)TaskInboundTypeEnum.InWheels: (int)TaskInboundTypeEnum.InBrake, //inWheelsInfo == null ? (int)TaskInboundTypeEnum.InBrake :
TaskNum = await BaseDal.GetTaskNo(),
- CarType = inWheelsInfo.Wheels_CarType,
+ CarType = rktype == 1 ? inWheelsInfo.Wheels_CarType:inZDPInfo.Zdp_chexing,
IsCheck = true,
- wheels_mttype = inWheelsInfo.Wheels_mttype,
- wheels_gkcc = inWheelsInfo.Wheels_gkcc,
- WheelsNewOrOld = inWheelsInfo.Wheels_NewOrOld,
+ wheels_mttype = rktype == 1 ? inWheelsInfo.Wheels_mttype:"",
+ wheels_gkcc = rktype == 1 ? inWheelsInfo.Wheels_gkcc: inZDPInfo.Zdp_GKJZ,
+ WheelsNewOrOld = rktype == 1 ? inWheelsInfo.Wheels_NewOrOld : inZDPInfo.Zdp_neworold,
Creater = "Systeam"
};
@@ -93,8 +108,17 @@
WheelsLX = newtask.WheelsLX,
};
- inWheelsInfo.Wheels_CurrentStatue = "1";
- _InWheels_MesRepository.UpdateData(inWheelsInfo);
+ if (rktype == 2)
+ {
+ inZDPInfo.Zdp_CurrentStatue = "1";
+ _InZdp_MesRepository.UpdateData(inZDPInfo);
+ }
+ else
+ {
+ inWheelsInfo.Wheels_CurrentStatue = "1";
+ _InWheels_MesRepository.UpdateData(inWheelsInfo);
+ }
+
content.OK(data: taskDTO);
}
@@ -207,6 +231,13 @@
return content.Error($"鏈煡鏉$爜{input.PalletCode}浠诲姟");
}
+ List<Dt_Task> taskcl = BaseDal.QueryData(x => x.TaskState == (int)TaskOutStatusEnum.Lien_Check);
+ if (taskcl.Count > 0)
+ {
+ return content.Error($"宸叉湁鍦ㄦ祴閲忎腑鐨勮溅杞紝璇锋煡鐪嬫槸鍚︾敵璇锋纭�");
+ }
+
+
task.TaskState = (int)TaskOutStatusEnum.Lien_Check;
task.CurrentAddress = input.Position;
task.NextAddress = "2021";
@@ -236,19 +267,59 @@
WebResponseContent content = new WebResponseContent();
try
{
- var cacheinfo = await _CacheInfoRepository.QueryFirstAsync(x => x.czh == input.PalletCode);
+ /*var cacheinfo = await BaseDal.QueryFirstAsync(x => x.task_CZInfo == input.PalletCode);
if (cacheinfo == null) throw new Exception($"鏈壘鍒皗input.PalletCode}杞﹁酱缂撳瓨浣嶄俊鎭�");
- return content.OK(data: cacheinfo.targetAddress);
+ if(cacheinfo.Towhereabouts =="" && cacheinfo.Towhereabouts == null) throw new Exception($"{input.PalletCode}杩愯緭鐩爣鍦板潃涓虹┖");
+ return content.OK(data: cacheinfo.Towhereabouts);*/
+
+ var task = await BaseDal.QueryFirstAsync(x => input.PalletCode.Contains(x.PalletCode));
+ if (task != null)
+ {
+ if (task.Towhereabouts == "" && task.Towhereabouts == null) return content.Error($"{input.PalletCode}杩愯緭鐩爣鍦板潃涓虹┖");
+ return content.OK(data: task.Towhereabouts);
+ }
+ else
+ {
+ Dt_Task_Hty dt_Task_Hty = _task_HtyRepository.QueryFirst(x => input.PalletCode.Contains(x.PalletCode) && x.CreateDate >= DateTime.Now.AddHours(-2));
+ if (dt_Task_Hty == null) return content.Error($"鏈壘鍒皗input.PalletCode}鎵樼洏鍘嗗彶淇℃伅");
+ if (dt_Task_Hty.Towhereabouts == null && dt_Task_Hty.Towhereabouts == "") return content.Error($"{input.PalletCode}鎵樼洏鍘嗗彶淇℃伅娌℃湁璁板綍鐩爣鍦板潃");
+ return content.OK(data: dt_Task_Hty.Towhereabouts);
+ }
}
catch (Exception err)
{
// 濡傛灉鍙戠敓寮傚父锛屽垯璋冪敤content.Error鏂规硶锛岃褰曢敊璇俊鎭紝骞惰緭鍑洪敊璇俊鎭�
content.Error(err.Message);
- Console.WriteLine($"杞﹁疆娴佸悜鍒嗛厤澶辫触:{err.Message}");
+ Console.WriteLine($"杞﹁疆娴佸悜鍒嗛厤澶辫触:{err.Message}锛屾墭鐩樻潯鐮侊細{input.PalletCode}");
return content;
}
}
+
+ public WebResponseContent UpWheelsFlow(SaveModel saveModel)
+ {
+ WebResponseContent webResponse = new WebResponseContent();
+ try
+ {
+ string CZTM = saveModel.MainData["CZTM"].ToString();
+ string TargetAddress = saveModel.MainData["TargetAddress"].ToString();
+ List<Dt_Task> taskt = BaseDal.QueryData(x => x.task_CZInfo == CZTM).ToList();
+ if (taskt.Count() == 0)
+ return webResponse.Error($"鏈壘鍒板搴旇溅杞达細{CZTM}鐨勮溅杞嚭搴撲俊鎭�");
+ foreach (var item in taskt)
+ {
+ item.Towhereabouts = TargetAddress;
+ }
+ BaseDal.UpdateData(taskt);
+ return webResponse.OK();
+ }
+ catch (Exception ex)
+ {
+ // 濡傛灉鍙戠敓寮傚父锛屽垯璋冪敤content.Error鏂规硶锛岃褰曢敊璇俊鎭紝骞惰緭鍑洪敊璇俊鎭�
+ webResponse.Error(ex.Message);
+ return webResponse;
+ }
+ }
#endregion
}
\ No newline at end of file
--
Gitblit v1.9.3