入库单新建
This commit is contained in:
1 parent
e2dead6c3f
commit
663769f80e
50 files changed
+2164
-94
No files matched your search
@@ -0,0 +1,231 @@
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using System;
|
||||
using WalkingTec.Mvvm.Core;
|
||||
using WalkingTec.Mvvm.Mvc;
|
||||
using WalkingTec.Mvvm.Core.Extensions;
|
||||
using HHWMS.Web;
|
||||
|
||||
namespace HHWMS.Web.Controllers
|
||||
{
|
||||
[Area("xwms")]
|
||||
[ActionDescription("物料基础信息")]
|
||||
public partial class Material2Controller : BaseController
|
||||
{
|
||||
private readonly IUnitWork _unitwork;
|
||||
|
||||
public Material2Controller(IUnitWork unitwork)
|
||||
{
|
||||
_unitwork = unitwork;
|
||||
}
|
||||
|
||||
#region Search
|
||||
[ActionDescription("Sys.Search")]
|
||||
public ActionResult Index()
|
||||
{
|
||||
var vm = Wtm.CreateVM<Material2ListVM>();
|
||||
return PartialView(vm);
|
||||
}
|
||||
|
||||
[ActionDescription("Sys.Search")]
|
||||
[HttpPost]
|
||||
[FixConnection(CsName = "hangyong")]
|
||||
public string Search(Material2Searcher searcher)
|
||||
{
|
||||
var dc = Wtm.CreateDC(cskey: "hangyong");
|
||||
Wtm.DC = dc;
|
||||
var vm = Wtm.CreateVM<Material2ListVM>(passInit: true);
|
||||
if (ModelState.IsValid)
|
||||
{
|
||||
vm.Searcher = searcher;
|
||||
return vm.GetJson(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
return vm.GetError();
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Create
|
||||
[ActionDescription("Sys.Create")]
|
||||
public ActionResult Create()
|
||||
{
|
||||
var vm = Wtm.CreateVM<Material2VM>();
|
||||
return PartialView(vm);
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
[ActionDescription("Sys.Create")]
|
||||
public ActionResult Create(Material2VM vm)
|
||||
{
|
||||
if (!ModelState.IsValid)
|
||||
{
|
||||
return PartialView(vm);
|
||||
}
|
||||
else
|
||||
{
|
||||
vm.DoAdd();
|
||||
if (!ModelState.IsValid)
|
||||
{
|
||||
vm.DoReInit();
|
||||
return PartialView(vm);
|
||||
}
|
||||
else
|
||||
{
|
||||
return FFResult().CloseDialog().RefreshGrid();
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Edit
|
||||
[ActionDescription("Sys.Edit")]
|
||||
public ActionResult Edit(string id)
|
||||
{
|
||||
var vm = Wtm.CreateVM<Material2VM>(id);
|
||||
return PartialView(vm);
|
||||
}
|
||||
|
||||
[ActionDescription("Sys.Edit")]
|
||||
[HttpPost]
|
||||
[ValidateFormItemOnly]
|
||||
public ActionResult Edit(Material2VM vm)
|
||||
{
|
||||
if (!ModelState.IsValid)
|
||||
{
|
||||
return PartialView(vm);
|
||||
}
|
||||
else
|
||||
{
|
||||
vm.DoEdit();
|
||||
if (!ModelState.IsValid)
|
||||
{
|
||||
vm.DoReInit();
|
||||
return PartialView(vm);
|
||||
}
|
||||
else
|
||||
{
|
||||
return FFResult().CloseDialog().RefreshGridRow(vm.Entity.ID);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Delete
|
||||
[ActionDescription("Sys.Delete")]
|
||||
public ActionResult Delete(string id)
|
||||
{
|
||||
var vm = Wtm.CreateVM<Material2VM>(id);
|
||||
return PartialView(vm);
|
||||
}
|
||||
|
||||
[ActionDescription("Sys.Delete")]
|
||||
[HttpPost]
|
||||
public ActionResult Delete(string id, IFormCollection nouse)
|
||||
{
|
||||
var vm = Wtm.CreateVM<Material2VM>(id);
|
||||
vm.DoDelete();
|
||||
if (!ModelState.IsValid)
|
||||
{
|
||||
return PartialView(vm);
|
||||
}
|
||||
else
|
||||
{
|
||||
return FFResult().CloseDialog().RefreshGrid();
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Details
|
||||
[ActionDescription("Sys.Details")]
|
||||
public ActionResult Details(string id)
|
||||
{
|
||||
var vm = Wtm.CreateVM<Material2VM>(id);
|
||||
return PartialView(vm);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region BatchEdit
|
||||
[HttpPost]
|
||||
[ActionDescription("Sys.BatchEdit")]
|
||||
public ActionResult BatchEdit(string[] IDs)
|
||||
{
|
||||
var vm = Wtm.CreateVM<Material2BatchVM>(Ids: IDs);
|
||||
return PartialView(vm);
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
[ActionDescription("Sys.BatchEdit")]
|
||||
public ActionResult DoBatchEdit(Material2BatchVM vm, IFormCollection nouse)
|
||||
{
|
||||
if (!ModelState.IsValid || !vm.DoBatchEdit())
|
||||
{
|
||||
return PartialView("BatchEdit",vm);
|
||||
}
|
||||
else
|
||||
{
|
||||
return FFResult().CloseDialog().RefreshGrid().Alert(Localizer["Sys.BatchEditSuccess", vm.Ids.Length]);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region BatchDelete
|
||||
[HttpPost]
|
||||
[ActionDescription("Sys.BatchDelete")]
|
||||
public ActionResult BatchDelete(string[] IDs)
|
||||
{
|
||||
var vm = Wtm.CreateVM<Material2BatchVM>(Ids: IDs);
|
||||
return PartialView(vm);
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
[ActionDescription("Sys.BatchDelete")]
|
||||
public ActionResult DoBatchDelete(Material2BatchVM vm, IFormCollection nouse)
|
||||
{
|
||||
if (!ModelState.IsValid || !vm.DoBatchDelete())
|
||||
{
|
||||
return PartialView("BatchDelete",vm);
|
||||
}
|
||||
else
|
||||
{
|
||||
return FFResult().CloseDialog().RefreshGrid().Alert(Localizer["Sys.BatchDeleteSuccess", vm.Ids.Length]);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Import
|
||||
[ActionDescription("Sys.Import")]
|
||||
public ActionResult Import()
|
||||
{
|
||||
var vm = Wtm.CreateVM<Material2ImportVM>();
|
||||
return PartialView(vm);
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
[ActionDescription("Sys.Import")]
|
||||
public ActionResult Import(Material2ImportVM vm, IFormCollection nouse)
|
||||
{
|
||||
if (vm.ErrorListVM.EntityList.Count > 0 || !vm.BatchSaveData())
|
||||
{
|
||||
return PartialView(vm);
|
||||
}
|
||||
else
|
||||
{
|
||||
return FFResult().CloseDialog().RefreshGrid().Alert(Localizer["Sys.ImportSuccess", vm.EntityList.Count.ToString()]);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Export
|
||||
[ActionDescription("Sys.Export")]
|
||||
[HttpPost]
|
||||
public IActionResult ExportExcel(Material2ListVM vm)
|
||||
{
|
||||
return vm.GetExportData();
|
||||
}
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,247 @@
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using System;
|
||||
using WalkingTec.Mvvm.Core;
|
||||
using WalkingTec.Mvvm.Mvc;
|
||||
using WalkingTec.Mvvm.Core.Extensions;
|
||||
using HHWMS.Web;
|
||||
using HHWMS.Web.Models;
|
||||
|
||||
namespace HHWMS.Web.Controllers
|
||||
{
|
||||
[Area("xwms")]
|
||||
[ActionDescription("入库明细")]
|
||||
public partial class ReceiptDetail2Controller : BaseController
|
||||
{
|
||||
private readonly IUnitWork _unitwork;
|
||||
|
||||
public ReceiptDetail2Controller(IUnitWork unitwork)
|
||||
{
|
||||
_unitwork = unitwork;
|
||||
}
|
||||
|
||||
#region Search
|
||||
[ActionDescription("Sys.Search")]
|
||||
public ActionResult Index()
|
||||
{
|
||||
var vm = Wtm.CreateVM<ReceiptDetail2ListVM>();
|
||||
return PartialView(vm);
|
||||
}
|
||||
|
||||
[ActionDescription("Sys.Search")]
|
||||
[HttpPost]
|
||||
[FixConnection(CsName = "hangyong")]
|
||||
public string Search(ReceiptDetail2Searcher searcher)
|
||||
{
|
||||
var dc = Wtm.CreateDC(cskey: "hangyong");
|
||||
Wtm.DC = dc;
|
||||
var vm = Wtm.CreateVM<ReceiptDetail2ListVM>(passInit: true);
|
||||
if (ModelState.IsValid)
|
||||
{
|
||||
vm.Searcher = searcher;
|
||||
return vm.GetJson(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
return vm.GetError();
|
||||
}
|
||||
}
|
||||
|
||||
[ActionDescription("Sys.Search")]
|
||||
[HttpPost]
|
||||
[FixConnection(CsName = "hangyong")]
|
||||
public string Search2(ReceiptDetail2ListVM vm)
|
||||
{
|
||||
var dc = Wtm.CreateDC(cskey: "hangyong");
|
||||
Wtm.DC = dc;
|
||||
vm.Searcher.Page = vm.FC.GetValue<int>("Page");
|
||||
vm.Searcher.Limit = vm.FC.GetValue<int>("Limit");
|
||||
return vm.GetJson(false);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Create
|
||||
[ActionDescription("Sys.Create")]
|
||||
public ActionResult Create(int id)
|
||||
{
|
||||
var vm = Wtm.CreateVM<ReceiptDetail2VM>();
|
||||
vm.Entity.ReceiptId = id;
|
||||
return PartialView(vm);
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
[ActionDescription("Sys.Create")]
|
||||
[FixConnection(CsName = "hangyong")]
|
||||
public ActionResult Create(ReceiptDetail2VM vm)
|
||||
{
|
||||
var dc = Wtm.CreateDC(cskey: "hangyong");
|
||||
Wtm.DC = dc;
|
||||
if (!ModelState.IsValid)
|
||||
{
|
||||
return PartialView(vm);
|
||||
}
|
||||
else
|
||||
{
|
||||
vm.DoAdd();
|
||||
if (!ModelState.IsValid)
|
||||
{
|
||||
vm.DoReInit();
|
||||
return PartialView(vm);
|
||||
}
|
||||
else
|
||||
{
|
||||
return FFResult().CloseDialog().RefreshGrid(index: 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Edit
|
||||
[ActionDescription("Sys.Edit")]
|
||||
public ActionResult Edit(string id)
|
||||
{
|
||||
var vm = Wtm.CreateVM<ReceiptDetail2VM>(id);
|
||||
return PartialView(vm);
|
||||
}
|
||||
|
||||
[ActionDescription("Sys.Edit")]
|
||||
[HttpPost]
|
||||
[ValidateFormItemOnly]
|
||||
public ActionResult Edit(ReceiptDetail2VM vm)
|
||||
{
|
||||
if (!ModelState.IsValid)
|
||||
{
|
||||
return PartialView(vm);
|
||||
}
|
||||
else
|
||||
{
|
||||
vm.DoEdit();
|
||||
if (!ModelState.IsValid)
|
||||
{
|
||||
vm.DoReInit();
|
||||
return PartialView(vm);
|
||||
}
|
||||
else
|
||||
{
|
||||
return FFResult().CloseDialog().RefreshGridRow(vm.Entity.ID);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Delete
|
||||
[ActionDescription("Sys.Delete")]
|
||||
public ActionResult Delete(string id)
|
||||
{
|
||||
var vm = Wtm.CreateVM<ReceiptDetail2VM>(id);
|
||||
return PartialView(vm);
|
||||
}
|
||||
|
||||
[ActionDescription("Sys.Delete")]
|
||||
[HttpPost]
|
||||
public ActionResult Delete(string id, IFormCollection nouse)
|
||||
{
|
||||
var vm = Wtm.CreateVM<ReceiptDetail2VM>(id);
|
||||
vm.DoDelete();
|
||||
if (!ModelState.IsValid)
|
||||
{
|
||||
return PartialView(vm);
|
||||
}
|
||||
else
|
||||
{
|
||||
return FFResult().CloseDialog().RefreshGrid();
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Details
|
||||
[ActionDescription("Sys.Details")]
|
||||
public ActionResult Details(string id)
|
||||
{
|
||||
var vm = Wtm.CreateVM<ReceiptDetail2VM>(id);
|
||||
return PartialView(vm);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region BatchEdit
|
||||
[HttpPost]
|
||||
[ActionDescription("Sys.BatchEdit")]
|
||||
public ActionResult BatchEdit(string[] IDs)
|
||||
{
|
||||
var vm = Wtm.CreateVM<ReceiptDetail2BatchVM>(Ids: IDs);
|
||||
return PartialView(vm);
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
[ActionDescription("Sys.BatchEdit")]
|
||||
public ActionResult DoBatchEdit(ReceiptDetail2BatchVM vm, IFormCollection nouse)
|
||||
{
|
||||
if (!ModelState.IsValid || !vm.DoBatchEdit())
|
||||
{
|
||||
return PartialView("BatchEdit",vm);
|
||||
}
|
||||
else
|
||||
{
|
||||
return FFResult().CloseDialog().RefreshGrid().Alert(Localizer["Sys.BatchEditSuccess", vm.Ids.Length]);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region BatchDelete
|
||||
[HttpPost]
|
||||
[ActionDescription("Sys.BatchDelete")]
|
||||
public ActionResult BatchDelete(string[] IDs)
|
||||
{
|
||||
var vm = Wtm.CreateVM<ReceiptDetail2BatchVM>(Ids: IDs);
|
||||
return PartialView(vm);
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
[ActionDescription("Sys.BatchDelete")]
|
||||
public ActionResult DoBatchDelete(ReceiptDetail2BatchVM vm, IFormCollection nouse)
|
||||
{
|
||||
if (!ModelState.IsValid || !vm.DoBatchDelete())
|
||||
{
|
||||
return PartialView("BatchDelete",vm);
|
||||
}
|
||||
else
|
||||
{
|
||||
return FFResult().CloseDialog().RefreshGrid().Alert(Localizer["Sys.BatchDeleteSuccess", vm.Ids.Length]);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Import
|
||||
[ActionDescription("Sys.Import")]
|
||||
public ActionResult Import()
|
||||
{
|
||||
var vm = Wtm.CreateVM<ReceiptDetail2ImportVM>();
|
||||
return PartialView(vm);
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
[ActionDescription("Sys.Import")]
|
||||
public ActionResult Import(ReceiptDetail2ImportVM vm, IFormCollection nouse)
|
||||
{
|
||||
if (vm.ErrorListVM.EntityList.Count > 0 || !vm.BatchSaveData())
|
||||
{
|
||||
return PartialView(vm);
|
||||
}
|
||||
else
|
||||
{
|
||||
return FFResult().CloseDialog().RefreshGrid().Alert(Localizer["Sys.ImportSuccess", vm.EntityList.Count.ToString()]);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Export
|
||||
[ActionDescription("Sys.Export")]
|
||||
[HttpPost]
|
||||
public IActionResult ExportExcel(ReceiptDetail2ListVM vm)
|
||||
{
|
||||
return vm.GetExportData();
|
||||
}
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,8 @@ using WalkingTec.Mvvm.Core;
|
||||
using WalkingTec.Mvvm.Mvc;
|
||||
using WalkingTec.Mvvm.Core.Extensions;
|
||||
using HHWMS.Web.xwms.ViewModels.ReceiptHeader2VMs;
|
||||
using HHWMS.Web.Models;
|
||||
using System.Linq;
|
||||
|
||||
namespace HHWMS.Web.Controllers
|
||||
{
|
||||
@@ -53,13 +55,28 @@ namespace HHWMS.Web.Controllers
|
||||
public ActionResult Create()
|
||||
{
|
||||
var vm = Wtm.CreateVM<ReceiptHeader2VM>();
|
||||
vm.Entity.Type = "QTR";
|
||||
vm.Entity.UserDef2 = "HYB";
|
||||
return PartialView(vm);
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
[ActionDescription("Sys.Create")]
|
||||
[FixConnection(CsName = "hangyong")]
|
||||
public ActionResult Create(ReceiptHeader2VM vm)
|
||||
{
|
||||
var warehouseId = Wtm.LoginUserInfo.Groups.FirstOrDefault().GroupCode;
|
||||
vm.Entity.WarehouseId = int.Parse(warehouseId);
|
||||
vm.Entity.Code = _unitwork.GetSerialNumber("QTR");
|
||||
vm.Entity.FirstStatus = 0;
|
||||
vm.Entity.LastStatus = 0;
|
||||
vm.Entity.TotalLines = 0;
|
||||
vm.Entity.TotalQty = 0;
|
||||
var dc = Wtm.CreateDC(cskey: "hangyong");
|
||||
Wtm.DC = dc;
|
||||
vm.Entity.SupplierName = dc.Set<Supplier>()
|
||||
.FirstOrDefault(x => x.Code == vm.Entity.SupplierCode)
|
||||
?.Name;
|
||||
if (!ModelState.IsValid)
|
||||
{
|
||||
return PartialView(vm);
|
||||
|
||||
@@ -2,6 +2,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using HHWMS.Web.Models;
|
||||
using MESTOWMSService;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
@@ -99,6 +100,8 @@ public class XWMSMFMController : BaseController
|
||||
|
||||
var shipment = new ShipmentHeader2();
|
||||
shipment.Code = _unitwork.GetSerialNumber("SCC");
|
||||
shipment.SourceCode = data.FirstOrDefault().MFGNUM_0;
|
||||
shipment.UserDef2 = data.FirstOrDefault().MFGLIN_0.ToString();
|
||||
shipment.Type = "SCC";
|
||||
shipment.FirstStatus = 0;
|
||||
shipment.UserDef1 = data.FirstOrDefault().MFGFCY_0;
|
||||
@@ -115,8 +118,8 @@ public class XWMSMFMController : BaseController
|
||||
detail.SourceCode = item.MFGNUM_0;
|
||||
detail.SourceLine = item.MFGLIN_0.ToString();
|
||||
detail.MaterialCode = item.ITMREF_0;
|
||||
detail.MaterialName = item.ITMDES1_0;
|
||||
detail.Lot = item.ITMDES2_0;
|
||||
detail.MaterialName = HttpUtility.HtmlDecode(item.ITMDES1_0);
|
||||
detail.Lot = HttpUtility.HtmlDecode(item.ITMDES2_0);
|
||||
detail.Qty = item.THISQTYSTU;
|
||||
detail.Unit = item.BOMSEQ_0.ToString();
|
||||
//detail.PurchasQty = item.THISQTYUOM;
|
||||
|
||||
@@ -2,12 +2,15 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using System.Web;
|
||||
using HHWMS.Web.Models;
|
||||
using MESTOWMSService;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Newtonsoft.Json;
|
||||
using ServiceReference1;
|
||||
using SixLabors.ImageSharp.Drawing;
|
||||
using WalkingTec.Mvvm.Core;
|
||||
using WalkingTec.Mvvm.Mvc;
|
||||
|
||||
@@ -88,6 +91,7 @@ public class XWMSPOHController : BaseController
|
||||
#endregion Search
|
||||
|
||||
[HttpPost]
|
||||
[ActionDescription("Sys.Create")]
|
||||
[FixConnection(CsName = "hangyong")]
|
||||
public ActionResult Create(List<XWMSPOH> data)
|
||||
{
|
||||
@@ -115,8 +119,8 @@ public class XWMSPOHController : BaseController
|
||||
detail.SourceCode = item.POHNUM_0;
|
||||
detail.SourceLine = item.POPLIN_0.ToString();
|
||||
detail.MaterialCode = item.ITMREF_0;
|
||||
detail.MaterialName = item.ITMDES1_0;
|
||||
detail.Lot = item.ITMDES2_0;
|
||||
detail.MaterialName = HttpUtility.HtmlDecode(item.ITMDES1_0);
|
||||
detail.Lot = HttpUtility.HtmlDecode(item.ITMDES2_0);
|
||||
detail.Qty = item.THISQTYSTU;
|
||||
detail.Unit = item.STU_0;
|
||||
detail.PurchasQty = item.THISQTYUOM;
|
||||
|
||||
@@ -2,6 +2,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using HHWMS.Web.Models;
|
||||
using MESTOWMSService;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
@@ -118,14 +119,13 @@ public class XWMSPTHController : BaseController
|
||||
detail.SourceCode = item.PTHNUM_0;
|
||||
detail.SourceLine = item.PTDLIN_0.ToString();
|
||||
detail.MaterialCode = item.ITMREF_0;
|
||||
detail.MaterialName = item.ITMDES1_0;
|
||||
detail.Lot = item.ITMDES2_0;
|
||||
detail.MaterialName = HttpUtility.HtmlDecode(item.ITMDES1_0);
|
||||
detail.Lot = HttpUtility.HtmlDecode(item.ITMDES2_0);
|
||||
detail.Qty = item.THISQTYSTU;
|
||||
detail.Unit = item.STU_0;
|
||||
detail.PurchasQty = item.THISQTYUOM;
|
||||
detail.PurchasUnits = item.UOM_0;
|
||||
detail.InventoryStatus = item.STA_0;
|
||||
detail.Batch = _unitwork.GetSerialNumber("HYB", 5).Remove(3, 2);
|
||||
detail.Status = 0;
|
||||
detail.CreateTime = DateTime.Now;
|
||||
detailList.Add(detail);
|
||||
|
||||
@@ -2,6 +2,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using HHWMS.Web.Models;
|
||||
using MESTOWMSService;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
@@ -86,8 +87,8 @@ public class XWMSSHIPController : BaseController
|
||||
var _unitwork = new UnitWork(Wtm);
|
||||
|
||||
var receipt = new ReceiptHeader2();
|
||||
receipt.Code = _unitwork.GetSerialNumber("CGR");
|
||||
receipt.SourceCode = data.FirstOrDefault().POHNUM_0;
|
||||
receipt.Code = _unitwork.GetSerialNumber("DDS");
|
||||
receipt.SourceCode = data.FirstOrDefault().SDHNUM_0;
|
||||
receipt.SupplierCode = data.FirstOrDefault().STOFCY_0;
|
||||
receipt.SupplierName = data.FirstOrDefault().BPRNAM_0;
|
||||
receipt.Type = "DDS";
|
||||
@@ -107,8 +108,8 @@ public class XWMSSHIPController : BaseController
|
||||
detail.SourceCode = item.SDHNUM_0;
|
||||
detail.SourceLine = item.SDDLIN_0.ToString();
|
||||
detail.MaterialCode = item.ITMREF_0;
|
||||
detail.MaterialName = item.ITMDES1_0;
|
||||
detail.Lot = item.ITMDES2_0;
|
||||
detail.MaterialName = HttpUtility.HtmlDecode(item.ITMDES1_0);
|
||||
detail.Lot = HttpUtility.HtmlDecode(item.ITMDES2_0);
|
||||
detail.Qty = item.QTYSTU_0;
|
||||
detail.Unit = item.SAU_0;
|
||||
detail.PurchasQty = item.QTY_0;
|
||||
@@ -121,6 +122,10 @@ public class XWMSSHIPController : BaseController
|
||||
}
|
||||
_unitwork.BatchAdd(detailList.ToArray());
|
||||
|
||||
receipt.TotalLines = detailList.Count();
|
||||
receipt.TotalQty = detailList.Sum(x => x.Qty);
|
||||
_unitwork.Update(receipt);
|
||||
|
||||
return JsonMore(null);
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using HHWMS.Web.Models;
|
||||
using MESTOWMSService;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
@@ -88,6 +89,7 @@ public class XWMSSOHController : BaseController
|
||||
var shipment = new ShipmentHeader2();
|
||||
shipment.Code = _unitwork.GetSerialNumber("XSC");
|
||||
shipment.Type = "XSC";
|
||||
shipment.SourceCode = data.FirstOrDefault().SOHNUM_0;
|
||||
shipment.ShipTo = data.FirstOrDefault().BPCORD_0;
|
||||
shipment.FirstStatus = 0;
|
||||
shipment.AppointmentTime = data.FirstOrDefault().ORDDAT_0;
|
||||
@@ -106,8 +108,8 @@ public class XWMSSOHController : BaseController
|
||||
detail.SourceCode = item.SOHNUM_0;
|
||||
detail.SourceLine = item.SOPLIN_0.ToString();
|
||||
detail.MaterialCode = item.ITMREF_0;
|
||||
detail.MaterialName = item.ITMDES1_0;
|
||||
detail.Lot = item.ITMDES2_0;
|
||||
detail.MaterialName = HttpUtility.HtmlDecode(item.ITMDES1_0);
|
||||
detail.Lot = HttpUtility.HtmlDecode(item.ITMDES2_0);
|
||||
detail.Qty = item.THISQTYSTU;
|
||||
detail.Unit = item.STU_0;
|
||||
//detail.PurchasQty = item.THISQTYUOM;
|
||||
|
||||
Reference in new issue
Block a user