| | |
| | | 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 |
| | |
| | | using WMS.Entity.SysEntity; |
| | | using WMS.IBLL.IBllAsnServer; |
| | | using WMS.BLL.SysServer; |
| | | using System.Threading.Tasks; |
| | | using System.Security.Policy; |
| | | |
| | | namespace WMS.BLL.BllAsnServer |
| | | { |
| | |
| | | } |
| | | |
| | | //添加入库单据 |
| | | public string AddArrivalNotice(ArrivalNoticeVm model) |
| | | public string AddArrivalNotice(ArrivalNoticeVm model, string url) |
| | | { |
| | | string strMessage = ""; |
| | | string sqlString = string.Empty; |
| | |
| | | //0:成品入库 1:采购入库 2:中间品入库 3:退货入库 4:车间余料入库 5:其它入库 6:代储入库 7:寄存入库 |
| | | var TypeLot = "1, 2, 5, 6, 7"; //批次可为空单据类型 |
| | | |
| | | var addOder = new List<ResponseOrderTaskModel>(); |
| | | try |
| | | { |
| | | if (model.Origin == "录入") |
| | |
| | | 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) |
| | |
| | | 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 |
| | |
| | | /// </summary> |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | string AddArrivalNotice(ArrivalNoticeVm model); |
| | | string AddArrivalNotice(ArrivalNoticeVm model, string url); |
| | | /// <summary> |
| | | /// 编辑入库单 |
| | | /// </summary> |
| | |
| | | using WMS.IBLL.IBllAsnServer; |
| | | using WMS.IBLL.ILogServer; |
| | | using Model.ModelVm.BllAsnVm; |
| | | using Wms.Tools; |
| | | using Microsoft.Extensions.Options; |
| | | |
| | | namespace Wms.Controllers |
| | | { |
| | |
| | | public class BllAsnController : ControllerBase |
| | | { |
| | | #region 依赖注入 |
| | | private readonly ApiUrlConfig _config; //接口交互路径 |
| | | private readonly IArrivalNoticeServer _arrivalNoticeSvc; // 入库单据Svc |
| | | private readonly IPalletBindServer _PalletBindSvc; // 托盘绑定Svc |
| | | private readonly IBllBoxInfoServer _BoxInfoSvc; |
| | |
| | | #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; |
| | |
| | | } |
| | | |
| | | model.CreateUser = int.Parse(UserId); |
| | | string strMesage = _arrivalNoticeSvc.AddArrivalNotice(model); |
| | | string strMesage = _arrivalNoticeSvc.AddArrivalNotice(model, _config.WcsHost + _config.AddOrderTaskUrl); |
| | | |
| | | if (strMesage == "") |
| | | { |
| | |
| | | |
| | | #endregion |
| | | |
| | | #region WCS |
| | | /// <summary> |
| | | /// //给WCS下发入库单信息 |
| | | /// </summary> |
| | | public string AddOrderTaskUrl { get; set; } |
| | | #endregion |
| | | } |
| | | } |
| | |
| | | // WCS |
| | | "IssueComApiUrl": "/api/demo/wcsTasks", //下发命令(出库、移库) |
| | | "IssueComApiUrl2": "/api/demo/wcsTask", //"/api/WCSApi/AddTask", //重新下发命令(出库、移库) |
| | | "AddOrderTaskUrl": "/api/demo/addOrderTask", //WMS给WCS下发的入库单任务 |
| | | |
| | | // ERP |
| | | "AsnFinishUrl": "/api/wmsInterface/OutStockTask", //入库订单关闭 |