From 35df4146b88a841aca11404aeeb8da35a20ab992 Mon Sep 17 00:00:00 2001
From: zongzhibin <zongzhibin@weben-smart.com>
Date: 周五, 29 11月 2024 15:53:27 +0800
Subject: [PATCH] add
---
LA24030_LuLiPackageLine_Wms/Admin.NET.Application/Service/WmsTask/WmsOperationTaskService.cs | 128 ++++++++++++++++++++++++++++++++++++++++++
1 files changed, 127 insertions(+), 1 deletions(-)
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..6ce3158 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,10 @@
using System.Data;
using System.Web;
using System.Text;
+using DocumentFormat.OpenXml.Office.CustomUI;
+using Microsoft.CodeAnalysis.Operations;
+using Admin.NET.Application.Service.WmsTask.WmsRbLineTask.Dto;
+
namespace Admin.NET.Application;
/// <summary>
/// 鎿嶄綔浠诲姟鏈嶅姟
@@ -13,10 +17,24 @@
{
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;
+ private readonly SqlSugarRepository<Mes_Order_Gather> _mesOrderGatherRep;
+
+ public WmsOperationTaskService(SqlSugarRepository<WmsRbLineTask> rep, SqlSugarRepository<WmsStockQuan> wmsStockQuanRep
+ , SqlSugarRepository<Mes_Package_Gather> mesPackageGatherRep
+ , SqlSugarRepository<SysConfig> sysConfigRep
+ , SqlSugarRepository<Mes_BatchOrderUPI_New> mesBatchOrderUpiRep
+ , SqlSugarRepository<Mes_Order_Gather> mesOrderGatherRep
+ )
{
+ _sysConfigRep = sysConfigRep;
+ _mesPackageGatherRep = mesPackageGatherRep;
_rep = rep;
_wmsStockQuanRep = wmsStockQuanRep;
+ _mesBatchOrderUpiRep = mesBatchOrderUpiRep;
+ _mesOrderGatherRep = mesOrderGatherRep;
}
@@ -59,6 +77,114 @@
}
+ /// <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) && 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;
+ }
+
+
+ /// <summary>
+ /// 鏌ヨ涓嶉綈濂楀崟鎹�
+ /// </summary>
+ /// <param name="input"></param>
+ /// <returns></returns>
+ [HttpGet]
+ [ApiDescriptionSettings(Name = "QueryNoKittingList")]
+ [Description("WmsOperationTask/QueryNoKittingList")]
+ public async Task<List<Mes_Order_Gather>> QueryNoKittingList([FromQuery] KittingListInput input)
+ {
+ var list = await _mesOrderGatherRep.AsQueryable()
+ .WhereIF(!string.IsNullOrWhiteSpace(input.Info5), u => u.Info5.Contains(input.Info5.Trim()))
+ .WhereIF(!string.IsNullOrWhiteSpace(input.Info5), u => u.Info5.Contains(input.Info5.Trim()))
+ .Where(x=>((DateTime)x.CreateTime).ToString("yyyyMMdd")==DateTime.Now.ToString("yyyyMMdd"))
+ .Where(x => x.IsKitting == false)
+ .OrderBy(g => g.Id)
+ .ToListAsync(); // 纭繚鑾峰彇缁撴灉涓� List
+
+ return list; // 缁撴灉
+ }
}
--
Gitblit v1.9.3