1
huangxiaoqiang
4 天以前 ce8f204db035e6fb7147edb4440591502f5c8567
1
已修改11个文件
已添加6个文件
240 ■■■■ 文件已修改
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/Partial/TaskService.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/Task/RequestInbound.cs 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_GW/GWTask/RequestInbound.cs 62 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSClient/src/api/http.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSClient/src/router/tables.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSClient/src/views/widesea_wms/basicinfo/Dt_LocationInfo.vue 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSClient/src/views/widesea_wms/basicinfo/Dt_LocationStatus.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSClient/src/views/widesea_wms/stock/Dt_OutTime.vue 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicRepository/Location/ILocationErrorRepository.cs 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicService/Location/ILocationErrorService.cs 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicRepository/Location/LocationErrorRepository.cs 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/Location/LocationErrorService.cs 60 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/Stock/StockInfoHtyService.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs 30 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Basic/LocationErrorController.cs 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Basic/StockInfoHtyController.cs 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/Partial/TaskService.cs
@@ -676,7 +676,7 @@
            catch (Exception ex)
            {
                content = WebResponseContent.Instance.Error($"任务完成异常,任务号:【{taskNum}】");
                QuartzLogger.WriteLogToFile($"Info_分容任务完成", $"任务完成异常,任务号:【{taskNum}】异常信息【{ex.StackTrace}】{Environment.NewLine}{Environment.NewLine}");
                QuartzLogger.WriteLogToFile($"Info_分容任务完成", $"任务完成异常,任务号:【{taskNum}】异常信息【{ex.Message}】{Environment.NewLine}异常信息【{ex.StackTrace}】{Environment.NewLine}");
            }
            QuartzLogger.WriteLogToFile($"Info_分容任务完成", $"任务完成,任务号:【{taskNum}】返回参数【{JsonConvert.SerializeObject(content)}】{Environment.NewLine}{Environment.NewLine}");
            return content;
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs
@@ -826,7 +826,7 @@
            catch (Exception ex)
            {
                content = WebResponseContent.Instance.Error($"任务完成异常,任务号:【{taskNum}】");
                QuartzLogger.WriteLogToFile($"Info_任务完成", $"任务完成异常,任务号:【{taskNum}】异常信息【{ex.StackTrace}】{Environment.NewLine}{Environment.NewLine}");
                QuartzLogger.WriteLogToFile($"Info_任务完成", $"任务完成异常,任务号:【{taskNum}】异常信息【{ex.Message}】{Environment.NewLine}异常信息【{ex.StackTrace}】{Environment.NewLine}");
            }
            QuartzLogger.WriteLogToFile($"Info_任务完成", $"任务完成,任务号:【{taskNum}】返回参数【{JsonConvert.SerializeObject(content)}】{Environment.NewLine}{Environment.NewLine}");
            return content;
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/Task/RequestInbound.cs
@@ -146,6 +146,22 @@
                if (_taskRepository.QueryFirst(x => x.PalletCode == taskDTO.PalletCode) != null)
                {
                    if (_taskRepository.QueryFirst(x => x.PalletCode == command.Barcode) != null)
                    {
                        var taskExecuting = _taskRepository.QueryFirst(x => x.PalletCode == command.Barcode && (x.TaskState == (int)TaskOutStatusEnum.Line_OutExecuting|| x.TaskState == (int)TaskOutStatusEnum.SC_OutFinish));
                        if (taskExecuting != null)
                        {
                            taskExecuting.ExceptionMessage = "未接收到线体完成信号系统内部自动完成";
                            _taskService.Delete(taskExecuting);
                        }
                        ConsoleHelper.WriteErrorLine($"当前托盘存在任务:【{command.Barcode}】");
                        WriteInfo(conveyorLine.DeviceName, $"当前托盘存在任务{command.Barcode}");
                    }
                    WriteInfo(conveyorLine.DeviceName, "当前托盘存在任务");
                }
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_GW/GWTask/RequestInbound.cs
@@ -315,43 +315,51 @@
        /// </summary>
        private async void RequestWmsTask(CommonConveyorLine_GW conveyorLine, ConveyorLineTaskCommand_After command, string childDeviceCode, Dt_StationManager stationManager)
        {
            if (command.ConveyorLineBarcode.IsNullOrEmpty()) return;
            var content = await _taskService.RequestWMSTask(command.ConveyorLineBarcode, childDeviceCode);
            if (content.Status)
            try
            {
                var task = _taskService.QueryBarCodeConveyorLineTask(command.ConveyorLineBarcode, childDeviceCode);
                if (task != null)
                if (command.ConveyorLineBarcode.IsNullOrEmpty()) return;
                var content = await _taskService.RequestWMSTask(command.ConveyorLineBarcode, childDeviceCode);
                if (content.Status)
                {
                    var GWTask = _taskRepository.QueryData(x => x.Roadway.Contains("GWSC2") && x.SourceAddress == "1039" && (x.TaskState == (int)TaskInStatusEnum.Line_InExecuting || x.TaskState == (int)TaskInStatusEnum.Line_InFinish)).ToList();
                    if (GWTask.Count >= 2 && childDeviceCode == "1039" && task.Roadway.Contains("GWSC2"))
                    var task = _taskService.QueryBarCodeConveyorLineTask(command.ConveyorLineBarcode, childDeviceCode);
                    if (task != null)
                    {
                        ConsoleHelper.WriteErrorLine($"托盘号:【{command.ConveyorLineBarcode}】高温二已存在【{GWTask.Count}】个任务大于2个任务不可下发");
                        return;
                    }
                    ConveyorLineTaskCommand_After taskCommand = _mapper.Map<ConveyorLineTaskCommand_After>(task);
                    //conveyorLine.SendCommand(taskCommand, childDeviceCode);
                        var GWTask = _taskRepository.QueryData(x => x.Roadway.Contains("GWSC2") && x.SourceAddress == "1039" && (x.TaskState == (int)TaskInStatusEnum.Line_InExecuting || x.TaskState == (int)TaskInStatusEnum.Line_InFinish)).ToList();
                        if (GWTask.Count >= 2 && childDeviceCode == "1039" && task.Roadway.Contains("GWSC2"))
                        {
                            ConsoleHelper.WriteErrorLine($"托盘号:【{command.ConveyorLineBarcode}】高温二已存在【{GWTask.Count}】个任务大于2个任务不可下发");
                            return;
                        }
                        ConveyorLineTaskCommand_After taskCommand = _mapper.Map<ConveyorLineTaskCommand_After>(task);
                        //conveyorLine.SendCommand(taskCommand, childDeviceCode);
                    bool sendFlag = SendCommand(taskCommand, conveyorLine, childDeviceCode);
                    if (sendFlag)
                        bool sendFlag = SendCommand(taskCommand, conveyorLine, childDeviceCode);
                        if (sendFlag)
                        {
                            conveyorLine.SetValue(ConveyorLineDBName_After.ResponState, Convert.ToInt16(1), childDeviceCode);
                            _taskService.UpdateTaskStatusToNext(task);
                        }
                    }
                }
                else
                {
                    if (content.Message != "请求过于频繁,请稍后再试" || content.Message != "无法获取目标地址")
                    {
                        WriteInfo(conveyorLine.DeviceName, content.Message);
                        conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineTargetAddress, stationManager.stationNGChildCode, childDeviceCode);
                        conveyorLine.SetValue(ConveyorLineDBName_After.ResponState, Convert.ToInt16(1), childDeviceCode);
                        _taskService.UpdateTaskStatusToNext(task);
                        ConsoleHelper.WriteErrorLine($"【{conveyorLine.DeviceName}】托盘号:【{command.ConveyorLineBarcode}】请求点位:【{childDeviceCode}】异常信息【{content.Message}】");
                        WriteInfo(conveyorLine.DeviceName, $"【{conveyorLine.DeviceName}】托盘号:【{command.ConveyorLineBarcode}】请求点位:【{childDeviceCode}】异常信息【{content.Message}】");
                    }
                }
            }
            else
            {
                if (content.Message != "请求过于频繁,请稍后再试" || content.Message != "无法获取目标地址")
                {
                    WriteInfo(conveyorLine.DeviceName, content.Message);
                    conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineTargetAddress, stationManager.stationNGChildCode, childDeviceCode);
                    conveyorLine.SetValue(ConveyorLineDBName_After.ResponState, Convert.ToInt16(1), childDeviceCode);
                    ConsoleHelper.WriteErrorLine($"【{conveyorLine.DeviceName}】托盘号:【{command.ConveyorLineBarcode}】请求点位:【{childDeviceCode}】异常信息【{content.Message}】");
                    WriteInfo(conveyorLine.DeviceName, $"【{conveyorLine.DeviceName}】托盘号:【{command.ConveyorLineBarcode}】请求点位:【{childDeviceCode}】异常信息【{content.Message}】");
                }
                ConsoleHelper.WriteErrorLine($"【{conveyorLine.DeviceName}】托盘号:【{command.ConveyorLineBarcode}】请求点位:【{childDeviceCode}】异常信息【{content.Message}】");
            }
            catch (Exception ex)
            {
                WriteInfo(conveyorLine.DeviceName, $"【{conveyorLine.DeviceName}】托盘号:【{command.ConveyorLineBarcode}】请求点位:【{childDeviceCode}】异常信息【{ex.Message}】异常行【{ex.StackTrace}】");
            }
        }
        /// <summary>
Code Management/WMS/WIDESEA_WMSClient/src/api/http.js
@@ -12,7 +12,7 @@
let loadingStatus = false
if (process.env.NODE_ENV == 'development') {
   axios.defaults.baseURL = 'http://localhost:5000/';
  // axios.defaults.baseURL = 'http://192.168.20.253:5000/';
  // axios.defaults.baseURL = 'http://192.168.15.253:5000/';
}
else if (process.env.NODE_ENV == 'debug') {
  axios.defaults.baseURL = 'http://192.168.15.253:5000/';
Code Management/WMS/WIDESEA_WMSClient/src/router/tables.js
@@ -31,7 +31,7 @@
  {
    path: '/Dt_LocationStatus',
    name: 'Dt_LocationStatus',
    component: () => import('@/views/widesea_wms/basicinfo/LocationStatusChange.vue'),
    component: () => import('@/views/widesea_wms/basicinfo/Dt_LocationStatus.vue'),
    meta: {
       
    }
Code Management/WMS/WIDESEA_WMSClient/src/views/widesea_wms/basicinfo/Dt_LocationInfo.vue
@@ -35,7 +35,9 @@
            [
                { "title": "货位编号", "field": "locationCode", type: "text" },
                { "title": "货位状态", "field": "locationStatus", "type": "select", dataKey: "LocationState", data: [] },
                { "title": "巷道编号", "field": "roadWayNO", type: "text" },
                { "title": "巷道编号", "field": "roadWayNO", type: "text" },
                { "title": "启用状态", "field": "enalbeStatus", "type": "select", dataKey: "EnalbeStatus", data: [] },
            ],
            [
                { "title": "行", "field": "row", type: "text" },
Code Management/WMS/WIDESEA_WMSClient/src/views/widesea_wms/basicinfo/Dt_LocationStatus.vue
@@ -20,7 +20,7 @@
            footer: "Foots",
            cnName: '货位信息',
            name: '/api',
            url: "/Task/LocationStatus",
            url: "/LocationError/",
            sortName: "id"
        });
        const editFormFields = ref({ "locationStatus": "" });
Code Management/WMS/WIDESEA_WMSClient/src/views/widesea_wms/stock/Dt_OutTime.vue
@@ -12,16 +12,16 @@
    </view-grid>
</template>
<script>
import extend from "@/extension/widesea_wms/stock/Dt_OutTime.jsx";
import extend from "@/extension/widesea_wms/stock/Dt_BillGroupStock.jsx";
import { ref, defineComponent } from "vue";
export default defineComponent({
    setup() {
        const table = ref({
            key: 'id',
            footer: "Foots",
            cnName: '超时库存信息',
            name: 'stock/StockInfoTimeout',
            url: "/StockInfo/",
            cnName: '库存信息',
            name: 'stock/Dt_BillGroupStock',
            url: "/StockInfoTimeout/",
            sortName: "createDate"
        });
        const editFormFields = ref({
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicRepository/Location/ILocationErrorRepository.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,5 @@
namespace WIDESEA_IStorageBasicRepository;
public interface ILocationErrorRepository : IRepository<DtLocationInfo>
{
}
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_IStorageBasicService/Location/ILocationErrorService.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,8 @@
using WIDESEA_DTO;
namespace WIDESEA_IStorageBasicService;
public interface ILocationErrorService : IService<DtLocationInfo>
{
}
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicRepository/Location/LocationErrorRepository.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,9 @@
namespace WIDESEA_StorageBasicRepository
{
    public class LocationErrorRepository : RepositoryBase<DtLocationInfo>, ILocationErrorRepository
    {
        public LocationErrorRepository(IUnitOfWorkManage unitOfWorkManage) : base(unitOfWorkManage)
        {
        }
    }
}
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/Location/LocationErrorService.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,60 @@
using AngleSharp.Dom;
using Mapster;
using SqlSugar;
using System.Threading.Tasks;
using WIDESEA_Common;
using WIDESEA_Core;
using WIDESEA_DTO;
using WIDESEA_Model.Models;
namespace WIDESEA_StorageBasicService;
public class LocationErrorService : ServiceBase<DtLocationInfo, ILocationErrorRepository>, ILocationErrorService
{
    private readonly IMapper _mapper;
    public LocationErrorService(ILocationErrorRepository BaseDal,IMapper mapper,IDt_TaskService taskService) : base(BaseDal)
    {
        _mapper = mapper;
    }
    public override PageGridData<DtLocationInfo> GetPageData(PageDataOptions options)
    {
        string wheres = ValidatePageOptions(options);
        //获取排序字段
        Dictionary<string, SqlSugar.OrderByType> orderbyDic = GetPageDataSort(options, TProperties);
        List<OrderByModel> orderByModels = new List<OrderByModel>();
        foreach (var item in orderbyDic)
        {
            OrderByModel orderByModel = new()
            {
                FieldName = item.Key,
                OrderByType = item.Value
            };
            orderByModels.Add(orderByModel);
        }
        int totalCount = 0;
        List<SearchParameters> searchParametersList = new List<SearchParameters>();
        if (!string.IsNullOrEmpty(options.Wheres))
        {
            try
            {
                searchParametersList = options.Wheres.DeserializeObject<List<SearchParameters>>();
                options.Filter = searchParametersList;
            }
            catch { }
        }
        var now = DateTime.Now;
        // ä½¿ç”¨Subtract方法
        var threeHoursAgo = now.Subtract(TimeSpan.FromHours(3));
        var data = BaseDal.Db.Queryable<DtLocationInfo>()
            .Where(x => x.LocationStatus != 2 && x.LocationStatus != 0)
            .WhereIF(!wheres.IsNullOrEmpty(), wheres)
            .OrderBy(orderByModels)
            .ToPageList(options.Page, options.Rows, ref totalCount);
        return new PageGridData<DtLocationInfo>(totalCount, data);
    }
}
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/Stock/StockInfoHtyService.cs
@@ -80,6 +80,7 @@
        var data = BaseDal.Db.Queryable<DtStockInfo_Hty>()
            .Includes(x => x.StockInfoDetails)
            .Includes(x => x.LocationInfo)
            .Where(x=>x.CreateDate>DateTime.Now.AddMonths(-1))
            .WhereIF(!wheres.IsNullOrEmpty(), wheres)
            .WhereIF(locationStatus != null, locationStatus)
            .WhereIF(roadwayNo != null, roadwayNo)
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs
@@ -1,5 +1,6 @@
using Mapster;
using Masuit.Tools;
using SixLabors.Fonts.Tables.AdvancedTypographic;
using SqlSugar;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
@@ -776,6 +777,7 @@
            // æ›´è¯¦ç»†çš„异常处理,可以根据异常类型记录不同的错误日志等
            content.Error(err.Message);
            Console.WriteLine(err.Message);
            LogFactory.GetLog($"请求入库异常").Info(true, $"异常信息【{err.Message}】异常行【{err.StackTrace}】");
        }
        return content;
@@ -976,6 +978,8 @@
        WebResponseContent content = new WebResponseContent();
        try
        {
            // è®°å½•异常信息并抛出
            LogFactory.GetLog($"{position}请求{productionLine}任务").Info(true, $"{position}-{tag}-{areaCode}-{JsonConvert.SerializeObject(areaCodes)}-{productionLine}");
            // æ ¹æ®æ‰˜ç›˜ç±»åž‹æŸ¥è¯¢åº“存信息
            DtStockInfo stockInfo = tag == (int)TaskOutboundTypeEnum.Outbound
                ? areaCode != "CWSC1" ? await QueryStockInfoForRealTrayAsync(areaCode, areaCodes, productionLine) : await QueryStockInfoForRealTrayCWAsync(areaCodes, productionLine)
@@ -1738,21 +1742,20 @@
        // åˆ›å»ºåŽ†å²ä»»åŠ¡å®žä¾‹æ¨¡åž‹
        try
        {
            Dt_Task task = BaseDal.QueryFirst(x => x.TaskId == Convert.ToInt32(key[0]));
            if (task == null)
            foreach (var item in key)
            {
                return content.Error("未找到任务信息!");
                Dt_Task task = BaseDal.QueryFirst(x => x.TaskId == Convert.ToInt32(key));
                if (task == null)
                {
                    return content.Error("未找到任务信息!");
                }
                var taskHtyNG = CreateHistoricalTask(task, true);
                // æ·»åŠ åŽ†å²ä»»åŠ¡
                var isTaskHtyAdd = _task_HtyRepository.AddData(taskHtyNG) > 0;
                // åˆ é™¤ä»»åŠ¡æ•°æ®
                var isTaskDelete = BaseDal.Delete(task.TaskId);
            }
            var taskHtyNG = CreateHistoricalTask(task, true);
            // æ‰§è¡Œæ•°æ®åº“事务
            // æ·»åŠ åŽ†å²ä»»åŠ¡
            var isTaskHtyAdd = _task_HtyRepository.AddData(taskHtyNG) > 0;
            // åˆ é™¤ä»»åŠ¡æ•°æ®
            var isTaskDelete = BaseDal.Delete(task.TaskId);
            return content.OK("删除成功!");
        }
        catch (Exception ex)
@@ -1886,7 +1889,6 @@
        {
            taskHty.Creater = App.User.UserName != null ? App.User.UserName : "System";
        }
        taskHty.TaskState = task.TaskType > 199 ? (int)TaskInStatusEnum.InFinish : (int)TaskOutStatusEnum.OutFinish;
        return taskHty;
    }
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Basic/LocationErrorController.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,15 @@
using Masuit.Tools.Models;
using WIDESEA_DTO;
namespace WIDESEA_WMSServer.Controllers;
[Route("api/LocationError")]
[ApiController]
public class LocationErrorController : ApiBaseController<ILocationErrorService, DtLocationInfo>
{
    public LocationErrorController(ILocationErrorService service) : base(service)
    {
    }
}
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Basic/StockInfoHtyController.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,12 @@
using WIDESEA_IStorageBasicService;
namespace WIDESEA_WMSServer.Controllers;
[Route("api/StockInfoHty")]
[ApiController]
public class StockInfoHtyController : ApiBaseController<IStockInfoHtyService, DtStockInfo_Hty>
{
    public StockInfoHtyController(IStockInfoHtyService service) : base(service)
    {
    }
}