From 24a1753366c1da983f93f68404cc4bc04069f77f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=89=E8=99=B9=E7=9D=BF?= <297504645@qq.com> Date: Wed, 10 Jan 2024 15:37:40 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E3=80=90=E9=95=BF=E6=98=A5=E6=B4=BE?= =?UTF-8?q?=E6=A0=BC1.5=E3=80=91=E6=97=A5=E5=B8=B8=E6=89=93=E5=8D=B0?= =?UTF-8?q?=E7=9B=B8=E5=85=B3=E6=9B=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package-lock.json | 6 ++++++ .../basedate/m100Online/normalPritIndex.vue | 15 +++++++++------ vue/static/config.js | 5 ++++- 3 files changed, 19 insertions(+), 7 deletions(-) create mode 100644 package-lock.json diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..d138b35 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,6 @@ +{ + "name": "FIS1.5", + "lockfileVersion": 2, + "requires": true, + "packages": {} +} diff --git a/vue/src/views/pg-fis/basedate/m100Online/normalPritIndex.vue b/vue/src/views/pg-fis/basedate/m100Online/normalPritIndex.vue index 2f628a9..d28abde 100644 --- a/vue/src/views/pg-fis/basedate/m100Online/normalPritIndex.vue +++ b/vue/src/views/pg-fis/basedate/m100Online/normalPritIndex.vue @@ -372,7 +372,7 @@ @change="beginHostSNChange" :disabled="true" /> - - + @@ -529,7 +529,7 @@ export default { drawerZHBPrint: false, drawerZHBDelete: false, activeNames: ["1"], - printNum: "12", + printNum: "10", printNumZHB: "24", rules: { erpAssemblyName: [ @@ -1335,7 +1335,7 @@ export default { }); return; } - (this.printNum = "12"), + (this.printNum = "10"), (this.printNumZHB = "24"), (this.hostSNQuery.productLine = this.listQuery.productLine); this.hostPrintQuery.productLine = this.listQuery.productLine; @@ -1699,8 +1699,11 @@ export default { /** * 保存、加载、打印门板 */ - private_printMenBan() - { + private_printMenBan(){ + // 2024-01-10 新增字段PrintCount + if(this.listQuery.productType == 1){ + this.hostPrintQuery.printCount = this.printNum + } this.$axios .posts( //"/api/newjit/bill-m100/save-menban-report", diff --git a/vue/static/config.js b/vue/static/config.js index ebf7976..380ece6 100644 --- a/vue/static/config.js +++ b/vue/static/config.js @@ -2,11 +2,14 @@ let configJSON; if (process.env.NODE_ENV === "development") { configJSON = { base: { - ip: "http://localhost", auth_port: "44344", public_port: "44344", backend_port: "44344", + // ip: "http://222.169.228.163", + // auth_port: "7696", + // public_port: "7692", + // backend_port: "7692", }, basic: {}, upload: { From 2a677a0a2f386c1dd7685e995ec010a07d8eb8cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=89=E8=99=B9=E7=9D=BF?= <297504645@qq.com> Date: Wed, 10 Jan 2024 17:14:02 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E3=80=90=E9=95=BF=E6=98=A5=E6=B4=BE?= =?UTF-8?q?=E6=A0=BC1.5=E3=80=91=E8=AE=A1=E5=88=92=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E5=BC=80=E5=8F=91=20+=20=E6=99=AE=E9=80=9A?= =?UTF-8?q?=E5=AF=BC=E5=85=A5=E7=BB=84=E4=BB=B6=E5=B0=81=E8=A3=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/ImportExcel-normal/index.vue | 178 ++++++ vue/src/router/modules/fis.js | 10 + .../pg-fis/basedate/planControl/index.vue | 558 ++++++++++++++++++ 3 files changed, 746 insertions(+) create mode 100644 vue/src/components/ImportExcel-normal/index.vue create mode 100644 vue/src/views/pg-fis/basedate/planControl/index.vue diff --git a/vue/src/components/ImportExcel-normal/index.vue b/vue/src/components/ImportExcel-normal/index.vue new file mode 100644 index 0000000..dbe2486 --- /dev/null +++ b/vue/src/components/ImportExcel-normal/index.vue @@ -0,0 +1,178 @@ + + + + + + 将文件拖到此处,或 + 点击上传 + + + + 取消 + 立即导入 + + + + + \ No newline at end of file diff --git a/vue/src/router/modules/fis.js b/vue/src/router/modules/fis.js index 265e0cd..0685eee 100644 --- a/vue/src/router/modules/fis.js +++ b/vue/src/router/modules/fis.js @@ -145,6 +145,16 @@ const pgfis = { //roles: ['SettleAccount.Reports'], icon: '客户零件' } + }, + { + path: '/pg-planControl', + component: () => import('@/views/pg-fis/basedate/planControl/index.vue'), + name: 'pg-planControl',//命名路由 + meta: { + title: '计划管理', + //roles: ['SettleAccount.Reports'], + icon: '客户零件' + } } ] } diff --git a/vue/src/views/pg-fis/basedate/planControl/index.vue b/vue/src/views/pg-fis/basedate/planControl/index.vue new file mode 100644 index 0000000..f6d36c4 --- /dev/null +++ b/vue/src/views/pg-fis/basedate/planControl/index.vue @@ -0,0 +1,558 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 搜索 + 重置 + 导出(Excel)查询信息 + + 导入 + + + + + + + + + + + {{ scope.column.label }} + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From 8f47014ff8323608f016f59f720c90d629c4d9f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=89=E8=99=B9=E7=9D=BF?= <297504645@qq.com> Date: Thu, 11 Jan 2024 09:22:48 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E3=80=90=E9=95=BF=E6=98=A5=E6=B4=BE?= =?UTF-8?q?=E6=A0=BC1.5=E3=80=91=E8=AE=A1=E5=88=92=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pg-fis/basedate/planControl/index.vue | 93 +------------------ 1 file changed, 2 insertions(+), 91 deletions(-) diff --git a/vue/src/views/pg-fis/basedate/planControl/index.vue b/vue/src/views/pg-fis/basedate/planControl/index.vue index f6d36c4..e475d18 100644 --- a/vue/src/views/pg-fis/basedate/planControl/index.vue +++ b/vue/src/views/pg-fis/basedate/planControl/index.vue @@ -233,21 +233,6 @@ @close="importClose" /> - - - - - - @@ -275,38 +260,16 @@ export default { name: "RepeatM100", - // components: { Pagination, CRMTableHead, importExcel, Detail }, components: { Pagination, CRMTableHead, importExcel }, directives: { permission }, - filters: { - IsCustomerSignFilter(status) { - //翻译是否签字 - const statusMap = { - true: "是", - false: "否", - }; - return statusMap[status]; - }, - }, mixins: [message_table], data() { return { - customerInfos: [], - isVINShowState:false, - versionValue: "", - customerInfosMB:[], - customerInfosZHB:[], - versionList: [], //版本列表 - searchContent: "", // 输入内容 showExcelImport: false, form: {}, - drawer: false, list: null, totalCount: 0, listLoading: true, - customerInfo: { - bomId: "", - }, listQuery: { factory:undefined, vin:undefined, @@ -327,34 +290,11 @@ SkipCount: 0, MaxResultCount: 15, }, - listPLQuery: { - BillType: 2, - //UserId: this.userinfo.UserId, - }, page: 1, - // 显示搜索条件 - // VehicleModelCodelist:[ - // {id: 1, name: "C8"}, - // {id: 2, name: "B8L"}, - // {id: 3, name: "CC"}, - // {id: 4, name: "BSMV"}, - // {id: 5, name: "B9"}, - // {id: 6, name: "Q5"}, - // ], - productTypeList: [ - { id: 1, name: "门板" }, - { id: 2, name: "柱护板" }, - ], showSearch: true, bomUnit, - PLList: [], - PLChildList: [], //筛选后产线下拉 multipleSelection: [], - drawer: false, - isShowState: true, - dialogTableVisible: false, - vehicleModelList:[],//车型list - //tableHeight: document.documentElement.clientHeight - 260, + tableHeight: document.documentElement.clientHeight - 260, }; }, mounted() { @@ -404,19 +344,6 @@ ...mapGetters(["userInfo"]), //获取当前用户信息 }, methods: { - //抽屉 - handleDrawerOpen(param) { - this.drawer = true; - var parentId = param.id; //传入的是总成id - this.customerInfos = [ - { - ParentId: parentId, - }, - ]; - }, - handleDrawerClose(done) { - done(); - }, /** 导出功能 */ handleDownload() { this.listLoading = true; @@ -455,7 +382,6 @@ }); }); }, - /** 重置按钮操作 */ resetQuery(refName) { this.$refs[refName].resetFields(); @@ -464,15 +390,6 @@ /** 搜索按钮操作 */ handleQuery() { this.listQuery.SkipCount = 1; - //this.getList(); - }, - selectValue(params) { - //版本下拉选择 - this.versionValue = params.value; - this.getList(); - }, - - selectOptionsChange(item) { this.getList(); }, //关闭导入窗体时调用 @@ -494,11 +411,6 @@ fieldFormatter(row, column) { return row[column.property] || "--"; }, - roleFilter(type) { - return projectTypeKeyValue[type]; - - }, - getList(data){ this.listLoading = true; if (data != undefined) { @@ -506,7 +418,6 @@ } else { this.listQuery.SkipCount = (this.page - 1) * this.listQuery.MaxResultCount; } - this.dialogTableVisible = true; this.$axios.gets("/api/newjit/import-record/list", this.listQuery) .then((response) => { this.list = response.items; @@ -521,13 +432,13 @@ }); }, handleFilter() { - this.dialogTableVisible = false; this.page = 1; this.getList(); }, sortChange(data) { const { prop, order } = data; if (!prop || !order) { + this.listQuery.Sorting = undefined this.handleFilter(); return; } From 9a2b97aa7ce60a067ffd6bf2dc3e3797ea9eb96d Mon Sep 17 00:00:00 2001 From: liuyunfeng Date: Mon, 15 Jan 2024 17:17:27 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E6=94=B9=20EXCEL=E6=8A=A5=E6=96=87?= =?UTF-8?q?=E5=AF=BC=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Services/EdiParseDomainService.cs | 419 ++ .../Services/HQ_CacheManagerDomainService.cs | 249 + .../Services/HQ_M100DomainService.cs | 209 + .../Services/LastImportHostSNDomainService.cs | 73 + .../MsgBaseData/Entitys/AssemblyCfgErp.cs | 10 + .../MsgBaseData/Entitys/AssemblyCfgGroup.cs | 11 + .../Entitys/Group_Assembly_Part.cs | 52 + .../MsgCheck/Entitys/BillM100.cs | 16 +- .../Services/BillNumberRecordDomainService.cs | 3 + .../Services/CacheManagerDomainService.cs | 5 +- .../MsgCheck/Services/M100DomainService.cs | 345 +- .../Services/R100CheckDomainService.cs | 42 + .../WY.NewJit.Domain/WY.NewJit.Domain.csproj | 1 - ...0240110033428_NewJitPG_HQ_0110.Designer.cs | 6126 ++++++++++++++++ .../20240110033428_NewJitPG_HQ_0110.cs | 41 + ...0240115023640_NewJitPG_HQ_Init.Designer.cs | 6132 ++++++++++++++++ .../20240115023640_NewJitPG_HQ_Init.cs | 33 + ...240115024450_NewJitPG_HQ_Init2.Designer.cs | 6134 ++++++++++++++++ .../20240115024450_NewJitPG_HQ_Init2.cs | 53 + ...240115055730_NewJitPG_HQ_Init3.Designer.cs | 6142 +++++++++++++++++ .../20240115055730_NewJitPG_HQ_Init3.cs | 35 + .../NewJitMigrationsDbContextModelSnapshot.cs | 57 + .../NewJitDbContextModelCreatingExtensions.cs | 7 +- 23 files changed, 26015 insertions(+), 180 deletions(-) create mode 100644 src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/EdiReceive/Services/EdiParseDomainService.cs create mode 100644 src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/EdiReceive/Services/HQ_CacheManagerDomainService.cs create mode 100644 src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/EdiReceive/Services/HQ_M100DomainService.cs create mode 100644 src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/EdiReceive/Services/LastImportHostSNDomainService.cs create mode 100644 src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.EntityFrameworkCore.DbMigrations/Migrations/20240110033428_NewJitPG_HQ_0110.Designer.cs create mode 100644 src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.EntityFrameworkCore.DbMigrations/Migrations/20240110033428_NewJitPG_HQ_0110.cs create mode 100644 src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.EntityFrameworkCore.DbMigrations/Migrations/20240115023640_NewJitPG_HQ_Init.Designer.cs create mode 100644 src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.EntityFrameworkCore.DbMigrations/Migrations/20240115023640_NewJitPG_HQ_Init.cs create mode 100644 src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.EntityFrameworkCore.DbMigrations/Migrations/20240115024450_NewJitPG_HQ_Init2.Designer.cs create mode 100644 src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.EntityFrameworkCore.DbMigrations/Migrations/20240115024450_NewJitPG_HQ_Init2.cs create mode 100644 src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.EntityFrameworkCore.DbMigrations/Migrations/20240115055730_NewJitPG_HQ_Init3.Designer.cs create mode 100644 src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.EntityFrameworkCore.DbMigrations/Migrations/20240115055730_NewJitPG_HQ_Init3.cs diff --git a/src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/EdiReceive/Services/EdiParseDomainService.cs b/src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/EdiReceive/Services/EdiParseDomainService.cs new file mode 100644 index 0000000..f8508dc --- /dev/null +++ b/src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/EdiReceive/Services/EdiParseDomainService.cs @@ -0,0 +1,419 @@ +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.Logging; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Volo.Abp; +using Volo.Abp.Domain.Repositories; +using Volo.Abp.Domain.Services; +using WY.NewJit.EdiReceive.Entitys; +using WY.NewJit.IRepositories; +using WY.NewJit.MsgBaseData; +using WY.NewJit.MsgCheck; +using WY.NewJit.Common; +using WY.NewJit.MsgBaseData.Entitys; + +namespace WY.NewJit.EdiReceive.Services +{ + /// + /// 红旗报文接收 + /// + public class EdiParseDomainService : DomainService + { + #region 成员 + /// + /// 日志 + /// + private readonly ILogger _logger; + + /// + /// Dapper仓储 + /// + private readonly INewJitDapperRepository _newJitDapperRepository; + + /// + /// 字典领域服务 + /// + private readonly DicDomainService _dicDomainService; + + /// + /// 零件仓储 + /// + private readonly IRepository _importRecordRepository; + + /// + /// M100单据 + /// + private readonly IRepository _billM100Repository; + + /// + /// ERP总成分组仓库 + /// + private readonly IRepository _assemblyCfgGroupRepository; + + /// + /// ERP总成仓储 + /// + private readonly IRepository _assemblyCfgErpRepository; + + /// + /// 整车总成配置仓库 + /// + private readonly IRepository _assemblyCfgVehicleRepository; + + + private readonly LastImportHostSNDomainService _lastImportHostSNDomainService; + + private readonly HQ_CacheManagerDomainService _hqCacheManagerDomainService; + + private readonly HQ_M100DomainService _hqM100DomainServie; + + /// + /// 重复M100 + /// + private readonly IRepository _repeatM100Repository; + + /// + /// 未知总成维护 + /// + private readonly IRepository _unknownAssemblyRepository; + + + /// + /// 报文车型对应零件生产工厂车型 + /// + private static List _msgToPaiGeVehicleModelList = new List(); + + /// + /// M100零件生产工厂车型对应生产线 + /// + private static List _m100VehicleModelProductLineList = new List(); + + /// + /// 根据车型代码中的前两位(HS),过滤属于派格的订单;只针对派格的订单进行报文解析 + /// + private const string _vehicleModelPrefix = "HS"; + + /// + /// 错误信息前缀 + /// + private string _errorMessagePrefix + { + get + { + return System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "."; + } + } + + + #endregion + public EdiParseDomainService(ILogger logger, INewJitDapperRepository newJitDapperRepository, DicDomainService dicDomainService, IRepository importRecordRepository, IRepository billM100Repository, LastImportHostSNDomainService lastImportHostSNDomainService, IRepository assemblyCfgGroupRepository = null, IRepository assemblyCfgErpRepository = null, IRepository assemblyCfgVehicleRepository = null, HQ_CacheManagerDomainService hqCacheManagerDomainService = null, HQ_M100DomainService hqM100DomainServie = null, IRepository repeatM100Repository = null, IRepository unknownAssemblyRepository = null) + { + _logger = logger; + _newJitDapperRepository = newJitDapperRepository; + _dicDomainService = dicDomainService; + _importRecordRepository = importRecordRepository; + _billM100Repository = billM100Repository; + _lastImportHostSNDomainService = lastImportHostSNDomainService; + + _msgToPaiGeVehicleModelList = _dicDomainService.GetDicItems(DicTypeName.报文车型对应派格车型); + _m100VehicleModelProductLineList = _dicDomainService.GetDicItems(DicTypeName.M100派格车型对应生产线); + _assemblyCfgGroupRepository = assemblyCfgGroupRepository; + _assemblyCfgErpRepository = assemblyCfgErpRepository; + _assemblyCfgVehicleRepository = assemblyCfgVehicleRepository; + + _hqCacheManagerDomainService = hqCacheManagerDomainService; + _hqM100DomainServie = hqM100DomainServie; + _repeatM100Repository = repeatM100Repository; + _unknownAssemblyRepository = unknownAssemblyRepository; + } + + /// + /// 解析报文 + /// + /// + public async Task ParseEdi(List input, bool forceExecute = false) + { + ObjectResultDto ret = new ObjectResultDto(); + //取本次导入的最小HostSN + int minHostSN = input.Min(itm => itm.HostSN); + //上次导入的最大HostSN + int lastHostSN = await _lastImportHostSNDomainService.GetLastImportHostSN(); + string betweenBreakNumMsg = ""; + if (minHostSN <= lastHostSN + 1) + { + } + else + { + if (forceExecute == false) + { + //两次导入断号提醒 + betweenBreakNumMsg = $"两次导入断号提醒:本次导入的最小流水号是:{minHostSN},上次导入的最大流水号是:{lastHostSN}"; + } + } + //扣除重复导入的订单 + List notRepeatOrder = await GetNotRepeatOrder(input); + + #region 断号提醒 + string breakNumMsg = ""; + notRepeatOrder = notRepeatOrder.OrderBy(itm => itm.HostSN).ToList(); + for (int curIdx = 1; curIdx < notRepeatOrder.Count; curIdx++) + { + int curVal = notRepeatOrder[curIdx].HostSN; + int priorIdx = curIdx - 1; + int priorVal = notRepeatOrder[priorIdx].HostSN; + if (curVal - priorVal != 1) + { + breakNumMsg += $"流水号{priorVal}和{curVal}之间存在断号\r\n"; + } + } + if (betweenBreakNumMsg.HasValue() || breakNumMsg.HasValue()) + { + if (forceExecute == false) + { + //断号提醒 + ret.Status = true; + ret.Message = betweenBreakNumMsg + breakNumMsg; + return ret; + } + } + #endregion + //批量插入 导入记录 + await _importRecordRepository.InsertManyAsync(notRepeatOrder); + + //初始化缓存 + _hqCacheManagerDomainService.InitLoadCache(); + + //过滤掉其它订单,只取派格订单 + var paigeOrderLst = notRepeatOrder.Where(itm => itm.VehicleModelCode.Substring(0, 2) == _vehicleModelPrefix).OrderBy(itm => itm.HostSN).ToList(); + foreach (ImportRecord orderItem in paigeOrderLst) + { + #region 构建M100实体 + BillM100 m100Obj = new BillM100(GuidGenerator.Create()); + m100Obj.MessageFileReceiveID = orderItem.Id; + m100Obj.SerialNum = ServerHelper.VinToSN(orderItem.Vin); + m100Obj.SerialNumStr = ServerHelper.ToSerialNumStr(orderItem.OnlineTime, orderItem.HostSN); + m100Obj.HostSN = orderItem.HostSN; + m100Obj.HostSN2 = orderItem.HostSN; //流水号 + m100Obj.KNR = orderItem.VehicleBodyCode; + m100Obj.VIN = orderItem.Vin; + m100Obj.AssemblyID = null; + m100Obj.OnlineTime = orderItem.OnlineTime; + m100Obj.VehicleModelCode = orderItem.VehicleBodyCode; + m100Obj.ProductLine = ""; + m100Obj.Version = ""; + m100Obj.ReceiveTime = ServerHelper.CurrentDateTime; + m100Obj.BillStatus = BillStatusEnum.NotMatch; + m100Obj.Description = ""; + //m100Obj.OperationType = operationType; + //m100Obj.Operator = @operator; + //m100Obj.OperationTime = operationTime; + m100Obj.CanNotPrint = false; + m100Obj.NeedReplenishPrint = 0; + m100Obj.IsPartSwitch = false; + #endregion + + UpdateProductLine(m100Obj); + string snStr = ServerHelper.ToSerialNumStr(m100Obj.OnlineTime, m100Obj.HostSN); + m100Obj.SetSerialNumStr(snStr); + + //重复报文 + bool isRepeat = _billM100Repository.Any(itm => itm.HostSN == orderItem.HostSN && itm.VIN == orderItem.Vin); + if (isRepeat == true) + { + #region 重复报文 + var succObj = InsertM100RepeatBill(orderItem, m100Obj); + _logger.LogDebug(_errorMessagePrefix + $"流水号{orderItem.HostSN}是重复报文"); + ret.Status = (succObj != null); + return ret; + #endregion + } + + //绑定总成分组 + string colorExplain = orderItem.VehicleModelDesc.Trim().Right(7); + + Group_Assembly groupAssemblyObj = HQ_CacheManagerDomainService._groupAssemblyList.FirstOrDefault(itm => itm.SpecExplain == orderItem.SpecDesc && itm.ColorExplain == colorExplain); + if (groupAssemblyObj != null) + { + #region 插入整车总成 + Guid vehicleAssemblyId = GuidGenerator.Create(); + AssemblyCfgVehicle vehicleAssemblyCfgObj = new AssemblyCfgVehicle(vehicleAssemblyId, null, "", null, true); + foreach (OnlyAssemblyInfo assemblyItem in groupAssemblyObj.AssemblyDetails) //插入子表 + { + vehicleAssemblyCfgObj.AddChildObj(GuidGenerator.Create(), assemblyItem.Id); + } + var vehicleAssemblyResu = await _assemblyCfgVehicleRepository.InsertAsync(vehicleAssemblyCfgObj, true); + if (vehicleAssemblyResu == null) + { + throw new Exception("插入整车总成返回结果为空InsertAsync!"); + } + #endregion + + //插入M100、未打印表 + m100Obj.SetAssemblyID(vehicleAssemblyResu.Id); + var insM100Ret = await _hqM100DomainServie.InsertM100(m100Obj, true); + } + else + { + //未知总成 + _logger.LogDebug(_errorMessagePrefix + $"未匹配总成,插入未知总成开始:{orderItem.HostSN}"); + //更新单据表 + m100Obj.SetAssemblyID(null); + m100Obj.SetBillStatus(BillStatusEnum.NotMatch); + var succObj1 = await _hqM100DomainServie.InsertM100(m100Obj, true); + + //不匹配时,插入未知总成 + var succObj2 = await InsertUnknownAssembly(m100Obj); + _logger.LogDebug(_errorMessagePrefix + $"未匹配总成,插入未知总成完成:{orderItem.HostSN}"); + ret.Status = (succObj1 != null && succObj2 != null); + } + + } + + /* + 一、导入记录表 + 1. 从客户网站导出EXCEL格式的订单列表 + 2. 校验 本次导入的最小HostSN必须<= 上次导入的最大HostSN + 1 (上次是10, 本次可以是 9 10 11,不能是12) + 3. 根据VIN和HostSN,扣除重复导入的记录 + 4. 断号提醒:导入Excel时,如果系统中的流水号不能顺序连接,需要给出提醒,是否继续导入,如果选择继续导入,仍可以导入到系统中 + 5. 最后导入到本系统中 impRecLst + + 二、插入M100 + 1. 根据车型代码中的前两位(HS),过滤属于派格的订单;只针对派格的订单进行报文解析 + 2. 根据VIN判断是否重复报文,将重复报文放到“重复报文表” + 3. 通过车型描述中的颜色(条件一)和规格说明(条件二)两个字段能够定位到该底盘对应哪个总成组(4个总成一组)。如果匹配将订单和总成组进行绑定;如果不匹配将订单放入未知总成 + 4. 插入M100 (更新派格车型、 生产线) + 5. 插入WaitPrint + */ + ret.Status = true; + return ret; + } + + /// + /// 根据流水号、VIN 扣除重复导入的订单 + /// + /// + /// + private async Task> GetNotRepeatOrder(List input) + { + List notRepeatLst = new List(); + + List importHistoryLst = await _importRecordRepository.AsQueryable() + .OrderBy(itm => itm.HostSN) + .TakeLast(10000) + .ToListAsync(); + foreach (ImportRecord item in input) + { + bool hasData = importHistoryLst.Any(itm => itm.HostSN == item.HostSN && itm.Vin == item.Vin); + if (hasData) + { + } + else + { + notRepeatLst.Add(item); + } + } + return notRepeatLst; + } + + /// + /// 更新车型、生产线 + /// + /// + private void UpdateProductLine(BillM100 bill) + { + string ediVehicleModel = bill.VehicleModelCode; //报文车型 + //车型转换:3H 转 CC + var obj1 = _msgToPaiGeVehicleModelList.FirstOrDefault(itm => itm.DicItemCode == ediVehicleModel); + if (obj1 != null) + { + string paigeVehicleModel = obj1.DicItemName; // CC + if (paigeVehicleModel.Contains('-')) //去掉B8L-PHEV中的-PHEV + { + paigeVehicleModel = paigeVehicleModel.Split('-')[0]; + } + bill.SetVehicleModelCode(paigeVehicleModel); + //根据车型取对应生产线 + var obj2 = _m100VehicleModelProductLineList.FirstOrDefault(itm => itm.DicItemCode == paigeVehicleModel); + if (obj2 != null) + { + string productLine = obj2.DicItemName; + bill.SetProductLine(productLine); + } + else + { + string errorMsg = $"零件生产工厂车型{paigeVehicleModel}没有对应的生产线!"; + _logger.LogError(errorMsg); + } + } + else //报文车型 没有对应的 派格车型 + { + string errorMsg = $"报文车型{ediVehicleModel}没有对应的零件生产工厂车型!"; + _logger.LogError(errorMsg); + } + } + + private RepeatM100 InsertM100RepeatBill(ImportRecord impordRec, BillM100 m100Bill) //, int? maxSerialNum + { + RepeatM100 ret = null; + int newSN = ServerHelper.VinToSN(m100Bill.VIN); + RepeatM100 repeatBill = new RepeatM100( + GuidGenerator.Create(), + impordRec.Id, + newSN, + m100Bill.HostSN, + m100Bill.KNR, + m100Bill.VIN, + null, + m100Bill.OnlineTime, + ServerHelper.CurrentDateTime, + m100Bill.VehicleModelCode, + m100Bill.ProductLine, + ((DateTime)m100Bill.OnlineTime).ToString("yyyyMM"), + BillStatusEnum.None + ); + + //零件子表赋值 + foreach (BillM100Part m100Part in m100Bill.BillM100Parts) + { + repeatBill.AddChildObj(GuidGenerator.Create(), m100Part.PartCode, m100Part.PartNum, m100Part.Description); + } + //插入重复单据 + ret = _repeatM100Repository.InsertAsync(repeatBill, true).GetAwaiter().GetResult(); + return ret; + } + + /// + /// 不匹配时,插入未知总成,写提醒日志 + /// + /// + private async Task InsertUnknownAssembly(BillM100 bill) + { + UnknownAssembly ret = null; + try + { + //插入未知总成 + UnknownAssembly unknownAssemblyObj = new UnknownAssembly(GuidGenerator.Create(), bill.Id, "M100"); + //预批量赋值 + unknownAssemblyObj.Description = bill.Description; //描述字段保存预批量信息 + + //foreach (BillM100Part billPart in bill.BillM100Parts) + //{ + // unknownAssemblyObj.AddChildObj(GuidGenerator.Create(), billPart.PartCode, billPart.PartNum, billPart.Description); + //} + //var partNumSum = unknownAssemblyObj.UnknownAssemblyParts.Sum(itm => (int)itm.PartNum); + //unknownAssemblyObj.SetPartNum(partNumSum); + ret = await _unknownAssemblyRepository.InsertAsync(unknownAssemblyObj); + return ret; + } + catch (Exception ex) + { + throw new Exception($"InsertUnknownAssembly方法报错:" + ex.Message); + } + } + + + } +} diff --git a/src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/EdiReceive/Services/HQ_CacheManagerDomainService.cs b/src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/EdiReceive/Services/HQ_CacheManagerDomainService.cs new file mode 100644 index 0000000..fb14158 --- /dev/null +++ b/src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/EdiReceive/Services/HQ_CacheManagerDomainService.cs @@ -0,0 +1,249 @@ +using Microsoft.Extensions.Logging; +using System; +using System.Collections.Concurrent; +using System.Collections.Generic; +using System.Diagnostics; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Volo.Abp.DependencyInjection; +using Volo.Abp.Domain.Repositories; +using Volo.Abp.Guids; +using Volo.Abp.Uow; +using WY.NewJit.Common; +using WY.NewJit.MsgBaseData; +using WY.NewJit.MsgCheck; +using WY.NewJit.IRepositories; +using WY.NewJit.MsgBaseData.Entitys; + +namespace WY.NewJit.EdiReceive.Services +{ + public partial class HQ_CacheManagerDomainService : ITransientDependency + { + #region 仓储 + + /// + /// 日志 + /// + private ILogger _logger; + + /// + /// 配置 + /// + private readonly Microsoft.Extensions.Configuration.IConfiguration _configuration; + + /// + /// Dapper仓储 + /// + private readonly INewJitDapperRepository _newJitDapperRepository; + + /// + /// 字典领域服务 + /// + private readonly DicDomainService _dicDomainService; + + /// + /// 跨进程全局配置领域服务 + /// + private readonly GlobalSettingsDomainService _globalSettingsDomainService; + #endregion + + #region 缓存 + public static List _erpAssemblyMainList = new List(); + + /// + /// 分组VS总成关系 + /// + //public static List _group2assemblyList = new List(); + + /// + /// 分组对应多个总成 清单- + /// + public static List _groupAssemblyList = new List(); + + + /// + /// 结算件切换列表 + /// + public static List _partSwitchList = new List(); + + /// + /// 报文车型VS派格车型 + /// + public static List _msgToPaiGeVehicleModelList = new List(); + + /// + /// R100派格车型VS生产线 + /// + public static List _r100VehicleModelProductLineList = new List(); + + /// + /// M100派格车型VS生产线 + /// + public static List _m100VehicleModelProductLineList = new List(); + + /// + /// 结算件信息列表 + /// + public static List _partCfgList = new List(); + + #endregion + + #region 变量 + /// + /// 错误信息前缀 + /// + private string _errorMessagePrefix + { + get + { + return System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "."; + } + } + + /// + /// 上一次缓存刷新时间,和配置文件中RefreshCacheIntervalInMinutes一起使用 + /// + private DateTime _lastRefreshCacheTime = DateTime.Now; + + #endregion + + #region 构造函数 + /// + /// 构造函数 + /// + public HQ_CacheManagerDomainService( + ILogger logger, + Microsoft.Extensions.Configuration.IConfiguration configuration, + INewJitDapperRepository newJitDapperRepository, + DicDomainService dicDomainService, + GlobalSettingsDomainService globalSettingsDomainService + ) + { + _logger = logger; + _configuration = configuration; + _newJitDapperRepository = newJitDapperRepository; + _dicDomainService = dicDomainService; + _globalSettingsDomainService = globalSettingsDomainService; + } + #endregion + + + #region 方法 + public bool InitLoadCache(bool forceRefresh = false) + { + bool ret = false; + try + { + if (forceRefresh == true) + { + DoInitLoadCache(); + //结算件信息列表,库存系统同步过来,无法缓存 + DoInitPartCfg(); + ret = true; + } + else + { + bool isFirstRun = (_partCfgList.Any() == false); //第一次执行 + if (isFirstRun) + { + DoInitLoadCache(); + ret = true; + } + else //不是第一次执行 + { + //判断是否需要刷新 + bool isRefresh = _globalSettingsDomainService.GetSetting(GlobalSettingsNameEnum.刷新报文解析缓存); + if (isRefresh) + { + DoInitLoadCache(); + _globalSettingsDomainService.SetSetting(GlobalSettingsNameEnum.刷新报文解析缓存, false); + } + else + { + #region 10分钟自动刷新一次缓存 + int refCacheInterval = _configuration["ConfigDic:RefreshCacheIntervalInMinutes"]?.TryToInt() ?? 10; + DateTime nowRefreshCacheTime = DateTime.Now; + TimeSpan ts = nowRefreshCacheTime - _lastRefreshCacheTime; + if (ts.TotalMinutes >= refCacheInterval) + { + DoInitLoadCache(); + _lastRefreshCacheTime = DateTime.Now; + } + #endregion + ret = true; + } + } + //结算件信息列表,库存系统同步过来,无法缓存 + DoInitPartCfg(); + } + return ret; + } + catch (Exception ex) + { + string errorMsg = _errorMessagePrefix + "调用InitLoadCache方法时报错:" + ex.Message; + throw new Exception(errorMsg); + } + } + + /// + /// 报文解析前加载缓存 + /// + public void DoInitLoadCache() + { + //取ERP总成主表 + string erpMainSql = "select Id, VehicleModel from FisAssemblyCfgErp where NewVersionId is null order by ErpAssemblyVersion, CreationTime desc"; + _erpAssemblyMainList = _newJitDapperRepository.GetListBySql(erpMainSql, true); + + //取ERP总成的零件 + string group2assemblySql = @" + select g.Id as GroupId, g.GroupCode, g.VehicleModel, e.Id as ErpAssemblyId, e.ErpAssemblyCode, + g.SpecExplain, g.ColorExplain + from FisAssemblyCfgGroup g + join FisAssemblyCfgErp e on g.Id = e.GroupId + where IsDeleted = 0 and g.IsDisable = 0 + order by g.CreationTime desc + "; + var group2assemblyList = _newJitDapperRepository.GetListBySql(group2assemblySql, true); + //转换成分组、总成 两层结构 + List _groupAssemblyList = group2assemblyList.GroupBy(itm => itm.GroupId).Select(itm => new Group_Assembly + { + Id = itm.Key, + GroupCode = itm.ElementAt(0).GroupCode, + SpecExplain = itm.ElementAt(0).SpecExplain, + ColorExplain = itm.ElementAt(0).ColorExplain, + + AssemblyDetails = itm.Select(itm2 => new OnlyAssemblyInfo + { + Id = itm2.ErpAssemblyId, + ErpAssemblyCode = itm2.ErpAssemblyCode, + ErpAssemblyName = itm2.ErpAssemblyName + }).ToList() + + }).ToList(); + + + //结算件切换列表 + string partSwitchSql = "select SourcePartCode, TargetPartCode, ActiveBeginTime, ActiveEndTime from FisPartSwitch"; + _partSwitchList = _newJitDapperRepository.GetListBySql(partSwitchSql, true); + + _msgToPaiGeVehicleModelList = _dicDomainService.GetDicItems(DicTypeName.报文车型对应派格车型); + _r100VehicleModelProductLineList = _dicDomainService.GetDicItems(DicTypeName.R100派格车型对应生产线); + _m100VehicleModelProductLineList = _dicDomainService.GetDicItems(DicTypeName.M100派格车型对应生产线); + _logger.LogDebug("重新刷新报文解析缓存!"); + } + + /// + /// 初始化零件基本信息 + /// + private void DoInitPartCfg() + { + //结算件信息列表,库存系统同步过来,无法缓存 + string partCfgSql = @"select Id, PartCode, PartName, PartType, Description, PartType2, PartType3, RelationKey from FisPartCfg where 1=1"; //,DaXiaoLiangGang,DoorPlankCode,MaterialDescription,SAPMaterialNum + _partCfgList = _newJitDapperRepository.GetListBySql(partCfgSql, true); + + } + #endregion + } +} diff --git a/src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/EdiReceive/Services/HQ_M100DomainService.cs b/src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/EdiReceive/Services/HQ_M100DomainService.cs new file mode 100644 index 0000000..b0be7e4 --- /dev/null +++ b/src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/EdiReceive/Services/HQ_M100DomainService.cs @@ -0,0 +1,209 @@ +using Microsoft.Extensions.Logging; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Volo.Abp.Domain.Repositories; +using Volo.Abp.Domain.Services; +using WY.NewJit.PrintTable; +using WY.NewJit.Common; + +namespace WY.NewJit.MsgCheck +{ + public class HQ_M100DomainService : DomainService + { + /// + /// M100单据 + /// + private readonly IRepository _billM100Repository; + + /// + /// 日志 + /// + private ILogger _logger; + + /// + /// 未打印表 + /// + private readonly IRepository _waitPrintRepository; + + public HQ_M100DomainService( + IRepository billM100Repository, + ILogger logger, + IRepository waitPrintRepository + ) + { + _billM100Repository = billM100Repository; + _logger = logger; + _waitPrintRepository = waitPrintRepository; + } + + public async Task InsertM100(BillM100 m100Obj, bool autoSave = false, bool isBatchImportBreakNum = false) + { + BillM100 m100Ret = null; + + if (isBatchImportBreakNum) //批量导入断号模块调用 + { + //更新M100 + m100Obj.HostSN2 = 0; + //M100转换成WaitPrint:一个底盘、08产线插入3条记录,其它产线插入1条记录 + WaitPrint[] wpArr2 = M100ConvertToWaitPrint(m100Obj); + + foreach (var wp in wpArr2) + { + wp.PrintType = PrintTypeEnum.ReplenishPrint; + //wp.HostSN2 = 0; //WaitPrint的HostSN2从m100的HostSN2取值 + } + m100Ret = await _billM100Repository.InsertAsync(m100Obj, autoSave); //插入M100 + await _waitPrintRepository.InsertManyAsync(wpArr2, autoSave); //插入未打印表 + return m100Ret; + } + + //M100转换成WaitPrint:一个底盘、08产线插入3条记录,其它产线插入1条记录 + WaitPrint[] wpArr = M100ConvertToWaitPrint(m100Obj); + + m100Ret = await _billM100Repository.InsertAsync(m100Obj, autoSave); //插入M100 + await _waitPrintRepository.InsertManyAsync(wpArr, autoSave); //插入未打印表 + return m100Ret; + } + + private WaitPrint[] M100ConvertToWaitPrint(BillM100 m100Obj) + { + WaitPrint[] wpArr; + WaitPrint mbRec = ConvertWaitPrint(m100Obj, BusinessTypeEnum.MenBan); + wpArr = new WaitPrint[1] { mbRec }; + return wpArr; + } + + public async Task UpdateM100(BillM100 m100Obj, bool autoSave = false) + { + var m100Ret = await _billM100Repository.UpdateAsync(m100Obj, autoSave); + if (m100Ret != null) + { + + //更新已解析状态时,只涉及门板、不涉及柱护板【柱护板一对一解析成功】 + List wpLst = await _waitPrintRepository.GetListAsync(itm => itm.M100Id == m100Ret.Id && itm.BusinessType == BusinessTypeEnum.MenBan); + foreach (var wp in wpLst) + { + wp.AssemblyID = m100Ret.AssemblyID; + wp.BillStatus = m100Ret.BillStatus; + } + await _waitPrintRepository.UpdateManyAsync(wpLst, autoSave); + + + return m100Ret; + } + return null; + } + + private WaitPrint ConvertWaitPrint(BillM100 m100Ret, BusinessTypeEnum businessType) + { + WaitPrint waitPrint = new WaitPrint(GuidGenerator.Create()); + ConvertWaitPrint(m100Ret, businessType, waitPrint); + return waitPrint; + } + + private void ConvertWaitPrint(BillM100 m100Ret, BusinessTypeEnum businessType, WaitPrint waitPrint) + { + waitPrint.M100Id = m100Ret.Id; + waitPrint.BusinessType = businessType; + waitPrint.ProductLine = m100Ret.ProductLine; + waitPrint.OnlineTime = (DateTime)m100Ret.OnlineTime; + waitPrint.HostSN = (int)m100Ret.HostSN; + waitPrint.KNR = m100Ret.KNR; + waitPrint.VIN = m100Ret.VIN; + waitPrint.VehicleModelCode = m100Ret.VehicleModelCode; + waitPrint.AssemblyID = m100Ret.AssemblyID; + if (businessType == BusinessTypeEnum.MenBan) + { + waitPrint.BillStatus = m100Ret.BillStatus; + } + else + { + waitPrint.BillStatus = BillStatusEnum.Match; //柱护板默认是匹配状态 + } + waitPrint.PrintType = PrintTypeEnum.OrderPrint; + waitPrint.HostSN2 = (int)m100Ret.HostSN2; + waitPrint.Description = m100Ret.Description; + waitPrint.ReceiveTime = m100Ret.ReceiveTime; + waitPrint.CreationTime = ServerHelper.CurrentDateTime; //m100Ret.CreationTime; + waitPrint.CreatorId = m100Ret.CreatorId; + waitPrint.LastModificationTime = m100Ret.LastModificationTime; + waitPrint.LastModifierId = m100Ret.LastModifierId; + } + + private void Set_WaitPrint(WaitPrint sourceWaitPrint, WaitPrint targetWaitPrint) + { + targetWaitPrint.M100Id = sourceWaitPrint.M100Id; + targetWaitPrint.BusinessType = sourceWaitPrint.BusinessType; + targetWaitPrint.ProductLine = sourceWaitPrint.ProductLine; + targetWaitPrint.OnlineTime = sourceWaitPrint.OnlineTime; + targetWaitPrint.HostSN = sourceWaitPrint.HostSN; + targetWaitPrint.KNR = sourceWaitPrint.KNR; + targetWaitPrint.VIN = sourceWaitPrint.VIN; + targetWaitPrint.VehicleModelCode = sourceWaitPrint.VehicleModelCode; + targetWaitPrint.AssemblyID = sourceWaitPrint.AssemblyID; + targetWaitPrint.BillStatus = sourceWaitPrint.BillStatus; + targetWaitPrint.PrintType = sourceWaitPrint.PrintType; + targetWaitPrint.HostSN2 = sourceWaitPrint.HostSN2; + targetWaitPrint.Description = sourceWaitPrint.Description; + targetWaitPrint.ReceiveTime = sourceWaitPrint.ReceiveTime; + targetWaitPrint.CreationTime = sourceWaitPrint.CreationTime; + targetWaitPrint.CreatorId = sourceWaitPrint.CreatorId; + targetWaitPrint.LastModificationTime = sourceWaitPrint.LastModificationTime; + targetWaitPrint.LastModifierId = sourceWaitPrint.LastModifierId; + } + + public async Task>> GetM100PartDic(List m100IdLst) + { + List m100Lst = await _billM100Repository.GetListAsync(itm => m100IdLst.Contains(itm.Id), true); + Dictionary> ret = m100Lst.ToDictionary(itm => itm.Id, itm2 => itm2.BillM100Parts); + return ret; + } + + /// + /// 根据M100插入或更新未打印表,【未知总成重新解析时调用】 + /// + /// + /// + public async Task InsertOrUpdateWaitPrintByM100(BillM100 m100Obj, bool autoSave = false) + { + ObjectResultDto ret = new ObjectResultDto(true, ""); + List wpLst = await _waitPrintRepository.GetListAsync(itm => itm.VIN == m100Obj.VIN && itm.BusinessType == BusinessTypeEnum.MenBan); + bool hasData = wpLst.Count > 0; + if (hasData) //未打印表有数据 + { + foreach (WaitPrint wp in wpLst) + { + wp.AssemblyID = m100Obj.AssemblyID; + wp.BillStatus = m100Obj.BillStatus; + } + await _waitPrintRepository.UpdateManyAsync(wpLst, autoSave); + } + else //未打印表没有数据 + { + WaitPrint[] wpArr; + if (m100Obj.ProductLine == "08") + { + WaitPrint mbRec = ConvertWaitPrint(m100Obj, BusinessTypeEnum.MenBan); + //WaitPrint zhbOtherRec = ConvertWaitPrint(m100Obj, BusinessTypeEnum.OtherZhuHuBan); + //WaitPrint zhbRec = ConvertWaitPrint(m100Obj, BusinessTypeEnum.AC_ZhuHuBan); + //wpArr = new WaitPrint[3] { mbRec, zhbOtherRec, zhbRec }; + wpArr = new WaitPrint[1] { mbRec }; + } + else + { + WaitPrint mbRec = ConvertWaitPrint(m100Obj, BusinessTypeEnum.MenBan); + wpArr = new WaitPrint[1] { mbRec }; + } + foreach (WaitPrint wp in wpArr) + { + wp.PrintType = PrintTypeEnum.ReplenishPrint; + } + await _waitPrintRepository.InsertManyAsync(wpArr, autoSave); //插入未打印表 + } + return ret; + } + } +} diff --git a/src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/EdiReceive/Services/LastImportHostSNDomainService.cs b/src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/EdiReceive/Services/LastImportHostSNDomainService.cs new file mode 100644 index 0000000..17c519c --- /dev/null +++ b/src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/EdiReceive/Services/LastImportHostSNDomainService.cs @@ -0,0 +1,73 @@ +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.Logging; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Volo.Abp.Domain.Repositories; +using Volo.Abp.Domain.Services; +using WY.NewJit.EdiReceive.Entitys; +using WY.NewJit.IRepositories; +using WY.NewJit.MsgBaseData; +using WY.NewJit.MsgCheck; + +namespace WY.NewJit.EdiReceive.Services +{ + public class LastImportHostSNDomainService : DomainService + { + #region 成员 + /// + /// 日志 + /// + private readonly ILogger _logger; + + /// + /// Dapper仓储 + /// + private readonly INewJitDapperRepository _newJitDapperRepository; + + /// + /// 字典领域服务 + /// + private readonly DicDomainService _dicDomainService; + + /// + /// 零件仓储 + /// + private readonly IRepository _importRecordRepository; + + /// + /// M100单据 + /// + private readonly IRepository _billM100Repository; + + private readonly IRepository _lastImportHostSNRepository; + + #endregion + public LastImportHostSNDomainService(ILogger logger, INewJitDapperRepository newJitDapperRepository, DicDomainService dicDomainService, IRepository importRecordRepository, IRepository billM100Repository, IRepository lastImportHostSNRepository) + { + _logger = logger; + _newJitDapperRepository = newJitDapperRepository; + _dicDomainService = dicDomainService; + _importRecordRepository = importRecordRepository; + _billM100Repository = billM100Repository; + _lastImportHostSNRepository = lastImportHostSNRepository; + } + + public async Task GetLastImportHostSN() + { + var lst = await _lastImportHostSNRepository.GetListAsync(); + if (lst.Count > 0) + { + return lst[0].HostSN; + } + else + { + int maxSN = await _lastImportHostSNRepository.MaxAsync(itm => itm.HostSN); + return maxSN; + } + } + + } +} diff --git a/src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/MsgBaseData/Entitys/AssemblyCfgErp.cs b/src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/MsgBaseData/Entitys/AssemblyCfgErp.cs index 9e1d59d..8d4eefd 100644 --- a/src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/MsgBaseData/Entitys/AssemblyCfgErp.cs +++ b/src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/MsgBaseData/Entitys/AssemblyCfgErp.cs @@ -52,6 +52,16 @@ namespace WY.NewJit.MsgBaseData /// public virtual Guid GroupId { get; set; } + /// + /// 规格说明 + /// + public virtual string SpecExplain { get; set; } + + /// + /// 颜色说明 + /// + public virtual string ColorExplain { get; set; } + /// /// 结算件列表 /// diff --git a/src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/MsgBaseData/Entitys/AssemblyCfgGroup.cs b/src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/MsgBaseData/Entitys/AssemblyCfgGroup.cs index f197491..02ae18f 100644 --- a/src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/MsgBaseData/Entitys/AssemblyCfgGroup.cs +++ b/src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/MsgBaseData/Entitys/AssemblyCfgGroup.cs @@ -27,6 +27,17 @@ namespace WY.NewJit.MsgBaseData /// public virtual bool IsDisable { get; set; } + /// + /// 规格说明 + /// + public virtual string SpecExplain { get; set; } + + /// + /// 颜色说明 + /// + public virtual string ColorExplain { get; set; } + + private AssemblyCfgGroup() { } diff --git a/src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/MsgBaseData/Entitys/Group_Assembly_Part.cs b/src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/MsgBaseData/Entitys/Group_Assembly_Part.cs index 023ebd9..10dfbd4 100644 --- a/src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/MsgBaseData/Entitys/Group_Assembly_Part.cs +++ b/src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/MsgBaseData/Entitys/Group_Assembly_Part.cs @@ -28,6 +28,34 @@ namespace WY.NewJit.MsgBaseData.Entitys } + public class Group_Assembly + { + public virtual Guid Id { get; set; } + /// + /// SAP分组编码(对应SAP的长描述或补充备注) + /// + public virtual string GroupCode { get; set; } + + /// + /// 规格说明 + /// + public virtual string SpecExplain { get; set; } + + /// + /// 颜色说明 + /// + public virtual string ColorExplain { get; set; } + + public List AssemblyDetails; + + public Group_Assembly() + { + AssemblyDetails = new List(); + } + + } + + public class AssemblyInfo { /// @@ -49,6 +77,30 @@ namespace WY.NewJit.MsgBaseData.Entitys } + public class OnlyAssemblyInfo + { + /// + /// Erp总成ID + /// + public Guid Id { get; set; } + + /// + /// Erp总成编码 + /// + public string ErpAssemblyCode { get; set; } + + /// + /// Erp总成编码 + /// + public string ErpAssemblyName { get; set; } + + public OnlyAssemblyInfo() + { + } + + } + + public class PartInfo { /// diff --git a/src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/MsgCheck/Entitys/BillM100.cs b/src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/MsgCheck/Entitys/BillM100.cs index cc7474d..e45f905 100644 --- a/src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/MsgCheck/Entitys/BillM100.cs +++ b/src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/MsgCheck/Entitys/BillM100.cs @@ -17,7 +17,7 @@ namespace WY.NewJit.MsgCheck /// /// 报文接收ID,对应报文接收表主键 /// - public virtual Guid? MessageFileReceiveID { get; protected set; } + public virtual Guid? MessageFileReceiveID { get; set; } /// /// 流水号# @@ -49,7 +49,7 @@ namespace WY.NewJit.MsgCheck /// /// 车型代码(取通用字典) /// - public virtual string VehicleModelCode { get; protected set; } + public virtual string VehicleModelCode { get; set; } /// /// 生产线(派格按生产线分类) @@ -59,17 +59,17 @@ namespace WY.NewJit.MsgCheck /// /// 版本 /// - public virtual string Version { get; protected set; } + public virtual string Version { get; set; } /// /// 接收时间 /// - public virtual DateTime? ReceiveTime { get; protected set; } + public virtual DateTime? ReceiveTime { get; set; } /// /// 单据状态(0 空;1 未匹配;2 已匹配未打印;3 已打印) /// - public virtual BillStatusEnum BillStatus { get; protected set; } + public virtual BillStatusEnum BillStatus { get; set; } /// /// 描述 @@ -142,9 +142,9 @@ namespace WY.NewJit.MsgCheck //因为它会被来自数据库的值覆盖.可能不适用于私有构造函数. } - //protected BillM100(Guid id) - // :base(id) - //{ } + public BillM100(Guid id) + : base(id) + { } //public BillM100(Guid id, Guid? messageFileReceiveID, int? serialNum, int? hostSN, string kNR, string vIN, Guid? assemblyID, DateTime? onlineTime, string vehicleModelCode, string version, DateTime? receiveTime, BillStatusEnum billStatus) // : base(id) diff --git a/src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/MsgCheck/Services/BillNumberRecordDomainService.cs b/src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/MsgCheck/Services/BillNumberRecordDomainService.cs index 478d69f..4606cb3 100644 --- a/src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/MsgCheck/Services/BillNumberRecordDomainService.cs +++ b/src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/MsgCheck/Services/BillNumberRecordDomainService.cs @@ -15,6 +15,9 @@ using WY.NewJit.PrintTable; namespace WY.NewJit.MsgCheck { + /// + /// 吕志斌开发的生成断号数据 + /// [Dependency(Microsoft.Extensions.DependencyInjection.ServiceLifetime.Singleton, ReplaceServices = true)] public class BillNumberRecordDomainService : DomainService { diff --git a/src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/MsgCheck/Services/CacheManagerDomainService.cs b/src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/MsgCheck/Services/CacheManagerDomainService.cs index 4018b63..b45a5e7 100644 --- a/src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/MsgCheck/Services/CacheManagerDomainService.cs +++ b/src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/MsgCheck/Services/CacheManagerDomainService.cs @@ -1,4 +1,5 @@ -using Microsoft.Extensions.Logging; +/* +using Microsoft.Extensions.Logging; using System; using System.Collections.Concurrent; using System.Collections.Generic; @@ -301,6 +302,8 @@ namespace WY.NewJit.MsgCheck } } +*/ + /* 调用缓存管理领域服务的代码 private readonly CacheManagerDomainService _cacheManagerDomainService; CacheManagerDomainService cacheManagerDomainService diff --git a/src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/MsgCheck/Services/M100DomainService.cs b/src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/MsgCheck/Services/M100DomainService.cs index 758b74c..7eca2df 100644 --- a/src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/MsgCheck/Services/M100DomainService.cs +++ b/src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/MsgCheck/Services/M100DomainService.cs @@ -43,102 +43,7 @@ namespace WY.NewJit.MsgCheck _billNumRecDomainSrv = billNumRecDomainSrv; } - public async Task InsertM100(BillM100 m100Obj, bool autoSave = false, bool isBatchImportBreakNum = false) - { - BillM100 m100Ret = null; - - if (isBatchImportBreakNum) //批量导入断号模块调用 - { - //更新M100 - m100Obj.HostSN2 = 0; - //M100转换成WaitPrint:一个底盘、08产线插入3条记录,其它产线插入1条记录 - WaitPrint[] wpArr2 = M100ConvertToWaitPrint(m100Obj); - - foreach (var wp in wpArr2) - { - wp.PrintType = PrintTypeEnum.ReplenishPrint; - //wp.HostSN2 = 0; //WaitPrint的HostSN2从m100的HostSN2取值 - } - m100Ret = await _billM100Repository.InsertAsync(m100Obj, autoSave); //插入M100 - await _waitPrintRepository.InsertManyAsync(wpArr2, autoSave); //插入未打印表 - return m100Ret; - } - - //调用HostSN2方法 - BillNumberRecord billNumRec = await _billNumRecDomainSrv.GetBillNumber(m100Obj.HostSN.TryToIntNotNull(), m100Obj.ProductLine); - var normalObj = billNumRec.Datas.FirstOrDefault(itm => itm.BillNumberType == BillNumberTypeEnum.正常); - var lateObj = billNumRec.Datas.FirstOrDefault(itm => itm.BillNumberType == BillNumberTypeEnum.迟到); - var breakNumLst = billNumRec.Datas.Where(itm => itm.BillNumberType == BillNumberTypeEnum.断号).ToList(); - //更新M100 - m100Obj.HostSN2 = normalObj != null ? normalObj.HostSN2 : lateObj.HostSN2; - //M100转换成WaitPrint:一个底盘、08产线插入3条记录,其它产线插入1条记录 - WaitPrint[] wpArr = M100ConvertToWaitPrint(m100Obj); - - //处理断号 - if (breakNumLst.Count > 0) - { - List waitPrintBreakNumLst = new List(); - foreach (var sourceWaitPrint in wpArr) //遍历门板、柱护板、其它柱护板 - { - foreach (var breaknum in breakNumLst) //遍历断号 - { - WaitPrint targetWaitPrint = new WaitPrint(GuidGenerator.Create()); - targetWaitPrint.M100Id = Guid.Parse("00000000-0000-0000-0000-000000000000"); - targetWaitPrint.BusinessType = sourceWaitPrint.BusinessType; - targetWaitPrint.ProductLine = sourceWaitPrint.ProductLine; - targetWaitPrint.OnlineTime = sourceWaitPrint.OnlineTime; - targetWaitPrint.HostSN = breaknum.HostSN; - targetWaitPrint.KNR = null; - targetWaitPrint.VIN = null; - targetWaitPrint.VehicleModelCode = null; - targetWaitPrint.AssemblyID = null; - targetWaitPrint.BillStatus = BillStatusEnum.BreakNum; - targetWaitPrint.PrintType = PrintTypeEnum.OrderPrint; - targetWaitPrint.HostSN2 = breaknum.HostSN2; - targetWaitPrint.Description = null; - targetWaitPrint.ReceiveTime = null; - targetWaitPrint.CreationTime = ServerHelper.CurrentDateTime; - //targetWaitPrint.CreatorId = null; - //targetWaitPrint.LastModificationTime = null; - //targetWaitPrint.LastModifierId = null; - waitPrintBreakNumLst.Add(targetWaitPrint); - } - } - await _waitPrintRepository.InsertManyAsync(waitPrintBreakNumLst, autoSave); //插入断号 - } - //处理正常、迟到 - if (normalObj != null) //正常 - { - m100Ret = await _billM100Repository.InsertAsync(m100Obj, autoSave); //插入M100 - await _waitPrintRepository.InsertManyAsync(wpArr, autoSave); //插入未打印表 - } - else if (lateObj != null) //迟到 - { - m100Ret = await _billM100Repository.InsertAsync(m100Obj, autoSave); //插入M100 - - foreach (var item in wpArr) //遍历门板、柱护板、其它柱护板 - { - var insObj = await _waitPrintRepository.FirstOrDefaultAsync(itm => - itm.HostSN2 == m100Obj.HostSN2 - && itm.BillStatus == BillStatusEnum.BreakNum - && itm.BusinessType == item.BusinessType); - if (insObj != null) - { - //如果未打印表有对应断号记录,将迟到记录与之合并 - Set_WaitPrint(item, insObj); - var updateRet = await _waitPrintRepository.UpdateAsync(insObj); - } - else - { - //如果未打印表没有----对应断号记录,则插入 - item.PrintType = PrintTypeEnum.ReplenishPrint; - var insertRet = await _waitPrintRepository.InsertAsync(item, autoSave); - } - } - } - return m100Ret; - } - + /* private WaitPrint[] M100ConvertToWaitPrint(BillM100 m100Obj) { WaitPrint[] wpArr; @@ -158,40 +63,6 @@ namespace WY.NewJit.MsgCheck return wpArr; } - public async Task UpdateM100(BillM100 m100Obj, bool autoSave = false) - { - var m100Ret = await _billM100Repository.UpdateAsync(m100Obj, autoSave); - if (m100Ret != null) - { - //if (m100Obj.ProductLine == "08") - //{ - // //更新已解析状态时,只涉及门板、2条柱护板 - // WaitPrint mbRec = await _waitPrintRepository.GetAsync(itm => itm.M100Id == m100Ret.Id && itm.BusinessType == BusinessTypeEnum.MenBan); - // ConvertWaitPrint(m100Ret, BusinessTypeEnum.MenBan, mbRec); - // await _waitPrintRepository.UpdateAsync(mbRec); - //} - //else - //{ - // WaitPrint mbRec = await _waitPrintRepository.GetAsync(itm => itm.M100Id == m100Ret.Id && itm.BusinessType == BusinessTypeEnum.MenBan); - // ConvertWaitPrint(m100Ret, BusinessTypeEnum.MenBan, mbRec); - // await _waitPrintRepository.UpdateAsync(mbRec); - //} - - //更新已解析状态时,只涉及门板、不涉及柱护板【柱护板一对一解析成功】 - List wpLst = await _waitPrintRepository.GetListAsync(itm => itm.M100Id == m100Ret.Id && itm.BusinessType == BusinessTypeEnum.MenBan); - foreach (var wp in wpLst) - { - wp.AssemblyID = m100Ret.AssemblyID; - wp.BillStatus = m100Ret.BillStatus; - } - await _waitPrintRepository.UpdateManyAsync(wpLst, autoSave); - - - return m100Ret; - } - return null; - } - private WaitPrint ConvertWaitPrint(BillM100 m100Ret, BusinessTypeEnum businessType) { WaitPrint waitPrint = new WaitPrint(GuidGenerator.Create()); @@ -249,12 +120,148 @@ namespace WY.NewJit.MsgCheck targetWaitPrint.LastModificationTime = sourceWaitPrint.LastModificationTime; targetWaitPrint.LastModifierId = sourceWaitPrint.LastModifierId; } + */ + + public async Task InsertM100(BillM100 m100Obj, bool autoSave = false, bool isBatchImportBreakNum = false) + { + throw new NotImplementedException(); + //BillM100 m100Ret = null; + + //if (isBatchImportBreakNum) //批量导入断号模块调用 + //{ + // //更新M100 + // m100Obj.HostSN2 = 0; + // //M100转换成WaitPrint:一个底盘、08产线插入3条记录,其它产线插入1条记录 + // WaitPrint[] wpArr2 = M100ConvertToWaitPrint(m100Obj); + + // foreach (var wp in wpArr2) + // { + // wp.PrintType = PrintTypeEnum.ReplenishPrint; + // //wp.HostSN2 = 0; //WaitPrint的HostSN2从m100的HostSN2取值 + // } + // m100Ret = await _billM100Repository.InsertAsync(m100Obj, autoSave); //插入M100 + // await _waitPrintRepository.InsertManyAsync(wpArr2, autoSave); //插入未打印表 + // return m100Ret; + //} + + ////调用HostSN2方法 + //BillNumberRecord billNumRec = await _billNumRecDomainSrv.GetBillNumber(m100Obj.HostSN.TryToIntNotNull(), m100Obj.ProductLine); + //var normalObj = billNumRec.Datas.FirstOrDefault(itm => itm.BillNumberType == BillNumberTypeEnum.正常); + //var lateObj = billNumRec.Datas.FirstOrDefault(itm => itm.BillNumberType == BillNumberTypeEnum.迟到); + //var breakNumLst = billNumRec.Datas.Where(itm => itm.BillNumberType == BillNumberTypeEnum.断号).ToList(); + ////更新M100 + //m100Obj.HostSN2 = normalObj != null ? normalObj.HostSN2 : lateObj.HostSN2; + ////M100转换成WaitPrint:一个底盘、08产线插入3条记录,其它产线插入1条记录 + //WaitPrint[] wpArr = M100ConvertToWaitPrint(m100Obj); + + ////处理断号 + //if (breakNumLst.Count > 0) + //{ + // List waitPrintBreakNumLst = new List(); + // foreach (var sourceWaitPrint in wpArr) //遍历门板、柱护板、其它柱护板 + // { + // foreach (var breaknum in breakNumLst) //遍历断号 + // { + // WaitPrint targetWaitPrint = new WaitPrint(GuidGenerator.Create()); + // targetWaitPrint.M100Id = Guid.Parse("00000000-0000-0000-0000-000000000000"); + // targetWaitPrint.BusinessType = sourceWaitPrint.BusinessType; + // targetWaitPrint.ProductLine = sourceWaitPrint.ProductLine; + // targetWaitPrint.OnlineTime = sourceWaitPrint.OnlineTime; + // targetWaitPrint.HostSN = breaknum.HostSN; + // targetWaitPrint.KNR = null; + // targetWaitPrint.VIN = null; + // targetWaitPrint.VehicleModelCode = null; + // targetWaitPrint.AssemblyID = null; + // targetWaitPrint.BillStatus = BillStatusEnum.BreakNum; + // targetWaitPrint.PrintType = PrintTypeEnum.OrderPrint; + // targetWaitPrint.HostSN2 = breaknum.HostSN2; + // targetWaitPrint.Description = null; + // targetWaitPrint.ReceiveTime = null; + // targetWaitPrint.CreationTime = ServerHelper.CurrentDateTime; + // //targetWaitPrint.CreatorId = null; + // //targetWaitPrint.LastModificationTime = null; + // //targetWaitPrint.LastModifierId = null; + // waitPrintBreakNumLst.Add(targetWaitPrint); + // } + // } + // await _waitPrintRepository.InsertManyAsync(waitPrintBreakNumLst, autoSave); //插入断号 + //} + ////处理正常、迟到 + //if (normalObj != null) //正常 + //{ + // m100Ret = await _billM100Repository.InsertAsync(m100Obj, autoSave); //插入M100 + // await _waitPrintRepository.InsertManyAsync(wpArr, autoSave); //插入未打印表 + //} + //else if (lateObj != null) //迟到 + //{ + // m100Ret = await _billM100Repository.InsertAsync(m100Obj, autoSave); //插入M100 + + // foreach (var item in wpArr) //遍历门板、柱护板、其它柱护板 + // { + // var insObj = await _waitPrintRepository.FirstOrDefaultAsync(itm => + // itm.HostSN2 == m100Obj.HostSN2 + // && itm.BillStatus == BillStatusEnum.BreakNum + // && itm.BusinessType == item.BusinessType); + // if (insObj != null) + // { + // //如果未打印表有对应断号记录,将迟到记录与之合并 + // Set_WaitPrint(item, insObj); + // var updateRet = await _waitPrintRepository.UpdateAsync(insObj); + // } + // else + // { + // //如果未打印表没有----对应断号记录,则插入 + // item.PrintType = PrintTypeEnum.ReplenishPrint; + // var insertRet = await _waitPrintRepository.InsertAsync(item, autoSave); + // } + // } + //} + //return m100Ret; + } + + public async Task UpdateM100(BillM100 m100Obj, bool autoSave = false) + { + throw new NotImplementedException(); + //var m100Ret = await _billM100Repository.UpdateAsync(m100Obj, autoSave); + //if (m100Ret != null) + //{ + // //if (m100Obj.ProductLine == "08") + // //{ + // // //更新已解析状态时,只涉及门板、2条柱护板 + // // WaitPrint mbRec = await _waitPrintRepository.GetAsync(itm => itm.M100Id == m100Ret.Id && itm.BusinessType == BusinessTypeEnum.MenBan); + // // ConvertWaitPrint(m100Ret, BusinessTypeEnum.MenBan, mbRec); + // // await _waitPrintRepository.UpdateAsync(mbRec); + // //} + // //else + // //{ + // // WaitPrint mbRec = await _waitPrintRepository.GetAsync(itm => itm.M100Id == m100Ret.Id && itm.BusinessType == BusinessTypeEnum.MenBan); + // // ConvertWaitPrint(m100Ret, BusinessTypeEnum.MenBan, mbRec); + // // await _waitPrintRepository.UpdateAsync(mbRec); + // //} + + // //更新已解析状态时,只涉及门板、不涉及柱护板【柱护板一对一解析成功】 + // List wpLst = await _waitPrintRepository.GetListAsync(itm => itm.M100Id == m100Ret.Id && itm.BusinessType == BusinessTypeEnum.MenBan); + // foreach (var wp in wpLst) + // { + // wp.AssemblyID = m100Ret.AssemblyID; + // wp.BillStatus = m100Ret.BillStatus; + // } + // await _waitPrintRepository.UpdateManyAsync(wpLst, autoSave); + + + // return m100Ret; + //} + //return null; + } + public async Task>> GetM100PartDic(List m100IdLst) { - List m100Lst = await _billM100Repository.GetListAsync(itm => m100IdLst.Contains(itm.Id), true); - Dictionary> ret = m100Lst.ToDictionary(itm => itm.Id, itm2 => itm2.BillM100Parts); - return ret; + throw new NotImplementedException(); + + //List m100Lst = await _billM100Repository.GetListAsync(itm => m100IdLst.Contains(itm.Id), true); + //Dictionary> ret = m100Lst.ToDictionary(itm => itm.Id, itm2 => itm2.BillM100Parts); + //return ret; } /// @@ -264,41 +271,43 @@ namespace WY.NewJit.MsgCheck /// public async Task InsertOrUpdateWaitPrintByM100(BillM100 m100Obj, bool autoSave = false) { - ObjectResultDto ret = new ObjectResultDto(true, ""); - List wpLst = await _waitPrintRepository.GetListAsync(itm => itm.VIN == m100Obj.VIN && itm.BusinessType == BusinessTypeEnum.MenBan); - bool hasData = wpLst.Count > 0; - if (hasData) //未打印表有数据 - { - foreach (WaitPrint wp in wpLst) - { - wp.AssemblyID = m100Obj.AssemblyID; - wp.BillStatus = m100Obj.BillStatus; - } - await _waitPrintRepository.UpdateManyAsync(wpLst, autoSave); - } - else //未打印表没有数据 - { - WaitPrint[] wpArr; - if (m100Obj.ProductLine == "08") - { - WaitPrint mbRec = ConvertWaitPrint(m100Obj, BusinessTypeEnum.MenBan); - //WaitPrint zhbOtherRec = ConvertWaitPrint(m100Obj, BusinessTypeEnum.OtherZhuHuBan); - //WaitPrint zhbRec = ConvertWaitPrint(m100Obj, BusinessTypeEnum.AC_ZhuHuBan); - //wpArr = new WaitPrint[3] { mbRec, zhbOtherRec, zhbRec }; - wpArr = new WaitPrint[1] { mbRec }; - } - else - { - WaitPrint mbRec = ConvertWaitPrint(m100Obj, BusinessTypeEnum.MenBan); - wpArr = new WaitPrint[1] { mbRec }; - } - foreach (WaitPrint wp in wpArr) - { - wp.PrintType = PrintTypeEnum.ReplenishPrint; - } - await _waitPrintRepository.InsertManyAsync(wpArr, autoSave); //插入未打印表 - } - return ret; + throw new NotImplementedException(); + + //ObjectResultDto ret = new ObjectResultDto(true, ""); + //List wpLst = await _waitPrintRepository.GetListAsync(itm => itm.VIN == m100Obj.VIN && itm.BusinessType == BusinessTypeEnum.MenBan); + //bool hasData = wpLst.Count > 0; + //if (hasData) //未打印表有数据 + //{ + // foreach (WaitPrint wp in wpLst) + // { + // wp.AssemblyID = m100Obj.AssemblyID; + // wp.BillStatus = m100Obj.BillStatus; + // } + // await _waitPrintRepository.UpdateManyAsync(wpLst, autoSave); + //} + //else //未打印表没有数据 + //{ + // WaitPrint[] wpArr; + // if (m100Obj.ProductLine == "08") + // { + // WaitPrint mbRec = ConvertWaitPrint(m100Obj, BusinessTypeEnum.MenBan); + // //WaitPrint zhbOtherRec = ConvertWaitPrint(m100Obj, BusinessTypeEnum.OtherZhuHuBan); + // //WaitPrint zhbRec = ConvertWaitPrint(m100Obj, BusinessTypeEnum.AC_ZhuHuBan); + // //wpArr = new WaitPrint[3] { mbRec, zhbOtherRec, zhbRec }; + // wpArr = new WaitPrint[1] { mbRec }; + // } + // else + // { + // WaitPrint mbRec = ConvertWaitPrint(m100Obj, BusinessTypeEnum.MenBan); + // wpArr = new WaitPrint[1] { mbRec }; + // } + // foreach (WaitPrint wp in wpArr) + // { + // wp.PrintType = PrintTypeEnum.ReplenishPrint; + // } + // await _waitPrintRepository.InsertManyAsync(wpArr, autoSave); //插入未打印表 + //} + //return ret; } } } diff --git a/src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/MsgCheck/Services/R100CheckDomainService.cs b/src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/MsgCheck/Services/R100CheckDomainService.cs index 005006e..f85566e 100644 --- a/src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/MsgCheck/Services/R100CheckDomainService.cs +++ b/src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/MsgCheck/Services/R100CheckDomainService.cs @@ -991,6 +991,48 @@ namespace WY.NewJit.MsgCheck } + + [Serializable] + public class Group2Assembly + { + /// + /// 分组Id, 对应总成分组表Id + /// + public Guid GroupId { get; set; } + + /// + /// 分组代码 + /// + public string GroupCode { get; set; } + + /// + /// Erp总成ID + /// + public Guid ErpAssemblyId { get; set; } + + /// + /// Erp总成编码 + /// + public string ErpAssemblyCode { get; set; } + + /// + /// Erp总成名称 + /// + public string ErpAssemblyName { get; set; } + + /// + /// 规格说明 + /// + public virtual string SpecExplain { get; set; } + + /// + /// 颜色说明 + /// + public virtual string ColorExplain { get; set; } + + } + + public class ErpAssemblyMain { public Guid Id { get; set; } diff --git a/src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/WY.NewJit.Domain.csproj b/src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/WY.NewJit.Domain.csproj index 55f387a..7fda79f 100644 --- a/src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/WY.NewJit.Domain.csproj +++ b/src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/WY.NewJit.Domain.csproj @@ -30,7 +30,6 @@ - diff --git a/src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.EntityFrameworkCore.DbMigrations/Migrations/20240110033428_NewJitPG_HQ_0110.Designer.cs b/src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.EntityFrameworkCore.DbMigrations/Migrations/20240110033428_NewJitPG_HQ_0110.Designer.cs new file mode 100644 index 0000000..c2d1124 --- /dev/null +++ b/src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.EntityFrameworkCore.DbMigrations/Migrations/20240110033428_NewJitPG_HQ_0110.Designer.cs @@ -0,0 +1,6126 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Volo.Abp.EntityFrameworkCore; +using WY.NewJit.EntityFrameworkCore; + +namespace WY.NewJit.Migrations +{ + [DbContext(typeof(NewJitMigrationsDbContext))] + [Migration("20240110033428_NewJitPG_HQ_0110")] + partial class NewJitPG_HQ_0110 + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.SqlServer) + .HasAnnotation("Relational:MaxIdentifierLength", 128) + .HasAnnotation("ProductVersion", "5.0.17") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ApplicationName") + .HasMaxLength(96) + .HasColumnType("nvarchar(96)") + .HasColumnName("ApplicationName"); + + b.Property("BrowserInfo") + .HasMaxLength(512) + .HasColumnType("nvarchar(512)") + .HasColumnName("BrowserInfo"); + + b.Property("ClientId") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ClientId"); + + b.Property("ClientIpAddress") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ClientIpAddress"); + + b.Property("ClientName") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)") + .HasColumnName("ClientName"); + + b.Property("Comments") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)") + .HasColumnName("Comments"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CorrelationId") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("CorrelationId"); + + b.Property("Exceptions") + .HasMaxLength(4000) + .HasColumnType("nvarchar(4000)") + .HasColumnName("Exceptions"); + + b.Property("ExecutionDuration") + .HasColumnType("int") + .HasColumnName("ExecutionDuration"); + + b.Property("ExecutionTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("HttpMethod") + .HasMaxLength(16) + .HasColumnType("nvarchar(16)") + .HasColumnName("HttpMethod"); + + b.Property("HttpStatusCode") + .HasColumnType("int") + .HasColumnName("HttpStatusCode"); + + b.Property("ImpersonatorTenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("ImpersonatorTenantId"); + + b.Property("ImpersonatorUserId") + .HasColumnType("uniqueidentifier") + .HasColumnName("ImpersonatorUserId"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("TenantName") + .HasColumnType("nvarchar(max)"); + + b.Property("Url") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)") + .HasColumnName("Url"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier") + .HasColumnName("UserId"); + + b.Property("UserName") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)") + .HasColumnName("UserName"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "ExecutionTime"); + + b.HasIndex("TenantId", "UserId", "ExecutionTime"); + + b.ToTable("AbpAuditLogs"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AuditLogId") + .HasColumnType("uniqueidentifier") + .HasColumnName("AuditLogId"); + + b.Property("ExecutionDuration") + .HasColumnType("int") + .HasColumnName("ExecutionDuration"); + + b.Property("ExecutionTime") + .HasColumnType("datetime2") + .HasColumnName("ExecutionTime"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("MethodName") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)") + .HasColumnName("MethodName"); + + b.Property("Parameters") + .HasMaxLength(2000) + .HasColumnType("nvarchar(2000)") + .HasColumnName("Parameters"); + + b.Property("ServiceName") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)") + .HasColumnName("ServiceName"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("AuditLogId"); + + b.HasIndex("TenantId", "ServiceName", "MethodName", "ExecutionTime"); + + b.ToTable("AbpAuditLogActions"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AuditLogId") + .HasColumnType("uniqueidentifier") + .HasColumnName("AuditLogId"); + + b.Property("ChangeTime") + .HasColumnType("datetime2") + .HasColumnName("ChangeTime"); + + b.Property("ChangeType") + .HasColumnType("tinyint") + .HasColumnName("ChangeType"); + + b.Property("EntityId") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)") + .HasColumnName("EntityId"); + + b.Property("EntityTenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("EntityTypeFullName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)") + .HasColumnName("EntityTypeFullName"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("AuditLogId"); + + b.HasIndex("TenantId", "EntityTypeFullName", "EntityId"); + + b.ToTable("AbpEntityChanges"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("EntityChangeId") + .HasColumnType("uniqueidentifier"); + + b.Property("NewValue") + .HasMaxLength(512) + .HasColumnType("nvarchar(512)") + .HasColumnName("NewValue"); + + b.Property("OriginalValue") + .HasMaxLength(512) + .HasColumnType("nvarchar(512)") + .HasColumnName("OriginalValue"); + + b.Property("PropertyName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)") + .HasColumnName("PropertyName"); + + b.Property("PropertyTypeFullName") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("PropertyTypeFullName"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("EntityChangeId"); + + b.ToTable("AbpEntityPropertyChanges"); + }); + + modelBuilder.Entity("Volo.Abp.BackgroundJobs.BackgroundJobRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsAbandoned") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("JobArgs") + .IsRequired() + .HasMaxLength(1048576) + .HasColumnType("nvarchar(max)"); + + b.Property("JobName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("LastTryTime") + .HasColumnType("datetime2"); + + b.Property("NextTryTime") + .HasColumnType("datetime2"); + + b.Property("Priority") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint") + .HasDefaultValue((byte)15); + + b.Property("TryCount") + .ValueGeneratedOnAdd() + .HasColumnType("smallint") + .HasDefaultValue((short)0); + + b.HasKey("Id"); + + b.HasIndex("IsAbandoned", "NextTryTime"); + + b.ToTable("AbpBackgroundJobs"); + }); + + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureValue", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("ProviderKey") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ProviderName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.HasKey("Id"); + + b.HasIndex("Name", "ProviderName", "ProviderKey"); + + b.ToTable("AbpFeatureValues"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityClaimType", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("Description") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsStatic") + .HasColumnType("bit"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("Regex") + .HasMaxLength(512) + .HasColumnType("nvarchar(512)"); + + b.Property("RegexDescription") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("Required") + .HasColumnType("bit"); + + b.Property("ValueType") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("AbpClaimTypes"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityLinkUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("SourceTenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("SourceUserId") + .HasColumnType("uniqueidentifier"); + + b.Property("TargetTenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("TargetUserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("SourceUserId", "SourceTenantId", "TargetUserId", "TargetTenantId") + .IsUnique() + .HasFilter("[SourceTenantId] IS NOT NULL AND [TargetTenantId] IS NOT NULL"); + + b.ToTable("AbpLinkUsers"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDefault") + .HasColumnType("bit") + .HasColumnName("IsDefault"); + + b.Property("IsPublic") + .HasColumnType("bit") + .HasColumnName("IsPublic"); + + b.Property("IsStatic") + .HasColumnType("bit") + .HasColumnName("IsStatic"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("NormalizedName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedName"); + + b.ToTable("AbpRoles"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ClaimType") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ClaimValue") + .HasMaxLength(1024) + .HasColumnType("nvarchar(1024)"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("AbpRoleClaims"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentitySecurityLog", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Action") + .HasMaxLength(96) + .HasColumnType("nvarchar(96)"); + + b.Property("ApplicationName") + .HasMaxLength(96) + .HasColumnType("nvarchar(96)"); + + b.Property("BrowserInfo") + .HasMaxLength(512) + .HasColumnType("nvarchar(512)"); + + b.Property("ClientId") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ClientIpAddress") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CorrelationId") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("CreationTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Identity") + .HasMaxLength(96) + .HasColumnType("nvarchar(96)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("TenantName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.Property("UserName") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "Action"); + + b.HasIndex("TenantId", "ApplicationName"); + + b.HasIndex("TenantId", "Identity"); + + b.HasIndex("TenantId", "UserId"); + + b.ToTable("AbpSecurityLogs"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AccessFailedCount") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0) + .HasColumnName("AccessFailedCount"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Email") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)") + .HasColumnName("Email"); + + b.Property("EmailConfirmed") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("EmailConfirmed"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IsExternal") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsExternal"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("LockoutEnabled") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("LockoutEnabled"); + + b.Property("LockoutEnd") + .HasColumnType("datetimeoffset"); + + b.Property("Name") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Name"); + + b.Property("NormalizedEmail") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)") + .HasColumnName("NormalizedEmail"); + + b.Property("NormalizedUserName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)") + .HasColumnName("NormalizedUserName"); + + b.Property("PasswordHash") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)") + .HasColumnName("PasswordHash"); + + b.Property("PhoneNumber") + .HasMaxLength(16) + .HasColumnType("nvarchar(16)") + .HasColumnName("PhoneNumber"); + + b.Property("PhoneNumberConfirmed") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("PhoneNumberConfirmed"); + + b.Property("SecurityStamp") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)") + .HasColumnName("SecurityStamp"); + + b.Property("Surname") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Surname"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("TwoFactorEnabled") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("TwoFactorEnabled"); + + b.Property("UserName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)") + .HasColumnName("UserName"); + + b.HasKey("Id"); + + b.HasIndex("Email"); + + b.HasIndex("NormalizedEmail"); + + b.HasIndex("NormalizedUserName"); + + b.HasIndex("UserName"); + + b.ToTable("AbpUsers"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ClaimType") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ClaimValue") + .HasMaxLength(1024) + .HasColumnType("nvarchar(1024)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("AbpUserClaims"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => + { + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.Property("LoginProvider") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ProviderDisplayName") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("ProviderKey") + .IsRequired() + .HasMaxLength(196) + .HasColumnType("nvarchar(196)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("UserId", "LoginProvider"); + + b.HasIndex("LoginProvider", "ProviderKey"); + + b.ToTable("AbpUserLogins"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserOrganizationUnit", b => + { + b.Property("OrganizationUnitId") + .HasColumnType("uniqueidentifier"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("OrganizationUnitId", "UserId"); + + b.HasIndex("UserId", "OrganizationUnitId"); + + b.ToTable("AbpUserOrganizationUnits"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => + { + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.Property