diff --git a/ZR.Admin.WebApi/Controllers/mes/md/MdProductDefineController.cs b/ZR.Admin.WebApi/Controllers/mes/md/MdProductDefineController.cs new file mode 100644 index 00000000..2bd7d293 --- /dev/null +++ b/ZR.Admin.WebApi/Controllers/mes/md/MdProductDefineController.cs @@ -0,0 +1,64 @@ +using CSRedis; +using Microsoft.AspNetCore.Mvc; +using Microsoft.Extensions.Hosting; +using Newtonsoft.Json; +using Newtonsoft.Json.Linq; +using System.Collections.Generic; +using ZR.Admin.WebApi.Extensions; +using ZR.Model.mes.md; +using ZR.Service.mes.md; +using ZR.Service.mes.md.IService; + +namespace ZR.Admin.WebApi.Controllers.mes.md +{ + [Route("mes/md/product")] + public class MdProductDefineController : BaseController + { + private readonly IMdProductDefineService mdProduct; + public MdProductDefineController(IMdProductDefineService mdProduct) { + this.mdProduct = mdProduct; + } + /// + /// 分页查寻 unti + /// + /// 页码 + /// 页尺 + /// 单位名称 + /// 单位代码 + /// + [HttpGet("list")] + public IActionResult Getlist(int pageNum, int pagesize, string name = "", string code = "") + { + var unitPageDto = mdProduct.GetList(name, code, pageNum, pagesize); + return SUCCESS(unitPageDto); + } + + // + + [HttpGet("getUnit/{name}")] + public IActionResult GetUnitlist(string name) + { + List units = mdProduct.GetProductDefineList(name); + return SUCCESS(units); + } + [HttpGet("getUnit")] + public IActionResult GetUnitlist() + { + List units = mdProduct.GetProductDefineList(); + return SUCCESS(units); + } + + //addProductDefine + [HttpPost("addProductDefine")] + public int addProductDefine([FromBody] MdProductDefine products) + { + int result = mdProduct.InsertProductDefine(products); + return result; + } + + + + + } + +} diff --git a/ZR.Admin.WebApi/Controllers/mes/md/MdUnitController.cs b/ZR.Admin.WebApi/Controllers/mes/md/MdUnitController.cs new file mode 100644 index 00000000..439e3d93 --- /dev/null +++ b/ZR.Admin.WebApi/Controllers/mes/md/MdUnitController.cs @@ -0,0 +1,123 @@ +using Microsoft.AspNetCore.Mvc; +using Microsoft.Extensions.Hosting; +using Newtonsoft.Json; +using Newtonsoft.Json.Linq; +using System.Collections.Generic; +using ZR.Admin.WebApi.Extensions; +using ZR.Model.mes.md; +using ZR.Model.mes.md.DTO; +using ZR.Service.mes.md.IService; + +namespace ZR.Admin.WebApi.Controllers.mes.md +{ + + [Route("mes/md/unit")] + public class MdUnitController : BaseController + { + private readonly IMdUnitService unitService; + + public MdUnitController(IMdUnitService unitService) + { + this.unitService = unitService; + } + /// + /// 分页查寻 unti + /// + /// 页码 + /// 页尺 + /// 单位名称 + /// 单位代码 + /// + [HttpGet("list")] + public IActionResult Getlist(int pageNum, int pagesize, string name = "", string code = "") + { + var unitPageDto = unitService.GetList(name, code, pageNum, pagesize); + return SUCCESS(unitPageDto); + } + + /// + /// by pk 寻求unit + /// + /// + /// + [HttpGet("getUnit/{measure_id}")] + public IActionResult GetUnit(int measure_id) + { + var unit = unitService.GetUnitbyPK(measure_id); + return SUCCESS(unit); + } + + /// + /// 添加Unit + /// + /// + /// + [HttpPost("addUnit")] + public IActionResult AddUnitmeasure([FromBody] MdUnit paramss) + { + paramss.ToCreate(HttpContext); + int result = unitService.InsertUnit(paramss); + return SUCCESS(result); + } + /// + /// 更新单位unit + /// + /// + /// + + [HttpPost("updateUnit")] + public IActionResult UpdateUnit([FromBody] MdUnit paramss) + { + if (paramss != null) + { + paramss.ToUpdate(HttpContext); + int result = unitService.Updateunit(paramss); + + return SUCCESS(result); + } + else + { + return ToResponse(ApiResult.Error(110, "请求参数为空")); + } + + + } + /// + /// 根据主键删除名称 + /// + /// + /// + [HttpDelete("delUnit/{id}")] + public IActionResult DelUnit(string id) + { + int[] ids = Tools.SpitIntArrary(id); + int result = unitService.deleteunit(ids); + return ToResponse(result); + } + + /// + /// 导出Unit excel + /// + /// + /// + [HttpGet("exportUnit")] + public IActionResult exportUnit([FromQuery] SearchOptionDTO searchOption) + { + List units = null; + if(searchOption != null) + { + units= unitService.GetList(searchOption); + } + + var result = ExportExcelMini(units, "unit", "单位列表"); + return ExportExcel(result.Item2, result.Item1); + + } + + + + + } + +} + diff --git a/ZR.Admin.WebApi/Controllers/mes/md/UnitController.cs b/ZR.Admin.WebApi/Controllers/mes/md/UnitController.cs deleted file mode 100644 index 8f581d46..00000000 --- a/ZR.Admin.WebApi/Controllers/mes/md/UnitController.cs +++ /dev/null @@ -1,22 +0,0 @@ -using Microsoft.AspNetCore.Mvc; -using ZR.Model.mes.md.DTO; -using ZR.Service.mes.md.IService; - -namespace ZR.Admin.WebApi.Controllers.mes.md; -//http://localhost:8887/dev-api/mes/md/unit/list -[Route("mes/md/unit")] -public class UnitController : BaseController -{ - private IUnitService unitService; - public UnitController(IUnitService unitService) - { - this.unitService = unitService; - } - - [HttpGet("list")] - public IActionResult Getlist(int pageNum,int pagesize) - { - UnitPageDTO unitPageDto = unitService.GetList(pageNum, pagesize); - return SUCCESS(unitPageDto); - } -} \ No newline at end of file diff --git a/ZR.Admin.WebApi/Extensions/EntityExtension.cs b/ZR.Admin.WebApi/Extensions/EntityExtension.cs index 1a96758e..02123da7 100644 --- a/ZR.Admin.WebApi/Extensions/EntityExtension.cs +++ b/ZR.Admin.WebApi/Extensions/EntityExtension.cs @@ -12,11 +12,15 @@ namespace ZR.Admin.WebApi.Extensions BindingFlags flag = BindingFlags.Public | BindingFlags.IgnoreCase | BindingFlags.Instance; types.GetProperty("CreateTime", flag)?.SetValue(source, DateTime.Now, null); + types.GetProperty("CreatedTime", flag)?.SetValue(source, DateTime.Now, null); types.GetProperty("AddTime", flag)?.SetValue(source, DateTime.Now, null); types.GetProperty("CreateBy", flag)?.SetValue(source, context.GetName(), null); types.GetProperty("Create_by", flag)?.SetValue(source, context.GetName(), null); + types.GetProperty("CreatedBy", flag)?.SetValue(source, context.GetName(), null); types.GetProperty("UserId", flag)?.SetValue(source, context.GetUId(), null); + + return source; } @@ -28,8 +32,10 @@ namespace ZR.Admin.WebApi.Extensions types.GetProperty("UpdateTime", flag)?.SetValue(source, DateTime.Now, null); types.GetProperty("Update_time", flag)?.SetValue(source, DateTime.Now, null); + types.GetProperty("UpdatedTime", flag)?.SetValue(source, DateTime.Now, null); types.GetProperty("UpdateBy", flag)?.SetValue(source, context.GetName(), null); types.GetProperty("Update_by", flag)?.SetValue(source, context.GetName(), null); + types.GetProperty("UpdatedBy", flag)?.SetValue(source, context.GetName(), null); return source; } diff --git a/ZR.Admin.WebApi/Filters/GlobalActionMonitor.cs b/ZR.Admin.WebApi/Filters/GlobalActionMonitor.cs index a4c00fa6..5c3aebb4 100644 --- a/ZR.Admin.WebApi/Filters/GlobalActionMonitor.cs +++ b/ZR.Admin.WebApi/Filters/GlobalActionMonitor.cs @@ -33,16 +33,19 @@ namespace ZR.Admin.WebApi.Filters response.Code = (int)ResultCode.PARAM_ERROR; var values = context.ModelState.Values; + //todo 在干啥??? foreach (var item in values) { foreach (var err in item.Errors) { if (err.ErrorMessage.Contains("JSON")) { + //放行 return next(); } if (!string.IsNullOrEmpty(response.Msg)) { + //The code field is required. | response.Msg += " | "; } diff --git a/ZR.Model/mes/md/DTO/MdProductDefineDTO.cs b/ZR.Model/mes/md/DTO/MdProductDefineDTO.cs new file mode 100644 index 00000000..e64dd107 --- /dev/null +++ b/ZR.Model/mes/md/DTO/MdProductDefineDTO.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ZR.Model.mes.md.DTO +{ + public class MdProductDefineDTO + { + public List list { set; get; } + public int Total { set; get; } + } +} diff --git a/ZR.Model/mes/md/DTO/MdUnitPageDTO.cs b/ZR.Model/mes/md/DTO/MdUnitPageDTO.cs new file mode 100644 index 00000000..e967f841 --- /dev/null +++ b/ZR.Model/mes/md/DTO/MdUnitPageDTO.cs @@ -0,0 +1,7 @@ +namespace ZR.Model.mes.md.DTO; + +public class MdUnitPageDTO +{ + public List list { set; get; } + public int Total { set; get; } +} \ No newline at end of file diff --git a/ZR.Model/mes/md/DTO/SearchOptionDTO.cs b/ZR.Model/mes/md/DTO/SearchOptionDTO.cs new file mode 100644 index 00000000..8b1b9f13 --- /dev/null +++ b/ZR.Model/mes/md/DTO/SearchOptionDTO.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ZR.Model.mes.md.DTO +{ + public class SearchOptionDTO + { + public DateTime starttime { get; set; } + public DateTime endtime { get; set; } + + public string measureCode { get; set; } + public string measureName { get; set; } + public string enableFlag { get; set; } + + } +} diff --git a/ZR.Model/mes/md/DTO/UnitPageDTO.cs b/ZR.Model/mes/md/DTO/UnitPageDTO.cs deleted file mode 100644 index 5d76c703..00000000 --- a/ZR.Model/mes/md/DTO/UnitPageDTO.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace ZR.Model.mes.md.DTO; - -public class UnitPageDTO -{ - public List list; - public int Total; -} \ No newline at end of file diff --git a/ZR.Model/mes/md/MdBom.cs b/ZR.Model/mes/md/MdBom.cs new file mode 100644 index 00000000..148b4c02 --- /dev/null +++ b/ZR.Model/mes/md/MdBom.cs @@ -0,0 +1,99 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using SqlSugar; +namespace ZR.Model.mes.md +{ + /// + /// 物料清单 + /// + [SugarTable("md_bom")] + public class MdBom + { + /// + /// 流水号 + /// + [SugarColumn(ColumnName="id" ,IsPrimaryKey = true ,IsIdentity = true )] + public int Id { get; set; } + /// + /// 父产品名称id + /// + [SugarColumn(ColumnName="parent_id" )] + public int? ParentId { get; set; } + /// + /// 父产品名称code + /// + [SugarColumn(ColumnName="parent_code" )] + public string ParentCode { get; set; } + /// + /// 父产品名称name + /// + [SugarColumn(ColumnName="parent_name" )] + public string ParentName { get; set; } + /// + /// 子项物料编号 + /// + [SugarColumn(ColumnName="material_code" )] + public string MaterialCode { get; set; } + /// + /// 子项物料名称 + /// + [SugarColumn(ColumnName="material_name" )] + public string MaterialName { get; set; } + /// + /// 类型(产品,物料) + /// + [SugarColumn(ColumnName="material_type" )] + public string MaterialType { get; set; } + /// + /// 安全库存 + /// + [SugarColumn(ColumnName="safety_stock" )] + public int? SafetyStock { get; set; } + /// + /// 位置 + /// + [SugarColumn(ColumnName="material_position" )] + public string MaterialPosition { get; set; } + /// + /// 需求数量 + /// + [SugarColumn(ColumnName="requireNum" )] + public int? RequireNum { get; set; } + /// + /// 子项单位id + /// + [SugarColumn(ColumnName="unit_id" )] + public int? UnitId { get; set; } + /// + /// 租户号 + /// + [SugarColumn(ColumnName="TENANT_ID" )] + public string TenantId { get; set; } + /// + /// 乐观锁 + /// + [SugarColumn(ColumnName="REVISION" )] + public int? Revision { get; set; } + /// + /// 创建人 + /// + [SugarColumn(ColumnName="CREATED_BY" )] + public string CreatedBy { get; set; } + /// + /// 创建时间 + /// + [SugarColumn(ColumnName="CREATED_TIME" )] + public DateTime? CreatedTime { get; set; } + /// + /// 更新人 + /// + [SugarColumn(ColumnName="UPDATED_BY" )] + public string UpdatedBy { get; set; } + /// + /// 更新时间 + /// + [SugarColumn(ColumnName="UPDATED_TIME" )] + public DateTime? UpdatedTime { get; set; } + } +} diff --git a/ZR.Model/mes/md/MdDevice.cs b/ZR.Model/mes/md/MdDevice.cs new file mode 100644 index 00000000..6f3476d3 --- /dev/null +++ b/ZR.Model/mes/md/MdDevice.cs @@ -0,0 +1,64 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using SqlSugar; +namespace ZR.Model.mes.md +{ + /// + /// 设备 + /// + [SugarTable("md_device")] + public class MdDevice + { + /// + /// 流水号 + /// + [SugarColumn(ColumnName="id" ,IsPrimaryKey = true ,IsIdentity = true )] + public int Id { get; set; } + /// + /// 设备编号 + /// + [SugarColumn(ColumnName="device_code" )] + public string DeviceCode { get; set; } + /// + /// 设备名称 + /// + [SugarColumn(ColumnName="device_name" )] + public string DeviceName { get; set; } + /// + /// 设备所属工位id + /// + [SugarColumn(ColumnName="fk_workstation_id" )] + public int? FkWorkstationId { get; set; } + /// + /// 租户号 + /// + [SugarColumn(ColumnName="TENANT_ID" )] + public string TenantId { get; set; } + /// + /// 乐观锁 + /// + [SugarColumn(ColumnName="REVISION" )] + public int? Revision { get; set; } + /// + /// 创建人 + /// + [SugarColumn(ColumnName="CREATED_BY" )] + public string CreatedBy { get; set; } + /// + /// 创建时间 + /// + [SugarColumn(ColumnName="CREATED_TIME" )] + public DateTime? CreatedTime { get; set; } + /// + /// 更新人 + /// + [SugarColumn(ColumnName="UPDATED_BY" )] + public string UpdatedBy { get; set; } + /// + /// 更新时间 + /// + [SugarColumn(ColumnName="UPDATED_TIME" )] + public DateTime? UpdatedTime { get; set; } + } +} diff --git a/ZR.Model/mes/md/MdPallet.cs b/ZR.Model/mes/md/MdPallet.cs new file mode 100644 index 00000000..a78b9534 --- /dev/null +++ b/ZR.Model/mes/md/MdPallet.cs @@ -0,0 +1,64 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using SqlSugar; +namespace ZR.Model.mes.md +{ + /// + /// 托盘 + /// + [SugarTable("md_pallet")] + public class MdPallet + { + /// + /// 租户号 + /// + [SugarColumn(ColumnName="TENANT_ID" )] + public string TenantId { get; set; } + /// + /// 乐观锁 + /// + [SugarColumn(ColumnName="REVISION" )] + public int? Revision { get; set; } + /// + /// 创建人 + /// + [SugarColumn(ColumnName="CREATED_BY" )] + public string CreatedBy { get; set; } + /// + /// 创建时间 + /// + [SugarColumn(ColumnName="CREATED_TIME" )] + public DateTime? CreatedTime { get; set; } + /// + /// 更新人 + /// + [SugarColumn(ColumnName="UPDATED_BY" )] + public string UpdatedBy { get; set; } + /// + /// 更新时间 + /// + [SugarColumn(ColumnName="UPDATED_TIME" )] + public DateTime? UpdatedTime { get; set; } + /// + /// 流水号 + /// + [SugarColumn(ColumnName="id" ,IsPrimaryKey = true ,IsIdentity = true )] + public int Id { get; set; } + /// + /// 托盘code + /// + [SugarColumn(ColumnName="pallet_code" )] + public string PalletCode { get; set; } + /// + /// 托盘name + /// + [SugarColumn(ColumnName="pallet_name" )] + public string PalletName { get; set; } + /// + /// fk_线体id + /// + [SugarColumn(ColumnName="fk_workline_id" )] + public int? FkWorklineId { get; set; } + } +} diff --git a/ZR.Model/mes/md/MdProductDefine.cs b/ZR.Model/mes/md/MdProductDefine.cs new file mode 100644 index 00000000..410f6ba2 --- /dev/null +++ b/ZR.Model/mes/md/MdProductDefine.cs @@ -0,0 +1,91 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using SqlSugar; +namespace ZR.Model.mes.md +{ + /// + /// 产品定义 + /// + [SugarTable("md_product_define")] + public class MdProductDefine + { + /// + /// 流水号 + /// + [SugarColumn(ColumnName="id" ,IsPrimaryKey = true ,IsIdentity = true )] + public int Id { get; set; } + /// + /// 产品编号 + /// + [SugarColumn(ColumnName="product_code" )] + public string ProductCode { get; set; } + /// + /// 产品名称 + /// + [SugarColumn(ColumnName="product_name" )] + public string ProductName { get; set; } + /// + /// 单位id + /// + [SugarColumn(ColumnName="product_unit" )] + public int? ProductUnit { get; set; } + public string ProductUnitName { get; set; } + + /// + /// 工艺路线code + /// + [SugarColumn(ColumnName="processRoute_code" )] + public string ProcessrouteCode { get; set; } + /// + /// 工艺路线 + /// + [SugarColumn(ColumnName="processRoute_name" )] + public string ProcessrouteName { get; set; } + /// + /// 预留字段1 + /// + [SugarColumn(ColumnName="attre1" )] + public string Attre1 { get; set; } + /// + /// 预留字段2 + /// + [SugarColumn(ColumnName="attre2" )] + public string Attre2 { get; set; } + /// + /// 预留字段3 + /// + [SugarColumn(ColumnName="attre3" )] + public string Attre3 { get; set; } + /// + /// 租户号 + /// + [SugarColumn(ColumnName="TENANT_ID" )] + public string TenantId { get; set; } + /// + /// 乐观锁 + /// + [SugarColumn(ColumnName="REVISION" )] + public int? Revision { get; set; } + /// + /// 创建人 + /// + [SugarColumn(ColumnName="CREATED_BY" )] + public string CreatedBy { get; set; } + /// + /// 创建时间 + /// + [SugarColumn(ColumnName="CREATED_TIME" )] + public DateTime? CreatedTime { get; set; } + /// + /// 更新人 + /// + [SugarColumn(ColumnName="UPDATED_BY" )] + public string UpdatedBy { get; set; } + /// + /// 更新时间 + /// + [SugarColumn(ColumnName="UPDATED_TIME" )] + public DateTime? UpdatedTime { get; set; } + } +} diff --git a/ZR.Model/mes/md/MdProrouteSort.cs b/ZR.Model/mes/md/MdProrouteSort.cs new file mode 100644 index 00000000..c66a63eb --- /dev/null +++ b/ZR.Model/mes/md/MdProrouteSort.cs @@ -0,0 +1,64 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using SqlSugar; +namespace ZR.Model.mes.md +{ + /// + /// 工艺组成表 + /// + [SugarTable("md_proroute_sort")] + public class MdProrouteSort + { + /// + /// 流水号 + /// + [SugarColumn(ColumnName="id" ,IsPrimaryKey = true ,IsIdentity = true )] + public int Id { get; set; } + /// + /// 工艺路线id + /// + [SugarColumn(ColumnName="fk_proroute_id" )] + public int? FkProrouteId { get; set; } + /// + /// 工序 + /// + [SugarColumn(ColumnName="fk_worksort_id" )] + public int? FkWorksortId { get; set; } + /// + /// 排序 + /// + [SugarColumn(ColumnName="sort" )] + public int? Sort { get; set; } + /// + /// 租户号 + /// + [SugarColumn(ColumnName="TENANT_ID" )] + public string TenantId { get; set; } + /// + /// 乐观锁 + /// + [SugarColumn(ColumnName="REVISION" )] + public int? Revision { get; set; } + /// + /// 创建人 + /// + [SugarColumn(ColumnName="CREATED_BY" )] + public string CreatedBy { get; set; } + /// + /// 创建时间 + /// + [SugarColumn(ColumnName="CREATED_TIME" )] + public DateTime? CreatedTime { get; set; } + /// + /// 更新人 + /// + [SugarColumn(ColumnName="UPDATED_BY" )] + public string UpdatedBy { get; set; } + /// + /// 更新时间 + /// + [SugarColumn(ColumnName="UPDATED_TIME" )] + public DateTime? UpdatedTime { get; set; } + } +} diff --git a/ZR.Model/mes/md/MdTechnologicalProroute.cs b/ZR.Model/mes/md/MdTechnologicalProroute.cs new file mode 100644 index 00000000..32076c9c --- /dev/null +++ b/ZR.Model/mes/md/MdTechnologicalProroute.cs @@ -0,0 +1,59 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using SqlSugar; +namespace ZR.Model.mes.md +{ + /// + /// 工艺路线 + /// + [SugarTable("md_technological_proroute")] + public class MdTechnologicalProroute + { + /// + /// 流水号 + /// + [SugarColumn(ColumnName="id" ,IsPrimaryKey = true ,IsIdentity = true )] + public int Id { get; set; } + /// + /// 工艺流程code + /// + [SugarColumn(ColumnName="proroute_code" )] + public string ProrouteCode { get; set; } + /// + /// 工艺流程name + /// + [SugarColumn(ColumnName="proroute_name" )] + public string ProrouteName { get; set; } + /// + /// 租户号 + /// + [SugarColumn(ColumnName="TENANT_ID" )] + public string TenantId { get; set; } + /// + /// 乐观锁 + /// + [SugarColumn(ColumnName="REVISION" )] + public int? Revision { get; set; } + /// + /// 创建人 + /// + [SugarColumn(ColumnName="CREATED_BY" )] + public string CreatedBy { get; set; } + /// + /// 创建时间 + /// + [SugarColumn(ColumnName="CREATED_TIME" )] + public DateTime? CreatedTime { get; set; } + /// + /// 更新人 + /// + [SugarColumn(ColumnName="UPDATED_BY" )] + public string UpdatedBy { get; set; } + /// + /// 更新时间 + /// + [SugarColumn(ColumnName="UPDATED_TIME" )] + public DateTime? UpdatedTime { get; set; } + } +} diff --git a/ZR.Model/mes/md/Unit.cs b/ZR.Model/mes/md/MdUnit.cs similarity index 94% rename from ZR.Model/mes/md/Unit.cs rename to ZR.Model/mes/md/MdUnit.cs index bf1bdfad..9c671888 100644 --- a/ZR.Model/mes/md/Unit.cs +++ b/ZR.Model/mes/md/MdUnit.cs @@ -4,7 +4,7 @@ /// 计量单位 /// [SugarTable("md_unit")] - public class Unit + public class MdUnit { /// /// 单位ID @@ -95,6 +95,11 @@ /// [SugarColumn(ColumnName = "UPDATED_TIME")] public DateTime? UpdatedTime { get; set; } - } + + public bool Contains() + { + throw new NotImplementedException(); + } + } } diff --git a/ZR.Model/mes/md/MdWorkline.cs b/ZR.Model/mes/md/MdWorkline.cs new file mode 100644 index 00000000..245cc96d --- /dev/null +++ b/ZR.Model/mes/md/MdWorkline.cs @@ -0,0 +1,64 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using SqlSugar; +namespace ZR.Model.mes.md +{ + /// + /// 线体 + /// + [SugarTable("md_workline")] + public class MdWorkline + { + /// + /// 流水号 + /// + [SugarColumn(ColumnName="id" ,IsPrimaryKey = true ,IsIdentity = true )] + public int Id { get; set; } + /// + /// 线体code + /// + [SugarColumn(ColumnName="line_code" )] + public string LineCode { get; set; } + /// + /// 线体名称 + /// + [SugarColumn(ColumnName="line_name" )] + public string LineName { get; set; } + /// + /// fk_工艺流程 + /// + [SugarColumn(ColumnName="fk_tech_process_id" )] + public int? FkTechProcessId { get; set; } + /// + /// 租户号 + /// + [SugarColumn(ColumnName="TENANT_ID" )] + public string TenantId { get; set; } + /// + /// 乐观锁 + /// + [SugarColumn(ColumnName="REVISION" )] + public int? Revision { get; set; } + /// + /// 创建人 + /// + [SugarColumn(ColumnName="CREATED_BY" )] + public string CreatedBy { get; set; } + /// + /// 创建时间 + /// + [SugarColumn(ColumnName="CREATED_TIME" )] + public DateTime? CreatedTime { get; set; } + /// + /// 更新人 + /// + [SugarColumn(ColumnName="UPDATED_BY" )] + public string UpdatedBy { get; set; } + /// + /// 更新时间 + /// + [SugarColumn(ColumnName="UPDATED_TIME" )] + public DateTime? UpdatedTime { get; set; } + } +} diff --git a/ZR.Model/mes/md/MdWorkshop.cs b/ZR.Model/mes/md/MdWorkshop.cs new file mode 100644 index 00000000..0606e760 --- /dev/null +++ b/ZR.Model/mes/md/MdWorkshop.cs @@ -0,0 +1,64 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using SqlSugar; +namespace ZR.Model.mes.md +{ + /// + /// 车间 + /// + [SugarTable("md_workshop")] + public class MdWorkshop + { + /// + /// 流水号 + /// + [SugarColumn(ColumnName="id" ,IsPrimaryKey = true ,IsIdentity = true )] + public int Id { get; set; } + /// + /// 车间id + /// + [SugarColumn(ColumnName="workshop_id" )] + public string WorkshopId { get; set; } + /// + /// 车间名称 + /// + [SugarColumn(ColumnName="workshop_name" )] + public string WorkshopName { get; set; } + /// + /// 车间位置 + /// + [SugarColumn(ColumnName="workshop_position" )] + public string WorkshopPosition { get; set; } + /// + /// 租户号 + /// + [SugarColumn(ColumnName="TENANT_ID" )] + public string TenantId { get; set; } + /// + /// 乐观锁 + /// + [SugarColumn(ColumnName="REVISION" )] + public int? Revision { get; set; } + /// + /// 创建人 + /// + [SugarColumn(ColumnName="CREATED_BY" )] + public string CreatedBy { get; set; } + /// + /// 创建时间 + /// + [SugarColumn(ColumnName="CREATED_TIME" )] + public DateTime? CreatedTime { get; set; } + /// + /// 更新人 + /// + [SugarColumn(ColumnName="UPDATED_BY" )] + public string UpdatedBy { get; set; } + /// + /// 更新时间 + /// + [SugarColumn(ColumnName="UPDATED_TIME" )] + public DateTime? UpdatedTime { get; set; } + } +} diff --git a/ZR.Model/mes/md/MdWorksort.cs b/ZR.Model/mes/md/MdWorksort.cs new file mode 100644 index 00000000..411be885 --- /dev/null +++ b/ZR.Model/mes/md/MdWorksort.cs @@ -0,0 +1,64 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using SqlSugar; +namespace ZR.Model.mes.md +{ + /// + /// 工序 + /// + [SugarTable("md_worksort")] + public class MdWorksort + { + /// + /// 租户号 + /// + [SugarColumn(ColumnName="TENANT_ID" )] + public string TenantId { get; set; } + /// + /// 乐观锁 + /// + [SugarColumn(ColumnName="REVISION" )] + public int? Revision { get; set; } + /// + /// 创建人 + /// + [SugarColumn(ColumnName="CREATED_BY" )] + public string CreatedBy { get; set; } + /// + /// 创建时间 + /// + [SugarColumn(ColumnName="CREATED_TIME" )] + public DateTime? CreatedTime { get; set; } + /// + /// 更新人 + /// + [SugarColumn(ColumnName="UPDATED_BY" )] + public string UpdatedBy { get; set; } + /// + /// 更新时间 + /// + [SugarColumn(ColumnName="UPDATED_TIME" )] + public DateTime? UpdatedTime { get; set; } + /// + /// 流水号 + /// + [SugarColumn(ColumnName="id" ,IsPrimaryKey = true ,IsIdentity = true )] + public int Id { get; set; } + /// + /// 工序code + /// + [SugarColumn(ColumnName="worksort_code" )] + public string WorksortCode { get; set; } + /// + /// 工序名称 + /// + [SugarColumn(ColumnName="worksort_name" )] + public string WorksortName { get; set; } + /// + /// fk_线体id + /// + [SugarColumn(ColumnName="fk_workline_id" )] + public int? FkWorklineId { get; set; } + } +} diff --git a/ZR.Model/mes/md/MdWorkstation.cs b/ZR.Model/mes/md/MdWorkstation.cs new file mode 100644 index 00000000..1933d305 --- /dev/null +++ b/ZR.Model/mes/md/MdWorkstation.cs @@ -0,0 +1,64 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using SqlSugar; +namespace ZR.Model.mes.md +{ + /// + /// 工位 + /// + [SugarTable("md_workstation")] + public class MdWorkstation + { + /// + /// 流水号 + /// + [SugarColumn(ColumnName="id" ,IsPrimaryKey = true ,IsIdentity = true )] + public int Id { get; set; } + /// + /// 工位code + /// + [SugarColumn(ColumnName="station_code" )] + public string StationCode { get; set; } + /// + /// 工位name + /// + [SugarColumn(ColumnName="station_name" )] + public string StationName { get; set; } + /// + /// fk_工序id + /// + [SugarColumn(ColumnName="fk_worksort_id" )] + public int? FkWorksortId { get; set; } + /// + /// 租户号 + /// + [SugarColumn(ColumnName="TENANT_ID" )] + public string TenantId { get; set; } + /// + /// 乐观锁 + /// + [SugarColumn(ColumnName="REVISION" )] + public int? Revision { get; set; } + /// + /// 创建人 + /// + [SugarColumn(ColumnName="CREATED_BY" )] + public string CreatedBy { get; set; } + /// + /// 创建时间 + /// + [SugarColumn(ColumnName="CREATED_TIME" )] + public DateTime? CreatedTime { get; set; } + /// + /// 更新人 + /// + [SugarColumn(ColumnName="UPDATED_BY" )] + public string UpdatedBy { get; set; } + /// + /// 更新时间 + /// + [SugarColumn(ColumnName="UPDATED_TIME" )] + public DateTime? UpdatedTime { get; set; } + } +} diff --git a/ZR.Model/mes/pro/ProCallmaterial.cs b/ZR.Model/mes/pro/ProCallmaterial.cs new file mode 100644 index 00000000..47323b66 --- /dev/null +++ b/ZR.Model/mes/pro/ProCallmaterial.cs @@ -0,0 +1,104 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using SqlSugar; +namespace ZR.Model.mes.pro +{ + /// + /// 产线叫料 + /// + [SugarTable("pro_callmaterial")] + public class ProCallmaterial + { + /// + /// 编号 + /// + [SugarColumn(ColumnName="id" ,IsPrimaryKey = true )] + public int Id { get; set; } + /// + /// fk_生产任务id + /// + [SugarColumn(ColumnName="fk_task_id" )] + public int? FkTaskId { get; set; } + /// + /// 物料id + /// + [SugarColumn(ColumnName="material_id" )] + public string MaterialId { get; set; } + /// + /// 物料code + /// + [SugarColumn(ColumnName="material_code" )] + public string MaterialCode { get; set; } + /// + /// 物料名称 + /// + [SugarColumn(ColumnName="material_name" )] + public string MaterialName { get; set; } + /// + /// 叫料数量 + /// + [SugarColumn(ColumnName="call_num" )] + public decimal? CallNum { get; set; } + /// + /// 叫料时间 + /// + [SugarColumn(ColumnName="call_time" )] + public DateTime? CallTime { get; set; } + /// + /// 得到数量 + /// + [SugarColumn(ColumnName="arrive_num" )] + public decimal? ArriveNum { get; set; } + /// + /// 叫料是否成功(0,1) + /// + [SugarColumn(ColumnName="status" )] + public string Status { get; set; } + /// + /// 备用字段1 + /// + [SugarColumn(ColumnName="attr1" )] + public string Attr1 { get; set; } + /// + /// 备用字段2 + /// + [SugarColumn(ColumnName="attr2" )] + public string Attr2 { get; set; } + /// + /// 备用字段3 + /// + [SugarColumn(ColumnName="attr3" )] + public string Attr3 { get; set; } + /// + /// 租户号 + /// + [SugarColumn(ColumnName="TENANT_ID" )] + public string TenantId { get; set; } + /// + /// 乐观锁 + /// + [SugarColumn(ColumnName="REVISION" )] + public int? Revision { get; set; } + /// + /// 创建人 + /// + [SugarColumn(ColumnName="CREATED_BY" )] + public string CreatedBy { get; set; } + /// + /// 创建时间 + /// + [SugarColumn(ColumnName="CREATED_TIME" )] + public DateTime? CreatedTime { get; set; } + /// + /// 更新人 + /// + [SugarColumn(ColumnName="UPDATED_BY" )] + public string UpdatedBy { get; set; } + /// + /// 更新时间 + /// + [SugarColumn(ColumnName="UPDATED_TIME" )] + public DateTime? UpdatedTime { get; set; } + } +} diff --git a/ZR.Model/mes/pro/ProFeedback.cs b/ZR.Model/mes/pro/ProFeedback.cs new file mode 100644 index 00000000..98284ed6 --- /dev/null +++ b/ZR.Model/mes/pro/ProFeedback.cs @@ -0,0 +1,214 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using SqlSugar; +namespace ZR.Model.mes.pro +{ + /// + /// 生产报工 + /// + [SugarTable("pro_feedback")] + public class ProFeedback + { + /// + /// 主键 + /// + [SugarColumn(ColumnName="record_id" ,IsPrimaryKey = true )] + public int RecordId { get; set; } + /// + /// 报工类型(统一报工,自行报工) + /// + [SugarColumn(ColumnName="feedback_type" )] + public string FeedbackType { get; set; } + /// + /// 报工单编号 + /// + [SugarColumn(ColumnName="feedback_code" )] + public string FeedbackCode { get; set; } + /// + /// 工单id + /// + [SugarColumn(ColumnName="workorder_id" )] + public int? WorkorderId { get; set; } + /// + /// 工单code + /// + [SugarColumn(ColumnName="workorder_code" )] + public string WorkorderCode { get; set; } + /// + /// 工单name + /// + [SugarColumn(ColumnName="workorder_name" )] + public string WorkorderName { get; set; } + /// + /// 工序id + /// + [SugarColumn(ColumnName="process_id" )] + public int? ProcessId { get; set; } + /// + /// 工序code + /// + [SugarColumn(ColumnName="process_code" )] + public string ProcessCode { get; set; } + /// + /// 工序name + /// + [SugarColumn(ColumnName="process_name" )] + public string ProcessName { get; set; } + /// + /// 工作站id + /// + [SugarColumn(ColumnName="workstation_id" )] + public int? WorkstationId { get; set; } + /// + /// 工作站code + /// + [SugarColumn(ColumnName="workstation_code" )] + public string WorkstationCode { get; set; } + /// + /// 工作站name + /// + [SugarColumn(ColumnName="workstation_name" )] + public string WorkstationName { get; set; } + /// + /// 生产任务ID + /// + [SugarColumn(ColumnName="task_id" )] + public string TaskId { get; set; } + /// + /// 生产任务code + /// + [SugarColumn(ColumnName="task_code" )] + public string TaskCode { get; set; } + /// + /// 产品物料ID + /// + [SugarColumn(ColumnName="item_id" )] + public string ItemId { get; set; } + /// + /// 产品物料code + /// + [SugarColumn(ColumnName="item_code" )] + public string ItemCode { get; set; } + /// + /// 产品物料name + /// + [SugarColumn(ColumnName="item_name" )] + public string ItemName { get; set; } + /// + /// 单位 + /// + [SugarColumn(ColumnName="unit" )] + public string Unit { get; set; } + /// + /// 排产数量 + /// + [SugarColumn(ColumnName="quantity" )] + public string Quantity { get; set; } + /// + /// 本次报工数量 + /// + [SugarColumn(ColumnName="quantity_feedback" )] + public string QuantityFeedback { get; set; } + /// + /// 合格数量 + /// + [SugarColumn(ColumnName="quantity_qualified" )] + public string QuantityQualified { get; set; } + /// + /// 不合格数量 + /// + [SugarColumn(ColumnName="quantity_unquanlified" )] + public string QuantityUnquanlified { get; set; } + /// + /// 报工人姓名 + /// + [SugarColumn(ColumnName="user_name" )] + public string UserName { get; set; } + /// + /// 昵称 + /// + [SugarColumn(ColumnName="nick_name" )] + public string NickName { get; set; } + /// + /// 报工途径 + /// + [SugarColumn(ColumnName="feedback_channel" )] + public string FeedbackChannel { get; set; } + /// + /// 报工时间 + /// + [SugarColumn(ColumnName="feedback_time" )] + public string FeedbackTime { get; set; } + /// + /// 记录人名称 + /// + [SugarColumn(ColumnName="record_user" )] + public string RecordUser { get; set; } + /// + /// 昵称 + /// + [SugarColumn(ColumnName="record_nick" )] + public string RecordNick { get; set; } + /// + /// 状态 + /// + [SugarColumn(ColumnName="status" )] + public string Status { get; set; } + /// + /// 备注 + /// + [SugarColumn(ColumnName="remark" )] + public string Remark { get; set; } + /// + /// 预留字段1 + /// + [SugarColumn(ColumnName="attr1" )] + public string Attr1 { get; set; } + /// + /// 预留字段2 + /// + [SugarColumn(ColumnName="attr2" )] + public string Attr2 { get; set; } + /// + /// 预留字段3 + /// + [SugarColumn(ColumnName="attr3" )] + public string Attr3 { get; set; } + /// + /// 预留字段4 + /// + [SugarColumn(ColumnName="attr4" )] + public string Attr4 { get; set; } + /// + /// 租户号 + /// + [SugarColumn(ColumnName="TENANT_ID" )] + public string TenantId { get; set; } + /// + /// 乐观锁 + /// + [SugarColumn(ColumnName="REVISION" )] + public int? Revision { get; set; } + /// + /// 创建人 + /// + [SugarColumn(ColumnName="CREATED_BY" )] + public string CreatedBy { get; set; } + /// + /// 创建时间 + /// + [SugarColumn(ColumnName="CREATED_TIME" )] + public DateTime? CreatedTime { get; set; } + /// + /// 更新人 + /// + [SugarColumn(ColumnName="UPDATED_BY" )] + public string UpdatedBy { get; set; } + /// + /// 更新时间 + /// + [SugarColumn(ColumnName="UPDATED_TIME" )] + public DateTime? UpdatedTime { get; set; } + } +} diff --git a/ZR.Model/mes/pro/ProWorkorder.cs b/ZR.Model/mes/pro/ProWorkorder.cs new file mode 100644 index 00000000..77c86bd0 --- /dev/null +++ b/ZR.Model/mes/pro/ProWorkorder.cs @@ -0,0 +1,184 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using SqlSugar; +namespace ZR.Model.mes.pro +{ + /// + /// 生产计划 + /// + [SugarTable("pro_workorder")] + public class ProWorkorder + { + /// + /// 计划年 + /// + [SugarColumn(ColumnName="workorder_year" ,IsPrimaryKey = true )] + public int WorkorderYear { get; set; } + /// + /// 计划月 + /// + [SugarColumn(ColumnName="workorder_month" ,IsPrimaryKey = true )] + public int WorkorderMonth { get; set; } + /// + /// 计划周 + /// + [SugarColumn(ColumnName="workorder_week" ,IsPrimaryKey = true )] + public int WorkorderWeek { get; set; } + /// + /// 工单编码/产品编码 + /// + [SugarColumn(ColumnName="workorder_code" ,IsPrimaryKey = true )] + public string WorkorderCode { get; set; } + /// + /// 工单名称/第(30)周生产计划 + /// + [SugarColumn(ColumnName="workorder_name" )] + public string WorkorderName { get; set; } + /// + /// 来源类型(1:客户订单(默认),2:生产备料) + /// + [SugarColumn(ColumnName="order_source" )] + public string OrderSource { get; set; } + /// + /// 来源单据code + /// + [SugarColumn(ColumnName="source_code" )] + public string SourceCode { get; set; } + /// + /// 班组 + /// + [SugarColumn(ColumnName="classgroup" )] + public string Classgroup { get; set; } + /// + /// 车型 + /// + [SugarColumn(ColumnName="vehicle" )] + public string Vehicle { get; set; } + /// + /// 生产产品零件号 + /// + [SugarColumn(ColumnName="product_id" )] + public string ProductId { get; set; } + /// + /// 生产产品编码 + /// + [SugarColumn(ColumnName="product_code" )] + public string ProductCode { get; set; } + /// + /// 生产产品名称 + /// + [SugarColumn(ColumnName="product_name" )] + public string ProductName { get; set; } + /// + /// 标准班产 + /// + [SugarColumn(ColumnName="standard_shift_production" )] + public string StandardShiftProduction { get; set; } + /// + /// 生产耗时 + /// + [SugarColumn(ColumnName="time_consumption" )] + public string TimeConsumption { get; set; } + /// + /// 本周装配计划数量 + /// + [SugarColumn(ColumnName="require_quantity" )] + public string RequireQuantity { get; set; } + /// + /// 单位 + /// + [SugarColumn(ColumnName="unit" )] + public string Unit { get; set; } + /// + /// 本周实际生产数量 + /// + [SugarColumn(ColumnName="quantity_produced" )] + public string QuantityProduced { get; set; } + /// + /// 数量调整 + /// + [SugarColumn(ColumnName="quantity_changed" )] + public string QuantityChanged { get; set; } + /// + /// 已排程数量 + /// + [SugarColumn(ColumnName="quantity_scheduled" )] + public string QuantityScheduled { get; set; } + /// + /// 客户id + /// + [SugarColumn(ColumnName="client_id" )] + public string ClientId { get; set; } + /// + /// 客户code + /// + [SugarColumn(ColumnName="client_code" )] + public string ClientCode { get; set; } + /// + /// 客户名称 + /// + [SugarColumn(ColumnName="client_name" )] + public string ClientName { get; set; } + /// + /// 父工单 + /// + [SugarColumn(ColumnName="parent_id" )] + public string ParentId { get; set; } + /// + /// 单据状态 + /// + [SugarColumn(ColumnName="status" )] + public string Status { get; set; } + /// + /// 备注 + /// + [SugarColumn(ColumnName="remark" )] + public string Remark { get; set; } + /// + /// 备用字段1 + /// + [SugarColumn(ColumnName="attr1" )] + public string Attr1 { get; set; } + /// + /// 备用字段2 + /// + [SugarColumn(ColumnName="attr2" )] + public string Attr2 { get; set; } + /// + /// 备用字段3 + /// + [SugarColumn(ColumnName="attr3" )] + public string Attr3 { get; set; } + /// + /// 租户号 + /// + [SugarColumn(ColumnName="TENANT_ID" )] + public string TenantId { get; set; } + /// + /// 乐观锁 + /// + [SugarColumn(ColumnName="REVISION" )] + public int? Revision { get; set; } + /// + /// 创建人 + /// + [SugarColumn(ColumnName="CREATED_BY" )] + public string CreatedBy { get; set; } + /// + /// 创建时间 + /// + [SugarColumn(ColumnName="CREATED_TIME" )] + public DateTime? CreatedTime { get; set; } + /// + /// 更新人 + /// + [SugarColumn(ColumnName="UPDATED_BY" )] + public string UpdatedBy { get; set; } + /// + /// 更新时间 + /// + [SugarColumn(ColumnName="UPDATED_TIME" )] + public DateTime? UpdatedTime { get; set; } + } +} diff --git a/ZR.Model/mes/pro/ProWorktask.cs b/ZR.Model/mes/pro/ProWorktask.cs new file mode 100644 index 00000000..4802a80c --- /dev/null +++ b/ZR.Model/mes/pro/ProWorktask.cs @@ -0,0 +1,179 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using SqlSugar; +namespace ZR.Model.mes.pro +{ + /// + /// 生产任务 + /// + [SugarTable("pro_worktask")] + public class ProWorktask + { + /// + /// 生产任务id + /// + [SugarColumn(ColumnName="task_id" ,IsPrimaryKey = true ,IsIdentity = true )] + public int TaskId { get; set; } + /// + /// 生产任务code + /// + [SugarColumn(ColumnName="task_code" )] + public string TaskCode { get; set; } + /// + /// 生产计划ID + /// + [SugarColumn(ColumnName="workorder_id" )] + public string WorkorderId { get; set; } + /// + /// 生产计划编号 + /// + [SugarColumn(ColumnName="workorder_code" )] + public string WorkorderCode { get; set; } + /// + /// 计划名称 + /// + [SugarColumn(ColumnName="workorder_name" )] + public string WorkorderName { get; set; } + /// + /// 工序id + /// + [SugarColumn(ColumnName="process_id" )] + public int? ProcessId { get; set; } + /// + /// 工序编码 + /// + [SugarColumn(ColumnName="process_code" )] + public string ProcessCode { get; set; } + /// + /// 工序名称 + /// + [SugarColumn(ColumnName="process_name" )] + public string ProcessName { get; set; } + /// + /// 物料id + /// + [SugarColumn(ColumnName="material_id" )] + public int? MaterialId { get; set; } + /// + /// 物料编码 + /// + [SugarColumn(ColumnName="material_code" )] + public string MaterialCode { get; set; } + /// + /// 物料名称 + /// + [SugarColumn(ColumnName="material_name" )] + public string MaterialName { get; set; } + /// + /// 单位 + /// + [SugarColumn(ColumnName="unit" )] + public string Unit { get; set; } + /// + /// 排产数量 + /// + [SugarColumn(ColumnName="quantity" )] + public decimal? Quantity { get; set; } + /// + /// 已经生产数量 + /// + [SugarColumn(ColumnName="quantity_produced" )] + public decimal? QuantityProduced { get; set; } + /// + /// 合格品数量 + /// + [SugarColumn(ColumnName="quantity_quanlify" )] + public decimal? QuantityQuanlify { get; set; } + /// + /// 不良品数量 + /// + [SugarColumn(ColumnName="quantity_unquanlify" )] + public decimal? QuantityUnquanlify { get; set; } + /// + /// 开始生产时间 + /// + [SugarColumn(ColumnName="start_time" )] + public DateTime? StartTime { get; set; } + /// + /// 生产时长 + /// + [SugarColumn(ColumnName="duration" )] + public decimal? Duration { get; set; } + /// + /// 完成生产时间 + /// + [SugarColumn(ColumnName="end_time" )] + public DateTime? EndTime { get; set; } + /// + /// 甘特图显示颜色 + /// + [SugarColumn(ColumnName="color_code" )] + public string ColorCode { get; set; } + /// + /// 需求日期 + /// + [SugarColumn(ColumnName="request_date" )] + public string RequestDate { get; set; } + /// + /// 生产状态 + /// + [SugarColumn(ColumnName="status" )] + public string Status { get; set; } + /// + /// 备注 + /// + [SugarColumn(ColumnName="remark" )] + public string Remark { get; set; } + /// + /// 预留字段1 + /// + [SugarColumn(ColumnName="attr1" )] + public string Attr1 { get; set; } + /// + /// 预留字段2 + /// + [SugarColumn(ColumnName="attr2" )] + public string Attr2 { get; set; } + /// + /// 预留字段3 + /// + [SugarColumn(ColumnName="attr3" )] + public string Attr3 { get; set; } + /// + /// 预留字段4 + /// + [SugarColumn(ColumnName="attr4" )] + public string Attr4 { get; set; } + /// + /// 租户号 + /// + [SugarColumn(ColumnName="TENANT_ID" )] + public string TenantId { get; set; } + /// + /// 乐观锁 + /// + [SugarColumn(ColumnName="REVISION" )] + public int? Revision { get; set; } + /// + /// 创建人 + /// + [SugarColumn(ColumnName="CREATED_BY" )] + public string CreatedBy { get; set; } + /// + /// 创建时间 + /// + [SugarColumn(ColumnName="CREATED_TIME" )] + public DateTime? CreatedTime { get; set; } + /// + /// 更新人 + /// + [SugarColumn(ColumnName="UPDATED_BY" )] + public string UpdatedBy { get; set; } + /// + /// 更新时间 + /// + [SugarColumn(ColumnName="UPDATED_TIME" )] + public DateTime? UpdatedTime { get; set; } + } +} diff --git a/ZR.Model/mes/pro/ProductDefine.cs b/ZR.Model/mes/pro/ProductDefine.cs new file mode 100644 index 00000000..16ec5030 --- /dev/null +++ b/ZR.Model/mes/pro/ProductDefine.cs @@ -0,0 +1,91 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ZR.Model.mes.pro +{ + /// + /// 产品定义 + /// + [SugarTable("md_product_define")] + public class MdProductDefine + { + /// + /// 流水号 + /// + [SugarColumn(ColumnName = "id", IsPrimaryKey = true, IsIdentity = true)] + public int Id { get; set; } + /// + /// 产品编号 + /// + [SugarColumn(ColumnName = "product_code")] + public string ProductCode { get; set; } + /// + /// 产品名称 + /// + [SugarColumn(ColumnName = "product_name")] + public string ProductName { get; set; } + /// + /// 单位id + /// + [SugarColumn(ColumnName = "product_unit")] + public int? ProductUnit { get; set; } + /// + /// 工艺路线code + /// + [SugarColumn(ColumnName = "processRoute_code")] + public string ProcessrouteCode { get; set; } + /// + /// 工艺路线 + /// + [SugarColumn(ColumnName = "processRoute_name")] + public string ProcessrouteName { get; set; } + /// + /// 预留字段1 + /// + [SugarColumn(ColumnName = "attre1")] + public string Attre1 { get; set; } + /// + /// 预留字段2 + /// + [SugarColumn(ColumnName = "attre2")] + public string Attre2 { get; set; } + /// + /// 预留字段3 + /// + [SugarColumn(ColumnName = "attre3")] + public string Attre3 { get; set; } + /// + /// 租户号 + /// + [SugarColumn(ColumnName = "TENANT_ID")] + public string TenantId { get; set; } + /// + /// 乐观锁 + /// + [SugarColumn(ColumnName = "REVISION")] + public int? Revision { get; set; } + /// + /// 创建人 + /// + [SugarColumn(ColumnName = "CREATED_BY")] + public string CreatedBy { get; set; } + /// + /// 创建时间 + /// + [SugarColumn(ColumnName = "CREATED_TIME")] + public DateTime? CreatedTime { get; set; } + /// + /// 更新人 + /// + [SugarColumn(ColumnName = "UPDATED_BY")] + public string UpdatedBy { get; set; } + /// + /// 更新时间 + /// + [SugarColumn(ColumnName = "UPDATED_TIME")] + public DateTime? UpdatedTime { get; set; } + } +} diff --git a/ZR.Service/mes/md/IService/IMdProductDefineService.cs b/ZR.Service/mes/md/IService/IMdProductDefineService.cs new file mode 100644 index 00000000..6b044afb --- /dev/null +++ b/ZR.Service/mes/md/IService/IMdProductDefineService.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using ZR.Model.mes.md.DTO; +using ZR.Model.mes.md; + +namespace ZR.Service.mes.md.IService +{ + public interface IMdProductDefineService + { + public int deleteProductDefine(int[] ids); + public MdProductDefineDTO GetList(string name, string code, int pageNum, int pageSize); + public List GetList(SearchOptionDTO searchOption); + public MdProductDefine GetProductDefinebyPK(int measure); + List GetProductDefineList(string name); + List GetProductDefineList(); + public int InsertProductDefine(MdProductDefine jo); + public int UpdateProductDefine(MdProductDefine paramss); + } +} diff --git a/ZR.Service/mes/md/IService/IMdUnitService.cs b/ZR.Service/mes/md/IService/IMdUnitService.cs new file mode 100644 index 00000000..70ca8c2a --- /dev/null +++ b/ZR.Service/mes/md/IService/IMdUnitService.cs @@ -0,0 +1,17 @@ +using System.Collections.Generic; +using Newtonsoft.Json.Linq; +using ZR.Model.mes.md; +using ZR.Model.mes.md.DTO; + +namespace ZR.Service.mes.md.IService; + +public interface IMdUnitService +{ + public int deleteunit(int[] ids); + public MdUnitPageDTO GetList(string name, string code, int pageNum, int pageSize); + public List GetList(SearchOptionDTO searchOption); + public MdUnit GetUnitbyPK(int measure); + public int InsertUnit(MdUnit jo); + public int Updateunit(MdUnit paramss); +} + \ No newline at end of file diff --git a/ZR.Service/mes/md/IService/IUnitService.cs b/ZR.Service/mes/md/IService/IUnitService.cs deleted file mode 100644 index 6983d701..00000000 --- a/ZR.Service/mes/md/IService/IUnitService.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System.Collections.Generic; -using ZR.Model.mes.md; -using ZR.Model.mes.md.DTO; - -namespace ZR.Service.mes.md.IService; - -public interface IUnitService -{ - - public UnitPageDTO GetList(int pageNum, int pageSize); -} \ No newline at end of file diff --git a/ZR.Service/mes/md/MdProductDefineService.cs b/ZR.Service/mes/md/MdProductDefineService.cs new file mode 100644 index 00000000..2be53cf5 --- /dev/null +++ b/ZR.Service/mes/md/MdProductDefineService.cs @@ -0,0 +1,81 @@ +using Infrastructure.Attribute; +using Infrastructure.Extensions; +using JinianNet.JNTemplate; +using Microsoft.Extensions.DependencyInjection; +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Xml.Linq; +using ZR.Model.mes.md; +using ZR.Model.mes.md.DTO; +using ZR.Service.mes.md.IService; + +namespace ZR.Service.mes.md +{ + [AppService(ServiceType = typeof(IMdProductDefineService), ServiceLifetime = LifeTime.Transient)] + public class MdProductDefineService : BaseService, IMdProductDefineService + { + public int deleteProductDefine(int[] ids) + { + throw new NotImplementedException(); + } + + public MdProductDefineDTO GetList(string name, string code, int pageNum, int pageSize) + { + int totalNum = 0; + var predicate = Expressionable.Create() + .AndIF(name.IsNotEmpty(), pro => pro.ProductName.Contains(name)) + .AndIF(code.IsNotEmpty(), pro => pro.ProductCode.Contains(code)).ToExpression(); + + + List data = Context.Queryable() + .LeftJoin((pro, unit) => pro.ProductUnit == unit.MeasureId) + .Where(predicate) + .Select((pro, unit) => new MdProductDefine() + { + ProductUnitName = unit.MeasureName + }, + true).ToPageList(pageNum, pageSize, ref totalNum); + + + MdProductDefineDTO productPageDto = new MdProductDefineDTO(); + productPageDto.list = data; + productPageDto.Total = totalNum; + return productPageDto; + + } + + public List GetList(SearchOptionDTO searchOption) + { + throw new NotImplementedException(); + } + + public MdUnit GetProductDefinebyPK(int measure) + { + throw new NotImplementedException(); + } + + public List GetProductDefineList(string name) + { + return Context.Queryable().Where(it=>it.MeasureName.Contains(name)).ToList(); + } + + public List GetProductDefineList() + { + return Context.Queryable().ToList(); + } + + public int InsertProductDefine(MdUnit jo) + { + throw new NotImplementedException(); + } + + public int UpdateProductDefine(MdUnit paramss) + { + throw new NotImplementedException(); + } + } +} diff --git a/ZR.Service/mes/md/MdUnitService.cs b/ZR.Service/mes/md/MdUnitService.cs new file mode 100644 index 00000000..33cad434 --- /dev/null +++ b/ZR.Service/mes/md/MdUnitService.cs @@ -0,0 +1,74 @@ +using System.Collections.Generic; +using Infrastructure.Attribute; +using Infrastructure.Extensions; +using Newtonsoft.Json.Linq; +using SqlSugar; +using ZR.Model.mes.md; +using ZR.Model.mes.md.DTO; +using ZR.Model.System; +using ZR.Service.mes.md.IService; +using ZR.Service.System.IService; +using NotImplementedException = System.NotImplementedException; + +namespace ZR.Service.mes.md; + +/// +/// 单位 +/// +[AppService(ServiceType = typeof(IMdUnitService), ServiceLifetime = LifeTime.Transient)] +public class MdUnitService : BaseService, IMdUnitService +{ + public int deleteunit(int[] ids) + { + return Delete(ids); + } + + /// + /// 获取列表 + /// + /// + /// + /// + public MdUnitPageDTO GetList(string name,string code,int pageNum,int pageSize) + { + int totalNum = 0; + var predicate = Expressionable.Create() + .AndIF(name.IsNotEmpty(),it=>it.MeasureName.Contains(name)) + .AndIF(code.IsNotEmpty(),it=>it.MeasureCode.Contains(code)).ToExpression(); + + + List data = Context.Queryable().Where(predicate).ToPageList(pageNum, pageSize, ref totalNum); + MdUnitPageDTO unitPageDto = new MdUnitPageDTO(); + unitPageDto.list = data; + unitPageDto.Total = totalNum; + return unitPageDto ; + } + + public List GetList(SearchOptionDTO searchOption) + { + var predicate = Expressionable.Create() + .AndIF(searchOption.starttime.IsNotEmpty(), it => it.CreatedTime >= searchOption.starttime) + .AndIF(searchOption.endtime.IsNotEmpty(), it => it.CreatedTime <= searchOption.endtime) + .AndIF(searchOption.measureCode.IsNotEmpty(), it => it.MeasureCode.Contains(searchOption.measureCode)) + .AndIF(searchOption.measureName.IsNotEmpty(), it => it.MeasureCode.Contains(searchOption.measureName)) + .ToExpression(); + return Context.Queryable().Where(predicate).ToList(); + } + + /// + /// 根据主键获取单条unit + /// + /// + /// + public MdUnit GetUnitbyPK(int id) + { + return GetId(id); + } + + public int InsertUnit(MdUnit jo) + { + return Insert(jo); + } + + public int Updateunit(MdUnit jo) => Update(jo,false); +} \ No newline at end of file diff --git a/ZR.Service/mes/md/UnitService.cs b/ZR.Service/mes/md/UnitService.cs deleted file mode 100644 index e2e5f10e..00000000 --- a/ZR.Service/mes/md/UnitService.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Collections.Generic; -using Infrastructure.Attribute; -using SqlSugar; -using ZR.Model.mes.md; -using ZR.Model.mes.md.DTO; -using ZR.Model.System; -using ZR.Service.mes.md.IService; -using ZR.Service.System.IService; -using NotImplementedException = System.NotImplementedException; - -namespace ZR.Service.mes.md; - -/// -/// 文件管理 -/// -[AppService(ServiceType = typeof(IUnitService), ServiceLifetime = LifeTime.Transient)] -public class UnitService : BaseService, IUnitService -{ - /// - /// 获取列表 - /// - /// - /// - /// - public UnitPageDTO GetList(int pageNum,int pageSize) - { - int totalNum = 0; - List data = Context.Queryable().ToPageList(pageNum, pageSize, ref totalNum); - UnitPageDTO unitPageDto = new UnitPageDTO(); - unitPageDto.list = data; - unitPageDto.Total = totalNum; - return unitPageDto ; - } - - -} \ No newline at end of file diff --git a/ZR.Vue/src/api/basisManagement/productEfinition.js b/ZR.Vue/src/api/basisManagement/productEfinition.js new file mode 100644 index 00000000..55c1822a --- /dev/null +++ b/ZR.Vue/src/api/basisManagement/productEfinition.js @@ -0,0 +1,38 @@ +import request from '@/utils/request' +import { downFile } from '@/utils/request' + + +export function listproductEfinition(query) { + return request({ + url: '/mes/md/product/list', + method: 'get', + params: query + }) + } + + + //根据名称查询单条unit + export function getUnitmeasure(query) { + return request({ + url: '/mes/md/product/getUnit/'+query, + method: 'get', + + }) + } + + export function updateUnitmeasure(data) { + return request({ + url: '/mes/md/unit/updateUnit', + method: 'post', + data: data + }) + } + + export function addUnitmeasure(data) { + return request({ + url: '/mes/md/unit/addUnit', + method: 'post', + data: data, + contextType:"application/json" + }) + } diff --git a/ZR.Vue/src/api/basisManagement/unit.js b/ZR.Vue/src/api/basisManagement/unit.js index 15776cef..dda46e60 100644 --- a/ZR.Vue/src/api/basisManagement/unit.js +++ b/ZR.Vue/src/api/basisManagement/unit.js @@ -1,4 +1,5 @@ import request from '@/utils/request' +import { downFile } from '@/utils/request' // 查询单位列表 export function listUnitmeasure(query) { return request({ @@ -6,4 +7,46 @@ export function listUnitmeasure(query) { method: 'get', params: query }) - } \ No newline at end of file + } + + + //根据主键查询单条unit + export function getUnitmeasure(query) { + return request({ + url: '/mes/md/unit/getUnit/'+query, + method: 'get', + }) + } + + export function updateUnitmeasure(data) { + return request({ + url: '/mes/md/unit/updateUnit', + method: 'post', + data: data + }) + } + + export function addUnitmeasure(data) { + return request({ + url: '/mes/md/unit/addUnit', + method: 'post', + data: data, + contextType:"application/json" + }) + } + + + export function delUnitmeasure(id) { + return request({ + url: '/mes/md/unit/delUnit/'+id, + method: 'delete', + }) + } + + + // 导出单位 +export async function exportUnit(query) { + + await downFile('/mes/md/unit/exportUnit/', { ...query }) + +} diff --git a/ZR.Vue/src/main.js b/ZR.Vue/src/main.js index 27fdcfd2..4d874f35 100644 --- a/ZR.Vue/src/main.js +++ b/ZR.Vue/src/main.js @@ -73,6 +73,9 @@ Vue.use(plugins) Vue.use(Element, { size: Cookies.get('size') || 'small' // set element-ui default size }) + + + DictData.install() Vue.config.productionTip = false diff --git a/ZR.Vue/src/utils/request.js b/ZR.Vue/src/utils/request.js index 44f705ea..dbeb4e55 100644 --- a/ZR.Vue/src/utils/request.js +++ b/ZR.Vue/src/utils/request.js @@ -167,7 +167,6 @@ export async function downFile(url, params, config) { var result = patt.exec(contentDisposition) var fileName = result[1] fileName = fileName.replace(/\"/g, '') - const blob = new Blob([data]) saveAs(blob, fileName) } else { diff --git a/ZR.Vue/src/views/basisManagement/materiel.vue b/ZR.Vue/src/views/basisManagement/materiel.vue deleted file mode 100644 index e69de29b..00000000 diff --git a/ZR.Vue/src/views/basisManagement/productEfinition.vue b/ZR.Vue/src/views/basisManagement/productEfinition.vue new file mode 100644 index 00000000..feee2e4c --- /dev/null +++ b/ZR.Vue/src/views/basisManagement/productEfinition.vue @@ -0,0 +1,353 @@ + + + + + diff --git a/ZR.Vue/src/views/basisManagement/unit.vue b/ZR.Vue/src/views/basisManagement/unit.vue index 1a41d274..eedc6fee 100644 --- a/ZR.Vue/src/views/basisManagement/unit.vue +++ b/ZR.Vue/src/views/basisManagement/unit.vue @@ -1,11 +1,11 @@ @@ -59,7 +115,9 @@ import { delUnitmeasure, addUnitmeasure, updateUnitmeasure, + exportUnit, } from '@/api/basisManagement/unit.js' +import { debounce } from '@/utils' export default { name: 'unit', @@ -77,28 +135,111 @@ export default { queryParams: { pageNum: 1, pageSize: 20, + code: null, + name: null, }, - unit: { - code: '1', - name: 'name', - }, unitList: [], + //模态框名称 + title: '新增', + open: false, + exportopen: false, + dmlform: { + measureCode: '', + measureName: '', + enableFlag: '', + remark: '', + }, + rules: { + measureCode: [{ required: true, message: '单位编码不能为空', trigger: 'blur' }], + measureName: [{ required: true, message: '单位名称不能为空', trigger: 'blur' }], + enableFlag: [{ required: true, message: '是否启用不能为空', trigger: 'blur' }], + }, + ids: [], + idsName: [], + exportExcel: { + excelTime: [], + measureCode: '', + measureName: '', + enableFlag: '', + }, + + pickerOptions: { + shortcuts: [ + { + text: '最近一周', + onClick(picker) { + const end = new Date() + const start = new Date() + start.setTime(start.getTime() - 3600 * 1000 * 24 * 7) + picker.$emit('pick', [start, end]) + }, + }, + { + text: '最近一个月', + onClick(picker) { + const end = new Date() + const start = new Date() + start.setTime(start.getTime() - 3600 * 1000 * 24 * 30) + picker.$emit('pick', [start, end]) + }, + }, + { + text: '最近三个月', + onClick(picker) { + const end = new Date() + const start = new Date() + start.setTime(start.getTime() - 3600 * 1000 * 24 * 90) + picker.$emit('pick', [start, end]) + }, + }, + ], + }, } }, created() { this.getList() }, methods: { - handleQuery() {}, - resetQuery() { - this.unit.code = '' - this.unit.name = '' + handleQuery() { + this.queryParams.pageNum = 1 + this.getList() }, - handleAdd() {}, - handleUpdate() {}, - handleDelete() {}, - handleExport() {}, + resetQuery() { + this.queryParams.code = null + this.queryParams.name = null + this.queryParams.pageNum = 1 + this.getList() + }, + handleAdd() { + this.reset() + this.title = '新增' + this.open = true + }, + handleUpdate(row) { + this.reset() + this.open = true + this.title = '修改' + const measureId = row.measureId || this.ids + getUnitmeasure(measureId).then((response) => { + this.dmlform = response.data + }) + }, + handleDelete(row) { + const measureIds = row.measureId || this.ids + const idsName = row.measureName || this.idsName + this.$modal + .confirm('是否确认删除单位编号为"' + idsName + '"的数据项?') + .then(function () { + return delUnitmeasure(measureIds) + }) + .then((response) => { + this.getList() + this.$modal.msgSuccess('删除成功') + }) + .catch(() => {}) + }, + // 获取list getList() { this.loading = true @@ -108,10 +249,77 @@ export default { this.loading = false }) }, - //处理多选 - handleSelectionChange() {}, + + // 多选框选中数据 + handleSelectionChange(selection) { + this.ids = selection.map((item) => item.measureId) + this.idsName = selection.map((item) => item.measureName) + this.single = selection.length !== 1 + this.multiple = !selection.length + }, + + submitForm() { + this.$refs['dmlform'].validate((valid) => { + if (valid) { + if (this.dmlform.measureId != null || this.dmlform.measureId == '') { + updateUnitmeasure(this.dmlform).then((response) => { + if (response.data == 1) { + this.$modal.msgSuccess('修改成功') + this.open = false + this.getList() + } + }) + } else { + addUnitmeasure(this.dmlform).then((response) => { + if (response.data == 1) { + this.$modal.msgSuccess('新增成功') + this.open = false + this.getList() + } + }) + } + } + }) + }, + //取消按钮 + cancel() { + this.open = false + this.reset() + }, + // 表单重置 + reset() { + this.form = { + measureId: null, + measureCode: null, + measureName: null, + enableFlag: 'Y', + remark: null, + } + this.resetForm('dmlform') + }, + + //excel导出 + handleExcel_export() { + this.exportopen = true + }, + + async submitExcelForm() { + this.exportExcel.starttime=this.exportExcel.excelTime[0]; + this.exportExcel.endtime=this.exportExcel.excelTime[1]; + await exportUnit(this.exportExcel) + this.exportopen=false; + }, }, } - +