diff --git a/ZR.Admin.WebApi/Controllers/mes/md/UnitController.cs b/ZR.Admin.WebApi/Controllers/mes/md/UnitController.cs new file mode 100644 index 00000000..8f581d46 --- /dev/null +++ b/ZR.Admin.WebApi/Controllers/mes/md/UnitController.cs @@ -0,0 +1,22 @@ +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.Model/ZR.Model.csproj b/ZR.Model/ZR.Model.csproj index b5eba233..f34d09c6 100644 --- a/ZR.Model/ZR.Model.csproj +++ b/ZR.Model/ZR.Model.csproj @@ -12,4 +12,16 @@ + + + + + + + + + + + + diff --git a/ZR.Model/mes/md/DTO/UnitPageDTO.cs b/ZR.Model/mes/md/DTO/UnitPageDTO.cs new file mode 100644 index 00000000..5d76c703 --- /dev/null +++ b/ZR.Model/mes/md/DTO/UnitPageDTO.cs @@ -0,0 +1,7 @@ +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/Unit.cs b/ZR.Model/mes/md/Unit.cs new file mode 100644 index 00000000..bf1bdfad --- /dev/null +++ b/ZR.Model/mes/md/Unit.cs @@ -0,0 +1,100 @@ +namespace ZR.Model.mes.md +{ + /// + /// 计量单位 + /// + [SugarTable("md_unit")] + public class Unit + { + /// + /// 单位ID + /// + [SugarColumn(ColumnName = "measure_id", IsPrimaryKey = true, IsIdentity = true)] + public int MeasureId { get; set; } + + /// + /// 单位编码 + /// + [SugarColumn(ColumnName = "measure_code")] + public string MeasureCode { get; set; } + + /// + /// 单位名称 + /// + [SugarColumn(ColumnName = "measure_name")] + public string MeasureName { get; set; } + + /// + /// 是否启用(不启用0,启用1) + /// + [SugarColumn(ColumnName = "enable_flag")] + public string EnableFlag { get; set; } + + /// + /// 备注 + /// + [SugarColumn(ColumnName = "remark")] + public string Remark { get; set; } + + /// + /// 预留字段 + /// + [SugarColumn(ColumnName = "attr1")] + public string Attr1 { get; set; } + + /// + /// 预留字段 + /// + [SugarColumn(ColumnName = "attr2")] + public string Attr2 { get; set; } + + /// + /// 预留字段 + /// + [SugarColumn(ColumnName = "attr3")] + public int? Attr3 { get; set; } + + /// + /// 预留字段 + /// + [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.Service/mes/md/IService/IUnitService.cs b/ZR.Service/mes/md/IService/IUnitService.cs new file mode 100644 index 00000000..6983d701 --- /dev/null +++ b/ZR.Service/mes/md/IService/IUnitService.cs @@ -0,0 +1,11 @@ +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/UnitService.cs b/ZR.Service/mes/md/UnitService.cs new file mode 100644 index 00000000..e2e5f10e --- /dev/null +++ b/ZR.Service/mes/md/UnitService.cs @@ -0,0 +1,36 @@ +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/.env.production b/ZR.Vue/.env.production index 9a8657a9..43309609 100644 --- a/ZR.Vue/.env.production +++ b/ZR.Vue/.env.production @@ -2,7 +2,7 @@ ENV = 'production' # 页面标题 -VUE_APP_TITLE = 'ZrAdmin.NET后台管理' +VUE_APP_TITLE = '上海干巷MES' # 生产环境 VUE_APP_BASE_API = '/prod-api' diff --git a/ZR.Vue/src/main.js b/ZR.Vue/src/main.js index 9f5d1d41..27fdcfd2 100644 --- a/ZR.Vue/src/main.js +++ b/ZR.Vue/src/main.js @@ -32,6 +32,8 @@ import DictTag from '@/components/DictTag' import UploadImage from '@/components/UploadImage/index'; // 上传文件 import UploadFile from '@/components/FileUpload/index'; +// 字典数据组件 +import DictData from '@/components/DictData' // 全局方法挂载 Vue.prototype.getDicts = getDicts @@ -71,6 +73,7 @@ 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/ruoyi.js b/ZR.Vue/src/utils/ruoyi.js index 3d570c24..1b85a090 100644 --- a/ZR.Vue/src/utils/ruoyi.js +++ b/ZR.Vue/src/utils/ruoyi.js @@ -231,4 +231,20 @@ export async function blobValidate(data) { } catch (error) { return true; } -} \ No newline at end of file +} + +// 数据合并 +export function mergeRecursive(source, target) { + for (var p in target) { + try { + if (target[p].constructor == Object) { + source[p] = mergeRecursive(source[p], target[p]); + } else { + source[p] = target[p]; + } + } catch (e) { + source[p] = target[p]; + } + } + return source; +}; \ No newline at end of file diff --git a/ZR.Vue/src/views/basisManagement/unit.vue b/ZR.Vue/src/views/basisManagement/unit.vue index c9ebd4dc..e508133a 100644 --- a/ZR.Vue/src/views/basisManagement/unit.vue +++ b/ZR.Vue/src/views/basisManagement/unit.vue @@ -1,15 +1,117 @@ - \ No newline at end of file +