From 413f167eacffa8958341bcdcf7bc97d547664868 Mon Sep 17 00:00:00 2001
From: schangxiang@126.com <schangxiang@126.com>
Date: 周二, 13 5月 2025 06:13:02 +0800
Subject: [PATCH] 高级查询初步
---
PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application/Implements/SharedService.cs | 442 +++++++++++++++++++++++++++++++++++++++++++-----------
1 files changed, 350 insertions(+), 92 deletions(-)
diff --git a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application/Implements/SharedService.cs b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application/Implements/SharedService.cs
index 2e16c41..7211e3f 100644
--- a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application/Implements/SharedService.cs
+++ b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application/Implements/SharedService.cs
@@ -7,17 +7,69 @@
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp;
using Microsoft.Extensions.DependencyInjection;
+using NPOI.Util;
+using CMS.Plugin.PipeLineLems.Domain.CallMaterialOrder;
+using CMS.Plugin.PipeLineLems.Application.Contracts.Services;
+using CMS.Plugin.PipeLineLems.Application.Contracts.Dtos.CallMaterialOrder;
+using Volo.Abp.Uow;
+using System.Text;
+using CMS.Plugin.PipeLineLems.Domain.WorkPlan;
+using CMS.Plugin.PipeLineLems.Domain.CallMaterialOrderRecord;
+using Volo.Abp.Users;
+using CmsQueryExtensions.Entitys;
+using CMS.Unit.RuntimeValue.Abstractions;
+using CMS.Extensions.Variable;
namespace CMS.Plugin.PipeLineLems.Application.Implements;
/// <summary>
/// 浣滀笟璁″垝琛ㄥ簲鐢ㄦ湇鍔�
/// </summary>
-public class SharedService: CMSPluginAppService
+public class SharedService : CMSPluginAppService
{
-
- public async Task<MesOrderResponse> CommonCreatebyApsAsync(List<WorkPlanInput> input, IServiceProvider _serviceProvider, WorkPlanAppService workPlanAppService)
+
+
+ public async Task<MesOrderResponse> CommonPick(IServiceProvider _serviceProvider, PickInput input, MyCurrentUser myCurrentUser)
{
+ //1銆佽褰曞垎鎷h褰曡〃
+ //2銆佹洿鏂颁綔涓氳鍒掕〃鐨勭姸鎬� =宸插垎鎷�
+ //3銆佸啓鍏� 鍒嗘嫞鍙橀噺
+
+ VariableService _variableService = _serviceProvider.GetRequiredService<VariableService>();
+
+ Dictionary<string, object?> keyValuePairs = new Dictionary<string, object?>
+ {
+ { "鍒嗘嫞鎵樼洏鍙�","鎵樼洏1"},
+ { "鍒嗘嫞鏂瑰悜", "鐭瑁呴厤"},
+ { "鍒嗘嫞浜�", myCurrentUser.UserAccount }
+ };
+ _variableService.WriteValueAsync(keyValuePairs);
+ var response = new MesOrderResponse
+ {
+ Code = "000000",
+ Data = "",
+ Fail = false,
+ Mesg = "澶勭悊鎴愬姛",
+ Success = true,
+ Time = DateTime.UtcNow
+ };
+ return response;
+ }
+ /// <summary>
+ /// 鍒涘缓浣滀笟璁″垝
+ /// </summary>
+ /// <param name="input"></param>
+ /// <param name="_serviceProvider"></param>
+ /// <param name="workPlanAppService"></param>
+ /// <returns></returns>
+ /// <exception cref="UserFriendlyException"></exception>
+
+ public async Task<MesOrderResponse> CommonCreatebyApsAsync(List<WorkPlanInput> input, IServiceProvider _serviceProvider,
+ WorkPlanAppService workPlanAppService,
+ string userId, string userAccount
+ )
+ {
+
if (input == null)
{
throw new UserFriendlyException("杈撳叆鍙傛暟涓嶈兘涓虹┖");
@@ -28,111 +80,179 @@
throw new UserFriendlyException("杈撳叆鍙傛暟Data涓嶈兘涓虹┖");
}
+ //鏍¢獙鏁版嵁
+ //1銆佸師鏂欐爣璇嗙浉鍚岀殑涓嶈兘瀛樺湪浜庝袱涓� 绠℃缂栧彿涓�
+ //var validationResult = ValidateUniqueDataIdentifierPerPipeSection(input);
+ //if (!validationResult.isValid)
+ //{
+ // 澶勭悊楠岃瘉澶辫触鐨勬儏鍐�
+ // throw new UserFriendlyException($"楠岃瘉澶辫触: {validationResult.errorMessage}");
+ // 杩斿洖閿欒淇℃伅缁欏鎴风鎴栬繘琛屽叾浠栧鐞�
+ //}
+
+
+ var callMaterialOrderAppService = _serviceProvider.GetRequiredService<ICallMaterialOrderAppService>();
+
var orderManager = _serviceProvider.GetRequiredService<IOrderManager>();
var productProvider = _serviceProvider.GetRequiredService<IProductProvider>();
var formulaProvider = _serviceProvider.GetRequiredService<IFormulaProvider>();
+
List<OrderModel> orderModels = new List<OrderModel>();
- //鎸夌収浠诲姟缂栧彿鍒嗙粍
- var groupTask = input.GroupBy(x => x.TaskCode);
- foreach (var gTask in groupTask)
+
+ #region 浜嬪姟
+
+ using var scope = _serviceProvider.CreateScope();
+ var unitOfWorkManager = scope.ServiceProvider.GetRequiredService<IUnitOfWorkManager>();
+ using var uow = unitOfWorkManager.Begin(requiresNew: true);
+
+ try
{
- var taskCode = gTask.Key;
- var order = await orderManager.GetByCodeAsync(taskCode);
- if (order != null)
+ #region 鏁版嵁澶勭悊
+
+ //鎸夌収 鍘熸枡鏍囪瘑 鍒嗙粍
+ var groupTask = input.GroupBy(x => x.DataIdentifier);
+ foreach (var gTask in groupTask)
{
- throw new UserFriendlyException($"浠诲姟缂栧彿[{taskCode}]宸插瓨鍦�");
- }
- //var product = await productProvider.FindByNameAsync(orderItem.PipeSectionName);
- //if (product == null)
- //{
- // throw new UserFriendlyException($"浜у搧鍚嶇О[{orderItem.PipeSectionName}]涓嶅瓨鍦�");
- //}
- //var formula = await formulaProvider.GetFormulaAsync(product.Id);
- //if (formula == null)
- //{
- // throw new UserFriendlyException($"浜у搧鍨嬪彿[{orderItem.MaterialCode}]鏃犲叧鑱旈厤鏂�");
- //}
- //棣栧厛瑕佸垱寤� 鎵撶爜鍒囧壊鐨勫伐鍗�
- var productForCut = await productProvider.FindByNameAsync("鍒囧壊鍘熸枡绠�");
- if (productForCut == null)
- {
- throw new UserFriendlyException($"浜у搧鍚嶇О[鍒囧壊鍘熸枡绠涓嶅瓨鍦�");
- }
- var formulaForCut = await formulaProvider.GetFormulaAsync(productForCut.Id);
- if (formulaForCut == null)
- {
- throw new UserFriendlyException($"浜у搧鍚嶇О[鍒囧壊鍘熸枡绠鏃犲叧鑱旈厤鏂�");
- }
- //鍒嗙粍鏁版嵁
- var group = gTask.ToList().GroupBy(x => x.DataIdentifier);
- foreach (var item in group)
- {
- OrderModel orderModelForCut = new OrderModel()
- {
- Id = Guid.NewGuid(),
- Code = "Cut_" + taskCode,
- Source = "APS鎺ㄩ��",
- PlanStartTime = gTask.ToList().First().PlannedStartTime,
- PlanFinishTime = gTask.ToList().First().PlannedEndTime,
- PlanQty = (ulong)item.ToList().Count,
- Status = OrderStatus.NotActive,
- Product = new AssociationProductModel() { Id = productForCut.Id, Name = productForCut.Name, Model = productForCut.Model, ShortNumber = productForCut.ShortNumber },
- Formula = new AssociationFormulaModel() { Id = formulaForCut.Id, Code = formulaForCut.Code, Name = formulaForCut.Name }
- };
- orderModelForCut.ExtraProperties["OuterDiameter"] = gTask.ToList().First().OuterDiameter;//澶栧緞
- orderModelForCut.ExtraProperties["Material"] = gTask.ToList().First().Material;//鏉愯川
- orderModelForCut.ExtraProperties["Length"] = gTask.ToList().First().Length;//闀垮害
-
- var orderForCut = await orderManager.GetByCodeAsync(orderModelForCut.Code);
- if (orderForCut != null)
- {
- //throw new UserFriendlyException($"宸ュ崟[{orderModelForCut.Code}]宸插瓨鍦�");
- //涓嶅啀鎶涘紓甯革紝鐩存帴璺宠繃
- break;
- }
-
- var orderModelResultForCut = await orderManager.CreateAsync(orderModelForCut);
- if (orderModelResultForCut == null)
- {
- throw new UserFriendlyException($"宸ュ崟[{orderModelForCut.Code}]鍒涘缓澶辫触");
- }
- orderModels.Add(orderModelResultForCut);
-
-
- //OrderModel orderModel = new OrderModel();
- //orderModel.Id = Guid.NewGuid();
- //orderModel.Code = orderItem.TaskCode;
- //orderModel.Source = "APS鎺ㄩ��";
- //orderModel.Product = new AssociationProductModel() { Id = product.Id, Name = product.Name, Model = product.Model, ShortNumber = product.ShortNumber };
- ////orderModel.Formula = new AssociationFormulaModel() { Id = formula.Id, Code = formula.Code, Name = formula.Name };
- //orderModel.PlanStartTime = orderItem.PlannedStartTime;
- //orderModel.PlanFinishTime = orderItem.PlannedEndTime;
- //orderModel.PlanQty = (ulong?)orderItem.OrderQty;
- //orderModel.Status = OrderStatus.NotActive;
- //orderModel.ExtraProperties["Source"] = "ddd";
- //var source = orderModel.ExtraProperties["Source"];
- //var orderModelResult = await orderManager.CreateAsync(orderModel);
- //if (orderModelResult == null)
+ //var product = await productProvider.FindByNameAsync(orderItem.PipeSectionName);
+ //if (product == null)
//{
- // throw new UserFriendlyException($"宸ュ崟[{orderItem.TaskCode}]鍒涘缓澶辫触");
+ // throw new UserFriendlyException($"浜у搧鍚嶇О[{orderItem.PipeSectionName}]涓嶅瓨鍦�");
//}
- //orderModels.Add(orderModelResult);
+
+ //var formula = await formulaProvider.GetFormulaAsync(product.Id);
+ //if (formula == null)
+ //{
+ // throw new UserFriendlyException($"浜у搧鍨嬪彿[{orderItem.MaterialCode}]鏃犲叧鑱旈厤鏂�");
+ //}
+ //棣栧厛瑕佸垱寤� 鎵撶爜鍒囧壊鐨勫伐鍗�
+ var productForCut = await productProvider.FindByNameAsync("鍒囧壊鍘熸枡绠�");
+ if (productForCut == null)
+ {
+ throw new UserFriendlyException($"浜у搧鍚嶇О[鍒囧壊鍘熸枡绠涓嶅瓨鍦�");
+ }
+ var formulaForCut = await formulaProvider.GetFormulaAsync(productForCut.Id);
+ if (formulaForCut == null)
+ {
+ throw new UserFriendlyException($"浜у搧鍚嶇О[鍒囧壊鍘熸枡绠鏃犲叧鑱旈厤鏂�");
+ }
+ //鎸夌収 绠℃缂栧彿 鍒嗙粍
+ var group = gTask.ToList().GroupBy(x => x.PipeSpecCode);
+ foreach (var item in group)
+ {
+ var prodOrderNo = "Order_" + item.Key;
+ var order = await orderManager.GetByCodeAsync(prodOrderNo);
+ if (order != null)
+ {
+ //throw new UserFriendlyException($"鐢熶骇宸ュ崟[{prodOrderNo}]宸插瓨鍦�");
+ continue;
+ }
+
+ OrderModel orderModelForCut = new OrderModel()
+ {
+ Id = Guid.NewGuid(),
+ Code = prodOrderNo,
+ Source = "APS鎺ㄩ��",
+ PlanStartTime = gTask.ToList().First().PlannedStartTime,
+ PlanFinishTime = gTask.ToList().First().PlannedEndTime,
+ PlanQty = 1,
+ Status = OrderStatus.NotActive,
+ Product = new AssociationProductModel() { Id = productForCut.Id, Name = productForCut.Name, Model = productForCut.Model, ShortNumber = productForCut.ShortNumber },
+ Formula = new AssociationFormulaModel() { Id = formulaForCut.Id, Code = formulaForCut.Code, Name = formulaForCut.Name }
+ };
+ orderModelForCut.ExtraProperties["OuterDiameter"] = gTask.ToList().First().OuterDiameter;//澶栧緞
+ orderModelForCut.ExtraProperties["Material"] = gTask.ToList().First().Material;//鏉愯川
+ orderModelForCut.ExtraProperties["Length"] = gTask.ToList().First().Length;//闀垮害
+ orderModelForCut.ExtraProperties["DataIdentifier"] = gTask.ToList().First().DataIdentifier;//鍘熸枡鏍囪瘑
+ orderModelForCut.ExtraProperties["MaterialMode"] = gTask.ToList().First().MaterialMode;//鍘熸枡绫诲瀷
+ orderModelForCut.ExtraProperties["PipeFittingCode"] = gTask.ToList().First().PipeFittingCode;//绠℃缂栧彿
+
+ var orderForCut = await orderManager.GetByCodeAsync(orderModelForCut.Code);
+ if (orderForCut != null)
+ {
+ //throw new UserFriendlyException($"宸ュ崟[{orderModelForCut.Code}]宸插瓨鍦�");
+ //涓嶅啀鎶涘紓甯革紝鐩存帴璺宠繃
+ break;
+ }
+
+ var orderModelResultForCut = await orderManager.CreateAsync(orderModelForCut);
+ if (orderModelResultForCut == null)
+ {
+ throw new UserFriendlyException($"宸ュ崟[{orderModelForCut.Code}]鍒涘缓澶辫触");
+ }
+ orderModels.Add(orderModelResultForCut);
+
+
+ //OrderModel orderModel = new OrderModel();
+ //orderModel.Id = Guid.NewGuid();
+ //orderModel.Code = orderItem.TaskCode;
+ //orderModel.Source = "APS鎺ㄩ��";
+ //orderModel.Product = new AssociationProductModel() { Id = product.Id, Name = product.Name, Model = product.Model, ShortNumber = product.ShortNumber };
+ ////orderModel.Formula = new AssociationFormulaModel() { Id = formula.Id, Code = formula.Code, Name = formula.Name };
+ //orderModel.PlanStartTime = orderItem.PlannedStartTime;
+ //orderModel.PlanFinishTime = orderItem.PlannedEndTime;
+ //orderModel.PlanQty = (ulong?)orderItem.OrderQty;
+ //orderModel.Status = OrderStatus.NotActive;
+ //orderModel.ExtraProperties["Source"] = "ddd";
+ //var source = orderModel.ExtraProperties["Source"];
+ //var orderModelResult = await orderManager.CreateAsync(orderModel);
+ //if (orderModelResult == null)
+ //{
+ // throw new UserFriendlyException($"宸ュ崟[{orderItem.TaskCode}]鍒涘缓澶辫触");
+ //}
+ //orderModels.Add(orderModelResult);
+ }
+
+
+ //淇濆瓨鍒� scms_callmaterialorders 琛ㄤ腑
+ CallMaterialOrderCreateDto insertObjForOrder = new CallMaterialOrderCreateDto()
+ {
+ CallMaterialStatus = Domain.Shared.Enums.CallMaterialStatusEnum.鏈墽琛�,
+ DataIdentifier = gTask.Key,
+ MaterialMode = gTask.ToList().First().MaterialMode,
+ CreatorName = userAccount,
+ Quantity = 1
+ };
+
+ await callMaterialOrderAppService.CreateAsync(insertObjForOrder);
}
+
+
+ //throw new UserFriendlyException($"涓诲姩瑙﹀彂澶辫触");
+ //淇濆瓨鍒� scms_workplans 琛ㄤ腑
+ foreach (var item in input)
+ {
+ var insertObj = ObjectMapper.Map<WorkPlanInput, WorkPlanCreateDto>(item);
+ //insertObj.OrgMaterialCode = "1111";
+ insertObj.CallMaterialStatus = Domain.Shared.Enums.CallMaterialStatusEnum.鏈墽琛�;
+ insertObj.WorkPlanStatus = Domain.Shared.Enums.WorkPlanStatusEnum.鏈敓浜�;
+ insertObj.Sort = 1;
+ insertObj.CreatorName = userAccount;
+ insertObj.Remark = "绯荤粺瀵煎叆";
+ await workPlanAppService.CreateAsync(insertObj);
+ }
+
+ #endregion
+
+ await uow.CompleteAsync();
}
-
-
- //淇濆瓨鍒拌〃涓�
- foreach (var item in input)
+ catch (Exception)
{
- var insertObj = ObjectMapper.Map<WorkPlanInput, WorkPlanCreateDto>(item);
- //insertObj.OrgMaterialCode = "1111";
- insertObj.Sort = 1;
- await workPlanAppService.CreateAsync(insertObj);
+ await uow.RollbackAsync();
+ throw;
}
+ finally
+ {
+
+ }
+
+
+
+ #endregion
+
// 鍙戝竷浜嬩欢
@@ -150,4 +270,142 @@
return response;
}
+ /// <summary>
+ /// 楠岃瘉鍘熸枡鏍囪瘑鐩稿悓鐨勮褰曚笉鑳藉瓨鍦ㄤ簬涓や釜涓嶅悓鐨勭娈电紪鍙蜂腑
+ /// </summary>
+ /// <param name="inputs">浣滀笟璁″垝杈撳叆鍙傛暟鍒楄〃</param>
+ /// <returns>楠岃瘉缁撴灉锛屽寘鍚槸鍚﹂�氳繃楠岃瘉鍙婇敊璇俊鎭�</returns>
+ public static (bool isValid, string errorMessage) ValidateUniqueDataIdentifierPerPipeSection(List<WorkPlanInput> inputs)
+ {
+ if (inputs == null || !inputs.Any())
+ {
+ return (true, string.Empty);
+ }
+
+ // 浣跨敤Lookup鍒嗙粍锛岄敭涓哄師鏂欐爣璇嗭紝鍊间负瀵瑰簲鐨勭娈电紪鍙烽泦鍚�
+ var dataIdentifierGroups = inputs.ToLookup(x => x.DataIdentifier, x => x.PipeSpecCode);
+
+ foreach (var group in dataIdentifierGroups)
+ {
+ // 蹇界暐绌虹殑鍘熸枡鏍囪瘑
+ if (string.IsNullOrEmpty(group.Key))
+ {
+ continue;
+ }
+
+ // 鑾峰彇褰撳墠鍘熸枡鏍囪瘑瀵瑰簲鐨勫敮涓�绠℃缂栧彿闆嗗悎
+ var uniquePipeSections = group.Distinct().ToList();
+
+ // 濡傛灉瀛樺湪澶氫釜涓嶅悓鐨勭娈电紪鍙凤紝鍒欒繚鍙嶈鍒�
+ if (uniquePipeSections.Count > 1)
+ {
+ return (false, $"鍘熸枡鏍囪瘑 '{group.Key}' 瀛樺湪浜庡涓笉鍚岀殑绠℃缂栧彿涓�: {string.Join(", ", uniquePipeSections)}");
+ }
+ }
+
+ return (true, string.Empty);
+ }
+
+
+ /// <summary>
+ /// 鏍规嵁鍘熸枡鏍囪瘑杩涜鍙枡鎿嶄綔
+ /// </summary>
+ /// <param name="dataIdentifier">鍘熸枡鏍囪瘑</param>
+ /// <param name="_serviceProvider">鏈嶅姟鎻愪緵鑰�</param>
+ /// <returns>鎿嶄綔缁撴灉</returns>
+ /// <exception cref="UserFriendlyException">褰撴暟鎹笉瀛樺湪鎴栫姸鎬佷笉鍏佽鍙枡鏃舵姏鍑�</exception>
+ public async Task<MesOrderResponse> CallMaterialByDataIdentifier(Guid id, IServiceProvider _serviceProvider)
+ {
+ if (string.IsNullOrEmpty(id.ToString()))
+ {
+ throw new UserFriendlyException("鍘熸枡鏍囪瘑涓嶈兘涓虹┖");
+ }
+
+ var callMaterialOrderRepository = _serviceProvider.GetRequiredService<ICallMaterialOrderRepository>();
+ var workPlanRepository = _serviceProvider.GetRequiredService<IWorkPlanRepository>();
+ var callMaterialOrderRecordRepository = _serviceProvider.GetRequiredService<ICallMaterialOrderRecordRepository>();
+ var orderManager = _serviceProvider.GetRequiredService<IOrderManager>();
+
+ // 鏌ユ壘鏁版嵁
+
+ var callMaterialOrder = await callMaterialOrderRepository.GetAsync(id);
+ if (callMaterialOrder == null)
+ {
+ throw new UserFriendlyException($"鎵句笉鍒板彨鏂欒褰�");
+ }
+
+ // 楠岃瘉鐘舵��
+ if (callMaterialOrder.CallMaterialStatus != Domain.Shared.Enums.CallMaterialStatusEnum.鏈墽琛�)
+ {
+ throw new UserFriendlyException($"鍘熸枡鏍囪瘑涓� '{callMaterialOrder.DataIdentifier}' 鐨勫彨鏂欒褰曠姸鎬佷负 '{callMaterialOrder.CallMaterialStatus}'锛屼笉鍏佽鍙枡");
+ }
+
+ // 鏇存柊鏁版嵁
+ callMaterialOrder.WmsRetResult = "鎴愬姛";
+ callMaterialOrder.WmsTaskNo = GenerateRandomTaskNo();
+ callMaterialOrder.CallMaterialStatus = Domain.Shared.Enums.CallMaterialStatusEnum.鍙枡瀹屾垚;
+ callMaterialOrder.LastModifierName = "SuperAdmin";
+
+ await callMaterialOrderRepository.UpdateAsync(callMaterialOrder);
+
+ //鏇存柊浣滀笟璁″垝琛�
+ var workPlanList = await workPlanRepository.FindByDataIdentifierAsync(callMaterialOrder.DataIdentifier);
+ foreach (var item in workPlanList)
+ {
+ item.CallMaterialStatus = Domain.Shared.Enums.CallMaterialStatusEnum.鍙枡瀹屾垚;
+ item.LastModifierName = "SuperAdmin";
+ }
+ await workPlanRepository.UpdateManyAsync(workPlanList);
+
+ //鏂板鍙枡璁板綍琛�
+ var callMaterialOrderRecord = new CallMaterialOrderRecord()
+ {
+ CallMaterialStatus = Domain.Shared.Enums.CallMaterialStatusEnum.鍙枡瀹屾垚,
+ MaterialMode = callMaterialOrder.MaterialMode,
+ DataIdentifier = callMaterialOrder.DataIdentifier,
+ Quantity = 1,
+ WmsRetResult = callMaterialOrder.WmsRetResult,
+ WmsTaskNo = callMaterialOrder.WmsTaskNo,
+ CreatorName = "SuperAdmin"
+ };
+ await callMaterialOrderRecordRepository.InsertAsync(callMaterialOrderRecord);
+
+ //鏇存柊宸ュ崟琛ㄧ殑鐘舵��
+ var pipeSpecCodeList = workPlanList.Select(x => x.PipeSpecCode).Distinct().ToList();
+ foreach (var item in pipeSpecCodeList)
+ {
+ var prodOrderNo = "Order_" + item;
+ var order = await orderManager.GetByCodeAsync(prodOrderNo);
+ if (order != null)
+ {
+ order.ExtraProperties["CallMaterialStatus"] = Domain.Shared.Enums.CallMaterialStatusEnum.鍙枡瀹屾垚.ToString();
+ }
+ await orderManager.UpdateAsync(order);
+ }
+
+
+ // 杩斿洖缁撴灉
+ var response = new MesOrderResponse
+ {
+ Code = "000000",
+ Fail = false,
+ Mesg = "鍙枡鎴愬姛",
+ Success = true,
+ Time = DateTime.UtcNow
+ };
+ return response;
+ }
+
+ /// <summary>
+ /// 鐢熸垚闅忔満鐨刉msTaskNo
+ /// </summary>
+ /// <returns>闅忔満鐢熸垚鐨勪换鍔$紪鍙�</returns>
+ private string GenerateRandomTaskNo()
+ {
+ // 鑾峰彇褰撳墠鏃堕棿鎴筹紙浠�1970-01-01 00:00:00 UTC鍒扮幇鍦ㄧ殑绉掓暟锛�
+ long timestamp = new DateTimeOffset(DateTime.UtcNow).ToUnixTimeSeconds();
+
+ // 鐢熸垚鍓嶇紑
+ return $"WMS{timestamp}";
+ }
}
--
Gitblit v1.9.3