647556386
2026-01-16 958bc4d177f7ddd0560b48dedd845833197513cc
代码优化
已修改7个文件
48 ■■■■ 文件已修改
项目代码/WIDESEA_WMSClient/src/views/stock/stockInfoDetail.vue 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_CheckService/ReCheckOrderService.cs 24 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_DTO/Stock/StockInfoDetailWithPalletDto.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_InboundService/InboundService.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_OutboundService/OutboundService.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_StockService/StockInfoDetailService.cs 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ÏîÄ¿´úÂë/WIDESEA_WMSClient/src/views/stock/stockInfoDetail.vue
@@ -193,6 +193,13 @@
        bind: { key: "stockStatusEmun", data: [] },
      },
      {
        field: "validDate",
        title: "有效期",
        type: "datetime",
        width: 160,
        align: "left",
      },
      {
        field: "creater",
        title: "创建人",
        type: "string",
ÏîÄ¿´úÂë/WMSÎÞ²Ö´¢°æ/WIDESEA_WMSServer/WIDESEA_CheckService/ReCheckOrderService.cs
@@ -2,9 +2,11 @@
using Microsoft.Extensions.Logging;
using Newtonsoft.Json;
using SqlSugar;
using StackExchange.Profiling.Internal;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection.Metadata;
using System.Text;
using System.Threading.Tasks;
using WIDESEA_Common.OrderEnum;
@@ -124,37 +126,47 @@
                if (model.Result == 1 && recheckOrder.SignSeq != model.SignSeq)
                {
                    var stockDetailIds = BaseDal.Db.Queryable<Dt_StockInfoDetail>()
                    .Where(x => x.MaterielCode == model.MaterielCode && x.BatchNo == model.BatchNo && x.ValidDate != null && x.Status == (int)StockStatusEmun.手动冻结)
                    .Where(x => x.MaterielCode == model.MaterielCode && x.BatchNo == model.BatchNo && x.ValidDate != null && (x.Status == (int)StockStatusEmun.手动冻结 ||x.Status == (int)StockStatusEmun.重检中))
                    .Select(x => x.Id)
                    .ToList();
                    if (stockDetailIds.Count > 0)
                    {
                        var datevaliDate = BaseDal.Db.Queryable<Dt_MaterialExpirationDate>().Where(x => x.MaterialCode.Contains(model.MaterielCode.Substring(0, 6))).First();
                        if(datevaliDate == null)
                        {
                            return WebResponseContent.Instance.Error($"该物料未找到MES推送的有效期数据,请先推送该物料的有效期数据");
                        }
                        BaseDal.Db.Updateable<Dt_StockInfoDetail>()
                            .SetColumns(x => x.Status == StockStatusEmun.入库完成.ObjToInt())
                            .Where(x => stockDetailIds.Contains(x.Id))
                            .Where(x => stockDetailIds.Contains(x.Id) && x.Status == (int)StockStatusEmun.手动冻结)
                            .ExecuteCommand();
                        //计算当前复检单据结果时间
                        DateTime newDate;
                        if (1 == reCheckOrders.Count())
                        {
                            //单据结果推送时间+物料复检延长时间与有效期做对比,谁大取谁
                            newDate = Convert.ToDateTime(DateTime.Now).AddDays(Convert.ToDouble(datevaliDate.OneExtensionDays));
                            BaseDal.Db.Updateable<Dt_StockInfoDetail>()
                            .SetColumns(x => x.ValidDate == Convert.ToDateTime(x.ValidDate).AddDays(Convert.ToDouble(datevaliDate.OneExtensionDays)))
                            .SetColumns(x => x.ValidDate == SqlFunc.IIF(x.ValidDate > newDate, x.ValidDate, newDate))
                            .Where(x => stockDetailIds.Contains(x.Id))
                            .ExecuteCommand();
                        }
                        else if (2 == reCheckOrders.Count())
                        {
                            newDate = Convert.ToDateTime(DateTime.Now).AddDays(Convert.ToDouble(datevaliDate.TwoExtensionDays));
                            BaseDal.Db.Updateable<Dt_StockInfoDetail>()
                            .SetColumns(x => x.ValidDate == Convert.ToDateTime(x.ValidDate).AddDays(Convert.ToDouble(datevaliDate.TwoExtensionDays)))
                            .SetColumns(x => x.ValidDate == SqlFunc.IIF(x.ValidDate > newDate, x.ValidDate, newDate))
                            .Where(x => stockDetailIds.Contains(x.Id))
                            .ExecuteCommand();
                        }
                        else if (3 == reCheckOrders.Count())
                        {
                            newDate = Convert.ToDateTime(DateTime.Now).AddDays(Convert.ToDouble(datevaliDate.ThreeExtensionDays));
                            BaseDal.Db.Updateable<Dt_StockInfoDetail>()
                            .SetColumns(x => x.ValidDate == Convert.ToDateTime(x.ValidDate).AddDays(Convert.ToDouble(datevaliDate.ThreeExtensionDays)))
                            .SetColumns(x => x.ValidDate == SqlFunc.IIF(x.ValidDate > newDate, x.ValidDate, newDate))
                            .Where(x => stockDetailIds.Contains(x.Id))
                            .ExecuteCommand();
                        }
ÏîÄ¿´úÂë/WMSÎÞ²Ö´¢°æ/WIDESEA_WMSServer/WIDESEA_DTO/Stock/StockInfoDetailWithPalletDto.cs
@@ -36,5 +36,7 @@
        // ä¸»è¡¨æ‰˜ç›˜ç¼–号(前端需显示的字段)
        public string PalletCode { get; set; }
        public string LocationCode { get; set; }
        public DateTime? ValidDate { get; set; }
    }
}
ÏîÄ¿´úÂë/WMSÎÞ²Ö´¢°æ/WIDESEA_WMSServer/WIDESEA_InboundService/InboundService.cs
@@ -790,7 +790,7 @@
                Dt_ReCheckOrder reCheckOrder = _stockInfoRepository.Db.Queryable<Dt_ReCheckOrder>().Where(x => x.MaterielCode == stockInfoDetail.MaterielCode && x.BatchNo == stockInfoDetail.BatchNo && x.OrderNo == stockInfoDetail.OrderNo && (x.Result == 1 || x.Result == 2 )).First();
                if(reCheckOrder == null)
                {
                    return content.Error($"该重检条码的批次在重检单中未拿到重检结果,请检测重检单{reCheckOrder.OrderNo}状态");
                    return content.Error($"该重检条码的批次在重检单中未拿到重检结果,请检查重检单中物料{stockInfoDetail.MaterielCode}和{stockInfoDetail.BatchNo}物料批次状态");
                }
                int newStatus = reCheckOrder.Result == 1 ? StockStatusEmun.入库完成.ObjToInt(): StockStatusEmun.手动冻结.ObjToInt();
ÏîÄ¿´úÂë/WMSÎÞ²Ö´¢°æ/WIDESEA_WMSServer/WIDESEA_OutboundService/OutboundService.cs
@@ -491,7 +491,7 @@
                x => request.StockDetailIds.Contains(x.Id)
                && x.MaterielCode == materielCalc.MaterielCode
                && x.StockQuantity > 0
                && (x.Status == (int)StockStatusEmun.入库完成 || x.Status == (int)StockStatusEmun.手动冻结)|| x.Status == (int)StockStatusEmun.手动解锁);
                && (x.Status == (int)StockStatusEmun.入库完成 || x.Status == (int)StockStatusEmun.手动冻结 || x.Status == (int)StockStatusEmun.手动解锁 || x.Status == (int)StockStatusEmun.过期));
            if (!specifiedStockDetails.Any())
            {
ÏîÄ¿´úÂë/WMSÎÞ²Ö´¢°æ/WIDESEA_WMSServer/WIDESEA_StockService/StockInfoDetailService.cs
@@ -120,7 +120,10 @@
                 Modifier = detail.Modifier,
                 ModifyDate = detail.ModifyDate,
                 PalletCode = item.PalletCode,
                 LocationCode = item.LocationCode
                 LocationCode = item.LocationCode,
                 ValidDate = detail.ValidDate,
             })
             .ToPageList(options.Page, options.Rows, ref totalCount);
ÏîÄ¿´úÂë/WMSÎÞ²Ö´¢°æ/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs
@@ -746,7 +746,11 @@
                var beforelocationStatus = locationInfo.LocationStatus;
                locationInfo.LocationStatus = LocationStatusEnum.InStock.ObjToInt();
                _locationInfoService.Repository.UpdateData(locationInfo);
                stockInfo.Details.ForEach(x =>
                {
                    x.Status = StockStatusEmun.入库完成.ObjToInt();
                });
                _stockService.StockInfoDetailService.Repository.UpdateData(stockInfo.Details);
                stockInfo.LocationCode = locationInfo.LocationCode;
                stockInfo.PalletCode = task.PalletCode;
                stockInfo.LocationCode = task.TargetAddress;