From b3a84d0eda990c2d8f7ea67cf3abc0e335467d6f Mon Sep 17 00:00:00 2001 From: ccongli <1441652193@qq.com> Date: Fri, 8 Sep 2023 11:05:18 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8E=E5=8F=B0=E7=AE=A1=E7=90=86=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E5=BC=80=E5=8F=91v1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .vs/slnx.sqlite | Bin 0 -> 106496 bytes .../IData_ConfigRepository.cs} | 4 +- .../machine/IData_MachineRepository.cs | 18 ++ .../IData_ProduceRepository.cs | 0 .../IData_ConfigService.cs} | 2 +- .../Partial/IData_ConfigService.cs} | 4 +- .../IServices/machine/IData_MachineService.cs | 12 + .../machine/Partial/IData_MachineService.cs | 13 + .../IServices/modbus/IDataProcessing.cs | 15 +- .../{data => produce}/IData_ProduceService.cs | 0 .../Partial/IData_ProduceService.cs | 0 .../Data_ConfigRepository.cs} | 10 +- .../machine/Data_MachineRepository.cs | 24 ++ .../Data_ProduceRepository.cs | 0 .../Services/config/Data_ConfigService.cs | 27 +++ .../Partial/Data_ConfigService.cs} | 24 +- .../Services/data/Data_DeviceService.cs | 27 --- .../Services/machine/Data_MachineService.cs | 27 +++ .../machine/Partial/Data_MachineService.cs | 41 ++++ .../Services/modbus/DataProcessing.cs | 126 ++++++++-- .../{data => produce}/Data_ProduceService.cs | 0 .../Partial/Data_ProduceService.cs | 0 .../Data_Device.cs => config/Data_Config.cs} | 55 ++--- .../partial/Data_Config.cs} | 2 +- .../DomainModels/machine/Data_Machine.cs | 225 ++++++++++++++++++ .../machine/partial/Data_Machine.cs | 21 ++ .../{data => produce}/Data_Produce.cs | 98 +++++++- .../{data => produce}/partial/Data_Produce.cs | 0 .../Data_ConfigMapConfig.cs} | 4 +- .../machine/Data_MachineMapConfig.cs | 16 ++ .../Data_ProduceMapConfig.cs | 0 .../Controllers/Data/DataCaptureController.cs | 17 +- .../Controllers/Data/DataTestController.cs | 79 +++--- .../Controllers/Data/Data_ConfigController.cs | 21 ++ .../Controllers/Data/Data_DeviceController.cs | 24 -- .../Data/Data_MachineController.cs | 21 ++ ...Controller.cs => Data_ConfigController.cs} | 11 +- .../Data/Partial/Data_MachineController.cs | 33 +++ vol-vue3/src/components/basic/VolTable.vue | 1 - .../Data_Device.js => config/Data_Config.js} | 0 .../extension/data/machine/Data_Machine.js | 164 +++++++++++++ .../extension/data/produce/Data_Produce.js | 112 +++++++-- vol-vue3/src/router/viewGird.js | 15 +- .../src/views/data/config/Data_Config.vue | 69 ++++++ .../src/views/data/device/Data_Device.vue | 71 ------ .../src/views/data/machine/Data_Machine.vue | 95 ++++++++ .../src/views/data/produce/Data_Produce.vue | 52 ++-- 47 files changed, 1280 insertions(+), 300 deletions(-) create mode 100644 .vs/slnx.sqlite rename vol-net6/VOL.Data/IRepositories/{data/IData_DeviceRepository.cs => config/IData_ConfigRepository.cs} (73%) create mode 100644 vol-net6/VOL.Data/IRepositories/machine/IData_MachineRepository.cs rename vol-net6/VOL.Data/IRepositories/{data => produce}/IData_ProduceRepository.cs (100%) rename vol-net6/VOL.Data/IServices/{data/IData_DeviceService.cs => config/IData_ConfigService.cs} (72%) rename vol-net6/VOL.Data/IServices/{data/Partial/IData_DeviceService.cs => config/Partial/IData_ConfigService.cs} (60%) create mode 100644 vol-net6/VOL.Data/IServices/machine/IData_MachineService.cs create mode 100644 vol-net6/VOL.Data/IServices/machine/Partial/IData_MachineService.cs rename vol-net6/VOL.Data/IServices/{data => produce}/IData_ProduceService.cs (100%) rename vol-net6/VOL.Data/IServices/{data => produce}/Partial/IData_ProduceService.cs (100%) rename vol-net6/VOL.Data/Repositories/{data/Data_DeviceRepository.cs => config/Data_ConfigRepository.cs} (53%) create mode 100644 vol-net6/VOL.Data/Repositories/machine/Data_MachineRepository.cs rename vol-net6/VOL.Data/Repositories/{data => produce}/Data_ProduceRepository.cs (100%) create mode 100644 vol-net6/VOL.Data/Services/config/Data_ConfigService.cs rename vol-net6/VOL.Data/Services/{data/Partial/Data_DeviceService.cs => config/Partial/Data_ConfigService.cs} (58%) delete mode 100644 vol-net6/VOL.Data/Services/data/Data_DeviceService.cs create mode 100644 vol-net6/VOL.Data/Services/machine/Data_MachineService.cs create mode 100644 vol-net6/VOL.Data/Services/machine/Partial/Data_MachineService.cs rename vol-net6/VOL.Data/Services/{data => produce}/Data_ProduceService.cs (100%) rename vol-net6/VOL.Data/Services/{data => produce}/Partial/Data_ProduceService.cs (100%) rename vol-net6/VOL.Entity/DomainModels/{data/Data_Device.cs => config/Data_Config.cs} (66%) rename vol-net6/VOL.Entity/DomainModels/{data/partial/Data_Device.cs => config/partial/Data_Config.cs} (94%) create mode 100644 vol-net6/VOL.Entity/DomainModels/machine/Data_Machine.cs create mode 100644 vol-net6/VOL.Entity/DomainModels/machine/partial/Data_Machine.cs rename vol-net6/VOL.Entity/DomainModels/{data => produce}/Data_Produce.cs (54%) rename vol-net6/VOL.Entity/DomainModels/{data => produce}/partial/Data_Produce.cs (100%) rename vol-net6/VOL.Entity/MappingConfiguration/{data/Data_DeviceMapConfig.cs => config/Data_ConfigMapConfig.cs} (66%) create mode 100644 vol-net6/VOL.Entity/MappingConfiguration/machine/Data_MachineMapConfig.cs rename vol-net6/VOL.Entity/MappingConfiguration/{data => produce}/Data_ProduceMapConfig.cs (100%) create mode 100644 vol-net6/VOL.WebApi/Controllers/Data/Data_ConfigController.cs delete mode 100644 vol-net6/VOL.WebApi/Controllers/Data/Data_DeviceController.cs create mode 100644 vol-net6/VOL.WebApi/Controllers/Data/Data_MachineController.cs rename vol-net6/VOL.WebApi/Controllers/Data/Partial/{Data_DeviceController.cs => Data_ConfigController.cs} (70%) create mode 100644 vol-net6/VOL.WebApi/Controllers/Data/Partial/Data_MachineController.cs rename vol-vue3/src/extension/data/{device/Data_Device.js => config/Data_Config.js} (100%) create mode 100644 vol-vue3/src/extension/data/machine/Data_Machine.js create mode 100644 vol-vue3/src/views/data/config/Data_Config.vue delete mode 100644 vol-vue3/src/views/data/device/Data_Device.vue create mode 100644 vol-vue3/src/views/data/machine/Data_Machine.vue diff --git a/.vs/slnx.sqlite b/.vs/slnx.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..03a966c1b45ac97976e03674e4c002b93f4f8fe8 GIT binary patch literal 106496 zcmeHw34B~tz5ktk?%ZwKER&>7J59Q!ZIUKwwx(&Dz0+oEmL_coVVaq=14$-iCO}vn ziaZnr7et>=eX=|S7ZAY>H&7H5MMU(ufbgCQDvGiyiu(Wk&bjN%B$=d${(U!}_MExr z{C>al`+d*vEccvy&+R|l8HtDe6VchJVBBBDco~a@+3)u=409>`FM$8bUl#nZD;E%3 zbiWt+c_~viQsqEm>CZ^BTKY483-9F)d9GovcK^g>a~`(6-TI2P&w6kn5oY@THwd^< z)5J#6Tenx=m~U#*siwj0niHm4|aC$kfrp_M$e0c!n1mA zg@%$~CG@qmxAnDkx3u;9M-+~>>3AeQKe|;-01+h`3)I_SZz}=;Ftjwawi&Wo+dA8{ zEJYa#VE2)xzLo<`eOoK5t4maclWXCnFP)a44MsV|^%mhrmlTycCO- z+@|sIa4Z%%9+^ZFRaleBl6)|QPBU2#AU2f#`B*$Wr9zmTgi!i5?v-HK866K|`|OLJ zzpw!cQA>1kZfZJ}PVkf@$~l*B4BFKgX;(zk@!<4yc(x@telk3ksyc0D$%MSIl_h5{ zC`Z@kl6k=QQcE8#IW_1ZE$+%u(&Cc2lCL>qi%ZUi@|6~soTYCw8MHXLLeuG-;yH#E zN6KB=VNTCqlxD3rO7VAtHVUEYyh=h!`%mA<2j*v>msENxr3j_v4Me8Gv3PK5X4H?J z$3UP9dQ#}G&=X5pm#@6Ua=Ao2Q7IPXjbWf9P{llQwGMU%4iBm$k3yp|>D)`nlMRD0 zMoFP6Cv_xh?ve0p3>sQW&wn}NcKJ$5ETF}t}2ts zaKeyoblw5O8Brmb0ev~q>~#6gfu3((>-lu8P%b)^Q`i6L$X&8M@)RhUZ3$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W64yE;t>J#OKH2(Rgt2hrtwKMi$WQ=A7O{Tob80p|uQ=MivnHzMR$sz9J~sp^~2w z^a?SExh|(Ufo}%Nz(+H9&P=gVrUfBy0bS13bQy=|0pZ1t#n)gIDGD)&xdQI(@qIw~ z-fSWq4rMM!rRIh&0y$Al4!*aQxg3?68=lQ;NlYtdSyV^J2x7$rxZy}nQvzT1BM4h8 z<8!mK;puorLS$NQI0zQut9>#uGtoGRh-B!EDm6DeoEJ!(19FsAhVax(7;0*6HnX~l zYxLZ3PhMl?%nuVvwbg_%hql-zK8ZchSV+9S;jUV?;295cMHS6s))!VT}uZAjp2 zd^uxea~K}R$xI<6ah&POD4EWmK%0|3lkvo<+4(xxA?btzlR3-?*Gk#P?21eeS zEi*hSGl-AMoJBT=$ga(D9+gR!o95M6mtzngl^H`UbdSmyIk79ihZB + public partial interface IData_ConfigRepository : IDependency,IRepository { } } diff --git a/vol-net6/VOL.Data/IRepositories/machine/IData_MachineRepository.cs b/vol-net6/VOL.Data/IRepositories/machine/IData_MachineRepository.cs new file mode 100644 index 0000000..1319286 --- /dev/null +++ b/vol-net6/VOL.Data/IRepositories/machine/IData_MachineRepository.cs @@ -0,0 +1,18 @@ +/* + *代码由框架生成,任何更改都可能导致被代码生成器覆盖 + *Repository提供数据库操作,如果要增加数据库操作请在当前目录下Partial文件夹IData_MachineRepository编写接口 + */ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using VOL.Core.BaseProvider; +using VOL.Entity.DomainModels; +using VOL.Core.Extensions.AutofacManager; +namespace VOL.Data.IRepositories +{ + public partial interface IData_MachineRepository : IDependency,IRepository + { + } +} diff --git a/vol-net6/VOL.Data/IRepositories/data/IData_ProduceRepository.cs b/vol-net6/VOL.Data/IRepositories/produce/IData_ProduceRepository.cs similarity index 100% rename from vol-net6/VOL.Data/IRepositories/data/IData_ProduceRepository.cs rename to vol-net6/VOL.Data/IRepositories/produce/IData_ProduceRepository.cs diff --git a/vol-net6/VOL.Data/IServices/data/IData_DeviceService.cs b/vol-net6/VOL.Data/IServices/config/IData_ConfigService.cs similarity index 72% rename from vol-net6/VOL.Data/IServices/data/IData_DeviceService.cs rename to vol-net6/VOL.Data/IServices/config/IData_ConfigService.cs index 9b84bad..502df3e 100644 --- a/vol-net6/VOL.Data/IServices/data/IData_DeviceService.cs +++ b/vol-net6/VOL.Data/IServices/config/IData_ConfigService.cs @@ -6,7 +6,7 @@ using VOL.Entity.DomainModels; namespace VOL.Data.IServices { - public partial interface IData_DeviceService : IService + public partial interface IData_ConfigService : IService { } } diff --git a/vol-net6/VOL.Data/IServices/data/Partial/IData_DeviceService.cs b/vol-net6/VOL.Data/IServices/config/Partial/IData_ConfigService.cs similarity index 60% rename from vol-net6/VOL.Data/IServices/data/Partial/IData_DeviceService.cs rename to vol-net6/VOL.Data/IServices/config/Partial/IData_ConfigService.cs index 85d1fe6..4309979 100644 --- a/vol-net6/VOL.Data/IServices/data/Partial/IData_DeviceService.cs +++ b/vol-net6/VOL.Data/IServices/config/Partial/IData_ConfigService.cs @@ -1,5 +1,5 @@ /* -*所有关于Data_Device类的业务代码接口应在此处编写 +*所有关于Data_Config类的业务代码接口应在此处编写 */ using VOL.Core.BaseProvider; using VOL.Entity.DomainModels; @@ -7,7 +7,7 @@ using VOL.Core.Utilities; using System.Linq.Expressions; namespace VOL.Data.IServices { - public partial interface IData_DeviceService + public partial interface IData_ConfigService { } } diff --git a/vol-net6/VOL.Data/IServices/machine/IData_MachineService.cs b/vol-net6/VOL.Data/IServices/machine/IData_MachineService.cs new file mode 100644 index 0000000..2001ef7 --- /dev/null +++ b/vol-net6/VOL.Data/IServices/machine/IData_MachineService.cs @@ -0,0 +1,12 @@ +/* + *代码由框架生成,任何更改都可能导致被代码生成器覆盖 + */ +using VOL.Core.BaseProvider; +using VOL.Entity.DomainModels; + +namespace VOL.Data.IServices +{ + public partial interface IData_MachineService : IService + { + } +} diff --git a/vol-net6/VOL.Data/IServices/machine/Partial/IData_MachineService.cs b/vol-net6/VOL.Data/IServices/machine/Partial/IData_MachineService.cs new file mode 100644 index 0000000..0609559 --- /dev/null +++ b/vol-net6/VOL.Data/IServices/machine/Partial/IData_MachineService.cs @@ -0,0 +1,13 @@ +/* +*所有关于Data_Machine类的业务代码接口应在此处编写 +*/ +using VOL.Core.BaseProvider; +using VOL.Entity.DomainModels; +using VOL.Core.Utilities; +using System.Linq.Expressions; +namespace VOL.Data.IServices +{ + public partial interface IData_MachineService + { + } + } diff --git a/vol-net6/VOL.Data/IServices/modbus/IDataProcessing.cs b/vol-net6/VOL.Data/IServices/modbus/IDataProcessing.cs index 52047b2..4a3f381 100644 --- a/vol-net6/VOL.Data/IServices/modbus/IDataProcessing.cs +++ b/vol-net6/VOL.Data/IServices/modbus/IDataProcessing.cs @@ -1,6 +1,10 @@ -using System; +using OfficeOpenXml.FormulaParsing.Excel.Functions.Text; +using System; +using System.Collections; using System.Collections.Generic; using System.Linq; +using System.Net; +using System.Security.Cryptography; using System.Text; using System.Threading.Tasks; using VOL.Entity.DomainModels; @@ -9,8 +13,15 @@ namespace VOL.Data.IServices.modbus { public interface IDataProcessing { + // 读西门子数据 + Dictionary> readSiemensData(IModbusService modbus); + + // 读广数数据 + Dictionary> readGSKData(IModbusService modbus); + + // 写设备运行数据 - bool saveDeviceData(Data_Device device, out string message); + bool saveDeviceData(Data_Machine machine, out string message); // 写设备生产数据 diff --git a/vol-net6/VOL.Data/IServices/data/IData_ProduceService.cs b/vol-net6/VOL.Data/IServices/produce/IData_ProduceService.cs similarity index 100% rename from vol-net6/VOL.Data/IServices/data/IData_ProduceService.cs rename to vol-net6/VOL.Data/IServices/produce/IData_ProduceService.cs diff --git a/vol-net6/VOL.Data/IServices/data/Partial/IData_ProduceService.cs b/vol-net6/VOL.Data/IServices/produce/Partial/IData_ProduceService.cs similarity index 100% rename from vol-net6/VOL.Data/IServices/data/Partial/IData_ProduceService.cs rename to vol-net6/VOL.Data/IServices/produce/Partial/IData_ProduceService.cs diff --git a/vol-net6/VOL.Data/Repositories/data/Data_DeviceRepository.cs b/vol-net6/VOL.Data/Repositories/config/Data_ConfigRepository.cs similarity index 53% rename from vol-net6/VOL.Data/Repositories/data/Data_DeviceRepository.cs rename to vol-net6/VOL.Data/Repositories/config/Data_ConfigRepository.cs index 2f3ab54..5b56ac4 100644 --- a/vol-net6/VOL.Data/Repositories/data/Data_DeviceRepository.cs +++ b/vol-net6/VOL.Data/Repositories/config/Data_ConfigRepository.cs @@ -1,6 +1,6 @@ /* *代码由框架生成,任何更改都可能导致被代码生成器覆盖 - *Repository提供数据库操作,如果要增加数据库操作请在当前目录下Partial文件夹Data_DeviceRepository编写代码 + *Repository提供数据库操作,如果要增加数据库操作请在当前目录下Partial文件夹Data_ConfigRepository编写代码 */ using VOL.Data.IRepositories; using VOL.Core.BaseProvider; @@ -10,15 +10,15 @@ using VOL.Entity.DomainModels; namespace VOL.Data.Repositories { - public partial class Data_DeviceRepository : RepositoryBase , IData_DeviceRepository + public partial class Data_ConfigRepository : RepositoryBase , IData_ConfigRepository { - public Data_DeviceRepository(VOLContext dbContext) + public Data_ConfigRepository(VOLContext dbContext) : base(dbContext) { } - public static IData_DeviceRepository Instance + public static IData_ConfigRepository Instance { - get { return AutofacContainerModule.GetService(); } } + get { return AutofacContainerModule.GetService(); } } } } diff --git a/vol-net6/VOL.Data/Repositories/machine/Data_MachineRepository.cs b/vol-net6/VOL.Data/Repositories/machine/Data_MachineRepository.cs new file mode 100644 index 0000000..66b3cb1 --- /dev/null +++ b/vol-net6/VOL.Data/Repositories/machine/Data_MachineRepository.cs @@ -0,0 +1,24 @@ +/* + *代码由框架生成,任何更改都可能导致被代码生成器覆盖 + *Repository提供数据库操作,如果要增加数据库操作请在当前目录下Partial文件夹Data_MachineRepository编写代码 + */ +using VOL.Data.IRepositories; +using VOL.Core.BaseProvider; +using VOL.Core.EFDbContext; +using VOL.Core.Extensions.AutofacManager; +using VOL.Entity.DomainModels; + +namespace VOL.Data.Repositories +{ + public partial class Data_MachineRepository : RepositoryBase , IData_MachineRepository + { + public Data_MachineRepository(VOLContext dbContext) + : base(dbContext) + { + + } + public static IData_MachineRepository Instance + { + get { return AutofacContainerModule.GetService(); } } + } +} diff --git a/vol-net6/VOL.Data/Repositories/data/Data_ProduceRepository.cs b/vol-net6/VOL.Data/Repositories/produce/Data_ProduceRepository.cs similarity index 100% rename from vol-net6/VOL.Data/Repositories/data/Data_ProduceRepository.cs rename to vol-net6/VOL.Data/Repositories/produce/Data_ProduceRepository.cs diff --git a/vol-net6/VOL.Data/Services/config/Data_ConfigService.cs b/vol-net6/VOL.Data/Services/config/Data_ConfigService.cs new file mode 100644 index 0000000..ea08790 --- /dev/null +++ b/vol-net6/VOL.Data/Services/config/Data_ConfigService.cs @@ -0,0 +1,27 @@ +/* + *Author:jxx + *Contact:283591387@qq.com + *代码由框架生成,此处任何更改都可能导致被代码生成器覆盖 + *所有业务编写全部应在Partial文件夹下Data_ConfigService与IData_ConfigService中编写 + */ +using VOL.Data.IRepositories; +using VOL.Data.IServices; +using VOL.Core.BaseProvider; +using VOL.Core.Extensions.AutofacManager; +using VOL.Entity.DomainModels; + +namespace VOL.Data.Services +{ + public partial class Data_ConfigService : ServiceBase + , IData_ConfigService, IDependency + { + public Data_ConfigService(IData_ConfigRepository repository) + : base(repository) + { + Init(repository); + } + public static IData_ConfigService Instance + { + get { return AutofacContainerModule.GetService(); } } + } + } diff --git a/vol-net6/VOL.Data/Services/data/Partial/Data_DeviceService.cs b/vol-net6/VOL.Data/Services/config/Partial/Data_ConfigService.cs similarity index 58% rename from vol-net6/VOL.Data/Services/data/Partial/Data_DeviceService.cs rename to vol-net6/VOL.Data/Services/config/Partial/Data_ConfigService.cs index e6dc9ce..82eb28a 100644 --- a/vol-net6/VOL.Data/Services/data/Partial/Data_DeviceService.cs +++ b/vol-net6/VOL.Data/Services/config/Partial/Data_ConfigService.cs @@ -1,10 +1,10 @@ /* - *所有关于Data_Device类的业务代码应在此处编写 + *所有关于Data_Config类的业务代码应在此处编写 *可使用repository.调用常用方法,获取EF/Dapper等信息 *如果需要事务请使用repository.DbContextBeginTransaction *也可使用DBServerProvider.手动获取数据库相关信息 *用户信息、权限、角色等使用UserContext.Current操作 -*Data_DeviceService对增、删、改查、导入、导出、审核业务代码扩展参照ServiceFunFilter +*Data_ConfigService对增、删、改查、导入、导出、审核业务代码扩展参照ServiceFunFilter */ using VOL.Core.BaseProvider; using VOL.Core.Extensions.AutofacManager; @@ -20,14 +20,14 @@ using VOL.Data.IRepositories; namespace VOL.Data.Services { - public partial class Data_DeviceService + public partial class Data_ConfigService { private readonly IHttpContextAccessor _httpContextAccessor; - private readonly IData_DeviceRepository _repository;//访问数据库 + private readonly IData_ConfigRepository _repository;//访问数据库 [ActivatorUtilitiesConstructor] - public Data_DeviceService( - IData_DeviceRepository dbRepository, + public Data_ConfigService( + IData_ConfigRepository dbRepository, IHttpContextAccessor httpContextAccessor ) : base(dbRepository) @@ -35,15 +35,7 @@ namespace VOL.Data.Services _httpContextAccessor = httpContextAccessor; _repository = dbRepository; //多租户会用到这init代码,其他情况可以不用 - Init(dbRepository); + //base.Init(dbRepository); } - - //重写ServiceBase Init方法,设置IsMultiTenancy=true开启多租户功能 - protected override void Init(IRepository repository) - { - //开启多租户功能,开启后会对查询、导出、删除、编辑功能同时生效 - //如果只需要对某个功能生效,如编辑,则在重写编辑方法中设置 IsMultiTenancy = true; - IsMultiTenancy = true; - } - } + } } diff --git a/vol-net6/VOL.Data/Services/data/Data_DeviceService.cs b/vol-net6/VOL.Data/Services/data/Data_DeviceService.cs deleted file mode 100644 index 6642633..0000000 --- a/vol-net6/VOL.Data/Services/data/Data_DeviceService.cs +++ /dev/null @@ -1,27 +0,0 @@ -/* - *Author:jxx - *Contact:283591387@qq.com - *代码由框架生成,此处任何更改都可能导致被代码生成器覆盖 - *所有业务编写全部应在Partial文件夹下Data_DeviceService与IData_DeviceService中编写 - */ -using VOL.Data.IRepositories; -using VOL.Data.IServices; -using VOL.Core.BaseProvider; -using VOL.Core.Extensions.AutofacManager; -using VOL.Entity.DomainModels; - -namespace VOL.Data.Services -{ - public partial class Data_DeviceService : ServiceBase - , IData_DeviceService, IDependency - { - public Data_DeviceService(IData_DeviceRepository repository) - : base(repository) - { - Init(repository); - } - public static IData_DeviceService Instance - { - get { return AutofacContainerModule.GetService(); } } - } - } diff --git a/vol-net6/VOL.Data/Services/machine/Data_MachineService.cs b/vol-net6/VOL.Data/Services/machine/Data_MachineService.cs new file mode 100644 index 0000000..ebb507c --- /dev/null +++ b/vol-net6/VOL.Data/Services/machine/Data_MachineService.cs @@ -0,0 +1,27 @@ +/* + *Author:jxx + *Contact:283591387@qq.com + *代码由框架生成,此处任何更改都可能导致被代码生成器覆盖 + *所有业务编写全部应在Partial文件夹下Data_MachineService与IData_MachineService中编写 + */ +using VOL.Data.IRepositories; +using VOL.Data.IServices; +using VOL.Core.BaseProvider; +using VOL.Core.Extensions.AutofacManager; +using VOL.Entity.DomainModels; + +namespace VOL.Data.Services +{ + public partial class Data_MachineService : ServiceBase + , IData_MachineService, IDependency + { + public Data_MachineService(IData_MachineRepository repository) + : base(repository) + { + Init(repository); + } + public static IData_MachineService Instance + { + get { return AutofacContainerModule.GetService(); } } + } + } diff --git a/vol-net6/VOL.Data/Services/machine/Partial/Data_MachineService.cs b/vol-net6/VOL.Data/Services/machine/Partial/Data_MachineService.cs new file mode 100644 index 0000000..fbad578 --- /dev/null +++ b/vol-net6/VOL.Data/Services/machine/Partial/Data_MachineService.cs @@ -0,0 +1,41 @@ +/* + *所有关于Data_Machine类的业务代码应在此处编写 +*可使用repository.调用常用方法,获取EF/Dapper等信息 +*如果需要事务请使用repository.DbContextBeginTransaction +*也可使用DBServerProvider.手动获取数据库相关信息 +*用户信息、权限、角色等使用UserContext.Current操作 +*Data_MachineService对增、删、改查、导入、导出、审核业务代码扩展参照ServiceFunFilter +*/ +using VOL.Core.BaseProvider; +using VOL.Core.Extensions.AutofacManager; +using VOL.Entity.DomainModels; +using System.Linq; +using VOL.Core.Utilities; +using System.Linq.Expressions; +using VOL.Core.Extensions; +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.AspNetCore.Http; +using VOL.Data.IRepositories; + +namespace VOL.Data.Services +{ + public partial class Data_MachineService + { + private readonly IHttpContextAccessor _httpContextAccessor; + private readonly IData_MachineRepository _repository;//访问数据库 + + [ActivatorUtilitiesConstructor] + public Data_MachineService( + IData_MachineRepository dbRepository, + IHttpContextAccessor httpContextAccessor + ) + : base(dbRepository) + { + _httpContextAccessor = httpContextAccessor; + _repository = dbRepository; + //多租户会用到这init代码,其他情况可以不用 + //base.Init(dbRepository); + } + } +} diff --git a/vol-net6/VOL.Data/Services/modbus/DataProcessing.cs b/vol-net6/VOL.Data/Services/modbus/DataProcessing.cs index a9d4f6c..76189dd 100644 --- a/vol-net6/VOL.Data/Services/modbus/DataProcessing.cs +++ b/vol-net6/VOL.Data/Services/modbus/DataProcessing.cs @@ -16,20 +16,114 @@ namespace VOL.Data.Services.modbus _httpContextAccessor = httpContextAccessor; } - // 写设备运行数据 - public bool saveDeviceData(Data_Device device, out string message) { + + // 读西门子数据 + public Dictionary> readSiemensData(IModbusService modbus) + { + // 生产数据 + Dictionary map1 = new Dictionary + { + { "com_status", modbus.readData(1, 6430, "int16") }, // 通讯状态 5:通讯正常 15:通讯断线 + { "run_time", modbus.readData(1, 6435, "int16") }, // 运行时长 分钟 + { "turnout_1", modbus.readData(1, 6436, "int16") }, // 工单1产量 件 + { "turnout_2", modbus.readData(1, 6437, "int16") }, // 工单2产量 件 + { "turnout_3", modbus.readData(1, 6438, "int16") }, // 工单3产量 件 + { "turnout_all", modbus.readData(1, 6439, "int16") }, // 当班产量 件 + { "status", modbus.readData(1, 6440, "int16") }, // 运行状态 0:待机 1:运行 2:故障 + { "schedule_1", modbus.readData(1, 1315, "single") }, // 工单1任务进度 % + { "schedule_2", modbus.readData(1, 1317, "single") }, // 工单2任务进度 % + { "schedule_3", modbus.readData(1, 1319, "single") }, // 工单3任务进度 % + { "yield_1", modbus.readData(1, 1321, "single") }, // 工单1良品率 % 真实值 *= 100 + { "yield_2", modbus.readData(1, 1323, "single") }, // 工单2良品率 % 真实值 *= 100 + { "yield_3", modbus.readData(1, 1325, "single") }, // 工单3良品率 % 真实值 *= 100 + { "oee", modbus.readData(1, 1339, "single") }, // 设备综合效率 % 真实值 *= 100 + }; + + // 机床数据 + Dictionary map2 = new Dictionary + { + // 操作模式 0:JOG 1:AUTO 2:AUTO + TEACHIN 3:JOG + REPOIN 4:JOG + REPOS + // 5:MDA 6:MDA + REPOS 7:MDA + REPOS + TEAHIN8:MDA + TEACHIN + { "com_status", modbus.readData(1, 6430, "int16") }, // 通讯状态 5:通讯正常 15:通讯断线 + { "smode", modbus.readData(1, 6099, "int16") }, + { "state", modbus.readData(1, 6429, "int16") }, // 运行状态 0:待机 1:故障 2:运行 3:暂停 + { "temperature", modbus.readData(1, 1201, "single")}, // 电机温度 ℃ + { "potential", modbus.readData(1, 1203, "single")}, // 母线电压 V + { "current", modbus.readData(1, 1205, "single")}, // 实际电流 A + { "quantity", modbus.readData(1, 1215, "single")}, // 加工数 次 + { "cut_rate", modbus.readData(1, 1225, "single")}, // 切削倍率 + { "main_rate", modbus.readData(1, 1231, "single")}, // 主轴倍率 + { "run_program_no", modbus.readData(1, 6689, "string", 26)}, // 加工程序号 length = 52 + }; + + // 组装Map返回 + Dictionary> map = new(); + map.Add("produce", map1); + map.Add("device", map2); + return map; + } + + // 读广数数据 + public Dictionary> readGSKData(IModbusService modbus) + { + // 生产数据 + Dictionary map1 = new Dictionary + { + { "program_no", modbus.readData(1, 6429, "int16") }, // 程序编号 + { "com_status", modbus.readData(1, 6430, "int16") }, // 通讯状态 5:通讯正常 15:通讯断线 + { "run_time", modbus.readData(1, 6435, "int16") }, // 运行时长 分钟 + { "turnout_1", modbus.readData(1, 6436, "int16") }, // 工单1产量 件 + { "turnout_2", modbus.readData(1, 6437, "int16") }, // 工单2产量 件 + { "turnout_3", modbus.readData(1, 6438, "int16") }, // 工单3产量 件 + { "turnout_all", modbus.readData(1, 6439, "int16") }, // 当班产量 件 + { "status", modbus.readData(1, 6435, "int16") }, // 运行状态 0:待机 1:运行 2:故障 + { "schedule_1", modbus.readData(1, 1315, "single") }, // 工单1任务进度 % + { "schedule_2", modbus.readData(1, 1317, "single") }, // 工单2任务进度 % + { "schedule_3", modbus.readData(1, 1319, "single") }, // 工单3任务进度 % + { "yield_1", modbus.readData(1, 1321, "single") }, // 工单1良品率 % 真实值 *= 100 + { "yield_2", modbus.readData(1, 1323, "single") }, // 工单2良品率 % 真实值 *= 100 + { "yield_3", modbus.readData(1, 1325, "single") }, // 工单3良品率 % 真实值 *= 100 + { "oee", modbus.readData(1, 1331, "single") }, // 设备综合效率 % 真实值 *= 100 + }; + + // 机床数据 + Dictionary map2 = new Dictionary + { + { "com_status", modbus.readData(1, 6430, "int16") }, // 通讯状态 5:通讯正常 15:通讯断线 + { "gmode", modbus.readData(1, 6099, "int16") }, // 工作方式 0:编辑 1:自动 2:MDI 3:DNC 4:手动 5:手轮 6:回参考点 + { "state", modbus.readData(1, 6099, "int16") }, // 运行状态 0:复位 1:停止 2:运行 3:暂停 + { "quantity", modbus.readData(1, 1199, "int32")}, // 加工数量 次 + { "on_time", modbus.readData(1, 1201, "int32")}, // 开机时间 秒 + { "run_time", modbus.readData(1, 1203, "int32")}, // 运行时间 秒 + { "feed_rate", modbus.readData(1, 1241, "single")}, // 进给倍率 + { "main_rate", modbus.readData(1, 1247, "single")}, // 主轴倍率 + { "run_program_no", modbus.readData(1, 6299, "string", 4)}, // 运行程序编号 length = 8 + { "run_time_total", modbus.readData(1, 4115, "int32")}, // 累计运行时长 分钟 + { "quantity_total", modbus.readData(1, 4117, "int32")} // 累计加工数 次 + }; + + // 组装Map返回 + Dictionary> map = new(); + map.Add("produce", map1); + map.Add("device", map2); + return map; + } + + + // 写机床数据 + public bool saveDeviceData(Data_Machine machine, out string message) { SaveModel model = new SaveModel(); Dictionary mapData = new() { - { "temperature", device.temperature ?? 68.0M }, - { "potential", device.potential ?? 220.0M }, - { "current", device.current ?? 24.0M }, - { "processno", device.processno ?? "10092768" }, - { "run_mode", device.run_mode ?? 1 } + //{ "temperature", device.temperature ?? 68.0M }, + //{ "potential", device.potential ?? 220.0M }, + //{ "current", device.current ?? 24.0M }, + //{ "processno", device.processno ?? "10092768" }, + //{ "run_mode", device.run_mode ?? 1 } }; model.MainData = mapData; try { - Core.Utilities.WebResponseContent result = Data_DeviceService.Instance.Add(model); + Core.Utilities.WebResponseContent result = Data_MachineService.Instance.Add(model); if (!result.Status) { message = result.Message; @@ -48,19 +142,19 @@ namespace VOL.Data.Services.modbus - // 写设备生产数据 + // 写生产数据 public bool saveProduceData(Data_Produce produce, out string message) { SaveModel model = new SaveModel(); Dictionary mapData = new() { - { "standby_time", produce.standby_time ?? 24 }, - { "run_time", produce.run_time ?? 20 }, - { "status", produce.status ?? 1 }, - { "turnout", produce.turnout ?? 1640 }, - { "turnout_one", produce.turnout_one ?? 450 }, - { "turnout_two", produce.turnout_two ?? 630 }, - { "turnout_three", produce.turnout_three ?? 560 } + //{ "standby_time", produce.standby_time ?? 24 }, + //{ "run_time", produce.run_time ?? 20 }, + //{ "status", produce.status ?? 1 }, + //{ "turnout", produce.turnout ?? 1640 }, + //{ "turnout_one", produce.turnout_one ?? 450 }, + //{ "turnout_two", produce.turnout_two ?? 630 }, + //{ "turnout_three", produce.turnout_three ?? 560 } }; model.MainData = mapData; try diff --git a/vol-net6/VOL.Data/Services/data/Data_ProduceService.cs b/vol-net6/VOL.Data/Services/produce/Data_ProduceService.cs similarity index 100% rename from vol-net6/VOL.Data/Services/data/Data_ProduceService.cs rename to vol-net6/VOL.Data/Services/produce/Data_ProduceService.cs diff --git a/vol-net6/VOL.Data/Services/data/Partial/Data_ProduceService.cs b/vol-net6/VOL.Data/Services/produce/Partial/Data_ProduceService.cs similarity index 100% rename from vol-net6/VOL.Data/Services/data/Partial/Data_ProduceService.cs rename to vol-net6/VOL.Data/Services/produce/Partial/Data_ProduceService.cs diff --git a/vol-net6/VOL.Entity/DomainModels/data/Data_Device.cs b/vol-net6/VOL.Entity/DomainModels/config/Data_Config.cs similarity index 66% rename from vol-net6/VOL.Entity/DomainModels/data/Data_Device.cs rename to vol-net6/VOL.Entity/DomainModels/config/Data_Config.cs index f103520..efcb8e3 100644 --- a/vol-net6/VOL.Entity/DomainModels/data/Data_Device.cs +++ b/vol-net6/VOL.Entity/DomainModels/config/Data_Config.cs @@ -13,62 +13,53 @@ using VOL.Entity.SystemModels; namespace VOL.Entity.DomainModels { - [Entity(TableCnName = "设备运行",TableName = "Data_Device")] - public partial class Data_Device:BaseEntity + [Entity(TableCnName = "设备配置",TableName = "Data_Config")] + public partial class Data_Config:BaseEntity { /// - ///ID + /// /// [Key] - [Display(Name ="ID")] + [Display(Name ="id")] [Column(TypeName="int")] [Editable(true)] [Required(AllowEmptyStrings=false)] public int id { get; set; } /// - ///电机温度 + ///设备名称 /// - [Display(Name ="电机温度")] - [DisplayFormat(DataFormatString="10,2")] - [Column(TypeName="decimal")] + [Display(Name ="设备名称")] + [MaxLength(255)] + [Column(TypeName="nvarchar(255)")] [Editable(true)] - public decimal? temperature { get; set; } + public string name { get; set; } /// - ///母线电压 + ///机床类型 /// - [Display(Name ="母线电压")] - [DisplayFormat(DataFormatString="10,2")] - [Column(TypeName="decimal")] + [Display(Name ="机床类型")] + [Column(TypeName="short")] [Editable(true)] - public decimal? potential { get; set; } + public short? type { get; set; } /// - ///实际电流 + ///设备IP /// - [Display(Name ="实际电流")] - [DisplayFormat(DataFormatString="10,2")] - [Column(TypeName="decimal")] + [Display(Name ="设备IP")] + [MaxLength(255)] + [Column(TypeName="nvarchar(255)")] [Editable(true)] - public decimal? current { get; set; } + public string device_ip { get; set; } /// - ///加工程序号 + ///通讯IP /// - [Display(Name ="加工程序号")] + [Display(Name ="通讯IP")] [MaxLength(60)] [Column(TypeName="nvarchar(60)")] [Editable(true)] - public string processno { get; set; } - - /// - ///运行模式 - /// - [Display(Name ="运行模式")] - [Column(TypeName="short")] - [Editable(true)] - public short? run_mode { get; set; } + public string com_ip { get; set; } /// /// @@ -88,9 +79,9 @@ namespace VOL.Entity.DomainModels public string Creator { get; set; } /// - ///记录时间 + ///创建时间 /// - [Display(Name ="记录时间")] + [Display(Name ="创建时间")] [Column(TypeName="datetime")] [Editable(true)] public DateTime? CreateDate { get; set; } diff --git a/vol-net6/VOL.Entity/DomainModels/data/partial/Data_Device.cs b/vol-net6/VOL.Entity/DomainModels/config/partial/Data_Config.cs similarity index 94% rename from vol-net6/VOL.Entity/DomainModels/data/partial/Data_Device.cs rename to vol-net6/VOL.Entity/DomainModels/config/partial/Data_Config.cs index 4e6fdba..74182b5 100644 --- a/vol-net6/VOL.Entity/DomainModels/data/partial/Data_Device.cs +++ b/vol-net6/VOL.Entity/DomainModels/config/partial/Data_Config.cs @@ -14,7 +14,7 @@ using VOL.Entity.SystemModels; namespace VOL.Entity.DomainModels { - public partial class Data_Device + public partial class Data_Config { //此处配置字段(字段配置见此model的另一个partial),如果表中没有此字段请加上 [NotMapped]属性,否则会异常 } diff --git a/vol-net6/VOL.Entity/DomainModels/machine/Data_Machine.cs b/vol-net6/VOL.Entity/DomainModels/machine/Data_Machine.cs new file mode 100644 index 0000000..e0290f5 --- /dev/null +++ b/vol-net6/VOL.Entity/DomainModels/machine/Data_Machine.cs @@ -0,0 +1,225 @@ +/* + *代码由框架生成,任何更改都可能导致被代码生成器覆盖 + *如果数据库字段发生变化,请在代码生器重新生成此Model + */ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using VOL.Entity.SystemModels; + +namespace VOL.Entity.DomainModels +{ + [Entity(TableCnName = "机床数据",TableName = "Data_Machine")] + public partial class Data_Machine:BaseEntity + { + /// + /// + /// + [Key] + [Display(Name ="id")] + [Column(TypeName="int")] + [Editable(true)] + [Required(AllowEmptyStrings=false)] + public int id { get; set; } + + /// + ///设备信息 + /// + [Display(Name ="设备信息")] + [Column(TypeName="int")] + [Editable(true)] + [Required(AllowEmptyStrings=false)] + public int config_id { get; set; } + + /// + ///通讯状态 + /// + [Display(Name ="通讯状态")] + [Column(TypeName="short")] + [Editable(true)] + public short? com_status { get; set; } + + /// + ///运行模式(西门子) + /// + [Display(Name ="运行模式(西门子)")] + [Column(TypeName="short")] + [Editable(true)] + public short? smode { get; set; } + + /// + ///运行模式(广数) + /// + [Display(Name ="运行模式(广数)")] + [Column(TypeName="short")] + [Editable(true)] + public short? gmode { get; set; } + + /// + ///加工程序号 + /// + [Display(Name ="加工程序号")] + [MaxLength(60)] + [Column(TypeName="nvarchar(60)")] + [Editable(true)] + public string run_program_no { get; set; } + + /// + ///运行状态 + /// + [Display(Name ="运行状态")] + [Column(TypeName="short")] + [Editable(true)] + public short? state { get; set; } + + /// + ///电机温度 + /// + [Display(Name ="电机温度")] + [DisplayFormat(DataFormatString="10,2")] + [Column(TypeName="decimal")] + [Editable(true)] + public decimal? temperature { get; set; } + + /// + ///母线电压 + /// + [Display(Name ="母线电压")] + [DisplayFormat(DataFormatString="10,2")] + [Column(TypeName="decimal")] + [Editable(true)] + public decimal? potential { get; set; } + + /// + ///实际电流 + /// + [Display(Name ="实际电流")] + [DisplayFormat(DataFormatString="10,2")] + [Column(TypeName="decimal")] + [Editable(true)] + public decimal? current { get; set; } + + /// + ///加工数 + /// + [Display(Name ="加工数")] + [Column(TypeName="bigint")] + [Editable(true)] + public long? quantity { get; set; } + + /// + ///主轴倍率 + /// + [Display(Name ="主轴倍率")] + [DisplayFormat(DataFormatString="10,2")] + [Column(TypeName="decimal")] + [Editable(true)] + public decimal? main_rate { get; set; } + + /// + ///进给倍率 + /// + [Display(Name ="进给倍率")] + [DisplayFormat(DataFormatString="10,2")] + [Column(TypeName="decimal")] + [Editable(true)] + public decimal? feed_rate { get; set; } + + /// + ///切削倍率 + /// + [Display(Name ="切削倍率")] + [DisplayFormat(DataFormatString="10,2")] + [Column(TypeName="decimal")] + [Editable(true)] + public decimal? cut_rate { get; set; } + + /// + ///开机时间 + /// + [Display(Name ="开机时间")] + [Column(TypeName="bigint")] + [Editable(true)] + public long? on_time { get; set; } + + /// + ///运行时间 + /// + [Display(Name ="运行时间")] + [Column(TypeName="bigint")] + [Editable(true)] + public long? run_time { get; set; } + + /// + ///累计运行时长 + /// + [Display(Name ="累计运行时长")] + [Column(TypeName="bigint")] + [Editable(true)] + public long? run_time_total { get; set; } + + /// + ///累计加工数 + /// + [Display(Name ="累计加工数")] + [Column(TypeName="bigint")] + [Editable(true)] + public long? quantity_total { get; set; } + + /// + /// + /// + [Display(Name ="CreateID")] + [Column(TypeName="int")] + [Editable(true)] + public int? CreateID { get; set; } + + /// + /// + /// + [Display(Name ="Creator")] + [MaxLength(255)] + [Column(TypeName="nvarchar(255)")] + [Editable(true)] + public string Creator { get; set; } + + /// + ///记录时间 + /// + [Display(Name ="记录时间")] + [Column(TypeName="datetime")] + [Editable(true)] + public DateTime? CreateDate { get; set; } + + /// + /// + /// + [Display(Name ="ModifyID")] + [Column(TypeName="int")] + [Editable(true)] + public int? ModifyID { get; set; } + + /// + /// + /// + [Display(Name ="Modifier")] + [MaxLength(255)] + [Column(TypeName="nvarchar(255)")] + [Editable(true)] + public string Modifier { get; set; } + + /// + ///更新时间 + /// + [Display(Name ="更新时间")] + [Column(TypeName="datetime")] + [Editable(true)] + public DateTime? ModifyDate { get; set; } + + + } +} \ No newline at end of file diff --git a/vol-net6/VOL.Entity/DomainModels/machine/partial/Data_Machine.cs b/vol-net6/VOL.Entity/DomainModels/machine/partial/Data_Machine.cs new file mode 100644 index 0000000..6f1267c --- /dev/null +++ b/vol-net6/VOL.Entity/DomainModels/machine/partial/Data_Machine.cs @@ -0,0 +1,21 @@ +/* + *代码由框架生成,任何更改都可能导致被代码生成器覆盖 + *如果数据库字段发生变化,请在代码生器重新生成此Model + */ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using VOL.Entity.SystemModels; + +namespace VOL.Entity.DomainModels +{ + + public partial class Data_Machine + { + //此处配置字段(字段配置见此model的另一个partial),如果表中没有此字段请加上 [NotMapped]属性,否则会异常 + } +} \ No newline at end of file diff --git a/vol-net6/VOL.Entity/DomainModels/data/Data_Produce.cs b/vol-net6/VOL.Entity/DomainModels/produce/Data_Produce.cs similarity index 54% rename from vol-net6/VOL.Entity/DomainModels/data/Data_Produce.cs rename to vol-net6/VOL.Entity/DomainModels/produce/Data_Produce.cs index 8d78f92..4f69768 100644 --- a/vol-net6/VOL.Entity/DomainModels/data/Data_Produce.cs +++ b/vol-net6/VOL.Entity/DomainModels/produce/Data_Produce.cs @@ -27,12 +27,29 @@ namespace VOL.Entity.DomainModels public int id { get; set; } /// - ///待机时长 + ///设备信息 /// - [Display(Name ="待机时长")] + [Display(Name ="设备信息")] [Column(TypeName="int")] [Editable(true)] - public int? standby_time { get; set; } + [Required(AllowEmptyStrings=false)] + public int config_id { get; set; } + + /// + ///程序编号 + /// + [Display(Name ="程序编号")] + [Column(TypeName="int")] + [Editable(true)] + public int? program_no { get; set; } + + /// + ///通讯状态 + /// + [Display(Name ="通讯状态")] + [Column(TypeName="int")] + [Editable(true)] + public int? com_status { get; set; } /// ///运行时长 @@ -56,7 +73,7 @@ namespace VOL.Entity.DomainModels [Display(Name ="当班产量")] [Column(TypeName="int")] [Editable(true)] - public int? turnout { get; set; } + public int? turnout_all { get; set; } /// ///工单 1 产量 @@ -64,7 +81,7 @@ namespace VOL.Entity.DomainModels [Display(Name ="工单 1 产量")] [Column(TypeName="int")] [Editable(true)] - public int? turnout_one { get; set; } + public int? turnout_1 { get; set; } /// ///工单 2 产量 @@ -72,7 +89,7 @@ namespace VOL.Entity.DomainModels [Display(Name ="工单 2 产量")] [Column(TypeName="int")] [Editable(true)] - public int? turnout_two { get; set; } + public int? turnout_2 { get; set; } /// ///工单 3 产量 @@ -80,7 +97,70 @@ namespace VOL.Entity.DomainModels [Display(Name ="工单 3 产量")] [Column(TypeName="int")] [Editable(true)] - public int? turnout_three { get; set; } + public int? turnout_3 { get; set; } + + /// + ///工单1任务进度 + /// + [Display(Name ="工单1任务进度")] + [DisplayFormat(DataFormatString="10,2")] + [Column(TypeName="decimal")] + [Editable(true)] + public decimal? schedule_1 { get; set; } + + /// + ///工单2任务进度 + /// + [Display(Name ="工单2任务进度")] + [DisplayFormat(DataFormatString="10,2")] + [Column(TypeName="decimal")] + [Editable(true)] + public decimal? schedule_2 { get; set; } + + /// + ///工单3任务进度 + /// + [Display(Name ="工单3任务进度")] + [DisplayFormat(DataFormatString="10,2")] + [Column(TypeName="decimal")] + [Editable(true)] + public decimal? schedule_3 { get; set; } + + /// + ///工单1良品率 + /// + [Display(Name ="工单1良品率")] + [DisplayFormat(DataFormatString="10,2")] + [Column(TypeName="decimal")] + [Editable(true)] + public decimal? yield_1 { get; set; } + + /// + ///工单2良品率 + /// + [Display(Name ="工单2良品率")] + [DisplayFormat(DataFormatString="10,2")] + [Column(TypeName="decimal")] + [Editable(true)] + public decimal? yield_2 { get; set; } + + /// + ///工单3良品率 + /// + [Display(Name ="工单3良品率")] + [DisplayFormat(DataFormatString="10,2")] + [Column(TypeName="decimal")] + [Editable(true)] + public decimal? yield_3 { get; set; } + + /// + ///设备综合效率 + /// + [Display(Name ="设备综合效率")] + [DisplayFormat(DataFormatString="10,2")] + [Column(TypeName="decimal")] + [Editable(true)] + public decimal? oee { get; set; } /// /// @@ -125,9 +205,9 @@ namespace VOL.Entity.DomainModels public string Modifier { get; set; } /// - /// + ///更新时间 /// - [Display(Name ="ModifyDate")] + [Display(Name ="更新时间")] [Column(TypeName="datetime")] [Editable(true)] public DateTime? ModifyDate { get; set; } diff --git a/vol-net6/VOL.Entity/DomainModels/data/partial/Data_Produce.cs b/vol-net6/VOL.Entity/DomainModels/produce/partial/Data_Produce.cs similarity index 100% rename from vol-net6/VOL.Entity/DomainModels/data/partial/Data_Produce.cs rename to vol-net6/VOL.Entity/DomainModels/produce/partial/Data_Produce.cs diff --git a/vol-net6/VOL.Entity/MappingConfiguration/data/Data_DeviceMapConfig.cs b/vol-net6/VOL.Entity/MappingConfiguration/config/Data_ConfigMapConfig.cs similarity index 66% rename from vol-net6/VOL.Entity/MappingConfiguration/data/Data_DeviceMapConfig.cs rename to vol-net6/VOL.Entity/MappingConfiguration/config/Data_ConfigMapConfig.cs index 43c5c72..c109456 100644 --- a/vol-net6/VOL.Entity/MappingConfiguration/data/Data_DeviceMapConfig.cs +++ b/vol-net6/VOL.Entity/MappingConfiguration/config/Data_ConfigMapConfig.cs @@ -4,9 +4,9 @@ using Microsoft.EntityFrameworkCore.Metadata.Builders; namespace VOL.Entity.MappingConfiguration { - public class Data_DeviceMapConfig : EntityMappingConfiguration + public class Data_ConfigMapConfig : EntityMappingConfiguration { - public override void Map(EntityTypeBuilder + public override void Map(EntityTypeBuilder builderTable) { //b.Property(x => x.StorageName).HasMaxLength(45); diff --git a/vol-net6/VOL.Entity/MappingConfiguration/machine/Data_MachineMapConfig.cs b/vol-net6/VOL.Entity/MappingConfiguration/machine/Data_MachineMapConfig.cs new file mode 100644 index 0000000..05893a1 --- /dev/null +++ b/vol-net6/VOL.Entity/MappingConfiguration/machine/Data_MachineMapConfig.cs @@ -0,0 +1,16 @@ +using VOL.Entity.MappingConfiguration; +using VOL.Entity.DomainModels; +using Microsoft.EntityFrameworkCore.Metadata.Builders; + +namespace VOL.Entity.MappingConfiguration +{ + public class Data_MachineMapConfig : EntityMappingConfiguration + { + public override void Map(EntityTypeBuilder + builderTable) + { + //b.Property(x => x.StorageName).HasMaxLength(45); + } + } +} + diff --git a/vol-net6/VOL.Entity/MappingConfiguration/data/Data_ProduceMapConfig.cs b/vol-net6/VOL.Entity/MappingConfiguration/produce/Data_ProduceMapConfig.cs similarity index 100% rename from vol-net6/VOL.Entity/MappingConfiguration/data/Data_ProduceMapConfig.cs rename to vol-net6/VOL.Entity/MappingConfiguration/produce/Data_ProduceMapConfig.cs diff --git a/vol-net6/VOL.WebApi/Controllers/Data/DataCaptureController.cs b/vol-net6/VOL.WebApi/Controllers/Data/DataCaptureController.cs index 788242b..140f109 100644 --- a/vol-net6/VOL.WebApi/Controllers/Data/DataCaptureController.cs +++ b/vol-net6/VOL.WebApi/Controllers/Data/DataCaptureController.cs @@ -60,22 +60,7 @@ namespace VOL.WebApi.Controllers.Data return Content("master modbus disconnect!"); } try { - // 读Int16 - ushort[] us1 = _service.ReadHoldingRegisters(1, 9, 1); - short v = DataConvertUtil.GetShort(us1, 0); - Console.WriteLine("Short Data:" + v); - // 读Float - ushort[] us2 = _service.ReadHoldingRegisters(1, 1, 2); - float f = DataConvertUtil.GetReal(us2, 0); - Console.WriteLine("Real Data:" + f); - // 读Bool - ushort[] us3 = _service.ReadHoldingRegisters(1, 11, 1); - bool[] bs = DataConvertUtil.GetBools(us3,0,1); - Console.WriteLine("Bools Data:" + String.Join(",",bs)); - // 读String - ushort[] target = _service.ReadHoldingRegisters(1, 30, 6); - string str = DataConvertUtil.GetString(target,0,6); - Console.WriteLine("String Data:" + str.ToString()); + } catch (Exception ex) { Console.WriteLine(ex.Message); return Content("read data error!"); diff --git a/vol-net6/VOL.WebApi/Controllers/Data/DataTestController.cs b/vol-net6/VOL.WebApi/Controllers/Data/DataTestController.cs index f414979..74b42a6 100644 --- a/vol-net6/VOL.WebApi/Controllers/Data/DataTestController.cs +++ b/vol-net6/VOL.WebApi/Controllers/Data/DataTestController.cs @@ -234,36 +234,43 @@ namespace VOL.WebApi.Controllers.Data [HttpGet, HttpPost, Route("unitTestSem")] public IActionResult Test02() { - Console.Write(5 / 2); - _service = new ModbusTcpService("192.168.0.99", 502); + _service = new ModbusTcpService("192.168.1.99", 502); if (_service.isConnected) { // 读取从0开始,文档上地址从1开始的,地址需要减1 Console.WriteLine("=========read4x========="); // 写数据 - _service.writeData(1, 6429, 1); + //_service.writeData(1, 6429, 1); - _service.writeData(1, 1173, 256); + //_service.writeData(1, 1173, 256); - _service.writeData(1, 1215, 6.28F); + //_service.writeData(1, 1215, 6.28F); - _service.writeData(1, 6691, "Hello World!!"); + //_service.writeData(1, 6691, "Hello World!!"); // 读数据 - short s = _service.readData(1, 6429, "int16"); - - int i = _service.readData(1, 1173, "int32"); - - float f = _service.readData(1, 1215, "single"); + //short s = _service.readData(1, 6429, "int16"); // 运行模式 + //float f = _service.readData(1, 1215, "single"); // 加工数 + //int i = _service.readData(1, 1173, "int32"); + //string str = _service.readData(1, 6690, "string", 52); + + //Console.WriteLine(s); + //Console.WriteLine(f); + //Console.WriteLine(i); + //Console.WriteLine(str); - string str = _service.readData(1, 6690, "string", 52); + //short s = _service.readData(1, 6429, "int16"); // 运行模式 + //float f1 = _service.readData(1, 1231, "single"); // 主轴倍率 + //float f2 = _service.readData(1, 1215, "single"); // 加工数 + //Console.WriteLine(s); + //Console.WriteLine(f1); + //Console.WriteLine(f2); + //Console.WriteLine(str); + short s = _service.readData(1, 6430, "int16"); // 通讯状态 Console.WriteLine(s); - Console.WriteLine(i); - Console.WriteLine(f); - Console.WriteLine(str); Console.WriteLine("=========read4x========="); @@ -281,35 +288,51 @@ namespace VOL.WebApi.Controllers.Data [HttpGet, HttpPost, Route("unitTestCnc")] public IActionResult Test03() { - _service = new ModbusTcpService("192.168.0.100", 502); + _service = new ModbusTcpService("192.168.1.100", 502); + //_service = new ModbusTcpService("192.168.1.99", 502); if (_service.isConnected) { // 读取从0开始,文档上地址从1开始的,地址需要减1 Console.WriteLine("=========read4x========="); // 写数据 - _service.writeData(1, 6424, 2); + //_service.writeData(1, 6424, 2); - _service.writeData(1, 1309, 65537); + //_service.writeData(1, 1309, 65537); - _service.writeData(1, 1307, 5.68F); + //_service.writeData(1, 1307, 5.68F); - _service.writeData(1, 6640, "hehe"); + //_service.writeData(1, 6640, "hehe"); // 读数据 - short s = _service.readData(1, 6424, "int16"); + //short s = _service.readData(1, 6424, "int16"); - int i = _service.readData(1, 1309, "int32"); + //int i = _service.readData(1, 1309, "int32"); - float f = _service.readData(1, 1307, "single"); + //float f = _service.readData(1, 1307, "single"); - string str = _service.readData(1, 6640, "string", 2); // 一个寄存器地址存放两个字符 + //string str = _service.readData(1, 6640, "string", 2); // 一个寄存器地址存放两个字符 + + //Console.WriteLine(s); + //Console.WriteLine(i); + //Console.WriteLine(f); + //Console.WriteLine(str); + //_service.writeData(1, 1307, 120F); + //_service.writeData(1, 1299, 19912F); + //_service.writeData(1, 6424, 2); + //_service.writeData(1, 6402, 25); + + //Console.WriteLine(_service.readData(1, 1307, "single")); // 加工数量 + //Console.WriteLine(_service.readData(1, 1299, "single")); // 切削时间 + //Console.WriteLine(_service.readData(1, 6424, "int16")); // 运行模式 + //Console.WriteLine(_service.readData(1, 6402, "int16")); // 快速倍率 + //Console.WriteLine(_service.readData(1, 6425, "int16")); // 轴状态 + + Console.WriteLine(_service.readData(1, 6429, "int16")); + Console.WriteLine(_service.readData(1, 6430, "int16")); + Console.WriteLine(_service.readData(1, 6431, "int16")); - Console.WriteLine(s); - Console.WriteLine(i); - Console.WriteLine(f); - Console.WriteLine(str); Console.WriteLine("=========read4x========="); diff --git a/vol-net6/VOL.WebApi/Controllers/Data/Data_ConfigController.cs b/vol-net6/VOL.WebApi/Controllers/Data/Data_ConfigController.cs new file mode 100644 index 0000000..63c63f8 --- /dev/null +++ b/vol-net6/VOL.WebApi/Controllers/Data/Data_ConfigController.cs @@ -0,0 +1,21 @@ +/* + *代码由框架生成,任何更改都可能导致被代码生成器覆盖 + *如果要增加方法请在当前目录下Partial文件夹Data_ConfigController编写 + */ +using Microsoft.AspNetCore.Mvc; +using VOL.Core.Controllers.Basic; +using VOL.Entity.AttributeManager; +using VOL.Data.IServices; +namespace VOL.Data.Controllers +{ + [Route("api/Data_Config")] + [PermissionTable(Name = "Data_Config")] + public partial class Data_ConfigController : ApiBaseController + { + public Data_ConfigController(IData_ConfigService service) + : base(service) + { + } + } +} + diff --git a/vol-net6/VOL.WebApi/Controllers/Data/Data_DeviceController.cs b/vol-net6/VOL.WebApi/Controllers/Data/Data_DeviceController.cs deleted file mode 100644 index 7f11ed8..0000000 --- a/vol-net6/VOL.WebApi/Controllers/Data/Data_DeviceController.cs +++ /dev/null @@ -1,24 +0,0 @@ -/* - *代码由框架生成,任何更改都可能导致被代码生成器覆盖 - *如果要增加方法请在当前目录下Partial文件夹Data_DeviceController编写 - */ -using Microsoft.AspNetCore.Mvc; -using VOL.Core.Controllers.Basic; -using VOL.Entity.AttributeManager; -using VOL.Data.IServices; -using System; - -namespace VOL.Data.Controllers -{ - [Route("api/Data_Device")] - [PermissionTable(Name = "Data_Device")] - public partial class Data_DeviceController : ApiBaseController - { - public Data_DeviceController(IData_DeviceService service) - : base(service) - { - // 类存在多个构造函数时,没有加ActivatorUtilitiesConstructor注解,不为指定的执行构造 - } - } -} - diff --git a/vol-net6/VOL.WebApi/Controllers/Data/Data_MachineController.cs b/vol-net6/VOL.WebApi/Controllers/Data/Data_MachineController.cs new file mode 100644 index 0000000..4057c71 --- /dev/null +++ b/vol-net6/VOL.WebApi/Controllers/Data/Data_MachineController.cs @@ -0,0 +1,21 @@ +/* + *代码由框架生成,任何更改都可能导致被代码生成器覆盖 + *如果要增加方法请在当前目录下Partial文件夹Data_MachineController编写 + */ +using Microsoft.AspNetCore.Mvc; +using VOL.Core.Controllers.Basic; +using VOL.Entity.AttributeManager; +using VOL.Data.IServices; +namespace VOL.Data.Controllers +{ + [Route("api/Data_Machine")] + [PermissionTable(Name = "Data_Machine")] + public partial class Data_MachineController : ApiBaseController + { + public Data_MachineController(IData_MachineService service) + : base(service) + { + } + } +} + diff --git a/vol-net6/VOL.WebApi/Controllers/Data/Partial/Data_DeviceController.cs b/vol-net6/VOL.WebApi/Controllers/Data/Partial/Data_ConfigController.cs similarity index 70% rename from vol-net6/VOL.WebApi/Controllers/Data/Partial/Data_DeviceController.cs rename to vol-net6/VOL.WebApi/Controllers/Data/Partial/Data_ConfigController.cs index 28fcbac..1a93351 100644 --- a/vol-net6/VOL.WebApi/Controllers/Data/Partial/Data_DeviceController.cs +++ b/vol-net6/VOL.WebApi/Controllers/Data/Partial/Data_ConfigController.cs @@ -1,7 +1,7 @@ /* *接口编写处... *如果接口需要做Action的权限验证,请在Action上使用属性 -*如: [ApiActionPermission("Data_Device",Enums.ActionPermissionOptions.Search)] +*如: [ApiActionPermission("Data_Config",Enums.ActionPermissionOptions.Search)] */ using Microsoft.AspNetCore.Mvc; using System; @@ -14,21 +14,20 @@ using VOL.Data.IServices; namespace VOL.Data.Controllers { - public partial class Data_DeviceController + public partial class Data_ConfigController { - private readonly IData_DeviceService _service;//访问业务代码 + private readonly IData_ConfigService _service;//访问业务代码 private readonly IHttpContextAccessor _httpContextAccessor; [ActivatorUtilitiesConstructor] - public Data_DeviceController( - IData_DeviceService service, + public Data_ConfigController( + IData_ConfigService service, IHttpContextAccessor httpContextAccessor ) : base(service) { _service = service; _httpContextAccessor = httpContextAccessor; - //Console.WriteLine("123456789"); } } } diff --git a/vol-net6/VOL.WebApi/Controllers/Data/Partial/Data_MachineController.cs b/vol-net6/VOL.WebApi/Controllers/Data/Partial/Data_MachineController.cs new file mode 100644 index 0000000..0969483 --- /dev/null +++ b/vol-net6/VOL.WebApi/Controllers/Data/Partial/Data_MachineController.cs @@ -0,0 +1,33 @@ +/* + *接口编写处... +*如果接口需要做Action的权限验证,请在Action上使用属性 +*如: [ApiActionPermission("Data_Machine",Enums.ActionPermissionOptions.Search)] + */ +using Microsoft.AspNetCore.Mvc; +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.AspNetCore.Http; +using VOL.Entity.DomainModels; +using VOL.Data.IServices; + +namespace VOL.Data.Controllers +{ + public partial class Data_MachineController + { + private readonly IData_MachineService _service;//访问业务代码 + private readonly IHttpContextAccessor _httpContextAccessor; + + [ActivatorUtilitiesConstructor] + public Data_MachineController( + IData_MachineService service, + IHttpContextAccessor httpContextAccessor + ) + : base(service) + { + _service = service; + _httpContextAccessor = httpContextAccessor; + } + } +} diff --git a/vol-vue3/src/components/basic/VolTable.vue b/vol-vue3/src/components/basic/VolTable.vue index 02db672..d75646f 100644 --- a/vol-vue3/src/components/basic/VolTable.vue +++ b/vol-vue3/src/components/basic/VolTable.vue @@ -1511,7 +1511,6 @@ export default defineComponent({ if (!column.bind || !column.bind.data) { return row[column.field]; } - if (column.edit && (column.edit.type == 'selectList'||column.edit.type=='treeSelect')) { if (!Array.isArray(val)) { row[column.field] = val.split(','); diff --git a/vol-vue3/src/extension/data/device/Data_Device.js b/vol-vue3/src/extension/data/config/Data_Config.js similarity index 100% rename from vol-vue3/src/extension/data/device/Data_Device.js rename to vol-vue3/src/extension/data/config/Data_Config.js diff --git a/vol-vue3/src/extension/data/machine/Data_Machine.js b/vol-vue3/src/extension/data/machine/Data_Machine.js new file mode 100644 index 0000000..0b28328 --- /dev/null +++ b/vol-vue3/src/extension/data/machine/Data_Machine.js @@ -0,0 +1,164 @@ +/***************************************************************************************** +** Author:jxx 2022 +** QQ:283591387 +**完整文档见:http://v2.volcore.xyz/document/api 【代码生成页面ViewGrid】 +**常用示例见:http://v2.volcore.xyz/document/vueDev +**后台操作见:http://v2.volcore.xyz/document/netCoreDev +*****************************************************************************************/ +//此js文件是用来自定义扩展业务代码,可以扩展一些自定义页面或者重新配置生成的代码 + +let extension = { + components: { + //查询界面扩展组件 + gridHeader: '', + gridBody: '', + gridFooter: '', + //新建、编辑弹出框扩展组件 + modelHeader: '', + modelBody: '', + modelFooter: '' + }, + tableAction: '', //指定某张表的权限(这里填写表名,默认不用填写) + buttons: { view: [], box: [], detail: [] }, //扩展的按钮 + methods: { + onInit() { //框架初始化配置前, + //设置排序字段 + this.pagination.sortName = "id"; + this.pagination.order = "desc"; + + //设置页面上显示的按钮个数 + this.maxBtnLength = 3; + + // 格式化数据 + this.dataFormatter(); + }, + onInited() { + //框架初始化配置后 + let fixeds = ['id','com_status','config_id']; + this.columns.forEach(x=>{ + //设置title列固定 + if (fixeds.includes(x.field)) { + x.fixed=true//也可以设置为right,固定到最右边 + } + }) + //如果要配置明细表,在此方法操作 + //this.detailOptions.columns.forEach(column=>{ }); + }, + searchBefore(param) { + //界面查询前,可以给param.wheres添加查询参数 + //返回false,则不会执行查询 + return true; + }, + searchAfter(result) { + //查询后,result返回的查询数据,可以在显示到表格前处理表格的值 + return true; + }, + addBefore(formData) { + //新建保存前formData为对象,包括明细表,可以给给表单设置值,自己输出看formData的值 + return true; + }, + updateBefore(formData) { + //编辑保存前formData为对象,包括明细表、删除行的Id + return true; + }, + rowClick({ row, column, event }) { + //查询界面点击行事件 + this.$refs.table.$refs.table.toggleRowSelection(row); //单击行时选中当前行; + }, + modelOpenAfter(row) { + //点击编辑、新建按钮弹出框后,可以在此处写逻辑,如,从后台获取数据 + //(1)判断是编辑还是新建操作: this.currentAction=='Add'; + //(2)给弹出框设置默认值 + //(3)this.editFormFields.字段='xxx'; + //如果需要给下拉框设置默认值,请遍历this.editFormOptions找到字段配置对应data属性的key值 + //看不懂就把输出看:console.log(this.editFormOptions) + }, + dataFormatter() { + this.columns.forEach(column => { + if (column.field == 'temperature') { + column.formatter = (row) => { + return row.temperature && '' + row.temperature + ' ℃ ' + } + } + if (column.field == 'potential') { + column.formatter = (row) => { + return row.potential && '' + row.potential + ' V ' + } + } + if (column.field == 'current') { + column.formatter = (row) => { + return row.current && '' + row.current + ' A ' + } + } + if (column.field == 'quantity') { + column.formatter = (row) => { + return row.quantity && '' + row.quantity + ' 次 ' + } + } + if (column.field == 'cut_rate') { + column.formatter = (row) => { + return row.cut_rate && '' + row.cut_rate + ' % ' + } + } + if (column.field == 'main_rate') { + column.formatter = (row) => { + return row.main_rate && '' + row.main_rate + ' % ' + } + } + if (column.field == 'feed_rate') { + column.formatter = (row) => { + return row.feed_rate && '' + row.feed_rate + ' % ' + } + } + if (column.field == 'on_time') { + column.formatter = (row) => { + return row.on_time && '' + row.on_time + ' 秒 ' + } + } + if (column.field == 'run_time') { + column.formatter = (row) => { + return row.run_time && '' + row.run_time + ' 秒 ' + } + } + if (column.field == 'run_time_total') { + column.formatter = (row) => { + return row.run_time_total && '' + row.run_time_total + ' 分 ' + } + } + if (column.field == 'quantity_total') { + column.formatter = (row) => { + return row.quantity_total && '' + row.quantity_total + ' 次 ' + } + } + + // 标签改色 + if (column.field == 'com_status') { + column.getColor = (row, column) => { + if (row.com_status == 15) { + return 'danger'; + } else if (row.com_status == 5){ + return 'success'; + } else { + return ''; + } + } + } + + if (column.field == 'state') { + column.getColor = (row, column) => { + if (row.state == 1) { + return 'danger'; + } else if (row.state == 2){ + return 'success'; + } else if (row.state == 3){ + return 'warning'; + } else { + return ''; + } + } + } + }) + } + } +}; +export default extension; diff --git a/vol-vue3/src/extension/data/produce/Data_Produce.js b/vol-vue3/src/extension/data/produce/Data_Produce.js index 8935403..3bad0d4 100644 --- a/vol-vue3/src/extension/data/produce/Data_Produce.js +++ b/vol-vue3/src/extension/data/produce/Data_Produce.js @@ -23,23 +23,24 @@ let extension = { methods: { //下面这些方法可以保留也可以删除 onInit() { //框架初始化配置前, - //示例:在按钮的最前面添加一个按钮 - // this.buttons.unshift({ //也可以用push或者splice方法来修改buttons数组 - // name: '按钮', //按钮名称 - // icon: 'el-icon-document', //按钮图标vue2版本见iview文档icon,vue3版本见element ui文档icon(注意不是element puls文档) - // type: 'primary', //按钮样式vue2版本见iview文档button,vue3版本见element ui文档button - // onClick: function () { - // this.$Message.success('点击了按钮'); - // } - // }); - - //示例:设置修改新建、编辑弹出框字段标签的长度 - // this.boxOptions.labelWidth = 150; + //设置排序字段 + this.pagination.sortName = "id"; + this.pagination.order = "desc"; + + //设置页面上显示的按钮个数 + this.maxBtnLength = 3; + + // 格式化数据 + this.dataFormatter(); }, onInited() { - //框架初始化配置后 - //如果要配置明细表,在此方法操作 - //this.detailOptions.columns.forEach(column=>{ }); + let fixeds = ['id','com_status','config_id']; + this.columns.forEach(x=>{ + //设置title列固定 + if (fixeds.includes(x.field)) { + x.fixed=true//也可以设置为right,固定到最右边 + } + }) }, searchBefore(param) { //界面查询前,可以给param.wheres添加查询参数 @@ -59,8 +60,8 @@ let extension = { return true; }, rowClick({ row, column, event }) { - //查询界面点击行事件 - // this.$refs.table.$refs.table.toggleRowSelection(row); //单击行时选中当前行; + //单击行时选中当前行 + this.$refs.table.$refs.table.toggleRowSelection(row); }, modelOpenAfter(row) { //点击编辑、新建按钮弹出框后,可以在此处写逻辑,如,从后台获取数据 @@ -69,6 +70,83 @@ let extension = { //(3)this.editFormFields.字段='xxx'; //如果需要给下拉框设置默认值,请遍历this.editFormOptions找到字段配置对应data属性的key值 //看不懂就把输出看:console.log(this.editFormOptions) + }, + dataFormatter() { + this.columns.forEach(column => { + if (column.field == 'run_time') { + column.formatter = (row) => { + return row.run_time && '' + row.run_time + ' 分 ' + } + } + if (column.field == 'turnout_1') { + column.formatter = (row) => { + return row.turnout_1 && '' + row.turnout_1 + ' 件 ' + } + } + if (column.field == 'turnout_2') { + column.formatter = (row) => { + return row.turnout_2 && '' + row.turnout_2 + ' 件 ' + } + } + if (column.field == 'turnout_3') { + column.formatter = (row) => { + return row.turnout_3 && '' + row.turnout_3 + ' 件 ' + } + } + if (column.field == 'turnout_all') { + column.formatter = (row) => { + return row.turnout_all && '' + row.turnout_all + ' 件 ' + } + } + if (column.field == 'schedule_1') { + column.formatter = (row) => { + return row.schedule_1 && '' + row.schedule_1 + ' % ' + } + } + if (column.field == 'schedule_2') { + column.formatter = (row) => { + return row.schedule_2 && '' + row.schedule_2 + ' % ' + } + } + if (column.field == 'schedule_3') { + column.formatter = (row) => { + return row.schedule_3 && '' + row.schedule_3 + ' % ' + } + } + if (column.field == 'yield_1') { + column.formatter = (row) => { + return row.yield_1 && '' + row.yield_1 * 100 + ' % ' + } + } + if (column.field == 'yield_2') { + column.formatter = (row) => { + return row.yield_2 && '' + row.yield_2 * 100 + ' % ' + } + } + if (column.field == 'yield_3') { + column.formatter = (row) => { + return row.yield_3 && '' + row.yield_3 * 100 + ' % ' + } + } + if (column.field == 'oee') { + column.formatter = (row) => { + return row.oee && '' + row.oee * 100 + ' % ' + } + } + + // 标签改色 + if (column.field == 'com_status') { + column.getColor = (row, column) => { + if (row.com_status == 15) { + return 'danger'; + } else if (row.com_status == 5){ + return 'success'; + } else { + return ''; + } + } + } + }) } } }; diff --git a/vol-vue3/src/router/viewGird.js b/vol-vue3/src/router/viewGird.js index 080bb0b..6c38105 100644 --- a/vol-vue3/src/router/viewGird.js +++ b/vol-vue3/src/router/viewGird.js @@ -144,15 +144,20 @@ let viewgird = [ name: 'Sys_Department', component: () => import('@/views/system/system/Sys_Department.vue') }, - { - path: '/Data_Device', - name: 'Data_Device', - component: () => import('@/views/data/device/Data_Device.vue') - }, { path: '/Data_Produce', name: 'Data_Produce', component: () => import('@/views/data/produce/Data_Produce.vue') + }, + { + path: '/Data_Config', + name: 'Data_Config', + component: () => import('@/views/data/config/Data_Config.vue') + }, + { + path: '/Data_Machine', + name: 'Data_Machine', + component: () => import('@/views/data/machine/Data_Machine.vue') } ] diff --git a/vol-vue3/src/views/data/config/Data_Config.vue b/vol-vue3/src/views/data/config/Data_Config.vue new file mode 100644 index 0000000..b19916c --- /dev/null +++ b/vol-vue3/src/views/data/config/Data_Config.vue @@ -0,0 +1,69 @@ + + + diff --git a/vol-vue3/src/views/data/device/Data_Device.vue b/vol-vue3/src/views/data/device/Data_Device.vue deleted file mode 100644 index c03622f..0000000 --- a/vol-vue3/src/views/data/device/Data_Device.vue +++ /dev/null @@ -1,71 +0,0 @@ - - - diff --git a/vol-vue3/src/views/data/machine/Data_Machine.vue b/vol-vue3/src/views/data/machine/Data_Machine.vue new file mode 100644 index 0000000..a89abb0 --- /dev/null +++ b/vol-vue3/src/views/data/machine/Data_Machine.vue @@ -0,0 +1,95 @@ + + + diff --git a/vol-vue3/src/views/data/produce/Data_Produce.vue b/vol-vue3/src/views/data/produce/Data_Produce.vue index 78fc830..b03b276 100644 --- a/vol-vue3/src/views/data/produce/Data_Produce.vue +++ b/vol-vue3/src/views/data/produce/Data_Produce.vue @@ -29,30 +29,48 @@ url: "/Data_Produce/", sortName: "id" }); - const editFormFields = ref({"standby_time":"","run_time":"","status":"","turnout":"","turnout_one":"","turnout_two":"","turnout_three":""}); - const editFormOptions = ref([[{"title":"待机时长","field":"standby_time","type":"number"}, - {"title":"运行时长","field":"run_time","type":"number"}, - {"dataKey":"produce_status","data":[],"title":"运行状态","field":"status","type":"select"}], - [{"title":"当班产量","field":"turnout","type":"number"}, - {"title":"工单 1 产量","field":"turnout_one","type":"number"}, - {"title":"工单 2 产量","field":"turnout_two","type":"number"}, - {"title":"工单 3 产量","field":"turnout_three","type":"number"}]]); - const searchFormFields = ref({"status":"","turnout":"","CreateDate":""}); - const searchFormOptions = ref([[{"dataKey":"produce_status","data":[],"title":"运行状态","field":"status","type":"select"},{"title":"当班产量","field":"turnout","type":"number"}],[{"title":"记录时间","field":"CreateDate","type":"datetime"}]]); - const columns = ref([{field:'id',title:'ID',type:'int',width:110,hidden:true,readonly:true,require:true,align:'left'}, - {field:'standby_time',title:'待机时长',type:'int',width:110,align:'left',sort:true}, + const editFormFields = ref({"config_id":"","program_no":"","com_status":"","run_time":"","status":"","turnout_all":"","turnout_1":"","turnout_2":"","turnout_3":"","schedule_1":"","schedule_2":"","schedule_3":"","yield_1":"","yield_2":"","yield_3":"","oee":""}); + const editFormOptions = ref([[{"dataKey":"device_name","data":[],"title":"设备信息","required":true,"field":"config_id","disabled":true,"type":"select"}, + {"title":"程序编号","field":"program_no","type":"number"}], + [{"dataKey":"produce_com_status","data":[],"title":"通讯状态","field":"com_status","type":"select"}, + {"title":"运行时长","field":"run_time","type":"number"}], + [{"dataKey":"produce_status","data":[],"title":"运行状态","field":"status","type":"select"}, + {"title":"当班产量","field":"turnout_all","type":"number"}], + [{"title":"工单 1 产量","field":"turnout_1","type":"number"}, + {"title":"工单 2 产量","field":"turnout_2","type":"number"}, + {"title":"工单 3 产量","field":"turnout_3","type":"number"}], + [{"title":"工单1任务进度","field":"schedule_1","type":"decimal"}, + {"title":"工单2任务进度","field":"schedule_2","type":"decimal"}, + {"title":"工单3任务进度","field":"schedule_3","type":"decimal"}], + [{"title":"工单1良品率","field":"yield_1","type":"decimal"}, + {"title":"工单2良品率","field":"yield_2","type":"decimal"}, + {"title":"工单3良品率","field":"yield_3","type":"decimal"}], + [{"title":"设备综合效率","field":"oee","type":"decimal"}]]); + const searchFormFields = ref({"config_id":"","program_no":"","com_status":"","status":"","turnout_all":[null,null],"CreateDate":""}); + const searchFormOptions = ref([[{"dataKey":"produce_status","data":[],"title":"运行状态","field":"status","type":"select"},{"title":"程序编号","field":"program_no","type":"number"},{"dataKey":"produce_com_status","data":[],"title":"通讯状态","field":"com_status","type":"number"}],[{"title":"记录时间","field":"CreateDate","type":"datetime"},{"dataKey":"device_name","data":[],"title":"设备信息","field":"config_id","type":"select"},{"title":"当班产量","field":"turnout_all","type":"range"}]]); + const columns = ref([{field:'id',title:'ID',type:'int',width:110,readonly:true,require:true,align:'left',sort:true}, + {field:'config_id',title:'设备信息',type:'int',bind:{ key:'device_name',data:[]},width:120,readonly:true,require:true,align:'left'}, + {field:'program_no',title:'程序编号',type:'int',width:150,align:'left'}, + {field:'com_status',title:'通讯状态',type:'int',bind:{ key:'produce_com_status',data:[]},width:120,align:'left'}, {field:'run_time',title:'运行时长',type:'int',width:110,align:'left'}, {field:'status',title:'运行状态',type:'sbyte',bind:{ key:'produce_status',data:[]},width:110,align:'left'}, - {field:'turnout',title:'当班产量',type:'int',width:110,align:'left'}, - {field:'turnout_one',title:'工单 1 产量',type:'int',width:110,align:'left'}, - {field:'turnout_two',title:'工单 2 产量',type:'int',width:110,align:'left'}, - {field:'turnout_three',title:'工单 3 产量',type:'int',width:110,align:'left'}, + {field:'turnout_all',title:'当班产量',type:'int',sort:true,width:120,align:'left'}, + {field:'turnout_1',title:'工单 1 产量',type:'int',width:120,align:'left'}, + {field:'turnout_2',title:'工单 2 产量',type:'int',width:120,align:'left'}, + {field:'turnout_3',title:'工单 3 产量',type:'int',width:120,align:'left'}, + {field:'schedule_1',title:'工单1任务进度',type:'decimal',width:120,align:'left'}, + {field:'schedule_2',title:'工单2任务进度',type:'decimal',width:120,align:'left'}, + {field:'schedule_3',title:'工单3任务进度',type:'decimal',width:120,align:'left'}, + {field:'yield_1',title:'工单1良品率',type:'decimal',width:120,align:'left'}, + {field:'yield_2',title:'工单2良品率',type:'decimal',width:120,align:'left'}, + {field:'yield_3',title:'工单3良品率',type:'decimal',width:120,align:'left'}, + {field:'oee',title:'设备综合效率',type:'decimal',sort:true,width:120,align:'left'}, {field:'CreateID',title:'CreateID',type:'int',width:100,hidden:true,readonly:true,align:'left'}, {field:'Creator',title:'Creator',type:'string',width:100,hidden:true,readonly:true,align:'left'}, {field:'CreateDate',title:'记录时间',type:'datetime',width:180,readonly:true,align:'left',sort:true}, {field:'ModifyID',title:'ModifyID',type:'int',width:100,hidden:true,readonly:true,align:'left'}, {field:'Modifier',title:'Modifier',type:'string',width:100,hidden:true,readonly:true,align:'left'}, - {field:'ModifyDate',title:'ModifyDate',type:'datetime',width:150,hidden:true,readonly:true,align:'left',sort:true}]); + {field:'ModifyDate',title:'更新时间',type:'datetime',width:180,readonly:true,align:'left',sort:true}]); const detail = ref({ cnName: "#detailCnName", table: "#detailTable",