From 2506b9b3a5cae018a797a4a5b2430d267b6a205f Mon Sep 17 00:00:00 2001
From: schangxiang@126.com <schangxiang@126.com>
Date: 周二, 20 5月 2025 10:49:21 +0800
Subject: [PATCH] 增加文件
---
PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application/Implements/SharedService.cs | 112 +++++++++++++++++++++++++++----------------------------
1 files changed, 55 insertions(+), 57 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 ff26b90..7b61b13 100644
--- a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application/Implements/SharedService.cs
+++ b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application/Implements/SharedService.cs
@@ -1,37 +1,29 @@
+using CMS.Extensions.Variable;
using CMS.Plugin.FormulaManagement.Abstractions;
+using CMS.Plugin.HIAWms.Application.Contracts.Dtos.CommonDto;
+using CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsMaterialStocks;
+using CMS.Plugin.MaterialManagement.Abstractions;
using CMS.Plugin.OrderManagement.Abstractions;
using CMS.Plugin.OrderManagement.Abstractions.Enums;
using CMS.Plugin.OrderManagement.Abstractions.Models;
-using CMS.Plugin.PipeLineLems.Application.Contracts.Dtos.WorkPlan;
-using CMS.Plugin.ProductManagement.Abstractions;
-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.Application.Contracts.Dtos.WorkPlan;
+using CMS.Plugin.PipeLineLems.Application.Contracts.Services;
+using CMS.Plugin.PipeLineLems.Domain.CallMaterialOrder;
using CMS.Plugin.PipeLineLems.Domain.CallMaterialOrderRecord;
-using Volo.Abp.Users;
-using CmsQueryExtensions.Entitys;
-using CMS.Unit.RuntimeValue.Abstractions;
-using CMS.Extensions.Variable;
-using CMS.Plugin.TraceManagement.Abstractions.Models.Traces;
+using CMS.Plugin.PipeLineLems.Domain.WorkPlan;
using CMS.Plugin.ProcessManagement.Abstractions;
-using KissUtil.Extensions;
+using CMS.Plugin.ProductManagement.Abstractions;
using CMS.Plugin.TraceManagement.Abstractions;
-using CMS.Plugin.ProductManagement.Abstractions.Models;
-using CMS.Plugin.MaterialManagement.Abstractions;
-using CMS.Plugin.HIAWms.Application.Contracts.Services;
-using CMS.Plugin.HIAWms.Application.Contracts.Dtos.CommonDto;
-using System.Collections.Generic;
-using CMS.Plugin.HIAWms.Abstractions;
-using Newtonsoft.Json;
+using CMS.Plugin.TraceManagement.Abstractions.Models.Traces;
using CmsQueryExtensions;
-using CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsMaterialStocks;
+using CmsQueryExtensions.Entitys;
+using CmsQueryExtensions.Extension;
+using KissUtil.Extensions;
+using Microsoft.Extensions.DependencyInjection;
+using Newtonsoft.Json;
+using Volo.Abp;
+using Volo.Abp.Uow;
namespace CMS.Plugin.PipeLineLems.Application.Implements;
@@ -50,6 +42,10 @@
/// <returns></returns>
public async Task<MesOrderResponse> CommonPick(IServiceProvider _serviceProvider, PickInput input, MyCurrentUser myCurrentUser)
{
+ if (string.IsNullOrEmpty(input.TaskCode))
+ {
+ throw new UserFriendlyException("璇疯緭鍏ヤ换鍔$紪鍙�");
+ };
if (string.IsNullOrEmpty(input.PipeSpecCode))
{
throw new UserFriendlyException("璇疯緭鍏ョ娈电紪鐮�");
@@ -111,9 +107,7 @@
});
}
//鐗╂枡鍙傛暟鍒楄〃
- var firstWorkPlans = await workPlanAppService.GetListByFilterAsync(x => x.PipeSpecCode == input.PipeSpecCode);
-
- var firstWorkPlan = await workPlanAppService.GetSingleByFilterAsync(x => x.PipeSpecCode == input.PipeSpecCode);
+ var firstWorkPlan = await workPlanAppService.GetSingleByFilterAsync(x => x.TaskCode == input.TaskCode);
var callMaterialOrder = await callMaterialOrderAppService.GetSingleByFilterAsync(x => x.DataIdentifier == firstWorkPlan.DataIdentifier);
//TODO:杩欓噷璋冪敤wms鐨勫彨鏂欐帴鍙�
try
@@ -126,7 +120,9 @@
StockNumber = 1,
MaterialBatch = callMaterialOrder.MaterialBatch,
- RedundantField1 = firstWorkPlan.ProcessRouteNumber //鎵╁睍瀛楁鏄剧ず 宸ヨ壓娴佸悜缂栧彿
+ RedundantField1 = firstWorkPlan.ProcessRouteNumber, //鎵╁睍瀛楁鏄剧ず 宸ヨ壓娴佸悜缂栧彿
+ RedundantField2 = firstWorkPlan.PipeSpecCode, //鎵╁睍瀛楁鏄剧ず 绠℃缂栫爜
+ RedundantField3 = firstWorkPlan.PipeSectionName, //鎵╁睍瀛楁鏄剧ず 绠℃鍚嶇О
};
string baseUrl = @"http://127.0.0.1:18000/api/v1/HIAWms/";
@@ -565,6 +561,7 @@
string url = baseUrl + "lMesOperate/LMesCallMaterial";
string json = JsonConvert.SerializeObject(param);
var result = HttpApiRequest.HttpPost(url, json);
+
var res = JsonConvert.DeserializeObject<CmsApiResponse<List<MyCallMaterialOutput>>>(result);
if (res.Code == 200)
{
@@ -577,6 +574,7 @@
{
throw new UserFriendlyException(res.Message);
}
+ //*/
}
catch (Exception)
{
@@ -1085,33 +1083,34 @@
WorkPlanDto workPlanDto = await _workPlanAppService.FindSingleByFilterAsync(input);
- //TODO:杩欓噷璋冪敤wms鐨勫彨鏂欐帴鍙�
+ //TODO:杩欓噷璋冪敤wms鐨勫簱瀛樻煡璇㈡帴鍙�
try
{
- List<LMesCallMaterialInput> param = new List<LMesCallMaterialInput>() {
- new LMesCallMaterialInput(){
+ GetWmsMaterialStockInput param = new GetWmsMaterialStockInput()
+ {
+ RedundantField1 = workPlanDto.ProcessRouteNumber,
+ RedundantField1_FilterMode = SearchFilterModeEnum.绮惧噯鏌ヨ
+ };
- }
- };
- /*
string baseUrl = @"http://127.0.0.1:18000/api/v1/HIAWms/";
- string url = baseUrl + "lMesOperate/LMesCallMaterial";
+ string url = baseUrl + "LMesOperate/FindListByFilter";
string json = JsonConvert.SerializeObject(param);
var result = HttpApiRequest.HttpPost(url, json);
- var res = JsonConvert.DeserializeObject<CmsApiResponse<List<MyCallMaterialOutput>>>(result);
+ var res = JsonConvert.DeserializeObject<CmsApiResponse<List<WmsMaterialStockDto>>>(result);
if (res.Code == 200)
{
- var retData = res.Data;
- //callMaterialOrder.MaterialBatch = retData[0].MaterialBatch;
- //callMaterialOrder.WmsTaskNo = retData[0].TaskNo;
- //callMaterialOrder.WmsRetResult = res.Message;
-
+ var retData = res.Data as List<WmsMaterialStockDto>;
var data = new PickOutput()
{
WorkPlan = workPlanDto,
PlaceNo = "",//寰呰祴鍊�
ContinerNo = ""//寰呰祴鍊�
};
+ if (retData?.Count > 0)
+ {
+ data.PlaceNo = retData.First().PlaceNo;
+ data.ContinerNo = retData.First().ContainerNo;
+ }
var response = new CmsApiResponse<PickOutput>
{
@@ -1125,23 +1124,22 @@
else
{
throw new UserFriendlyException(res.Message);
- }
+ };
//*/
//妯℃嫙
- var data = new PickOutput()
- {
- WorkPlan = workPlanDto,
- PlaceNo = "",//寰呰祴鍊�
- ContinerNo = ""//寰呰祴鍊�
- };
-
- var response = new CmsApiResponse<PickOutput>
- {
- Code = 200,
- Data = data,
- Message = "澶勭悊鎴愬姛",
- };
- return response;
+ //var data = new PickOutput()
+ //{
+ // WorkPlan = workPlanDto,
+ // PlaceNo = "",//寰呰祴鍊�
+ // ContinerNo = ""//寰呰祴鍊�
+ //};
+ //var response = new CmsApiResponse<PickOutput>
+ //{
+ // Code = 200,
+ // Data = data,
+ // Message = "澶勭悊鎴愬姛",
+ //};
+ //return response;
}
catch (Exception)
--
Gitblit v1.9.3