duyongjia
2024-12-29 9a0acba23c5b5095be2a89b8ca190fe5202c2ea6
ÏîÄ¿´úÂë/WMS/WIDESEA_WMSServer/WIDESEA_SystemService/Sys_JobService.cs
@@ -1,4 +1,5 @@
using LikuServiceReference;
using LogLibrary.Log;
using Newtonsoft.Json;
using OfficeOpenXml.FormulaParsing.Excel.Functions.DateTime;
using OfficeOpenXml.FormulaParsing.Excel.Functions.Information;
@@ -21,8 +22,11 @@
using WIDESEA_Core.Enums;
using WIDESEA_Core.Helper;
using WIDESEA_Core.Log;
using WIDESEA_DTO.Inbound;
using WIDESEA_DTO.System;
using WIDESEA_IBasicRepository;
using WIDESEA_IInboundService;
using WIDESEA_InboundService;
using WIDESEA_IOutboundRepository;
using WIDESEA_IOutboundService;
using WIDESEA_ISystemRepository;
@@ -45,7 +49,8 @@
        private readonly IOutboundOrderDetail_LabelsBYDRepository _outboundOrderDetailLabelsByDRepository;
        private readonly IOutboundOrderDetailRepository _outboundOrderDetailRepository;
        private readonly IOutboundOrderRepository _outboundOrderRepository;
        private readonly IInboundService _inboundService;
        public Sys_JobService(ISys_JobRepository BaseDal, IUnitOfWorkManage unitOfWorkManage, ICacheService cacheService,ILabelMasterRepository labelMasterRepository, IOutBoundOrderBYDRepository outBoundOrderBYDRepository, IOutboundOrderDetailBYDRepository outboundOrderDetailByDRepository, IOutboundOrderDetail_LabelsBYDRepository outboundOrderDetailLabelsByDRepository, IOutboundOrderDetailRepository outboundOrderDetailRepository, IOutboundOrderRepository outboundOrderRepository) : base(BaseDal)
        {
            _unitOfWorkManage = unitOfWorkManage;
@@ -56,6 +61,8 @@
            _outboundOrderDetailLabelsByDRepository = outboundOrderDetailLabelsByDRepository;
            _outboundOrderRepository = outboundOrderRepository;
            _outboundOrderDetailRepository = outboundOrderDetailRepository;
        }
        /// <summary>
@@ -148,8 +155,10 @@
                            }
                            content = WebResponseContent.Instance.OK("获取条码主数据成功", item);
                        }
                    }
                    else
                    {
                        content = WebResponseContent.Instance.Error("根据条码同步条码主数据失败");
                    }
                }
@@ -162,7 +171,7 @@
        }
        /// <summary>
        /// åŽŸææ–™ä¸Šæž¶æŽ¥å£ï¼Œå…¥åº“å›žä¼ 
        /// åŽŸææ–™ä¸Šæž¶æŽ¥å£ï¼Œå…¥åº“å›žä¼   LABEL _STATUS æ¡ç çŠ¶æ€  02已收料(无需质检)03 å¾…进仓(已质检),并且,QC RESULT CODE质检状态为“02”
        /// </summary>
        /// <returns></returns>
        public WebResponseContent CallPutAway(PutAwayRequest putAway)
@@ -173,20 +182,31 @@
                LikuServiceReference.WmsStereoWhServiceClient likuClient = new LikuServiceReference.WmsStereoWhServiceClient();
                
                string inparam = JsonConvert.SerializeObject(putAway);
                new LogFactory().GetLog("BYD_WMS接口").InfoFormat(true, "CallPutAway", "请求", $"{inparam}");
                string response = likuClient.putaway(inparam);
                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.MSGTX == "S")
                    {
                        content = WebResponseContent.Instance.OK("上架回传成功!");
                        new LogFactory().GetLog("BYD_WMS接口").InfoFormat(true, "CallPutAway", "响应", $"上架回传成功!");
                    }
                    else
                    {
                        content = WebResponseContent.Instance.Error("上架回传失败!");
                        new LogFactory().GetLog("BYD_WMS接口").InfoFormat(true, "CallPutAway", "响应", $"上架回传失败!");
                    }
                }
            }
            catch (Exception ex)
            {
                content = WebResponseContent.Instance.Error(ex.Message);
                new LogFactory().GetLog("BYD_WMS接口").InfoFormat(true, "CallPutAway", "异常", $"{ex.Message}");
            }
            return content;
@@ -206,13 +226,20 @@
                LikuServiceReference.WmsStereoWhServiceClient likuClient = new LikuServiceReference.WmsStereoWhServiceClient();
                string inparam = JsonConvert.SerializeObject(putAwayReturn);
                new LogFactory().GetLog("BYD_WMS接口").InfoFormat(true, "CallPutAwayReturn", "请求", $"{inparam}");
                string response = likuClient.putAwayReturn(inparam);
                if (response != null)
                {
                    PutAwayReturnResponse res = JsonConvert.DeserializeObject<PutAwayReturnResponse>(response);
                    if (res != null && res.MSGTX == "S")
                    {
                        content = WebResponseContent.Instance.OK("余料回库回传成功!");
                        content = WebResponseContent.Instance.OK("上架回传成功!");
                        new LogFactory().GetLog("BYD_WMS接口").InfoFormat(true, "CallPutAwayReturn", "响应", $"上架回传成功!");
                    }
                    else
                    {
                        content = WebResponseContent.Instance.Error("上架回传失败!");
                        new LogFactory().GetLog("BYD_WMS接口").InfoFormat(true, "CallPutAwayReturn", "响应", $"上架回传失败!");
                    }
                }
@@ -220,6 +247,7 @@
            catch (Exception ex)
            {
                content = WebResponseContent.Instance.Error(ex.Message);
                new LogFactory().GetLog("BYD_WMS接口").InfoFormat(true, "CallPutAwayReturn", "异常", $"{ex.Message}");
            }
            return content;
@@ -462,91 +490,34 @@
                StereoServiceReference.WhStereoWebServiceClient client = new StereoServiceReference.WhStereoWebServiceClient();
                string inparam = JsonConvert.SerializeObject(pickAndPost);
                new LogFactory().GetLog("BYD_WMS接口").InfoFormat(true, "CallPickAndPost", "请求", $"{inparam}");
                string response = client.pickAndPost(inparam);
                new LogFactory().GetLog("BYD_WMS接口").InfoFormat(true, "CallPickAndPost", "响应", $"{response}");
                if (response != null)
                {
                    PickAndPostResponse res = JsonConvert.DeserializeObject<PickAndPostResponse>(response);
                    if (res != null && res.MSGTX == "S")
                    {
                        content = WebResponseContent.Instance.OK("出库回传成功!");
                        new LogFactory().GetLog("BYD_WMS接口").InfoFormat(true, "CallPickAndPost", "响应", $"出库回传成功!");
                    }
                }
                else
                {
                    content = WebResponseContent.Instance.Error("出库回传失败!");
                    new LogFactory().GetLog("BYD_WMS接口").InfoFormat(true, "CallPickAndPost", "响应", $"出库回传失败!");
                }
            }
            catch (Exception ex)
            {
                content = WebResponseContent.Instance.Error(ex.Message);
                new LogFactory().GetLog("BYD_WMS接口").InfoFormat(true, "CallPickAndPost", "异常", $"{ex.Message}");
            }
            return content;
        }
        /// <summary>
        /// ç«‹åº“退回信息接口,供上游系统调用,立库生成退货任务
        /// </summary>
        /// <returns></returns>
        public ReturnInventoryResponse returnInventory(ReturnInventoryRequest inventoryRequest)
        {
            ReturnInventoryResponse returnInventoryResponse = new ReturnInventoryResponse();
            try
            {
                //todo:WMS生成退货任务
            }
            catch (Exception)
            {
            }
            return returnInventoryResponse;
        }
        /// <summary>
        /// ç«‹åº“WMS库存信息接口,供上游系统调用
        /// </summary>
        /// <param name="inventoryQueryRequest"></param>
        /// <returns></returns>
        public InventoryQueryResponse  InventoryQuery(InventoryQueryRequest inventoryQueryRequest)
        {
            InventoryQueryResponse inventoryQueryResponse = new InventoryQueryResponse();
            try
            {
                //todo:WMS查询实时库存
            }
            catch (Exception)
            {
            }
            return inventoryQueryResponse;
        }
        /// <summary>
        /// ç«‹åº“WMS冻结/解冻信息接口,供上游系统调用
        /// </summary>
        /// <param name="freezeByCustomerResponse"></param>
        /// <returns></returns>
        public freezeByCustomerResponse freezeByCustomer(freezeByCustomerRequest freezeRequest)
        {
            freezeByCustomerResponse freezeResponse = new freezeByCustomerResponse();
            try
            {
                //todo:WMS查询冻结解冻信息
            }
            catch (Exception)
            {
            }
            return freezeResponse;
        }