From 6861434f1445d1685b67a24897890c34f8c54f85 Mon Sep 17 00:00:00 2001
From: wangxinhui <wangxinhui@hnkhzn.com>
Date: 星期三, 08 四月 2026 17:22:26 +0800
Subject: [PATCH] WCS&WMS代码更新
---
代码管理/WMS/WMSServices/WIDESEA_TaskInfoService/TaskService.cs | 98 +-----------------------------------------------
1 files changed, 3 insertions(+), 95 deletions(-)
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WMSServices/WIDESEA_TaskInfoService/TaskService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WMSServices/WIDESEA_TaskInfoService/TaskService.cs"
index 4d075e3..57c2da6 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WMSServices/WIDESEA_TaskInfoService/TaskService.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WMSServices/WIDESEA_TaskInfoService/TaskService.cs"
@@ -16,44 +16,21 @@
#endregion << 鐗� 鏈� 娉� 閲� >>
using AutoMapper;
-using Microsoft.AspNetCore.Mvc.ApiExplorer;
using Newtonsoft.Json;
using SqlSugar;
-using System.Reflection.Emit;
-using System.Threading.Tasks;
-using WIDESEA_Common.CommonEnum;
-using WIDESEA_Common.LocationEnum;
-using WIDESEA_Common.OrderEnum;
-using WIDESEA_Common.StockEnum;
using WIDESEA_Common.TaskEnum;
-using WIDESEA_Common.WareHouseEnum;
using WIDESEA_Core;
using WIDESEA_Core.BaseRepository;
using WIDESEA_Core.BaseServices;
-using WIDESEA_Core.Enums;
using WIDESEA_Core.Helper;
-using WIDESEA_DTO;
-using WIDESEA_DTO.ERP;
-using WIDESEA_DTO.Inbound;
-using WIDESEA_DTO.Stock;
using WIDESEA_DTO.Task;
using WIDESEA_External.ERPService;
using WIDESEA_External.MESService;
-using WIDESEA_External.Model;
using WIDESEA_IBasicRepository;
using WIDESEA_IBasicService;
-using WIDESEA_IInboundRepository;
-using WIDESEA_IInboundService;
-using WIDESEA_InboundRepository;
-using WIDESEA_IOutboundRepository;
-using WIDESEA_IOutboundService;
-using WIDESEA_IRecordService;
-using WIDESEA_IStockRepository;
-using WIDESEA_IStockService;
using WIDESEA_ITaskInfoRepository;
using WIDESEA_ITaskInfoService;
using WIDESEA_Model.Models;
-using WIDESEA_TaskInfoRepository;
namespace WIDESEA_TaskInfoService
{
@@ -61,19 +38,11 @@
{
private readonly IMapper _mapper;
private readonly IUnitOfWorkManage _unitOfWorkManage;
- private readonly IRecordService _recordService;
- private readonly IStockRepository _stockRepository;
- private readonly IStockService _stockService;
private readonly IBasicRepository _basicRepository;
private readonly IBasicService _basicService;
private readonly IInvokeERPService _invokeERPService;
private readonly IInvokeMESService _invokeMESService;
- private readonly IOutboundRepository _outboundRepository;
- private readonly IOutboundService _outboundService;
- private readonly IInboundRepository _inboundRepository;
- private readonly IInboundService _inboundService;
- private readonly IRepository<Dt_BlankStockInfo> _blankStockInfoRepository;
- private readonly IRepository<Dt_PalletCodeInfo> _palletCodeInfoRepository;
+ private readonly IRepository<Dt_StockInfo> _blankStockInfoRepository;
private readonly IApiInfoRepository _apiInfoRepository;
public ITaskRepository Repository => BaseDal;
@@ -87,23 +56,15 @@
public List<int> TaskOutboundTypes => typeof(TaskTypeEnum).GetEnumIndexList().Where(x => x >= 100 && x < 500).ToList();
- public TaskService(ITaskRepository BaseDal, IMapper mapper, IUnitOfWorkManage unitOfWorkManage, IStockRepository stockRepository, IBasicService basicService, IRecordService recordService, IStockService stockService, IBasicRepository basicRepository, IInvokeERPService invokeERPService, IOutboundRepository outboundRepository, IOutboundService outboundService, IInboundRepository inboundRepository,IInboundService inboundService,IInvokeMESService invokeMESService, IRepository<Dt_BlankStockInfo> blankStockInfoRepository, IRepository<Dt_PalletCodeInfo> palletCodeInfoRepository,IApiInfoRepository _apiInfoRepository) : base(BaseDal)
+ public TaskService(ITaskRepository BaseDal, IMapper mapper, IUnitOfWorkManage unitOfWorkManage, IBasicService basicService, IBasicRepository basicRepository, IInvokeERPService invokeERPService, IInvokeMESService invokeMESService, IRepository<Dt_StockInfo> blankStockInfoRepository, IApiInfoRepository _apiInfoRepository) : base(BaseDal)
{
_mapper = mapper;
_unitOfWorkManage = unitOfWorkManage;
- _stockRepository = stockRepository;
_basicService = basicService;
- _recordService = recordService;
- _stockService = stockService;
_basicRepository = basicRepository;
_invokeERPService = invokeERPService;
_invokeMESService = invokeMESService;
- _outboundRepository = outboundRepository;
- _outboundService = outboundService;
- _inboundRepository = inboundRepository;
- _inboundService = inboundService;
_blankStockInfoRepository = blankStockInfoRepository;
- _palletCodeInfoRepository = palletCodeInfoRepository;
this._apiInfoRepository = _apiInfoRepository;
}
@@ -115,7 +76,7 @@
{
try
{
- if (tasks==null || tasks.Count == 0)
+ if (tasks == null || tasks.Count == 0)
{
return WebResponseContent.Instance.Error($"浼犲叆浠诲姟涓虹┖");
}
@@ -137,59 +98,6 @@
{
return WebResponseContent.Instance.Error(ex.Message);
}
- }
- /// <summary>
- /// 鏀捐揣瀹屾垚
- /// </summary>
- /// <param name="code"></param>
- /// <returns></returns>
- public WebResponseContent PutFinish(string code, string barCode = "", string taskNum = "")
- {
- try
- {
- string url = AppSettings.Get("WCS");
- if (string.IsNullOrEmpty(url))
- {
- return WebResponseContent.Instance.Error($"鏈壘鍒癢CSAApi鍦板潃,璇锋鏌ラ厤缃枃浠�");
- }
- string response = HttpHelper.Post($"{url}/api/CTU_AGV/PutFinish?code={code}&barCode={barCode}&taskNum={taskNum}" );
-
- return JsonConvert.DeserializeObject<WebResponseContent>(response) ?? WebResponseContent.Instance.Error("杩斿洖閿欒");
- }
- catch (Exception ex)
- {
- return WebResponseContent.Instance.Error(ex.Message);
- }
- }
- private readonly static object lockerAddSG = new object();
- public WebResponseContent AddOutSGOrder(List<SGOutOrderDTO> outOrderDTOs)
- {
- WebResponseContent content = new WebResponseContent();
- try
- {
- lock (lockerAddSG)
- {
- int outDetailId = _outboundRepository.OutSGOrderDetailRepository.QueryData().OrderByDescending(x=>x.Id).FirstOrDefault()?.Id ?? 0;
- content = _outboundService.OutSGOrderService.AddOutSGOrder(outOrderDTOs);
- if (!content.Status)
- {
- return content;
- }
- List<int> ints = _outboundRepository.OutSGOrderDetailRepository.QueryData(x=>x.Id>outDetailId).Select(x=>x.Id).ToList();
- int[] reseponse= new int[ints.Count];
- for (int i = 0; i < ints.Count; i++)
- {
- reseponse[i] = ints[i];
- }
- content.Message = CreateSGOutboundTasks(reseponse).Message;
- }
-
- }
- catch (Exception ex)
- {
- content.Error(ex.Message);
- }
- return content;
}
}
}
--
Gitblit v1.9.3