调整wms出入库、返库逻辑,调整与比亚迪接口对接的类型和方法,调整配置参数,写入服务器上数据库密码
已修改11个文件
894 ■■■■■ 文件已修改
项目代码/WMS/WIDESEA_WMSServer/WIDESEA_InboundService/Service/InboundOrderService.cs 80 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/System/Request/PickAndPostRequest.cs 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/System/Request/PutAwayReturnRequest.cs 60 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/System/Request/ReturnInventoryRequest.cs 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/System/Request/freezeByCustomerRequest.cs 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS/WIDESEA_WMSServer/WIDESEA_StockRepository/StockInfoRepository.cs 62 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS/WIDESEA_WMSServer/WIDESEA_SystemService/Sys_JobService.cs 359 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_Inbound.cs 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs 228 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/PDAController.cs 39 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/appsettings.json 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ÏîÄ¿´úÂë/WMS/WIDESEA_WMSServer/WIDESEA_InboundService/Service/InboundOrderService.cs
@@ -14,6 +14,7 @@
using WIDESEA_Core.BaseServices;
using WIDESEA_Core.Enums;
using WIDESEA_Core.Helper;
using WIDESEA_Core.LogHelper;
using WIDESEA_Core.Utilities;
using WIDESEA_DTO;
using WIDESEA_DTO.Inbound;
@@ -53,81 +54,120 @@
            WebResponseContent content = new WebResponseContent();
            try
            {
                //Logger.Write_Log("System/test", "", "2.0 ", "");
                materielGroupDTO.OrderNo = GetOrderNo();
                //Logger.Write_Log("System/test", "", "2.1 ", "");
                Dt_StockInfo? stockInfo = _stockService.StockInfoService.GetStockByPalletCode(materielGroupDTO.PalletCode);
                //Logger.Write_Log("System/test", "", "2.2 ", "");
                (bool, string, object?) result = CheckMaterielGroupParam(materielGroupDTO, stockInfo);
                if (!result.Item1) return content = WebResponseContent.Instance.Error(result.Item2);
                if (stockInfo == null)
                {
                    //Logger.Write_Log("System/test", "", "2.2.1 ", "");
                    stockInfo = new Dt_StockInfo();
                    stockInfo.PalletCode = materielGroupDTO.PalletCode;
                    stockInfo.StockStatus = StockStatusEmun.组盘暂存.ObjToInt();
                    stockInfo.Creater = "立库WMS";
                    stockInfo.Details = new List<Dt_StockInfoDetail>();
                }
                //Logger.Write_Log("System/test", "", "2.3 ", "");
                List<Dt_StockInfoDetail> stockInfoDetails = new List<Dt_StockInfoDetail>();
                List<Dt_LabelMaster> notExistLabels = new List<Dt_LabelMaster>();
                foreach (var lablel in materielGroupDTO.SerialNumbers)
                {
                    Dt_LabelMaster labmaster = _labelMasterRepository.QueryFirst(x => x.LABEL_NO == lablel);
                    if(labmaster == null)
                    if (labmaster == null)
                    {
                        //Logger.Write_Log("System/test", "", "2.3.1 lablel=" + lablel);
                        //通过条码接口同步条码主数据
                        var res= _sys_JobService.GetLabMaster(lablel);
                        var res = _sys_JobService.GetLabMaster(lablel);
                        if (res != null && res.Status)
                        {
                            //Logger.Write_Log("System/test", "", "2.3.2 res.Status=" + res.Status.ToString());
                            labmaster = _labelMasterRepository.QueryFirst(x => x.LABEL_NO == lablel);
                            if (labmaster == null)
                            {
                                //Logger.Write_Log("System/test", "", "2.3.3 ", "");
                                notExistLabels.Add(labmaster);
                            }
                        }
                        else
                        {
                          return  content = WebResponseContent.Instance.Error("组盘条码在上游WMS系统中不存在!");
                        }
                    }
                    if(labmaster!=null)
                            //Logger.Write_Log("System/test", "", "2.3.4 ", "");
                            return content = WebResponseContent.Instance.Error("组盘条码在上游WMS系统中不存在!");
                        }
                    }
                    if (labmaster != null)
                    {
                        //Logger.Write_Log("System/test", "", "2.3.5 ", "");
                        //主数据条码状态允许组盘:01已收料待质检,02已收料无需质检,03待进仓已质检,09已下架;
                        //主数据条码状态不允许组盘:00创建,04已质检待退货,05收料房退货,06库房退货,07已进仓,08已上架,10已出库,11已冻结,12已锁定,20关闭的;
                        if (labmaster.LABEL_STATUS=="00"|| labmaster.LABEL_STATUS == "04" || labmaster.LABEL_STATUS == "05"|| labmaster.LABEL_STATUS == "06" || labmaster.LABEL_STATUS == "07" || labmaster.LABEL_STATUS == "08" || labmaster.LABEL_STATUS == "10" || labmaster.LABEL_STATUS == "11" || labmaster.LABEL_STATUS == "12" || labmaster.LABEL_STATUS == "20")
                        if (labmaster.LABEL_STATUS == "00" || labmaster.LABEL_STATUS == "04" || labmaster.LABEL_STATUS == "05" || labmaster.LABEL_STATUS == "06" || labmaster.LABEL_STATUS == "07" || labmaster.LABEL_STATUS == "08" || labmaster.LABEL_STATUS == "10" || labmaster.LABEL_STATUS == "11" || labmaster.LABEL_STATUS == "12" || labmaster.LABEL_STATUS == "20")
                        {
                            return content = WebResponseContent.Instance.Error("主数据条码状态不允许组盘!条码状态:"+ labmaster.LABEL_STATUS);
                            //Logger.Write_Log("System/test", "", "2.3.6 LABEL_STATUS=" + labmaster.LABEL_STATUS);
                            return content = WebResponseContent.Instance.Error("主数据条码状态不允许组盘!条码状态:" + labmaster.LABEL_STATUS);
                        }
                    }
                }
                //Logger.Write_Log("System/test", "", "2.4 ", "");
                if (notExistLabels.Count == 0)
                {
                    //Logger.Write_Log("System/test", "", "2.4.1 ", "");
                    foreach (var item in materielGroupDTO.SerialNumbers)
                    {
                        //Logger.Write_Log("System/test", "", "2.4.2 "+ item);
                        //Logger.Write_Log("System/test", "", "2.4.2.0 ", "");
                        Dt_LabelMaster labmaster = _labelMasterRepository.QueryFirst(x => x.LABEL_NO == item);
                        Dt_StockInfoDetail dt_StockInfoDetail = new Dt_StockInfoDetail();
                        dt_StockInfoDetail.Status = 0;
                        //Logger.Write_Log("System/test", "", "2.4.2.1 ", "");
                        dt_StockInfoDetail.OrderNo = materielGroupDTO.OrderNo;
                        dt_StockInfoDetail.StockId = stockInfo.Id != 0 ? stockInfo.Id : 0;
                        dt_StockInfoDetail.MaterielCode = labmaster.MATNR;
                        dt_StockInfoDetail.MaterielName = labmaster.MAKTX;
                        dt_StockInfoDetail.BatchNo = labmaster.BATCH;
                        dt_StockInfoDetail.SerialNumber = labmaster.LABEL_NO;
                        dt_StockInfoDetail.StockQuantity = int.Parse(labmaster.BOX_QTY);
                        //Logger.Write_Log("System/test", "", "2.4.2.2 "+ labmaster.BOX_QTY);
                        dt_StockInfoDetail.StockQuantity = (int)Convert.ToDouble(labmaster.BOX_QTY);
                        dt_StockInfoDetail.OutboundQuantity = 0;
                        dt_StockInfoDetail.Creater = "System";
                        //Logger.Write_Log("System/test", "", "2.4.2.3 ", "");
                        stockInfoDetails.Add(dt_StockInfoDetail);
                        stockInfo.Details.AddRange(stockInfoDetails);
                        //Logger.Write_Log("System/test", "", "2.4.2.4 ", "");
                        stockInfo.Details.AddRange(stockInfoDetails);
                        //Logger.Write_Log("System/test", "", "2.4.2.5 ", "");
                    }
                    content = MaterielGroupUpdateData(stockInfo);
                }
                else
                {
                    //Logger.Write_Log("System/test", "", "2.4.3 ", "");
                    content = WebResponseContent.Instance.Error("组盘条码在上游WMS系统中不存在!");
                }
                }
            }
            catch (Exception ex)
            {
                //Logger.Write_Log("System/test", "", "2.4.4 " + ex.ToString());
                content = WebResponseContent.Instance.Error(ex.Message);
            }
            finally
@@ -164,7 +204,7 @@
                foreach (var item in inventoryRequest.DATA)
                {
                    Dt_StockInfoDetail dt_StockInfoDetail = new Dt_StockInfoDetail();
                    dt_StockInfoDetail.Status = 0;
                    dt_StockInfoDetail.OrderNo = materielGroupDTO.OrderNo;
@@ -173,7 +213,7 @@
                    dt_StockInfoDetail.MaterielName = "";
                    dt_StockInfoDetail.BatchNo = "";
                    dt_StockInfoDetail.SerialNumber = item.LABEL_NO;
                    dt_StockInfoDetail.StockQuantity = int.Parse(item.QTY);
                    dt_StockInfoDetail.StockQuantity = (int)Convert.ToDouble(item.QTY);
                    dt_StockInfoDetail.OutboundQuantity = 0;
                    dt_StockInfoDetail.Creater = "WMS";
                    stockInfoDetails.Add(dt_StockInfoDetail);
@@ -205,12 +245,12 @@
            new LogFactory().GetLog("WMS接口").InfoFormat(true, "returnInventory", "余料退回信息", $"{inventoryRequeststr}");
            ReturnInventoryRequest inventoryRequest = JsonConvert.DeserializeObject<ReturnInventoryRequest>(inventoryRequeststr);
            ReturnInventoryResponse response= new ReturnInventoryResponse();
            ReturnInventoryResponse response = new ReturnInventoryResponse();
            MaterielGroupDTO materielGroupDTO = new MaterielGroupDTO();
            materielGroupDTO.PalletCode = inventoryRequest.TPNUM;
            materielGroupDTO.OrderNo = inventoryRequest.IZLID; //退货入库指令
            List<string> SerialNumbers = new List<string>();
            Dt_MainReturnInventory dt_MainReturnInventoryOld =  _mainReturnInventoryRepository.QueryFirst(x => x.RETURN_NO == inventoryRequest.RETURN_NO && x.RETURN_ITEM_NO == inventoryRequest.RETURN_ITEM_NO);
            Dt_MainReturnInventory dt_MainReturnInventoryOld = _mainReturnInventoryRepository.QueryFirst(x => x.RETURN_NO == inventoryRequest.RETURN_NO && x.RETURN_ITEM_NO == inventoryRequest.RETURN_ITEM_NO);
            if (dt_MainReturnInventoryOld == null)
            {
                //保存回退数据到本地
@@ -289,9 +329,9 @@
            try
            {
                Dt_StockInfo? stockInfo = _stockService.StockInfoService.GetStockByPalletCode(PalletCode);
                if(stockInfo != null)
                if (stockInfo != null)
                {
                    if(stockInfo.StockStatus!= (int)StockStatusEmun.组盘暂存)
                    if (stockInfo.StockStatus != (int)StockStatusEmun.组盘暂存)
                    {
                        return content = WebResponseContent.Instance.Error("组盘暂存状态才可以撤销组盘!");
                    }
@@ -305,12 +345,12 @@
                    }
                    content = MaterielGroupUpdateData(stockInfo);
                }
                }
                else
                {
                    return content = WebResponseContent.Instance.Error("组盘信息不存在!");
                }
            }
            catch (Exception ex)
            {
ÏîÄ¿´úÂë/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/System/Request/PickAndPostRequest.cs
@@ -8,9 +8,12 @@
{
    public class PickAndPostRequest
    {
        public string WH_NUMBER { get; set; }
        public string SYSNOD { get; set; }
        public string WERKS { get; set; }
        public string WH_NUMBER { get; set; }
        //public string SYSNOD { get; set; }
        //public string REQUIREMENT_NO { get; set; }
        //public string BUSINESS_NAME { get; set; }
        //public string BUSINESS_CODE { get; set; }
        public List<PickAndPost> ITEMDATA { get; set; }
@@ -77,9 +80,9 @@
    {
        public string REQUIREMENT_NO { get; set; }
        public string REQUIREMENT_ITEM_NO { get; set; }
        public string WERKS { get; set; }
        public string ORDERCODE { get; set; }
        public string ORDERCODE_ITEM_NO { get; set; }
        public string SYSNOD { get; set; }
        public string MATNR { get; set; }
        public string LIFNR { get; set; }
        public string QTY { get; set; }
@@ -90,9 +93,12 @@
        public string STATION { get; set; }
        public string  SPLIT { get; set; }
        public string  LABEL_NO { get; set; }
        public string Pack_LABEL_NO { get; set; }
        public string pallet_label_no { get; set; }
        public string CREATE_DATE { get; set; }
        public string UPDATE_DATE { get; set; }
        public string STATUS { get; set; }
        public string MO_NO { get; set; }
        // /// <summary>
        // /// éœ€æ±‚行
ÏîÄ¿´úÂë/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/System/Request/PutAwayReturnRequest.cs
@@ -8,20 +8,28 @@
{
    public class PutAwayReturnRequest
    {
        /// <summary>
        /// ä»“库编号(系统标识)
        /// </summary>
        public string WH_NUMBER { get; set; }
        /// <summary>
        /// ä¸šåŠ¡ç±»åž‹åç§°
        /// </summary>
        public string BUSINESS_NAME { get; set; }
        /// <summary>
        /// å·¥åŽ‚ä»£ç 
        /// </summary>
        public string WERKS { get; set; }
        /// <summary>
        /// ä»“库编号(系统标识)
        /// ç›®æ ‡åº“存地点
        /// </summary>
        public string WH_NUMBER { get; set; }
        public string LGORT { get; set; }
        public string TOTAL_RETURN_QTY { get; set; }
        /// <summary>
        /// å…¥åº“指令
        /// ä¸šåŠ¡ç±»åž‹ä»£ç 
        /// </summary>
        public string IZLID { get; set; }
        public string BUSINESS_CODE { get; set; }
        /// <summary>
        /// é€€è´§å•号
        /// </summary>
@@ -30,45 +38,37 @@
        /// é€€è´§å•行项目
        /// </summary>
        public string RETURN_ITEM_NO { get; set; }
        /// <summary>
        /// ä¸šåŠ¡ç±»åž‹åç§°
        /// </summary>
        public  string  BUSINESS_NAME { get; set; }
        /// <summary>
        /// ä¸šåŠ¡ç±»åž‹ä»£ç 
        /// </summary>
        public string BUSINESS_CODE {  get; set; }
        /// <summary>
        /// æ‰˜ç›˜å·
        /// </summary>
        public string TPNUM { get; set; }
        /// <summary>
        /// ç›®æ ‡åº“存地点
        /// </summary>
        public string LGORT { get; set; }
        public string MO_NO { get; set; }
        public string YLZD5 { get; set; }
        public List<PutAwayReturn> DATA { get; set; }
        /// <summary>
        /// å…¥åº“指令
        /// </summary>
        public string IZLID { get; set; }
        public string MO_NO { get; set; }
        public string YLZD3 { get; set; }
        public string YLZD4 { get; set; }
        public string YLZD1 { get; set; }
        public string YLZD2 { get; set; }
        public string SYSNOD { get; set; }
    }
    public class PutAwayReturn
    {
        public string LABEL_NO { get; set; }
        public string SOBKZ { get; set; }
        public string UNIT { get; set; }
        public string SOBKZ { get; set; }
        public string LGORT { get; set; }
        public string TOTAL_RETURN_QTY { get; set; }
        public string QTY { get; set; }
        public string F_LGORT { get; set; }
        public string MO_NO { get; set; }
        public string LIFNR { get; set; }
        public string MO_NO { get; set; }
       
        public string MATNR { get; set; }
        public string BATCH { get; set;}
    }
}
ÏîÄ¿´úÂë/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/System/Request/ReturnInventoryRequest.cs
@@ -21,26 +21,27 @@
        public string TPNUM { get; set; }  
        public string YLZD5 { get; set; }
        public List<ReturnInventory> DATA { get; set; }
        public string IZLID { get; set; }
        public string SYSNOD { get; set; }
        public string MO_NO { get; set; }
        public string SYSNOD { get; set; }
        public string YLZD3 { get; set; }
        public string YLZD4 { get; set; }
        public string YLZD1 { get; set; }
        public string YLZD2 { get; set; }
        public List<ReturnInventory> DATA { get; set; }
    }
    public class ReturnInventory
    {
        public string LABEL_NO { get; set; }
        public string SOBKZ { get; set; }
        public string UNIT { get; set; }
        public string SOBKZ { get; set; }
        public string LGORT { get; set; }
        public string QTY { get; set; }
        public string LIFNR { get; set; }
        public string F_LGORT { get; set; }
        public string LIFNR { get; set; }
        public string MO_NO { get; set; }
        public string MATNR { get; set; }
    }
ÏîÄ¿´úÂë/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/System/Request/freezeByCustomerRequest.cs
@@ -12,14 +12,14 @@
        public string WH_NUMBER { get; set; }
        public string MATNR { get; set; }
        public string BATCH { get; set; }
        public string FREEZE_TYPE { get; set; }
        public string YWLX { get; set; }
        public string EFFECT_DATE { get; set; }
        public string VALTO { get; set; }
        public string REASON_CODE { get; set; }
        //public string REASON_CODE { get; set; }
        public string REASON { get; set; }
        public string EDITOR { get; set; }
        //public string REASON { get; set; }
        //public string EDITOR { get; set; }
    }
    
ÏîÄ¿´úÂë/WMS/WIDESEA_WMSServer/WIDESEA_StockRepository/StockInfoRepository.cs
@@ -24,7 +24,7 @@
    public class StockInfoRepository : RepositoryBase<Dt_StockInfo>, IStockInfoRepository
    {
        private readonly ILabelMasterRepository _labelMasterRepository;
        public StockInfoRepository(IUnitOfWorkManage unitOfWorkManage,ILabelMasterRepository labelMasterRepository) : base(unitOfWorkManage)
        public StockInfoRepository(IUnitOfWorkManage unitOfWorkManage, ILabelMasterRepository labelMasterRepository) : base(unitOfWorkManage)
        {
            _labelMasterRepository = labelMasterRepository;
        }
@@ -78,15 +78,15 @@
        /// </summary>
        /// <param name="materielCode"></param>
        /// <returns></returns>
        public List<Dt_StockInfo> GetStockInfos(string materielCode,string batchNo)
        public List<Dt_StockInfo> GetStockInfos(string materielCode, string batchNo)
        {
            return Db.Queryable<Dt_StockInfo>().Includes(x => x.Details).Where(x => x.Details.Any(v => v.MaterielCode == materielCode&&v.BatchNo==batchNo)).ToList();
            return Db.Queryable<Dt_StockInfo>().Includes(x => x.Details).Where(x => x.Details.Any(v => v.MaterielCode == materielCode && v.BatchNo == batchNo)).ToList();
        }
        public List<Dt_StockInfo> GetStockInfos(string materielCode, List<string> locationCodes)
        {
            //修改只获取已上架状态的库存
            return Db.Queryable<Dt_StockInfo>().Where(x => locationCodes.Contains(x.LocationCode)&&x.StockStatus== (int)StockStatusEmun.已上架).Includes(x => x.Details).Where(x => x.Details.Any(v => v.MaterielCode == materielCode)).ToList();
            return Db.Queryable<Dt_StockInfo>().Where(x => locationCodes.Contains(x.LocationCode) && x.StockStatus == (int)StockStatusEmun.已上架).Includes(x => x.Details).Where(x => x.Details.Any(v => v.MaterielCode == materielCode)).ToList();
            //ISugarQueryable<Dt_LocationInfo> sugarQueryable = Db.Queryable<Dt_LocationInfo>().Where(x => locationCodes.Contains(x.LocationCode));
@@ -118,9 +118,9 @@
        {
            //ISugarQueryable<string> locationCodes = Db.Queryable<Dt_LocationInfo>().Where(x => x.RoadwayNo == roadwayNo && x.LocationStatus == LocationStatusEnum.Pallet.ObjToInt() && (x.EnalbeStatus == LocationEnalbeStatusEnum.OnlyOut.ObjToInt() || LocationEnalbeStatusEnum.Normal.ObjToInt() == x.EnalbeStatus)).Select(x => x.LocationCode);
            return Db.Queryable<Dt_StockInfo>().Where(x => x.StockStatus == StockStatusEmun.已入库.ObjToInt() && SqlFunc.Subqueryable<Dt_LocationInfo>().Where(v => v.LocationCode == x.LocationCode && v.RoadwayNo == roadwayNo && v.LocationStatus == LocationStatusEnum.Pallet.ObjToInt() && (EnableStatusEnum.Normal.ObjToInt() == v.EnableStatus)).Any()).OrderBy(x => x.ModifyDate).First();
        }
        public Dt_StockInfo GetPalletStockInfo(string roadwayNo,string strayType)
        public Dt_StockInfo GetPalletStockInfo(string roadwayNo, string strayType)
        {
            //ISugarQueryable<string> locationCodes = Db.Queryable<Dt_LocationInfo>().Where(x => x.RoadwayNo == roadwayNo && x.LocationStatus == LocationStatusEnum.Pallet.ObjToInt() && (x.EnalbeStatus == LocationEnalbeStatusEnum.OnlyOut.ObjToInt() || LocationEnalbeStatusEnum.Normal.ObjToInt() == x.EnalbeStatus)).Select(x => x.LocationCode);
            if (strayType == "1")
@@ -161,7 +161,7 @@
                            stockItem.LGORT = "0030";//库位
                            if (labelMaster != null)
                            {
                                if (labelMaster.WH_NUMBER == inventoryQueryRequest.DATA[0].WH_NUMBER && labelMaster.WERKS == inventoryQueryRequest.DATA[0].WH_NUMBER)
                                if (labelMaster.WH_NUMBER == inventoryQueryRequest.DATA[0].WH_NUMBER && labelMaster.WERKS == inventoryQueryRequest.DATA[0].WERKS)
                                {
                                    stockItem.LIFNR = labelMaster.LIFNR;
                                    stockItem.LIKTX = labelMaster.LIKTX;
@@ -170,7 +170,20 @@
                                    stockItem.MATNR = labelMaster.MATNR;
                                    stockItem.MEINS = labelMaster.UNIT;
                                    stockItem.QTY = labelMaster.BOX_QTY;
                                    stockItem.SOBKZ = labelMaster.SOBKZ;
                                    var sobkz = "非限制";
                                    if (labelMaster.SOBKZ == "0")
                                    {
                                        sobkz = "非限制";
                                    }
                                    else if (labelMaster.SOBKZ == "1")
                                    {
                                        sobkz = "冻结";
                                    }
                                    else if (labelMaster.SOBKZ == "2")
                                    {
                                        sobkz = "待质检";
                                    }
                                    stockItem.SOBKZ = sobkz;
                                    stockItem.TPNUM = view.PalletCode;
                                    stockItem.WERKS = labelMaster.WERKS;//工厂
                                    stockItem.WH_NUMBER = labelMaster.WH_NUMBER;//仓库号
@@ -206,18 +219,20 @@
        /// </summary>
        /// <param name="freezeByCustomerResponse"></param>
        /// <returns></returns>
        public freezeByCustomerResponse freezeByCustomer(string  freezeRequeststr)
        public freezeByCustomerResponse freezeByCustomer(string freezeRequeststr)
        {
            freezeByCustomerResponse freezeResponse = new freezeByCustomerResponse();
            try
            {
                freezeByCustomerRequest freezeRequest = JsonConvert.DeserializeObject<freezeByCustomerRequest>(freezeRequeststr);
                if (freezeRequest.WERKS == AppSettings.Configuration["WERKS"] && freezeRequest.WH_NUMBER == AppSettings.Configuration["SYSNO"])
                if (freezeRequest.WERKS == AppSettings.Configuration["WERKS"] && freezeRequest.WH_NUMBER == AppSettings.Configuration["WERKS"])
                {
                    //根据批次和物料号查找对应的托盘号,冻结库存,只有入库成功了,才能被冻结
                    List<Dt_StockInfo> stockInfos = GetStockInfos(freezeRequest.MATNR, freezeRequest.BATCH);
                    if (freezeRequest.FREEZE_TYPE == "00")//00冻结
                    List<Dt_LabelMaster> labelInfos = _labelMasterRepository.QueryData(x => x.MATNR == freezeRequest.MATNR && x.BATCH == freezeRequest.BATCH);
                    if (freezeRequest.YWLX == "00")//00冻结
                    {
                        foreach (var item in stockInfos)
                        {
@@ -227,10 +242,17 @@
                                UpdateData(item);
                            }
                        }
                        foreach (var li in labelInfos)
                        {
                            li.SOBKZ = "1";
                        }
                        _labelMasterRepository.UpdateData(labelInfos);
                        freezeResponse.MSGTY = "S";
                        freezeResponse.MSGTX = "";
                    }
                    else if (freezeRequest.FREEZE_TYPE == "01") //01解冻
                    else if (freezeRequest.YWLX == "01") //01解冻
                    {
                        foreach (var item in stockInfos)
                        {
@@ -240,6 +262,20 @@
                                UpdateData(item);
                            }
                        }
                        foreach (var li in labelInfos)
                        {
                            //if (li.LABEL_STATUS == "01")
                            //{
                            //    li.SOBKZ = "2";
                            //}
                            //else
                            //{
                            li.SOBKZ = "0";
                            //}
                        }
                        _labelMasterRepository.UpdateData(labelInfos);
                        freezeResponse.MSGTY = "S";
                        freezeResponse.MSGTX = "";
ÏîÄ¿´úÂë/WMS/WIDESEA_WMSServer/WIDESEA_SystemService/Sys_JobService.cs
@@ -22,6 +22,7 @@
using WIDESEA_Core.Enums;
using WIDESEA_Core.Helper;
using WIDESEA_Core.Log;
using WIDESEA_Core.LogHelper;
using WIDESEA_DTO.Inbound;
using WIDESEA_DTO.System;
using WIDESEA_IBasicRepository;
@@ -94,11 +95,14 @@
                           Dt_LabelMaster labMaster =  _labelMasterRepository.QueryFirst(x=>x.LABEL_NO == item.LABEL_NO);
                            if (labMaster != null)//更新状态
                            {
                                labMaster.RECEIPT_NO = item.RECEIPT_NO;
                                labMaster.QC_RESULT_CODE = item.QC_RESULT_CODE;
                                labMaster.LABEL_STATUS = item.LABEL_STATUS;
                                _labelMasterRepository.UpdateData(labMaster);
                            }
                            else
                            {
                                item.WH_NUMBER = AppSettings.Configuration["SYSNO"];
                                _labelMasterRepository.AddData(item);
                            }
                        }
@@ -183,12 +187,14 @@
                
                string inparam = JsonConvert.SerializeObject(putAway);
                new LogFactory().GetLog("BYD_WMS接口").InfoFormat(true, "CallPutAway", "请求", $"{inparam}");
                //Logger.Write_Log("System/test_in", "", "inparam =  " + inparam);
                string response = likuClient.putaway(inparam);
                //Logger.Write_Log("System/test_in", "", "response =  " + response);
                new LogFactory().GetLog("BYD_WMS接口").InfoFormat(true, "CallPutAway", "响应", $"{response}");
                if (response != null)
                {
                    PutAwayResponse res = JsonConvert.DeserializeObject<PutAwayResponse>(response);
                    if (res != null && res.MSGTX == "S")
                    if (res != null && res.MSGTY == "S")
                    {
                        content = WebResponseContent.Instance.OK("上架回传成功");
                        new LogFactory().GetLog("BYD_WMS接口").InfoFormat(true, "CallPutAway", "响应", $"上架回传成功!");
@@ -227,11 +233,13 @@
                string inparam = JsonConvert.SerializeObject(putAwayReturn);
                new LogFactory().GetLog("BYD_WMS接口").InfoFormat(true, "CallPutAwayReturn", "请求", $"{inparam}");
                //Logger.Write_Log("System/test_re", "", "inparam = "+ inparam);
                string response = likuClient.putAwayReturn(inparam);
                //Logger.Write_Log("System/test_re", "", "response = " + response);
                if (response != null)
                {
                    PutAwayReturnResponse res = JsonConvert.DeserializeObject<PutAwayReturnResponse>(response);
                    if (res != null && res.MSGTX == "S")
                    if (res != null && res.MSGTY == "S")
                    {
                        content = WebResponseContent.Instance.OK("上架回传成功!");
                        new LogFactory().GetLog("BYD_WMS接口").InfoFormat(true, "CallPutAwayReturn", "响应", $"上架回传成功!");
@@ -267,155 +275,191 @@
                outStoreOrder.WERKS = AppSettings.Configuration["WERKS"];
                outStoreOrder.WH_NUMBER = AppSettings.Configuration["SYSNO"];
                string inparam = JsonConvert.SerializeObject(outStoreOrder);
                //string response = client.selectOutStoreOrder(inparam);
                string response = "{\r\n    \"MSGTY\": \"S\",\r\n    \"DATA\": \"[{REQUIREMENT_NO=XAXQGX25012005354, WERKS=GX25, WH_NUMBER=null, SYSNOD=G30, BUSINESS_CODE=00, BUSINESS_NAME=47, LGORT=0030, STATION=null, MO_NO=null, SAP_OUT_NO=null, RECEIVE_LGORT=W001, OVERSTEP_REQ_FLAG=0, SPLIT=null, STATUS=01, CREATE_PERSON=66694:宋子超, CREATE_DATE=2024-12-18 11:36:17, ITEMS=[{REQUIREMENT_ITEM_NO=1, MATNR=12825222-00, BATCH=null, QTY=10.0, GEAR=null, PI_NO=null, LABELS=[]}]}, {REQUIREMENT_NO=XAXQGX25012005353, WERKS=GX25, WH_NUMBER=null, SYSNOD=G30, BUSINESS_CODE=00, BUSINESS_NAME=47, LGORT=0030, STATION=null, MO_NO=null, SAP_OUT_NO=null, RECEIVE_LGORT=W001, OVERSTEP_REQ_FLAG=0, SPLIT=null, STATUS=01, CREATE_PERSON=66694:宋子超, CREATE_DATE=2024-12-18 11:35:22, ITEMS=[{REQUIREMENT_ITEM_NO=1, MATNR=12825222-00, BATCH=null, QTY=10.0, GEAR=null, PI_NO=null, LABELS=[]}]}]\",\r\n    \"MSGTX\": \"success\"\r\n}";
                string response = client.selectOutStoreOrder(inparam);
                //string response = "{\r\n    \"MSGTY\": \"S\",\r\n    \"DATA\": \"[{REQUIREMENT_NO=XAXQGX25012005354, WERKS=GX25, WH_NUMBER=null, SYSNOD=G30, BUSINESS_CODE=00, BUSINESS_NAME=47, LGORT=0030, STATION=null, MO_NO=null, SAP_OUT_NO=null, RECEIVE_LGORT=W001, OVERSTEP_REQ_FLAG=0, SPLIT=null, STATUS=01, CREATE_PERSON=66694:宋子超, CREATE_DATE=2024-12-18 11:36:17, ITEMS=[{REQUIREMENT_ITEM_NO=1, MATNR=12825222-00, BATCH=null, QTY=10.0, GEAR=null, PI_NO=null, LABELS=[]}]}, {REQUIREMENT_NO=XAXQGX25012005353, WERKS=GX25, WH_NUMBER=null, SYSNOD=G30, BUSINESS_CODE=00, BUSINESS_NAME=47, LGORT=0030, STATION=null, MO_NO=null, SAP_OUT_NO=null, RECEIVE_LGORT=W001, OVERSTEP_REQ_FLAG=0, SPLIT=null, STATUS=01, CREATE_PERSON=66694:宋子超, CREATE_DATE=2024-12-18 11:35:22, ITEMS=[{REQUIREMENT_ITEM_NO=1, MATNR=12825222-00, BATCH=null, QTY=10.0, GEAR=null, PI_NO=null, LABELS=[]}]}]\",\r\n    \"MSGTX\": \"success\"\r\n}";
                if (response != null)
                {
                    SelectOutStoreOrderResponse res = JsonConvert.DeserializeObject<SelectOutStoreOrderResponse>(response);
                    if (res != null && res.MSGTY == "S"&&!string.IsNullOrEmpty(res.DATA))
                    if (res != null && res.MSGTY == "S")
                    {
                        string data = stringToJson(res.DATA);
                        string newdata = data.Replace("},\"", "},").Replace("\" ", "\"");
                        List<OutStoreData> outStoreList = JsonConvert.DeserializeObject<List<OutStoreData>>(newdata);
                        foreach (var item in outStoreList)
                        if (string.IsNullOrEmpty(res.DATA) || res.DATA == "[]")
                        {
                            Dt_OutBoundOrderBYD bydOrder = _outBoundOrderBYDRepository.QueryFirst(x => x.REQUIREMENT_NO == item.REQUIREMENT_NO);
                            if (bydOrder != null)//更新
                            {
                                bydOrder.REQUIREMENT_NO = item.REQUIREMENT_NO;
                                bydOrder.WRKS = item.WERKS;
                                bydOrder.WH_NUMBER = item.WH_NUMBER;
                                bydOrder.SYSNOD = item.SYSNOD;
                                bydOrder.BUSINESS_CODE = item.BUSINESS_CODE;
                                bydOrder.BUSINESS_NAME = item.BUSINESS_NAME;
                                bydOrder.LGORT = item.LGORT;
                                bydOrder.STATION = item.STATION;
                                bydOrder.MO_NO = item.MO_NO;
                                bydOrder.SAP_OUT_NO = item.SAP_OUT_NO;
                                bydOrder.RECEIVE_LGORT = item.RECEIVE_LGORT;
                                bydOrder.OVERSTEP_REQ_FLAG = item.OVERSTEP_REQ_FLAG;
                                bydOrder.SPLIT = item.SPLIT;
                                bydOrder.STATUS = item.STATUS;
                                bydOrder.CREATE_PERSON = item.CREATE_PERSON;
                                bydOrder.CREATE_DATE = item.CREATE_DATE;
                                _outBoundOrderBYDRepository.UpdateData(bydOrder);
                                foreach (var detail in item.ITEMS)
                                {
                                    Dt_OutboundOrderDetailBYD byddetail = _outboundOrderDetailByDRepository.QueryFirst(x => x.REQUIREMENT_NO == item.REQUIREMENT_NO && x.REQUIREMENT_ITEM_NO == detail.REQUIREMENT_ITEM_NO);
                                    if (byddetail != null)
                                    {
                                        byddetail.REQUIREMENT_NO = item.REQUIREMENT_NO;
                                        byddetail.REQUIREMENT_ITEM_NO = detail.REQUIREMENT_ITEM_NO;
                                        byddetail.MATNR = detail.MATNR;
                                        byddetail.BATCH = detail.BATCH;
                                        byddetail.BATCH = detail.BATCH;
                                        byddetail.QTY = detail.QTY;
                                        byddetail.GEAR = detail.GEAR;
                                        byddetail.PI_NO = detail.PI_NO;
                                        _outboundOrderDetailByDRepository.UpdateData(byddetail);
                                    }
                                    else
                                    {
                                        Dt_OutboundOrderDetailBYD newdetail = new Dt_OutboundOrderDetailBYD();
                                        newdetail.REQUIREMENT_NO = item.REQUIREMENT_NO;
                                        newdetail.REQUIREMENT_ITEM_NO = detail.REQUIREMENT_ITEM_NO;
                                        newdetail.MATNR = detail.MATNR;
                                        newdetail.BATCH = detail.BATCH;
                                        newdetail.BATCH = detail.BATCH;
                                        newdetail.QTY = detail.QTY;
                                        newdetail.GEAR = detail.GEAR;
                                        newdetail.PI_NO = detail.PI_NO;
                                        _outboundOrderDetailByDRepository.AddData(newdetail);
                                    }
                                }
                            }
                            else
                            {
                                Dt_OutBoundOrderBYD outBoundOrderBYD = new Dt_OutBoundOrderBYD();
                                outBoundOrderBYD.REQUIREMENT_NO = item.REQUIREMENT_NO;
                                outBoundOrderBYD.WRKS = item.WERKS;
                                outBoundOrderBYD.WH_NUMBER = item.WH_NUMBER;
                                outBoundOrderBYD.SYSNOD = item.SYSNOD;
                                outBoundOrderBYD.BUSINESS_CODE = item.BUSINESS_CODE;
                                outBoundOrderBYD.BUSINESS_NAME = item.BUSINESS_NAME;
                                outBoundOrderBYD.LGORT = item.LGORT;
                                outBoundOrderBYD.STATION = item.STATION;
                                outBoundOrderBYD.MO_NO = item.MO_NO;
                                outBoundOrderBYD.SAP_OUT_NO = item.SAP_OUT_NO;
                                outBoundOrderBYD.RECEIVE_LGORT = item.RECEIVE_LGORT;
                                outBoundOrderBYD.OVERSTEP_REQ_FLAG = item.OVERSTEP_REQ_FLAG;
                                outBoundOrderBYD.SPLIT = item.SPLIT;
                                outBoundOrderBYD.STATUS = item.STATUS;
                                outBoundOrderBYD.CREATE_PERSON = item.CREATE_PERSON;
                                outBoundOrderBYD.CREATE_DATE = item.CREATE_DATE;
                                _outBoundOrderBYDRepository.AddData(outBoundOrderBYD);
                                foreach (var detail in item.ITEMS)
                                {
                                    Dt_OutboundOrderDetailBYD outboundOrderDetailBYD = new Dt_OutboundOrderDetailBYD();
                                    outboundOrderDetailBYD.REQUIREMENT_NO = outBoundOrderBYD.REQUIREMENT_NO;
                                    outboundOrderDetailBYD.REQUIREMENT_ITEM_NO = detail.REQUIREMENT_ITEM_NO;
                                    outboundOrderDetailBYD.MATNR = detail.MATNR;
                                    outboundOrderDetailBYD.BATCH = detail.BATCH;
                                    outboundOrderDetailBYD.QTY = detail.QTY;
                                    outboundOrderDetailBYD.GEAR = detail.GEAR;
                                    outboundOrderDetailBYD.PI_NO = detail.PI_NO;
                                    _outboundOrderDetailByDRepository.AddData(outboundOrderDetailBYD);
                                    foreach (var label in detail.LABELS)
                                    {
                                        if (label != null)
                                        {
                                            Dt_OutboundOrderDetail_LabelsBYD outboundOrderDetail_LabelsBYD = new Dt_OutboundOrderDetail_LabelsBYD();
                                            outboundOrderDetail_LabelsBYD.LABEL_NO = label.LABLEL_NO;
                                            outboundOrderDetail_LabelsBYD.CONTENT_LABEL_NO = label.CONTENT_LABLEL_NO;
                                            outboundOrderDetail_LabelsBYD.REQUIREMENT_NO = item.REQUIREMENT_NO;
                                            outboundOrderDetail_LabelsBYD.REQUIREMENT_ITEM_NO = detail.REQUIREMENT_ITEM_NO;
                                            _outboundOrderDetailLabelsByDRepository.AddData(outboundOrderDetail_LabelsBYD);
                                        }
                                    }
                                }
                            }
                            content = WebResponseContent.Instance.Error("出库单数据为空");
                        }
                        //同步到WMS出库单中
                        foreach(var item in outStoreList)
                        else
                        {
                            if (item != null)
                            string data = stringToJson(res.DATA);
                            string newdata = data.Replace("},\"", "},").Replace("\" ", "\"");
                            List<OutStoreData> outStoreList = JsonConvert.DeserializeObject<List<OutStoreData>>(newdata);
                            foreach (var item in outStoreList)
                            {
                                Dt_OutboundOrder outOrder =_outboundOrderRepository.QueryFirst(x=>x.OrderNo==item.REQUIREMENT_NO);
                                if (outOrder != null)
                                Dt_OutBoundOrderBYD bydOrder = _outBoundOrderBYDRepository.QueryFirst(x => x.REQUIREMENT_NO == item.REQUIREMENT_NO);
                                if (bydOrder != null)//更新
                                {
                                    outOrder.OrderNo = item.REQUIREMENT_NO;
                                    outOrder.UpperOrderNo = "";
                                    outOrder.OrderType = (int)OutOrderTypeEnum.Issue;
                                    outOrder.OrderStatus = (int)OutboundStatusEnum.未开始;
                                    outOrder.CreateType = (int)CreateType.UpperSystemPush;
                                    outOrder.Creater = "System";
                                    _outboundOrderRepository.UpdateData(outOrder);
                                    foreach (var orderdetail in item.ITEMS)
                                    bydOrder.REQUIREMENT_NO = item.REQUIREMENT_NO;
                                    bydOrder.WRKS = item.WERKS;
                                    bydOrder.WH_NUMBER = item.WH_NUMBER;
                                    bydOrder.SYSNOD = item.SYSNOD;
                                    bydOrder.BUSINESS_CODE = item.BUSINESS_CODE;
                                    bydOrder.BUSINESS_NAME = item.BUSINESS_NAME;
                                    bydOrder.LGORT = item.LGORT;
                                    bydOrder.STATION = item.STATION;
                                    bydOrder.MO_NO = item.MO_NO;
                                    bydOrder.SAP_OUT_NO = item.SAP_OUT_NO;
                                    bydOrder.RECEIVE_LGORT = item.RECEIVE_LGORT;
                                    bydOrder.OVERSTEP_REQ_FLAG = item.OVERSTEP_REQ_FLAG;
                                    bydOrder.SPLIT = item.SPLIT;
                                    bydOrder.STATUS = item.STATUS;
                                    bydOrder.CREATE_PERSON = item.CREATE_PERSON;
                                    bydOrder.CREATE_DATE = item.CREATE_DATE;
                                    _outBoundOrderBYDRepository.UpdateData(bydOrder);
                                    foreach (var detail in item.ITEMS)
                                    {
                                        Dt_OutboundOrderDetail detail = _outboundOrderDetailRepository.QueryFirst(x => x.OrderId == outOrder.Id && x.Remark == orderdetail.REQUIREMENT_ITEM_NO);
                                        if (detail != null)
                                        Dt_OutboundOrderDetailBYD byddetail = _outboundOrderDetailByDRepository.QueryFirst(x => x.REQUIREMENT_NO == item.REQUIREMENT_NO && x.REQUIREMENT_ITEM_NO == detail.REQUIREMENT_ITEM_NO);
                                        if (byddetail != null)
                                        {
                                            detail.OrderId = outOrder.Id;
                                            detail.MaterielCode = orderdetail.MATNR;
                                            detail.BatchNo = orderdetail.BATCH;
                                            detail.OrderQuantity = Convert.ToDecimal(orderdetail.QTY);
                                            detail.LockQuantity = 0;
                                            detail.OverOutQuantity = 0;
                                            detail.OrderDetailStatus = (int)OrderDetailStatusEnum.New;
                                            detail.Creater = "System";
                                            detail.Remark = orderdetail.REQUIREMENT_ITEM_NO;
                                            _outboundOrderDetailRepository.UpdateData(detail);
                                            byddetail.REQUIREMENT_NO = item.REQUIREMENT_NO;
                                            byddetail.REQUIREMENT_ITEM_NO = detail.REQUIREMENT_ITEM_NO;
                                            byddetail.MATNR = detail.MATNR;
                                            byddetail.BATCH = detail.BATCH;
                                            byddetail.BATCH = detail.BATCH;
                                            byddetail.QTY = detail.QTY;
                                            byddetail.GEAR = detail.GEAR;
                                            byddetail.PI_NO = detail.PI_NO;
                                            _outboundOrderDetailByDRepository.UpdateData(byddetail);
                                        }
                                        else
                                        {
                                            Dt_OutboundOrderDetailBYD newdetail = new Dt_OutboundOrderDetailBYD();
                                            newdetail.REQUIREMENT_NO = item.REQUIREMENT_NO;
                                            newdetail.REQUIREMENT_ITEM_NO = detail.REQUIREMENT_ITEM_NO;
                                            newdetail.MATNR = detail.MATNR;
                                            newdetail.BATCH = detail.BATCH;
                                            newdetail.BATCH = detail.BATCH;
                                            newdetail.QTY = detail.QTY;
                                            newdetail.GEAR = detail.GEAR;
                                            newdetail.PI_NO = detail.PI_NO;
                                            _outboundOrderDetailByDRepository.AddData(newdetail);
                                        }
                                    }
                                }
                                else
                                {
                                    Dt_OutBoundOrderBYD outBoundOrderBYD = new Dt_OutBoundOrderBYD();
                                    outBoundOrderBYD.REQUIREMENT_NO = item.REQUIREMENT_NO;
                                    outBoundOrderBYD.WRKS = item.WERKS;
                                    outBoundOrderBYD.WH_NUMBER = item.WH_NUMBER;
                                    outBoundOrderBYD.SYSNOD = item.SYSNOD;
                                    outBoundOrderBYD.BUSINESS_CODE = item.BUSINESS_CODE;
                                    outBoundOrderBYD.BUSINESS_NAME = item.BUSINESS_NAME;
                                    outBoundOrderBYD.LGORT = item.LGORT;
                                    outBoundOrderBYD.STATION = item.STATION;
                                    outBoundOrderBYD.MO_NO = item.MO_NO;
                                    outBoundOrderBYD.SAP_OUT_NO = item.SAP_OUT_NO;
                                    outBoundOrderBYD.RECEIVE_LGORT = item.RECEIVE_LGORT;
                                    outBoundOrderBYD.OVERSTEP_REQ_FLAG = item.OVERSTEP_REQ_FLAG;
                                    outBoundOrderBYD.SPLIT = item.SPLIT;
                                    outBoundOrderBYD.STATUS = item.STATUS;
                                    outBoundOrderBYD.CREATE_PERSON = item.CREATE_PERSON;
                                    outBoundOrderBYD.CREATE_DATE = item.CREATE_DATE;
                                    _outBoundOrderBYDRepository.AddData(outBoundOrderBYD);
                                    foreach (var detail in item.ITEMS)
                                    {
                                        Dt_OutboundOrderDetailBYD outboundOrderDetailBYD = new Dt_OutboundOrderDetailBYD();
                                        outboundOrderDetailBYD.REQUIREMENT_NO = outBoundOrderBYD.REQUIREMENT_NO;
                                        outboundOrderDetailBYD.REQUIREMENT_ITEM_NO = detail.REQUIREMENT_ITEM_NO;
                                        outboundOrderDetailBYD.MATNR = detail.MATNR;
                                        outboundOrderDetailBYD.BATCH = detail.BATCH;
                                        outboundOrderDetailBYD.QTY = detail.QTY;
                                        outboundOrderDetailBYD.GEAR = detail.GEAR;
                                        outboundOrderDetailBYD.PI_NO = detail.PI_NO;
                                        _outboundOrderDetailByDRepository.AddData(outboundOrderDetailBYD);
                                        foreach (var label in detail.LABELS)
                                        {
                                            if (label != null)
                                            {
                                                Dt_OutboundOrderDetail_LabelsBYD outboundOrderDetail_LabelsBYD = new Dt_OutboundOrderDetail_LabelsBYD();
                                                outboundOrderDetail_LabelsBYD.LABEL_NO = label.LABLEL_NO;
                                                outboundOrderDetail_LabelsBYD.CONTENT_LABEL_NO = label.CONTENT_LABLEL_NO;
                                                outboundOrderDetail_LabelsBYD.REQUIREMENT_NO = item.REQUIREMENT_NO;
                                                outboundOrderDetail_LabelsBYD.REQUIREMENT_ITEM_NO = detail.REQUIREMENT_ITEM_NO;
                                                _outboundOrderDetailLabelsByDRepository.AddData(outboundOrderDetail_LabelsBYD);
                                            }
                                        }
                                    }
                                }
                            }
                            //同步到WMS出库单中
                            foreach (var item in outStoreList)
                            {
                                if (item != null)
                                {
                                    Dt_OutboundOrder outOrder = _outboundOrderRepository.QueryFirst(x => x.OrderNo == item.REQUIREMENT_NO);
                                    if (outOrder != null)
                                    {
                                        outOrder.OrderNo = item.REQUIREMENT_NO;
                                        outOrder.UpperOrderNo = "";
                                        outOrder.OrderType = (int)OutOrderTypeEnum.Issue;
                                        outOrder.OrderStatus = (int)OutboundStatusEnum.未开始;
                                        outOrder.CreateType = (int)CreateType.UpperSystemPush;
                                        outOrder.Creater = "System";
                                        _outboundOrderRepository.UpdateData(outOrder);
                                        foreach (var orderdetail in item.ITEMS)
                                        {
                                            Dt_OutboundOrderDetail detail = _outboundOrderDetailRepository.QueryFirst(x => x.OrderId == outOrder.Id && x.Remark == orderdetail.REQUIREMENT_ITEM_NO);
                                            if (detail != null)
                                            {
                                                detail.OrderId = outOrder.Id;
                                                detail.MaterielCode = orderdetail.MATNR;
                                                detail.BatchNo = orderdetail.BATCH;
                                                detail.OrderQuantity = Convert.ToDecimal(orderdetail.QTY);
                                                detail.LockQuantity = 0;
                                                detail.OverOutQuantity = 0;
                                                detail.OrderDetailStatus = (int)OrderDetailStatusEnum.New;
                                                detail.Creater = "System";
                                                detail.Remark = orderdetail.REQUIREMENT_ITEM_NO;
                                                _outboundOrderDetailRepository.UpdateData(detail);
                                            }
                                            else
                                            {
                                                Dt_OutboundOrderDetail outboundOrderDetail = new Dt_OutboundOrderDetail();
                                                outboundOrderDetail.OrderId = outOrder.Id;
                                                outboundOrderDetail.MaterielCode = orderdetail.MATNR;
                                                outboundOrderDetail.BatchNo = orderdetail.BATCH;
                                                outboundOrderDetail.OrderQuantity = Convert.ToDecimal(orderdetail.QTY);
                                                outboundOrderDetail.LockQuantity = 0;
                                                outboundOrderDetail.OverOutQuantity = 0;
                                                outboundOrderDetail.OrderDetailStatus = (int)OrderDetailStatusEnum.New;
                                                outboundOrderDetail.Creater = "System";
                                                outboundOrderDetail.Remark = orderdetail.REQUIREMENT_ITEM_NO;
                                                _outboundOrderDetailRepository.AddData(outboundOrderDetail);
                                            }
                                        }
                                    }
                                    else
                                    {
                                        Dt_OutboundOrder outboundOrder = new Dt_OutboundOrder();
                                        outboundOrder.OrderNo = item.REQUIREMENT_NO;
                                        outboundOrder.UpperOrderNo = "";
                                        outboundOrder.OrderType = (int)OutOrderTypeEnum.Issue;
                                        outboundOrder.OrderStatus = (int)OutboundStatusEnum.未开始;
                                        outboundOrder.CreateType = (int)CreateType.UpperSystemPush;
                                        outboundOrder.Creater = "System";
                                        _outboundOrderRepository.AddData(outboundOrder);
                                        Dt_OutboundOrder outOrdertemp = _outboundOrderRepository.QueryFirst(x => x.OrderNo == item.REQUIREMENT_NO);
                                        foreach (var orderdetail in item.ITEMS)
                                        {
                                            Dt_OutboundOrderDetail outboundOrderDetail = new Dt_OutboundOrderDetail();
                                            outboundOrderDetail.OrderId = outOrder.Id;
                                            outboundOrderDetail.OrderId = outOrdertemp.Id;
                                            outboundOrderDetail.MaterielCode = orderdetail.MATNR;
                                            outboundOrderDetail.BatchNo = orderdetail.BATCH;
                                            outboundOrderDetail.OrderQuantity = Convert.ToDecimal(orderdetail.QTY);
@@ -427,45 +471,16 @@
                                            _outboundOrderDetailRepository.AddData(outboundOrderDetail);
                                        }
                                    }
                                }
                                else
                                {
                                    Dt_OutboundOrder outboundOrder = new Dt_OutboundOrder();
                                    outboundOrder.OrderNo = item.REQUIREMENT_NO;
                                    outboundOrder.UpperOrderNo = "";
                                    outboundOrder.OrderType = (int)OutOrderTypeEnum.Issue;
                                    outboundOrder.OrderStatus = (int)OutboundStatusEnum.未开始;
                                    outboundOrder.CreateType = (int)CreateType.UpperSystemPush;
                                    outboundOrder.Creater = "System";
                                    _outboundOrderRepository.AddData(outboundOrder);
                                    Dt_OutboundOrder outOrdertemp = _outboundOrderRepository.QueryFirst(x => x.OrderNo == item.REQUIREMENT_NO);
                                    foreach (var orderdetail in item.ITEMS)
                                    {
                                        Dt_OutboundOrderDetail outboundOrderDetail = new Dt_OutboundOrderDetail();
                                        outboundOrderDetail.OrderId = outOrdertemp.Id;
                                        outboundOrderDetail.MaterielCode = orderdetail.MATNR;
                                        outboundOrderDetail.BatchNo = orderdetail.BATCH;
                                        outboundOrderDetail.OrderQuantity =Convert.ToDecimal(orderdetail.QTY);
                                        outboundOrderDetail.LockQuantity = 0;
                                        outboundOrderDetail.OverOutQuantity = 0;
                                        outboundOrderDetail.OrderDetailStatus = (int)OrderDetailStatusEnum.New;
                                        outboundOrderDetail.Creater="System";
                                        outboundOrderDetail.Remark = orderdetail.REQUIREMENT_ITEM_NO;
                                        _outboundOrderDetailRepository.AddData(outboundOrderDetail);
                                    }
                                }
                            }
                            content = WebResponseContent.Instance.OK();
                        }
                        content = WebResponseContent.Instance.OK();
                    }
                    }
                }
            }
@@ -487,16 +502,18 @@
            WebResponseContent content = new WebResponseContent();
            try
            {
                StereoServiceReference.WhStereoWebServiceClient client = new StereoServiceReference.WhStereoWebServiceClient();
                LikuServiceReference.WmsStereoWhServiceClient likuClient = new LikuServiceReference.WmsStereoWhServiceClient();
                string inparam = JsonConvert.SerializeObject(pickAndPost);
                //Logger.Write_Log("System/test_out", "", "inparam= "+ inparam);
                new LogFactory().GetLog("BYD_WMS接口").InfoFormat(true, "CallPickAndPost", "请求", $"{inparam}");
                string response = client.pickAndPost(inparam);
                string response = likuClient.pickAndPost(inparam);
                new LogFactory().GetLog("BYD_WMS接口").InfoFormat(true, "CallPickAndPost", "响应", $"{response}");
                //Logger.Write_Log("System/test_out", "", "response= " + response);
                if (response != null)
                {
                    PickAndPostResponse res = JsonConvert.DeserializeObject<PickAndPostResponse>(response);
                    if (res != null && res.MSGTX == "S")
                    if (res != null && res.MSGTY == "S")
                    {
                        content = WebResponseContent.Instance.OK("出库回传成功!");
                        new LogFactory().GetLog("BYD_WMS接口").InfoFormat(true, "CallPickAndPost", "响应", $"出库回传成功!");
ÏîÄ¿´úÂë/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_Inbound.cs
@@ -12,6 +12,7 @@
using System.Net.Http.Headers;
using System.Security.Policy;
using Newtonsoft.Json;
using WIDESEA_Core.LogHelper;
namespace WIDESEA_TaskInfoService
{
@@ -77,10 +78,16 @@
            WebResponseContent content = new WebResponseContent();
            try
            {
                //Logger.Write_Log("System/test_in", "", "1.0 ", "");
                Dt_StockInfo stockInfo = _stockService.StockInfoService.Repository.GetStockInfo(palletCode);
                //Logger.Write_Log("System/test_in", "", "1.1 ", "");
                (bool, string) result = CheckRequestInbound(stationCode, palletCode, true, stockInfo);
                //Logger.Write_Log("System/test_in", "", "1.2 ", "");
                if (!result.Item1) return content = WebResponseContent.Instance.Error(result.Item2);
                //Logger.Write_Log("System/test_in", "", "1.3 ", "");
                content = AssignLocUpdateData(stationCode, TaskTypeEnum.Inbound.ObjToInt(), palletCode, true, stockInfo);
                //Logger.Write_Log("System/test_in", "", "1.4 ", "");
            }
            catch (Exception ex)
            {
@@ -129,10 +136,15 @@
            WebResponseContent content = new WebResponseContent();
            try
            {
                //Logger.Write_Log("System/test_in", "", "2.0 ");
                _unitOfWorkManage.BeginTran();
                Dt_LocationInfo? locationInfo = _basicService.LocationInfoService.AssignLocation(stationCode, taskType,palletCode);
                //Logger.Write_Log("System/test_in", "", "2.1 ");
                if (locationInfo != null)
                {
                    //Logger.Write_Log("System/test_in", "", "2.2 ");
                    List<Dt_Task> tasks = new List<Dt_Task>();
                    Dt_Task task = new()
                    {
@@ -151,16 +163,22 @@
                    BaseDal.AddData(task);
                    int beforeStatus = locationInfo.LocationStatus;
                    //Logger.Write_Log("System/test_in", "", "2.3 ");
                    if (isUpdateStock)
                    {
                        //Logger.Write_Log("System/test_in", "", "2.3.1 ");
                        locationInfo.LocationStatus = LocationStatusEnum.Lock.ObjToInt();
                        if (locationInfo.Depth == 2)
                        {
                            //Logger.Write_Log("System/test_in", "", "2.3.1.1 ");
                            _basicService.LocationInfoService.UpdateLocationLock(locationInfo, task.TaskNum, StockChangeType.Inbound.ObjToInt(), false);
                        }
                        //Logger.Write_Log("System/test_in", "", "2.3.1.2 ");
                        if (stockInfo != null && stockInfo.Details != null && stockInfo.Details.Count > 0)
                        {
                            //Logger.Write_Log("System/test_in", "", "2.3.1.3 ");
                            orderNo = stockInfo.Details.FirstOrDefault()?.OrderNo ?? "";
                            stockInfo.StockStatus = StockStatusEmun.入库确认.ObjToInt();
@@ -168,11 +186,14 @@
                        }
                        else
                        {
                            //Logger.Write_Log("System/test_in", "", "2.3.1.4 ");
                            return content = WebResponseContent.Instance.Error("未找到库存信息");
                        }
                    }
                    else
                    {
                        //Logger.Write_Log("System/test_in", "", "2.3.2 ");
                        locationInfo.LocationStatus = LocationStatusEnum.PalletLock.ObjToInt();
                        if (locationInfo.Depth == 2)
                        {
@@ -180,19 +201,26 @@
                        }
                        task.Grade = 1;
                    }
                    //Logger.Write_Log("System/test_in", "", "2.4 ");
                    _basicService.LocationInfoService.Repository.UpdateData(locationInfo);
                     
                    tasks.Add(task);
                    _recordService.LocationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(locationInfo, beforeStatus, StockChangeType.Inbound.ObjToInt(), orderNo, task.TaskNum);
                    //Logger.Write_Log("System/test_in", "", "2.5 ");
                    var response = HttpHelper.Post<WebResponseContent>(url + "ReceiveTask/", tasks, "入库任务下发");
                    if (!response.Status)
                    {
                        _unitOfWorkManage.RollbackTran();
                        return content = WebResponseContent.Instance.Error($"{response.Message}");
                    }
                    _unitOfWorkManage.CommitTran();
                    //Logger.Write_Log("System/test_in", "", "2.6 ");
                    return content = WebResponseContent.Instance.OK();
                }
                return content = WebResponseContent.Instance.Error("未找到可分配货位");
            }
ÏîÄ¿´úÂë/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs
@@ -38,6 +38,7 @@
using WIDESEA_Core.Enums;
using WIDESEA_Core.Helper;
using WIDESEA_Core.Log;
using WIDESEA_Core.LogHelper;
using WIDESEA_DTO.Inbound;
using WIDESEA_DTO.Stock;
using WIDESEA_IBasicRepository;
@@ -87,12 +88,12 @@
        private Dictionary<string, OrderByType> _OutLockOrderBy = new Dictionary<string, OrderByType>()
        {
            { nameof(Dt_OutStockLockInfo.CreateDate), OrderByType.Desc },
        };
        public TaskService(ITaskRepository BaseDal, IMapper mapper, IUnitOfWorkManage unitOfWorkManage, IBasicService basicService, IOutboundService outboundService, IInboundService inboundService, IRecordService recordService, IStockService stockService, ITask_HtyService taskHtyService, ILocationInfoService locationInfoService, ISys_JobService sys_JobService, ILabelMasterRepository labelMasterRepository, IOutStockLockInfoRepository outStockLockInfoRepository, IOutboundOrderDetailRepository outboundOrderDetailRepository, IOutBoundOrderBYDRepository outBoundOrderBYDRepository, IOutboundOrderDetailBYDRepository outboundOrderDetailByDRepository, IOutboundOrderRepository outboundOrderRepository, IOutboundOrder_HtyRepository outboundOrder_HtyRepository, IOutboundOrderDetail_HtyRepository outboundOrderDetail_HtyRepository, IReturnInventoryDetailRepository returnInventoryDetailRepository,IMainReturnInventoryRepository mainReturnInventoryRepository) : base(BaseDal)
        public TaskService(ITaskRepository BaseDal, IMapper mapper, IUnitOfWorkManage unitOfWorkManage, IBasicService basicService, IOutboundService outboundService, IInboundService inboundService, IRecordService recordService, IStockService stockService, ITask_HtyService taskHtyService, ILocationInfoService locationInfoService, ISys_JobService sys_JobService, ILabelMasterRepository labelMasterRepository, IOutStockLockInfoRepository outStockLockInfoRepository, IOutboundOrderDetailRepository outboundOrderDetailRepository, IOutBoundOrderBYDRepository outBoundOrderBYDRepository, IOutboundOrderDetailBYDRepository outboundOrderDetailByDRepository, IOutboundOrderRepository outboundOrderRepository, IOutboundOrder_HtyRepository outboundOrder_HtyRepository, IOutboundOrderDetail_HtyRepository outboundOrderDetail_HtyRepository, IReturnInventoryDetailRepository returnInventoryDetailRepository, IMainReturnInventoryRepository mainReturnInventoryRepository) : base(BaseDal)
        {
            _mapper = mapper;
            _unitOfWorkManage = unitOfWorkManage;
@@ -114,7 +115,7 @@
            _outboundOrderDetail_HtyRepository = outboundOrderDetail_HtyRepository;
            _returnInventoryDetailRepository = returnInventoryDetailRepository;
            _mainReturnInventoryRepository = mainReturnInventoryRepository;
        }
@@ -164,7 +165,7 @@
            }
            finally
            {
                WriteLog.GetLog("任务完成").Write($"操作人:{(App.User.UserId>0? App.User.UserName: "System")}{ Environment.NewLine}任务号:{taskNum}{Environment.NewLine}{ JsonConvert.SerializeObject(content)}", "任务完成");
                WriteLog.GetLog("任务完成").Write($"操作人:{(App.User.UserId > 0 ? App.User.UserName : "System")}{Environment.NewLine}任务号:{taskNum}{Environment.NewLine}{JsonConvert.SerializeObject(content)}", "任务完成");
            }
        }
        public WebResponseContent TaskCancel(int taskNum)
@@ -175,7 +176,7 @@
                Dt_Task task = BaseDal.QueryFirst(x => x.TaskNum == taskNum);
                if (task == null)
                {
                    return content=WebResponseContent.Instance.Error("未找到任务信息");
                    return content = WebResponseContent.Instance.Error("未找到任务信息");
                }
                _unitOfWorkManage.BeginTran();
                MethodInfo? methodInfo = GetType().GetMethod(((TaskTypeEnum)task.TaskType) + "TaskCancel");
@@ -192,22 +193,22 @@
                                if (!response.Status)
                                {
                                    _unitOfWorkManage.RollbackTran();
                                    return content=WebResponseContent.Instance.Error(response.Message);
                                    return content = WebResponseContent.Instance.Error(response.Message);
                                }
                                _unitOfWorkManage.CommitTran();
                                return content=responseContent;
                                return content = responseContent;
                            }
                            _unitOfWorkManage.CommitTran();
                            return content=responseContent;
                            return content = responseContent;
                        }
                    }
                }
                return content=WebResponseContent.Instance.Error("未找到任务类型对应业务处理逻辑");
                return content = WebResponseContent.Instance.Error("未找到任务类型对应业务处理逻辑");
            }
            catch (Exception ex)
            {
                _unitOfWorkManage.RollbackTran();
                return content=WebResponseContent.Instance.Error(ex.Message);
                return content = WebResponseContent.Instance.Error(ex.Message);
            }
            finally
            {
@@ -270,7 +271,7 @@
                task.Modifier = App.User.UserId > 0 ? App.User.UserName : "System";
                BaseDal.UpdateData(task);
                _unitOfWorkManage.CommitTran();
                 return content = WebResponseContent.Instance.OK();
                return content = WebResponseContent.Instance.OK();
            }
            catch (Exception ex)
            {
@@ -282,33 +283,58 @@
        {
            try
            {
                //Logger.Write_Log("System/test_in", "", "3.0 ");
                _unitOfWorkManage.BeginTran();
                decimal beforeQuantity = 0;
                Dt_LocationInfo locationInfo = _basicService.LocationInfoService.Repository.QueryFirst(x => x.LocationCode == task.TargetAddress);
                Dt_StockInfo stockInfo = _stockService.StockInfoService.Repository.GetStockInfo(task.PalletCode);
                //Logger.Write_Log("System/test_in", "", "3.1 ");
                CheckCompleted(stockInfo, locationInfo);
                //Logger.Write_Log("System/test_in", "", "3.2 ");
                stockInfo.LocationCode = locationInfo.LocationCode;
                stockInfo.StockStatus = StockStatusEmun.已入库.ObjToInt();
                _stockService.StockInfoService.Repository.UpdateData(stockInfo);
                //Logger.Write_Log("System/test_in", "", "3.3 ");
                beforeQuantity = stockInfo.Details.Where(x => x.Id != 0).Sum(x => x.StockQuantity);
                foreach (Dt_StockInfoDetail detail in stockInfo.Details)
                {
                    //0 - éžé™åˆ¶ï¼ˆåœ¨åº“正常的物料)
                    //1 - å†»ç»“(在库已冻结的物料)
                    //2 - å¾…质检(已上架立库,还未质检或已质检不合格的物料)
                    Dt_LabelMaster labMaster = _labelMasterRepository.QueryFirst(x => x.LABEL_NO == detail.SerialNumber);
                    if (labMaster.LABEL_STATUS == "01")
                    {
                        labMaster.SOBKZ = "0";
                    }
                    else
                    {
                        labMaster.SOBKZ = "2";
                    }
                    _labelMasterRepository.UpdateData(labMaster);
                }
                int beforeStatus = locationInfo.LocationStatus;
                locationInfo.LocationStatus = LocationStatusEnum.InStock.ObjToInt();
                _basicService.LocationInfoService.UpdateLocationFree(locationInfo, task.TaskNum, StockChangeType.Inbound.ObjToInt(), false);
                //Logger.Write_Log("System/test_in", "", "3.4 ");
                _basicService.LocationInfoService.Repository.UpdateData(locationInfo);
                task.TaskStatus = InTaskStatusEnum.InFinish.ObjToInt();
                //Logger.Write_Log("System/test_in", "", "3.5 ");
                BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId == 0 ? OperateType.自动完成 : OperateType.人工完成);
                //Logger.Write_Log("System/test_in", "", "3.6 ");
                _recordService.LocationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(locationInfo, beforeStatus, StockChangeType.Inbound.ObjToInt(), stockInfo.Details.FirstOrDefault()?.OrderNo ?? "", task.TaskNum);
                _recordService.StockQuantityChangeRecordService.AddStockChangeRecord(stockInfo, stockInfo.Details, beforeQuantity, stockInfo.Details.Sum(x => x.StockQuantity) + beforeQuantity, StockChangeType.Inbound,task.TaskNum);
                _recordService.StockQuantityChangeRecordService.AddStockChangeRecord(stockInfo, stockInfo.Details, beforeQuantity, stockInfo.Details.Sum(x => x.StockQuantity) + beforeQuantity, StockChangeType.Inbound, task.TaskNum);
                _unitOfWorkManage.CommitTran();
                //Logger.Write_Log("System/test_in", "", "3.7 ");
            }
            catch (Exception ex)
            {
@@ -320,27 +346,33 @@
            #region å›žä¼ é€»è¾‘处理
            try
            {
                //Logger.Write_Log("System/test_in", "", "3.8 ");
                PutAwayRequest request = new PutAwayRequest();
                List<PutAway> itemData = new List<PutAway>();
                request.ITEMDATA = itemData;
                request.WERKS = AppSettings.Configuration["WERKS"];
                request.WH_NUMBER = AppSettings.Configuration["WERKS"];
                request.IZLID = request.WERKS + request.WH_NUMBER+ DateTime.Now.ToString("yyyyMMdd") + task.TaskNum.ToString();
                request.WH_NUMBER = AppSettings.Configuration["SYSNO"];
                request.IZLID = request.WERKS + request.WH_NUMBER + DateTime.Now.ToString("yyyyMMdd") + task.TaskNum.ToString();
                request.CREATE_DATE = task.CreateDate.ToString("yyyy-MM-dd HH:mm:ss");
                request.PSTNG_DATE = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                request.INBOUND_NO = "";//todo:单号要从条码主数据中获取,不然回传会提示:该条码无进仓单数据!
                request.RECEIPT_NO = "";//todo:单号要从条码主数据中,不然回传会提示:该条码无进仓单数据!
                //Logger.Write_Log("System/test_in", "", "3.9 ");
                Dt_StockInfo stockInfo = _stockService.StockInfoService.Repository.GetStockInfo(task.PalletCode);
                //Logger.Write_Log("System/test_in", "", "3.10 ");
                foreach (Dt_StockInfoDetail detail in stockInfo.Details)
                {
                    //Logger.Write_Log("System/test_in", "", "3.11 ");
                    Dt_LabelMaster labMaster = _labelMasterRepository.QueryFirst(x => x.LABEL_NO == detail.SerialNumber);
                    if (labMaster != null)
                    {
                        if (request.INBOUND_NO == "")
                        //Logger.Write_Log("System/test_in", "", "3.12 ");
                        if (string.IsNullOrWhiteSpace(request.INBOUND_NO))
                        {
                            request.INBOUND_NO = labMaster.INBOUND_NO;
                        }
                        if (request.RECEIPT_NO == "")
                        if (string.IsNullOrWhiteSpace(request.RECEIPT_NO))
                        {
                            request.RECEIPT_NO = labMaster.RECEIPT_NO;
                        }
@@ -363,24 +395,34 @@
                        putAway.RECEIPT_ITEM_NO = labMaster.RECEIPT_ITEM_NO;
                        putAway.INBOUND_NO = task.TaskNum.ToString();
                        //LABEL _STATUS æ¡ç çŠ¶æ€  02已收料(无需质检)03 å¾…进仓(已质检),并且,QC RESULT CODE质检状态为“02” æ‰å…è®¡ä¸Šæž¶
                        if (labMaster.QC_RESULT_CODE=="02"&&(labMaster.LABEL_STATUS=="02"|| labMaster.LABEL_STATUS == "03"))
                        //Logger.Write_Log("System/test_in", "", "3.13 ");
                        if (labMaster.QC_RESULT_CODE == "02" && (labMaster.LABEL_STATUS == "02" || labMaster.LABEL_STATUS == "03"))
                        {
                            //Logger.Write_Log("System/test_in", "", "3.14 ");
                            itemData.Add(putAway);
                        }
                    }
                }
                if (itemData.Count > 0)
                {
                   WebResponseContent content=  _sys_JobService.CallPutAway(request);
                   if (content != null&&content.Message== "上架回传成功") //如果上架成功,修改库存状态为已上架
                    //Logger.Write_Log("System/test_in", "", "3.15 ");
                    WebResponseContent content = _sys_JobService.CallPutAway(request);
                    //Logger.Write_Log("System/test_in", "", "3.16 ");
                    if (content != null && content.Message == "上架回传成功") //如果上架成功,修改库存状态为已上架
                    {
                        //Logger.Write_Log("System/test_in", "", "3.17 ");
                        stockInfo.StockStatus = StockStatusEmun.已上架.ObjToInt();
                        _stockService.StockInfoService.Repository.UpdateData(stockInfo);
                    }
                    else
                    {
                        //Logger.Write_Log("System/test_in", "", "3.18 " + content.Message);
                    }
                }
            }
            catch(Exception ex)
            catch (Exception ex)
            {
                return WebResponseContent.Instance.Error(ex.Message);
            }
@@ -449,15 +491,20 @@
            try
            {
                //Logger.Write_Log("System/test_re", "", "3.0 ");
                _unitOfWorkManage.BeginTran();
                decimal beforeQuantity = 0;
                Dt_LocationInfo locationInfo = _basicService.LocationInfoService.Repository.QueryFirst(x => x.LocationCode == task.TargetAddress);
                //Logger.Write_Log("System/test_re", "", "3.1 ");
                Dt_StockInfo stockInfo = _stockService.StockInfoService.Repository.GetStockInfo(task.PalletCode);
                //Logger.Write_Log("System/test_re", "", "3.2 ");
                CheckCompleted(stockInfo, locationInfo);
                //Logger.Write_Log("System/test_re", "", "3.3 ");
                stockInfo.LocationCode = locationInfo.LocationCode;
                stockInfo.StockStatus = StockStatusEmun.已入库.ObjToInt();
                _stockService.StockInfoService.Repository.UpdateData(stockInfo);
                //Logger.Write_Log("System/test_re", "", "3.4 ");
                beforeQuantity = stockInfo.Details.Where(x => x.Id != 0).Sum(x => x.StockQuantity);
@@ -465,14 +512,20 @@
                locationInfo.LocationStatus = LocationStatusEnum.InStock.ObjToInt();
                _basicService.LocationInfoService.UpdateLocationFree(locationInfo, task.TaskNum, StockChangeType.Inbound.ObjToInt(), false);
                //Logger.Write_Log("System/test_re", "", "3.5 ");
                _basicService.LocationInfoService.Repository.UpdateData(locationInfo);
                task.TaskStatus = InTaskStatusEnum.InFinish.ObjToInt();
                //Logger.Write_Log("System/test_re", "", "3.6 ");
                BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId == 0 ? OperateType.自动完成 : OperateType.人工完成);
                //Logger.Write_Log("System/test_re", "", "3.7 ");
                _recordService.LocationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(locationInfo, beforeStatus, StockChangeType.Inbound.ObjToInt(), stockInfo.Details.FirstOrDefault()?.OrderNo ?? "", task.TaskNum);
                //Logger.Write_Log("System/test_re", "", "3.8 ");
                _recordService.StockQuantityChangeRecordService.AddStockChangeRecord(stockInfo, stockInfo.Details, beforeQuantity, stockInfo.Details.Sum(x => x.StockQuantity) + beforeQuantity, StockChangeType.Inbound, task.TaskNum);
                //Logger.Write_Log("System/test_re", "", "3.9 ");
                _unitOfWorkManage.CommitTran();
                //Logger.Write_Log("System/test_re", "", "3.10 ");
            }
@@ -486,46 +539,85 @@
            #region å›žä¼ é€»è¾‘处理
            try
            {
                //Logger.Write_Log("System/test_re", "", "3.11 ");
                PutAwayReturnRequest request = new PutAwayReturnRequest();
                List<PutAwayReturn> DATA = new List<PutAwayReturn>();
                request.DATA = DATA;
                request.WERKS = AppSettings.Configuration["WERKS"];
                request.WH_NUMBER = AppSettings.Configuration["SYSNO"];
                request.IZLID = task.OrderNo;//这个值会在接收上游回库组盘信息时,存在库存表中,再存到任务表中
                Dt_MainReturnInventory mainReturnInventory = _mainReturnInventoryRepository.QueryFirst(x => x.IZLID == task.OrderNo);
                //request.WH_NUMBER = AppSettings.Configuration["SYSNO"];
                //request.WERKS = AppSettings.Configuration["WERKS"];
                //request.IZLID = task.OrderNo;//这个值会在接收上游回库组盘信息时,存在库存表中,再存到任务表中
                Dt_MainReturnInventory mainReturnInventory = _mainReturnInventoryRepository.QueryFirst(x => x.TPNUM == task.PalletCode && x.YLZD4 != "1");
                if (mainReturnInventory != null)
                {
                    request.RETURN_NO = mainReturnInventory.RETURN_NO;
                    request.RETURN_ITEM_NO = mainReturnInventory.RETURN_ITEM_NO;
                    //Logger.Write_Log("System/test_re", "", "3.12 ");
                    request.WH_NUMBER = mainReturnInventory.WH_NUMBER;
                    request.BUSINESS_NAME = mainReturnInventory.BUSINESS_NAME;
                    request.BUSINESS_CODE = mainReturnInventory.BUSINESS_CODE;
                    request.TPNUM = mainReturnInventory.TPNUM;
                    request.WERKS = mainReturnInventory.WERKS;
                    request.LGORT = mainReturnInventory.LGORT;
                    request.MO_NO = mainReturnInventory.MO_NO;
                    request.TOTAL_RETURN_QTY = mainReturnInventory.TOTAL_RETURN_QTY;
                    request.BUSINESS_CODE = mainReturnInventory.BUSINESS_CODE;
                    request.RETURN_NO = mainReturnInventory.RETURN_NO;
                    request.RETURN_ITEM_NO = mainReturnInventory.RETURN_ITEM_NO;
                    request.TPNUM = mainReturnInventory.TPNUM;
                    request.YLZD5 = mainReturnInventory.YLZD5;
                    request.IZLID = mainReturnInventory.IZLID;
                    request.MO_NO = mainReturnInventory.MO_NO;
                    request.YLZD3 = mainReturnInventory.YLZD3;
                    request.YLZD4 = mainReturnInventory.YLZD4;
                    request.YLZD1 = mainReturnInventory.YLZD1;
                    request.YLZD2 = mainReturnInventory.YLZD2;
                    request.SYSNOD = mainReturnInventory.SYSNOD;
                    //Logger.Write_Log("System/test_re", "", "3.13 ");
                    Dt_StockInfo stockInfo = _stockService.StockInfoService.Repository.GetStockInfo(task.PalletCode);
                    List<Dt_ReturnInventoryDetail> returnInventoryDetails = new List<Dt_ReturnInventoryDetail>();
                    foreach (Dt_StockInfoDetail detail in stockInfo.Details)
                    {
                        Dt_ReturnInventoryDetail dt_ReturnInventoryDetail = _returnInventoryDetailRepository.QueryFirst(x => x.LABEL_NO == detail.SerialNumber);
                        //Logger.Write_Log("System/test_re", "", "3.14 ");
                        Dt_ReturnInventoryDetail dt_ReturnInventoryDetail = _returnInventoryDetailRepository.QueryFirst(x => x.LABEL_NO == detail.SerialNumber && x.SOBKZ == "Z");
                        if (dt_ReturnInventoryDetail != null)
                        {
                            //Logger.Write_Log("System/test_re", "", "3.15 ");
                            PutAwayReturn putAwayReturn = new PutAwayReturn();
                            putAwayReturn.LABEL_NO = dt_ReturnInventoryDetail.LABEL_NO;
                            putAwayReturn.SOBKZ = dt_ReturnInventoryDetail.SOBKZ;
                            putAwayReturn.UNIT = dt_ReturnInventoryDetail.UNIT;
                            putAwayReturn.SOBKZ = dt_ReturnInventoryDetail.SOBKZ;
                            putAwayReturn.LGORT = dt_ReturnInventoryDetail.LGORT;
                            putAwayReturn.TOTAL_RETURN_QTY = dt_ReturnInventoryDetail.QTY;
                            putAwayReturn.QTY = dt_ReturnInventoryDetail.QTY;
                            putAwayReturn.F_LGORT = dt_ReturnInventoryDetail.F_LGORT;
                            putAwayReturn.MO_NO = mainReturnInventory.MO_NO;
                            putAwayReturn.LIFNR = dt_ReturnInventoryDetail.LIFNR;
                            putAwayReturn.MO_NO = mainReturnInventory.MO_NO;
                            putAwayReturn.MATNR = dt_ReturnInventoryDetail.MATNR;
                            putAwayReturn.BATCH = "";
                            DATA.Add(putAwayReturn);
                            //Logger.Write_Log("System/test_re", "", "3.16 ");
                            returnInventoryDetails.Add(dt_ReturnInventoryDetail);
                        }
                    }
                    if(DATA.Count>0)
                    request.DATA = DATA;
                    if (DATA.Count > 0)
                    {
                        _sys_JobService.CallPutAwayReturn(request);//余料退库回传
                        //Logger.Write_Log("System/test_re", "", "3.17 ");
                        var res = _sys_JobService.CallPutAwayReturn(request);//余料退库回传
                        if (res.Status)
                        {
                            //Logger.Write_Log("System/test_re", "", "3.18 ");
                            mainReturnInventory.YLZD4 = "1";
                            _mainReturnInventoryRepository.UpdateData(mainReturnInventory);
                            foreach (var li in returnInventoryDetails)
                            {
                                li.SOBKZ = "0";
                                _returnInventoryDetailRepository.UpdateData(li);
                            }
                        }
                        else
                        {
                            //Logger.Write_Log("System/test_re", "", "3.19 ");
                        }
                    }
                }
            }
@@ -565,28 +657,35 @@
        public WebResponseContent OutboundTaskCompleted(Dt_Task task)
        {
            //Logger.Write_Log("System/test_out", "", "3.0 ");
            Dt_StockInfo stockInfo = _stockService.StockInfoService.Repository.GetStockInfo(task.PalletCode);
            Dt_StockInfo stockInfoCatch = stockInfo;//先缓存起来,供后面的回传接口调用
            //Logger.Write_Log("System/test_out", "", "3.1 ");
            try
            {
                _unitOfWorkManage.BeginTran();
                decimal beforeQuantity = 0;
                //Dt_StockInfo stockInfo = _stockService.StockInfoService.Repository.GetStockInfo(task.PalletCode);
                //Dt_StockInfo stockInfoCatch = stockInfo;//先缓存起来,供后面的回传接口调用
                Dt_LocationInfo locationInfo = _basicService.LocationInfoService.Repository.QueryFirst(x => x.LocationCode == task.SourceAddress);
                //Logger.Write_Log("System/test_out", "", "3.2 ");
                CheckCompleted(stockInfo, locationInfo);
                //Logger.Write_Log("System/test_out", "", "3.3 ");
                stockInfo.LocationCode = locationInfo.LocationCode;
                stockInfo.StockStatus = StockStatusEmun.出库完成.ObjToInt();
                _stockService.StockInfoService.Repository.UpdateData(stockInfo);
                //Logger.Write_Log("System/test_out", "", "3.4 ");
                int beforeStatus = locationInfo.LocationStatus;
                if (locationInfo.Depth == 2)
                {
                    //Logger.Write_Log("System/test_out", "", "3.5 ");
                    if (DepthTask(locationInfo) == false)
                    {
                        //Logger.Write_Log("System/test_out", "", "3.6 ");
                        _basicService.LocationInfoService.UpdateLocationFree(locationInfo, task.TaskNum, StockChangeType.Outbound.ObjToInt(), false);
                    }
@@ -594,18 +693,24 @@
                locationInfo.LocationStatus = LocationStatusEnum.Free.ObjToInt();
                _basicService.LocationInfoService.Repository.UpdateData(locationInfo);
                //Logger.Write_Log("System/test_out", "", "3.7 ");
                task.TaskStatus = OutTaskStatusEnum.OutFinish.ObjToInt();
                BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId == 0 ? OperateType.自动完成 : OperateType.人工完成);
                //Logger.Write_Log("System/test_out", "", "3.8 ");
                _stockService.StockInfoService.Repository.DeleteAndMoveIntoHty(stockInfo, App.User.UserId == 0 ? OperateType.自动完成 : OperateType.人工完成);
                _stockService.StockInfoDetailService.Repository.DeleteAndMoveIntoHty(stockInfo.Details, App.User.UserId == 0 ? OperateType.自动完成 : OperateType.人工完成);
                //Logger.Write_Log("System/test_out", "", "3.9 ");
                beforeQuantity = stockInfo.Details.Where(x => x.Id != 0).Sum(x => x.StockQuantity);
                _recordService.LocationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(locationInfo, beforeStatus, StockChangeType.Outbound.ObjToInt(), stockInfo.Details.FirstOrDefault()?.OrderNo ?? "", task.TaskNum);
                //Logger.Write_Log("System/test_out", "", "3.10 ");
                _recordService.StockQuantityChangeRecordService.AddStockChangeRecord(stockInfo, stockInfo.Details, beforeQuantity, stockInfo.Details.Sum(x => x.StockQuantity) - beforeQuantity, StockChangeType.Outbound, task.TaskNum);
                //Logger.Write_Log("System/test_out", "", "3.11 ");
                _unitOfWorkManage.CommitTran();
                //Logger.Write_Log("System/test_out", "", "3.12 ");
            }
            catch (Exception ex)
            {
@@ -618,35 +723,43 @@
            #region å›žä¼ é€»è¾‘处理
            try
            {
                //Logger.Write_Log("System/test_out", "", "3.13 ");
                PickAndPostRequest request = new PickAndPostRequest();
                List<PickAndPost> itemData = new List<PickAndPost>();
                request.ITEMDATA = itemData;
                request.WH_NUMBER = AppSettings.Configuration["SYSNO"];
                request.SYSNOD = AppSettings.Configuration["SYSNO"];
                request.WERKS = AppSettings.Configuration["CallMaterialID"];
                request.WERKS = AppSettings.Configuration["WERKS"];
                Dt_OutboundOrderDetail_Hty detail = _outboundOrderDetail_HtyRepository.QueryFirst(x => x.SourceId.ToString() == task.Remark);// task.Remark存需求明细ID
                if (detail != null)
                {
                    //Logger.Write_Log("System/test_out", "", "3.14 ");
                    Dt_OutboundOrder_Hty outboundOrder = _outboundOrder_HtyRepository.QueryFirst(x => x.SourceId == detail.OrderId);
                    if (outboundOrder != null)
                    {
                        //Logger.Write_Log("System/test_out", "", "3.15 ");
                        Dt_OutBoundOrderBYD outboundOrderBYD = _outBoundOrderBYDRepository.QueryFirst(x => x.REQUIREMENT_NO == outboundOrder.OrderNo);
                        if (outboundOrderBYD != null)
                        {
                            //Logger.Write_Log("System/test_out", "", "3.16 ");
                            Dt_OutboundOrderDetailBYD outboundOrderDetailBYD = _outboundOrderDetailByDRepository.QueryFirst(x => x.REQUIREMENT_NO == outboundOrderBYD.REQUIREMENT_NO && x.REQUIREMENT_ITEM_NO == detail.Remark);//detail.Remark å­˜éœ€æ±‚行
                            //根据托盘号查立库的条码和批次进行回传
                            foreach (var item in stockInfoCatch.Details)
                            {
                                //Logger.Write_Log("System/test_out", "", "3.17 ");
                                Dt_LabelMaster labMaster = _labelMasterRepository.QueryFirst(x => x.LABEL_NO == item.SerialNumber);
                                PickAndPost pickpost = new PickAndPost();
                                pickpost.REQUIREMENT_NO = outboundOrderDetailBYD.REQUIREMENT_NO;
                                pickpost.REQUIREMENT_ITEM_NO = outboundOrderDetailBYD.REQUIREMENT_ITEM_NO;
                                pickpost.WERKS = outboundOrderBYD.WRKS;
                                pickpost.ORDERCODE = request.WERKS + request.WH_NUMBER + DateTime.Now.ToString("yyyyMMdd") + outboundOrderDetailBYD.Id.ToString("D6");
                                pickpost.ORDERCODE_ITEM_NO = "1";
                                pickpost.SYSNOD = outboundOrderBYD.SYSNOD;
                                pickpost.MATNR = outboundOrderDetailBYD.MATNR;
                                pickpost.LIFNR = "";//没有返回,暂时转空
                                pickpost.QTY = outboundOrderDetailBYD.QTY;
                                pickpost.QTY = labMaster.BOX_QTY ?? outboundOrderDetailBYD.QTY;
                                pickpost.BATCH = item.BatchNo;//取立库入库库存的条码
                                pickpost.LGORT = outboundOrderBYD.LGORT;
                                pickpost.BUSINESS_CODE = outboundOrderBYD.BUSINESS_CODE;
@@ -654,24 +767,29 @@
                                pickpost.STATION = outboundOrderBYD.STATION;
                                pickpost.SPLIT = outboundOrderBYD.SPLIT;
                                pickpost.LABEL_NO = item.SerialNumber;//取立库入库库存的条码
                                pickpost.Pack_LABEL_NO = null;
                                pickpost.pallet_label_no = null;
                                pickpost.CREATE_DATE = outboundOrderBYD.CREATE_DATE;
                                pickpost.UPDATE_DATE = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                                pickpost.STATUS = outboundOrderBYD.STATUS;
                                pickpost.MO_NO = null;
                                itemData.Add(pickpost);
                                //Logger.Write_Log("System/test_out", "", "3.18 ");
                            }
                            _sys_JobService.CallPickAndPost(request);//回传
                            //Logger.Write_Log("System/test_out", "", "3.19 ");
                        }
                    }
                }
            }
            catch(Exception ex)
            catch (Exception ex)
            {
                return WebResponseContent.Instance.Error(ex.Message);
            }
            #endregion
            return WebResponseContent.Instance.OK();
        }
@@ -680,6 +798,7 @@
        {
            try
            {
                //Logger.Write_Log("System/test_out", "empt ", "3.0 ");
                _unitOfWorkManage.BeginTran();
                Dt_StockInfo stockInfo = _stockService.StockInfoService.Repository.GetStockInfo(task.PalletCode);
@@ -706,6 +825,7 @@
                _recordService.LocationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(locationInfo, beforeStatus, StockChangeType.Outbound.ObjToInt(), stockInfo.Details.FirstOrDefault()?.OrderNo ?? "", task.TaskNum);
                _unitOfWorkManage.CommitTran();
                //Logger.Write_Log("System/test_out", "empt ", "3.1 ");
                return WebResponseContent.Instance.OK();
            }
            catch (Exception ex)
@@ -835,7 +955,7 @@
            }
        }
        public WebResponseContent OutboundTaskCancel(Dt_Task task)
        {
            try
@@ -914,7 +1034,7 @@
                task.TaskStatus = OutTaskStatusEnum.OutCancel.ObjToInt();
                BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId == 0 ? OperateType.自动完成 : OperateType.人工完成);
                _recordService.LocationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(locationInfo, beforeStatus, StockChangeType.Outbound.ObjToInt(), stockInfo.Details.FirstOrDefault()?.OrderNo ?? "", task.TaskNum);
                _unitOfWorkManage.CommitTran();
@@ -940,7 +1060,7 @@
                stockInfo.StockStatus = StockStatusEmun.已入库.ObjToInt();
                _stockService.StockInfoService.Repository.UpdateData(stockInfo);
                locationEnd.LocationStatus= LocationStatusEnum.Free.ObjToInt();
                locationEnd.LocationStatus = LocationStatusEnum.Free.ObjToInt();
                _basicService.LocationInfoService.RelocationFree(locationStart, task.TaskNum);
                _basicService.LocationInfoService.Repository.UpdateData(locationEnd);
@@ -958,7 +1078,7 @@
        }
        public bool DepthTask(Dt_LocationInfo location)
        {
            if (location != null )
            if (location != null)
            {
                Dt_LocationInfo locations = _locationInfoService.Repository.QueryFirst(x => x.RoadwayNo == location.RoadwayNo && x.Column == location.Column && x.Layer == location.Layer && x.Depth != location.Depth && x.Row != location.Row && (SqlFunc.Abs(x.Row - location.Row) == 1));
                if (locations != null)
@@ -979,7 +1099,7 @@
                {
                    expression = x => x.Creater == App.User.UserName;
                }
                var task = BaseDal.Db.Queryable<Dt_Task>().OrderByDescending(x => x.CreateDate).Take(10).Select(x => new Dt_Task { TaskNum = x.TaskNum, PalletCode=x.PalletCode, TaskType=x.TaskType,SourceAddress=x.SourceAddress,TargetAddress=x.TargetAddress }).ToList();
                var task = BaseDal.Db.Queryable<Dt_Task>().OrderByDescending(x => x.CreateDate).Take(10).Select(x => new Dt_Task { TaskNum = x.TaskNum, PalletCode = x.PalletCode, TaskType = x.TaskType, SourceAddress = x.SourceAddress, TargetAddress = x.TargetAddress }).ToList();
                content = WebResponseContent.Instance.OK(data: task);
            }
            catch (Exception ex)
ÏîÄ¿´úÂë/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/PDAController.cs
@@ -12,6 +12,7 @@
using WIDESEA_Model.Models;
using System;
using Newtonsoft.Json;
using WIDESEA_Core.LogHelper;
namespace WIDESEA_WMSServer.Controllers
{
@@ -52,7 +53,7 @@
        [HttpPost, HttpGet, Route("UploadApp"), AllowAnonymous]
        public async Task<WebResponseContent> UploadApk(IEnumerable<IFormFile> fileInput)
         {
        {
            // æ£€æŸ¥æ˜¯å¦æœ‰æ–‡ä»¶ä¸Šä¼ 
            if (fileInput == null || !fileInput.Any())
            {
@@ -61,7 +62,7 @@
            var formFile = fileInput.First();
            var uploadFolder = Path.Combine(Directory.GetCurrentDirectory(), "wwwroot", "Upload");
            Directory.CreateDirectory(uploadFolder);
            Directory.CreateDirectory(uploadFolder);
            var fileName = $"WMS-PDA.apk";
            var filePath = Path.Combine(uploadFolder, fileName);
@@ -102,7 +103,7 @@
            }
            memory.Position = 0;
            var ext = Path.GetExtension(filePath).ToLowerInvariant();
            return File(memory, new Dictionary<string, string>{{ ".apk", "application/vnd.android.package-archive" }}[ext], Path.GetFileName(filePath));
            return File(memory, new Dictionary<string, string> { { ".apk", "application/vnd.android.package-archive" } }[ext], Path.GetFileName(filePath));
        }
        /// <summary>
@@ -113,7 +114,7 @@
        [HttpPost, Route("EmptyInBound"), AllowAnonymous]
        public WebResponseContent EmptyInBound(string PalletCode)
        {
            return _taskService.PalletInboundRequest("R01-001-023-001",PalletCode);
            return _taskService.PalletInboundRequest("R01-001-023-001", PalletCode);
        }
@@ -126,7 +127,7 @@
        [HttpGet, Route("EmptyOutBound"), AllowAnonymous]
        public WebResponseContent EmptyOutBound(string trayType)
        {
            return _taskService.PalletOutboundTask("R01", "R01-001-023-001",trayType);
            return _taskService.PalletOutboundTask("R01", "R01-001-023-001", trayType);
        }
@@ -138,34 +139,50 @@
        [HttpPost, Route("MaterielGroup"), AllowAnonymous]
        public WebResponseContent MaterielGroup([FromBody] SaveModel saveModel)
        {
            string PalletCode = saveModel.MainData["PalletCode"].ToString();
            string ReceviveSN = saveModel.MainData["SerialNumbers"].ToString();
            List<string> OldSerialNumbers = JsonConvert.DeserializeObject<List<string>>(ReceviveSN);
            string PalletCode = saveModel.MainData["PalletCode"].ToString();
            var ReceviveSN = saveModel.MainData["SerialNumbers"];
            string str = "1.0 ReceviveSN=" + ReceviveSN;
            //Logger.Write_Log("System/test", "", str);
            List<string> OldSerialNumbers = JsonConvert.DeserializeObject<List<string>>(ReceviveSN.ToString());
            List<string> SerialNumbers = new List<string>();
            string code = "";
            foreach (var number in OldSerialNumbers)
            {
                //Logger.Write_Log("System/test", "", "1.0.1 ");
                if (number.Contains("S:"))
                {
                    //Logger.Write_Log("System/test", "", "1.0.1.1 ");
                    List<string> nums = number.Split(';').ToList();
                    foreach (var item in nums)
                    {
                        if(item.Contains("S:"))
                        if (item.Contains("S:"))
                        {
                            //Logger.Write_Log("System/test", "", "1.0.1.2 ");
                            string SerialNumber = item.Replace("S:", "");
                            if (!string.IsNullOrEmpty(SerialNumber))
                            {
                                SerialNumbers.Add(SerialNumber);
                                code += SerialNumber;
                            }
                        }
                    }
                }
                else
                {
                    //Logger.Write_Log("System/test", "", "1.0.2 ");
                    SerialNumbers.Add(number);
                    code += number;
                }
            }
            //Logger.Write_Log("System/test", "", "1.1 " + code);
            MaterielGroupDTO materielGroupDTO = new MaterielGroupDTO();
            materielGroupDTO.SerialNumbers = SerialNumbers;
@@ -202,7 +219,7 @@
        /// <param name="PalletCode">托盘号</param>
        /// <returns></returns>
        [HttpGet, Route("MaterielInBoundReturnConfirm"), AllowAnonymous]
        public WebResponseContent MaterielInBoundReturnConfirm( string PalletCode)
        public WebResponseContent MaterielInBoundReturnConfirm(string PalletCode)
        {
            return _taskService.ReturnInboundRequest("R01-001-023-001", PalletCode);
        }
ÏîÄ¿´úÂë/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/appsettings.json
@@ -12,7 +12,8 @@
  "MainDB": "DB_WIDESEA", //当前项目的主库,所对应的连接字符串的Enabled必须为true
  //连接字符串
  //"ConnectionString": "HTI6FB1H05Krd07mNm9yBCNhofW6edA5zLs9TY~MNthRYW3kn0qKbMIsGp~3yyPDF1YZUCPBQx8U0Jfk4PH~ajNFXVIwlH85M3F~v_qKYQ3CeAz3q1mLVDn8O5uWt1~3Ut2V3KRkEwYHvW2oMDN~QIDXPxDgXN0R2oTIhc9dNu7QNaLEknblqmHhjaNSSpERdDVZIgHnMKejU_SL49tralBkZmDNi0hmkbL~837j1NWe37u9fJKmv91QPb~16JsuI9uu0EvNZ06g6PuZfOSAeFH9GMMIZiketdcJG3tHelo=",
  "ConnectionString": "Data Source=.;Initial Catalog=WIDESEAWMS_GXBYD;User ID=sa;Password=123456;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False",
  "ConnectionString": "Data Source=193.169.10.200;Initial Catalog=WIDESEAWMS_GXBYD;User ID=sa;Password=1qaz@WSX;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False",
  //"ConnectionString": "Data Source=.;Initial Catalog=WIDESEAWMS_GXBYD;User ID=sa;Password=123;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False",
  //跨域
  "Cors": {
    "PolicyName": "CorsIpAccess", //策略名称
@@ -25,7 +26,7 @@
  "WCS": "http://localhost:9291/api/Task/",
  "WERKS": "GX25", //工厂
  "SYSNO": "G30", //立库系统标识,发料标识
  "CallMaterialID": "W01",//叫料标识
  "CallMaterialID": "W01", //叫料标识
  "ApiName": "WIDESEA",
  "ExpMinutes": 120,
  "QuartzJobAutoStart": true,