wxw
2024-09-26 510a6a402b7cb9d5cf5214934a49a291485958ca
修改问题
6个文件已修改
109 ■■■■■ 已修改文件
Wms/Model/InterFaceModel/HttpModel.cs 44 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/WMS.BLL/BllAsnServer/ArrivalNoticeServer.cs 48 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/WMS.IBLL/IBllAsnServer/IArrivalNoticeServer.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/Wms/Controllers/BllAsnController.cs 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/Wms/Tools/ApiUrlConfig.cs 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/Wms/appsettings.json 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Wms/Model/InterFaceModel/HttpModel.cs
@@ -315,6 +315,50 @@
        public int? QtyCount { get; set; }
    }
    //入库任务单据信息
    public class ResponseOrderTaskModel
    {
        /// <summary>
        /// WMS下发单号
        /// </summary>
        public string? OrderNo { get; set; }
        /// <summary>
        /// 任务号
        /// </summary>
        public string? TaskNo { get; set; }
        /// <summary>
        /// 批次号
        /// </summary>
        public string? LotNo { get; set; }
        /// <summary>
        /// 物料编码
        /// </summary>
        public string? SkuNo { get; set; }
        /// <summary>
        /// 物料名称
        /// </summary>
        public string? SkuName { get; set; }
        /// <summary>
        /// 规格
        /// </summary>
        public string? BoxType { get; set; }
        /// <summary>
        /// 总箱数/计划箱数/预估箱数
        /// </summary>
        public int? Qty { get; set; }
        /// <summary>
        /// 任务类型
        /// </summary>
        public int? TaskType { get; set; }
    }
    #endregion
    #region AGV-Model
Wms/WMS.BLL/BllAsnServer/ArrivalNoticeServer.cs
@@ -18,6 +18,8 @@
using WMS.Entity.SysEntity;
using WMS.IBLL.IBllAsnServer;
using WMS.BLL.SysServer;
using System.Threading.Tasks;
using System.Security.Policy;
namespace WMS.BLL.BllAsnServer
{
@@ -254,7 +256,7 @@
        }
        //添加入库单据
        public string AddArrivalNotice(ArrivalNoticeVm model)
        public string AddArrivalNotice(ArrivalNoticeVm model, string url)
        {
            string strMessage = "";
            string sqlString = string.Empty;
@@ -262,6 +264,7 @@
            //0:成品入库 1:采购入库 2:中间品入库 3:退货入库 4:车间余料入库 5:其它入库 6:代储入库 7:寄存入库
            var TypeLot = "1, 2, 5, 6, 7"; //批次可为空单据类型
            var addOder = new List<ResponseOrderTaskModel>();
            try
            {
                if (model.Origin == "录入")
@@ -341,6 +344,20 @@
                    sqlDetailStr += $"'{model.ASNNo}','{detailModel.SkuNo}','{detailModel.SkuName}','{detailModel.Standard}', ";
                    sqlDetailStr += $"'{detailModel.LotNo}','{detailModel.LotText}','{detailModel.Qty}','{detailModel.PackagNo}','{detailModel.Price}', ";
                    sqlDetailStr += $"{detailModel.Money},'{detailModel.IsBale}','{detailModel.IsBelt}','{detailModel.SupplierLot}','0','{detailModel.UDF1}','{detailModel.UDF2}','{detailModel.UDF3}','{detailModel.UDF4}','{detailModel.UDF5}','{model.CreateUser}');";
                    if (model.Type == "1")
                    {
                        addOder.Add(new ResponseOrderTaskModel()
                        {
                            OrderNo = model.ASNNo,
                            LotNo = detailModel.LotNo,
                            SkuNo = detailModel.SkuNo,
                            SkuName = detailModel.SkuName,
                            BoxType = detailModel.Standard,
                            Qty = (int)detailModel.Qty,
                            TaskType = 0
                        });
                    }
                }
                if (sqlDetailStr == string.Empty)
@@ -359,6 +376,35 @@
                if (rowCount > 0 && rowDetailCount > 0)
                {
                    new OperationASNServer().AddLogOperationAsn("入库作业", "入库单据", model.ASNNo, "添加", $"添加了单据号为{model.ASNNo}的单据信息", Convert.ToInt32(model.CreateUser));
                    if (addOder.Count > 0)
                    {
                        // 正式运行程序放开
                        var jsonData = JsonConvert.SerializeObject(addOder);
                        string response = "";
                        try
                        {
                            var time1 = DateTime.Now;//发送时间 .ToString("yyyy-MM-dd HH:mm:ss")
                            //给WCS下发入库单信息
                            response = HttpHelper.DoPost(url, jsonData, "下发给WCS出库命令", "WCS");
                            //////解析返回数据
                            var wcsModel = JsonConvert.DeserializeObject<WcsModel>(response);
                            if (wcsModel.StatusCode == 0)
                            {
                            }
                            if (wcsModel.StatusCode == -1)
                            {
                            }
                        }
                        catch (Exception ex)
                        {
                            throw new Exception(ex.Message);
                        }
                    }
                    return strMessage;
                }
                else
Wms/WMS.IBLL/IBllAsnServer/IArrivalNoticeServer.cs
@@ -45,7 +45,7 @@
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        string AddArrivalNotice(ArrivalNoticeVm model);
        string AddArrivalNotice(ArrivalNoticeVm model, string url);
        /// <summary>
        /// 编辑入库单
        /// </summary>
Wms/Wms/Controllers/BllAsnController.cs
@@ -9,6 +9,8 @@
using WMS.IBLL.IBllAsnServer;
using WMS.IBLL.ILogServer;
using Model.ModelVm.BllAsnVm;
using Wms.Tools;
using Microsoft.Extensions.Options;
namespace Wms.Controllers
{
@@ -18,6 +20,7 @@
    public class BllAsnController : ControllerBase
    {
        #region 依赖注入
        private readonly ApiUrlConfig _config; //接口交互路径
        private readonly IArrivalNoticeServer _arrivalNoticeSvc;                    // 入库单据Svc 
        private readonly IPalletBindServer _PalletBindSvc;                          // 托盘绑定Svc 
        private readonly IBllBoxInfoServer _BoxInfoSvc;
@@ -29,8 +32,9 @@
        #endregion
        #region 构造函数
        public BllAsnController(IArrivalNoticeServer arrivalNoticeSvc, IPalletBindServer palletBindSvc,IBllBoxInfoServer bllBoxInfoSvc, ITaskServer taskSvc,IOperationASNServer logSvc, IPalletUnbindServer palletUnbind,IAuditLogServer auditLog,IBllLabelBoxNoServer labelBox)
        public BllAsnController(IOptions<ApiUrlConfig> setting, IArrivalNoticeServer arrivalNoticeSvc, IPalletBindServer palletBindSvc,IBllBoxInfoServer bllBoxInfoSvc, ITaskServer taskSvc,IOperationASNServer logSvc, IPalletUnbindServer palletUnbind,IAuditLogServer auditLog,IBllLabelBoxNoServer labelBox)
        {
            _config = setting.Value;
            _arrivalNoticeSvc = arrivalNoticeSvc;
            _PalletBindSvc = palletBindSvc;
            _BoxInfoSvc = bllBoxInfoSvc;
@@ -134,7 +138,7 @@
                }
                model.CreateUser = int.Parse(UserId);
                string strMesage = _arrivalNoticeSvc.AddArrivalNotice(model);
                string strMesage = _arrivalNoticeSvc.AddArrivalNotice(model, _config.WcsHost + _config.AddOrderTaskUrl);
                if (strMesage == "")
                {
Wms/Wms/Tools/ApiUrlConfig.cs
@@ -103,5 +103,11 @@
        #endregion
        #region WCS
        /// <summary>
        /// //给WCS下发入库单信息
        /// </summary>
        public string AddOrderTaskUrl { get; set; }
        #endregion
    }
}
Wms/Wms/appsettings.json
@@ -31,6 +31,7 @@
    // WCS
    "IssueComApiUrl": "/api/demo/wcsTasks", //下发命令(出库、移库)
    "IssueComApiUrl2": "/api/demo/wcsTask", //"/api/WCSApi/AddTask", //重新下发命令(出库、移库)
    "AddOrderTaskUrl": "/api/demo/addOrderTask", //WMS给WCS下发的入库单任务
    // ERP
    "AsnFinishUrl": "/api/wmsInterface/OutStockTask", //入库订单关闭