From 157f0b8a78b200bf68ce96a163d8d59432e78283 Mon Sep 17 00:00:00 2001 From: zongzhibin <zongzhibin@weben-smart.com> Date: 周四, 28 11月 2024 14:38:07 +0800 Subject: [PATCH] Merge branch 'master' of http://222.71.245.114:9086/r/LA24030-LuLI_PackageLine --- LA24030_LuLiPackageLine_Wms/Admin.NET.Application/Service/WmsTask/WmsRbLineTask/Dto/ValidateQiTaoOutput.cs | 20 ++ LA24030_LuLiPackageLine_Wms/Admin.NET.Application/Service/WmsTask/WmsRbLineTask/Dto/ValidateQiTaoInput.cs | 19 ++ CC/iWareCC_ASRS/Common/SystemWarningMsg.cs | 2 CC/iWareCommon/log4net_iWare.config | 16 +- LA24030_LuLiPackageLine_Wms/Admin.NET.Core/Const/CommonConst.cs | 4 CC/iWareCommon/Utils/Log4Net/LogType.cs | 2 CC/iWareCC_ASRS/FormCC.cs | 2 CC/iWareCC_ASRS/Common/SystemValue.cs | 2 CC/iWareCC_ASRS/ThreadService/05_BZ30(齐套验证)/DataProcess_ValidateQiTao.cs | 122 +++++++++++++++++ LA24030_LuLiPackageLine_Wms/Admin.NET.Application/Service/WmsTask/WmsRbLineTask/Dto/ValidateLabelInput.cs | 25 +++ CC/iWareModel/EnumType/WMS/AreaCodeEnum.cs | 9 + CC/iWareCC_ASRS/FormCC.Designer.cs | 50 +++--- LA24030_LuLiPackageLine_Wms/Admin.NET.Application/Enum/WmsOrder/AreaCodeEnum.cs | 8 + LA24030_LuLiPackageLine_Wms/Admin.NET.Application/Service/WmsTask/WmsOperationTaskService.cs | 101 ++++++++++++++ CC/iWareCC_ASRS/iWareCC.csproj | 1 15 files changed, 341 insertions(+), 42 deletions(-) diff --git a/CC/iWareCC_ASRS/Common/SystemValue.cs b/CC/iWareCC_ASRS/Common/SystemValue.cs index c94df98..e43c28f 100644 --- a/CC/iWareCC_ASRS/Common/SystemValue.cs +++ b/CC/iWareCC_ASRS/Common/SystemValue.cs @@ -134,7 +134,7 @@ /// </summary> public static bool isAllowRuning_DataProcess_RobotBuffer_ModeChange = false; - public static bool isAllowRuning_PrintHandler = false; + public static bool isAllowRuning_DataProcess_ValidateQiTao = false; /// <summary> /// 鏄惁鍏佽鎵ц 鍫嗗灈鏈哄叆鍙f壂鐮佹娴嬬嚎绋� diff --git a/CC/iWareCC_ASRS/Common/SystemWarningMsg.cs b/CC/iWareCC_ASRS/Common/SystemWarningMsg.cs index 7c8e007..e5efb8d 100644 --- a/CC/iWareCC_ASRS/Common/SystemWarningMsg.cs +++ b/CC/iWareCC_ASRS/Common/SystemWarningMsg.cs @@ -101,7 +101,7 @@ /// <summary> /// 杈撻�佺嚎浠诲姟瀹屾垚纭鐨勮鍛婃秷鎭� /// </summary> - public static string _lbl_Alert_PrintHandler = string.Empty; + public static string _lbl_Alert_DataProcess_ValidateQiTao = string.Empty; /// <summary> /// 娓呯悊鏁版嵁鐜板満 鐨勮鍛婃秷鎭� diff --git a/CC/iWareCC_ASRS/FormCC.Designer.cs b/CC/iWareCC_ASRS/FormCC.Designer.cs index 20736dc..ff78685 100644 --- a/CC/iWareCC_ASRS/FormCC.Designer.cs +++ b/CC/iWareCC_ASRS/FormCC.Designer.cs @@ -244,8 +244,8 @@ this.ckDataProcess_RobotBuffer_AutoQiTaoOutbound = new System.Windows.Forms.CheckBox(); this.lbl_Alert_DataProcess_RobotBuffer_IssueOutboundTask = new System.Windows.Forms.Label(); this.ck_DataProcess_RobotBuffer_IssueOutboundTask = new System.Windows.Forms.CheckBox(); - this.lbl_Alert_PrintHandler = new System.Windows.Forms.Label(); - this.ck_PrintHandler = new System.Windows.Forms.CheckBox(); + this.lbl_DataProcess_ValidateQiTao = new System.Windows.Forms.Label(); + this.ck_DataProcess_ValidateQiTao = new System.Windows.Forms.CheckBox(); this.lbl_MainTaskDecompose = new System.Windows.Forms.Label(); this.ckMainTaskDecompose = new System.Windows.Forms.CheckBox(); this.lbl_Alert_DeleteData = new System.Windows.Forms.Label(); @@ -3016,8 +3016,8 @@ this.groupBox1.Controls.Add(this.ckDataProcess_RobotBuffer_AutoQiTaoOutbound); this.groupBox1.Controls.Add(this.lbl_Alert_DataProcess_RobotBuffer_IssueOutboundTask); this.groupBox1.Controls.Add(this.ck_DataProcess_RobotBuffer_IssueOutboundTask); - this.groupBox1.Controls.Add(this.lbl_Alert_PrintHandler); - this.groupBox1.Controls.Add(this.ck_PrintHandler); + this.groupBox1.Controls.Add(this.lbl_DataProcess_ValidateQiTao); + this.groupBox1.Controls.Add(this.ck_DataProcess_ValidateQiTao); this.groupBox1.Controls.Add(this.lbl_MainTaskDecompose); this.groupBox1.Controls.Add(this.ckMainTaskDecompose); this.groupBox1.Controls.Add(this.lbl_Alert_DeleteData); @@ -3286,28 +3286,28 @@ this.ck_DataProcess_RobotBuffer_IssueOutboundTask.UseVisualStyleBackColor = true; this.ck_DataProcess_RobotBuffer_IssueOutboundTask.CheckedChanged += new System.EventHandler(this.CommonCheckedChanged); // - // lbl_Alert_PrintHandler + // lbl_DataProcess_ValidateQiTao // - this.lbl_Alert_PrintHandler.AutoSize = true; - this.lbl_Alert_PrintHandler.BackColor = System.Drawing.Color.White; - this.lbl_Alert_PrintHandler.ForeColor = System.Drawing.Color.Red; - this.lbl_Alert_PrintHandler.Location = new System.Drawing.Point(215, 492); - this.lbl_Alert_PrintHandler.Name = "lbl_Alert_PrintHandler"; - this.lbl_Alert_PrintHandler.Size = new System.Drawing.Size(70, 15); - this.lbl_Alert_PrintHandler.TabIndex = 37; - this.lbl_Alert_PrintHandler.Text = "label11"; + this.lbl_DataProcess_ValidateQiTao.AutoSize = true; + this.lbl_DataProcess_ValidateQiTao.BackColor = System.Drawing.Color.White; + this.lbl_DataProcess_ValidateQiTao.ForeColor = System.Drawing.Color.Red; + this.lbl_DataProcess_ValidateQiTao.Location = new System.Drawing.Point(215, 492); + this.lbl_DataProcess_ValidateQiTao.Name = "lbl_DataProcess_ValidateQiTao"; + this.lbl_DataProcess_ValidateQiTao.Size = new System.Drawing.Size(70, 15); + this.lbl_DataProcess_ValidateQiTao.TabIndex = 37; + this.lbl_DataProcess_ValidateQiTao.Text = "label11"; // - // ck_PrintHandler + // ck_DataProcess_ValidateQiTao // - this.ck_PrintHandler.AutoSize = true; - this.ck_PrintHandler.Location = new System.Drawing.Point(4, 492); - this.ck_PrintHandler.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); - this.ck_PrintHandler.Name = "ck_PrintHandler"; - this.ck_PrintHandler.Size = new System.Drawing.Size(125, 19); - this.ck_PrintHandler.TabIndex = 36; - this.ck_PrintHandler.Text = "打印服务线程"; - this.ck_PrintHandler.UseVisualStyleBackColor = true; - this.ck_PrintHandler.CheckedChanged += new System.EventHandler(this.CommonCheckedChanged); + this.ck_DataProcess_ValidateQiTao.AutoSize = true; + this.ck_DataProcess_ValidateQiTao.Location = new System.Drawing.Point(4, 492); + this.ck_DataProcess_ValidateQiTao.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.ck_DataProcess_ValidateQiTao.Name = "ck_DataProcess_ValidateQiTao"; + this.ck_DataProcess_ValidateQiTao.Size = new System.Drawing.Size(161, 19); + this.ck_DataProcess_ValidateQiTao.TabIndex = 36; + this.ck_DataProcess_ValidateQiTao.Text = "BZ30齐套验证线程"; + this.ck_DataProcess_ValidateQiTao.UseVisualStyleBackColor = true; + this.ck_DataProcess_ValidateQiTao.CheckedChanged += new System.EventHandler(this.CommonCheckedChanged); // // lbl_MainTaskDecompose // @@ -6152,8 +6152,8 @@ private System.Windows.Forms.CheckBox ckDeleteData; private System.Windows.Forms.Label lbl_MainTaskDecompose; private System.Windows.Forms.CheckBox ckMainTaskDecompose; - private System.Windows.Forms.Label lbl_Alert_PrintHandler; - private System.Windows.Forms.CheckBox ck_PrintHandler; + private System.Windows.Forms.Label lbl_DataProcess_ValidateQiTao; + private System.Windows.Forms.CheckBox ck_DataProcess_ValidateQiTao; private System.Windows.Forms.Label lbl_Alert_DataProcess_RobotBuffer_IssueOutboundTask; private System.Windows.Forms.CheckBox ck_DataProcess_RobotBuffer_IssueOutboundTask; private System.Windows.Forms.Button btn_1007; diff --git a/CC/iWareCC_ASRS/FormCC.cs b/CC/iWareCC_ASRS/FormCC.cs index 0e2098c..99387b2 100644 --- a/CC/iWareCC_ASRS/FormCC.cs +++ b/CC/iWareCC_ASRS/FormCC.cs @@ -1549,7 +1549,7 @@ DoCommonCheckedChanged(ref SystemValue.isAllowRuning_DataProcess_RobotBuffer_ModeChange, ck_DataProcess_RobotBuffer_ModeChange); - DoCommonCheckedChanged(ref SystemValue.isAllowRuning_PrintHandler, ck_PrintHandler); + DoCommonCheckedChanged(ref SystemValue.isAllowRuning_DataProcess_ValidateQiTao, ck_DataProcess_ValidateQiTao); DoCommonCheckedChanged(ref SystemValue.isAllowRuning_DataProcess_RobotBuffer_FinishTaskForOutbound, checkBox_DataProcess_RobotBuffer_FinishTaskForOutbound); diff --git "a/CC/iWareCC_ASRS/ThreadService/05_BZ30\050\351\275\220\345\245\227\351\252\214\350\257\201\051/DataProcess_ValidateQiTao.cs" "b/CC/iWareCC_ASRS/ThreadService/05_BZ30\050\351\275\220\345\245\227\351\252\214\350\257\201\051/DataProcess_ValidateQiTao.cs" new file mode 100644 index 0000000..adb6ebe --- /dev/null +++ "b/CC/iWareCC_ASRS/ThreadService/05_BZ30\050\351\275\220\345\245\227\351\252\214\350\257\201\051/DataProcess_ValidateQiTao.cs" @@ -0,0 +1,122 @@ +锘縰sing Admin.NET.Application; +using iWareCC.Common.Helper; +using iWareCC.StationService; +using iWareCommon.Common.Globle; +using iWareCommon.Utils; +using iWareModel; +using iWareSql.DataAccess; +using iWareSql.DBModel; +using iWareSql.WmsDBModel; +using System; +using System.Collections.Generic; +using System.Linq; +using System.ServiceModel.Configuration; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +using WZ.Useful.Commons; +using XiGang.Core.Model; + +namespace iWareCC.ThreadService +{ + /// <summary> + /// BZ30榻愬楠岃瘉 + /// </summary> + public static class DataProcess_ValidateQiTao + { + public static async void Handler() + { + var alertMsg = ""; + LogType logType = LogType.DataProcess_ValidateQiTao; + while (true) + { + Thread.Sleep(2000);//浼戠湢2绉掞紝灏嗕紤鐪犲啓鍒板墠闈紝鏄负浜嗕笅闈㈢殑continue鏂规硶鎵ц鍚庝笉鏄剧ず閿欒淇℃伅鐨勬彁绀猴紒锛侊紒銆怑ditBy shaocx,2022-05-24銆� + SystemWarningMsg._lbl_Alert_DataProcess_ValidateQiTao = string.Empty; + try + { + if (SystemValue.isAllowRuning_DataProcess_ValidateQiTao && SystemValue.isStartedModel) + { + var rgvLocation = StationLocationEnum.BZ39.ToString(); + + using (WmsDBModel wmsDB = new WmsDBModel()) + { + var bz30Config = wmsDB.SysConfig.Where(x => x.Code == "wms_bz30_qitao").FirstOrDefault(); + if (bz30Config == null) + { + SystemWarningMsg._lbl_Alert_DataProcess_ValidateQiTao = $"娌℃湁閰嶇疆 wms_bz30_qitao 鍊�"; + continue; + } + var configValue = bz30Config.Value; + if (string.IsNullOrEmpty(configValue) || configValue.IndexOf('|') <= -1) + { + SystemWarningMsg._lbl_Alert_DataProcess_ValidateQiTao = $"閰嶇疆 wms_bz30_qitao 鍊納configValue}涓虹┖鎴栦笉姝g‘"; + continue; + } + var configValues = configValue.Split('|'); + var packageCode = configValues[0]; + var qitaoValue = configValues[1];//榻愬 涓嶉綈濂� + + //TODO:鎺ㄩ�佺粰PLC 鍘诲摢涓柟鍚戯紵 + /* + using (StationServiceClient client = new StationServiceClient()) + { + var res = await client.ChangeModeAsync((int)EDevice.Station, (int)RbRunModeEnum.鍏ュ簱妯″紡, rgvLocation); + if (!res.result) + { + SystemWarningMsg._lbl_Alert_DataProcess_ValidateQiTao = $"{rgvLocation.ToString()}-鎺ㄩ�佺粰PLC鍒囨崲妯″紡 澶辫触,ChangeModeAsync 杩斿洖:{res.resMsg}"; + continue; + } + else + { + Log4NetHelper.WriteInfoLog(logType, $"{rgvLocation.ToString()}-鎺ㄩ�佺粰PLC鍒囨崲妯″紡 鎴愬姛,ChangeModeAsync锛屽弬鏁�: 绔欑偣{rgvLocation}"); + } + } + //*/ + + + //鏇存柊鍊� + bz30Config.Value = ""; + var gahter = wmsDB.mes_package_gather.Where(x => x.PackageCode == packageCode).FirstOrDefault(); + if (gahter != null) + { + gahter.UpiStatus = (int)UpiStatusEnum.宸蹭笅绾�; + gahter.AreaCode = (int)AreaCodeEnum.涓嬬嚎鍖哄煙; + } + var upiList = wmsDB.mes_batchOrderUPI_new.Where(x => x.PackageCode == packageCode).ToList(); + foreach (var item in upiList) + { + item.UpiStatus = (int)UpiStatusEnum.宸蹭笅绾�; + item.AreaCode = (int)AreaCodeEnum.涓嬬嚎鍖哄煙; + item.UpdateTime = DateTime.Now; + } + //鍒犻櫎闃熷垪淇℃伅 + var lineQueue = wmsDB.mes_package_linequeue.Where(x => x.PackageCode == packageCode).FirstOrDefault(); + if (lineQueue != null) + { + wmsDB.mes_package_linequeue.Remove(lineQueue); + } + //鏂板涓嬬嚎璁板綍 + mes_package_unline_record record = new mes_package_unline_record(); + record = ClassHelper.RotationMapping<mes_package_unline_record, mes_package_gather>(gahter); + record.Id = Yitter.IdGenerator.YitIdHelper.NextId(); + record.CreateTime = DateTime.Now; + record.UpdateTime = DateTime.Now; + record.OpRemark = "涓嬬嚎"; + wmsDB.mes_package_unline_record.Add(record); + + + wmsDB.SaveChanges(); + } + } + + } + catch (Exception ex) + { + SystemWarningMsg._lbl_Alert_DataProcess_ValidateQiTao += " 鍑虹幇寮傚父:" + ex.Message + SysGloble.SPLIT_STR; + Log4NetHelper.WriteErrorLog(logType, " 鍑虹幇寮傚父锛�" + ex.Message, ex); + } + } + } + + } +} diff --git a/CC/iWareCC_ASRS/iWareCC.csproj b/CC/iWareCC_ASRS/iWareCC.csproj index a4a5b7d..4f7ae2e 100644 --- a/CC/iWareCC_ASRS/iWareCC.csproj +++ b/CC/iWareCC_ASRS/iWareCC.csproj @@ -171,6 +171,7 @@ <Compile Include="ThreadService\03_BZ12%28鏈哄櫒浜虹爜鍖呭伐浣�%29\DataProcess_BZ12_FinishTask.cs" /> <Compile Include="ThreadService\04_BZ21锛堟惉杩愭暣鍨涙満鍣ㄤ汉锛塡DataProcess_BZ21.cs" /> <Compile Include="ThreadService\04_BZ21锛堟惉杩愭暣鍨涙満鍣ㄤ汉锛塡DataProcess_BZ21_FinishTask.cs" /> + <Compile Include="ThreadService\05_BZ30%28榻愬楠岃瘉%29\DataProcess_ValidateQiTao.cs" /> <Compile Include="WCF\CCWcfService.cs" /> <Compile Include="WCF\ICCWcfService.cs" /> <Compile Include="WmsTask\AutoUpdateEngineInfoTask.cs" /> diff --git a/CC/iWareCommon/Utils/Log4Net/LogType.cs b/CC/iWareCommon/Utils/Log4Net/LogType.cs index 77b1216..6cb4de5 100644 --- a/CC/iWareCommon/Utils/Log4Net/LogType.cs +++ b/CC/iWareCommon/Utils/Log4Net/LogType.cs @@ -62,7 +62,7 @@ /// <summary> /// 鍑哄簱璁″垝 /// </summary> - PrintHandler = 300, + DataProcess_ValidateQiTao = 300, /// <summary> /// MES鏈嶅姟 diff --git a/CC/iWareCommon/log4net_iWare.config b/CC/iWareCommon/log4net_iWare.config index 8ccb8a7..2e1ab7c 100644 --- a/CC/iWareCommon/log4net_iWare.config +++ b/CC/iWareCommon/log4net_iWare.config @@ -262,8 +262,8 @@ <filter type="log4net.Filter.DenyAllFilter" /> </appender> <!--鍑哄簱璁″垝銆愪俊鎭�戞棩蹇�--> - <appender name="PrintHandler_Info" type="log4net.Appender.RollingFileAppender"> - <file value="d:\\Log\\LuLiMuYe\\iWareCC\\PrintHandler_Info\\" /> + <appender name="DataProcess_ValidateQiTao_Info" type="log4net.Appender.RollingFileAppender"> + <file value="d:\\Log\\LuLiMuYe\\iWareCC\\DataProcess_ValidateQiTao_Info\\" /> <appendToFile value="true" /> <rollingStyle value="Date" /> <staticLogFileName value="false" /> @@ -273,13 +273,13 @@ <param name="ConversionPattern" value="%n娑堟伅鏃堕棿锛�%d [%t] %n娑堟伅绾у埆锛�%-5p %n娑� 鎭� 绫伙細%c [%x] %n%m %n "/> </layout> <filter type="log4net.Filter.LoggerMatchFilter"> - <loggerToMatch value="PrintHandler_Info" /> + <loggerToMatch value="DataProcess_ValidateQiTao_Info" /> </filter> <filter type="log4net.Filter.DenyAllFilter" /> </appender> <!--鍑哄簱璁″垝銆愰敊璇�戞棩蹇�--> - <appender name="PrintHandler_Error" type="log4net.Appender.RollingFileAppender"> - <file value="d:\\Log\\LuLiMuYe\\iWareCC\\PrintHandler_Error\\" /> + <appender name="DataProcess_ValidateQiTao_Error" type="log4net.Appender.RollingFileAppender"> + <file value="d:\\Log\\LuLiMuYe\\iWareCC\\DataProcess_ValidateQiTao_Error\\" /> <appendToFile value="true" /> <rollingStyle value="Date" /> <staticLogFileName value="false" /> @@ -289,7 +289,7 @@ <param name="ConversionPattern" value="%n寮傚父鏃堕棿锛�%d [%t] %n寮傚父绾у埆锛�%-5p %n寮� 甯� 绫伙細%c [%x] %n%m %n "/> </layout> <filter type="log4net.Filter.LoggerMatchFilter"> - <loggerToMatch value="PrintHandler_Error" /> + <loggerToMatch value="DataProcess_ValidateQiTao_Error" /> </filter> <filter type="log4net.Filter.DenyAllFilter" /> </appender> @@ -640,8 +640,8 @@ <appender-ref ref="DataProcess_RobotBuffer_AutoQiTaoOutbound_Error"/> <appender-ref ref="DataProcess_RobotBuffer_ModeChange_Info"/> <appender-ref ref="DataProcess_RobotBuffer_ModeChange_Error"/> - <appender-ref ref="PrintHandler_Info"/> - <appender-ref ref="PrintHandler_Error"/> + <appender-ref ref="DataProcess_ValidateQiTao_Info"/> + <appender-ref ref="DataProcess_ValidateQiTao_Error"/> <!--鍫嗗灈鏈轰换鍔$嚎绋嬫棩蹇�--> <appender-ref ref="SrmTheadService_Info"/> <appender-ref ref="SrmTheadService_Error"/> diff --git a/CC/iWareModel/EnumType/WMS/AreaCodeEnum.cs b/CC/iWareModel/EnumType/WMS/AreaCodeEnum.cs index 3540074..87cd603 100644 --- a/CC/iWareModel/EnumType/WMS/AreaCodeEnum.cs +++ b/CC/iWareModel/EnumType/WMS/AreaCodeEnum.cs @@ -54,8 +54,15 @@ /// </summary> [Description("鍖呰绾垮尯鍩�")] - 鍖呰绾垮尯鍩� = 6 + 鍖呰绾垮尯鍩� = 6, + + /// <summary> + /// 涓嬬嚎鍖哄煙 + /// </summary> + [Description("涓嬬嚎鍖哄煙")] + + 涓嬬嚎鍖哄煙 = 7 } } \ No newline at end of file diff --git a/LA24030_LuLiPackageLine_Wms/Admin.NET.Application/Enum/WmsOrder/AreaCodeEnum.cs b/LA24030_LuLiPackageLine_Wms/Admin.NET.Application/Enum/WmsOrder/AreaCodeEnum.cs index 96932b4..4c63e17 100644 --- a/LA24030_LuLiPackageLine_Wms/Admin.NET.Application/Enum/WmsOrder/AreaCodeEnum.cs +++ b/LA24030_LuLiPackageLine_Wms/Admin.NET.Application/Enum/WmsOrder/AreaCodeEnum.cs @@ -52,6 +52,12 @@ /// </summary> [Description("鍖呰绾垮尯鍩�")] - 鍖呰绾垮尯鍩� = 6 + 鍖呰绾垮尯鍩� = 6, + /// <summary> + /// 涓嬬嚎鍖哄煙 + /// </summary> + [Description("涓嬬嚎鍖哄煙")] + + 涓嬬嚎鍖哄煙 = 7 } diff --git a/LA24030_LuLiPackageLine_Wms/Admin.NET.Application/Service/WmsTask/WmsOperationTaskService.cs b/LA24030_LuLiPackageLine_Wms/Admin.NET.Application/Service/WmsTask/WmsOperationTaskService.cs index 10276d2..dc62396 100644 --- a/LA24030_LuLiPackageLine_Wms/Admin.NET.Application/Service/WmsTask/WmsOperationTaskService.cs +++ b/LA24030_LuLiPackageLine_Wms/Admin.NET.Application/Service/WmsTask/WmsOperationTaskService.cs @@ -4,6 +4,9 @@ using System.Data; using System.Web; using System.Text; +using DocumentFormat.OpenXml.Office.CustomUI; +using Microsoft.CodeAnalysis.Operations; + namespace Admin.NET.Application; /// <summary> /// 鎿嶄綔浠诲姟鏈嶅姟 @@ -13,10 +16,20 @@ { private readonly SqlSugarRepository<WmsRbLineTask> _rep; private readonly SqlSugarRepository<WmsStockQuan> _wmsStockQuanRep; - public WmsOperationTaskService(SqlSugarRepository<WmsRbLineTask> rep, SqlSugarRepository<WmsStockQuan> wmsStockQuanRep) + private readonly SqlSugarRepository<Mes_Package_Gather> _mesPackageGatherRep; + private readonly SqlSugarRepository<SysConfig> _sysConfigRep; + private readonly SqlSugarRepository<Mes_BatchOrderUPI_New> _mesBatchOrderUpiRep; + public WmsOperationTaskService(SqlSugarRepository<WmsRbLineTask> rep, SqlSugarRepository<WmsStockQuan> wmsStockQuanRep + , SqlSugarRepository<Mes_Package_Gather> mesPackageGatherRep + , SqlSugarRepository<SysConfig> sysConfigRep + , SqlSugarRepository<Mes_BatchOrderUPI_New> mesBatchOrderUpiRep + ) { + _sysConfigRep = sysConfigRep; + _mesPackageGatherRep = mesPackageGatherRep; _rep = rep; _wmsStockQuanRep = wmsStockQuanRep; + _mesBatchOrderUpiRep = mesBatchOrderUpiRep; } @@ -59,6 +72,92 @@ } + /// <summary> + /// 鍒ゆ柇榻愬 + /// </summary> + /// <param name="input"></param> + /// <returns></returns> + [HttpPost] + [ApiDescriptionSettings(Name = "ValdateQiTao")] + [Description("WmsOperationTask/ValdateQiTao")] + public async Task<ValidateQiTaoOutput> ValdateQiTao(ValidateQiTaoInput input) + { + ValidateQiTaoOutput output = new ValidateQiTaoOutput(); + if (input == null || input.PackageCode == null) + { + throw Oops.Oh("鍙傛暟涓嶈兘涓虹┖"); + } + var singlePackage = await _mesPackageGatherRep.AsQueryable().Where(x => x.PackageCode == input.PackageCode).FirstAsync(); + if (singlePackage == null) + { + throw Oops.Oh($"娌℃湁鎵惧埌鍖呭彿{input.PackageCode}鐨勬眹鎬绘暟鎹�"); + } + var setValue = ""; + var _QiTaoReuslt = ""; + var other_orderList = await _mesPackageGatherRep.AsQueryable().Where(x => x.Info5 == singlePackage.Info5 && x.PackageCode != input.PackageCode).ToListAsync(); + var num = other_orderList.Where(x => x.UpiStatus == UpiStatusEnum.鍒濆 || x.UpiStatus == UpiStatusEnum.涓嶉綈鍖�).Count(); + if (num > 0) + { + //涓嶉綈濂� + setValue = $"{input.PackageCode}|涓嶉綈濂�"; + _QiTaoReuslt = "涓嶉綈濂�"; + } + else + { + setValue = $"{input.PackageCode}|榻愬"; + _QiTaoReuslt = "榻愬"; + } + + var sysConfig = await _sysConfigRep.GetFirstAsync(x => x.Code == CommonConst.WmsBZ30_QiTao); + if (sysConfig == null) + { + throw Oops.Oh($"娌℃湁閰嶇疆 鍒ゆ柇榻愬 鍊�"); + } + if (!string.IsNullOrEmpty(sysConfig.Value)) + { + throw Oops.Oh($"鍒ゆ柇榻愬鍊煎凡缁忓瓨鍦ㄥ�納sysConfig.Value},涓嶅厑璁告搷浣�"); + } + sysConfig.Value = setValue; + await _sysConfigRep.UpdateAsync(sysConfig); + + output = singlePackage.Adapt<ValidateQiTaoOutput>(); + output.QiTaoReuslt = _QiTaoReuslt; + return output; + } + + + /// <summary> + /// 鏍稿鏍囩 + /// </summary> + /// <param name="input"></param> + /// <returns></returns> + [HttpPost] + [ApiDescriptionSettings(Name = "ValdateLabel")] + [Description("WmsOperationTask/ValdateLabel")] + public async Task<Mes_Package_Gather> ValdateLabel(ValidateLabelInput input) + { + if (input == null || input.PackageCode == null || input.Upi == null) + { + throw Oops.Oh("鍙傛暟涓嶈兘涓虹┖"); + } + + var singleUpi = await _mesBatchOrderUpiRep.AsQueryable().Where(x => x.UPI == input.Upi).FirstAsync(); + if (singleUpi == null) + { + throw Oops.Oh($"娌℃湁鎵惧埌閮ㄤ欢鏉$爜{input.Upi}鐨勬暟鎹�"); + } + if (singleUpi.PackageCode != input.PackageCode) + { + throw Oops.Oh($"閮ㄤ欢鏉$爜{input.Upi}鎵�灞炲寘鏄瘂singleUpi.PackageCode},璺熸壂鎻忕殑鍖呭彿{input.PackageCode}涓嶇"); + } + + var singlePackage = await _mesPackageGatherRep.AsQueryable().Where(x => x.PackageCode == input.PackageCode).FirstAsync(); + if (singlePackage == null) + { + throw Oops.Oh($"娌℃湁鎵惧埌鍖呭彿{input.PackageCode}鐨勬眹鎬绘暟鎹�"); + } + return singlePackage; + } } diff --git a/LA24030_LuLiPackageLine_Wms/Admin.NET.Application/Service/WmsTask/WmsRbLineTask/Dto/ValidateLabelInput.cs b/LA24030_LuLiPackageLine_Wms/Admin.NET.Application/Service/WmsTask/WmsRbLineTask/Dto/ValidateLabelInput.cs new file mode 100644 index 0000000..1bbdfb7 --- /dev/null +++ b/LA24030_LuLiPackageLine_Wms/Admin.NET.Application/Service/WmsTask/WmsRbLineTask/Dto/ValidateLabelInput.cs @@ -0,0 +1,25 @@ +锘縰sing Admin.NET.Core; +using System.ComponentModel.DataAnnotations; + +namespace Admin.NET.Application; + +/// <summary> +/// 鏍稿鏍囩杈撳叆鍙傛暟 +/// </summary> +public class ValidateLabelInput +{ + + /// <summary> + /// 鍖呰鍙� + /// </summary> + public virtual string PackageCode { get; set; } + + + /// <summary> + /// 閮ㄤ欢鏉$爜 + /// </summary> + public virtual string Upi { get; set; } + +} + + diff --git a/LA24030_LuLiPackageLine_Wms/Admin.NET.Application/Service/WmsTask/WmsRbLineTask/Dto/ValidateQiTaoInput.cs b/LA24030_LuLiPackageLine_Wms/Admin.NET.Application/Service/WmsTask/WmsRbLineTask/Dto/ValidateQiTaoInput.cs new file mode 100644 index 0000000..4372021 --- /dev/null +++ b/LA24030_LuLiPackageLine_Wms/Admin.NET.Application/Service/WmsTask/WmsRbLineTask/Dto/ValidateQiTaoInput.cs @@ -0,0 +1,19 @@ +锘縰sing Admin.NET.Core; +using System.ComponentModel.DataAnnotations; + +namespace Admin.NET.Application; + +/// <summary> +/// 鍒ゆ柇榻愬杈撳叆鍙傛暟 +/// </summary> +public class ValidateQiTaoInput +{ + + /// <summary> + /// 鍖呰鍙� + /// </summary> + public virtual string PackageCode { get; set; } + +} + + diff --git a/LA24030_LuLiPackageLine_Wms/Admin.NET.Application/Service/WmsTask/WmsRbLineTask/Dto/ValidateQiTaoOutput.cs b/LA24030_LuLiPackageLine_Wms/Admin.NET.Application/Service/WmsTask/WmsRbLineTask/Dto/ValidateQiTaoOutput.cs new file mode 100644 index 0000000..44d86d6 --- /dev/null +++ b/LA24030_LuLiPackageLine_Wms/Admin.NET.Application/Service/WmsTask/WmsRbLineTask/Dto/ValidateQiTaoOutput.cs @@ -0,0 +1,20 @@ +锘縰sing Admin.NET.Application.Entity; +using Admin.NET.Core; +using System.ComponentModel.DataAnnotations; + +namespace Admin.NET.Application; + +/// <summary> +/// 鍒ゆ柇榻愬杈撳嚭鍙傛暟 +/// </summary> +public class ValidateQiTaoOutput: Mes_Package_Gather +{ + + /// <summary> + /// 榻愬缁撴灉 + /// </summary> + public virtual string QiTaoReuslt { get; set; } + +} + + diff --git a/LA24030_LuLiPackageLine_Wms/Admin.NET.Core/Const/CommonConst.cs b/LA24030_LuLiPackageLine_Wms/Admin.NET.Core/Const/CommonConst.cs index a01457c..0a22a6b 100644 --- a/LA24030_LuLiPackageLine_Wms/Admin.NET.Core/Const/CommonConst.cs +++ b/LA24030_LuLiPackageLine_Wms/Admin.NET.Core/Const/CommonConst.cs @@ -99,9 +99,9 @@ public const string SysAddQCOrder = "sys_add_qc_order"; /// <summary> - /// ASN鍗曞垱寤虹敓鎴愯窡韪爜绫诲瀷 :涓�缁寸爜銆佷簩缁寸爜 + /// BZ30涓嬬嚎鐐归綈濂楀垽鏂� 銆怑ditby shaocx,2024-11-28銆� /// </summary> - public const string SysCreateSnCodeType = "sys_create_sncode_type"; + public const string WmsBZ30_QiTao = "wms_bz30_qitao"; /// <summary> -- Gitblit v1.9.3