diff --git a/HHWMS.Web/Areas/Configs/Controllers/Print4Controller.cs b/HHWMS.Web/Areas/Configs/Controllers/Print4Controller.cs new file mode 100644 index 0000000..47263b2 --- /dev/null +++ b/HHWMS.Web/Areas/Configs/Controllers/Print4Controller.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using HHWMS.Web.Models; +using ICSharpCode.SharpZipLib.Core; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using WalkingTec.Mvvm.Core; +using WalkingTec.Mvvm.Core.Extensions; +using WalkingTec.Mvvm.Mvc; + +namespace HHWMS.Web.Controllers +{ + [Area("configs")] + [ActionDescription("卷料库打码")] + public partial class Print4Controller : BaseController + { + private readonly IUnitWork _unitwork; + + public Print4Controller(IUnitWork unitwork) + { + _unitwork = unitwork; + } + + #region Search + + [ActionDescription("Sys.Search")] + public ActionResult Index() + { + var vm = Wtm.CreateVM(); + return PartialView(vm); + } + #endregion Search + + } +} diff --git a/HHWMS.Web/Areas/Configs/ViewModels/MaterialVMs/MaterialListVM.cs b/HHWMS.Web/Areas/Configs/ViewModels/MaterialVMs/MaterialListVM.cs index f8deb72..ba6d3ab 100644 --- a/HHWMS.Web/Areas/Configs/ViewModels/MaterialVMs/MaterialListVM.cs +++ b/HHWMS.Web/Areas/Configs/ViewModels/MaterialVMs/MaterialListVM.cs @@ -32,19 +32,20 @@ namespace HHWMS.Web protected override IEnumerable> InitGridHeader() { return new List>{ - this.MakeGridHeader(x => x.UniqueCode).SetHide(), - this.MakeGridHeader(x => x.QRCode), - this.MakeGridHeader(x => x.SourceCode).SetHide(), - this.MakeGridHeader(x => x.MaterialCode), + this.MakeGridHeader(x => x.UniqueCode), this.MakeGridHeader(x => x.MaterialType), - this.MakeGridHeader(x => x.MaterialName), this.MakeGridHeader(x => x.MaterialSpec), - this.MakeGridHeader(x => x.MaterialUnit).SetWidth(80), - this.MakeGridHeader(x => x.Batch).SetWidth(150), + this.MakeGridHeader(x => x.Batch), + this.MakeGridHeader(x => x.Qty), + this.MakeGridHeader(x => x.CreateTime), + this.MakeGridHeader(x => x.QRCode).SetHide(), + this.MakeGridHeader(x => x.SourceCode).SetHide(), + this.MakeGridHeader(x => x.MaterialCode).SetHide(), + this.MakeGridHeader(x => x.MaterialName).SetHide(), + this.MakeGridHeader(x => x.MaterialUnit).SetHide(), this.MakeGridHeader(x => x.Lot).SetHide(), this.MakeGridHeader(x => x.CompanyCode).SetHide(), - this.MakeGridHeader(x => x.SupplierCode), - this.MakeGridHeader(x => x.Qty), + this.MakeGridHeader(x => x.SupplierCode).SetHide(), this.MakeGridHeaderAction(width: 200) }; } @@ -71,6 +72,7 @@ namespace HHWMS.Web CompanyCode = x.CompanyCode, SupplierCode = x.SupplierCode, Qty = x.Qty, + CreateTime = x.CreateTime }) .OrderBy(x => x.ID); return query; diff --git a/HHWMS.Web/Areas/Configs/ViewModels/MaterialVMs/MaterialSearcher.cs b/HHWMS.Web/Areas/Configs/ViewModels/MaterialVMs/MaterialSearcher.cs index 9f4326a..8eb51d8 100644 --- a/HHWMS.Web/Areas/Configs/ViewModels/MaterialVMs/MaterialSearcher.cs +++ b/HHWMS.Web/Areas/Configs/ViewModels/MaterialVMs/MaterialSearcher.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; @@ -12,7 +12,7 @@ namespace HHWMS.Web { public partial class MaterialSearcher : BaseSearcher { - [Display(Name = "Inventory.UniqueCode")] + [Display(Name = "Inventory4.UniqueCode")] public String UniqueCode { get; set; } [Display(Name = "Inventory.QRCode")] public String QRCode { get; set; } diff --git a/HHWMS.Web/Areas/Configs/Views/Material/Index.cshtml b/HHWMS.Web/Areas/Configs/Views/Material/Index.cshtml index da33ae4..d142782 100644 --- a/HHWMS.Web/Areas/Configs/Views/Material/Index.cshtml +++ b/HHWMS.Web/Areas/Configs/Views/Material/Index.cshtml @@ -4,8 +4,8 @@ - - +@* + *@ diff --git a/HHWMS.Web/Areas/Configs/Views/Print4/Index.cshtml b/HHWMS.Web/Areas/Configs/Views/Print4/Index.cshtml new file mode 100644 index 0000000..b622f88 --- /dev/null +++ b/HHWMS.Web/Areas/Configs/Views/Print4/Index.cshtml @@ -0,0 +1,299 @@ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 创建入库单 + + + 打印 + + + + + + + + + + + + + + + + + +
+ + diff --git a/HHWMS.Web/Areas/XWMS/Controllers/ReceiptHeader2Controller.cs b/HHWMS.Web/Areas/XWMS/Controllers/ReceiptHeader2Controller.cs index fb78e8f..b24dbce 100644 --- a/HHWMS.Web/Areas/XWMS/Controllers/ReceiptHeader2Controller.cs +++ b/HHWMS.Web/Areas/XWMS/Controllers/ReceiptHeader2Controller.cs @@ -8,6 +8,7 @@ using HHWMS.Web.xwms.ViewModels.ReceiptHeader2VMs; using HHWMS.Web.Models; using System.Linq; using System.Collections.Generic; +using NPOI.SS.Formula; namespace HHWMS.Web.Controllers { @@ -319,13 +320,12 @@ namespace HHWMS.Web.Controllers { var warehouseId = Wtm.LoginUserInfo.Groups.FirstOrDefault().GroupCode; var dc = Wtm.CreateDC(cskey: "hangyong"); - + Wtm.DC = dc; + var _unit = new UnitWork(Wtm); using (var tran = dc.BeginTransaction()) { try { - Wtm.DC = dc; - var _unit = new UnitWork(Wtm); var receipt = new ReceiptHeader2(); receipt.WarehouseId = int.Parse(warehouseId); receipt.Code = _unitwork.GetSerialNumber("10"); @@ -368,5 +368,92 @@ namespace HHWMS.Web.Controllers } return JsonMore(null); } + + [HttpPost] + [ActionDescription("Sys.Create4")] + [FixConnection(CsName = "hangyong")] + public ActionResult CreateDetail4(List data) + { + var warehouseId = Wtm.LoginUserInfo.Groups.FirstOrDefault().GroupCode; + var dc = Wtm.CreateDC(cskey: "hangyong"); + Wtm.DC = dc; + var _unit = new UnitWork(Wtm); + using (var tran = dc.BeginTransaction()) + { + try + { + var receipt = new ReceiptHeader2(); + receipt.WarehouseId = int.Parse(warehouseId); + receipt.Code = _unitwork.GetSerialNumber("410"); + receipt.Type = "10"; + receipt.FirstStatus = 0; + receipt.LastStatus = 0; + + _unit.Add(receipt); + + var detailList = new List(); + var matList = new List(); + foreach(var item in data) + { + var detail = new ReceiptDetail2(); + detail.WarehouseId = receipt.WarehouseId; + detail.ReceiptId = receipt.ID; + detail.ReceiptCode = receipt.Code; + detail.MaterialCode = item.JH; + detail.MaterialName = item.JH; + detail.Lot = item.Lot; + detail.Sn = item.Sn; + detail.Qty = item.Qty; + detail.Project = item.JH; + detail.InventoryStatus = "1"; + detail.UserDef1 = item.Lot; + detail.UserDef2 = item.PH; + detail.Status = 0; + detail.CreateTime = DateTime.Now; + detailList.Add(detail); + + matList.Add(new Material + { + UniqueCode = item.JH, + MaterialSpec = item.Lot, + MaterialType = item.Sn, + Qty = item.Qty, + Batch = item.PH, + CreateTime = DateTime.Now, + }); + } + _unitwork.BatchAdd(matList.ToArray()); + _unit.BatchAdd(detailList.ToArray()); + + receipt.TotalLines = detailList.Count(); + receipt.TotalQty = detailList.Sum(x => x.Qty); + _unit.Update(receipt); + + tran.Commit(); + } + catch (Exception ex) + { + tran.Rollback(); + return JsonMore(null, 500, ex.Message); + } + } + return JsonMore(null); + } + } + + public class receipt4 + { + /// + /// 卷号 + /// + public string JH { get; set; } + public decimal Qty { get; set; } + public decimal Len { get; set; } + public string Lot { get; set; } + public string Sn { get; set;} + /// + /// 片厚 + /// + public string PH { get; set; } } } diff --git a/HHWMS.Web/Areas/XWMS/ViewModels/Material2VMs/Material2ListVM.cs b/HHWMS.Web/Areas/XWMS/ViewModels/Material2VMs/Material2ListVM.cs index 88ba569..5b0cc77 100644 --- a/HHWMS.Web/Areas/XWMS/ViewModels/Material2VMs/Material2ListVM.cs +++ b/HHWMS.Web/Areas/XWMS/ViewModels/Material2VMs/Material2ListVM.cs @@ -36,8 +36,8 @@ namespace HHWMS.Web this.MakeGridHeader(x => x.Type), this.MakeGridHeader(x => x.Name).SetWidth(150), this.MakeGridHeader(x => x.MasterUnit), - this.MakeGridHeader(x => x.Specification).SetHide(), - this.MakeGridHeader(x => x.ClassA).SetHide(), + this.MakeGridHeader(x => x.Specification), + this.MakeGridHeader(x => x.ClassA), this.MakeGridHeaderAction(width: 200) }; } diff --git a/HHWMS.Web/Areas/XWMS/Views/ReceiptDetail2/Print.cshtml b/HHWMS.Web/Areas/XWMS/Views/ReceiptDetail2/Print.cshtml index 0121e2a..8cd66cf 100644 --- a/HHWMS.Web/Areas/XWMS/Views/ReceiptDetail2/Print.cshtml +++ b/HHWMS.Web/Areas/XWMS/Views/ReceiptDetail2/Print.cshtml @@ -27,7 +27,7 @@ width="50"> - + diff --git a/HHWMS.Web/Areas/XWMS/Views/XWMSMFM/Index.cshtml b/HHWMS.Web/Areas/XWMS/Views/XWMSMFM/Index.cshtml index 85fc035..09523d8 100644 --- a/HHWMS.Web/Areas/XWMS/Views/XWMSMFM/Index.cshtml +++ b/HHWMS.Web/Areas/XWMS/Views/XWMSMFM/Index.cshtml @@ -96,7 +96,7 @@ - + @* *@ diff --git a/HHWMS.Web/Models/Configs/Material.cs b/HHWMS.Web/Models/Configs/Material.cs index 5ae81a3..433c687 100644 --- a/HHWMS.Web/Models/Configs/Material.cs +++ b/HHWMS.Web/Models/Configs/Material.cs @@ -13,7 +13,7 @@ namespace HHWMS.Web.Models [DatabaseGenerated(DatabaseGeneratedOption.Identity)] public new int ID { get; set; } - [Display(Name = "Inventory.UniqueCode", Description = "唯一码")] + [Display(Name = "Inventory4.UniqueCode", Description = "唯一码")] [StringLength(50, ErrorMessage = "Validate.{0}stringmax{1}")] public string UniqueCode { get; set; } @@ -29,7 +29,7 @@ namespace HHWMS.Web.Models [StringLength(50, ErrorMessage = "Validate.{0}stringmax{1}")] public string MaterialCode { get; set; } - [Display(Name = "Inventory.MaterialType", Description = "物料类型")] + [Display(Name = "Inventory4.MaterialType", Description = "物料类型")] [StringLength(50, ErrorMessage = "Validate.{0}stringmax{1}")] public string MaterialType { get; set; } @@ -37,14 +37,14 @@ namespace HHWMS.Web.Models [StringLength(50, ErrorMessage = "Validate.{0}stringmax{1}")] public string MaterialName { get; set; } - [Display(Name = "Inventory.MaterialSpec", Description = "物料规格")] + [Display(Name = "Inventory4.MaterialSpec", Description = "物料规格")] public string MaterialSpec { get; set; } [Display(Name = "Inventory.MaterialUnit", Description = "单位")] [StringLength(50, ErrorMessage = "Validate.{0}stringmax{1}")] public string MaterialUnit { get; set; } - [Display(Name = "Inventory.Batch", Description = "批次")] + [Display(Name = "Inventory4.Batch", Description = "批次")] [StringLength(50, ErrorMessage = "Validate.{0}stringmax{1}")] public string Batch { get; set; } @@ -60,7 +60,7 @@ namespace HHWMS.Web.Models [StringLength(50, ErrorMessage = "Validate.{0}stringmax{1}")] public string SupplierCode { get; set; } - [Display(Name = "Inventory.Qty", Description = "数量")] + [Display(Name = "Inventory4.Qty", Description = "数量")] [Column(TypeName = "decimal(12,4)")] public decimal? Qty { get; set; } } diff --git a/HHWMS.Web/Models/XWMS/Material.cs b/HHWMS.Web/Models/XWMS/Material.cs index fb9cae7..a340d8a 100644 --- a/HHWMS.Web/Models/XWMS/Material.cs +++ b/HHWMS.Web/Models/XWMS/Material.cs @@ -92,6 +92,7 @@ namespace HHWMS.Web.Models /// 规格 /// [Column("specification")] + [Display(Name = "ReceiptDetail2.Lot")] public string Specification { get; set; } /// /// 品牌 diff --git a/HHWMS.Web/Resources/Program.zh.resx b/HHWMS.Web/Resources/Program.zh.resx index 6792690..b8a504b 100644 --- a/HHWMS.Web/Resources/Program.zh.resx +++ b/HHWMS.Web/Resources/Program.zh.resx @@ -1497,4 +1497,22 @@ 单价 + + 状态 + + + 重量 + + + 片厚 + + + 铁损 + + + 规格 + + + 卷号 + diff --git a/HHWMS.Web/Resposity/Helper/OracleHelper.cs b/HHWMS.Web/Resposity/Helper/OracleHelper.cs index d66d021..47b69e5 100644 --- a/HHWMS.Web/Resposity/Helper/OracleHelper.cs +++ b/HHWMS.Web/Resposity/Helper/OracleHelper.cs @@ -12,7 +12,7 @@ namespace HHWMS.Web public static OracleConnection conn = null; //user id=guest;password=guest123; data source=202.101.164.132:15555/SAGEX3; - public static string connstr = "Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=202.101.164.132)(PORT=15555))(CONNECT_DATA=(SERVICE_NAME=SAGEX3)));User Id=guest;Password=guest123"; + public static string connstr = "Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=202.101.164.132)(PORT=15555))(CONNECT_DATA=(SERVICE_NAME=SAGEX3)));User Id=QRE;Password=tiger"; public static OracleConnection init() {