Compare commits

...

56 Commits
master ... HQ

Author SHA1 Message Date
liuyunfeng 7fb9f195b9 解决现场反馈bug 6 months ago
liuyunfeng 11cc50a3da 超时问题,终于解决 7 months ago
liuyunfeng ea965197bd 超时问题,方案一 7 months ago
liuyunfeng 21c69df191 改大bug前 7 months ago
安虹睿 affc9ff148 Merge branch 'HQ' of http://dev.ccwin-in.com:3000/zhibinlv/FIS1.5 into HQ 7 months ago
安虹睿 a0e2ddd494 【派格】门板去掉支持批量字段缺陷修复 7 months ago
liuyunfeng b0a3fba68f bug修改完成 7 months ago
安虹睿 fe67e8e466 【派格pc】登录页面页脚更改 7 months ago
安虹睿 37b57845c3 【派格PC】更改字段开发 7 months ago
安虹睿 024f8ef66b 【派格1.5】ip配置文件提出外部配置 7 months ago
安虹睿 c649b81d42 Merge branch 'HQ' of http://dev.ccwin-in.com:3000/zhibinlv/FIS1.5 into HQ 7 months ago
安虹睿 db02e83d55 【派格1.5】发布ip更改 7 months ago
liuyunfeng 9312425ed4 修改内容 7 months ago
liuyunfeng 5d3b517c43 二轮测试修改bug完成 7 months ago
liuyunfeng 9195f1ca22 bug完成 7 months ago
liuyunfeng ac9a1ada55 修改bug 导入总成时,校验规格说明包含的4个物料号分别是1001,1002,1003,1004 7 months ago
安虹睿 f423d71a7c 【派格PC前端】2024-04-17需求更改 7 months ago
liuyunfeng 04ff49a2f8 项目暂停前提交 10 months ago
安虹睿 6f6623a1d4 【长春派格1.5】日常打印+M100查询需求更改 10 months ago
安虹睿 cb6b565fb7 【长春派格1.5】0119需求更改 10 months ago
安虹睿 c4261cce92 Merge branch 'HQ' of http://dev.ccwin-in.com:3000/zhibinlv/FIS1.5 into HQ 10 months ago
安虹睿 6580fd9440 【长春派格1.5】需求更改0118 10 months ago
liuyunfeng c4679816a9 m100查询bug 10 months ago
liuyunfeng 8c4b13e190 测试未知总成、打印通过 10 months ago
安虹睿 0facf74942 Merge branch 'HQ' of http://dev.ccwin-in.com:3000/zhibinlv/FIS1.5 into HQ 10 months ago
安虹睿 a8d13b6f53 【长春派格1.5】物料管理页面开发 10 months ago
安虹睿 de5ac5285d 【长春派格1.5】多页面条件修改 10 months ago
lvzb ed9f48faa6 物料管理修改 10 months ago
lvzb 814f942d0c 修改物料导出方法 10 months ago
lvzb 6767578cc6 Merge branch 'HQ' of http://dev.ccwin-in.com:3000/zhibinlv/FIS1.5 into HQ 10 months ago
lvzb 5176d63ddf SAP物料管理服务添加 10 months ago
安虹睿 cc319f4be9 【长春派格1.5】总成模块功能需求开发 10 months ago
安虹睿 af0ebb512d 【长春派格1.5】计划管理提醒功能+日常打印提醒优化 10 months ago
liuyunfeng 9c95697be9 改bug 10 months ago
lvzb e5f2e386e6 导入总成组修改 10 months ago
lvzb 57f474a790 总成查询修改添加字段 10 months ago
lvzb 9badc26ab2 打印时间提醒修改 10 months ago
lvzb 015f8d9cbd 合并代码 10 months ago
lvzb 67558d1610 添加模板导入功能 10 months ago
liuyunfeng e9ad9c732e 冲突 补充 提交 10 months ago
liuyunfeng 558da06c8c 报文导入-初步测试通过 10 months ago
lvzb b3abed0b71 Merge branch 'HQ' of http://dev.ccwin-in.com:3000/zhibinlv/FIS1.5 into HQ 10 months ago
lvzb 2887117563 添加基础配置表和打印提醒服务 10 months ago
liuyunfeng 73cfc90d97 1 10 months ago
liuyunfeng 9a2b97aa7c 改 EXCEL报文导入 10 months ago
安虹睿 8f47014ff8 【长春派格1.5】计划管理优化 11 months ago
安虹睿 be7c11f251 Merge branch 'HQ' of http://dev.ccwin-in.com:3000/zhibinlv/FIS1.5 into HQ 11 months ago
安虹睿 2a677a0a2f 【长春派格1.5】计划管理页面开发 + 普通导入组件封装 11 months ago
安虹睿 24a1753366 【长春派格1.5】日常打印相关更改 11 months ago
lvzb 5907e39946 基础参数修改 11 months ago
lvzb 5eea910a74 基础参数修改 11 months ago
lvzb 08071e6e4b Merge branch 'HQ' of http://dev.ccwin-in.com:3000/zhibinlv/FIS1.5 into HQ 11 months ago
lvzb 4a7cad660b 打印修改 11 months ago
liuyunfeng 5061147c98 导入记录表CRUD完成 11 months ago
liuyunfeng cdda6c33bb 修改编译不通过问题 11 months ago
liuyunfeng 428f65d5b1 数据库连接改 NewJitPG_HQ 11 months ago
  1. 6
      package-lock.json
  2. 3
      src/Modules/BaseService/BaseService.Application/UserManagement/UserAppService.cs
  3. 2
      src/Modules/新版JIT或JIS系统服务端/WY.NewJit.sln
  4. 131
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/EdiReceive/Dtos/ImportRecordCreateDto.cs
  5. 197
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/EdiReceive/Dtos/ImportRecordDto.cs
  6. 131
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/EdiReceive/Dtos/ImportRecordHisCreateDto.cs
  7. 132
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/EdiReceive/Dtos/ImportRecordHisDto.cs
  8. 86
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/EdiReceive/Dtos/ImportRecordInputDto.cs
  9. 70
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/EdiReceive/Interfaces/IImportRecordAppService.cs
  10. 5
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/Extends/MenBanReports/MenBanPrintInputDto.cs
  11. 16
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/MsgBaseData/AssemblyCfgs/Dtos/AssemblyCfgErpDto.cs
  12. 15
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/MsgBaseData/AssemblyCfgs/Dtos/ExportErpAssemblyDto.cs
  13. 39
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/MsgBaseData/AssemblyCfgs/Dtos/ImportErpAssemblyGroupDto.cs
  14. 11
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/MsgBaseData/AssemblyCfgs/Dtos/QueryAssemblyCfgErpDto.cs
  15. 26
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/MsgBaseData/BaseConfig/Dto/BaseConfigCreateDto.cs
  16. 31
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/MsgBaseData/BaseConfig/Dto/BaseConfigDto.cs
  17. 27
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/MsgBaseData/BaseConfig/Dto/QueryBaseConfigDto.cs
  18. 14
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/MsgBaseData/BaseConfig/Interfaces/IBaseGonfigService.cs
  19. 49
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/MsgBaseData/MaterialExt/Dto/MaterialExtDto.cs
  20. 30
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/MsgBaseData/MaterialExt/Dto/QueryMaterialExtDto.cs
  21. 11
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/MsgBaseData/MaterialExt/Interfaces/IMaterialExtAppService.cs
  22. 13
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/MsgCheck/BillM100s/Dtos/BillM100Dto.cs
  23. 15
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/MsgCheck/BillM100s/Dtos/ResultBillM100Dto.cs
  24. 14
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/MsgCheck/UnknownAssemblys/Dtos/ResultUnknownAssemblyDto.cs
  25. 2
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/MsgCheck/UnknownAssemblys/Interfaces/IUnknownAssemblyAppService.cs
  26. 13
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/PrintTable/Dtos/AlreadyPrintDto.cs
  27. 15
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/PrintTable/Dtos/WaitPrintDto.cs
  28. 1
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/WY.NewJit.Application.Contracts.csproj
  29. 782
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/WY.NewJit.Application.Contracts.xml
  30. 562
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application/EdiReceive/ImportRecordAppService.cs
  31. 549
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application/MsgBaseData/AssemblyCfgs/AssemblyCfgErpAppService.cs
  32. 1
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application/MsgBaseData/AssemblyCfgs/AssemblyCfgVehicleAppService.cs
  33. 234
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application/MsgBaseData/BaseConfig/BaseGonfigService.cs
  34. 4
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application/MsgBaseData/Dics/DicAppService.cs
  35. 11
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application/MsgBaseData/MaterialExt/IMaterialExtAppService.cs
  36. 161
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application/MsgBaseData/MaterialExt/MaterialExtAppService.cs
  37. 4
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application/MsgBaseData/PrintTemplateConfiguration/PrintTemplateConfigurationService.cs
  38. 4
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application/MsgCheck/BillM100s/BillM100AppService.cs
  39. 2
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application/MsgCheck/BillM100s/MenBanPackingRecService.cs
  40. 2
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application/MsgCheck/BillM100s/ZhuHuBanPackingRecService.cs
  41. 658
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application/MsgCheck/UnknownAssemblys/UnknownAssemblyAppService.cs
  42. 14
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application/NewJitApplicationAutoMapperProfile.cs
  43. 54
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application/PrintTable/WaitPrintAppService.cs
  44. 272
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application/WY.NewJit.Application.xml
  45. 3
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.DbMigrator/appsettings.json
  46. 10
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain.Shared/Common/ExtMethod.cs
  47. 149
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain.Shared/Common/ServerHelper.cs
  48. 1
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain.Shared/Common/SwaggerGroupConsts.cs
  49. 4
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/Commons/Services/SequenceDomainService.cs
  50. 139
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/EdiReceive/Entitys/ImportRecord.cs
  51. 139
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/EdiReceive/Entitys/ImportRecordHis.cs
  52. 21
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/EdiReceive/Entitys/LastImportHostSN.cs
  53. 553
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/EdiReceive/Services/EdiParseDomainService.cs
  54. 239
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/EdiReceive/Services/HQ_CacheManagerDomainService.cs
  55. 243
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/EdiReceive/Services/HQ_M100DomainService.cs
  56. 102
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/EdiReceive/Services/LastImportHostSNDomainService.cs
  57. 10
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/MsgBaseData/Entitys/AssemblyCfgErp.cs
  58. 11
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/MsgBaseData/Entitys/AssemblyCfgGroup.cs
  59. 45
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/MsgBaseData/Entitys/BaseConfig.cs
  60. 52
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/MsgBaseData/Entitys/Group_Assembly_Part.cs
  61. 105
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/MsgBaseData/Services/AssemblyDomainService.cs
  62. 45
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/MsgBaseData/Services/BaseGonfigDomainService.cs
  63. 25
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/MsgCheck/Entitys/BillM100.cs
  64. 3
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/MsgCheck/Services/BillNumberRecordDomainService.cs
  65. 7
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/MsgCheck/Services/CacheManagerDomainService.cs
  66. 345
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/MsgCheck/Services/M100DomainService.cs
  67. 42
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/MsgCheck/Services/R100CheckDomainService.cs
  68. 12
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/PrintTable/Entitys/AlreadyPrint.cs
  69. 10
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/PrintTable/Entitys/WaitPrint.cs
  70. 338
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.EntityFrameworkCore.DbMigrations/Migrations/20220701062532_Created_NewJit_Entity2022-07-01.cs
  71. 233
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.EntityFrameworkCore.DbMigrations/Migrations/20220701064724_Created_NewJit_Entity2022-07-01_2.cs
  72. 1170
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.EntityFrameworkCore.DbMigrations/Migrations/20240109072607_Add_ImportRec_Table.Designer.cs
  73. 3238
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.EntityFrameworkCore.DbMigrations/Migrations/20240109072607_Add_ImportRec_Table.cs
  74. 1157
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.EntityFrameworkCore.DbMigrations/Migrations/20240110033428_NewJitPG_HQ_0110.Designer.cs
  75. 41
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.EntityFrameworkCore.DbMigrations/Migrations/20240110033428_NewJitPG_HQ_0110.cs
  76. 6132
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.EntityFrameworkCore.DbMigrations/Migrations/20240115023640_NewJitPG_HQ_Init.Designer.cs
  77. 33
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.EntityFrameworkCore.DbMigrations/Migrations/20240115023640_NewJitPG_HQ_Init.cs
  78. 6134
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.EntityFrameworkCore.DbMigrations/Migrations/20240115024450_NewJitPG_HQ_Init2.Designer.cs
  79. 53
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.EntityFrameworkCore.DbMigrations/Migrations/20240115024450_NewJitPG_HQ_Init2.cs
  80. 6142
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.EntityFrameworkCore.DbMigrations/Migrations/20240115055730_NewJitPG_HQ_Init3.Designer.cs
  81. 35
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.EntityFrameworkCore.DbMigrations/Migrations/20240115055730_NewJitPG_HQ_Init3.cs
  82. 1113
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.EntityFrameworkCore.DbMigrations/Migrations/NewJitMigrationsDbContextModelSnapshot.cs
  83. 4
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.EntityFrameworkCore.DbMigrations/WY.NewJit.EntityFrameworkCore.DbMigrations.csproj
  84. 14
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.EntityFrameworkCore/EntityFrameworkCore/NewJitDbContext.cs
  85. 100
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.EntityFrameworkCore/EntityFrameworkCore/NewJitDbContextModelCreatingExtensions.cs
  86. 4
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Job.BomInterface/appsettings.json
  87. 2
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Job.ConsoleApp/appsettings.json
  88. 4
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Job.ConsoleBatchImportBrokenNum/appsettings.json
  89. 2
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Job.ConsoleGetEDIFile/appsettings.json
  90. 12
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Job.ConsoleSyncToWms/appsettings.json
  91. 13
      src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Web/appsettings.json
  92. 11
      vue/public/config.js
  93. 5
      vue/public/index.html
  94. 6
      vue/src/App.vue
  95. 175
      vue/src/components/ImportExcel-normal/index.vue
  96. 108
      vue/src/router/modules/fis.js
  97. 4
      vue/src/router/modules/fisprint.js
  98. 2
      vue/src/settings.js
  99. 6
      vue/src/views/login/index.vue
  100. 317
      vue/src/views/pg-fis/basedate/SAPItemConfig/index.vue

6
package-lock.json

@ -0,0 +1,6 @@
{
"name": "FIS1.5",
"lockfileVersion": 2,
"requires": true,
"packages": {}
}

3
src/Modules/BaseService/BaseService.Application/UserManagement/UserAppService.cs

@ -198,8 +198,7 @@ namespace BaseService.Systems.UserManagement
var branchRoles = await GetUserBranchRolesAsync(CurrentUsers.GetId());
var groupBranchRoles = branchRoles.GroupBy(x => x.BranchId)
.Select(y => new {xx = new {BranchId = y.Key}, items = y});
foreach (var group in groupBranchRoles
)
foreach (var group in groupBranchRoles)
{
var mybranchrole = new BranchRoleDto
{

2
src/Modules/新版JIT或JIS系统服务端/WY.NewJit.sln

@ -53,7 +53,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Win.Utils", "..\..\Shared\W
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BaseService.Domain", "..\BaseService\BaseService.Domain\BaseService.Domain.csproj", "{4568BFE0-D0F9-408D-BD7E-99415C9EC010}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "FIS1.5版本", "FIS1.5版本", "{9CB5F3B9-0044-40C3-BD36-0B41CEEC0487}"
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "派格——红旗FIS", "派格——红旗FIS", "{9CB5F3B9-0044-40C3-BD36-0B41CEEC0487}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Base", "Base", "{A8441906-AA32-4B6A-8D55-6B3DEF4E5DEB}"
EndProject

131
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/EdiReceive/Dtos/ImportRecordCreateDto.cs

@ -0,0 +1,131 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace WY.NewJit.EdiReceive.Dtos
{
public class ImportRecordCreateDto
{
/// <summary>
/// 工厂
/// </summary>
public virtual string Factory { get; set; }
/// <summary>
/// 车位
/// </summary>
public virtual string VehicleLocation { get; set; }
/// <summary>
/// 工位
/// </summary>
public virtual string WorkLocation { get; set; }
/// <summary>
/// 底盘号
/// </summary>
public virtual string Vin { get; set; }
/// <summary>
/// 车身号
/// </summary>
public virtual string VehicleBodyCode { get; set; }
/// <summary>
/// 车型代码
/// </summary>
public virtual string VehicleModelCode { get; set; }
/// <summary>
/// 车型名称
/// </summary>
public virtual string VehicleModelName { get; set; }
/// <summary>
/// 车型描述
/// </summary>
public virtual string VehicleModelDesc { get; set; }
/// <summary>
/// 规格
/// </summary>
public virtual string Spec { get; set; }
/// <summary>
/// 规格说明
/// </summary>
public virtual string SpecDesc { get; set; }
/// <summary>
/// 类别
/// </summary>
public virtual string Type { get; set; }
/// <summary>
/// 涂装下线时间
/// </summary>
public virtual DateTime? PaintOfflineTime { get; set; }
/// <summary>
/// 总装上线时间
/// </summary>
public virtual DateTime? OnlineTime { get; set; }
/// <summary>
/// 内饰颜色
/// </summary>
public virtual string InteriorColor { get; set; }
/// <summary>
/// 外饰颜色
/// </summary>
public virtual string ExteriorTrimmingColor { get; set; }
/// <summary>
/// 序列号
/// </summary>
public virtual string SerialNum { get; set; }
/// <summary>
/// 流水号
/// </summary>
public virtual int HostSN { get; set; }
/// <summary>
/// 生产线:A/B
/// </summary>
public virtual string ProductLine { get; set; }
/// <summary>
/// 目的
/// </summary>
public virtual string Target { get; set; }
/// <summary>
/// 备注
/// </summary>
public virtual string Remark { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public virtual DateTime? CreateTime { get; set; }
/// <summary>
/// 创建人
/// </summary>
public virtual string CreatePerson { get; set; }
public virtual DateTime? ImportTime { get; set; }
public virtual string ImportPerson { get; set; }
public virtual string Remark2 { get; set; }
public virtual string Remark3 { get; set; }
public virtual string Remark4 { get; set; }
public virtual string Remark5 { get; set; }
}
}

197
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/EdiReceive/Dtos/ImportRecordDto.cs

@ -0,0 +1,197 @@
using Magicodes.ExporterAndImporter.Core;
using Magicodes.ExporterAndImporter.Excel;
using System;
using System.Collections.Generic;
using System.Text;
namespace WY.NewJit.EdiReceive.Dtos
{
/// <summary>
/// 导入记录表
/// </summary>
[ExcelExporter(Name = "导入记录表", AutoFitAllColumn = true, MaxRowNumberOnASheet = 50000)] //一个Sheet最大允许的行数,设置了之后将输出多个Sheet
[Serializable]
public class ImportRecordDto
{
[ExporterHeader(IsIgnore = true)]
[ImporterHeader(IsIgnore = true)]
public virtual Guid Id { get; set; }
/// <summary>
/// 工厂
/// </summary>
[ExporterHeader(DisplayName = "工厂")]
[ImporterHeader(Name = "工厂")]
public virtual string Factory { get; set; }
/// <summary>
/// 车位
/// </summary>
[ExporterHeader(DisplayName = "车位")]
[ImporterHeader(Name = "车位")]
public virtual string VehicleLocation { get; set; }
/// <summary>
/// 工位
/// </summary>
[ExporterHeader(DisplayName = "工位")]
[ImporterHeader(Name = "工位")]
public virtual string WorkLocation { get; set; }
/// <summary>
/// 底盘号
/// </summary>
[ExporterHeader(DisplayName = "底盘号")]
[ImporterHeader(Name = "底盘号")]
public virtual string Vin { get; set; }
/// <summary>
/// 车身号
/// </summary>
[ExporterHeader(DisplayName = "车身号")]
[ImporterHeader(Name = "车身号")]
public virtual string VehicleBodyCode { get; set; }
/// <summary>
/// 车型代码
/// </summary>
[ExporterHeader(DisplayName = "车型代码")]
[ImporterHeader(Name = "车型代码")]
public virtual string VehicleModelCode { get; set; }
/// <summary>
/// 车型名称
/// </summary>
[ExporterHeader(DisplayName = "车型名称")]
[ImporterHeader(Name = "车型名称")]
public virtual string VehicleModelName { get; set; }
/// <summary>
/// 车型描述
/// </summary>
[ExporterHeader(DisplayName = "车型描述")]
[ImporterHeader(Name = "车型描述")]
public virtual string VehicleModelDesc { get; set; }
/// <summary>
/// 规格
/// </summary>
[ExporterHeader(DisplayName = "规格")]
[ImporterHeader(Name = "规格")]
public virtual string Spec { get; set; }
/// <summary>
/// 规格说明
/// </summary>
[ExporterHeader(DisplayName = "规格说明")]
[ImporterHeader(Name = "规格说明")]
public virtual string SpecDesc { get; set; }
/// <summary>
/// 类别
/// </summary>
[ExporterHeader(DisplayName = "类别")]
[ImporterHeader(Name = "类别")]
public virtual string Type { get; set; }
/// <summary>
/// 涂装下线时间
/// </summary>
[ExporterHeader(DisplayName = "涂装下线时间", Format ="yyyy/MM/dd HH:mm:ss")]
[ImporterHeader(Name = "涂装下线时间", Format = "yyyy/MM/dd HH:mm:ss")]
public virtual DateTime? PaintOfflineTime { get; set; }
/// <summary>
/// 总装上线时间
/// </summary>
[ExporterHeader(DisplayName = "总装上线时间", Format = "yyyy/MM/dd HH:mm:ss")]
[ImporterHeader(Name = "总装上线时间", Format = "yyyy/MM/dd HH:mm:ss")]
public virtual DateTime? OnlineTime { get; set; }
/// <summary>
/// 内饰颜色
/// </summary>
[ExporterHeader(DisplayName = "内饰颜色")]
[ImporterHeader(Name = "内饰颜色")]
public virtual string InteriorColor { get; set; }
/// <summary>
/// 外饰颜色
/// </summary>
[ExporterHeader(DisplayName = "外饰颜色")]
[ImporterHeader(Name = "外饰颜色")]
public virtual string ExteriorTrimmingColor { get; set; }
/// <summary>
/// 序列号
/// </summary>
[ExporterHeader(DisplayName = "序列号")]
[ImporterHeader(Name = "序列号")]
public virtual string SerialNum { get; set; }
/// <summary>
/// 流水号
/// </summary>
[ExporterHeader(DisplayName = "流水号")]
[ImporterHeader(Name = "流水号")]
public virtual int HostSN { get; set; }
/// <summary>
/// 生产线:A/B
/// </summary>
[ExporterHeader(DisplayName = "生产线:A/B")]
[ImporterHeader(Name = "生产线:A/B")]
public virtual string ProductLine { get; set; }
/// <summary>
/// 目的
/// </summary>
[ExporterHeader(DisplayName = "目的")]
[ImporterHeader(Name = "目的")]
public virtual string Target { get; set; }
/// <summary>
/// 备注
/// </summary>
[ExporterHeader(DisplayName = "备注")]
[ImporterHeader(Name = "备注")]
public virtual string Remark { get; set; }
/// <summary>
/// 创建时间
/// </summary>
[ExporterHeader(DisplayName = "创建时间", Format = "yyyy/MM/dd HH:mm:ss")]
[ImporterHeader(Name = "创建时间", Format = "yyyy/MM/dd HH:mm:ss")]
public virtual DateTime? CreateTime { get; set; }
/// <summary>
/// 创建人
/// </summary>
[ExporterHeader(DisplayName = "创建人")]
[ImporterHeader(Name = "创建人")]
public virtual string CreatePerson { get; set; }
[ExporterHeader(IsIgnore = true)]
[ImporterHeader(IsIgnore = true)]
public virtual DateTime? ImportTime { get; set; }
[ExporterHeader(IsIgnore = true)]
[ImporterHeader(IsIgnore = true)]
public virtual string ImportPerson { get; set; }
[ExporterHeader(IsIgnore = true)]
[ImporterHeader(IsIgnore = true)]
public virtual string Remark2 { get; set; }
[ExporterHeader(IsIgnore = true)]
[ImporterHeader(IsIgnore = true)]
public virtual string Remark3 { get; set; }
[ExporterHeader(IsIgnore = true)]
[ImporterHeader(IsIgnore = true)]
public virtual string Remark4 { get; set; }
[ExporterHeader(IsIgnore = true)]
[ImporterHeader(IsIgnore = true)]
public virtual string Remark5 { get; set; }
}
}

131
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/EdiReceive/Dtos/ImportRecordHisCreateDto.cs

@ -0,0 +1,131 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace WY.NewJit.EdiReceive.Dtos
{
public class ImportRecordHisCreateDto
{
/// <summary>
/// 工厂
/// </summary>
public virtual string Factory { get; set; }
/// <summary>
/// 车位
/// </summary>
public virtual string VehicleLocation { get; set; }
/// <summary>
/// 工位
/// </summary>
public virtual string WorkLocation { get; set; }
/// <summary>
/// 底盘号
/// </summary>
public virtual string Vin { get; set; }
/// <summary>
/// 车身号
/// </summary>
public virtual string VehicleBodyCode { get; set; }
/// <summary>
/// 车型代码
/// </summary>
public virtual string VehicleModelCode { get; set; }
/// <summary>
/// 车型名称
/// </summary>
public virtual string VehicleModelName { get; set; }
/// <summary>
/// 车型描述
/// </summary>
public virtual string VehicleModelDesc { get; set; }
/// <summary>
/// 规格
/// </summary>
public virtual string Spec { get; set; }
/// <summary>
/// 规格说明
/// </summary>
public virtual string SpecDesc { get; set; }
/// <summary>
/// 类别
/// </summary>
public virtual string Type { get; set; }
/// <summary>
/// 涂装下线时间
/// </summary>
public virtual DateTime? PaintOfflineTime { get; set; }
/// <summary>
/// 总装上线时间
/// </summary>
public virtual DateTime? OnlineTime { get; set; }
/// <summary>
/// 内饰颜色
/// </summary>
public virtual string InteriorColor { get; set; }
/// <summary>
/// 外饰颜色
/// </summary>
public virtual string ExteriorTrimmingColor { get; set; }
/// <summary>
/// 序列号
/// </summary>
public virtual string SerialNum { get; set; }
/// <summary>
/// 流水号
/// </summary>
public virtual int HostSN { get; set; }
/// <summary>
/// 生产线:A/B
/// </summary>
public virtual string ProductLine { get; set; }
/// <summary>
/// 目的
/// </summary>
public virtual string Target { get; set; }
/// <summary>
/// 备注
/// </summary>
public virtual string Remark { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public virtual DateTime? CreateTime { get; set; }
/// <summary>
/// 创建人
/// </summary>
public virtual string CreatePerson { get; set; }
public virtual DateTime? ImportTime { get; set; }
public virtual string ImportPerson { get; set; }
public virtual string Remark2 { get; set; }
public virtual string Remark3 { get; set; }
public virtual string Remark4 { get; set; }
public virtual string Remark5 { get; set; }
}
}

132
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/EdiReceive/Dtos/ImportRecordHisDto.cs

@ -0,0 +1,132 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace WY.NewJit.EdiReceive.Dtos
{
public class ImportRecordHisDto
{
public Guid Id { get; set; }
/// <summary>
/// 工厂
/// </summary>
public virtual string Factory { get; set; }
/// <summary>
/// 车位
/// </summary>
public virtual string VehicleLocation { get; set; }
/// <summary>
/// 工位
/// </summary>
public virtual string WorkLocation { get; set; }
/// <summary>
/// 底盘号
/// </summary>
public virtual string Vin { get; set; }
/// <summary>
/// 车身号
/// </summary>
public virtual string VehicleBodyCode { get; set; }
/// <summary>
/// 车型代码
/// </summary>
public virtual string VehicleModelCode { get; set; }
/// <summary>
/// 车型名称
/// </summary>
public virtual string VehicleModelName { get; set; }
/// <summary>
/// 车型描述
/// </summary>
public virtual string VehicleModelDesc { get; set; }
/// <summary>
/// 规格
/// </summary>
public virtual string Spec { get; set; }
/// <summary>
/// 规格说明
/// </summary>
public virtual string SpecDesc { get; set; }
/// <summary>
/// 类别
/// </summary>
public virtual string Type { get; set; }
/// <summary>
/// 涂装下线时间
/// </summary>
public virtual DateTime? PaintOfflineTime { get; set; }
/// <summary>
/// 总装上线时间
/// </summary>
public virtual DateTime? OnlineTime { get; set; }
/// <summary>
/// 内饰颜色
/// </summary>
public virtual string InteriorColor { get; set; }
/// <summary>
/// 外饰颜色
/// </summary>
public virtual string ExteriorTrimmingColor { get; set; }
/// <summary>
/// 序列号
/// </summary>
public virtual string SerialNum { get; set; }
/// <summary>
/// 流水号
/// </summary>
public virtual int HostSN { get; set; }
/// <summary>
/// 生产线:A/B
/// </summary>
public virtual string ProductLine { get; set; }
/// <summary>
/// 目的
/// </summary>
public virtual string Target { get; set; }
/// <summary>
/// 备注
/// </summary>
public virtual string Remark { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public virtual DateTime? CreateTime { get; set; }
/// <summary>
/// 创建人
/// </summary>
public virtual string CreatePerson { get; set; }
public virtual DateTime? ImportTime { get; set; }
public virtual string ImportPerson { get; set; }
public virtual string Remark2 { get; set; }
public virtual string Remark3 { get; set; }
public virtual string Remark4 { get; set; }
public virtual string Remark5 { get; set; }
}
}

86
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/EdiReceive/Dtos/ImportRecordInputDto.cs

@ -0,0 +1,86 @@
using System;
using System.Collections.Generic;
using System.Text;
using WY.NewJit.Common;
namespace WY.NewJit.EdiReceive.Dtos
{
public class ImportRecordInputDto : PagedAndSortedBase
{
/// <summary>
/// 工厂
/// </summary>
public virtual string Factory { get; set; }
/// <summary>
/// 底盘号
/// </summary>
public virtual string Vin { get; set; }
/// <summary>
/// 车型代码
/// </summary>
public virtual string VehicleModelCode { get; set; }
/// <summary>
/// 涂装下线时间起
/// </summary>
public virtual DateTime? PaintOfflineTimeBegin { get; set; }
/// <summary>
/// 涂装下线时间止
/// </summary>
public virtual DateTime? PaintOfflineTimeEnd { get; set; }
/// <summary>
/// 总装上线时间起
/// </summary>
public virtual DateTime? OnlineTimeBegin { get; set; }
/// <summary>
/// 总装上线时间止
/// </summary>
public virtual DateTime? OnlineTimeEnd { get; set; }
/// <summary>
/// 序列号起
/// </summary>
public virtual string SerialNumBegin { get; set; }
/// <summary>
/// 序列号止
/// </summary>
public virtual string SerialNumEnd { get; set; }
/// <summary>
/// 流水号起
/// </summary>
public virtual int? HostSNBegin { get; set; }
/// <summary>
/// 流水号止
/// </summary>
public virtual int? HostSNEnd { get; set; }
/// <summary>
/// 生产线:A/B
/// </summary>
public virtual string ProductLine { get; set; }
/// <summary>
/// 创建时间起
/// </summary>
public virtual DateTime? CreateTimeBegin { get; set; }
/// <summary>
/// 创建时间止
/// </summary>
public virtual DateTime? CreateTimeEnd { get; set; }
public virtual DateTime? ImportTimeBegin { get; set; }
public virtual DateTime? ImportTimeEnd { get; set; }
}
}

70
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/EdiReceive/Interfaces/IImportRecordAppService.cs

@ -0,0 +1,70 @@
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Application.Services;
using WY.NewJit.EdiReceive.Dtos;
namespace WY.NewJit.EdiReceive.Interfaces
{
public interface IImportRecordAppService : IApplicationService
{
#region 接口方法
/// 根据筛选条件获取分页实体列表
/// </summary>
/// <param name="input">输入查询条件</param>
/// <param name="page">输入分页条件</param>
/// <returns>返回符合条件的排序分页列表</returns>
Task<PagedResultDto<ImportRecordDto>> GetListAsync(ImportRecordInputDto input);
/// <summary>
/// 按主键获取唯一实体
/// </summary>
/// <param name="id">主键</param>
/// <returns>实体信息</returns>
Task<ObjectResultDto<ImportRecordDto>> GetAsync(Guid id);
/// <summary>
/// 添加实体
/// </summary>
/// <param name="input">添加内容</param>
/// <returns>执行成功返回真</returns>
Task<ObjectResultDto<Guid>> CreateAsync(ImportRecordCreateDto input);
/// <summary>
/// 修改实体
/// </summary>
/// <param name="id">更新主键</param>
/// <param name="input">修改内容</param>
/// <returns>执行成功返回真</returns>
Task<ObjectResultDto> UpdateAsync(Guid id, ImportRecordCreateDto input);
/// <summary>
/// 删除实体
/// </summary>
/// <param name="id">删除主键</param>
/// <returns>执行成功返回真</returns>
Task<ObjectResultDto> DeleteAsync(string id);
/// <summary>
/// 导出信息
/// </summary>
/// <param name="input">导出查询条件</param>
/// <returns>执行成功返回真</returns>
Task<ObjectResultDto<string>> ExportAsync(ImportRecordInputDto input);
/// <summary>
/// 导入信息
/// </summary>
/// <param name="files">导入文件流</param>
/// <param name="forceExecute">是否强制执行</param>
/// <returns>执行成功返回真</returns>
Task<ObjectResultDto> ImportAsync([FromForm] IFormFileCollection files, bool forceExecute = false);
#endregion
}
}

5
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/Extends/MenBanReports/MenBanPrintInputDto.cs

@ -33,6 +33,11 @@ namespace WY.NewJit.Extends
/// </summary>
public virtual int EndHostSN { get; set; }
/// <summary>
/// 打印条数
/// </summary>
public virtual int PrintCount { get; set; }
#region 重新打印、补打时使用
/// <summary>
/// 重新打印时使用。装箱单主表ID列表,报废时传入一个,重打时可传入多个

16
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/MsgBaseData/AssemblyCfgs/Dtos/AssemblyCfgErpDto.cs

@ -46,6 +46,22 @@ namespace WY.NewJit.MsgBaseData
[ImporterHeader(Name = "长描述")]
public virtual string GroupCode { get; set; }
/// <summary>
/// 规格说明
/// </summary>
[ExporterHeader(DisplayName = "规格说明")]
[ImporterHeader(Name = "规格说明")]
public virtual string SpecExplain { get; set; }
/// <summary>
/// 颜色说明
/// </summary>
[ExporterHeader(DisplayName = "颜色说明")]
[ImporterHeader(Name = "颜色说明")]
public virtual string ColorExplain { get; set; }
/// <summary>
/// 车型
/// </summary>

15
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/MsgBaseData/AssemblyCfgs/Dtos/ExportErpAssemblyDto.cs

@ -39,6 +39,21 @@ namespace WY.NewJit.MsgBaseData
[ImporterHeader(Name = "ERP总成名称")]
public string ErpAssemblyName { get; set; }
/// <summary>
/// 规格说明
/// </summary>
[ExporterHeader(DisplayName = "规格说明")]
[ImporterHeader(Name = "规格说明")]
public string SpecExplain { get; set; }
/// <summary>
/// 颜色说明
/// </summary>
[ExporterHeader(DisplayName = "颜色说明")]
[ImporterHeader(Name = "颜色说明")]
public string ColorExplain { get; set; }
/// <summary>
/// 客户零件代码
/// </summary>

39
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/MsgBaseData/AssemblyCfgs/Dtos/ImportErpAssemblyGroupDto.cs

@ -0,0 +1,39 @@
using Magicodes.ExporterAndImporter.Core;
using Magicodes.ExporterAndImporter.Excel;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Text;
namespace WY.NewJit.MsgBaseData
{
/// <summary>
/// 总成组
/// </summary>
[ExcelExporter(Name = "总成组表", AutoFitAllColumn = true, MaxRowNumberOnASheet = 50000)] //一个Sheet最大允许的行数,设置了之后将输出多个Sheet
[Serializable]
public class ImportErpAssemblyGroupDto
{
/// <summary>
/// 规格说明
/// </summary>
[ExporterHeader(DisplayName = "规格说明")]
[ImporterHeader(Name = "规格说明")]
[Required(ErrorMessage = "规格说明{0}是必填项")]
public virtual string SpecExplain { get; set; }
/// <summary>
/// 颜色说明
/// </summary>
[ExporterHeader(DisplayName = "颜色说明")]
[ImporterHeader(Name = "颜色说明")]
[Required(ErrorMessage = "颜色说明{0}是必填项")]
public virtual string ColorExplain { get; set; }
/// <summary>
/// SAP物料号
/// </summary>
[ExporterHeader(DisplayName = "物料号")]
[ImporterHeader(Name = "物料号")]
[Required(ErrorMessage = "SAP物料号{0}是必填项")]
public virtual string MaterialNum { get; set; }
}
}

11
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/MsgBaseData/AssemblyCfgs/Dtos/QueryAssemblyCfgErpDto.cs

@ -18,12 +18,21 @@ namespace WY.NewJit.MsgBaseData
/// 总成名称
/// </summary>
public string ErpAssemblyName { get; set; }
/// <summary>
/// 车型代码
/// </summary>
public string VehicleModelCode { get; set; }
/// <summary>
/// 规格说明
/// </summary>
public string SpecExplain { get; set; }
/// <summary>
/// 颜色说明
/// </summary>
public string ColorExplain { get; set; }
public DateTime? BeginCreateTime { get; set; }
public DateTime? EndCreateTime { get; set; }

26
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/MsgBaseData/BaseConfig/Dto/BaseConfigCreateDto.cs

@ -0,0 +1,26 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace WY.NewJit.MsgBaseData
{
public class BaseConfigCreateDto
{
/// <summary>
/// 参数名称
/// </summary>
public virtual string ParamName { get; set; }
/// <summary>
/// 参数值
/// </summary>
public virtual string ParamValue { get; set; }
/// <summary>
/// 状态
/// </summary>
public virtual bool State { get; set; }
/// <summary>
/// 备注
/// </summary>
public virtual string Remark { get; set; }
}
}

31
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/MsgBaseData/BaseConfig/Dto/BaseConfigDto.cs

@ -0,0 +1,31 @@
using System;
using System.Collections.Generic;
using System.Text;
using Volo.Abp.Application.Dtos;
namespace WY.NewJit.MsgBaseData
{
/// <summary>
/// 基础参数配置表
/// </summary>
[Serializable]
public class BaseConfigDto : EntityDto<Guid>
{
/// <summary>
/// 参数名称
/// </summary>
public virtual string ParamName { get; set; }
/// <summary>
/// 参数值
/// </summary>
public virtual string ParamValue { get; set; }
/// <summary>
/// 状态
/// </summary>
public virtual bool State { get; set; }
/// <summary>
/// 备注
/// </summary>
public virtual string Remark { get; set; }
}
}

27
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/MsgBaseData/BaseConfig/Dto/QueryBaseConfigDto.cs

@ -0,0 +1,27 @@
using System;
using System.Collections.Generic;
using System.Text;
using WY.NewJit.Common;
namespace WY.NewJit.MsgBaseData
{
public class QueryBaseConfigDto : PagedAndSortedBase
{
/// <summary>
/// 参数名称
/// </summary>
public virtual string ParamName { get; set; }
/// <summary>
/// 参数值
/// </summary>
public virtual string ParamValue { get; set; }
/// <summary>
/// 状态
/// </summary>
public virtual List<bool> State { get; set; } = new List<bool>();
/// <summary>
/// 备注
/// </summary>
public virtual string Remark { get; set; }
}
}

14
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/MsgBaseData/BaseConfig/Interfaces/IBaseGonfigService.cs

@ -0,0 +1,14 @@
using System;
using System.Threading.Tasks;
using Volo.Abp.Application.Dtos;
namespace WY.NewJit.MsgBaseData
{
public interface IBaseGonfigService
{
Task<ObjectResultDto<Guid>> CreateAsync(BaseConfigCreateDto input);
Task<ObjectResultDto> DeleteAsync(string id);
Task<PagedResultDto<BaseConfigDto>> GetListAsync(QueryBaseConfigDto input);
Task<ObjectResultDto> UpdateAsync(Guid id, BaseConfigCreateDto input);
}
}

49
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/MsgBaseData/MaterialExt/Dto/MaterialExtDto.cs

@ -0,0 +1,49 @@
using Magicodes.ExporterAndImporter.Core;
using Magicodes.ExporterAndImporter.Excel;
using System;
using System.Collections.Generic;
using System.Text;
using Volo.Abp.Application.Dtos;
namespace WY.NewJit.MsgBaseData
{
[ExcelExporter(Name = "物料信息", AutoFitAllColumn = true, MaxRowNumberOnASheet = 1000)] //一个Sheet最大允许的行数,设置了之后将输出多个Sheet
[Serializable]
public class MaterialExtDto : AuditedEntityDto<Guid>
{
/// <summary>
/// SAP物料号
/// </summary>
[ExporterHeader(DisplayName = "SAP物料号")]
[ImporterHeader(Name = "SAP物料号")]
public string MaterialNum { get; set; }
/// <summary>
/// 物料描述(大小量纲、物料描述字段值同时存在时,优先显示大小量纲)
/// </summary>
[ExporterHeader(DisplayName = "物料描述")]
[ImporterHeader(Name = "物料描述")]
public string MaterialDescription { get; set; }
/// <summary>
/// 大小量纲(大小量纲、物料描述字段值同时存在时,优先显示大小量纲)
/// </summary>
[ExporterHeader(DisplayName = "大小量纲")]
[ImporterHeader(Name = "大小量纲")]
public string MaterialDescription2 { get; set; }
/// <summary>
/// 补充备注(车型、门板代码)
/// </summary>
[ExporterHeader(DisplayName = "补充备注")]
[ImporterHeader(Name = "补充备注")]
public string MaterialMemo { get; set; }
/// <summary>
/// 物料组:例如 门板成品-C8
/// </summary>
[ExporterHeader(DisplayName = "物料组")]
[ImporterHeader(Name = "物料组")]
public string MaterialGroup { get; set; }
}
}

30
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/MsgBaseData/MaterialExt/Dto/QueryMaterialExtDto.cs

@ -0,0 +1,30 @@
using System;
using System.Collections.Generic;
using System.Text;
using WY.NewJit.Common;
namespace WY.NewJit.MsgBaseData
{
[Serializable]
public class QueryMaterialExtDto : PagedAndSortedBase
{
/// <summary>
/// SAP物料号
/// </summary>
public string MaterialNum { get; set; }
/// <summary>
/// 物料描述(大小量纲、物料描述字段值同时存在时,优先显示大小量纲)
/// </summary>
public string MaterialDescription { get; set; }
/// <summary>
/// 物料组:例如 门板成品-C8
/// </summary>
public string MaterialGroup { get; set; }
/// <summary>
/// 物料类型 0 空 1 控制件 2 柱护板 3 门板
/// </summary>
public string MaterialType { get; set; }
}
}

11
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/MsgBaseData/MaterialExt/Interfaces/IMaterialExtAppService.cs

@ -0,0 +1,11 @@
using System.Threading.Tasks;
using Volo.Abp.Application.Dtos;
namespace WY.NewJit.MsgBaseData
{
public interface IMaterialExtAppService
{
Task<ObjectResultDto<string>> ExportAsync(QueryMaterialExtDto input);
Task<PagedResultDto<MaterialExtDto>> GetListAsync(QueryMaterialExtDto input);
}
}

13
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/MsgCheck/BillM100s/Dtos/BillM100Dto.cs

@ -124,5 +124,18 @@ namespace WY.NewJit.MsgCheck
[ImporterHeader(Name = "手工操作日期")]
public DateTime? OperationTime { get; set; }
/// <summary>
/// 规格说明:HSC0DRCC0001
/// </summary>
[ExporterHeader(DisplayName = "规格说明")]
[ImporterHeader(Name = "规格说明")]
public virtual string SpecExplain { get; set; }
/// <summary>
/// 颜色说明:车型描述后7位,石墨黑/云杉灰
/// </summary>
[ExporterHeader(DisplayName = "颜色说明")]
[ImporterHeader(Name = "颜色说明")]
public virtual string ColorExplain { get; set; }
}
}

15
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/MsgCheck/BillM100s/Dtos/ResultBillM100Dto.cs

@ -150,8 +150,21 @@ namespace WY.NewJit.MsgCheck
[ImporterHeader(IsIgnore = true)]
public virtual string PrintBillNum { get; set; }
/// <summary>
/// 规格说明:HSC0DRCC0001
/// </summary>
[ExporterHeader(DisplayName = "规格说明")]
[ImporterHeader(Name = "规格说明")]
public virtual string SpecExplain { get; set; }
/// <summary>
/// 颜色说明:车型描述后7位,石墨黑/云杉灰
/// </summary>
[ExporterHeader(DisplayName = "颜色说明")]
[ImporterHeader(Name = "颜色说明")]
public virtual string ColorExplain { get; set; }
}
}

14
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/MsgCheck/UnknownAssemblys/Dtos/ResultUnknownAssemblyDto.cs

@ -109,7 +109,19 @@ namespace WY.NewJit.MsgCheck.UnknownAssemblys
[ExporterHeader(DisplayName = "单据表描述")]
[ImporterHeader(Name = "单据表描述")]
public string BillDescription { get; set; }
/// <summary>
/// 规格说明:HSC0DRCC0001
/// </summary>
[ExporterHeader(DisplayName = "规格说明")]
[ImporterHeader(Name = "规格说明")]
public virtual string SpecExplain { get; set; }
/// <summary>
/// 颜色说明:车型描述后7位,石墨黑/云杉灰
/// </summary>
[ExporterHeader(DisplayName = "颜色说明")]
[ImporterHeader(Name = "颜色说明")]
public virtual string ColorExplain { get; set; }
}
}

2
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/MsgCheck/UnknownAssemblys/Interfaces/IUnknownAssemblyAppService.cs

@ -64,7 +64,7 @@ namespace WY.NewJit.MsgCheck.UnknownAssemblys
/// </summary>
/// <param name="takeCount"></param>
/// <returns></returns>
ObjectResultDto<string> BatchParseAsync(BatchParseParam input);
//ObjectResultDto<string> BatchParseAsync(BatchParseParam input);
/// <summary>
/// 根据vin从天合mes系统中取erp总成编码列表

13
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/PrintTable/Dtos/AlreadyPrintDto.cs

@ -139,6 +139,19 @@ namespace WY.NewJit.PrintTable
[ImporterHeader(Name = "最后修改人")]
public Guid? LastModifierId { get; set; }
/// <summary>
/// 规格说明:HSC0DRCC0001
/// </summary>
[ExporterHeader(DisplayName = "规格说明")]
[ImporterHeader(Name = "规格说明")]
public virtual string SpecExplain { get; set; }
/// <summary>
/// 颜色说明:车型描述后7位,石墨黑/云杉灰
/// </summary>
[ExporterHeader(DisplayName = "颜色说明")]
[ImporterHeader(Name = "颜色说明")]
public virtual string ColorExplain { get; set; }
}
}

15
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/PrintTable/Dtos/WaitPrintDto.cs

@ -154,5 +154,20 @@ namespace WY.NewJit.PrintTable
[ExporterHeader(DisplayName = "R100接收时间")]
[ImporterHeader(Name = "R100接收时间")]
public DateTime? R100ReceiveTime { get; set; }
/// <summary>
/// 规格说明:HSC0DRCC0001
/// </summary>
[ExporterHeader(DisplayName = "规格说明")]
[ImporterHeader(Name = "规格说明")]
public virtual string SpecExplain { get; set; }
/// <summary>
/// 颜色说明:车型描述后7位,石墨黑/云杉灰
/// </summary>
[ExporterHeader(DisplayName = "颜色说明")]
[ImporterHeader(Name = "颜色说明")]
public virtual string ColorExplain { get; set; }
}
}

1
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/WY.NewJit.Application.Contracts.csproj

@ -22,6 +22,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Mvc.Core" Version="2.2.0" />
<PackageReference Include="Volo.Abp.ObjectExtending" Version="4.3.3" />
<PackageReference Include="Volo.Abp.Account.Application.Contracts" Version="4.3.3" />
<PackageReference Include="Volo.Abp.Identity.Application.Contracts" Version="4.3.3" />

782
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application.Contracts/WY.NewJit.Application.Contracts.xml

@ -4,6 +4,566 @@
<name>WY.NewJit.Application.Contracts</name>
</assembly>
<members>
<member name="P:WY.NewJit.EdiReceive.Dtos.ImportRecordCreateDto.Factory">
<summary>
工厂
</summary>
</member>
<member name="P:WY.NewJit.EdiReceive.Dtos.ImportRecordCreateDto.VehicleLocation">
<summary>
车位
</summary>
</member>
<member name="P:WY.NewJit.EdiReceive.Dtos.ImportRecordCreateDto.WorkLocation">
<summary>
工位
</summary>
</member>
<member name="P:WY.NewJit.EdiReceive.Dtos.ImportRecordCreateDto.Vin">
<summary>
底盘号
</summary>
</member>
<member name="P:WY.NewJit.EdiReceive.Dtos.ImportRecordCreateDto.VehicleBodyCode">
<summary>
车身号
</summary>
</member>
<member name="P:WY.NewJit.EdiReceive.Dtos.ImportRecordCreateDto.VehicleModelCode">
<summary>
车型代码
</summary>
</member>
<member name="P:WY.NewJit.EdiReceive.Dtos.ImportRecordCreateDto.VehicleModelName">
<summary>
车型名称
</summary>
</member>
<member name="P:WY.NewJit.EdiReceive.Dtos.ImportRecordCreateDto.VehicleModelDesc">
<summary>
车型描述
</summary>
</member>
<member name="P:WY.NewJit.EdiReceive.Dtos.ImportRecordCreateDto.Spec">
<summary>
规格
</summary>
</member>
<member name="P:WY.NewJit.EdiReceive.Dtos.ImportRecordCreateDto.SpecDesc">
<summary>
规格说明
</summary>
</member>
<member name="P:WY.NewJit.EdiReceive.Dtos.ImportRecordCreateDto.Type">
<summary>
类别
</summary>
</member>
<member name="P:WY.NewJit.EdiReceive.Dtos.ImportRecordCreateDto.PaintOfflineTime">
<summary>
涂装下线时间
</summary>
</member>
<member name="P:WY.NewJit.EdiReceive.Dtos.ImportRecordCreateDto.OnlineTime">
<summary>
总装上线时间
</summary>
</member>
<member name="P:WY.NewJit.EdiReceive.Dtos.ImportRecordCreateDto.InteriorColor">
<summary>
内饰颜色
</summary>
</member>
<member name="P:WY.NewJit.EdiReceive.Dtos.ImportRecordCreateDto.ExteriorTrimmingColor">
<summary>
外饰颜色
</summary>
</member>
<member name="P:WY.NewJit.EdiReceive.Dtos.ImportRecordCreateDto.SerialNum">
<summary>
序列号
</summary>
</member>
<member name="P:WY.NewJit.EdiReceive.Dtos.ImportRecordCreateDto.HostSN">
<summary>
流水号
</summary>
</member>
<member name="P:WY.NewJit.EdiReceive.Dtos.ImportRecordCreateDto.ProductLine">
<summary>
生产线:A/B
</summary>
</member>
<member name="P:WY.NewJit.EdiReceive.Dtos.ImportRecordCreateDto.Target">
<summary>
目的
</summary>
</member>
<member name="P:WY.NewJit.EdiReceive.Dtos.ImportRecordCreateDto.Remark">
<summary>
备注
</summary>
</member>
<member name="P:WY.NewJit.EdiReceive.Dtos.ImportRecordCreateDto.CreateTime">
<summary>
创建时间
</summary>
</member>
<member name="P:WY.NewJit.EdiReceive.Dtos.ImportRecordCreateDto.CreatePerson">
<summary>
创建人
</summary>
</member>
<member name="T:WY.NewJit.EdiReceive.Dtos.ImportRecordDto">
<summary>
导入记录表
</summary>
</member>
<member name="P:WY.NewJit.EdiReceive.Dtos.ImportRecordDto.Factory">
<summary>
工厂
</summary>
</member>
<member name="P:WY.NewJit.EdiReceive.Dtos.ImportRecordDto.VehicleLocation">
<summary>
车位
</summary>
</member>
<member name="P:WY.NewJit.EdiReceive.Dtos.ImportRecordDto.WorkLocation">
<summary>
工位
</summary>
</member>
<member name="P:WY.NewJit.EdiReceive.Dtos.ImportRecordDto.Vin">
<summary>
底盘号
</summary>
</member>
<member name="P:WY.NewJit.EdiReceive.Dtos.ImportRecordDto.VehicleBodyCode">
<summary>
车身号
</summary>
</member>
<member name="P:WY.NewJit.EdiReceive.Dtos.ImportRecordDto.VehicleModelCode">
<summary>
车型代码
</summary>
</member>
<member name="P:WY.NewJit.EdiReceive.Dtos.ImportRecordDto.VehicleModelName">
<summary>
车型名称
</summary>
</member>
<member name="P:WY.NewJit.EdiReceive.Dtos.ImportRecordDto.VehicleModelDesc">
<summary>
车型描述
</summary>
</member>
<member name="P:WY.NewJit.EdiReceive.Dtos.ImportRecordDto.Spec">
<summary>
规格
</summary>
</member>
<member name="P:WY.NewJit.EdiReceive.Dtos.ImportRecordDto.SpecDesc">
<summary>
规格说明
</summary>
</member>
<member name="P:WY.NewJit.EdiReceive.Dtos.ImportRecordDto.Type">
<summary>
类别
</summary>
</member>
<member name="P:WY.NewJit.EdiReceive.Dtos.ImportRecordDto.PaintOfflineTime">
<summary>
涂装下线时间
</summary>
</member>
<member name="P:WY.NewJit.EdiReceive.Dtos.ImportRecordDto.OnlineTime">
<summary>
总装上线时间
</summary>
</member>
<member name="P:WY.NewJit.EdiReceive.Dtos.ImportRecordDto.InteriorColor">
<summary>
内饰颜色
</summary>
</member>
<member name="P:WY.NewJit.EdiReceive.Dtos.ImportRecordDto.ExteriorTrimmingColor">
<summary>
外饰颜色
</summary>
</member>
<member name="P:WY.NewJit.EdiReceive.Dtos.ImportRecordDto.SerialNum">
<summary>
序列号
</summary>
</member>
<member name="P:WY.NewJit.EdiReceive.Dtos.ImportRecordDto.HostSN">
<summary>
流水号
</summary>
</member>
<member name="P:WY.NewJit.EdiReceive.Dtos.ImportRecordDto.ProductLine">
<summary>
生产线:A/B
</summary>
</member>
<member name="P:WY.NewJit.EdiReceive.Dtos.ImportRecordDto.Target">
<summary>
目的
</summary>
</member>
<member name="P:WY.NewJit.EdiReceive.Dtos.ImportRecordDto.Remark">
<summary>
备注
</summary>
</member>
<member name="P:WY.NewJit.EdiReceive.Dtos.ImportRecordDto.CreateTime">
<summary>
创建时间
</summary>
</member>
<member name="P:WY.NewJit.EdiReceive.Dtos.ImportRecordDto.CreatePerson">
<summary>
创建人
</summary>
</member>
<member name="P:WY.NewJit.EdiReceive.Dtos.ImportRecordHisCreateDto.Factory">
<summary>
工厂
</summary>
</member>
<member name="P:WY.NewJit.EdiReceive.Dtos.ImportRecordHisCreateDto.VehicleLocation">
<summary>
车位
</summary>
</member>
<member name="P:WY.NewJit.EdiReceive.Dtos.ImportRecordHisCreateDto.WorkLocation">
<summary>
工位
</summary>
</member>
<member name="P:WY.NewJit.EdiReceive.Dtos.ImportRecordHisCreateDto.Vin">
<summary>
底盘号
</summary>
</member>
<member name="P:WY.NewJit.EdiReceive.Dtos.ImportRecordHisCreateDto.VehicleBodyCode">
<summary>
车身号
</summary>
</member>
<member name="P:WY.NewJit.EdiReceive.Dtos.ImportRecordHisCreateDto.VehicleModelCode">
<summary>
车型代码
</summary>
</member>
<member name="P:WY.NewJit.EdiReceive.Dtos.ImportRecordHisCreateDto.VehicleModelName">
<summary>
车型名称
</summary>
</member>
<member name="P:WY.NewJit.EdiReceive.Dtos.ImportRecordHisCreateDto.VehicleModelDesc">
<summary>
车型描述
</summary>
</member>
<member name="P:WY.NewJit.EdiReceive.Dtos.ImportRecordHisCreateDto.Spec">
<summary>
规格
</summary>
</member>
<member name="P:WY.NewJit.EdiReceive.Dtos.ImportRecordHisCreateDto.SpecDesc">
<summary>
规格说明
</summary>
</member>
<member name="P:WY.NewJit.EdiReceive.Dtos.ImportRecordHisCreateDto.Type">
<summary>
类别
</summary>
</member>
<member name="P:WY.NewJit.EdiReceive.Dtos.ImportRecordHisCreateDto.PaintOfflineTime">
<summary>
涂装下线时间
</summary>
</member>
<member name="P:WY.NewJit.EdiReceive.Dtos.ImportRecordHisCreateDto.OnlineTime">
<summary>
总装上线时间
</summary>
</member>
<member name="P:WY.NewJit.EdiReceive.Dtos.ImportRecordHisCreateDto.InteriorColor">
<summary>
内饰颜色
</summary>
</member>
<member name="P:WY.NewJit.EdiReceive.Dtos.ImportRecordHisCreateDto.ExteriorTrimmingColor">
<summary>
外饰颜色
</summary>
</member>
<member name="P:WY.NewJit.EdiReceive.Dtos.ImportRecordHisCreateDto.SerialNum">
<summary>
序列号
</summary>
</member>
<member name="P:WY.NewJit.EdiReceive.Dtos.ImportRecordHisCreateDto.HostSN">
<summary>
流水号
</summary>
</member>
<member name="P:WY.NewJit.EdiReceive.Dtos.ImportRecordHisCreateDto.ProductLine">
<summary>
生产线:A/B
</summary>
</member>
<member name="P:WY.NewJit.EdiReceive.Dtos.ImportRecordHisCreateDto.Target">
<summary>
目的
</summary>
</member>
<member name="P:WY.NewJit.EdiReceive.Dtos.ImportRecordHisCreateDto.Remark">
<summary>
备注
</summary>
</member>
<member name="P:WY.NewJit.EdiReceive.Dtos.ImportRecordHisCreateDto.CreateTime">
<summary>
创建时间
</summary>
</member>
<member name="P:WY.NewJit.EdiReceive.Dtos.ImportRecordHisCreateDto.CreatePerson">
<summary>
创建人
</summary>
</member>
<member name="P:WY.NewJit.EdiReceive.Dtos.ImportRecordHisDto.Factory">
<summary>
工厂
</summary>
</member>
<member name="P:WY.NewJit.EdiReceive.Dtos.ImportRecordHisDto.VehicleLocation">
<summary>
车位
</summary>
</member>
<member name="P:WY.NewJit.EdiReceive.Dtos.ImportRecordHisDto.WorkLocation">
<summary>
工位
</summary>
</member>
<member name="P:WY.NewJit.EdiReceive.Dtos.ImportRecordHisDto.Vin">
<summary>
底盘号
</summary>
</member>
<member name="P:WY.NewJit.EdiReceive.Dtos.ImportRecordHisDto.VehicleBodyCode">
<summary>
车身号
</summary>
</member>
<member name="P:WY.NewJit.EdiReceive.Dtos.ImportRecordHisDto.VehicleModelCode">
<summary>
车型代码
</summary>
</member>
<member name="P:WY.NewJit.EdiReceive.Dtos.ImportRecordHisDto.VehicleModelName">
<summary>
车型名称
</summary>
</member>
<member name="P:WY.NewJit.EdiReceive.Dtos.ImportRecordHisDto.VehicleModelDesc">
<summary>
车型描述
</summary>
</member>
<member name="P:WY.NewJit.EdiReceive.Dtos.ImportRecordHisDto.Spec">
<summary>
规格
</summary>
</member>
<member name="P:WY.NewJit.EdiReceive.Dtos.ImportRecordHisDto.SpecDesc">
<summary>
规格说明
</summary>
</member>
<member name="P:WY.NewJit.EdiReceive.Dtos.ImportRecordHisDto.Type">
<summary>
类别
</summary>
</member>
<member name="P:WY.NewJit.EdiReceive.Dtos.ImportRecordHisDto.PaintOfflineTime">
<summary>
涂装下线时间
</summary>
</member>
<member name="P:WY.NewJit.EdiReceive.Dtos.ImportRecordHisDto.OnlineTime">
<summary>
总装上线时间
</summary>
</member>
<member name="P:WY.NewJit.EdiReceive.Dtos.ImportRecordHisDto.InteriorColor">
<summary>
内饰颜色
</summary>
</member>
<member name="P:WY.NewJit.EdiReceive.Dtos.ImportRecordHisDto.ExteriorTrimmingColor">
<summary>
外饰颜色
</summary>
</member>
<member name="P:WY.NewJit.EdiReceive.Dtos.ImportRecordHisDto.SerialNum">
<summary>
序列号
</summary>
</member>
<member name="P:WY.NewJit.EdiReceive.Dtos.ImportRecordHisDto.HostSN">
<summary>
流水号
</summary>
</member>
<member name="P:WY.NewJit.EdiReceive.Dtos.ImportRecordHisDto.ProductLine">
<summary>
生产线:A/B
</summary>
</member>
<member name="P:WY.NewJit.EdiReceive.Dtos.ImportRecordHisDto.Target">
<summary>
目的
</summary>
</member>
<member name="P:WY.NewJit.EdiReceive.Dtos.ImportRecordHisDto.Remark">
<summary>
备注
</summary>
</member>
<member name="P:WY.NewJit.EdiReceive.Dtos.ImportRecordHisDto.CreateTime">
<summary>
创建时间
</summary>
</member>
<member name="P:WY.NewJit.EdiReceive.Dtos.ImportRecordHisDto.CreatePerson">
<summary>
创建人
</summary>
</member>
<member name="P:WY.NewJit.EdiReceive.Dtos.ImportRecordInputDto.Factory">
<summary>
工厂
</summary>
</member>
<member name="P:WY.NewJit.EdiReceive.Dtos.ImportRecordInputDto.Vin">
<summary>
底盘号
</summary>
</member>
<member name="P:WY.NewJit.EdiReceive.Dtos.ImportRecordInputDto.VehicleModelCode">
<summary>
车型代码
</summary>
</member>
<member name="P:WY.NewJit.EdiReceive.Dtos.ImportRecordInputDto.PaintOfflineTimeBegin">
<summary>
涂装下线时间起
</summary>
</member>
<member name="P:WY.NewJit.EdiReceive.Dtos.ImportRecordInputDto.PaintOfflineTimeEnd">
<summary>
涂装下线时间止
</summary>
</member>
<member name="P:WY.NewJit.EdiReceive.Dtos.ImportRecordInputDto.OnlineTimeBegin">
<summary>
总装上线时间起
</summary>
</member>
<member name="P:WY.NewJit.EdiReceive.Dtos.ImportRecordInputDto.OnlineTimeEnd">
<summary>
总装上线时间止
</summary>
</member>
<member name="P:WY.NewJit.EdiReceive.Dtos.ImportRecordInputDto.SerialNumBegin">
<summary>
序列号起
</summary>
</member>
<member name="P:WY.NewJit.EdiReceive.Dtos.ImportRecordInputDto.SerialNumEnd">
<summary>
序列号止
</summary>
</member>
<member name="P:WY.NewJit.EdiReceive.Dtos.ImportRecordInputDto.HostSNBegin">
<summary>
流水号起
</summary>
</member>
<member name="P:WY.NewJit.EdiReceive.Dtos.ImportRecordInputDto.HostSNEnd">
<summary>
流水号止
</summary>
</member>
<member name="P:WY.NewJit.EdiReceive.Dtos.ImportRecordInputDto.ProductLine">
<summary>
生产线:A/B
</summary>
</member>
<member name="P:WY.NewJit.EdiReceive.Dtos.ImportRecordInputDto.CreateTimeBegin">
<summary>
创建时间起
</summary>
</member>
<member name="P:WY.NewJit.EdiReceive.Dtos.ImportRecordInputDto.CreateTimeEnd">
<summary>
创建时间止
</summary>
</member>
<!-- Badly formed XML comment ignored for member "M:WY.NewJit.EdiReceive.Interfaces.IImportRecordAppService.GetListAsync(WY.NewJit.EdiReceive.Dtos.ImportRecordInputDto)" -->
<member name="M:WY.NewJit.EdiReceive.Interfaces.IImportRecordAppService.GetAsync(System.Guid)">
<summary>
按主键获取唯一实体
</summary>
<param name="id">主键</param>
<returns>实体信息</returns>
</member>
<member name="M:WY.NewJit.EdiReceive.Interfaces.IImportRecordAppService.CreateAsync(WY.NewJit.EdiReceive.Dtos.ImportRecordCreateDto)">
<summary>
添加实体
</summary>
<param name="input">添加内容</param>
<returns>执行成功返回真</returns>
</member>
<member name="M:WY.NewJit.EdiReceive.Interfaces.IImportRecordAppService.UpdateAsync(System.Guid,WY.NewJit.EdiReceive.Dtos.ImportRecordCreateDto)">
<summary>
修改实体
</summary>
<param name="id">更新主键</param>
<param name="input">修改内容</param>
<returns>执行成功返回真</returns>
</member>
<member name="M:WY.NewJit.EdiReceive.Interfaces.IImportRecordAppService.DeleteAsync(System.String)">
<summary>
删除实体
</summary>
<param name="id">删除主键</param>
<returns>执行成功返回真</returns>
</member>
<member name="M:WY.NewJit.EdiReceive.Interfaces.IImportRecordAppService.ExportAsync(WY.NewJit.EdiReceive.Dtos.ImportRecordInputDto)">
<summary>
导出信息
</summary>
<param name="input">导出查询条件</param>
<returns>执行成功返回真</returns>
</member>
<member name="M:WY.NewJit.EdiReceive.Interfaces.IImportRecordAppService.ImportAsync(Microsoft.AspNetCore.Http.IFormFileCollection,System.Boolean)">
<summary>
导入信息
</summary>
<param name="files">导入文件流</param>
<param name="forceExecute">是否强制执行</param>
<returns>执行成功返回真</returns>
</member>
<member name="T:WY.NewJit.Extends.MenBanPackingListDto">
<summary>
门板装箱单打印主实体
@ -209,6 +769,11 @@
终止大众顺序号
</summary>
</member>
<member name="P:WY.NewJit.Extends.MenBanPrintInputDto.PrintCount">
<summary>
打印条数
</summary>
</member>
<member name="P:WY.NewJit.Extends.MenBanPrintInputDto.ReportIdList">
<summary>
重新打印时使用。装箱单主表ID列表,报废时传入一个,重打时可传入多个
@ -688,6 +1253,16 @@
长描述
</summary>
</member>
<member name="P:WY.NewJit.MsgBaseData.AssemblyCfgErpDto.SpecExplain">
<summary>
规格说明
</summary>
</member>
<member name="P:WY.NewJit.MsgBaseData.AssemblyCfgErpDto.ColorExplain">
<summary>
颜色说明
</summary>
</member>
<member name="P:WY.NewJit.MsgBaseData.AssemblyCfgErpDto.VehicleModel">
<summary>
车型
@ -813,6 +1388,16 @@
ERP总成名称
</summary>
</member>
<member name="P:WY.NewJit.MsgBaseData.ExportErpAssemblyDto.SpecExplain">
<summary>
规格说明
</summary>
</member>
<member name="P:WY.NewJit.MsgBaseData.ExportErpAssemblyDto.ColorExplain">
<summary>
颜色说明
</summary>
</member>
<member name="P:WY.NewJit.MsgBaseData.ExportErpAssemblyDto.PartCode">
<summary>
客户零件代码
@ -838,6 +1423,26 @@
创建时间
</summary>
</member>
<member name="T:WY.NewJit.MsgBaseData.ImportErpAssemblyGroupDto">
<summary>
总成组
</summary>
</member>
<member name="P:WY.NewJit.MsgBaseData.ImportErpAssemblyGroupDto.SpecExplain">
<summary>
规格说明
</summary>
</member>
<member name="P:WY.NewJit.MsgBaseData.ImportErpAssemblyGroupDto.ColorExplain">
<summary>
颜色说明
</summary>
</member>
<member name="P:WY.NewJit.MsgBaseData.ImportErpAssemblyGroupDto.MaterialNum">
<summary>
SAP物料号
</summary>
</member>
<member name="P:WY.NewJit.MsgBaseData.QueryAssemblyCfgErpDto.ErpAssemblyCode">
<summary>
ERP总成编码
@ -853,6 +1458,16 @@
车型代码
</summary>
</member>
<member name="P:WY.NewJit.MsgBaseData.QueryAssemblyCfgErpDto.SpecExplain">
<summary>
规格说明
</summary>
</member>
<member name="P:WY.NewJit.MsgBaseData.QueryAssemblyCfgErpDto.ColorExplain">
<summary>
颜色说明
</summary>
</member>
<member name="M:WY.NewJit.MsgBaseData.IAssemblyCfgErpAppService.GetErpAssemblyListAsync(WY.NewJit.MsgBaseData.QueryAssemblyCfgErpDto)">
<summary>
根据筛选条件获取分页实体列表
@ -940,6 +1555,71 @@
<param name="vehicleAssemblyId">整车总成Id</param>
<returns>Erp总成列表</returns>
</member>
<member name="P:WY.NewJit.MsgBaseData.BaseConfigCreateDto.ParamName">
<summary>
参数名称
</summary>
</member>
<member name="P:WY.NewJit.MsgBaseData.BaseConfigCreateDto.ParamValue">
<summary>
参数值
</summary>
</member>
<member name="P:WY.NewJit.MsgBaseData.BaseConfigCreateDto.State">
<summary>
状态
</summary>
</member>
<member name="P:WY.NewJit.MsgBaseData.BaseConfigCreateDto.Remark">
<summary>
备注
</summary>
</member>
<member name="T:WY.NewJit.MsgBaseData.BaseConfigDto">
<summary>
基础参数配置表
</summary>
</member>
<member name="P:WY.NewJit.MsgBaseData.BaseConfigDto.ParamName">
<summary>
参数名称
</summary>
</member>
<member name="P:WY.NewJit.MsgBaseData.BaseConfigDto.ParamValue">
<summary>
参数值
</summary>
</member>
<member name="P:WY.NewJit.MsgBaseData.BaseConfigDto.State">
<summary>
状态
</summary>
</member>
<member name="P:WY.NewJit.MsgBaseData.BaseConfigDto.Remark">
<summary>
备注
</summary>
</member>
<member name="P:WY.NewJit.MsgBaseData.QueryBaseConfigDto.ParamName">
<summary>
参数名称
</summary>
</member>
<member name="P:WY.NewJit.MsgBaseData.QueryBaseConfigDto.ParamValue">
<summary>
参数值
</summary>
</member>
<member name="P:WY.NewJit.MsgBaseData.QueryBaseConfigDto.State">
<summary>
状态
</summary>
</member>
<member name="P:WY.NewJit.MsgBaseData.QueryBaseConfigDto.Remark">
<summary>
备注
</summary>
</member>
<member name="T:WY.NewJit.MsgBaseData.DicItemDto">
<summary>
通用字典信息DTO
@ -1193,6 +1873,51 @@
<param name="id">主键</param>
<returns>执行成功返回真</returns>
</member>
<member name="P:WY.NewJit.MsgBaseData.MaterialExtDto.MaterialNum">
<summary>
SAP物料号
</summary>
</member>
<member name="P:WY.NewJit.MsgBaseData.MaterialExtDto.MaterialDescription">
<summary>
物料描述(大小量纲、物料描述字段值同时存在时,优先显示大小量纲)
</summary>
</member>
<member name="P:WY.NewJit.MsgBaseData.MaterialExtDto.MaterialDescription2">
<summary>
大小量纲(大小量纲、物料描述字段值同时存在时,优先显示大小量纲)
</summary>
</member>
<member name="P:WY.NewJit.MsgBaseData.MaterialExtDto.MaterialMemo">
<summary>
补充备注(车型、门板代码)
</summary>
</member>
<member name="P:WY.NewJit.MsgBaseData.MaterialExtDto.MaterialGroup">
<summary>
物料组:例如 门板成品-C8
</summary>
</member>
<member name="P:WY.NewJit.MsgBaseData.QueryMaterialExtDto.MaterialNum">
<summary>
SAP物料号
</summary>
</member>
<member name="P:WY.NewJit.MsgBaseData.QueryMaterialExtDto.MaterialDescription">
<summary>
物料描述(大小量纲、物料描述字段值同时存在时,优先显示大小量纲)
</summary>
</member>
<member name="P:WY.NewJit.MsgBaseData.QueryMaterialExtDto.MaterialGroup">
<summary>
物料组:例如 门板成品-C8
</summary>
</member>
<member name="P:WY.NewJit.MsgBaseData.QueryMaterialExtDto.MaterialType">
<summary>
物料类型 0 空 1 控制件 2 柱护板 3 门板
</summary>
</member>
<member name="P:WY.NewJit.MsgBaseData.CreateUpdatePartCfgDto.PartCode">
<summary>
零件编码
@ -1556,6 +2281,16 @@
手工操作日期
</summary>
</member>
<member name="P:WY.NewJit.MsgCheck.BillM100Dto.SpecExplain">
<summary>
规格说明:HSC0DRCC0001
</summary>
</member>
<member name="P:WY.NewJit.MsgCheck.BillM100Dto.ColorExplain">
<summary>
颜色说明:车型描述后7位,石墨黑/云杉灰
</summary>
</member>
<member name="T:WY.NewJit.MsgCheck.BillM100PartDto">
<summary>
零件查询结果DTO
@ -1876,6 +2611,16 @@
柱护板打印状态(不为空时表示已打印)
</summary>
</member>
<member name="P:WY.NewJit.MsgCheck.ResultBillM100Dto.SpecExplain">
<summary>
规格说明:HSC0DRCC0001
</summary>
</member>
<member name="P:WY.NewJit.MsgCheck.ResultBillM100Dto.ColorExplain">
<summary>
颜色说明:车型描述后7位,石墨黑/云杉灰
</summary>
</member>
<member name="P:WY.NewJit.MsgCheck.TimeOutRemindResultDto.ProductLine">
<summary>
生产线
@ -3282,6 +4027,16 @@
单据表描述
</summary>
</member>
<member name="P:WY.NewJit.MsgCheck.UnknownAssemblys.ResultUnknownAssemblyDto.SpecExplain">
<summary>
规格说明:HSC0DRCC0001
</summary>
</member>
<member name="P:WY.NewJit.MsgCheck.UnknownAssemblys.ResultUnknownAssemblyDto.ColorExplain">
<summary>
颜色说明:车型描述后7位,石墨黑/云杉灰
</summary>
</member>
<member name="P:WY.NewJit.MsgCheck.UnknownAssemblys.ToParseInParam.IsSelectAll">
<summary>
是否选中全部
@ -3390,13 +4145,6 @@
<param name="input">总成、分总成、零件三级关系实体</param>
<returns>执行成功返回真</returns>
</member>
<member name="M:WY.NewJit.MsgCheck.UnknownAssemblys.IUnknownAssemblyAppService.BatchParseAsync(WY.NewJit.MsgCheck.UnknownAssemblys.BatchParseParam)">
<summary>
系统初始化时使用,批量解析
</summary>
<param name="takeCount"></param>
<returns></returns>
</member>
<member name="M:WY.NewJit.MsgCheck.UnknownAssemblys.IUnknownAssemblyAppService.GetErpAssemblyCodeByMesAsync(System.String)">
<summary>
根据vin从天合mes系统中取erp总成编码列表
@ -3517,6 +4265,16 @@
最后修改人
</summary>
</member>
<member name="P:WY.NewJit.PrintTable.AlreadyPrintDto.SpecExplain">
<summary>
规格说明:HSC0DRCC0001
</summary>
</member>
<member name="P:WY.NewJit.PrintTable.AlreadyPrintDto.ColorExplain">
<summary>
颜色说明:车型描述后7位,石墨黑/云杉灰
</summary>
</member>
<member name="P:WY.NewJit.PrintTable.Dtos.QueryWaitPrintDto.BusinessType">
<summary>
业务类型:1 门板 2 其它柱护板 3 柱护板
@ -3722,5 +4480,15 @@
R100接收时间
</summary>
</member>
<member name="P:WY.NewJit.PrintTable.WaitPrintDto.SpecExplain">
<summary>
规格说明:HSC0DRCC0001
</summary>
</member>
<member name="P:WY.NewJit.PrintTable.WaitPrintDto.ColorExplain">
<summary>
颜色说明:车型描述后7位,石墨黑/云杉灰
</summary>
</member>
</members>
</doc>

562
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application/EdiReceive/ImportRecordAppService.cs

@ -0,0 +1,562 @@
using Magicodes.ExporterAndImporter.Core;
using Magicodes.ExporterAndImporter.Core.Models;
using Magicodes.ExporterAndImporter.Excel;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using Shouldly;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Application.Services;
using Volo.Abp.BlobStoring;
using Volo.Abp.Domain.Repositories;
using Volo.Abp.Uow;
using WY.NewJit.Common;
using WY.NewJit.EdiReceive.Dtos;
using WY.NewJit.EdiReceive.Entitys;
using WY.NewJit.EdiReceive.Interfaces;
using WY.NewJit.EdiReceive.Services;
using WY.NewJit.EntityFrameworkCore;
using WY.NewJit.MsgBaseData;
using WY.NewJit.MsgCheck;
namespace WY.NewJit.EdiReceive
{
/// <summary>
/// 零件管理应用服务实现
/// </summary>
[Microsoft.AspNetCore.Mvc.Route("api/newjit/import-record")]
[ApiExplorerSettings(GroupName = SwaggerGroupConsts.报文接收)]
public class ImportRecordAppService : ApplicationService, IImportRecordAppService
{
#region 成员
/// <summary>
/// 零件仓储
/// </summary>
private readonly IRepository<ImportRecord, Guid> _importRecordRepository;
/// <summary>
/// 日志
/// </summary>
private ILogger<ImportRecordAppService> _logger;
/// <summary>
/// Dapper仓储
/// </summary>
private readonly NewJitDapperRepository _newJitDapperRepository;
/// <summary>
/// BLOB存储
/// </summary>
private readonly IBlobContainer<OurFileContainer> _blobContainer;
/// <summary>
/// 字典领域服务
/// </summary>
private readonly DicDomainService _dicDomainService;
private readonly EdiParseDomainService _ediParseDomainService;
/// <summary>
/// 配置
/// </summary>
private readonly Microsoft.Extensions.Configuration.IConfiguration _configuration;
/// <summary>
/// 错误信息前缀
/// </summary>
private string _errorMessagePrefix
{
get
{
return System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + ".";
}
}
private readonly IUnitOfWorkManager _unitOfWorkManager;
#endregion
/// <summary>
/// 构造函数
/// </summary>
public ImportRecordAppService(
IRepository<ImportRecord, Guid> importRecordRepository,
ILogger<ImportRecordAppService> logger,
NewJitDapperRepository newJitDapperRepository,
IBlobContainer<OurFileContainer> blobContainer,
DicDomainService dicDomainService,
EdiParseDomainService ediParseDomainService,
Microsoft.Extensions.Configuration.IConfiguration configuration,
IUnitOfWorkManager unitOfWorkManager)
{
_importRecordRepository = importRecordRepository;
_logger = logger;
_newJitDapperRepository = newJitDapperRepository;
_blobContainer = blobContainer;
_dicDomainService = dicDomainService;
_ediParseDomainService = ediParseDomainService;
_configuration = configuration;
_unitOfWorkManager = unitOfWorkManager;
}
#region 私有方法
private static string GetWhere(ImportRecordInputDto input)
{
string where = "";
if (input.Factory.HasValue())
{
where += string.Format(" and Factory = '{0}'", input.Factory);
}
if (input.Vin.HasValue())
{
where += string.Format(" and Vin = '{0}'", input.Vin);
}
if (input.VehicleModelCode.HasValue())
{
where += string.Format(" and VehicleModelCode = '{0}'", input.VehicleModelCode);
}
if (input.PaintOfflineTimeBegin.HasValue())
{
where += string.Format(" and PaintOfflineTime >= '{0}'", input.PaintOfflineTimeBegin);
}
if (input.PaintOfflineTimeEnd.HasValue())
{
where += string.Format(" and PaintOfflineTime <= '{0}'", input.PaintOfflineTimeEnd);
}
if (input.OnlineTimeBegin.HasValue())
{
where += string.Format(" and OnlineTime >= '{0}'", input.OnlineTimeBegin);
}
if (input.OnlineTimeEnd.HasValue())
{
where += string.Format(" and OnlineTime <= '{0}'", input.OnlineTimeEnd);
}
if (input.OnlineTimeBegin.HasValue())
{
where += string.Format(" and OnlineTime >= '{0}'", input.OnlineTimeBegin);
}
if (input.OnlineTimeEnd.HasValue())
{
where += string.Format(" and OnlineTime <= '{0}'", input.OnlineTimeEnd);
}
if (input.SerialNumBegin.HasValue())
{
where += string.Format(" and SerialNum >= '{0}'", input.SerialNumBegin);
}
if (input.SerialNumEnd.HasValue())
{
where += string.Format(" and SerialNum <= '{0}'", input.SerialNumEnd);
}
if (input.HostSNBegin.HasValue())
{
where += string.Format(" and HostSN >= '{0}'", input.HostSNBegin);
}
if (input.HostSNEnd.HasValue())
{
where += string.Format(" and HostSN <= '{0}'", input.HostSNEnd);
}
if (input.ProductLine.HasValue())
{
where += string.Format(" and ProductLine = '{0}'", input.ProductLine);
}
if (input.CreateTimeBegin.HasValue())
{
where += string.Format(" and CreateTime >= '{0}'", input.CreateTimeBegin);
}
if (input.CreateTimeEnd.HasValue())
{
where += string.Format(" and CreateTime <= '{0}'", input.CreateTimeEnd);
}
if (input.ImportTimeBegin.HasValue())
{
where += string.Format(" and ImportTime >= '{0}'", input.ImportTimeBegin);
}
if (input.ImportTimeEnd.HasValue())
{
where += string.Format(" and ImportTime <= '{0}'", input.ImportTimeEnd);
}
return where;
}
/// <summary>
/// 取单表记录总数
/// </summary>
/// <param name="tableName"></param>
/// <param name="where"></param>
/// <returns></returns>
private async Task<int> GetEntityCountAsync(string tableName, string where)
{
string sql = $"select count(*) from {tableName} where 1=1 {where}";
var ret = await _newJitDapperRepository.GetSingleBySqlAsync<int>(sql);
return ret;
}
/// <summary>
/// 取单表当前页数据
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="tableName"></param>
/// <param name="where"></param>
/// <param name="orderFieldName"></param>
/// <param name="pageSize"></param>
/// <param name="pageIndex"></param>
/// <returns></returns>
private async Task<List<T>> GetEntityListAsync<T>(string tableName, string where, string orderFieldName, int pageSize, int pageIndex)
{
int takeNum = pageSize;
int skipNum = (pageIndex - 1) * pageSize;
string sql = $"select * from {tableName} where 1=1 {where} order by {orderFieldName} offset {skipNum} rows fetch next {takeNum} rows only";
var ret = await _newJitDapperRepository.GetListBySqlAsync<T>(sql);
return ret;
}
private async Task<List<T>> GetEntityListFromToAsync<T>(string tableName, string where, string orderFieldName, int skipNum, int takeNum)
{
string sql = $"select * from {tableName} where 1=1 {where} order by {orderFieldName} offset {skipNum} rows fetch next {takeNum} rows only";
var ret = await _newJitDapperRepository.GetListBySqlAsync<T>(sql);
return ret;
}
/// <summary>
/// 根据筛选条件获取实体列表
/// </summary>
private async Task<PagedResultDto<ImportRecordDto>> QueryByConditionAsync(ImportRecordInputDto input, PagedAndSortedBase page)
{
PagedResultDto<ImportRecordDto> ret = new PagedResultDto<ImportRecordDto>();
string where = GetWhere(input);
ret.TotalCount = await GetEntityCountAsync("FisImportRecord", where);
//计算分页
int skipNum = page.SkipCount;
int takeNum = page.MaxResultCount;
var lst = await GetEntityListFromToAsync<ImportRecordDto>("FisImportRecord", where, "HostSN", skipNum, takeNum);
ret.Items = lst;
return ret;
}
#endregion
#region 公有方法
/// <summary>
/// 根据筛选条件获取分页实体列表
/// </summary>
/// <param name="input">输入查询条件</param>
/// <returns>返回符合条件的排序分页列表</returns>
[HttpGet]
[UnitOfWork(false)]
[Route("list")]
public async Task<PagedResultDto<ImportRecordDto>> GetListAsync(ImportRecordInputDto input)
{
_logger.LogDebug(_errorMessagePrefix + "GetListAsync 进入");
PagedResultDto<ImportRecordDto> ret = new PagedResultDto<ImportRecordDto>();
try
{
ret = await QueryByConditionAsync(input, (PagedAndSortedBase)input);
return ret;
}
catch (Exception ex)
{
var msg = _errorMessagePrefix + "GetListAsync 执行出错:" + ex.Message;
_logger.LogError(msg);
return ret;
}
}
/// <summary>
/// 按主键获取唯一实体
/// </summary>
/// <param name="id">主键</param>
/// <returns>实体信息</returns>
[HttpGet]
[Route("{id}")]
public async Task<ObjectResultDto<ImportRecordDto>> GetAsync(Guid id)
{
_logger.LogDebug(_errorMessagePrefix + "GetAsync 进入");
ObjectResultDto<ImportRecordDto> ret = new ObjectResultDto<ImportRecordDto>();
try
{
ImportRecord sourceObj = await _importRecordRepository.GetAsync(id);
ImportRecordDto targetObj = ObjectMapper.Map<ImportRecord, ImportRecordDto>(sourceObj);
ret.Item = targetObj;
return ret;
}
catch (Exception ex)
{
ret.Status = false;
ret.Message = _errorMessagePrefix + "GetAsync 执行出错:" + ex.Message;
_logger.LogError(ret.Message);
return ret;
}
}
/// <summary>
/// 添加实体
/// </summary>
/// <param name="input">添加内容</param>
/// <returns>执行成功返回真</returns>
[HttpPost]
[UnitOfWork]
[Route("")]//create
public async Task<ObjectResultDto<Guid>> CreateAsync(ImportRecordCreateDto input)
{
_logger.LogDebug(_errorMessagePrefix + "CreateAsync 进入");
ObjectResultDto<Guid> ret = new ObjectResultDto<Guid>();
try
{
ImportRecord obj = ObjectMapper.Map<ImportRecordCreateDto, ImportRecord>(input);
ImportRecord obj2 = await _importRecordRepository.InsertAsync(obj);
ret.Item = obj2.Id; //返回添加对象的主键
return ret;
}
catch (Exception ex)
{
ret.Status = false;
ret.Message = _errorMessagePrefix + "CreateAsync 执行出错:" + ex.Message;
_logger.LogError(ret.Message);
return ret;
}
}
/// <summary>
/// 修改实体
/// </summary>
/// <param name="id">更新主键</param>
/// <param name="input">修改内容</param>
/// <returns>执行成功返回真</returns>
[HttpPut]
[UnitOfWork]
[Route("{id}")]//update/
public async Task<ObjectResultDto> UpdateAsync(Guid id, ImportRecordCreateDto input)
{
_logger.LogDebug(_errorMessagePrefix + "UpdateAsync 进入");
ObjectResultDto ret = new ObjectResultDto();
try
{
ImportRecord targetObj = await _importRecordRepository.GetAsync(id);
ObjectMapper.Map<ImportRecordCreateDto, ImportRecord>(input, targetObj);
await _importRecordRepository.UpdateAsync(targetObj);
return ret;
}
catch (Exception ex)
{
ret.Status = false;
ret.Message = _errorMessagePrefix + "UpdateAsync 执行出错:" + ex.Message;
_logger.LogError(ret.Message);
return ret;
}
}
/// <summary>
/// 删除实体
/// </summary>
/// <param name="id">删除主键</param>
/// <returns>执行成功返回真</returns>
[UnitOfWork]
[HttpDelete]
[Route("{id}")]//delete/
public async Task<ObjectResultDto> DeleteAsync(string id)
{
_logger.LogDebug(_errorMessagePrefix + "DeleteAsync 进入");
ObjectResultDto ret = new ObjectResultDto();
try
{
Guid guid = Guid.Parse(id);
await _importRecordRepository.DeleteAsync(guid);
return ret;
}
catch (Exception ex)
{
ret.Status = false;
ret.Message = _errorMessagePrefix + "DeleteAsync 执行出错:" + ex.Message;
_logger.LogError(ret.Message);
return ret;
}
}
/// <summary>
/// 导出信息
/// </summary>
/// <param name="input">导出查询条件</param>
/// <returns>执行成功返回真</returns>
[UnitOfWork(false)]
[HttpPost]
[Route("export")]
public async Task<ObjectResultDto<string>> ExportAsync(ImportRecordInputDto input)
{
_logger.LogDebug(_errorMessagePrefix + "ExportAsync 进入");
ObjectResultDto<string> ret = new ObjectResultDto<string>();
try
{
PagedResultDto<ImportRecordDto> pageLst = await QueryByConditionAsync(input, (PagedAndSortedBase)input);
var items = pageLst.Items.AsEnumerable().ToList();
//将实体列表转换成excel文件流
IExporter exporter = new ExcelExporter();
byte[] byteArr = await exporter.ExportAsByteArray<ImportRecordDto>(items);
byteArr.ShouldNotBeNull();
//将excel文件流保存到服务器端文件系统
string fileName = string.Format("导入记录_{0}.xlsx", Guid.NewGuid().ToString());
await _blobContainer.SaveAsync(fileName, byteArr);
ret.Item = fileName;
return ret;
}
catch (Exception ex)
{
ret.Status = false;
ret.Message = _errorMessagePrefix + "ExportAsync 执行出错:" + ex.Message;
_logger.LogError(ret.Message);
return ret;
}
}
/// <summary>
/// 导入
/// </summary>
/// <param name="files">导入文件</param>
/// <param name="forceExecute">校验出错时,是否强制执行</param>
/// <returns>执行成功返回真</returns>
//[UnitOfWork(IsDisabled =true)]
//[UnitOfWork(isTransactional: false)] //[UnitOfWork(false)]
[UnitOfWork]
[HttpPost]
[Route("import")]
[DisableRequestSizeLimit]
public virtual async Task<ObjectResultDto> ImportAsync([FromForm] IFormFileCollection files, bool forceExecute = false)
{
_logger.LogDebug(_errorMessagePrefix + "ImportAsync 进入");
ObjectResultDto ret = new ObjectResultDto();
try
{
ImportResult<ImportRecordDto> impResult;
using (var memoryStream = new MemoryStream())
{
//保存到内存流
IFormFile file = files[0];
await file.CopyToAsync(memoryStream);
memoryStream.Seek(0, SeekOrigin.Begin);
//StreamReader sr = new StreamReader(memoryStream, Encoding.Default);
IImporter importer = new ExcelImporter();
impResult = await importer.Import<ImportRecordDto>(memoryStream);
}
if (impResult.HasError)
{
string rowErrStr = "";
foreach (var rowErr in impResult.RowErrors)
{
string fieldErr = string.Concat(rowErr.FieldErrors.Select(itm => $"字段:{itm.Key},错误信息:{itm.Value}"));
rowErrStr += $"行号:{rowErr.RowIndex},{fieldErr}\r\n";
}
string templateErrStr = "";
foreach (var templateErr in impResult.TemplateErrors)
{
string errorLevel = templateErr.ErrorLevel == ErrorLevels.Error ? "错误" : "警告";
templateErrStr += $"错误等级:{errorLevel},列名:{templateErr.ColumnName},需要列:{templateErr.RequireColumnName},错误消息:{templateErr.Message}\r\n";
}
ret.Message = rowErrStr + templateErrStr;
ret.Status = false;
return ret;
}
//using (var uow = _unitOfWorkManager.Begin())
//{
var srcLst = impResult.Data.AsEnumerable().ToList();
#region 校验重复报文
string msg = "";
var groupLst = srcLst.GroupBy(itm => new { itm.Vin, itm.HostSN }).Select(itm => new
{
Vin = itm.Key.Vin,
HostSN = itm.Key.HostSN,
Count = itm.Count()
});
var tempLst = groupLst.Where(itm => itm.Count > 1);
foreach (var temp in tempLst)
{
msg += $"底盘{temp.Vin}、顺序号{temp.HostSN}记录重复\r\n";
}
if (msg.Length > 0)
{
ret.Message = msg;
ret.Status = false;
return ret;
}
#endregion
var tarLst = ObjectMapper.Map<List<ImportRecordDto>, List<ImportRecord>>(srcLst);
foreach (var tar in tarLst)
{
//tar.CreatePerson = "导入";
tar.CreateTime = ServerHelper.CurrentDateTime;
tar.OnlineTime = tar.PaintOfflineTime; //导入文件时 总装上线时间 为空,使用 涂装下线时间 代替 总装上线时间
}
//报文解析
ObjectResultDto ret2 = await _ediParseDomainService.ParseEdi(tarLst, forceExecute);
if (ret2.Status == false)
{
return ret2;
}
if (ret2.Status == true && ret2.Message.HasValue())
{
return ret2;
}
//await uow.CompleteAsync();
ret.Status = true;
return ret;
//}
}
catch (Exception ex)
{
ret.Status = false;
ret.Message = _errorMessagePrefix + "ImportAsync 执行出错:" + ex.Message;
_logger.LogError(ret.Message);
throw new BusinessException("1001", ret.Message);
//return ret;
}
}
/// <summary>
/// 打印时间提醒
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[UnitOfWork]
[HttpPost]
[Route("print-timeout-remind")]
public virtual async Task<TimeOutRemindResultDto> PrintTimeoutRemind()
{
//return new TimeOutRemindResultDto();
TimeOutRemindResultDto retObj = new TimeOutRemindResultDto();
retObj.ConfigMinutes = _configuration[$"ConfigDic:ProductLineTimeoutRemind_New:{"Record"}"].TryToInt() ?? 40;
var qry = await _importRecordRepository.MaxAsync(itm => itm.CreateTime);
retObj.LastReceiveTime = qry != null ? Convert.ToDateTime(qry) : ServerHelper.CurrentDateTime;
retObj.TimeoutMinutes = MinuteDiff(retObj.LastReceiveTime, ServerHelper.CurrentDateTime);
return retObj;
}
private int MinuteDiff(DateTime beginTime, DateTime endTime)
{
TimeSpan beginSpan = new TimeSpan(beginTime.Ticks);
TimeSpan endSpan = new TimeSpan(endTime.Ticks);
TimeSpan diffSpan = endSpan.Subtract(beginSpan).Duration();
return (int)(diffSpan.TotalMinutes);
}
#endregion
}
}

549
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application/MsgBaseData/AssemblyCfgs/AssemblyCfgErpAppService.cs

@ -23,6 +23,7 @@ using System.Data;
using Microsoft.AspNetCore.Authorization;
using WY.NewJit.Extends.PaiGe;
using Volo.Abp;
using Magicodes.ExporterAndImporter.Core.Models;
namespace WY.NewJit.MsgBaseData
{
@ -33,6 +34,10 @@ namespace WY.NewJit.MsgBaseData
[ApiExplorerSettings(GroupName = SwaggerGroupConsts.基础数据)]
public class AssemblyCfgErpAppService : ApplicationService, IAssemblyCfgErpAppService
{
/// <summary>
/// 总成组
/// </summary>
private readonly IRepository<AssemblyCfgGroup, Guid> _assemblyCfgGroupRepository;
/// <summary>
/// ERP总成仓储
/// </summary>
@ -112,7 +117,8 @@ SELECT top 1 v.Id
AssemblyDomainService assemblyDomainService,
IRepository<PartCfg, Guid> partCfgRepository,
IRepository<MaterialExt, Guid> materialExtRepository,
GlobalSettingsDomainService globalSettingsDomainService
GlobalSettingsDomainService globalSettingsDomainService,
IRepository<AssemblyCfgGroup, Guid> assemblyCfgGroupRepository
)
{
_assemblyCfgErpRepository = assemblyCfgErpRepository;
@ -124,6 +130,7 @@ SELECT top 1 v.Id
_partCfgRepository = partCfgRepository;
_materialExtRepository = materialExtRepository;
_globalSettingsDomainService = globalSettingsDomainService;
_assemblyCfgGroupRepository = assemblyCfgGroupRepository;
}
@ -150,7 +157,7 @@ SELECT top 1 v.Id
(
select ROW_NUMBER() OVER(order by a.[CreationTime]) as row_number,
a.Id, a.ErpAssemblyCode, a.ErpAssemblyName, a.ErpAssemblyVersion,
g.GroupCode, g.VehicleModel, g.IsDisable, g.CreationTime
g.GroupCode, g.VehicleModel, g.IsDisable, g.CreationTime ,g.SpecExplain,g.ColorExplain
from FisAssemblyCfgErp a
join FisAssemblyCfgGroup g on g.Id = a.GroupId
where g.IsDeleted = 0 and g.IsDisable <> 1 {0}
@ -183,10 +190,10 @@ SELECT top 1 v.Id
select ROW_NUMBER() OVER(order by a.[CreationTime]) as row_number,
a.Id, g.GroupCode, a.ErpAssemblyCode, a.ErpAssemblyName,
p.PartCode, pc.PartName, p.PartNum,
g.VehicleModel, g.IsDisable, g.CreationTime
g.VehicleModel, g.IsDisable, g.CreationTime,g.SpecExplain,g.ColorExplain
from FisAssemblyCfgErp a
join FisAssemblyCfgGroup g on g.Id = a.GroupId
join FisAssemblyCfgPart p on a.Id = p.AssemblyCfgErpId
left join FisAssemblyCfgPart p on a.Id = p.AssemblyCfgErpId
left join FisPartCfg pc on p.PartCode = pc.PartCode
where g.IsDeleted = 0 and g.IsDisable <> 1 {0}
";
@ -211,6 +218,14 @@ SELECT top 1 v.Id
{
where += string.Format(" and g.VehicleModel = '{0}'", input.VehicleModelCode);
}
if (!string.IsNullOrEmpty(input.SpecExplain))
{
where += string.Format(" and g.SpecExplain = '{0}'", input.SpecExplain);
}
if (!string.IsNullOrEmpty(input.ColorExplain))
{
where += string.Format(" and g.ColorExplain = '{0}'", input.ColorExplain);
}
if (input.BeginCreateTime != null)
{
where += string.Format(" and g.CreationTime >= '{0}'", ((DateTime)input.BeginCreateTime).ToString("yyyy-MM-dd HH:mm:ss"));
@ -477,202 +492,418 @@ SELECT top 1 v.Id
[DisableRequestSizeLimit]
public virtual async Task<ObjectResultDto<string>> ImportErpAssemblyAsync([FromForm] IFormFileCollection files)
{
_logger.LogDebug(_errorMessagePrefix + "ImportErpAssemblyAsync 进入");
ObjectResultDto<string> ret = new ObjectResultDto<string>();
throw new NotImplementedException();
//_logger.LogDebug(_errorMessagePrefix + "ImportErpAssemblyAsync 进入");
//ObjectResultDto<string> ret = new ObjectResultDto<string>();
//try
//{
// List<MaterialExt> material3Lst = await _materialExtRepository.Where(itm => itm.MaterialType == "3").ToListAsync();
// List<PartCfg> partCfgLst = await _partCfgRepository.GetListAsync(); //取结算件信息列表
// List<ErpAssemblyInfo2Part> ass2partLst = new List<ErpAssemblyInfo2Part>();
// using (var memoryStream = new MemoryStream())
// {
// //保存到内存流
// IFormFile file = files[0];
// await file.CopyToAsync(memoryStream);
// memoryStream.Seek(0, SeekOrigin.Begin);
// StreamReader sr = new StreamReader(memoryStream, Encoding.Default);
// string strLine = ""; //记录每次读取的一行记录
// string[] aryLine = null; //记录每行记录中的各字段内容
// int columnCount = 0; //标示列数
// //遍历文件行
// while ((strLine = sr.ReadLine()) != null)
// {
// if (strLine.IsNullOrEmpty())
// {
// continue;
// }
// if (strLine.Contains('�'))
// {
// ret.Message = "导入文件的格式不对,请将其转换成utf-8格式后再导入";
// ret.Status = false;
// return ret;
// }
// aryLine = strLine.Split(" ");
// columnCount = aryLine.Count();
// if (columnCount == 0)
// {
// continue;
// }
// if (columnCount < 14)
// {
// ret.Message = "当前行的列数小于14,行号:" + aryLine[0];
// ret.Status = false;
// return ret;
// }
// ErpAssemblyInfo2Part ass2partObj = new ErpAssemblyInfo2Part();
// ass2partObj.ErpAssemblyCode = aryLine[1].Trim();
// ass2partObj.ErpAssemblyName = aryLine[2].Trim();
// //从物料表取车型,操作员导入BOM时已经在SAP中录入物料了
// MaterialExt materialObj = material3Lst.FirstOrDefault(itm => itm.MaterialNum == ass2partObj.ErpAssemblyCode);
// if (materialObj != null)
// {
// ass2partObj.VehicleModel = materialObj.VehicleModel;
// ass2partObj.MaterialMemo = materialObj.MaterialMemo?.Replace(" ",""); //SAP分组
// }
// //将模板中的SAP物料号转换成客户零件号
// string sapMaterialNum = aryLine[11].Trim().Replace(" "," "); //取派格SAP物料号
// var partCfgObj = partCfgLst.FirstOrDefault(itm => itm.RelationKey == sapMaterialNum);
// if (partCfgObj != null)
// {
// ass2partObj.PartCode = partCfgObj.PartCode;
// ass2partObj.PartCode2 = sapMaterialNum;
// }
// else
// {
// ret.Message = $"当前行的SAP物料号在零件信息表没有匹配的客户零件号,行号:{aryLine[0]},SAP物料号:{sapMaterialNum}";
// ret.Status = false;
// return ret;
// }
// ass2partObj.PartNum = aryLine[13].TryToDouble();
// //数据校验
// if (ass2partObj.ErpAssemblyCode == null || ass2partObj.ErpAssemblyCode.Trim() == "")
// {
// ret.Message = "当前行的ERP总成代码列是空,行号:" + aryLine[0];
// ret.Status = false;
// return ret;
// }
// if (ass2partObj.PartCode == null || ass2partObj.PartCode.Trim() == "")
// {
// if (partCfgObj.IsDisable == true) //不参与解析的也进入BOM, 报文解析时排除
// {
// }
// else
// {
// ret.Message = "当前行的零件代码列是空,行号:" + aryLine[0] + "对应SAP零件号:" + sapMaterialNum;
// ret.Status = false;
// return ret;
// }
// }
// if (ass2partObj.PartNum == null || ass2partObj.PartNum == 0)
// {
// ret.Message = "当前行的零件数量列是空或零,行号:" + aryLine[0];
// ret.Status = false;
// return ret;
// }
// ass2partLst.Add(ass2partObj);
// }
// }
// //取Erp总成
// List<AssemblyCfgErp> erpDataLst = await _assemblyCfgErpRepository.GetListAsync(itm => itm.NewVersionId == null, true);
// //总成编码去重
// List<string> erpAssemblyCodeLst = ass2partLst
// .Where(itm => string.IsNullOrEmpty(itm.ErpAssemblyCode) == false)
// .Select(itm => itm.ErpAssemblyCode)
// .Distinct()
// .ToList();
// //校验导入
// string repeatMsg = "";
// foreach (var erpAssemblyCode in erpAssemblyCodeLst)
// {
// var partLst = ass2partLst.Where(itm => itm.ErpAssemblyCode == erpAssemblyCode).ToList();
// if (partLst.Count() > 0)
// {
// string erpAssCode = partLst[0].ErpAssemblyCode;
// string erpAssName = partLst[0].ErpAssemblyName;
// string vehicleModel = partLst[0].VehicleModel;
// AssemblyCfgErp erpObj = new AssemblyCfgErp(
// GuidGenerator.Create(),
// erpAssCode,
// erpAssName,
// 0,
// vehicleModel
// );
// foreach (var partObj in partLst)
// {
// erpObj.AddChildObject(
// GuidGenerator.Create(),
// partObj.PartCode,
// partObj.PartNum,
// partObj.PartCode2
// );
// }
// List<string> repeatLst = _assemblyDomainService.ReturnRepeatErpAssembly(erpObj, erpDataLst, material3Lst); //返回重复总成
// foreach (var repeatStr in repeatLst)
// {
// repeatMsg += repeatStr;
// }
// }
// }
// if (repeatMsg.Length > 0)
// {
// ret.Status = false;
// ret.Message = repeatMsg;
// return ret;
// }
// //遍历总成,插入数据库
// int maxVer = _assemblyCfgErpRepository.Any() ? _assemblyCfgErpRepository.Max(itm => itm.ErpAssemblyVersion) : 0;
// foreach (var erpAssemblyCode in erpAssemblyCodeLst)
// {
// var partLst = ass2partLst.Where(itm => itm.ErpAssemblyCode == erpAssemblyCode).ToList();
// if (partLst.Count() > 0)
// {
// string erpAssCode = partLst[0].ErpAssemblyCode;
// string erpAssName = partLst[0].ErpAssemblyName;
// string vehicleModel = partLst[0].VehicleModel;
// AssemblyCfgErp erpObj = new AssemblyCfgErp(
// GuidGenerator.Create(),
// erpAssCode,
// erpAssName,
// ++maxVer,
// vehicleModel
// );
// foreach (var partObj in partLst)
// {
// erpObj.AddChildObject(
// GuidGenerator.Create(),
// partObj.PartCode,
// partObj.PartNum,
// partObj.PartCode2
// );
// }
// AssemblyCfgErp obj2 = await _assemblyCfgErpRepository.InsertAsync(erpObj);
// await _assemblyDomainService.RemoveRepeatErpAssembly(obj2, erpDataLst); //删除重复总成
// }
// }
// _globalSettingsDomainService.SetSetting(GlobalSettingsNameEnum.刷新报文解析缓存, true);
// ret.Status = true;
// return ret;
//}
//catch (Exception ex)
//{
// ret.Status = false;
// ret.Message = _errorMessagePrefix + "ImportErpAssemblyAsync 执行出错:" + ex.Message;
// _logger.LogError(ret.Message);
// return ret;
//}
}
/// <summary>
/// 总成组导入【红旗版本】
/// </summary>
/// <param name="files"></param>
/// <returns></returns>
[HttpPost]
[Route("import-erp-assembly-group")]
[DisableRequestSizeLimit]
public virtual async Task<ObjectResultDto> ImportErpAssemblyGroupAsync([FromForm] IFormFileCollection files)
{
_logger.LogDebug(_errorMessagePrefix + "ImportErpAssemblyGroupAsync 进入");
ObjectResultDto ret = new ObjectResultDto();
try
{
List<MaterialExt> material3Lst = await _materialExtRepository.Where(itm => itm.MaterialType == "3").ToListAsync();
List<PartCfg> partCfgLst = await _partCfgRepository.GetListAsync(); //取结算件信息列表
List<ErpAssemblyInfo2Part> ass2partLst = new List<ErpAssemblyInfo2Part>();
#region 导入文件处理
ImportResult<ImportErpAssemblyGroupDto> impResult;
using (var memoryStream = new MemoryStream())
{
//保存到内存流
IFormFile file = files[0];
await file.CopyToAsync(memoryStream);
memoryStream.Seek(0, SeekOrigin.Begin);
StreamReader sr = new StreamReader(memoryStream, Encoding.Default);
string strLine = ""; //记录每次读取的一行记录
string[] aryLine = null; //记录每行记录中的各字段内容
int columnCount = 0; //标示列数
//遍历文件行
while ((strLine = sr.ReadLine()) != null)
//StreamReader sr = new StreamReader(memoryStream, Encoding.Default);
IImporter importer = new ExcelImporter();
impResult = await importer.Import<ImportErpAssemblyGroupDto>(memoryStream);
if (impResult.HasError)
{
if (strLine.IsNullOrEmpty())
{
continue;
}
if (strLine.Contains('�'))
{
ret.Message = "导入文件的格式不对,请将其转换成utf-8格式后再导入";
ret.Status = false;
return ret;
}
aryLine = strLine.Split(" ");
columnCount = aryLine.Count();
if (columnCount == 0)
{
continue;
}
if (columnCount < 14)
string rowErrStr = "";
foreach (var rowErr in impResult.RowErrors)
{
ret.Message = "当前行的列数小于14,行号:" + aryLine[0];
ret.Status = false;
return ret;
string fieldErr = string.Concat(rowErr.FieldErrors.Select(itm => $"字段:{itm.Key},错误信息:{itm.Value}"));
rowErrStr += $"行号:{rowErr.RowIndex},{fieldErr}\r\n";
}
ErpAssemblyInfo2Part ass2partObj = new ErpAssemblyInfo2Part();
ass2partObj.ErpAssemblyCode = aryLine[1].Trim();
ass2partObj.ErpAssemblyName = aryLine[2].Trim();
//从物料表取车型,操作员导入BOM时已经在SAP中录入物料了
MaterialExt materialObj = material3Lst.FirstOrDefault(itm => itm.MaterialNum == ass2partObj.ErpAssemblyCode);
if (materialObj != null)
string templateErrStr = "";
foreach (var templateErr in impResult.TemplateErrors)
{
ass2partObj.VehicleModel = materialObj.VehicleModel;
ass2partObj.MaterialMemo = materialObj.MaterialMemo?.Replace(" ",""); //SAP分组
string errorLevel = templateErr.ErrorLevel == ErrorLevels.Error ? "错误" : "警告";
templateErrStr += $"错误等级:{errorLevel},列名:{templateErr.ColumnName},需要列:{templateErr.RequireColumnName},错误消息:{templateErr.Message}\r\n";
}
//将模板中的SAP物料号转换成客户零件号
string sapMaterialNum = aryLine[11].Trim().Replace(" "," "); //取派格SAP物料号
var partCfgObj = partCfgLst.FirstOrDefault(itm => itm.RelationKey == sapMaterialNum);
if (partCfgObj != null)
{
ass2partObj.PartCode = partCfgObj.PartCode;
ass2partObj.PartCode2 = sapMaterialNum;
}
else
{
ret.Message = $"当前行的SAP物料号在零件信息表没有匹配的客户零件号,行号:{aryLine[0]},SAP物料号:{sapMaterialNum}";
ret.Status = false;
return ret;
}
ass2partObj.PartNum = aryLine[13].TryToDouble();
//数据校验
if (ass2partObj.ErpAssemblyCode == null || ass2partObj.ErpAssemblyCode.Trim() == "")
{
ret.Message = "当前行的ERP总成代码列是空,行号:" + aryLine[0];
ret.Status = false;
return ret;
}
if (ass2partObj.PartCode == null || ass2partObj.PartCode.Trim() == "")
{
if (partCfgObj.IsDisable == true) //不参与解析的也进入BOM, 报文解析时排除
{
}
else
{
ret.Message = "当前行的零件代码列是空,行号:" + aryLine[0] + "对应SAP零件号:" + sapMaterialNum;
ret.Status = false;
return ret;
}
}
if (ass2partObj.PartNum == null || ass2partObj.PartNum == 0)
{
ret.Message = "当前行的零件数量列是空或零,行号:" + aryLine[0];
ret.Status = false;
return ret;
}
ass2partLst.Add(ass2partObj);
ret.Message = rowErrStr + templateErrStr;
ret.Status = false;
return ret;
}
}
//取Erp总成
List<AssemblyCfgErp> erpDataLst = await _assemblyCfgErpRepository.GetListAsync(itm => itm.NewVersionId == null, true);
//总成编码去重
List<string> erpAssemblyCodeLst = ass2partLst
.Where(itm => string.IsNullOrEmpty(itm.ErpAssemblyCode) == false)
.Select(itm => itm.ErpAssemblyCode)
.Distinct()
.ToList();
//校验导入
string repeatMsg = "";
foreach (var erpAssemblyCode in erpAssemblyCodeLst)
#endregion
#region 数据验证
var srcLst = impResult.Data.AsEnumerable().ToList();
List<MaterialExt> material3Lst = await _materialExtRepository.Where(itm => itm.MaterialType == "3").ToListAsync();
var error= CheckGroup(srcLst, material3Lst);
if (!string.IsNullOrEmpty(error))
{
var partLst = ass2partLst.Where(itm => itm.ErpAssemblyCode == erpAssemblyCode).ToList();
if (partLst.Count() > 0)
{
string erpAssCode = partLst[0].ErpAssemblyCode;
string erpAssName = partLst[0].ErpAssemblyName;
string vehicleModel = partLst[0].VehicleModel;
AssemblyCfgErp erpObj = new AssemblyCfgErp(
GuidGenerator.Create(),
erpAssCode,
erpAssName,
0,
vehicleModel
);
foreach (var partObj in partLst)
{
erpObj.AddChildObject(
GuidGenerator.Create(),
partObj.PartCode,
partObj.PartNum,
partObj.PartCode2
);
}
List<string> repeatLst = _assemblyDomainService.ReturnRepeatErpAssembly(erpObj, erpDataLst, material3Lst); //返回重复总成
foreach (var repeatStr in repeatLst)
{
repeatMsg += repeatStr;
}
}
ret.Message = error;
ret.Status = false;
return ret;
}
if (repeatMsg.Length > 0)
var err2 = CheckMaterialRepeatByAssembly(srcLst, material3Lst);
if (!string.IsNullOrEmpty(err2))
{
ret.Message = err2;
ret.Status = false;
ret.Message = repeatMsg;
return ret;
}
//遍历总成,插入数据库
int maxVer = _assemblyCfgErpRepository.Any() ? _assemblyCfgErpRepository.Max(itm => itm.ErpAssemblyVersion) : 0;
foreach (var erpAssemblyCode in erpAssemblyCodeLst)
#endregion
#region 插入数据
List<AssemblyCfgGroup> assemblyCfgGroups = new List<AssemblyCfgGroup>();
List<AssemblyCfgGroup> deleteAssemblyCfgGroups = new List<AssemblyCfgGroup>();
List<AssemblyCfgErp> assemblyCfgErps = new List<AssemblyCfgErp>();
var groups = srcLst.GroupBy(r => new { r.SpecExplain, r.ColorExplain }).ToList();
foreach (var group in groups)
{
var partLst = ass2partLst.Where(itm => itm.ErpAssemblyCode == erpAssemblyCode).ToList();
if (partLst.Count() > 0)
var olditem= await _assemblyCfgGroupRepository.FirstOrDefaultAsync(r=>r.IsDisable==false&&r.SpecExplain== group.Key.SpecExplain.Trim()&& r.ColorExplain == group.Key.ColorExplain.Trim());
if (olditem != null)
{
string erpAssCode = partLst[0].ErpAssemblyCode;
string erpAssName = partLst[0].ErpAssemblyName;
string vehicleModel = partLst[0].VehicleModel;
AssemblyCfgErp erpObj = new AssemblyCfgErp(
GuidGenerator.Create(),
erpAssCode,
erpAssName,
++maxVer,
vehicleModel
);
foreach (var partObj in partLst)
{
erpObj.AddChildObject(
GuidGenerator.Create(),
partObj.PartCode,
partObj.PartNum,
partObj.PartCode2
);
}
AssemblyCfgErp obj2 = await _assemblyCfgErpRepository.InsertAsync(erpObj);
await _assemblyDomainService.RemoveRepeatErpAssembly(obj2, erpDataLst); //删除重复总成
olditem.IsDisable = true;
deleteAssemblyCfgGroups.Add(olditem);
}
string groupCode = group.Key.SpecExplain + group.Key.ColorExplain;
AssemblyCfgGroup assemblyCfgGroup = new AssemblyCfgGroup(GuidGenerator.Create() , groupCode,"",true);
assemblyCfgGroup.SpecExplain = group.Key.SpecExplain.Trim();
assemblyCfgGroup.ColorExplain = group.Key.ColorExplain.Trim();
assemblyCfgGroup.IsDisable = false;
foreach (var item in group)
{
var material3 = material3Lst.FirstOrDefault(r => r.MaterialNum == item.MaterialNum.Trim());
AssemblyCfgErp assemblyCfgErp = new AssemblyCfgErp(GuidGenerator.Create());
assemblyCfgErp.ErpAssemblyCode = item.MaterialNum.Trim();
assemblyCfgErp.ErpAssemblyName = material3.MaterialDescription;
assemblyCfgErp.ErpAssemblyVersion = 1;
assemblyCfgErp.GroupCode = groupCode;
assemblyCfgErp.GroupId = assemblyCfgGroup.Id;
assemblyCfgErp.SpecExplain = item.SpecExplain.Trim();
assemblyCfgErp.ColorExplain = item.ColorExplain.Trim();
assemblyCfgErps.Add(assemblyCfgErp);
}
assemblyCfgGroups.Add(assemblyCfgGroup);
}
_globalSettingsDomainService.SetSetting(GlobalSettingsNameEnum., true);
//插入“导入记录表”
await _assemblyCfgGroupRepository.UpdateManyAsync(deleteAssemblyCfgGroups);//更新总成组
await _assemblyCfgGroupRepository.InsertManyAsync(assemblyCfgGroups);
await _assemblyCfgErpRepository.InsertManyAsync(assemblyCfgErps);
#endregion
ret.Status = true;
return ret;
}
catch (Exception ex)
{
ret.Status = false;
ret.Message = _errorMessagePrefix + "ImportErpAssemblyAsync 执行出错:" + ex.Message;
ret.Message = _errorMessagePrefix + "ImportErpAssemblyGroupAsync 执行出错:" + ex.Message;
_logger.LogError(ret.Message);
return ret;
}
}
private string CheckGroup(List<ImportErpAssemblyGroupDto> srcLst, List<MaterialExt> material3Lst)
{
//验证是否有重复项
string error = "";
var disitem = srcLst.Distinct();
if (disitem.Count() != srcLst.Count())
{
error = "导入数据有重复项,检查后在导入!";
}
if (!string.IsNullOrEmpty(error)) return error;
#region 验证分组是否符合分组规
var checkGroups = srcLst.GroupBy(r => new { r.SpecExplain, r.ColorExplain }).Select(r => new { SpecExplain = r.Key.SpecExplain, ColorExplain = r.Key.ColorExplain, Count = r.Count() });
var errorgroups = checkGroups.Where(r => r.Count != 4).ToList();
foreach (var item in errorgroups)
{
error += $"规格说明【{item.SpecExplain}】,颜色说明【{item.ColorExplain}】,零件数【{item.Count}】不符合分组规则\r\n";
}
if (!string.IsNullOrEmpty(error)) return error;
#endregion
#region 验证零件是否存在(门板)
var partdists = srcLst.Select(r => r.MaterialNum).Distinct();
foreach (var sapMaterial in partdists)
{
var material3 = material3Lst.FirstOrDefault(r => r.MaterialNum == sapMaterial);
if (material3 == null)
{
error += $"零件编号【{sapMaterial}】系统中不存在,请检查后再导入\r\n";
}
}
#endregion
return error;
}
/// <summary>
/// 校验ERP总成:是否版本覆盖
/// 导入总成时,校验规格说明包含的4个物料号分别是1001,1002,1003,1004
/// </summary>
/// <param name="input"></param>
/// <param name="srcLst">导入总成list</param>
/// <param name="material3Lst">总成物料list</param>
/// <returns></returns>
private string CheckMaterialRepeatByAssembly(List<ImportErpAssemblyGroupDto> srcLst, List<MaterialExt> material3Lst)
{
StringBuilder strBuild = new StringBuilder();
string[] arr = new string[4] { "1001", "1002", "1003", "1004" };
string arrStr = string.Join(',', arr);
var qry = from item in srcLst
group item by new { item.SpecExplain, item.ColorExplain } into g
select new
{
SpecExplain = g.Key.SpecExplain,
ColorExplain = g.Key.ColorExplain,
Details = g.Select(itm => itm.MaterialNum).ToList()
};
foreach (var item in qry)
{
if (item.Details.Count != 4)
{
strBuild.AppendLine($"规格说明{item.SpecExplain}、颜色说明{item.ColorExplain}包含的物料号不是4个");
}
//遍历物料号
List<string> strLst = new List<string>();
foreach (string sapMaterialNum in item.Details)
{
var materialObj = material3Lst.FirstOrDefault(itm => itm.MaterialNum == sapMaterialNum);
if (materialObj == null)
{
strBuild.AppendLine($"规格说明{item.SpecExplain}:物料号{sapMaterialNum}在物料表不存在!");
}
else
{
if (arr.Contains(materialObj.MaterialType2) == true)
{
strLst.Add(materialObj.MaterialType2);
}
else
{
strBuild.AppendLine($"规格说明{item.SpecExplain}:物料号{sapMaterialNum}的MaterialType2不是【{arrStr}】其中之一!");
}
}
}
if (string.IsNullOrEmpty(strBuild.ToString()))
{
if (strLst.Count != strLst.Distinct().Count())
{
string repeatLst = string.Join(',', strLst);
strBuild.AppendLine($"规格说明{item.SpecExplain}包含的配置号重复{repeatLst}");
}
}
}
return strBuild.ToString();
}
//[UnitOfWork]
//[HttpPost]
//[Route("check")]

1
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application/MsgBaseData/AssemblyCfgs/AssemblyCfgVehicleAppService.cs

@ -123,6 +123,7 @@ namespace WY.NewJit.MsgBaseData.AssemblyCfgs
ObjectResultDto<AssemblyCfgErpDto> erpAssemblyObj = await _assemblyCfgErpAppService.GetErpAssemblyAsync(vehicleChildItem.ErpAssemblyId);
ret.Add(erpAssemblyObj.Item);
}
ret = ret.OrderBy(itm => itm.ErpAssemblyCode).ToList();
return ret;
}
else

234
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application/MsgBaseData/BaseConfig/BaseGonfigService.cs

@ -0,0 +1,234 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Dynamic.Core;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Application.Services;
using Volo.Abp.Domain.Repositories;
using Volo.Abp.Uow;
using WY.NewJit.Common;
namespace WY.NewJit.MsgBaseData
{
/// <summary>
/// 通用字典应用服务实现
/// </summary>
[Route("api/newjit/baseconfig")]
[ApiExplorerSettings(GroupName = SwaggerGroupConsts.基础数据)]
public class BaseGonfigService : ApplicationService, IBaseGonfigService
{
public readonly IRepository<BaseConfig, Guid> _repository;
private readonly BaseGonfigDomainService _baseConfigDomainService;
/// <summary>
/// 日志
/// </summary>
private ILogger<BaseGonfigService> _logger;
/// <summary>
/// 错误信息前缀
/// </summary>
private string _errorMessagePrefix
{
get
{
return System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + ".";
}
}
/// <summary>
/// 构造函数
/// </summary>
public BaseGonfigService(
IRepository<BaseConfig, Guid> repository,
ILogger<BaseGonfigService> logger,
BaseGonfigDomainService baseConfigDomainService
)
{
_repository = repository;
_logger = logger;
_baseConfigDomainService = baseConfigDomainService;
}
#region 公共方法
/// <summary>
/// 获取所有基本参数数据
/// </summary>
/// <returns></returns>
[HttpGet]
[UnitOfWork(false)]
[Route("list")]
public virtual async Task<PagedResultDto<BaseConfigDto>> GetListAsync(QueryBaseConfigDto input)
{
_logger.LogDebug(_errorMessagePrefix + "GetListAsync 进入");
try
{
var page = (PagedAndSortedBase)input;
IQueryable<BaseConfig> qry1 = QueryByCondition(input);
if (string.IsNullOrEmpty(page.Sorting))
{
page.Sorting = "ParamName";
}
int totalCount = await qry1.CountAsync(); //返回总记录数而不是当前页记录数
if (totalCount == 0)
{
return new PagedResultDto<BaseConfigDto>(0, new List<BaseConfigDto>());
}
var query = qry1.OrderBy(page.Sorting).Skip(page.SkipCount).Take(page.MaxResultCount);
List<BaseConfig> lst = await query.ToListAsync();
var items = ObjectMapper.Map<List<BaseConfig>, List<BaseConfigDto>>(lst);
return new PagedResultDto<BaseConfigDto>(totalCount, items);
}
catch (Exception ex)
{
string errMsg = _errorMessagePrefix + "GetListAsync 执行出错:" + ex.Message;
_logger.LogError(errMsg);
return new PagedResultDto<BaseConfigDto>(0, new List<BaseConfigDto>());
}
}
/// <summary>
/// 添加实体
/// </summary>
/// <param name="input">添加内容</param>
/// <returns>执行成功返回真</returns>
[HttpPost]
[UnitOfWork]
[Route("create")]
public async Task<ObjectResultDto<Guid>> CreateAsync(BaseConfigCreateDto input)
{
_logger.LogDebug(_errorMessagePrefix + "CreateAsync 进入");
ObjectResultDto<Guid> ret = new ObjectResultDto<Guid>();
try
{
var checkitem = await _repository.FirstOrDefaultAsync(r => r.ParamName == input.ParamName);
if (checkitem != null)
{
ret.Status = false;
ret.Message = $"参数名称【{input.ParamName}】已存,在无法添加!";
return ret;
}
BaseConfig obj = ObjectMapper.Map<BaseConfigCreateDto, BaseConfig>(input);
var obj2 = await _repository.InsertAsync(obj);
ret.Item = obj2.Id; //返回添加对象的主键
await _baseConfigDomainService.UpdateBaseConfigCache();
return ret;
}
catch (Exception ex)
{
ret.Status = false;
ret.Message = _errorMessagePrefix + "CreateAsync 执行出错:" + ex.Message;
_logger.LogError(ret.Message);
return ret;
}
}
/// <summary>
/// 修改实体
/// </summary>
/// <param name="id">更新主键</param>
/// <param name="input">修改内容</param>
/// <returns>执行成功返回真</returns>
[HttpPut]
[UnitOfWork]
[Route("update/{id}")]
public async Task<ObjectResultDto> UpdateAsync(Guid id, BaseConfigCreateDto input)
{
_logger.LogDebug(_errorMessagePrefix + "UpdateAsync 进入");
ObjectResultDto ret = new ObjectResultDto();
try
{
var checkitem = await _repository.FirstOrDefaultAsync(r => r.ParamName == input.ParamName && r.Id != id);
if (checkitem != null)
{
ret.Status = false;
ret.Message = $"参数名称【{input.ParamName}】已存,在无法添加!";
return ret;
}
var item = await _repository.GetAsync(id);
ObjectMapper.Map<BaseConfigCreateDto, BaseConfig>(input, item);
await _repository.UpdateAsync(item);
await _baseConfigDomainService.UpdateBaseConfigCache();
return ret;
}
catch (Exception ex)
{
ret.Status = false;
ret.Message = _errorMessagePrefix + "UpdateAsync 执行出错:" + ex.Message;
_logger.LogError(ret.Message);
return ret;
}
}
/// <summary>
/// 删除实体
/// </summary>
/// <param name="id">删除主键</param>
/// <returns>执行成功返回真</returns>
[UnitOfWork]
[HttpDelete]
[Route("delete/{id}")]//delete/
public async Task<ObjectResultDto> DeleteAsync(string id)
{
_logger.LogDebug(_errorMessagePrefix + "DeleteAsync 进入");
ObjectResultDto ret = new ObjectResultDto();
try
{
Guid guid = Guid.Parse(id);
await _repository.DeleteAsync(guid);
await _baseConfigDomainService.UpdateBaseConfigCache();
return ret;
}
catch (Exception ex)
{
ret.Status = false;
ret.Message = _errorMessagePrefix + "DeleteAsync 执行出错:" + ex.Message;
_logger.LogError(ret.Message);
return ret;
}
}
#endregion
#region 私有方法
/// <summary>
/// 根据筛选条件获取实体列表
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
private IQueryable<BaseConfig> QueryByCondition(QueryBaseConfigDto input)
{
IQueryable<BaseConfig> ret = _repository.Where(itm => 1 == 1);
if (!string.IsNullOrEmpty(input.ParamName))
{
ret = ret.Where(itm => itm.ParamName.Contains(input.ParamName));
}
if (!string.IsNullOrEmpty(input.ParamValue))
{
ret = ret.Where(itm => itm.ParamValue.Contains(input.ParamValue));
}
if (input.State.Count > 0)
{
ret = ret.Where(itm => input.State.Contains(itm.State));
}
if (!string.IsNullOrEmpty(input.Remark))
{
ret = ret.Where(itm => itm.Remark.Contains(input.Remark));
}
return ret;
}
#endregion
}
}

4
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application/MsgBaseData/Dics/DicAppService.cs

@ -34,7 +34,7 @@ namespace WY.NewJit.MsgBaseData
/// <summary>
/// 日志
/// </summary>
private ILogger<PartCfgAppService> _logger;
private ILogger<DicAppService> _logger;
/// <summary>
/// 错误信息前缀
@ -52,7 +52,7 @@ namespace WY.NewJit.MsgBaseData
/// </summary>
public DicAppService(
DicDomainService dicDomainService,
ILogger<PartCfgAppService> logger
ILogger<DicAppService> logger
)
{
_dicDomainService = dicDomainService;

11
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application/MsgBaseData/MaterialExt/IMaterialExtAppService.cs

@ -0,0 +1,11 @@
using System.Threading.Tasks;
using Volo.Abp.Application.Dtos;
namespace WY.NewJit.MsgBaseData
{
public interface IMaterialExtAppService
{
Task<ObjectResultDto<string>> ExportAsync(QueryMaterialExtDto input);
Task<PagedResultDto<MaterialExtDto>> GetListAsync(QueryMaterialExtDto input);
}
}

161
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application/MsgBaseData/MaterialExt/MaterialExtAppService.cs

@ -0,0 +1,161 @@
using Magicodes.ExporterAndImporter.Core;
using Magicodes.ExporterAndImporter.Excel;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Logging;
using Shouldly;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Dynamic.Core;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Application.Services;
using Volo.Abp.BlobStoring;
using Volo.Abp.Domain.Repositories;
using Volo.Abp.Uow;
using WY.NewJit.Common;
using WY.NewJit.Extends.PaiGe;
namespace WY.NewJit.MsgBaseData
{
[Route("api/newjit/material")]
[ApiExplorerSettings(GroupName = SwaggerGroupConsts.基础数据)]
public class MaterialExtAppService : ApplicationService, IMaterialExtAppService
{
private readonly IRepository<MaterialExt, Guid> _materialExtRepository;
private ILogger<MaterialExtAppService> _logger;
/// <summary>
/// BLOB存储
/// </summary>
private readonly IBlobContainer<OurFileContainer> _blobContainer;
/// <summary>
/// 错误信息前缀
/// </summary>
private string _errorMessagePrefix
{
get
{
return System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + ".";
}
}
public MaterialExtAppService(IRepository<MaterialExt, Guid> materialExtRepository, ILogger<MaterialExtAppService> logger, IBlobContainer<OurFileContainer> blobContainer)
{
_materialExtRepository = materialExtRepository;
_logger = logger;
_blobContainer = blobContainer;
}
/// <summary>
/// 获取数据
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpGet]
[UnitOfWork(false)]
[Route("list")]
public virtual async Task<PagedResultDto<MaterialExtDto>> GetListAsync(QueryMaterialExtDto input)
{
_logger.LogDebug(_errorMessagePrefix + "GetListAsync 进入");
try
{
var page = (PagedAndSortedBase)input;
IQueryable<MaterialExt> qry1 = QueryByCondition(input);
if (string.IsNullOrEmpty(page.Sorting))
{
page.Sorting = "MaterialNum";
}
int totalCount = await qry1.CountAsync(); //返回总记录数而不是当前页记录数
if (totalCount == 0)
{
return new PagedResultDto<MaterialExtDto>(0, new List<MaterialExtDto>());
}
var query = qry1
.OrderBy(page.Sorting)
.Skip(page.SkipCount)
.Take(page.MaxResultCount);
List<MaterialExt> lst = await query.ToListAsync();
List<MaterialExtDto> items =
ObjectMapper.Map<List<MaterialExt>, List<MaterialExtDto>>(lst);
return new PagedResultDto<MaterialExtDto>(totalCount, items);
}
catch (Exception ex)
{
string errMsg = _errorMessagePrefix + "GetListAsync 执行出错:" + ex.Message;
_logger.LogError(errMsg);
return new PagedResultDto<MaterialExtDto>(0, new List<MaterialExtDto>());
}
}
/// <summary>
/// 导出信息
/// </summary>
/// <param name="input">导出查询条件</param>
/// <returns>执行成功返回真</returns>
[UnitOfWork(false)]
[HttpPost]
[Route("export")]
public virtual async Task<ObjectResultDto<string>> ExportAsync(QueryMaterialExtDto input)
{
_logger.LogDebug(_errorMessagePrefix + "ExportAsync 进入");
ObjectResultDto<string> ret = new ObjectResultDto<string>();
try
{
IQueryable<MaterialExt> query = QueryByCondition(input);
List<MaterialExt> lst = await query.ToListAsync();
List<MaterialExtDto> items =
ObjectMapper.Map<List<MaterialExt>, List<MaterialExtDto>>(lst);
//将实体列表转换成excel文件流
IExporter exporter = new ExcelExporter();
byte[] byteArr = await exporter.ExportAsByteArray<MaterialExtDto>(items);
byteArr.ShouldNotBeNull();
//将excel文件流保存到服务器端文件系统
string fileName = string.Format("物料信息_{0}.xlsx", Guid.NewGuid().ToString());
await _blobContainer.SaveAsync(fileName, byteArr);
ret.Item = fileName;
return ret;
}
catch (Exception ex)
{
ret.Status = false;
ret.Message = _errorMessagePrefix + "ExportAsync 执行出错:" + ex.Message;
_logger.LogError(ret.Message);
return ret;
}
}
#region 私有方法
/// <summary>
/// 根据筛选条件获取实体列表
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
private IQueryable<MaterialExt> QueryByCondition(QueryMaterialExtDto input)
{
IQueryable<MaterialExt> ret = _materialExtRepository.Where(itm => 1 == 1);
if (!string.IsNullOrEmpty(input.MaterialNum))
{
ret = ret.Where(itm => itm.MaterialNum.Contains(input.MaterialNum));
}
if (!string.IsNullOrEmpty(input.MaterialDescription))
{
ret = ret.Where(itm => itm.MaterialDescription.Contains(input.MaterialDescription));
}
if (!string.IsNullOrEmpty(input.MaterialGroup))
{
ret = ret.Where(itm => itm.MaterialGroup == input.MaterialGroup);
}
if (!string.IsNullOrEmpty(input.MaterialType))
{
ret = ret.Where(itm => itm.MaterialType == input.MaterialType);
}
return ret;
}
#endregion
}
}

4
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application/MsgBaseData/PrintTemplateConfiguration/PrintTemplateConfigurationService.cs

@ -37,7 +37,7 @@ namespace WY.NewJit.MsgBaseData
/// <summary>
/// 日志
/// </summary>
private ILogger<PartCfgAppService> _logger;
private ILogger<PrintTemplateConfigurationService> _logger;
/// <summary>
/// Dapper仓储
@ -70,7 +70,7 @@ namespace WY.NewJit.MsgBaseData
/// </summary>
public PrintTemplateConfigurationService(
IRepository<PrintTemplateConfiguration, Guid> repository,
ILogger<PartCfgAppService> logger,
ILogger<PrintTemplateConfigurationService> logger,
NewJitDapperRepository newJitDapperRepository,
IBlobContainer<OurFileContainer> blobContainer,
DicDomainService dicDomainService

4
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application/MsgCheck/BillM100s/BillM100AppService.cs

@ -547,12 +547,12 @@ select * from
}
else
{
where += " and b.BillStatus in (2,3)"; //单据状态是已匹配、已打印
//where += " and b.BillStatus in (2,3)"; //单据状态是已匹配、已打印
}
if (input.IsNeedReplenishPrint == true) //只显示需要补打的记录
{
where += " and b.NeedReplenishPrint = 1";
//where += " and b.NeedReplenishPrint = 1";
}
sqlCnt = string.Format(sqlCnt, where);

2
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application/MsgCheck/BillM100s/MenBanPackingRecService.cs

@ -360,7 +360,7 @@ namespace Win.Sfs.SettleAccount.FISes
{
if (alreadyPrintItem.BillStatus == BillStatusEnum.BreakNum && waitPrintLst[0].BillStatus == BillStatusEnum.BreakNum)
{
throw new BusinessException("1001", "未打印列表和已打印列表出现都是断号的情况号码未【" + alreadyPrintItem.HostSN2 + "】,不能报废!");
throw new BusinessException("1001", "未打印列表和已打印列表出现都是断号状态【" + alreadyPrintItem.HostSN2 + "】,不能报废!");
}
//未打印有一条补打的记录,忽略已打印的对应记录,将未打印记录的补打状态改成顺序打印状态
if (waitPrintLst[0].PrintType == WY.NewJit.PrintTable.PrintTypeEnum.ReplenishPrint)

2
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application/MsgCheck/BillM100s/ZhuHuBanPackingRecService.cs

@ -396,7 +396,7 @@ namespace Win.Sfs.SettleAccount.FISes
{
if (alreadyPrintItem.BillStatus == BillStatusEnum.BreakNum && waitPrintLst[0].BillStatus == BillStatusEnum.BreakNum)
{
throw new BusinessException("1001", "未打印列表和已打印列表出现都是断号的情况号码未【" + alreadyPrintItem.HostSN2 + "】,不能报废!");
throw new BusinessException("1001", "未打印列表和已打印列表出现都是柱护板断号状态【" + alreadyPrintItem.HostSN2 + "】,不能报废!");
}
//未打印有一条补打的记录,忽略已打印的对应记录,将未打印记录的补打状态改成顺序打印状态
if (waitPrintLst[0].PrintType == WY.NewJit.PrintTable.PrintTypeEnum.ReplenishPrint)

658
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application/MsgCheck/UnknownAssemblys/UnknownAssemblyAppService.cs

@ -25,6 +25,8 @@ using Volo.Abp.EventBus.Distributed;
using WY.NewJit.SettleAccountFis;
using WY.NewJit.MsgTransmission.PaiGe;
using WY.NewJit.PrintTable;
using WY.NewJit.EdiReceive.Services;
using WY.NewJit.EdiReceive.Entitys;
namespace WY.NewJit.MsgCheck
{
@ -61,12 +63,12 @@ namespace WY.NewJit.MsgCheck
/// <summary>
/// R100报文解析及校验领域服务
/// </summary>
private readonly R100CheckDomainService _r100CheckDomainSrv;
//private readonly R100CheckDomainService _r100CheckDomainSrv;
/// <summary>
/// M100报文解析及校验领域服务
/// </summary>
private readonly M100CheckDomainService _m100CheckDomainService;
//private readonly M100CheckDomainService _m100CheckDomainService;
/// <summary>
/// 日志
@ -91,12 +93,28 @@ namespace WY.NewJit.MsgCheck
/// <summary>
/// 零件基本信息
/// </summary>
private readonly IRepository<PartCfg, Guid> _partCfgRepository;
//private readonly IRepository<PartCfg, Guid> _partCfgRepository;
/// <summary>
/// 缓存管理 领域服务
/// </summary>
private readonly HQ_CacheManagerDomainService _hqCacheManagerDomainService;
/// <summary>
/// 报文解析 领域服务
/// </summary>
private readonly EdiParseDomainService _ediParseDomainService;
/// <summary>
/// 导入记录仓储
/// </summary>
private readonly IRepository<ImportRecord, Guid> _importRecordRepository;
/// <summary>
/// 结算件切换列表
/// </summary>
private List<PartSwitch> _partSwitchList = new List<PartSwitch>();
//private List<PartSwitch> _partSwitchList = new List<PartSwitch>();
/// <summary>
/// 结算件信息列表
@ -131,13 +149,16 @@ namespace WY.NewJit.MsgCheck
IBlobContainer<OurFileContainer> blobContainer,
IRepository<AssemblyCfgErp, Guid> assemblyCfgErpRepository,
MsgTransmissionAppService msgTransmissionAppService,
R100CheckDomainService r100CheckDomainSrv,
M100CheckDomainService m100CheckDomainService,
//R100CheckDomainService r100CheckDomainSrv,
//M100CheckDomainService m100CheckDomainService,
IDistributedEventBus distributedEventBus,
IRepository<PartCfg, Guid> partCfgRepository,
//IRepository<PartCfg, Guid> partCfgRepository,
IRepository<WaitPrint, Guid> waitPrintRepository,
M100DomainService m100DomainService
)
M100DomainService m100DomainService,
HQ_CacheManagerDomainService hqCacheManagerDomainService
,
EdiParseDomainService ediParseDomainService,
IRepository<ImportRecord, Guid> importRecordRepository)
{
_UnknownAssemblyRepository = UnknownAssemblyRepository;
_UnknownAssemblyPartRepository = UnknownAssemblyPartRepository;
@ -154,12 +175,15 @@ namespace WY.NewJit.MsgCheck
_blobContainer = blobContainer;
_assemblyCfgErpRepository = assemblyCfgErpRepository;
_msgTransmissionAppService = msgTransmissionAppService;
_r100CheckDomainSrv = r100CheckDomainSrv;
_m100CheckDomainService = m100CheckDomainService;
//_r100CheckDomainSrv = r100CheckDomainSrv;
//_m100CheckDomainService = m100CheckDomainService;
_distributedEventBus = distributedEventBus;
_partCfgRepository = partCfgRepository;
//_partCfgRepository = partCfgRepository;
_waitPrintRepository = waitPrintRepository;
_m100DomainService = m100DomainService;
_hqCacheManagerDomainService = hqCacheManagerDomainService;
_ediParseDomainService = ediParseDomainService;
_importRecordRepository = importRecordRepository;
}
#endregion
@ -174,8 +198,8 @@ namespace WY.NewJit.MsgCheck
string sqlCnt = @"
with b as
(
select Id,HostSN,KNR,'' as VIN,AssemblyID,OnlineTime,ReceiveTime,VehicleModelCode,ProductLine,[Version],BillStatus from FisBillR100 where BillStatus =1
union all
-- select Id,HostSN,KNR,'' as VIN,AssemblyID,OnlineTime,ReceiveTime,VehicleModelCode,ProductLine,[Version],BillStatus from FisBillR100 where BillStatus =1
-- union all
select Id,HostSN,KNR,VIN,AssemblyID,OnlineTime,ReceiveTime,VehicleModelCode,ProductLine,[Version],BillStatus from FisBillM100 where BillStatus =1
)
,d as
@ -188,7 +212,7 @@ select * from
from FisUnknownAssembly a
join b on a.BillID = b.Id
left join d on b.VehicleModelCode = d.DicItemCode
where a.IsDeleted <> 1 {0}
where a.IsDeleted = 0 {0}
) t
";
@ -196,9 +220,9 @@ select * from
with b as
(
select Id,HostSN,KNR,'' as VIN,AssemblyID,OnlineTime,ReceiveTime,VehicleModelCode,ProductLine,[Version],BillStatus, Description, SerialNumStr from FisBillR100 where BillStatus =1
union all
select Id,HostSN,KNR,VIN,AssemblyID,OnlineTime,ReceiveTime,VehicleModelCode,ProductLine,[Version],BillStatus, Description, SerialNumStr from FisBillM100 where BillStatus =1
-- select Id,HostSN,KNR,'' as VIN,AssemblyID,OnlineTime,ReceiveTime,VehicleModelCode,ProductLine,[Version],BillStatus, Description, SerialNumStr from FisBillR100 where BillStatus =1
-- union all
select Id,HostSN,KNR,VIN,AssemblyID,OnlineTime,ReceiveTime,VehicleModelCode,ProductLine,[Version],BillStatus, Description, SerialNumStr, SpecExplain, ColorExplain from FisBillM100 where BillStatus =1
)
,d as
(
@ -207,11 +231,11 @@ with b as
select * from
(
select ROW_NUMBER() OVER(order by b.SerialNumStr) as row_number,
a.*, b.HostSN,b.KNR,VIN,b.AssemblyID,b.OnlineTime,b.ReceiveTime,b.VehicleModelCode,b.[Version],b.BillStatus, '' as MessageFileName, b.Description as BillDescription
a.*, b.HostSN,b.KNR,VIN,b.AssemblyID,b.OnlineTime,b.ReceiveTime,b.VehicleModelCode,b.[Version],b.BillStatus, '' as MessageFileName, b.Description as BillDescription, b.SpecExplain, b.ColorExplain
from FisUnknownAssembly a
join b on a.BillID = b.Id
left join d on b.VehicleModelCode = d.DicItemCode
where a.IsDeleted <> 1 {0}
where a.IsDeleted = 0 {0}
) t where row_number between {1} and {2}
";
string where = "";
@ -281,28 +305,28 @@ select * from
return ret;
}
[UnitOfWork]
private bool OneParseAsync(Guid unknownAssemblyId)
{
bool isMatch = false;
//根据未知总成ID取单据Id
UnknownAssembly unknownAssemblyObj = _UnknownAssemblyRepository.GetAsync(unknownAssemblyId, false).GetAwaiter().GetResult();
if (unknownAssemblyObj.ScanPoint == "R100")//!!
{
}
else if (unknownAssemblyObj.ScanPoint == "M100")
{
//天合版本的匹配总成算法:
//匹配上时:插入整车总成配置表、更新单据表的整车总成ID字段、返回true
//匹配不上时返回false
//isMatch = _msgTransmissionAppServiceTianHe.MatchAssembly_Init(unknownAssemblyObj.BillID);
var billObj = _billM100Repository.GetAsync(unknownAssemblyObj.BillID).GetAwaiter().GetResult();
_m100CheckDomainService.DoMatchAssembly(billObj);
}
unknownAssemblyObj.SetExtraProperties("1");
_UnknownAssemblyRepository.UpdateAsync(unknownAssemblyObj).GetAwaiter().GetResult();
return isMatch;
}
//[UnitOfWork]
//private bool OneParseAsync(Guid unknownAssemblyId)
//{
// bool isMatch = false;
// //根据未知总成ID取单据Id
// UnknownAssembly unknownAssemblyObj = _UnknownAssemblyRepository.GetAsync(unknownAssemblyId, false).GetAwaiter().GetResult();
// if (unknownAssemblyObj.ScanPoint == "R100")//!!
// {
// }
// else if (unknownAssemblyObj.ScanPoint == "M100")
// {
// //天合版本的匹配总成算法:
// //匹配上时:插入整车总成配置表、更新单据表的整车总成ID字段、返回true
// //匹配不上时返回false
// //isMatch = _msgTransmissionAppServiceTianHe.MatchAssembly_Init(unknownAssemblyObj.BillID);
// var billObj = _billM100Repository.GetAsync(unknownAssemblyObj.BillID).GetAwaiter().GetResult();
// _m100CheckDomainService.DoMatchAssembly(billObj);
// }
// unknownAssemblyObj.SetExtraProperties("1");
// _UnknownAssemblyRepository.UpdateAsync(unknownAssemblyObj).GetAwaiter().GetResult();
// return isMatch;
//}
private FISVersionEto ConvertToFISVersion(List<BillM100> m100BillList)
{
@ -434,147 +458,147 @@ select * from
return isEqual;
}
private void DoInitLoadCache()
{
//取全部整车总成ID
string vehicleSql = "select Id, VehicleModelCode as VehicleModel from FisAssemblyCfgVehicle v where NewVersionId is null order by CreationTime desc";
List<VehicleAssemblyMainList> vehicleAssemblyIdList = _newJitDapperRepository.GetListBySql<VehicleAssemblyMainList>(vehicleSql, true);
//取全部零件:按整车总成Id、零件编码分组汇总数量
const string vehicle2PartSql = @"
select v.Id as VehicleAssemblyId, ep.PartCode, sum(ep.PartNum) as PartNum
from FisAssemblyCfgVehicle v
join FisAssemblyCfgVehicleChild vc on v.Id = vc.AssemblyCfgVehicleId
join FisAssemblyCfgErp e on vc.ErpAssemblyId = e.Id
join FisAssemblyCfgPart ep on e.Id = ep.AssemblyCfgErpId
where 1=1 and not exists (select PartCode from FisPartCfg pc where IsDisable = 1 and ep.PartCode = pc.PartCode)
and v.NewVersionId is null
and ep.PartCode is not null
group by v.Id, ep.PartCode
order by v.Id, ep.PartCode
";
var vehicle2partList = _newJitDapperRepository.GetListBySql<AssemblyCfgVehicle2Part>(vehicle2PartSql, true);
//取Erp总成
string erpMainSql = "select Id, VehicleModel from FisAssemblyCfgErp where NewVersionId is null order by ErpAssemblyVersion, CreationTime desc";
List<ErpAssemblyMain> erpAssemblyMainList = _newJitDapperRepository.GetListBySql<ErpAssemblyMain>(erpMainSql, true);
List<AssemblyCfgErp2Part> erp2partList = new List<AssemblyCfgErp2Part>();
if (ConfigDic.CurrentVersion == ConfigDicVersionOption.)
{
//取所有零件(IsDisable = 1时表示不需要解析BOM)
string erp2partSql = @"
select e.GroupId, e.Id as ErpAssemblyId, e.ErpAssemblyCode, ep.Id as PartId, ep.PartCode, ep.PartNum, ep.IsKey
from FisAssemblyCfgErp e
join FisAssemblyCfgPart ep on e.Id = ep.AssemblyCfgErpId
where ep.PartCode is not null
and not exists (select PartCode from FisPartCfg pc where IsDisable = 1 and ep.PartCode = pc.PartCode)
";
erp2partList = _newJitDapperRepository.GetListBySql<AssemblyCfgErp2Part>(erp2partSql, true);
//结算件切换列表
string partSwitchSql = "select SourcePartCode,TargetPartCode,ActiveBeginTime,ActiveEndTime from FisPartSwitch";
_partSwitchList = _newJitDapperRepository.GetListBySql<PartSwitch>(partSwitchSql, true);
}
else
{
//取所有零件(IsDisable = 1时表示不需要解析BOM)
string erp2partSql = @"
select e.Id as ErpAssemblyId, e.ErpAssemblyCode, ep.Id as PartId, ep.PartCode, ep.PartNum, ep.IsKey
from FisAssemblyCfgErp e
join FisAssemblyCfgPart ep on e.Id = ep.AssemblyCfgErpId
where e.NewVersionId is null
and ep.PartCode is not null
and not exists (select PartCode from FisPartCfg pc where IsDisable = 1 and ep.PartCode = pc.PartCode)
";
erp2partList = _newJitDapperRepository.GetListBySql<AssemblyCfgErp2Part>(erp2partSql, true);
}
_r100CheckDomainSrv.InitPub(vehicleAssemblyIdList, vehicle2partList, erpAssemblyMainList, erp2partList, _partSwitchList); //整车总成内存及时刷新, ERP总成增删改时触发刷新标志
_m100CheckDomainService.InitPub(vehicleAssemblyIdList, vehicle2partList, erpAssemblyMainList, erp2partList, _partSwitchList);
#region 无法缓存的
//结算件信息列表,库存系统同步过来,无法缓存
string partCfgSql = @"select Id, PartCode, PartName, PartType, Description, PartType2, PartType3, RelationKey from FisPartCfg where 1=1"; //,DaXiaoLiangGang,DoorPlankCode,MaterialDescription,SAPMaterialNum
_partCfgList = _newJitDapperRepository.GetListBySql<PartCfg>(partCfgSql, true);
#endregion
}
private void DifferenceMenBan_ZhuHuBan(BillResult billResObj)
{
//根据物料组区分门板、柱护板, 柱护板不参与匹配,但是参与发货
if (ConfigDic.CurrentVersion == ConfigDicVersionOption.)
{
if (billResObj.R100Bill != null)
{
if (billResObj.R100Bill.VehicleModelCode == "Q5")
{
foreach (BillR100Part billPart in billResObj.R100Bill.BillR100Parts)
{
PartCfg partObj = _partCfgList.FirstOrDefault(itm => itm.PartCode == billPart.PartCode);
if (partObj != null)
{
billPart.PartType = partObj.PartType;
billPart.Description = partObj.PartType == "2" ? "柱护板" : "控制件";
billPart.PartType2 = partObj.PartType2;
}
else
{
billPart.PartType = "1";
billPart.Description = "控制件";
string errorMsg = $"R100结算件{billPart.PartCode}在结算件信息表中不存在!KNR={billResObj.R100Bill.KNR}";
//throw new Exception(errorMsg); ////???? 此处需要优化,不触发异常,直接入库
//_logRemindDomainService.WriteLogRemind("报文解析", errorMsg, LogTypeEnum.R100);
_logger.LogError(errorMsg);
}
}
}
else //除Q5,其它车型没有柱护板
{
foreach (BillR100Part partItm in billResObj.R100Bill.BillR100Parts)
{
partItm.PartType = "1";
partItm.Description = "控制件";
}
}
}
else if (billResObj.M100Bill != null)
{
if (billResObj.M100Bill.VehicleModelCode == "Q5")
{
foreach (BillM100Part billPart in billResObj.M100Bill.BillM100Parts)
{
PartCfg partObj = _partCfgList.FirstOrDefault(itm => itm.PartCode == billPart.PartCode);
if (partObj != null)
{
billPart.PartType = partObj.PartType;
billPart.Description = partObj.PartType == "2" ? "柱护板" : "控制件";
billPart.PartType2 = partObj.PartType2;
}
else
{
billPart.PartType = "1";
billPart.Description = "控制件";
string errorMsg = $"M100结算件{billPart.PartCode}在结算件信息表中不存在!VIN={billResObj.M100Bill.VIN}";
//_logRemindDomainService.WriteLogRemind("报文解析", errorMsg, LogTypeEnum.M100);
_logger.LogError(errorMsg);
//throw new Exception(errorMsg);
}
}
}
else
{
foreach (BillM100Part partItm in billResObj.M100Bill.BillM100Parts)
{
partItm.PartType = "1";
partItm.Description = "控制件";
}
}
}
}
}
//private void DoInitLoadCache()
//{
// //取全部整车总成ID
// string vehicleSql = "select Id, VehicleModelCode as VehicleModel from FisAssemblyCfgVehicle v where NewVersionId is null order by CreationTime desc";
// List<VehicleAssemblyMainList> vehicleAssemblyIdList = _newJitDapperRepository.GetListBySql<VehicleAssemblyMainList>(vehicleSql, true);
// //取全部零件:按整车总成Id、零件编码分组汇总数量
// const string vehicle2PartSql = @"
// select v.Id as VehicleAssemblyId, ep.PartCode, sum(ep.PartNum) as PartNum
// from FisAssemblyCfgVehicle v
// join FisAssemblyCfgVehicleChild vc on v.Id = vc.AssemblyCfgVehicleId
// join FisAssemblyCfgErp e on vc.ErpAssemblyId = e.Id
// join FisAssemblyCfgPart ep on e.Id = ep.AssemblyCfgErpId
// where 1=1 and not exists (select PartCode from FisPartCfg pc where IsDisable = 1 and ep.PartCode = pc.PartCode)
// and v.NewVersionId is null
// and ep.PartCode is not null
// group by v.Id, ep.PartCode
// order by v.Id, ep.PartCode
// ";
// var vehicle2partList = _newJitDapperRepository.GetListBySql<AssemblyCfgVehicle2Part>(vehicle2PartSql, true);
// //取Erp总成
// string erpMainSql = "select Id, VehicleModel from FisAssemblyCfgErp where NewVersionId is null order by ErpAssemblyVersion, CreationTime desc";
// List<ErpAssemblyMain> erpAssemblyMainList = _newJitDapperRepository.GetListBySql<ErpAssemblyMain>(erpMainSql, true);
// List<AssemblyCfgErp2Part> erp2partList = new List<AssemblyCfgErp2Part>();
// if (ConfigDic.CurrentVersion == ConfigDicVersionOption.派格)
// {
// //取所有零件(IsDisable = 1时表示不需要解析BOM)
// string erp2partSql = @"
// select e.GroupId, e.Id as ErpAssemblyId, e.ErpAssemblyCode, ep.Id as PartId, ep.PartCode, ep.PartNum, ep.IsKey
// from FisAssemblyCfgErp e
// join FisAssemblyCfgPart ep on e.Id = ep.AssemblyCfgErpId
// where ep.PartCode is not null
// and not exists (select PartCode from FisPartCfg pc where IsDisable = 1 and ep.PartCode = pc.PartCode)
// ";
// erp2partList = _newJitDapperRepository.GetListBySql<AssemblyCfgErp2Part>(erp2partSql, true);
// //结算件切换列表
// string partSwitchSql = "select SourcePartCode,TargetPartCode,ActiveBeginTime,ActiveEndTime from FisPartSwitch";
// _partSwitchList = _newJitDapperRepository.GetListBySql<PartSwitch>(partSwitchSql, true);
// }
// else
// {
// //取所有零件(IsDisable = 1时表示不需要解析BOM)
// string erp2partSql = @"
// select e.Id as ErpAssemblyId, e.ErpAssemblyCode, ep.Id as PartId, ep.PartCode, ep.PartNum, ep.IsKey
// from FisAssemblyCfgErp e
// join FisAssemblyCfgPart ep on e.Id = ep.AssemblyCfgErpId
// where e.NewVersionId is null
// and ep.PartCode is not null
// and not exists (select PartCode from FisPartCfg pc where IsDisable = 1 and ep.PartCode = pc.PartCode)
// ";
// erp2partList = _newJitDapperRepository.GetListBySql<AssemblyCfgErp2Part>(erp2partSql, true);
// }
// _r100CheckDomainSrv.InitPub(vehicleAssemblyIdList, vehicle2partList, erpAssemblyMainList, erp2partList, _partSwitchList); //整车总成内存及时刷新, ERP总成增删改时触发刷新标志
// _m100CheckDomainService.InitPub(vehicleAssemblyIdList, vehicle2partList, erpAssemblyMainList, erp2partList, _partSwitchList);
// #region 无法缓存的
// //结算件信息列表,库存系统同步过来,无法缓存
// string partCfgSql = @"select Id, PartCode, PartName, PartType, Description, PartType2, PartType3, RelationKey from FisPartCfg where 1=1"; //,DaXiaoLiangGang,DoorPlankCode,MaterialDescription,SAPMaterialNum
// _partCfgList = _newJitDapperRepository.GetListBySql<PartCfg>(partCfgSql, true);
// #endregion
//}
//private void DifferenceMenBan_ZhuHuBan(BillResult billResObj)
//{
// //根据物料组区分门板、柱护板, 柱护板不参与匹配,但是参与发货
// if (ConfigDic.CurrentVersion == ConfigDicVersionOption.派格)
// {
// if (billResObj.R100Bill != null)
// {
// if (billResObj.R100Bill.VehicleModelCode == "Q5")
// {
// foreach (BillR100Part billPart in billResObj.R100Bill.BillR100Parts)
// {
// PartCfg partObj = _partCfgList.FirstOrDefault(itm => itm.PartCode == billPart.PartCode);
// if (partObj != null)
// {
// billPart.PartType = partObj.PartType;
// billPart.Description = partObj.PartType == "2" ? "柱护板" : "控制件";
// billPart.PartType2 = partObj.PartType2;
// }
// else
// {
// billPart.PartType = "1";
// billPart.Description = "控制件";
// string errorMsg = $"R100结算件{billPart.PartCode}在结算件信息表中不存在!KNR={billResObj.R100Bill.KNR}";
// //throw new Exception(errorMsg); ////???? 此处需要优化,不触发异常,直接入库
// //_logRemindDomainService.WriteLogRemind("报文解析", errorMsg, LogTypeEnum.R100);
// _logger.LogError(errorMsg);
// }
// }
// }
// else //除Q5,其它车型没有柱护板
// {
// foreach (BillR100Part partItm in billResObj.R100Bill.BillR100Parts)
// {
// partItm.PartType = "1";
// partItm.Description = "控制件";
// }
// }
// }
// else if (billResObj.M100Bill != null)
// {
// if (billResObj.M100Bill.VehicleModelCode == "Q5")
// {
// foreach (BillM100Part billPart in billResObj.M100Bill.BillM100Parts)
// {
// PartCfg partObj = _partCfgList.FirstOrDefault(itm => itm.PartCode == billPart.PartCode);
// if (partObj != null)
// {
// billPart.PartType = partObj.PartType;
// billPart.Description = partObj.PartType == "2" ? "柱护板" : "控制件";
// billPart.PartType2 = partObj.PartType2;
// }
// else
// {
// billPart.PartType = "1";
// billPart.Description = "控制件";
// string errorMsg = $"M100结算件{billPart.PartCode}在结算件信息表中不存在!VIN={billResObj.M100Bill.VIN}";
// //_logRemindDomainService.WriteLogRemind("报文解析", errorMsg, LogTypeEnum.M100);
// _logger.LogError(errorMsg);
// //throw new Exception(errorMsg);
// }
// }
// }
// else
// {
// foreach (BillM100Part partItm in billResObj.M100Bill.BillM100Parts)
// {
// partItm.PartType = "1";
// partItm.Description = "控制件";
// }
// }
// }
// }
//}
#endregion
@ -637,22 +661,21 @@ select * from
throw new Exception("不是R100或M100!");
}
//填充零件类型
if (vehicleModel == "Q5")
{
foreach (UnknownAssemblyPartDto partDto in targetObj.UnknownAssemblyParts)
{
var tempObj = await _partCfgRepository.FirstOrDefaultAsync(itm => itm.PartCode == partDto.PartCode);
if (tempObj != null)
{
partDto.PartType = tempObj.PartType;
}
else
{
throw new Exception("Q5车型的零件在零件配置中没有对应!");
}
}
}
//if (vehicleModel == "Q5")
//{
// foreach (UnknownAssemblyPartDto partDto in targetObj.UnknownAssemblyParts)
// {
// var tempObj = await _partCfgRepository.FirstOrDefaultAsync(itm => itm.PartCode == partDto.PartCode);
// if (tempObj != null)
// {
// partDto.PartType = tempObj.PartType;
// }
// else
// {
// throw new Exception("Q5车型的零件在零件配置中没有对应!");
// }
// }
//}
ret.Item = targetObj;
return ret;
@ -836,8 +859,8 @@ select * from
string sql = @"
with b as
(
select Id from FisBillR100 where BillStatus =1
union all
-- select Id from FisBillR100 where BillStatus =1
-- union all
select Id from FisBillM100 where BillStatus =1
)
select a.Id from FisUnknownAssembly a where IsDeleted = 0 and BillID in (select Id from b)
@ -850,89 +873,35 @@ select * from
}
int matchNum = 0;
int notMatchNum = 0;
DoInitLoadCache(); //新版初始化缓存
//取所有总成包含的子零件列表
string allAssemblyPartSql = @"
select distinct p.PartCode
from FisAssemblyCfgGroup g
join FisAssemblyCfgErp e on g.Id = e.GroupId
join FisAssemblyCfgPart p on e.Id = p.AssemblyCfgErpId
where g.IsDisable <> 1
";
List<string> allAssemblyPartLst =_newJitDapperRepository.GetListBySql<string>(allAssemblyPartSql, true);
//新版初始化缓存
//DoInitLoadCache();
_hqCacheManagerDomainService.InitLoadCache(true);
foreach (Guid selId in selLst)
{
//根据未知总成ID取单据Id
UnknownAssembly unknownAssemblyObj = await _UnknownAssemblyRepository.GetAsync(selId, false);
if (unknownAssemblyObj.ScanPoint == "R100")
UnknownAssembly unknownAssemblyObj = await _UnknownAssemblyRepository.GetAsync(selId, false);
BillM100 m100Obj = await _billM100Repository.GetAsync(unknownAssemblyObj.BillID, false);
if (m100Obj.MessageFileReceiveID == null)
{
//根据单据Id取单据信息
BillR100 r100Obj = await _billR100Repository.GetAsync(unknownAssemblyObj.BillID);
//Q5车型区分控制件、柱护板
BillResult billResObj = new BillResult();
billResObj.R100Bill = r100Obj;
DifferenceMenBan_ZhuHuBan(billResObj);
//匹配上时:插入整车总成配置表、更新单据表的整车总成ID字段、返回true
//匹配不上时返回false
bool isMatch = _r100CheckDomainSrv.DoMatchAssembly(r100Obj, true, true);
if (isMatch)
{
matchNum++;
}
else
{
notMatchNum++;
var billNotExistPartLst = r100Obj.BillR100Parts.Where(itm => itm.PartType == "1" && allAssemblyPartLst.Contains(itm.PartCode) == false).ToList();
if (billNotExistPartLst.Count > 0)
{
string desc = "如下是新零件,在总成子零件中不存在:" + billNotExistPartLst.Select(itm => itm.PartCode).Distinct().JoinAsString(",");
unknownAssemblyObj.Description = desc;
await _UnknownAssemblyRepository.UpdateAsync(unknownAssemblyObj);
}
}
throw new Exception("M100表的MessageFileReceiveID字段值不能为空:" + m100Obj.HostSN2.ToString());
}
else if (unknownAssemblyObj.ScanPoint == "M100")
ImportRecord impRecObj = await _importRecordRepository.GetAsync((Guid)(m100Obj.MessageFileReceiveID));
string specExplain = impRecObj.SpecDesc;
string colorExplain = impRecObj.VehicleModelDesc.Trim().Right(7);
ObjectResultDto<bool> repasingRet = await _ediParseDomainService.ReParsing(m100Obj, specExplain, colorExplain);
if (repasingRet.Status == false)
{
//根据单据Id取单据信息
BillM100 m100Obj = await _billM100Repository.GetAsync(unknownAssemblyObj.BillID);
string curPL = m100Obj.ProductLine;
string curSNStr = m100Obj.SerialNumStr;
//Q5车型区分控制件、柱护板
BillResult billResObj = new BillResult();
billResObj.M100Bill = m100Obj;
DifferenceMenBan_ZhuHuBan(billResObj);
//匹配上时:插入整车总成配置表、更新单据表的整车总成ID字段、返回true
//匹配不上时返回false
bool isMatch = _m100CheckDomainService.DoMatchAssembly(m100Obj, true, true);
if (isMatch)
{
matchNum++;
//判断未打印表是否有数据,有则更新,没有则插入
ObjectResultDto res = await _m100DomainService.InsertOrUpdateWaitPrintByM100(m100Obj);
#region 当前单据在未匹配时已经参与打印,重新解析后进入补打
//bool hasPrintData = _billM100Repository.Any(itm => itm.ProductLine == curPL && itm.SerialNumStr.CompareTo(curSNStr) > 0 && itm.BillStatus == BillStatusEnum.Publish);
//if (hasPrintData) //该单据处于未解析时,已经打印
//{
// m100Obj.NeedReplenishPrint = 1;
// await _billM100Repository.UpdateAsync(m100Obj);
//}
#endregion
}
else
{
notMatchNum++;
var billNotExistPartLst = m100Obj.BillM100Parts.Where(itm => itm.PartType == "1" && allAssemblyPartLst.Contains(itm.PartCode) == false).ToList();
if (billNotExistPartLst.Count > 0)
{
string desc = "如下是新零件,在总成子零件中不存在:" + billNotExistPartLst.Select(itm => itm.PartCode).Distinct().JoinAsString(",");
unknownAssemblyObj.Description = desc;
await _UnknownAssemblyRepository.UpdateAsync(unknownAssemblyObj);
}
}
throw new Exception(repasingRet.Message);
}
if (repasingRet.Item == true)
{
matchNum++;
}
else
{
notMatchNum++;
}
} //foreach
@ -962,74 +931,73 @@ select * from
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost]
//[UnitOfWork(true)]
[Route("batch-parse")]
public virtual ObjectResultDto<string> BatchParseAsync(BatchParseParam input)
{
_logger.LogDebug(_errorMessagePrefix + "BatchParseAsync 进入");
//批量删除未匹配单据
//string delSql = "delete from FisNotMatchTempBill";
// _newJitDapperRepository.ExecuteSql(delSql, null, true);
ObjectResultDto<string> ret = new ObjectResultDto<string>();
try
{
string sql = @"
with b as
(
select Id, OnlineTime from FisBillM100 where BillStatus =1 {1}
)
select top {0} a.Id from FisUnknownAssembly a
join b on a.BillId = b.Id
where a.IsDeleted <> 1 and a.ExtraProperties is null
order by b.OnlineTime desc
";
int takeCount = input.TakeCount;
string sqlWhere = "";
if (input.BeginDate != null && input.EndDate != null)
{
sqlWhere = "and OnlineTime between convert(datetime,'{0}', 20) and convert(datetime,'{1}', 20)";
sqlWhere = string.Format(sqlWhere, ((DateTime)input.BeginDate).ToString("yyyy-MM-dd HH:mm:ss"), ((DateTime)input.EndDate).ToString("yyyy-MM-dd HH:mm:ss"));
}
sql = string.Format(sql, takeCount, sqlWhere);
List<Guid> selLst = _newJitDapperRepository.GetListBySql<Guid>(sql, true);
int matchNum = 0;
int notMatchNum = 0;
//_msgTransmissionAppService.ClearPub();
_msgTransmissionAppService.InitPub();
foreach (Guid selId in selLst)
{
bool isMatch = OneParseAsync(selId);
if (isMatch)
{
matchNum++;
}
else
{
notMatchNum++;
}
} //foreach
ret.Status = true;
ret.Message = $"本次共重新解析{matchNum + notMatchNum}条,其中匹配{matchNum}条、不匹配{notMatchNum}条";
ret.Item = ret.Message;
_logger.LogDebug(_errorMessagePrefix + "BatchParseAsync 完成:" + ret.Message);
return ret;
}
catch (Exception ex)
{
ret.Status = false;
ret.Message = _errorMessagePrefix + "BatchParseAsync 执行出错:" + ex.Message;
_logger.LogError(ret.Message);
return ret;
}
}
// [HttpPost]
// [Route("batch-parse")]
// public virtual ObjectResultDto<string> BatchParseAsync(BatchParseParam input)
// {
// _logger.LogDebug(_errorMessagePrefix + "BatchParseAsync 进入");
// //批量删除未匹配单据
// //string delSql = "delete from FisNotMatchTempBill";
// // _newJitDapperRepository.ExecuteSql(delSql, null, true);
// ObjectResultDto<string> ret = new ObjectResultDto<string>();
// try
// {
// string sql = @"
// with b as
// (
// select Id, OnlineTime from FisBillM100 where BillStatus =1 {1}
// )
// select top {0} a.Id from FisUnknownAssembly a
//join b on a.BillId = b.Id
//where a.IsDeleted <> 1 and a.ExtraProperties is null
//order by b.OnlineTime desc
// ";
// int takeCount = input.TakeCount;
// string sqlWhere = "";
// if (input.BeginDate != null && input.EndDate != null)
// {
// sqlWhere = "and OnlineTime between convert(datetime,'{0}', 20) and convert(datetime,'{1}', 20)";
// sqlWhere = string.Format(sqlWhere, ((DateTime)input.BeginDate).ToString("yyyy-MM-dd HH:mm:ss"), ((DateTime)input.EndDate).ToString("yyyy-MM-dd HH:mm:ss"));
// }
// sql = string.Format(sql, takeCount, sqlWhere);
// List<Guid> selLst = _newJitDapperRepository.GetListBySql<Guid>(sql, true);
// int matchNum = 0;
// int notMatchNum = 0;
// //_msgTransmissionAppService.ClearPub();
// _msgTransmissionAppService.InitPub();
// foreach (Guid selId in selLst)
// {
// bool isMatch = OneParseAsync(selId);
// if (isMatch)
// {
// matchNum++;
// }
// else
// {
// notMatchNum++;
// }
// } //foreach
// ret.Status = true;
// ret.Message = $"本次共重新解析{matchNum + notMatchNum}条,其中匹配{matchNum}条、不匹配{notMatchNum}条";
// ret.Item = ret.Message;
// _logger.LogDebug(_errorMessagePrefix + "BatchParseAsync 完成:" + ret.Message);
// return ret;
// }
// catch (Exception ex)
// {
// ret.Status = false;
// ret.Message = _errorMessagePrefix + "BatchParseAsync 执行出错:" + ex.Message;
// _logger.LogError(ret.Message);
// return ret;
// }
// }
/// <summary>
/// 根据vin从天合mes系统中取erp总成编码列表

14
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application/NewJitApplicationAutoMapperProfile.cs

@ -2,7 +2,10 @@
using Acme.BookStore.Books;
using AutoMapper;
using WY.NewJit.Books;
using WY.NewJit.EdiReceive.Dtos;
using WY.NewJit.EdiReceive.Entitys;
using WY.NewJit.Extends;
using WY.NewJit.Extends.PaiGe;
using WY.NewJit.MsgBaseData;
using WY.NewJit.MsgCheck;
using WY.NewJit.MsgCheck.UnknownAssemblys;
@ -19,6 +22,7 @@ namespace WY.NewJit
CreateMap<CreateUpdateBookDto, Book>();
#region 基础数据
CreateMap<MaterialExt, MaterialExtDto>().ReverseMap();
CreateMap<PartCfg, PartCfgDto>().ReverseMap();
CreateMap<PartCfg, CreateUpdatePartCfgDto>().ReverseMap();
@ -44,6 +48,9 @@ namespace WY.NewJit
CreateMap<LogRemind, LogRemindDto>().ReverseMap();
CreateMap<LogRemind, CreateUpdateLogRemindDto>().ReverseMap();
CreateMap<BaseConfig, BaseConfigCreateDto>().ReverseMap();
CreateMap<BaseConfig, BaseConfigDto>().ReverseMap();
#endregion
#region 报文解析及校验
@ -109,6 +116,13 @@ namespace WY.NewJit
CreateMap<WaitPrint, AlreadyPrint>().ReverseMap();
#endregion
#region 导出记录
CreateMap<ImportRecord, ImportRecordDto>().ReverseMap();
CreateMap<ImportRecord, ImportRecordCreateDto>().ReverseMap();
CreateMap<ImportRecordHis, ImportRecordHisDto>().ReverseMap();
CreateMap<ImportRecordHis, ImportRecordHisCreateDto>().ReverseMap();
#endregion
}
}
}

54
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application/PrintTable/WaitPrintAppService.cs

@ -43,7 +43,7 @@ namespace WY.NewJit.PrintTable
}
}
private const string _providerCode = "0709FAW-VW7XH";
private const string _providerCode = "LAJ46"; //0709FAW-VW7XH
/// <summary>
/// 柱护板缓存列表(打印柱护板时用到)
@ -116,6 +116,9 @@ namespace WY.NewJit.PrintTable
/// BLOB存储
/// </summary>
private readonly IBlobContainer<OurFileContainer> _blobContainer;
private readonly BaseGonfigDomainService _baseConfigDomainService;
#endregion
public WaitPrintAppService(
@ -136,7 +139,8 @@ namespace WY.NewJit.PrintTable
IRepository<PrintTemplateConfiguration, Guid> printTemplateConfigurationRepository,
M100DomainService m100DomainService,
IBlobContainer<OurFileContainer> blobContainer,
IRepository<BillR100, Guid> billR100Repository
IRepository<BillR100, Guid> billR100Repository,
BaseGonfigDomainService baseConfigDomainService
)
{
_waitPrintRepository = waitPrintRepository;
@ -157,6 +161,7 @@ namespace WY.NewJit.PrintTable
_m100DomainService = m100DomainService;
_blobContainer = blobContainer;
_billR100Repository = billR100Repository;
_baseConfigDomainService = baseConfigDomainService;
}
#region 私有方法
@ -336,20 +341,10 @@ namespace WY.NewJit.PrintTable
{
List<WaitPrint> billLst = new List<WaitPrint>();
ListResultDto<WaitPrint> ret = new ListResultDto<WaitPrint>(billLst);
int printBillCnt = 0;
if (input.PrintCount == 0) input.PrintCount = 10;//调试用的
if (input.PrintType == WY.NewJit.Extends.PaiGe.PrintTypeEnum.)
{
if ((input.BeginHostSN % 10000) > 1999)
{
throw new Exception("起始大众顺序号不能大于1999!");
}
if (input.BeginHostSN > input.EndHostSN)
{
throw new Exception("起始大众顺序号不能大于止大众顺序号!");
}
printBillCnt = input.EndHostSN - input.BeginHostSN + 1;
int minHostSN2 = await _waitPrintRepository.Where(itm =>
itm.BusinessType == BusinessTypeEnum.MenBan
@ -370,8 +365,7 @@ namespace WY.NewJit.PrintTable
&& itm.PrintType == PrintTypeEnum.OrderPrint //顺序打印
&& itm.HostSN2 >= minHostSN2)
.OrderBy(itm => itm.HostSN2)
.Take(printBillCnt).ToListAsync();
.Take(input.PrintCount).ToListAsync();
bool hasData = billLst.Any();
if (hasData == false)
{
@ -401,7 +395,7 @@ namespace WY.NewJit.PrintTable
/// <returns></returns>
private List<MenBanPackingList> DoMBPrint(MenBanPrintInputDto input, int pageIdx, ref double maxBillNum, double maxSN, DateTime printTime, List<WaitPrint> billLst, string rightOrLeft)
{
const int _colNumberPerPage = 12;
const int _colNumberPerPage = 10;
List<MenBanPackingList> retLst = new List<MenBanPackingList>();
//取当前页内容
@ -460,7 +454,7 @@ namespace WY.NewJit.PrintTable
List<AssemblyCfgErp> erpAssemblyLst = GetErpAssemblyListByBill((Guid)billObj.AssemblyID);
List<string> erpCodeLst = erpAssemblyLst.Select(itm => itm.ErpAssemblyCode).ToList();
//根据ERP总成编码取对应的物料扩展信息
List<MaterialExt> materialExtLst = _materialExtRepository.Where(itm => erpCodeLst.Contains(itm.RelationKey)).ToList();
List<MaterialExt> materialExtLst = _materialExtRepository.Where(itm => erpCodeLst.Contains(itm.MaterialNum)).ToList();
if (erpCodeLst.Count != 4)
{
promMsg += $"*总成数量是{erpCodeLst.Count}*";
@ -566,7 +560,7 @@ namespace WY.NewJit.PrintTable
//装箱单号规则 1开头,11位,自增顺序号
if (newSNStr.Length < 11)
{
return "F" + newSNStr.PadLeft(10, '0');
return "W" + newSNStr.PadLeft(10, '0');
}
return newSNStr;
}
@ -610,7 +604,7 @@ namespace WY.NewJit.PrintTable
targetMain.BillNum = sourceObj.BillNum; //单据编号
targetMain.State = 0;
targetMain.BillType = 206; //单据类型
targetMain.SubBillType = 21004; //单据子类型
targetMain.SubBillType = 21033; //红旗单据子类型
targetMain.BillTime = sourceObj.PrintDate; //单据时间
targetMain.OperName = sourceObj.CreatorId.ToString(); //操作员
targetMain.DetailQty = 0; //明细数量
@ -663,8 +657,8 @@ namespace WY.NewJit.PrintTable
targetDetail.BillNum = sourceObj.BillNum; //单据编号 通过该字段和主表弱连接
targetDetail.VinCode = sourceRec.VIN; //VIN码
targetDetail.PartCode = sourceRec.BelowSAPMaterialNum; //物料号
targetDetail.LineNum = (idx2 + 12); //行号
targetDetail.SeqNum = (idx2 + 12).ToString(); //顺序号sourceRec.HostSN.ToString()
targetDetail.LineNum = (idx2 + 10); //行号
targetDetail.SeqNum = (idx2 + 10).ToString(); //顺序号sourceRec.HostSN.ToString()
//targetDetail.BarCode = sourceRec.TopBoxPositionNum; //箱码
targetDetail.ProjectId = ""; //车型
targetDetail.State = "0"; //状态
@ -836,7 +830,7 @@ namespace WY.NewJit.PrintTable
&& itm.PrintType == PrintTypeEnum.OrderPrint //顺序打印
).MinAsync(itm => itm.HostSN2);
int minHostSN = minHostSN2 % 100000;
if (input.BeginHostSN != minHostSN)
if (input.BeginHostSN != minHostSN2)
{
retLst.Add($"输入的大众起始大众顺序号{input.BeginHostSN}和未打印表中的最小大众顺序号{minHostSN2}不相等!");
return new ListResultDto<string>(retLst);
@ -859,7 +853,7 @@ namespace WY.NewJit.PrintTable
string breakNumStr = string.Join(" ", breakNumLst);
// string breakNumStr = string.Concat(breakNumLst);
retLst.Add($"存在断号:{breakNumStr}");
return new ListResultDto<string>(retLst);
//return new ListResultDto<string>(retLst);
}
//判断未知总成
bool containNotMatch = billLst.Any(itm => itm.BillStatus == BillStatusEnum.NotMatch);
@ -869,7 +863,7 @@ namespace WY.NewJit.PrintTable
string str = string.Join(" ", lst);
//string str = string.Concat(lst);
retLst.Add($"存在未知总成:{str}");
return new ListResultDto<string>(retLst);
//return new ListResultDto<string>(retLst);
}
return new ListResultDto<string>(retLst);
@ -883,12 +877,14 @@ namespace WY.NewJit.PrintTable
Stopwatch sw = new Stopwatch();
sw.Start();
_logger.LogDebug(_errorMessagePrefix + "SaveMenBanReport 进入");
var baseConfigCache= _baseConfigDomainService.GetCachesByName("打印条数");
var printCount = baseConfigCache == null ? 10 : Convert.ToInt32(baseConfigCache.ParamValue);
MenBanPrintResultDto retObj = new MenBanPrintResultDto();
ObjectResultDto<MenBanPrintResultDto> ret = new ObjectResultDto<MenBanPrintResultDto>(retObj);
using (var uow = _unitOfWorkManager.Begin(requiresNew: true, isTransactional: true, isolationLevel: System.Data.IsolationLevel.Unspecified))
{
try
{
List<MenBanPackingList> reportMainLst = new List<MenBanPackingList>();
@ -915,7 +911,7 @@ namespace WY.NewJit.PrintTable
sw.Stop();
_logger.LogWarning($"SaveMenBanReport读取数据 - {sw.ElapsedMilliseconds}毫秒");
sw.Start();
int pageCnt = (int)Math.Ceiling(billLst.Count / 12.0); //每页打印12列,取打印页数
int pageCnt = (int)Math.Ceiling(billLst.Count / 10.0); //每页打印10列,取打印页数
double maxBillNum = 0;
@ -982,7 +978,7 @@ namespace WY.NewJit.PrintTable
return ret;
}
int pageCnt = (int)Math.Ceiling(billLst.Count / 12.0); //每页打印12列,取打印页数
int pageCnt = (int)Math.Ceiling(billLst.Count / 10.0); //每页打印10列,取打印页数
double maxBillNum = 0;
@ -1067,7 +1063,7 @@ namespace WY.NewJit.PrintTable
foreach (var masterObj in targetLst)
{
int trueCnt = masterObj.Details.Count;
int planCnt = 12;
int planCnt = 10;
if (trueCnt > planCnt)
{
throw new Exception($"实际打印行数{trueCnt}超过每页总行数{planCnt}, 底盘起{masterObj.BeginVin}底盘止{masterObj.EndVin}");
@ -1182,7 +1178,7 @@ namespace WY.NewJit.PrintTable
foreach (var masterObj in targetLst)
{
int trueCnt = masterObj.Details.Count;
int planCnt = 12;
int planCnt = 10;
if (trueCnt > planCnt)
{
throw new Exception($"实际打印行数{trueCnt}超过每页总行数{planCnt}, 底盘起{masterObj.BeginVin}底盘止{masterObj.EndVin}");

272
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Application/WY.NewJit.Application.xml

@ -9,6 +9,134 @@
BookAppService使用IObjectMapper将Book对象转换为BookDto对象, 将CreateUpdateBookDto对象转换为Book对象
</summary>
</member>
<member name="T:WY.NewJit.EdiReceive.ImportRecordAppService">
<summary>
零件管理应用服务实现
</summary>
</member>
<member name="F:WY.NewJit.EdiReceive.ImportRecordAppService._importRecordRepository">
<summary>
零件仓储
</summary>
</member>
<member name="F:WY.NewJit.EdiReceive.ImportRecordAppService._logger">
<summary>
日志
</summary>
</member>
<member name="F:WY.NewJit.EdiReceive.ImportRecordAppService._newJitDapperRepository">
<summary>
Dapper仓储
</summary>
</member>
<member name="F:WY.NewJit.EdiReceive.ImportRecordAppService._blobContainer">
<summary>
BLOB存储
</summary>
</member>
<member name="F:WY.NewJit.EdiReceive.ImportRecordAppService._dicDomainService">
<summary>
字典领域服务
</summary>
</member>
<member name="F:WY.NewJit.EdiReceive.ImportRecordAppService._configuration">
<summary>
配置
</summary>
</member>
<member name="P:WY.NewJit.EdiReceive.ImportRecordAppService._errorMessagePrefix">
<summary>
错误信息前缀
</summary>
</member>
<member name="M:WY.NewJit.EdiReceive.ImportRecordAppService.#ctor(Volo.Abp.Domain.Repositories.IRepository{WY.NewJit.EdiReceive.Entitys.ImportRecord,System.Guid},Microsoft.Extensions.Logging.ILogger{WY.NewJit.EdiReceive.ImportRecordAppService},WY.NewJit.EntityFrameworkCore.NewJitDapperRepository,Volo.Abp.BlobStoring.IBlobContainer{WY.NewJit.Common.OurFileContainer},WY.NewJit.MsgBaseData.DicDomainService,WY.NewJit.EdiReceive.Services.EdiParseDomainService,Microsoft.Extensions.Configuration.IConfiguration,Volo.Abp.Uow.IUnitOfWorkManager)">
<summary>
构造函数
</summary>
</member>
<member name="M:WY.NewJit.EdiReceive.ImportRecordAppService.GetEntityCountAsync(System.String,System.String)">
<summary>
取单表记录总数
</summary>
<param name="tableName"></param>
<param name="where"></param>
<returns></returns>
</member>
<member name="M:WY.NewJit.EdiReceive.ImportRecordAppService.GetEntityListAsync``1(System.String,System.String,System.String,System.Int32,System.Int32)">
<summary>
取单表当前页数据
</summary>
<typeparam name="T"></typeparam>
<param name="tableName"></param>
<param name="where"></param>
<param name="orderFieldName"></param>
<param name="pageSize"></param>
<param name="pageIndex"></param>
<returns></returns>
</member>
<member name="M:WY.NewJit.EdiReceive.ImportRecordAppService.QueryByConditionAsync(WY.NewJit.EdiReceive.Dtos.ImportRecordInputDto,WY.NewJit.Common.PagedAndSortedBase)">
<summary>
根据筛选条件获取实体列表
</summary>
</member>
<member name="M:WY.NewJit.EdiReceive.ImportRecordAppService.GetListAsync(WY.NewJit.EdiReceive.Dtos.ImportRecordInputDto)">
<summary>
根据筛选条件获取分页实体列表
</summary>
<param name="input">输入查询条件</param>
<returns>返回符合条件的排序分页列表</returns>
</member>
<member name="M:WY.NewJit.EdiReceive.ImportRecordAppService.GetAsync(System.Guid)">
<summary>
按主键获取唯一实体
</summary>
<param name="id">主键</param>
<returns>实体信息</returns>
</member>
<member name="M:WY.NewJit.EdiReceive.ImportRecordAppService.CreateAsync(WY.NewJit.EdiReceive.Dtos.ImportRecordCreateDto)">
<summary>
添加实体
</summary>
<param name="input">添加内容</param>
<returns>执行成功返回真</returns>
</member>
<member name="M:WY.NewJit.EdiReceive.ImportRecordAppService.UpdateAsync(System.Guid,WY.NewJit.EdiReceive.Dtos.ImportRecordCreateDto)">
<summary>
修改实体
</summary>
<param name="id">更新主键</param>
<param name="input">修改内容</param>
<returns>执行成功返回真</returns>
</member>
<member name="M:WY.NewJit.EdiReceive.ImportRecordAppService.DeleteAsync(System.String)">
<summary>
删除实体
</summary>
<param name="id">删除主键</param>
<returns>执行成功返回真</returns>
</member>
<member name="M:WY.NewJit.EdiReceive.ImportRecordAppService.ExportAsync(WY.NewJit.EdiReceive.Dtos.ImportRecordInputDto)">
<summary>
导出信息
</summary>
<param name="input">导出查询条件</param>
<returns>执行成功返回真</returns>
</member>
<member name="M:WY.NewJit.EdiReceive.ImportRecordAppService.ImportAsync(Microsoft.AspNetCore.Http.IFormFileCollection,System.Boolean)">
<summary>
导入
</summary>
<param name="files">导入文件</param>
<param name="forceExecute">校验出错时,是否强制执行</param>
<returns>执行成功返回真</returns>
</member>
<member name="M:WY.NewJit.EdiReceive.ImportRecordAppService.PrintTimeoutRemind">
<summary>
打印时间提醒
</summary>
<param name="input"></param>
<returns></returns>
</member>
<member name="T:WY.NewJit.Extends.ProductLineAuthorityAppService">
<summary>
生产线权限管理应用服务实现
@ -149,6 +277,11 @@
总成配置应用服务实现
</summary>
</member>
<member name="F:WY.NewJit.MsgBaseData.AssemblyCfgErpAppService._assemblyCfgGroupRepository">
<summary>
总成组
</summary>
</member>
<member name="F:WY.NewJit.MsgBaseData.AssemblyCfgErpAppService._assemblyCfgErpRepository">
<summary>
ERP总成仓储
@ -199,7 +332,7 @@
错误信息前缀
</summary>
</member>
<member name="M:WY.NewJit.MsgBaseData.AssemblyCfgErpAppService.#ctor(Volo.Abp.Domain.Repositories.IRepository{WY.NewJit.MsgBaseData.AssemblyCfgErp,System.Guid},Microsoft.Extensions.Logging.ILogger{WY.NewJit.MsgBaseData.AssemblyCfgErpAppService},WY.NewJit.EntityFrameworkCore.NewJitDapperRepository,Volo.Abp.Domain.Repositories.IRepository{WY.NewJit.MsgBaseData.AssemblyCfgPart,System.Guid},Volo.Abp.BlobStoring.IBlobContainer{WY.NewJit.Common.OurFileContainer},WY.NewJit.MsgBaseData.AssemblyDomainService,Volo.Abp.Domain.Repositories.IRepository{WY.NewJit.MsgBaseData.PartCfg,System.Guid},Volo.Abp.Domain.Repositories.IRepository{WY.NewJit.Extends.PaiGe.MaterialExt,System.Guid},WY.NewJit.MsgBaseData.GlobalSettingsDomainService)">
<member name="M:WY.NewJit.MsgBaseData.AssemblyCfgErpAppService.#ctor(Volo.Abp.Domain.Repositories.IRepository{WY.NewJit.MsgBaseData.AssemblyCfgErp,System.Guid},Microsoft.Extensions.Logging.ILogger{WY.NewJit.MsgBaseData.AssemblyCfgErpAppService},WY.NewJit.EntityFrameworkCore.NewJitDapperRepository,Volo.Abp.Domain.Repositories.IRepository{WY.NewJit.MsgBaseData.AssemblyCfgPart,System.Guid},Volo.Abp.BlobStoring.IBlobContainer{WY.NewJit.Common.OurFileContainer},WY.NewJit.MsgBaseData.AssemblyDomainService,Volo.Abp.Domain.Repositories.IRepository{WY.NewJit.MsgBaseData.PartCfg,System.Guid},Volo.Abp.Domain.Repositories.IRepository{WY.NewJit.Extends.PaiGe.MaterialExt,System.Guid},WY.NewJit.MsgBaseData.GlobalSettingsDomainService,Volo.Abp.Domain.Repositories.IRepository{WY.NewJit.MsgBaseData.AssemblyCfgGroup,System.Guid})">
<summary>
构造函数
</summary>
@ -274,6 +407,21 @@
<param name="files">导入文件</param>
<returns>执行成功返回真</returns>
</member>
<member name="M:WY.NewJit.MsgBaseData.AssemblyCfgErpAppService.ImportErpAssemblyGroupAsync(Microsoft.AspNetCore.Http.IFormFileCollection)">
<summary>
总成组导入【红旗版本】
</summary>
<param name="files"></param>
<returns></returns>
</member>
<member name="M:WY.NewJit.MsgBaseData.AssemblyCfgErpAppService.CheckMaterialRepeatByAssembly(System.Collections.Generic.List{WY.NewJit.MsgBaseData.ImportErpAssemblyGroupDto},System.Collections.Generic.List{WY.NewJit.Extends.PaiGe.MaterialExt})">
<summary>
导入总成时,校验规格说明包含的4个物料号分别是1001,1002,1003,1004
</summary>
<param name="srcLst">导入总成list</param>
<param name="material3Lst">总成物料list</param>
<returns></returns>
</member>
<member name="M:WY.NewJit.MsgBaseData.AssemblyCfgErpAppService.RemoveRepeatErpAssembly(System.Int32)">
<summary>
系统初始化时使用,去掉重复的ERP总成
@ -414,6 +562,61 @@
<param name="targetLst"></param>
<returns></returns>
</member>
<member name="T:WY.NewJit.MsgBaseData.BaseGonfigService">
<summary>
通用字典应用服务实现
</summary>
</member>
<member name="F:WY.NewJit.MsgBaseData.BaseGonfigService._logger">
<summary>
日志
</summary>
</member>
<member name="P:WY.NewJit.MsgBaseData.BaseGonfigService._errorMessagePrefix">
<summary>
错误信息前缀
</summary>
</member>
<member name="M:WY.NewJit.MsgBaseData.BaseGonfigService.#ctor(Volo.Abp.Domain.Repositories.IRepository{WY.NewJit.MsgBaseData.BaseConfig,System.Guid},Microsoft.Extensions.Logging.ILogger{WY.NewJit.MsgBaseData.BaseGonfigService},WY.NewJit.MsgBaseData.BaseGonfigDomainService)">
<summary>
构造函数
</summary>
</member>
<member name="M:WY.NewJit.MsgBaseData.BaseGonfigService.GetListAsync(WY.NewJit.MsgBaseData.QueryBaseConfigDto)">
<summary>
获取所有基本参数数据
</summary>
<returns></returns>
</member>
<member name="M:WY.NewJit.MsgBaseData.BaseGonfigService.CreateAsync(WY.NewJit.MsgBaseData.BaseConfigCreateDto)">
<summary>
添加实体
</summary>
<param name="input">添加内容</param>
<returns>执行成功返回真</returns>
</member>
<member name="M:WY.NewJit.MsgBaseData.BaseGonfigService.UpdateAsync(System.Guid,WY.NewJit.MsgBaseData.BaseConfigCreateDto)">
<summary>
修改实体
</summary>
<param name="id">更新主键</param>
<param name="input">修改内容</param>
<returns>执行成功返回真</returns>
</member>
<member name="M:WY.NewJit.MsgBaseData.BaseGonfigService.DeleteAsync(System.String)">
<summary>
删除实体
</summary>
<param name="id">删除主键</param>
<returns>执行成功返回真</returns>
</member>
<member name="M:WY.NewJit.MsgBaseData.BaseGonfigService.QueryByCondition(WY.NewJit.MsgBaseData.QueryBaseConfigDto)">
<summary>
根据筛选条件获取实体列表
</summary>
<param name="input"></param>
<returns></returns>
</member>
<member name="T:WY.NewJit.MsgBaseData.DicAppService">
<summary>
通用字典应用服务实现
@ -434,7 +637,7 @@
错误信息前缀
</summary>
</member>
<member name="M:WY.NewJit.MsgBaseData.DicAppService.#ctor(WY.NewJit.MsgBaseData.DicDomainService,Microsoft.Extensions.Logging.ILogger{WY.NewJit.MsgBaseData.PartCfgAppService})">
<member name="M:WY.NewJit.MsgBaseData.DicAppService.#ctor(WY.NewJit.MsgBaseData.DicDomainService,Microsoft.Extensions.Logging.ILogger{WY.NewJit.MsgBaseData.DicAppService})">
<summary>
构造函数
</summary>
@ -654,6 +857,37 @@
<param name="id">主键</param>
<returns>执行成功返回真</returns>
</member>
<member name="F:WY.NewJit.MsgBaseData.MaterialExtAppService._blobContainer">
<summary>
BLOB存储
</summary>
</member>
<member name="P:WY.NewJit.MsgBaseData.MaterialExtAppService._errorMessagePrefix">
<summary>
错误信息前缀
</summary>
</member>
<member name="M:WY.NewJit.MsgBaseData.MaterialExtAppService.GetListAsync(WY.NewJit.MsgBaseData.QueryMaterialExtDto)">
<summary>
获取数据
</summary>
<param name="input"></param>
<returns></returns>
</member>
<member name="M:WY.NewJit.MsgBaseData.MaterialExtAppService.ExportAsync(WY.NewJit.MsgBaseData.QueryMaterialExtDto)">
<summary>
导出信息
</summary>
<param name="input">导出查询条件</param>
<returns>执行成功返回真</returns>
</member>
<member name="M:WY.NewJit.MsgBaseData.MaterialExtAppService.QueryByCondition(WY.NewJit.MsgBaseData.QueryMaterialExtDto)">
<summary>
根据筛选条件获取实体列表
</summary>
<param name="input"></param>
<returns></returns>
</member>
<member name="T:WY.NewJit.MsgBaseData.PartCfgAppService">
<summary>
零件管理应用服务实现
@ -880,7 +1114,7 @@
错误信息前缀
</summary>
</member>
<member name="M:WY.NewJit.MsgBaseData.PrintTemplateConfigurationService.#ctor(Volo.Abp.Domain.Repositories.IRepository{WY.NewJit.MsgBaseData.PrintTemplateConfiguration,System.Guid},Microsoft.Extensions.Logging.ILogger{WY.NewJit.MsgBaseData.PartCfgAppService},WY.NewJit.EntityFrameworkCore.NewJitDapperRepository,Volo.Abp.BlobStoring.IBlobContainer{WY.NewJit.Common.OurFileContainer},WY.NewJit.MsgBaseData.DicDomainService)">
<member name="M:WY.NewJit.MsgBaseData.PrintTemplateConfigurationService.#ctor(Volo.Abp.Domain.Repositories.IRepository{WY.NewJit.MsgBaseData.PrintTemplateConfiguration,System.Guid},Microsoft.Extensions.Logging.ILogger{WY.NewJit.MsgBaseData.PrintTemplateConfigurationService},WY.NewJit.EntityFrameworkCore.NewJitDapperRepository,Volo.Abp.BlobStoring.IBlobContainer{WY.NewJit.Common.OurFileContainer},WY.NewJit.MsgBaseData.DicDomainService)">
<summary>
构造函数
</summary>
@ -1561,16 +1795,6 @@
ERP总成仓储
</summary>
</member>
<member name="F:WY.NewJit.MsgCheck.UnknownAssemblyAppService._r100CheckDomainSrv">
<summary>
R100报文解析及校验领域服务
</summary>
</member>
<member name="F:WY.NewJit.MsgCheck.UnknownAssemblyAppService._m100CheckDomainService">
<summary>
M100报文解析及校验领域服务
</summary>
</member>
<member name="F:WY.NewJit.MsgCheck.UnknownAssemblyAppService._logger">
<summary>
日志
@ -1591,14 +1815,19 @@
事物总线仓库
</summary>
</member>
<member name="F:WY.NewJit.MsgCheck.UnknownAssemblyAppService._partCfgRepository">
<member name="F:WY.NewJit.MsgCheck.UnknownAssemblyAppService._hqCacheManagerDomainService">
<summary>
缓存管理 领域服务
</summary>
</member>
<member name="F:WY.NewJit.MsgCheck.UnknownAssemblyAppService._ediParseDomainService">
<summary>
零件基本信息
报文解析 领域服务
</summary>
</member>
<member name="F:WY.NewJit.MsgCheck.UnknownAssemblyAppService._partSwitchList">
<member name="F:WY.NewJit.MsgCheck.UnknownAssemblyAppService._importRecordRepository">
<summary>
结算件切换列表
导入记录仓储
</summary>
</member>
<member name="F:WY.NewJit.MsgCheck.UnknownAssemblyAppService._partCfgList">
@ -1611,7 +1840,7 @@
错误信息前缀
</summary>
</member>
<member name="M:WY.NewJit.MsgCheck.UnknownAssemblyAppService.#ctor(Volo.Abp.Domain.Repositories.IRepository{WY.NewJit.MsgCheck.UnknownAssembly,System.Guid},Volo.Abp.Domain.Repositories.IRepository{WY.NewJit.MsgCheck.UnknownAssemblyPart,System.Guid},Microsoft.Extensions.Logging.ILogger{WY.NewJit.MsgCheck.UnknownAssemblyAppService},WY.NewJit.EntityFrameworkCore.NewJitDapperRepository,Volo.Abp.Domain.Repositories.IRepository{WY.NewJit.MsgBaseData.AssemblyCfgVehicle,System.Guid},Volo.Abp.Domain.Repositories.IRepository{WY.NewJit.MsgBaseData.AssemblyCfgErp,System.Guid},Volo.Abp.Domain.Repositories.IRepository{WY.NewJit.MsgBaseData.AssemblyCfgPart,System.Guid},Volo.Abp.Domain.Repositories.IRepository{WY.NewJit.MsgCheck.BillR100,System.Guid},Volo.Abp.Domain.Repositories.IRepository{WY.NewJit.MsgCheck.BillM100,System.Guid},Volo.Abp.BlobStoring.IBlobContainer{WY.NewJit.Common.OurFileContainer},Volo.Abp.Domain.Repositories.IRepository{WY.NewJit.MsgBaseData.AssemblyCfgErp,System.Guid},WY.NewJit.MsgTransmission.PaiGe.MsgTransmissionAppService,WY.NewJit.MsgCheck.R100CheckDomainService,WY.NewJit.MsgCheck.M100CheckDomainService,Volo.Abp.EventBus.Distributed.IDistributedEventBus,Volo.Abp.Domain.Repositories.IRepository{WY.NewJit.MsgBaseData.PartCfg,System.Guid},Volo.Abp.Domain.Repositories.IRepository{WY.NewJit.PrintTable.WaitPrint,System.Guid},WY.NewJit.MsgCheck.M100DomainService)">
<member name="M:WY.NewJit.MsgCheck.UnknownAssemblyAppService.#ctor(Volo.Abp.Domain.Repositories.IRepository{WY.NewJit.MsgCheck.UnknownAssembly,System.Guid},Volo.Abp.Domain.Repositories.IRepository{WY.NewJit.MsgCheck.UnknownAssemblyPart,System.Guid},Microsoft.Extensions.Logging.ILogger{WY.NewJit.MsgCheck.UnknownAssemblyAppService},WY.NewJit.EntityFrameworkCore.NewJitDapperRepository,Volo.Abp.Domain.Repositories.IRepository{WY.NewJit.MsgBaseData.AssemblyCfgVehicle,System.Guid},Volo.Abp.Domain.Repositories.IRepository{WY.NewJit.MsgBaseData.AssemblyCfgErp,System.Guid},Volo.Abp.Domain.Repositories.IRepository{WY.NewJit.MsgBaseData.AssemblyCfgPart,System.Guid},Volo.Abp.Domain.Repositories.IRepository{WY.NewJit.MsgCheck.BillR100,System.Guid},Volo.Abp.Domain.Repositories.IRepository{WY.NewJit.MsgCheck.BillM100,System.Guid},Volo.Abp.BlobStoring.IBlobContainer{WY.NewJit.Common.OurFileContainer},Volo.Abp.Domain.Repositories.IRepository{WY.NewJit.MsgBaseData.AssemblyCfgErp,System.Guid},WY.NewJit.MsgTransmission.PaiGe.MsgTransmissionAppService,Volo.Abp.EventBus.Distributed.IDistributedEventBus,Volo.Abp.Domain.Repositories.IRepository{WY.NewJit.PrintTable.WaitPrint,System.Guid},WY.NewJit.MsgCheck.M100DomainService,WY.NewJit.EdiReceive.Services.HQ_CacheManagerDomainService,WY.NewJit.EdiReceive.Services.EdiParseDomainService,Volo.Abp.Domain.Repositories.IRepository{WY.NewJit.EdiReceive.Entitys.ImportRecord,System.Guid})">
<summary>
构造函数
</summary>
@ -1686,13 +1915,6 @@
<param name="input">总成、分总成、零件三级关系实体</param>
<returns>执行成功返回真</returns>
</member>
<member name="M:WY.NewJit.MsgCheck.UnknownAssemblyAppService.BatchParseAsync(WY.NewJit.MsgCheck.UnknownAssemblys.BatchParseParam)">
<summary>
系统初始化时使用,批量解析【天合版本】
</summary>
<param name="input"></param>
<returns></returns>
</member>
<member name="M:WY.NewJit.MsgCheck.UnknownAssemblyAppService.GetErpAssemblyCodeByMesAsync(System.String)">
<summary>
根据vin从天合mes系统中取erp总成编码列表

3
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.DbMigrator/appsettings.json

@ -1,6 +1,7 @@
{
"ConnectionStrings": {
"Default": "Server=192.168.0.140;Database=NewJitPG_TEST_20230703;uid=sa;pwd=Microsoft2008"
"Default": "Server=dev.ccwin-in.com,6208;Database=NewJitPG_HQ_Temp;uid=sa;pwd=ChangkeTec@2021;"
/*"Default": "Server=192.168.0.213;Database=NewJitPG;uid=sa;pwd=Microsoft@2021"*/
/*"Default": "Server=LAPTOP-4TE7UPMR\\MYSQLSERVER;Database=NewJit;uid=sa;pwd=1"*/
},

10
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain.Shared/Common/ExtMethod.cs

@ -321,6 +321,16 @@ namespace WY.NewJit.Common
return p_val != null && p_val > 0;
}
public static bool HasValue(this string p_val)
{
return (string.IsNullOrEmpty(p_val) == false);
}
public static bool HasValue(this DateTime? p_val)
{
return (p_val != null);
}
//public static string Left(this string param, int length)
//{

149
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain.Shared/Common/ServerHelper.cs

@ -78,75 +78,86 @@ namespace WY.NewJit
/// <returns></returns>
public static string ToSerialNumStr(DateTime? onlineTime, int? hostSN, string m100_r100, string productLine)
{
if (onlineTime == null)
{
throw new Exception("ToSerialNumStr上线时间不能为空:" + hostSN.ToString());
}
if (hostSN == null)
{
throw new Exception("ToSerialNumStr大众顺序号不能为空!");
}
if (m100_r100.IsNullOrEmpty())
{
throw new Exception("ToSerialNumStr m100_r100参数不能为空!");
}
if (productLine.IsNullOrEmpty())
{
throw new Exception("ToSerialNumStr productLine参数不能为空!");
throw new Exception("ToSerialNumStr大众顺序号不能为空!!");
}
/*
1.SerialNumStr在分钟后面插入00
2.线
3.
4.线1000 01
5.20001000
6.线
*/
string secondPart = "00";
return hostSN.ToString().PadLeft(6, '0'); ; //红旗顺序号不重复,按红旗顺序号排序
string pl = (m100_r100?.Trim() + productLine?.Trim()).ToLower();
Dictionary<DateTime, int> childDic = GetDicByPL(pl); //根据产线取子字典
//if (onlineTime == null)
//{
// throw new Exception("ToSerialNumStr上线时间不能为空:" + hostSN.ToString());
//}
//if (hostSN == null)
//{
// throw new Exception("ToSerialNumStr大众顺序号不能为空!");
//}
//if (m100_r100.IsNullOrEmpty())
//{
// throw new Exception("ToSerialNumStr m100_r100参数不能为空!");
//}
//if (productLine.IsNullOrEmpty())
//{
// throw new Exception("ToSerialNumStr productLine参数不能为空!");
//}
///*
//1.SerialNumStr在分钟后面插入00
//2.取报文中的上线时间、大众顺序号,如果缓存分钟键没有,则增加一个
//3.如果缓存中有该分钟键,取最大“大众顺序号”更新
//4.如果缓存中有该分钟键,并且比当前上线时间的“大众顺序号”大1000以上,则 01
//5.分钟键超过2000时,保留1000
//6.字典按产线分组
//*/
//string secondPart = "00";
DateTime curOnlineTime = (DateTime)onlineTime;
int curHostSN = (int)hostSN;
//string pl = (m100_r100?.Trim() + productLine?.Trim()).ToLower();
//Dictionary<DateTime, int> childDic = GetDicByPL(pl); //根据产线取子字典
if (childDic.ContainsKey(curOnlineTime)) //缓存中有
{
int cacheHostSN = childDic[curOnlineTime];
//DateTime curOnlineTime = (DateTime)onlineTime;
//int curHostSN = (int)hostSN;
if (curHostSN > cacheHostSN)
{
childDic[curOnlineTime] = curHostSN; //取最大“大众顺序号”更新
}
//大1000以上,则 01
//202309251350 - 00 - 51999
//差1000以上
//202309251350 - 01 - 50001
//202309251350 - 01 - 50002
//202309251351 - 00 - 50003
if (cacheHostSN - curHostSN >= 1000)
{
secondPart = "01";
}
}
else //缓存中没有
{
childDic.Add(curOnlineTime, curHostSN); //添加缓存
}
return ((DateTime)onlineTime).ToString("yyyyMMddHHmm") + secondPart + hostSN.ToString().PadLeft(5, '0');
//if (childDic.ContainsKey(curOnlineTime)) //缓存中有
//{
// int cacheHostSN = childDic[curOnlineTime];
// if (curHostSN > cacheHostSN)
// {
// childDic[curOnlineTime] = curHostSN; //取最大“大众顺序号”更新
// }
// //大1000以上,则 01
// //202309251350 - 00 - 51999
// //差1000以上
// //202309251350 - 01 - 50001
// //202309251350 - 01 - 50002
// //202309251351 - 00 - 50003
// if (cacheHostSN - curHostSN >= 1000)
// {
// secondPart = "01";
// }
//}
//else //缓存中没有
//{
// childDic.Add(curOnlineTime, curHostSN); //添加缓存
//}
//return ((DateTime)onlineTime).ToString("yyyyMMddHHmm") + secondPart + hostSN.ToString().PadLeft(5, '0');
}
public static string ToSerialNumStr(DateTime? onlineTime, int? hostSN)
{
if (onlineTime == null)
{
throw new Exception("ToSerialNumStr上线时间不能为空:" + hostSN.ToString());
}
if (hostSN == null)
{
throw new Exception("ToSerialNumStr大众顺序号不能为空!");
}
return ((DateTime)onlineTime).ToString("yyyyMMddHHmm") + "00" + hostSN.ToString().PadLeft(5, '0');
return hostSN.ToString().PadLeft(6, '0'); ; //红旗顺序号不重复,按红旗顺序号排序
//if (onlineTime == null)
//{
// throw new Exception("ToSerialNumStr上线时间不能为空:" + hostSN.ToString());
//}
//if (hostSN == null)
//{
// throw new Exception("ToSerialNumStr大众顺序号不能为空!");
//}
//return ((DateTime)onlineTime).ToString("yyyyMMddHHmmss") + hostSN.ToString().PadLeft(5, '0');
}
/// <summary>
@ -158,23 +169,29 @@ namespace WY.NewJit
/// <exception cref="Exception"></exception>
public static string ToSerialNumStr(string priorSerialNumStr, int? hostSN)
{
if (priorSerialNumStr == null)
{
throw new Exception("ToSerialNumStr上一个排序字段值不能为空:" + priorSerialNumStr);
}
if (hostSN == null)
{
throw new Exception("ToSerialNumStr大众顺序号不能为空!");
}
if (priorSerialNumStr.Length == 17 || priorSerialNumStr.Length == 19)
{ }
else
{
throw new Exception("priorSerialNumStr不是17或19位!");
}
string prefix = priorSerialNumStr.Substring(0, priorSerialNumStr.Length - 5);
return hostSN.ToString().PadLeft(6, '0'); //红旗顺序号不重复,按红旗顺序号排序
//if (priorSerialNumStr == null)
//{
// throw new Exception("ToSerialNumStr上一个排序字段值不能为空:" + priorSerialNumStr);
//}
//if (hostSN == null)
//{
// throw new Exception("ToSerialNumStr大众顺序号不能为空!");
//}
//if (priorSerialNumStr.Length == 17 || priorSerialNumStr.Length == 19)
//{ }
//else
//{
// throw new Exception("priorSerialNumStr不是17或19位!");
//}
//string prefix = priorSerialNumStr.Substring(0, priorSerialNumStr.Length - 5);
return prefix + hostSN.ToString().PadLeft(5, '0');
//return prefix + hostSN.ToString().PadLeft(5, '0');
}

1
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain.Shared/Common/SwaggerGroupConsts.cs

@ -13,6 +13,7 @@ namespace WY.NewJit.Common
public const string = "基础数据";
public const string = "扩展";
public const string = "报文打印";
public const string = "报文接收";
}
}

4
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/Commons/Services/SequenceDomainService.cs

@ -72,14 +72,14 @@ namespace WY.NewJit.Commons
SequenceInfo newObj = new SequenceInfo(_guidGenerator.Create());
newObj.SequenceType = seqType;
newObj.SequenceNum = initMaxNum;
_sequenceInfoRepository.InsertAsync(newObj).GetAwaiter().GetResult();
_sequenceInfoRepository.InsertAsync(newObj, true).GetAwaiter().GetResult();
ret = newObj.SequenceNum;
} //不是第一次
else
{
//序列+1后更新
obj.SequenceNum++;
_sequenceInfoRepository.UpdateAsync(obj).GetAwaiter().GetResult();
_sequenceInfoRepository.UpdateAsync(obj, true).GetAwaiter().GetResult();
ret = obj.SequenceNum;
}
}

139
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/EdiReceive/Entitys/ImportRecord.cs

@ -0,0 +1,139 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Domain.Entities;
using Volo.Abp.Domain.Entities.Auditing;
namespace WY.NewJit.EdiReceive.Entitys
{
/// <summary>
/// 导入记录
/// </summary>
public class ImportRecord : Entity<Guid>
{
/// <summary>
/// 工厂
/// </summary>
public virtual string Factory { get; set; }
/// <summary>
/// 车位
/// </summary>
public virtual string VehicleLocation { get; set; }
/// <summary>
/// 工位
/// </summary>
public virtual string WorkLocation { get; set; }
/// <summary>
/// 底盘号
/// </summary>
public virtual string Vin { get; set; }
/// <summary>
/// 车身号
/// </summary>
public virtual string VehicleBodyCode { get; set; }
/// <summary>
/// 车型代码
/// </summary>
public virtual string VehicleModelCode { get; set; }
/// <summary>
/// 车型名称
/// </summary>
public virtual string VehicleModelName { get; set; }
/// <summary>
/// 车型描述
/// </summary>
public virtual string VehicleModelDesc { get; set; }
/// <summary>
/// 规格
/// </summary>
public virtual string Spec { get; set; }
/// <summary>
/// 规格说明
/// </summary>
public virtual string SpecDesc { get; set; }
/// <summary>
/// 类别
/// </summary>
public virtual string Type { get; set; }
/// <summary>
/// 涂装下线时间
/// </summary>
public virtual DateTime? PaintOfflineTime { get; set; }
/// <summary>
/// 总装上线时间
/// </summary>
public virtual DateTime? OnlineTime { get; set; }
/// <summary>
/// 内饰颜色
/// </summary>
public virtual string InteriorColor { get; set; }
/// <summary>
/// 外饰颜色
/// </summary>
public virtual string ExteriorTrimmingColor { get; set; }
/// <summary>
/// 序列号
/// </summary>
public virtual string SerialNum { get; set; }
/// <summary>
/// 流水号
/// </summary>
public virtual int HostSN { get; set; }
/// <summary>
/// 生产线:A/B
/// </summary>
public virtual string ProductLine { get; set; }
/// <summary>
/// 目的
/// </summary>
public virtual string Target { get; set; }
/// <summary>
/// 备注
/// </summary>
public virtual string Remark { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public virtual DateTime? CreateTime { get; set; }
/// <summary>
/// 创建人
/// </summary>
public virtual string CreatePerson { get; set; }
public virtual DateTime? ImportTime { get; set; }
public virtual string ImportPerson { get; set; }
public virtual string Remark2 { get; set; }
public virtual string Remark3 { get; set; }
public virtual string Remark4 { get; set; }
public virtual string Remark5 { get; set; }
}
}

139
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/EdiReceive/Entitys/ImportRecordHis.cs

@ -0,0 +1,139 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Domain.Entities;
using Volo.Abp.Domain.Entities.Auditing;
namespace WY.NewJit.EdiReceive.Entitys
{
/// <summary>
/// 导入记录
/// </summary>
public class ImportRecordHis : Entity<Guid>
{
/// <summary>
/// 工厂
/// </summary>
public virtual string Factory { get; set; }
/// <summary>
/// 车位
/// </summary>
public virtual string VehicleLocation { get; set; }
/// <summary>
/// 工位
/// </summary>
public virtual string WorkLocation { get; set; }
/// <summary>
/// 底盘号
/// </summary>
public virtual string Vin { get; set; }
/// <summary>
/// 车身号
/// </summary>
public virtual string VehicleBodyCode { get; set; }
/// <summary>
/// 车型代码
/// </summary>
public virtual string VehicleModelCode { get; set; }
/// <summary>
/// 车型名称
/// </summary>
public virtual string VehicleModelName { get; set; }
/// <summary>
/// 车型描述
/// </summary>
public virtual string VehicleModelDesc { get; set; }
/// <summary>
/// 规格
/// </summary>
public virtual string Spec { get; set; }
/// <summary>
/// 规格说明
/// </summary>
public virtual string SpecDesc { get; set; }
/// <summary>
/// 类别
/// </summary>
public virtual string Type { get; set; }
/// <summary>
/// 涂装下线时间
/// </summary>
public virtual DateTime? PaintOfflineTime { get; set; }
/// <summary>
/// 总装上线时间
/// </summary>
public virtual DateTime? OnlineTime { get; set; }
/// <summary>
/// 内饰颜色
/// </summary>
public virtual string InteriorColor { get; set; }
/// <summary>
/// 外饰颜色
/// </summary>
public virtual string ExteriorTrimmingColor { get; set; }
/// <summary>
/// 序列号
/// </summary>
public virtual string SerialNum { get; set; }
/// <summary>
/// 流水号
/// </summary>
public virtual int HostSN { get; set; }
/// <summary>
/// 生产线:A/B
/// </summary>
public virtual string ProductLine { get; set; }
/// <summary>
/// 目的
/// </summary>
public virtual string Target { get; set; }
/// <summary>
/// 备注
/// </summary>
public virtual string Remark { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public virtual DateTime? CreateTime { get; set; }
/// <summary>
/// 创建人
/// </summary>
public virtual string CreatePerson { get; set; }
public virtual DateTime? ImportTime { get; set; }
public virtual string ImportPerson { get; set; }
public virtual string Remark2 { get; set; }
public virtual string Remark3 { get; set; }
public virtual string Remark4 { get; set; }
public virtual string Remark5 { get; set; }
}
}

21
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/EdiReceive/Entitys/LastImportHostSN.cs

@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Domain.Entities;
namespace WY.NewJit.EdiReceive.Entitys
{
public class LastImportHostSN : Entity<Guid>
{
public string ProductLineCode { get; set; }
public int HostSN { get; set; }
public LastImportHostSN(Guid id)
:base(id)
{
}
}
}

553
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/EdiReceive/Services/EdiParseDomainService.cs

@ -0,0 +1,553 @@
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
{
/// <summary>
/// 红旗报文接收
/// </summary>
public class EdiParseDomainService : DomainService
{
#region 成员
/// <summary>
/// 日志
/// </summary>
private readonly ILogger<EdiParseDomainService> _logger;
/// <summary>
/// Dapper仓储
/// </summary>
private readonly INewJitDapperRepository _newJitDapperRepository;
/// <summary>
/// 字典领域服务
/// </summary>
private readonly DicDomainService _dicDomainService;
/// <summary>
/// 导入记录仓储
/// </summary>
private readonly IRepository<ImportRecord, Guid> _importRecordRepository;
/// <summary>
/// M100单据
/// </summary>
private readonly IRepository<BillM100, Guid> _billM100Repository;
/// <summary>
/// ERP总成分组仓库
/// </summary>
//private readonly IRepository<AssemblyCfgGroup, Guid> _assemblyCfgGroupRepository;
/// <summary>
/// ERP总成仓储
/// </summary>
//private readonly IRepository<AssemblyCfgErp, Guid> _assemblyCfgErpRepository;
/// <summary>
/// 整车总成配置仓库
/// </summary>
private readonly IRepository<AssemblyCfgVehicle, Guid> _assemblyCfgVehicleRepository;
/// <summary>
/// 导入最大流水号 领域服务
/// </summary>
private readonly LastImportHostSNDomainService _lastImportHostSNDomainService;
/// <summary>
/// 缓存管理 领域服务
/// </summary>
private readonly HQ_CacheManagerDomainService _hqCacheManagerDomainService;
/// <summary>
/// 插入M100、未打印表 领域服务
/// </summary>
private readonly HQ_M100DomainService _hqM100DomainServie;
/// <summary>
/// 重复报文仓库
/// </summary>
private readonly IRepository<RepeatM100, Guid> _repeatM100Repository;
/// <summary>
/// 未知总成仓库
/// </summary>
private readonly IRepository<UnknownAssembly, Guid> _unknownAssemblyRepository;
/// <summary>
/// 报文车型对应零件生产工厂车型
/// </summary>
//private static List<DicItem> _msgToPaiGeVehicleModelList = new List<DicItem>();
/// <summary>
/// M100零件生产工厂车型对应生产线
/// </summary>
//private static List<DicItem> _m100VehicleModelProductLineList = new List<DicItem>();
/// <summary>
/// 根据车型代码中的前两位(HS),过滤属于派格的订单;只针对派格的订单进行报文解析
/// </summary>
private const string _vehicleModelPrefix = "HS";
/// <summary>
/// 错误信息前缀
/// </summary>
private string _errorMessagePrefix
{
get
{
return System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + ".";
}
}
#endregion
public EdiParseDomainService(ILogger<EdiParseDomainService> logger, INewJitDapperRepository newJitDapperRepository, DicDomainService dicDomainService, IRepository<ImportRecord, Guid> importRecordRepository, IRepository<BillM100, Guid> billM100Repository, LastImportHostSNDomainService lastImportHostSNDomainService, IRepository<AssemblyCfgGroup, Guid> assemblyCfgGroupRepository = null, IRepository<AssemblyCfgErp, Guid> assemblyCfgErpRepository = null, IRepository<AssemblyCfgVehicle, Guid> assemblyCfgVehicleRepository = null, HQ_CacheManagerDomainService hqCacheManagerDomainService = null, HQ_M100DomainService hqM100DomainServie = null, IRepository<RepeatM100, Guid> repeatM100Repository = null, IRepository<UnknownAssembly, Guid> 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;
}
/// <summary>
/// 解析报文
/// 一、导入记录表
/// 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
/// </summary>
/// <param name="impRecLst">导入Excel内容</param>
/// <param name="forceExecute">校验不通过时,是否强制执行通过</param>
public virtual async Task<ObjectResultDto> ParseEdi(List<ImportRecord> input, bool forceExecute = false)
{
ObjectResultDto ret = new ObjectResultDto();
bool autoSave = false;
//扣除重复导入的订单
List<ImportRecord> notRepeatOrder = await GetNotRepeatOrder(input);
if (notRepeatOrder.Count == 0)
{
ret.Status = false;
ret.Message = $"本次导入Excel文件中{input.Count}条记录,重复订单数量{input.Count- notRepeatOrder.Count},都是重复的订单、无法导入!";
return ret;
}
#region 断号提醒
//校验两次导入之间是否断号
int priorMaxHostSN = await _lastImportHostSNDomainService.GetLastImportMaxHostSN();
string betweenBreakNumMsg = await CheckBetweenBreakNum(input, priorMaxHostSN);
//校验本次导入数据是否断号
string breakNumMsg = CheckBreakNum(ref notRepeatOrder);
if (betweenBreakNumMsg.HasValue() || breakNumMsg.HasValue())
{
if (forceExecute == false)
{
//断号提醒
ret.Status = true;
ret.Message = betweenBreakNumMsg + breakNumMsg;
return ret;
}
}
#endregion
//初始化缓存
_hqCacheManagerDomainService.InitLoadCache();
//批量插入 导入记录
await _importRecordRepository.InsertManyAsync(notRepeatOrder, autoSave);
//过滤掉其它厂家的订单,只取派格订单
var paigeOrderLst = notRepeatOrder.Where(itm => itm.VehicleModelCode.Substring(0, 2) == _vehicleModelPrefix).OrderBy(itm => itm.HostSN).ToList();
int idx = 0;
foreach (ImportRecord orderItem in paigeOrderLst)
{
idx++;
if (idx % 10 == 0)
{
_logger.LogDebug(_errorMessagePrefix + $"循环中:{idx}/{paigeOrderLst.Count}");
}
//构建M100实体
BillM100 m100Obj = BuildM100Entity(orderItem);
//更新车型、产线
UpdateProductLine(m100Obj);
//重复报文
bool isRepeat = await _billM100Repository.AnyAsync(itm => itm.HostSN == orderItem.HostSN && itm.VIN == orderItem.Vin);
if (isRepeat == true)
{
#region 重复报文
var succObj = await InsertM100RepeatBill(orderItem, m100Obj, autoSave);
_logger.LogDebug(_errorMessagePrefix + $"流水号{orderItem.HostSN}是重复报文");
ret.Status = (succObj != null);
return ret;
#endregion
}
//绑定总成分组
string specExplain = orderItem.SpecDesc;
string colorExplain = orderItem.VehicleModelDesc.Trim().Right(7);
Group_Assembly groupAssemblyObj = HQ_CacheManagerDomainService._groupAssemblyList.FirstOrDefault(itm => itm.SpecExplain == specExplain && itm.ColorExplain == colorExplain);
if (groupAssemblyObj != null)
{
#region 插入整车总成
Guid vehicleAssemblyId = GuidGenerator.Create();
AssemblyCfgVehicle vehicleAssemblyCfgObj = new AssemblyCfgVehicle(vehicleAssemblyId, null, m100Obj.VehicleModelCode, null, true);
foreach (OnlyAssemblyInfo assemblyItem in groupAssemblyObj.AssemblyDetails) //插入子表
{
vehicleAssemblyCfgObj.AddChildObj(GuidGenerator.Create(), assemblyItem.Id);
}
var vehicleAssemblyResu = await _assemblyCfgVehicleRepository.InsertAsync(vehicleAssemblyCfgObj, autoSave);
if (vehicleAssemblyResu == null)
{
throw new Exception("插入整车总成返回结果为空InsertAsync!");
}
#endregion
//插入M100、未打印表
m100Obj.SetAssemblyID(vehicleAssemblyResu.Id);
m100Obj.SetBillStatus(BillStatusEnum.Match);
m100Obj.SpecExplain = specExplain;
m100Obj.ColorExplain = colorExplain;
var insM100Ret = await _hqM100DomainServie.InsertM100(m100Obj, autoSave);
if (insM100Ret == null)
{
throw new Exception("插入M100返回结果为空InsertAsync!");
}
}
else
{
//未知总成
_logger.LogDebug(_errorMessagePrefix + $"未匹配总成,插入未知总成开始:{orderItem.HostSN}");
//更新单据表
m100Obj.SetAssemblyID(null);
m100Obj.SetBillStatus(BillStatusEnum.NotMatch);
m100Obj.SpecExplain = specExplain;
m100Obj.ColorExplain = colorExplain;
var succObj1 = await _hqM100DomainServie.InsertM100(m100Obj, autoSave);
//不匹配时,插入未知总成
var succObj2 = await InsertUnknownAssembly(m100Obj, autoSave);
_logger.LogDebug(_errorMessagePrefix + $"未匹配总成,插入未知总成完成:{orderItem.HostSN}");
ret.Status = (succObj1 != null && succObj2 != null);
}
} //foreach
//更新本次导入的最大HostSN
int curMaxHostSN = input.Max(itm => itm.HostSN);
await _lastImportHostSNDomainService.SetCurrentImportMaxHostSN(curMaxHostSN, true); //取最大号必须缓存autoSave = true
if (notRepeatOrder.Count < input.Count)
{
int repeatCount = input.Count - notRepeatOrder.Count;
ret.Message = $"本次导入Excel文件中{input.Count}条记录,上次导入最大流水号是{priorMaxHostSN},本次导入重复记录{repeatCount}";
ret.Status = false;
return ret;
}
ret.Status = true;
return ret;
}
/// <summary>
/// 未知总成-重新解析
/// </summary>
/// <param name="m100Obj"></param>
/// <param name="specExplain"></param>
/// <param name="colorExplain"></param>
/// <returns></returns>
public virtual async Task<ObjectResultDto<bool>> ReParsing(BillM100 m100Obj, string specExplain, string colorExplain)
{
ObjectResultDto<bool> ret = new ObjectResultDto<bool>();
Group_Assembly groupAssemblyObj = HQ_CacheManagerDomainService._groupAssemblyList.FirstOrDefault(itm => itm.SpecExplain == specExplain && itm.ColorExplain == colorExplain);
if (groupAssemblyObj != null)
{
#region 插入整车总成
Guid vehicleAssemblyId = GuidGenerator.Create();
AssemblyCfgVehicle vehicleAssemblyCfgObj = new AssemblyCfgVehicle(vehicleAssemblyId, null, m100Obj.VehicleModelCode, 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($"{_errorMessagePrefix}插入整车总成失败:{m100Obj.HostSN2}");
}
#endregion
//更新M100
m100Obj.SetAssemblyID(vehicleAssemblyResu.Id);
m100Obj.SetBillStatus(BillStatusEnum.Match);
var m100Ret = await _billM100Repository.UpdateAsync(m100Obj);
if (m100Ret == null)
{
throw new Exception($"{_errorMessagePrefix}更新M100失败:{m100Obj.HostSN2}");
}
//bool hasBeforeNotPrint = await _hqM100DomainServie.BeforeNotPrint((int)(m100Obj.HostSN2));
//bool isReplenishPrint = hasBeforeNotPrint ? false : true; //未打印表包含重新解析之前的记录,设置成正常打印,否则设置成补打
bool isReplenishPrint = await _hqM100DomainServie.JugdeIsReplenishPrint(m100Obj.ProductLine, (int)(m100Obj.HostSN2));
//判断未打印表是否有数据,有则更新,没有则插入
ObjectResultDto wpRet = await _hqM100DomainServie.InsertOrUpdateWaitPrintByM100(m100Ret, false, isReplenishPrint);
if (wpRet.Status == false)
{
throw new Exception(wpRet.Message);
}
//var updM100Ret = await _hqM100DomainServie.UpdateM100(m100Obj);
ret.Status = true;
ret.Item = true;
return ret;
}
else
{
ret.Status = true;
ret.Item = false;
ret.Message = $"重新解析失败:流水号{m100Obj.HostSN2},规格说明:{specExplain},颜色说明:{colorExplain}";
return ret;
}
}
/// <summary>
/// 上次导入和本次导入之间的流水号是否连续
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
private async Task<string> CheckBetweenBreakNum(List<ImportRecord> input, int priorMaxHostSN)
{
string ret = "";
//取本次导入的最小HostSN
int curMinHostSN = input.Min(itm => itm.HostSN);
//上次导入的最大HostSN
//int priorMaxHostSN = await _lastImportHostSNDomainService.GetLastImportMaxHostSN();
if (priorMaxHostSN > 0) //第一次导入时(priorMaxHostSN = 0),不需要校验两次导入之间的断号
{
if (curMinHostSN <= priorMaxHostSN + 1)
{
}
else
{
//两次导入断号提醒
ret = $"两次导入断号提醒:本次导入的最小流水号是:{curMinHostSN},上次导入的最大流水号是:{priorMaxHostSN},两者不连续\r\n";
}
}
return ret;
}
private BillM100 BuildM100Entity(ImportRecord orderItem)
{
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.VehicleModelCode.Substring(0, 2);
m100Obj.ProductLine = null;
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;
return m100Obj;
}
/// <summary>
/// 校验本次导入数据断号
/// </summary>
/// <param name="notRepeatOrder"></param>
/// <returns></returns>
private static string CheckBreakNum(ref List<ImportRecord> notRepeatOrder)
{
StringBuilder sb = new StringBuilder();
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)
{
sb.AppendLine($"流水号{priorVal}和{curVal}之间存在断号");
}
else if (curVal - priorVal == 0)
{
sb.AppendLine($"流水号{priorVal}和{curVal}之间存在重复");
}
}
return sb.ToString();
}
/// <summary>
/// 根据流水号、VIN 扣除重复导入的订单
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
private async Task<List<ImportRecord>> GetNotRepeatOrder(List<ImportRecord> input)
{
List<ImportRecord> notRepeatLst = new List<ImportRecord>();
List<ImportRecord> importHistoryLst = await _importRecordRepository.GetPagedListAsync(0, 10000, "HostSN desc");
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;
}
/// <summary>
/// 更新车型、生产线
/// </summary>
/// <param name="billResObj"></param>
private void UpdateProductLine(BillM100 bill)
{
string ediVehicleModel = bill.VehicleModelCode; //报文车型
//车型转换:3H 转 CC
var obj1 = HQ_CacheManagerDomainService._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 = HQ_CacheManagerDomainService._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 async Task<RepeatM100> InsertM100RepeatBill(ImportRecord impordRec, BillM100 m100Bill, bool autoSave = false)
{
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 = await _repeatM100Repository.InsertAsync(repeatBill, autoSave);
return ret;
}
/// <summary>
/// 不匹配时,插入未知总成,写提醒日志
/// </summary>
/// <param name="bill"></param>
private async Task<UnknownAssembly> InsertUnknownAssembly(BillM100 bill, bool autoSave = false)
{
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, autoSave);
return ret;
}
catch (Exception ex)
{
throw new Exception($"InsertUnknownAssembly方法报错:" + ex.Message);
}
}
}
}

239
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/EdiReceive/Services/HQ_CacheManagerDomainService.cs

@ -0,0 +1,239 @@
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 仓储
/// <summary>
/// 日志
/// </summary>
private ILogger<HQ_CacheManagerDomainService> _logger;
/// <summary>
/// 配置
/// </summary>
private readonly Microsoft.Extensions.Configuration.IConfiguration _configuration;
/// <summary>
/// Dapper仓储
/// </summary>
private readonly INewJitDapperRepository _newJitDapperRepository;
/// <summary>
/// 字典领域服务
/// </summary>
private readonly DicDomainService _dicDomainService;
/// <summary>
/// 跨进程全局配置领域服务
/// </summary>
private readonly GlobalSettingsDomainService _globalSettingsDomainService;
#endregion
#region 缓存
/// <summary>
/// 分组对应多个总成 清单-
/// </summary>
public static List<Group_Assembly> _groupAssemblyList = new List<Group_Assembly>();
/// <summary>
/// 结算件切换列表
/// </summary>
public static List<PartSwitch> _partSwitchList = new List<PartSwitch>();
/// <summary>
/// 报文车型VS派格车型
/// </summary>
public static List<DicItem> _msgToPaiGeVehicleModelList = new List<DicItem>();
/// <summary>
/// R100派格车型VS生产线
/// </summary>
public static List<DicItem> _r100VehicleModelProductLineList = new List<DicItem>();
/// <summary>
/// M100派格车型VS生产线
/// </summary>
public static List<DicItem> _m100VehicleModelProductLineList = new List<DicItem>();
/// <summary>
/// 结算件信息列表
/// </summary>
public static List<PartCfg> _partCfgList = new List<PartCfg>();
#endregion
#region 变量
/// <summary>
/// 错误信息前缀
/// </summary>
private string _errorMessagePrefix
{
get
{
return System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + ".";
}
}
/// <summary>
/// 上一次缓存刷新时间,和配置文件中RefreshCacheIntervalInMinutes一起使用
/// </summary>
private DateTime _lastRefreshCacheTime = DateTime.Now;
#endregion
#region 构造函数
/// <summary>
/// 构造函数
/// </summary>
public HQ_CacheManagerDomainService(
ILogger<HQ_CacheManagerDomainService> 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);
}
}
/// <summary>
/// 报文解析前加载缓存
/// </summary>
public void DoInitLoadCache()
{
//取ERP总成的零件
string group2assemblySql = @"
select g.Id as GroupId, g.GroupCode, g.VehicleModel, e.Id as ErpAssemblyId, e.ErpAssemblyCode, e.ErpAssemblyName,
g.SpecExplain, g.ColorExplain
from FisAssemblyCfgGroup g
join FisAssemblyCfgErp e on g.Id = e.GroupId
where g.IsDisable = 0 and g.IsDeleted = 0
order by g.CreationTime desc
";
var group2assemblyList = _newJitDapperRepository.GetListBySql<Group2Assembly>(group2assemblySql, true);
//转换成分组、总成 两层结构
_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<PartSwitch>(partSwitchSql, true);
_msgToPaiGeVehicleModelList = _dicDomainService.GetDicItems(DicTypeName.);
_r100VehicleModelProductLineList = _dicDomainService.GetDicItems(DicTypeName.R100派格车型对应生产线);
_m100VehicleModelProductLineList = _dicDomainService.GetDicItems(DicTypeName.M100派格车型对应生产线);
_logger.LogDebug("重新刷新报文解析缓存!");
}
/// <summary>
/// 初始化零件基本信息
/// </summary>
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<PartCfg>(partCfgSql, true);
}
#endregion
}
}

243
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/EdiReceive/Services/HQ_M100DomainService.cs

@ -0,0 +1,243 @@
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
{
/// <summary>
/// M100单据
/// </summary>
private readonly IRepository<BillM100, Guid> _billM100Repository;
/// <summary>
/// 日志
/// </summary>
private ILogger<M100CheckDomainService> _logger;
/// <summary>
/// 未打印表
/// </summary>
private readonly IRepository<WaitPrint, Guid> _waitPrintRepository;
private readonly IRepository<AlreadyPrint, Guid> _alreadyPrintRepository;
public HQ_M100DomainService(
IRepository<BillM100, Guid> billM100Repository,
ILogger<M100CheckDomainService> logger,
IRepository<WaitPrint, Guid> waitPrintRepository,
IRepository<AlreadyPrint, Guid> alreadyPrintRepository)
{
_billM100Repository = billM100Repository;
_logger = logger;
_waitPrintRepository = waitPrintRepository;
_alreadyPrintRepository = alreadyPrintRepository;
}
public async Task<BillM100> 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<BillM100> UpdateM100(BillM100 m100Obj, bool autoSave = false)
{
var m100Ret = await _billM100Repository.UpdateAsync(m100Obj, autoSave);
if (m100Ret != null)
{
//更新已解析状态时,只涉及门板、不涉及柱护板【柱护板一对一解析成功】
List<WaitPrint> 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;
waitPrint.SpecExplain = m100Ret.SpecExplain;
waitPrint.ColorExplain = m100Ret.ColorExplain;
}
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;
targetWaitPrint.SpecExplain = sourceWaitPrint.SpecExplain;
targetWaitPrint.ColorExplain = sourceWaitPrint.ColorExplain;
}
public async Task<Dictionary<Guid, List<BillM100Part>>> GetM100PartDic(List<Guid> m100IdLst)
{
List<BillM100> m100Lst = await _billM100Repository.GetListAsync(itm => m100IdLst.Contains(itm.Id), true);
Dictionary<Guid, List<BillM100Part>> ret = m100Lst.ToDictionary(itm => itm.Id, itm2 => itm2.BillM100Parts);
return ret;
}
/// <summary>
/// 根据M100插入或更新未打印表,【未知总成重新解析时调用】
/// </summary>
/// <param name="m100Obj"></param>
/// <returns></returns>
public async Task<ObjectResultDto> InsertOrUpdateWaitPrintByM100(BillM100 m100Obj, bool autoSave = false, bool isReplenishPrint = false)
{
ObjectResultDto ret = new ObjectResultDto(true, "");
List<WaitPrint> wpLst = await _waitPrintRepository.GetListAsync(itm => itm.M100Id == m100Obj.Id);
bool hasData = wpLst.Count > 0;
if (hasData) //未打印表有数据
{
foreach (WaitPrint wp in wpLst)
{
wp.AssemblyID = m100Obj.AssemblyID;
wp.BillStatus = m100Obj.BillStatus;
wp.PrintType = isReplenishPrint ? PrintTypeEnum.ReplenishPrint : PrintTypeEnum.OrderPrint;
}
await _waitPrintRepository.UpdateManyAsync(wpLst, autoSave);
}
else //未打印表没有数据
{
WaitPrint mbRec = ConvertWaitPrint(m100Obj, BusinessTypeEnum.MenBan);
WaitPrint[] wpArr = new WaitPrint[1] { mbRec };
foreach (WaitPrint wp in wpArr)
{
wp.PrintType = PrintTypeEnum.ReplenishPrint;
}
await _waitPrintRepository.InsertManyAsync(wpArr, autoSave); //插入未打印表
}
return ret;
}
/// <summary>
/// 根据传入参数hostSN2,判断存在小于hostSN2的未打印记录
/// </summary>
/// <param name="hostSN2"></param>
/// <returns></returns>
public async Task<bool> BeforeNotPrint(int hostSN2)
{
var qry = await _waitPrintRepository.GetQueryableAsync();
bool hasBeforeNotPrint = qry.Any(itm => itm.HostSN2 < hostSN2 && itm.PrintType == PrintTypeEnum.OrderPrint && itm.BillStatus == BillStatusEnum.Match);
return hasBeforeNotPrint;
}
/// <summary>
/// 判断是否进入补打流程
/// </summary>
/// <param name="productLine"></param>
/// <param name="curHostSN2"></param>
/// <returns></returns>
public async Task<bool> JugdeIsReplenishPrint(string productLine, int curHostSN2)
{
//在已打印表是最大的顺序号
var qry2 = await _alreadyPrintRepository.GetQueryableAsync();
var lst = qry2.Where(itm => itm.ProductLine == productLine);
int maxHostSN;
if (lst.Any())
{
maxHostSN = qry2.Where(itm => itm.ProductLine == productLine).Max(itm => itm.HostSN2);
}
else
{
maxHostSN = 0;
}
bool isMax = curHostSN2 > maxHostSN;
return isMax == false;
}
}
}

102
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/EdiReceive/Services/LastImportHostSNDomainService.cs

@ -0,0 +1,102 @@
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 成员
/// <summary>
/// 日志
/// </summary>
private readonly ILogger<LastImportHostSNDomainService> _logger;
/// <summary>
/// Dapper仓储
/// </summary>
private readonly INewJitDapperRepository _newJitDapperRepository;
/// <summary>
/// 字典领域服务
/// </summary>
private readonly DicDomainService _dicDomainService;
/// <summary>
/// 零件仓储
/// </summary>
private readonly IRepository<ImportRecord, Guid> _importRecordRepository;
/// <summary>
/// M100单据
/// </summary>
private readonly IRepository<BillM100, Guid> _billM100Repository;
private readonly IRepository<LastImportHostSN, Guid> _lastImportHostSNRepository;
#endregion
public LastImportHostSNDomainService(ILogger<LastImportHostSNDomainService> logger, INewJitDapperRepository newJitDapperRepository, DicDomainService dicDomainService, IRepository<ImportRecord, Guid> importRecordRepository, IRepository<BillM100, Guid> billM100Repository, IRepository<LastImportHostSN, Guid> lastImportHostSNRepository)
{
_logger = logger;
_newJitDapperRepository = newJitDapperRepository;
_dicDomainService = dicDomainService;
_importRecordRepository = importRecordRepository;
_billM100Repository = billM100Repository;
_lastImportHostSNRepository = lastImportHostSNRepository;
}
/// <summary>
/// 假设:产线之间的流水号都是唯一的
/// </summary>
/// <param name="productLine"></param>
/// <returns></returns>
public virtual async Task<int> GetLastImportMaxHostSN()
{
var lst = await _lastImportHostSNRepository.GetListAsync();
if (lst.Count > 0)
{
return lst[0].HostSN;
}
else
{
bool hasData = await _importRecordRepository.AnyAsync();
if (hasData)
{
int maxSN = await _importRecordRepository.MaxAsync(itm => itm.HostSN);
return maxSN;
}
else
{
return 0;
}
}
}
public async Task SetCurrentImportMaxHostSN(int maxHostSN, bool autoSave = false)
{
var obj = await _lastImportHostSNRepository.FirstOrDefaultAsync();
if (obj != null)
{
obj.HostSN = maxHostSN;
await _lastImportHostSNRepository.UpdateAsync(obj, autoSave);
}
else
{
LastImportHostSN newObj = new LastImportHostSN(GuidGenerator.Create());
newObj.HostSN = maxHostSN;
var insRet = await _lastImportHostSNRepository.InsertAsync(newObj, autoSave);
}
}
}
}

10
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/MsgBaseData/Entitys/AssemblyCfgErp.cs

@ -52,6 +52,16 @@ namespace WY.NewJit.MsgBaseData
/// </summary>
public virtual Guid GroupId { get; set; }
/// <summary>
/// 规格说明
/// </summary>
public virtual string SpecExplain { get; set; }
/// <summary>
/// 颜色说明
/// </summary>
public virtual string ColorExplain { get; set; }
/// <summary>
/// 结算件列表
/// </summary>

11
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/MsgBaseData/Entitys/AssemblyCfgGroup.cs

@ -27,6 +27,17 @@ namespace WY.NewJit.MsgBaseData
/// </summary>
public virtual bool IsDisable { get; set; }
/// <summary>
/// 规格说明
/// </summary>
public virtual string SpecExplain { get; set; }
/// <summary>
/// 颜色说明
/// </summary>
public virtual string ColorExplain { get; set; }
private AssemblyCfgGroup()
{
}

45
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/MsgBaseData/Entitys/BaseConfig.cs

@ -0,0 +1,45 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Domain.Entities;
namespace WY.NewJit.MsgBaseData
{
/// <summary>
/// 基础参数
/// </summary>
public class BaseConfig : AggregateRoot<Guid>
{
public BaseConfig()
{
}
public BaseConfig(Guid id ,string paramName, string paramValue, bool state, string remark):base(id)
{
ParamName = paramName;
ParamValue = paramValue;
State = state;
Remark = remark;
}
/// <summary>
/// 参数名称
/// </summary>
public virtual string ParamName { get; set; }
/// <summary>
/// 参数值
/// </summary>
public virtual string ParamValue { get; set; }
/// <summary>
/// 是否启用
/// </summary>
public virtual bool State { get; set; }
/// <summary>
/// 备注
/// </summary>
public virtual string Remark { get; set; }
}
}

52
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; }
/// <summary>
/// SAP分组编码(对应SAP的长描述或补充备注)
/// </summary>
public virtual string GroupCode { get; set; }
/// <summary>
/// 规格说明
/// </summary>
public virtual string SpecExplain { get; set; }
/// <summary>
/// 颜色说明
/// </summary>
public virtual string ColorExplain { get; set; }
public List<OnlyAssemblyInfo> AssemblyDetails;
public Group_Assembly()
{
AssemblyDetails = new List<OnlyAssemblyInfo>();
}
}
public class AssemblyInfo
{
/// <summary>
@ -49,6 +77,30 @@ namespace WY.NewJit.MsgBaseData.Entitys
}
public class OnlyAssemblyInfo
{
/// <summary>
/// Erp总成ID
/// </summary>
public Guid Id { get; set; }
/// <summary>
/// Erp总成编码
/// </summary>
public string ErpAssemblyCode { get; set; }
/// <summary>
/// Erp总成编码
/// </summary>
public string ErpAssemblyName { get; set; }
public OnlyAssemblyInfo()
{
}
}
public class PartInfo
{
/// <summary>

105
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/MsgBaseData/Services/AssemblyDomainService.cs

@ -143,59 +143,60 @@ namespace WY.NewJit.MsgBaseData
[UnitOfWork]
public virtual async Task SyncErpAssemblyAsync(int takeRecordCount)
{
string sql = @"
SELECT AppraisalCategory as RelationKey, ErpMaterialCode, MaterialDesc, SettleMaterialCode, Qty
FROM [SettleAccountService].[dbo].[v_relationship] a
where not exists (select * from [dbo].[FisAssemblyCfgErp] e where a.AppraisalCategory = e.RelationKey)
order by [Version], ErpMaterialCode, MaterialDesc, SettleMaterialCode, Qty
";
//取ERP总成 最大版本
int maxVer = _assemblyCfgErpRepository.Any() ? _assemblyCfgErpRepository.Max(itm => itm.ErpAssemblyVersion) : 0;
//初始化ERP总成及结算件数据
await ClearPub(maxVer);
//取增量数据
List<V_Relationship> relationshipLst = await _newJitDapperRepository.GetListBySqlAsync<V_Relationship>(sql, true);
List<string> keyLst = relationshipLst.Select(itm => itm.RelationKey).Distinct().Take(takeRecordCount).ToList();
throw new NotImplementedException();
// string sql = @"
//SELECT AppraisalCategory as RelationKey, ErpMaterialCode, MaterialDesc, SettleMaterialCode, Qty
// FROM [SettleAccountService].[dbo].[v_relationship] a
// where not exists (select * from [dbo].[FisAssemblyCfgErp] e where a.AppraisalCategory = e.RelationKey)
// order by [Version], ErpMaterialCode, MaterialDesc, SettleMaterialCode, Qty
//";
// //取ERP总成 最大版本
// int maxVer = _assemblyCfgErpRepository.Any() ? _assemblyCfgErpRepository.Max(itm => itm.ErpAssemblyVersion) : 0;
// //初始化ERP总成及结算件数据
// await ClearPub(maxVer);
// //取增量数据
// List<V_Relationship> relationshipLst = await _newJitDapperRepository.GetListBySqlAsync<V_Relationship>(sql, true);
// List<string> keyLst = relationshipLst.Select(itm => itm.RelationKey).Distinct().Take(takeRecordCount).ToList();
foreach (string keyStr in keyLst)
{
List<V_Relationship> filterLst = relationshipLst.Where(itm => itm.RelationKey == keyStr).ToList();
//填充erp主实体
AssemblyCfgErp targetObj = new AssemblyCfgErp(
_guidGenerator.Create(),
filterLst[0].ErpMaterialCode,
filterLst[0].MaterialDesc,
++maxVer,
null,
filterLst[0].RelationKey
);
//填充erp子实体
foreach (V_Relationship filterItm in filterLst)
{
targetObj.AddChildObject(
_guidGenerator.Create(),
filterItm.SettleMaterialCode,
filterItm.Qty,
"",
false
);
}
//判断结算件配置重复
List<ErpAssembly2> repeatIdLst = await FindRepeatErpAssembly(targetObj);
if (repeatIdLst == null || repeatIdLst.Count == 0) //没有重复,直接插入
{
AssemblyCfgErp obj2 = await _assemblyCfgErpRepository.InsertAsync(targetObj);
}
else //存在重复
{
foreach (ErpAssembly2 item in repeatIdLst)
{
//更新历史数据NewVersionId字段
await UpdateNewVersionId(item.ErpAssemblyId, targetObj.Id);
}
AssemblyCfgErp obj2 = await _assemblyCfgErpRepository.InsertAsync(targetObj);
}
}
// foreach (string keyStr in keyLst)
// {
// List<V_Relationship> filterLst = relationshipLst.Where(itm => itm.RelationKey == keyStr).ToList();
// //填充erp主实体
// AssemblyCfgErp targetObj = new AssemblyCfgErp(
// _guidGenerator.Create(),
// filterLst[0].ErpMaterialCode,
// filterLst[0].MaterialDesc,
// ++maxVer,
// null,
// filterLst[0].RelationKey
// );
// //填充erp子实体
// foreach (V_Relationship filterItm in filterLst)
// {
// targetObj.AddChildObject(
// _guidGenerator.Create(),
// filterItm.SettleMaterialCode,
// filterItm.Qty,
// "",
// false
// );
// }
// //判断结算件配置重复
// List<ErpAssembly2> repeatIdLst = await FindRepeatErpAssembly(targetObj);
// if (repeatIdLst == null || repeatIdLst.Count == 0) //没有重复,直接插入
// {
// AssemblyCfgErp obj2 = await _assemblyCfgErpRepository.InsertAsync(targetObj);
// }
// else //存在重复
// {
// foreach (ErpAssembly2 item in repeatIdLst)
// {
// //更新历史数据NewVersionId字段
// await UpdateNewVersionId(item.ErpAssemblyId, targetObj.Id);
// }
// AssemblyCfgErp obj2 = await _assemblyCfgErpRepository.InsertAsync(targetObj);
// }
// }
}
/// <summary>

45
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/MsgBaseData/Services/BaseGonfigDomainService.cs

@ -0,0 +1,45 @@
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;
namespace WY.NewJit.MsgBaseData
{
public class BaseGonfigDomainService : DomainService
{
private static List<BaseConfig> _baseConfigdCaches = new List<BaseConfig>();//记录缓存
private readonly IRepository<BaseConfig, Guid> _repository;
public BaseGonfigDomainService(IRepository<BaseConfig, Guid> repository)
{
_repository = repository;
}
/// <summary>
/// 更新记录和内存
/// </summary>
/// <returns></returns>
public async Task<ObjectResultDto> UpdateBaseConfigCache()
{
ObjectResultDto ret = new ObjectResultDto(true, null);
_baseConfigdCaches.Clear();//清空缓存
_baseConfigdCaches = await _repository.GetListAsync();
return ret;
}
/// <summary>
/// 根据名称获取参数
/// </summary>
/// <param name="name"></param>
/// <returns></returns>
public BaseConfig GetCachesByName(string name)
{
var item = _baseConfigdCaches.FirstOrDefault(r => r.ParamName == name);
return item;
}
}
}

25
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/MsgCheck/Entitys/BillM100.cs

@ -17,7 +17,7 @@ namespace WY.NewJit.MsgCheck
/// <summary>
/// 报文接收ID,对应报文接收表主键
/// </summary>
public virtual Guid? MessageFileReceiveID { get; protected set; }
public virtual Guid? MessageFileReceiveID { get; set; }
/// <summary>
/// 流水号#
@ -49,7 +49,7 @@ namespace WY.NewJit.MsgCheck
/// <summary>
/// 车型代码(取通用字典)
/// </summary>
public virtual string VehicleModelCode { get; protected set; }
public virtual string VehicleModelCode { get; set; }
/// <summary>
/// 生产线(派格按生产线分类)
@ -59,17 +59,17 @@ namespace WY.NewJit.MsgCheck
/// <summary>
/// 版本
/// </summary>
public virtual string Version { get; protected set; }
public virtual string Version { get; set; }
/// <summary>
/// 接收时间
/// </summary>
public virtual DateTime? ReceiveTime { get; protected set; }
public virtual DateTime? ReceiveTime { get; set; }
/// <summary>
/// 单据状态(0 空;1 未匹配;2 已匹配未打印;3 已打印)
/// </summary>
public virtual BillStatusEnum BillStatus { get; protected set; }
public virtual BillStatusEnum BillStatus { get; set; }
/// <summary>
/// 描述
@ -134,6 +134,15 @@ namespace WY.NewJit.MsgCheck
/// </summary>
public virtual bool? IsPartSwitch { get; set; }
/// <summary>
/// 规格说明:HSC0DRCC0001
/// </summary>
public virtual string SpecExplain { get; set; }
/// <summary>
/// 颜色说明:车型描述后7位,石墨黑/云杉灰
/// </summary>
public virtual string ColorExplain { get; set; }
public BillM100()
{
@ -142,9 +151,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)

3
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/MsgCheck/Services/BillNumberRecordDomainService.cs

@ -15,6 +15,9 @@ using WY.NewJit.PrintTable;
namespace WY.NewJit.MsgCheck
{
/// <summary>
/// 吕志斌开发的生成断号数据
/// </summary>
[Dependency(Microsoft.Extensions.DependencyInjection.ServiceLifetime.Singleton, ReplaceServices = true)]
public class BillNumberRecordDomainService : DomainService
{

7
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;
@ -22,7 +23,7 @@ using WY.NewJit.MsgBaseData.Entitys;
namespace WY.NewJit.MsgCheck
{
public partial class CacheManagerDomainService : ITransientDependency
public partial class CacheManagerDomainService : ITransientDependency
{
#region 仓储
@ -301,6 +302,8 @@ namespace WY.NewJit.MsgCheck
}
}
*/
/*
private readonly CacheManagerDomainService _cacheManagerDomainService;
CacheManagerDomainService cacheManagerDomainService

345
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<BillM100> 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<WaitPrint> waitPrintBreakNumLst = new List<WaitPrint>();
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<BillM100> 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<WaitPrint> 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<BillM100> 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<WaitPrint> waitPrintBreakNumLst = new List<WaitPrint>();
// 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<BillM100> 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<WaitPrint> 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<Dictionary<Guid, List<BillM100Part>>> GetM100PartDic(List<Guid> m100IdLst)
{
List<BillM100> m100Lst = await _billM100Repository.GetListAsync(itm => m100IdLst.Contains(itm.Id), true);
Dictionary<Guid, List<BillM100Part>> ret = m100Lst.ToDictionary(itm => itm.Id, itm2 => itm2.BillM100Parts);
return ret;
throw new NotImplementedException();
//List<BillM100> m100Lst = await _billM100Repository.GetListAsync(itm => m100IdLst.Contains(itm.Id), true);
//Dictionary<Guid, List<BillM100Part>> ret = m100Lst.ToDictionary(itm => itm.Id, itm2 => itm2.BillM100Parts);
//return ret;
}
/// <summary>
@ -264,41 +271,43 @@ namespace WY.NewJit.MsgCheck
/// <returns></returns>
public async Task<ObjectResultDto> InsertOrUpdateWaitPrintByM100(BillM100 m100Obj, bool autoSave = false)
{
ObjectResultDto ret = new ObjectResultDto(true, "");
List<WaitPrint> 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<WaitPrint> 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;
}
}
}

42
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/MsgCheck/Services/R100CheckDomainService.cs

@ -991,6 +991,48 @@ namespace WY.NewJit.MsgCheck
}
[Serializable]
public class Group2Assembly
{
/// <summary>
/// 分组Id, 对应总成分组表Id
/// </summary>
public Guid GroupId { get; set; }
/// <summary>
/// 分组代码
/// </summary>
public string GroupCode { get; set; }
/// <summary>
/// Erp总成ID
/// </summary>
public Guid ErpAssemblyId { get; set; }
/// <summary>
/// Erp总成编码
/// </summary>
public string ErpAssemblyCode { get; set; }
/// <summary>
/// Erp总成名称
/// </summary>
public string ErpAssemblyName { get; set; }
/// <summary>
/// 规格说明
/// </summary>
public virtual string SpecExplain { get; set; }
/// <summary>
/// 颜色说明
/// </summary>
public virtual string ColorExplain { get; set; }
}
public class ErpAssemblyMain
{
public Guid Id { get; set; }

12
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/PrintTable/Entitys/AlreadyPrint.cs

@ -121,6 +121,18 @@ namespace WY.NewJit.PrintTable
this.Id = id;
}
/// <summary>
/// 规格说明:HSC0DRCC0001
/// </summary>
public virtual string SpecExplain { get; set; }
/// <summary>
/// 颜色说明:车型描述后7位,石墨黑/云杉灰
/// </summary>
public virtual string ColorExplain { get; set; }
}
}

10
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Domain/PrintTable/Entitys/WaitPrint.cs

@ -110,6 +110,16 @@ namespace WY.NewJit.PrintTable
/// </summary>
public Guid? LastModifierId { get; set; }
/// <summary>
/// 规格说明:HSC0DRCC0001
/// </summary>
public virtual string SpecExplain { get; set; }
/// <summary>
/// 颜色说明:车型描述后7位,石墨黑/云杉灰
/// </summary>
public virtual string ColorExplain { get; set; }
public WaitPrint()
{

338
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.EntityFrameworkCore.DbMigrations/Migrations/20220701062532_Created_NewJit_Entity2022-07-01.cs

@ -1,338 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace WY.NewJit.Migrations
{
public partial class Created_NewJit_Entity20220701 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
//migrationBuilder.AddColumn<DateTime>(
// name: "MinOnlineTime",
// table: "FisZhuHuBanPackingList",
// type: "datetime2",
// nullable: true);
//migrationBuilder.AddColumn<int>(
// name: "ErrorCount",
// table: "FisMessageReceive",
// type: "int",
// nullable: true);
//migrationBuilder.AddColumn<string>(
// name: "ErrorMessage",
// table: "FisMessageReceive",
// type: "nvarchar(max)",
// nullable: true);
//migrationBuilder.AddColumn<DateTime>(
// name: "LastUpdateTime",
// table: "FisMessageReceive",
// type: "datetime2",
// nullable: true);
//migrationBuilder.AddColumn<DateTime>(
// name: "MinOnlineTime",
// table: "FisMenBanPackingList",
// type: "datetime2",
// nullable: true);
//migrationBuilder.AddColumn<bool>(
// name: "IsPartSwitch",
// table: "FisBillR100",
// type: "bit",
// nullable: true);
//migrationBuilder.AddColumn<int>(
// name: "HostSN2",
// table: "FisBillM100",
// type: "int",
// nullable: true);
//migrationBuilder.AddColumn<bool>(
// name: "IsPartSwitch",
// table: "FisBillM100",
// type: "bit",
// nullable: true);
//migrationBuilder.AddColumn<int>(
// name: "NeedReplenishPrint",
// table: "FisBillM100",
// type: "int",
// nullable: true);
//migrationBuilder.AddColumn<DateTime>(
// name: "PrintTime2",
// table: "FisBillM100",
// type: "datetime2",
// nullable: true);
//migrationBuilder.AlterColumn<string>(
// name: "GroupCode",
// table: "FisAssemblyCfgErp",
// type: "varchar(100)",
// maxLength: 100,
// nullable: true,
// oldClrType: typeof(string),
// oldType: "varchar(50)",
// oldMaxLength: 50,
// oldNullable: true);
//migrationBuilder.AddColumn<Guid>(
// name: "GroupId",
// table: "FisAssemblyCfgErp",
// type: "uniqueidentifier",
// nullable: false,
// defaultValue: new Guid("00000000-0000-0000-0000-000000000000"));
//migrationBuilder.CreateTable(
// name: "FisAssemblyCfgGroup",
// columns: table => new
// {
// Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
// GroupCode = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: true),
// VehicleModel = table.Column<string>(type: "nvarchar(max)", nullable: true),
// IsDisable = table.Column<bool>(type: "bit", nullable: false),
// ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: true),
// ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: true),
// CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
// CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
// LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
// LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
// IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false),
// DeleterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
// DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true)
// },
// constraints: table =>
// {
// table.PrimaryKey("PK_FisAssemblyCfgGroup", x => x.Id);
// });
migrationBuilder.CreateTable(
name: "FisCUR_TB_BILL",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
UID = table.Column<int>(type: "int", nullable: false),
BillNum = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
State = table.Column<int>(type: "int", nullable: false),
SourceBillNum = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
SourceBillNum2 = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
SourceBillNum3 = table.Column<string>(type: "nvarchar(max)", nullable: true),
BillTime = table.Column<DateTime>(type: "datetime2", nullable: false),
StartTime = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
FinishTime = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
OperName = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
DetailQty = table.Column<int>(type: "int", nullable: false),
VendId = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
CustId = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
ProjectId = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
TransportType = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
TruckNum = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
GateCode = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
GateName = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
DockCode = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
Remark = table.Column<string>(type: "nvarchar(max)", nullable: true),
AccountDate = table.Column<DateTime>(type: "datetime2", nullable: true),
GUID = table.Column<Guid>(type: "uniqueidentifier", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_FisCUR_TB_BILL", x => x.Id);
});
migrationBuilder.CreateTable(
name: "FisCUR_TS_SORT_DETAIL",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
UID = table.Column<long>(type: "bigint", nullable: false),
BillNum = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
LineNum = table.Column<int>(type: "int", nullable: false),
VinCode = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
SeqNum = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
PartCode = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
BarCode = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
CustPartCode = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
ProjectId = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
FyonNum = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
VendId = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
Dock = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
DispatchDate = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
State = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
Remark = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true),
PlanQty = table.Column<decimal>(type: "money", nullable: false),
Qty = table.Column<decimal>(type: "money", nullable: false),
CustBarCode = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true),
ReceiptQty = table.Column<decimal>(type: "money", nullable: false),
FullBarCode = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_FisCUR_TS_SORT_DETAIL", x => x.Id);
});
migrationBuilder.CreateTable(
name: "FisHIS_TB_BILL",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
UID = table.Column<int>(type: "int", nullable: false),
BillNum = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
State = table.Column<int>(type: "int", nullable: false),
SourceBillNum = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
SourceBillNum2 = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
SourceBillNum3 = table.Column<string>(type: "nvarchar(max)", nullable: true),
BillTime = table.Column<DateTime>(type: "datetime2", nullable: false),
StartTime = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
FinishTime = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
OperName = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
DetailQty = table.Column<int>(type: "int", nullable: false),
VendId = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
CustId = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
ProjectId = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
TransportType = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
TruckNum = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
GateCode = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
GateName = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
DockCode = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
Remark = table.Column<string>(type: "nvarchar(max)", nullable: true),
AccountDate = table.Column<DateTime>(type: "datetime2", nullable: true),
GUID = table.Column<Guid>(type: "uniqueidentifier", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_FisHIS_TB_BILL", x => x.Id);
});
migrationBuilder.CreateTable(
name: "FisHIS_TS_SORT_DETAIL",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
UID = table.Column<long>(type: "bigint", nullable: false),
BillNum = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
LineNum = table.Column<int>(type: "int", nullable: false),
VinCode = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
SeqNum = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
PartCode = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
BarCode = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
CustPartCode = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
ProjectId = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
FyonNum = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
VendId = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
Dock = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
DispatchDate = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
State = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
Remark = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true),
PlanQty = table.Column<decimal>(type: "money", nullable: false),
Qty = table.Column<decimal>(type: "money", nullable: false),
CustBarCode = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true),
ReceiptQty = table.Column<decimal>(type: "money", nullable: false),
FullBarCode = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_FisHIS_TS_SORT_DETAIL", x => x.Id);
});
//migrationBuilder.CreateTable(
// name: "FisMessageReceiveArchive",
// columns: table => new
// {
// Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
// MessageFileName = table.Column<string>(type: "nvarchar(max)", nullable: true),
// MessageContent = table.Column<string>(type: "nvarchar(max)", nullable: true),
// ReceiveStatus = table.Column<int>(type: "int", nullable: false),
// ReceiveTime = table.Column<DateTime>(type: "datetime2", nullable: false),
// LastUpdateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
// MessageReceiveId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
// BillType = table.Column<string>(type: "nvarchar(max)", nullable: true),
// BillOnlineTime = table.Column<DateTime>(type: "datetime2", nullable: true),
// BillHostSN = table.Column<int>(type: "int", nullable: true),
// ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: true),
// ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: true)
// },
// constraints: table =>
// {
// table.PrimaryKey("PK_FisMessageReceiveArchive", x => x.Id);
// });
}
protected override void Down(MigrationBuilder migrationBuilder)
{
//migrationBuilder.DropTable(
// name: "FisAssemblyCfgGroup");
migrationBuilder.DropTable(
name: "FisCUR_TB_BILL");
migrationBuilder.DropTable(
name: "FisCUR_TS_SORT_DETAIL");
migrationBuilder.DropTable(
name: "FisHIS_TB_BILL");
migrationBuilder.DropTable(
name: "FisHIS_TS_SORT_DETAIL");
//migrationBuilder.DropTable(
// name: "FisMessageReceiveArchive");
//migrationBuilder.DropColumn(
// name: "MinOnlineTime",
// table: "FisZhuHuBanPackingList");
//migrationBuilder.DropColumn(
// name: "ErrorCount",
// table: "FisMessageReceive");
//migrationBuilder.DropColumn(
// name: "ErrorMessage",
// table: "FisMessageReceive");
//migrationBuilder.DropColumn(
// name: "LastUpdateTime",
// table: "FisMessageReceive");
//migrationBuilder.DropColumn(
// name: "MinOnlineTime",
// table: "FisMenBanPackingList");
//migrationBuilder.DropColumn(
// name: "IsPartSwitch",
// table: "FisBillR100");
//migrationBuilder.DropColumn(
// name: "HostSN2",
// table: "FisBillM100");
//migrationBuilder.DropColumn(
// name: "IsPartSwitch",
// table: "FisBillM100");
//migrationBuilder.DropColumn(
// name: "NeedReplenishPrint",
// table: "FisBillM100");
//migrationBuilder.DropColumn(
// name: "PrintTime2",
// table: "FisBillM100");
//migrationBuilder.DropColumn(
// name: "GroupId",
// table: "FisAssemblyCfgErp");
//migrationBuilder.AlterColumn<string>(
// name: "GroupCode",
// table: "FisAssemblyCfgErp",
// type: "varchar(50)",
// maxLength: 50,
// nullable: true,
// oldClrType: typeof(string),
// oldType: "varchar(100)",
// oldMaxLength: 100,
// oldNullable: true);
}
}
}

233
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.EntityFrameworkCore.DbMigrations/Migrations/20220701064724_Created_NewJit_Entity2022-07-01_2.cs

@ -1,233 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace WY.NewJit.Migrations
{
public partial class Created_NewJit_Entity20220701_2 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "VinCode",
table: "FisHIS_TS_SORT_DETAIL",
type: "nvarchar(50)",
maxLength: 50,
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "nvarchar(50)",
oldMaxLength: 50,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "PartCode",
table: "FisHIS_TS_SORT_DETAIL",
type: "nvarchar(50)",
maxLength: 50,
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "nvarchar(50)",
oldMaxLength: 50,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "FullBarCode",
table: "FisHIS_TS_SORT_DETAIL",
type: "nvarchar(200)",
maxLength: 200,
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "nvarchar(200)",
oldMaxLength: 200,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "BillNum",
table: "FisHIS_TS_SORT_DETAIL",
type: "nvarchar(50)",
maxLength: 50,
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "nvarchar(50)",
oldMaxLength: 50,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "BillNum",
table: "FisHIS_TB_BILL",
type: "nvarchar(50)",
maxLength: 50,
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "nvarchar(50)",
oldMaxLength: 50,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "VinCode",
table: "FisCUR_TS_SORT_DETAIL",
type: "nvarchar(50)",
maxLength: 50,
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "nvarchar(50)",
oldMaxLength: 50,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "PartCode",
table: "FisCUR_TS_SORT_DETAIL",
type: "nvarchar(50)",
maxLength: 50,
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "nvarchar(50)",
oldMaxLength: 50,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "FullBarCode",
table: "FisCUR_TS_SORT_DETAIL",
type: "nvarchar(200)",
maxLength: 200,
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "nvarchar(200)",
oldMaxLength: 200,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "BillNum",
table: "FisCUR_TS_SORT_DETAIL",
type: "nvarchar(50)",
maxLength: 50,
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "nvarchar(50)",
oldMaxLength: 50,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "BillNum",
table: "FisCUR_TB_BILL",
type: "nvarchar(50)",
maxLength: 50,
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "nvarchar(50)",
oldMaxLength: 50,
oldNullable: true);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "VinCode",
table: "FisHIS_TS_SORT_DETAIL",
type: "nvarchar(50)",
maxLength: 50,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(50)",
oldMaxLength: 50);
migrationBuilder.AlterColumn<string>(
name: "PartCode",
table: "FisHIS_TS_SORT_DETAIL",
type: "nvarchar(50)",
maxLength: 50,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(50)",
oldMaxLength: 50);
migrationBuilder.AlterColumn<string>(
name: "FullBarCode",
table: "FisHIS_TS_SORT_DETAIL",
type: "nvarchar(200)",
maxLength: 200,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(200)",
oldMaxLength: 200);
migrationBuilder.AlterColumn<string>(
name: "BillNum",
table: "FisHIS_TS_SORT_DETAIL",
type: "nvarchar(50)",
maxLength: 50,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(50)",
oldMaxLength: 50);
migrationBuilder.AlterColumn<string>(
name: "BillNum",
table: "FisHIS_TB_BILL",
type: "nvarchar(50)",
maxLength: 50,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(50)",
oldMaxLength: 50);
migrationBuilder.AlterColumn<string>(
name: "VinCode",
table: "FisCUR_TS_SORT_DETAIL",
type: "nvarchar(50)",
maxLength: 50,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(50)",
oldMaxLength: 50);
migrationBuilder.AlterColumn<string>(
name: "PartCode",
table: "FisCUR_TS_SORT_DETAIL",
type: "nvarchar(50)",
maxLength: 50,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(50)",
oldMaxLength: 50);
migrationBuilder.AlterColumn<string>(
name: "FullBarCode",
table: "FisCUR_TS_SORT_DETAIL",
type: "nvarchar(200)",
maxLength: 200,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(200)",
oldMaxLength: 200);
migrationBuilder.AlterColumn<string>(
name: "BillNum",
table: "FisCUR_TS_SORT_DETAIL",
type: "nvarchar(50)",
maxLength: 50,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(50)",
oldMaxLength: 50);
migrationBuilder.AlterColumn<string>(
name: "BillNum",
table: "FisCUR_TB_BILL",
type: "nvarchar(50)",
maxLength: 50,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(50)",
oldMaxLength: 50);
}
}
}

1170
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.EntityFrameworkCore.DbMigrations/Migrations/20220701064724_Created_NewJit_Entity2022-07-01_2.Designer.cs → src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.EntityFrameworkCore.DbMigrations/Migrations/20240109072607_Add_ImportRec_Table.Designer.cs

File diff suppressed because it is too large

3238
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.EntityFrameworkCore.DbMigrations/Migrations/20240109072607_Add_ImportRec_Table.cs

File diff suppressed because it is too large

1157
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.EntityFrameworkCore.DbMigrations/Migrations/20220701062532_Created_NewJit_Entity2022-07-01.Designer.cs → src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.EntityFrameworkCore.DbMigrations/Migrations/20240110033428_NewJitPG_HQ_0110.Designer.cs

File diff suppressed because it is too large

41
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.EntityFrameworkCore.DbMigrations/Migrations/20240110033428_NewJitPG_HQ_0110.cs

@ -0,0 +1,41 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace WY.NewJit.Migrations
{
public partial class NewJitPG_HQ_0110 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "FisBaseConfig",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
ParamName = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
ParamValue = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
State = table.Column<int>(type: "int", precision: 1, nullable: false),
Remark = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: true),
ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: true),
ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_FisBaseConfig", x => x.Id);
});
migrationBuilder.CreateIndex(
name: "IX_FisBaseConfig_ParamName",
table: "FisBaseConfig",
column: "ParamName",
unique: true,
filter: "[ParamName] IS NOT NULL");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "FisBaseConfig");
}
}
}

6132
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.EntityFrameworkCore.DbMigrations/Migrations/20240115023640_NewJitPG_HQ_Init.Designer.cs

File diff suppressed because it is too large

33
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.EntityFrameworkCore.DbMigrations/Migrations/20240115023640_NewJitPG_HQ_Init.cs

@ -0,0 +1,33 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace WY.NewJit.Migrations
{
public partial class NewJitPG_HQ_Init : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "ColorExplain",
table: "FisAssemblyCfgErp",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "SpecExplain",
table: "FisAssemblyCfgErp",
type: "nvarchar(max)",
nullable: true);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "ColorExplain",
table: "FisAssemblyCfgErp");
migrationBuilder.DropColumn(
name: "SpecExplain",
table: "FisAssemblyCfgErp");
}
}
}

6134
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.EntityFrameworkCore.DbMigrations/Migrations/20240115024450_NewJitPG_HQ_Init2.Designer.cs

File diff suppressed because it is too large

53
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.EntityFrameworkCore.DbMigrations/Migrations/20240115024450_NewJitPG_HQ_Init2.cs

@ -0,0 +1,53 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace WY.NewJit.Migrations
{
public partial class NewJitPG_HQ_Init2 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "SpecExplain",
table: "FisAssemblyCfgErp",
type: "varchar(50)",
maxLength: 50,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(max)",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ColorExplain",
table: "FisAssemblyCfgErp",
type: "varchar(50)",
maxLength: 50,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(max)",
oldNullable: true);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "SpecExplain",
table: "FisAssemblyCfgErp",
type: "nvarchar(max)",
nullable: true,
oldClrType: typeof(string),
oldType: "varchar(50)",
oldMaxLength: 50,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ColorExplain",
table: "FisAssemblyCfgErp",
type: "nvarchar(max)",
nullable: true,
oldClrType: typeof(string),
oldType: "varchar(50)",
oldMaxLength: 50,
oldNullable: true);
}
}
}

6142
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.EntityFrameworkCore.DbMigrations/Migrations/20240115055730_NewJitPG_HQ_Init3.Designer.cs

File diff suppressed because it is too large

35
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.EntityFrameworkCore.DbMigrations/Migrations/20240115055730_NewJitPG_HQ_Init3.cs

@ -0,0 +1,35 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace WY.NewJit.Migrations
{
public partial class NewJitPG_HQ_Init3 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "ColorExplain",
table: "FisAssemblyCfgGroup",
type: "varchar(50)",
maxLength: 50,
nullable: true);
migrationBuilder.AddColumn<string>(
name: "SpecExplain",
table: "FisAssemblyCfgGroup",
type: "varchar(50)",
maxLength: 50,
nullable: true);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "ColorExplain",
table: "FisAssemblyCfgGroup");
migrationBuilder.DropColumn(
name: "SpecExplain",
table: "FisAssemblyCfgGroup");
}
}
}

1113
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.EntityFrameworkCore.DbMigrations/Migrations/NewJitMigrationsDbContextModelSnapshot.cs

File diff suppressed because it is too large

4
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.EntityFrameworkCore.DbMigrations/WY.NewJit.EntityFrameworkCore.DbMigrations.csproj

@ -18,8 +18,4 @@
</PackageReference>
</ItemGroup>
<ItemGroup>
<Folder Include="Migrations\" />
</ItemGroup>
</Project>

14
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.EntityFrameworkCore/EntityFrameworkCore/NewJitDbContext.cs

@ -17,6 +17,7 @@ using WY.NewJit.Commons;
using WY.NewJit.Extends.PaiGe.WMS;
using WY.NewJit.MsgBaseData.Entitys;
using WY.NewJit.PrintTable;
using WY.NewJit.EdiReceive.Entitys;
namespace WY.NewJit.EntityFrameworkCore
{
@ -58,6 +59,8 @@ namespace WY.NewJit.EntityFrameworkCore
public DbSet<PrintTemplateConfiguration> PrintTemplateConfigurations { get; set; }
public DbSet<BaseConfig> BaseConfigs { get; set; }
#endregion
#region 报文解析及校验
@ -150,6 +153,15 @@ namespace WY.NewJit.EntityFrameworkCore
public DbSet<AlreadyPrint> already_print { get; set; }
#endregion
#region 派格红旗报文接收
public DbSet<ImportRecord> ImportRecords { get; set; }
public DbSet<ImportRecordHis> ImportRecordHis { get; set; }
public DbSet<LastImportHostSN> LastImportHostSN { get; set; }
#endregion
/* Add DbSet properties for your Aggregate Roots / Entities here.
* Also map them inside NewJitDbContextModelCreatingExtensions.ConfigureNewJit
*/
@ -157,7 +169,7 @@ namespace WY.NewJit.EntityFrameworkCore
public NewJitDbContext(DbContextOptions<NewJitDbContext> options)
: base(options)
{
this.Database.SetCommandTimeout(System.TimeSpan.FromMinutes(120));
}
protected override void OnModelCreating(ModelBuilder builder)

100
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.EntityFrameworkCore/EntityFrameworkCore/NewJitDbContextModelCreatingExtensions.cs

@ -3,6 +3,7 @@ using Volo.Abp;
using Volo.Abp.EntityFrameworkCore.Modeling;
using WY.NewJit.Books;
using WY.NewJit.Commons;
using WY.NewJit.EdiReceive.Entitys;
using WY.NewJit.Extends;
using WY.NewJit.Extends.PaiGe;
using WY.NewJit.Extends.PaiGe.WMS;
@ -72,8 +73,8 @@ namespace WY.NewJit.EntityFrameworkCore
b.Property(itm => itm.VehicleModel).HasColumnType("varchar").HasMaxLength(50);
b.Property(itm => itm.RelationKey).HasColumnType("varchar").HasMaxLength(50);
b.Property(itm => itm.GroupCode).HasColumnType("varchar").HasMaxLength(100);
b.Property(itm => itm.SpecExplain).HasColumnType("varchar").HasMaxLength(50);
b.Property(itm => itm.ColorExplain).HasColumnType("varchar").HasMaxLength(50);
});
builder.Entity<AssemblyCfgGroup>(b =>
@ -82,6 +83,9 @@ namespace WY.NewJit.EntityFrameworkCore
b.ConfigureByConvention();//配置/映射继承的属性,应始终对你所有的实体使用它
b.Property(itm => itm.GroupCode).HasColumnType("varchar").HasMaxLength(100);
b.Property(itm => itm.SpecExplain).HasColumnType("varchar").HasMaxLength(50);
b.Property(itm => itm.ColorExplain).HasColumnType("varchar").HasMaxLength(50);
});
@ -162,7 +166,15 @@ namespace WY.NewJit.EntityFrameworkCore
});
builder.Entity<BaseConfig>(b =>
{
b.ToTable(NewJitConsts.DbTablePrefix + nameof(BaseConfig)); //将Book实体映射到数据库表XXXBooks
b.ConfigureByConvention();//配置/映射继承的属性,应始终对你所有的实体使用它
b.Property("ParamName").HasMaxLength(50);
b.Property("ParamValue").HasMaxLength(50);
b.Property("Remark").HasMaxLength(500);
b.HasIndex(x => new { x.ParamName}).IsUnique();
});
#endregion
@ -591,6 +603,88 @@ namespace WY.NewJit.EntityFrameworkCore
b.ConfigureByConvention();//配置/映射继承的属性,应始终对你所有的实体使用它
});
#endregion
#region 派格红旗报文接收
builder.Entity<ImportRecord>(b =>
{
b.ToTable(NewJitConsts.DbTablePrefix + nameof(ImportRecord));
b.ConfigureByConvention();//配置/映射继承的属性,应始终对你所有的实体使用它
b.Property(itm => itm.Factory).HasColumnType("varchar").HasMaxLength(50);
b.Property(itm => itm.VehicleLocation).HasColumnType("varchar").HasMaxLength(50);
b.Property(itm => itm.WorkLocation).HasColumnType("varchar").HasMaxLength(50);
b.Property(itm => itm.Vin).HasColumnType("varchar").HasMaxLength(50);
b.Property(itm => itm.VehicleBodyCode).HasColumnType("varchar").HasMaxLength(50);
b.Property(itm => itm.VehicleModelCode).HasColumnType("varchar").HasMaxLength(50);
b.Property(itm => itm.VehicleModelName).HasColumnType("nvarchar").HasMaxLength(200);
b.Property(itm => itm.VehicleModelDesc).HasColumnType("nvarchar").HasMaxLength(200);
b.Property(itm => itm.Spec).HasColumnType("varchar").HasMaxLength(50);
b.Property(itm => itm.SpecDesc).HasColumnType("nvarchar").HasMaxLength(200);
b.Property(itm => itm.Type).HasColumnType("varchar").HasMaxLength(50);
b.Property(itm => itm.PaintOfflineTime).HasColumnType("datetime");
b.Property(itm => itm.OnlineTime).HasColumnType("datetime");
b.Property(itm => itm.InteriorColor).HasColumnType("varchar").HasMaxLength(50);
b.Property(itm => itm.ExteriorTrimmingColor).HasColumnType("varchar").HasMaxLength(50);
b.Property(itm => itm.SerialNum).HasColumnType("varchar").HasMaxLength(50);
b.Property(itm => itm.HostSN).HasColumnType("int");
b.Property(itm => itm.ProductLine).HasColumnType("varchar").HasMaxLength(50);
b.Property(itm => itm.Target).HasColumnType("nvarchar").HasMaxLength(200);
b.Property(itm => itm.Remark).HasColumnType("varchar").HasMaxLength(200);
b.Property(itm => itm.CreateTime).HasColumnType("datetime2");
b.Property(itm => itm.CreatePerson).HasColumnType("varchar").HasMaxLength(50);
b.Property(itm => itm.ImportTime).HasColumnType("datetime2").HasMaxLength(50);
b.Property(itm => itm.ImportPerson).HasColumnType("varchar").HasMaxLength(50);
//b.HasIndex(itm => itm.HostSN).HasDatabaseName("IX_ImportRec_HostSN");
b.Property(itm => itm.Remark2).HasColumnType("varchar").HasMaxLength(200);
b.Property(itm => itm.Remark3).HasColumnType("varchar").HasMaxLength(200);
b.Property(itm => itm.Remark4).HasColumnType("varchar").HasMaxLength(200);
b.Property(itm => itm.Remark5).HasColumnType("varchar").HasMaxLength(200);
});
builder.Entity<ImportRecordHis>(b =>
{
b.ToTable(NewJitConsts.DbTablePrefix + nameof(ImportRecordHis));
b.ConfigureByConvention();//配置/映射继承的属性,应始终对你所有的实体使用它
b.Property(itm => itm.Factory).HasColumnType("varchar").HasMaxLength(50);
b.Property(itm => itm.VehicleLocation).HasColumnType("varchar").HasMaxLength(50);
b.Property(itm => itm.WorkLocation).HasColumnType("varchar").HasMaxLength(50);
b.Property(itm => itm.Vin).HasColumnType("varchar").HasMaxLength(50);
b.Property(itm => itm.VehicleBodyCode).HasColumnType("varchar").HasMaxLength(50);
b.Property(itm => itm.VehicleModelCode).HasColumnType("varchar").HasMaxLength(50);
b.Property(itm => itm.VehicleModelName).HasColumnType("nvarchar").HasMaxLength(200);
b.Property(itm => itm.VehicleModelDesc).HasColumnType("nvarchar").HasMaxLength(200);
b.Property(itm => itm.Spec).HasColumnType("varchar").HasMaxLength(50);
b.Property(itm => itm.SpecDesc).HasColumnType("nvarchar").HasMaxLength(200);
b.Property(itm => itm.Type).HasColumnType("varchar").HasMaxLength(50);
b.Property(itm => itm.PaintOfflineTime).HasColumnType("datetime");
b.Property(itm => itm.OnlineTime).HasColumnType("datetime");
b.Property(itm => itm.InteriorColor).HasColumnType("varchar").HasMaxLength(50);
b.Property(itm => itm.ExteriorTrimmingColor).HasColumnType("varchar").HasMaxLength(50);
b.Property(itm => itm.SerialNum).HasColumnType("varchar").HasMaxLength(50);
b.Property(itm => itm.HostSN).HasColumnType("int");
b.Property(itm => itm.ProductLine).HasColumnType("varchar").HasMaxLength(50);
b.Property(itm => itm.Target).HasColumnType("nvarchar").HasMaxLength(200);
b.Property(itm => itm.Remark).HasColumnType("varchar").HasMaxLength(200);
b.Property(itm => itm.CreateTime).HasColumnType("datetime2");
b.Property(itm => itm.CreatePerson).HasColumnType("varchar").HasMaxLength(50);
b.Property(itm => itm.ImportTime).HasColumnType("datetime2").HasMaxLength(50);
b.Property(itm => itm.ImportPerson).HasColumnType("varchar").HasMaxLength(50);
b.HasIndex(itm => itm.HostSN).HasDatabaseName("IX_ImportRecHis_HostSN");
b.Property(itm => itm.Remark2).HasColumnType("varchar").HasMaxLength(200);
b.Property(itm => itm.Remark3).HasColumnType("varchar").HasMaxLength(200);
b.Property(itm => itm.Remark4).HasColumnType("varchar").HasMaxLength(200);
b.Property(itm => itm.Remark5).HasColumnType("varchar").HasMaxLength(200);
});
builder.Entity<LastImportHostSN>(b =>
{
b.ToTable(NewJitConsts.DbTablePrefix + nameof(LastImportHostSN));
b.ConfigureByConvention();//配置/映射继承的属性,应始终对你所有的实体使用它
b.Property(itm => itm.ProductLineCode).HasColumnType("varchar").HasMaxLength(50);
b.Property(itm => itm.HostSN).HasColumnType("int");
});
#endregion
}
}
}

4
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Job.BomInterface/appsettings.json

@ -19,10 +19,10 @@
//"Default": "Server=192.168.0.140;Database=NewJitPG_TEST_20230703;uid=sa;pwd=Microsoft2008;",
//"ABP": "Server=192.168.0.140;Database=ABP;User ID=sa;Password=Microsoft2008;",
//"WMS": "Server=192.168.0.140;Database=CPAT_WMS_TEST;User ID=sa;Password=Microsoft2008;"
//"Default": "Server=dev.ccwin-in.com,6208;Database=NewJitPG_15;uid=sa;pwd=ChangkeTec@2021;",
//"Default": "Server=dev.ccwin-in.com,6208;Database=NewJitPG_HQ;uid=sa;pwd=ChangkeTec@2021;",
//"ABP": "Server=dev.ccwin-in.com,6208;Database=ABP;User ID=sa;Password=ChangkeTec@2021;",
//"WMS": "Server=dev.ccwin-in.com,6208;Database=CPAT_WMS;User ID=sa;Password=ChangkeTec@2021;"
"Default": "Server=192.168.0.228;Database=NewJitPG_15;uid=sa;pwd=ChangkeTec@2021;",
"Default": "Server=192.168.0.228;Database=NewJitPG_HQ;uid=sa;pwd=ChangkeTec@2021;",
"ABP": "Server=192.168.0.228;Database=ABP;User ID=sa;Password=ChangkeTec@2021;",
"WMS": "Server=192.168.0.228;Database=CPAT_WMS;User ID=sa;Password=ChangkeTec@2021;"

2
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Job.ConsoleApp/appsettings.json

@ -63,7 +63,7 @@
/*"Default": "Server=192.168.0.140;Database=NewJitPG_TEST_0114;uid=sa;pwd=Microsoft2008;",*/
//"Default": "Server=192.168.0.140;Database=NewJitPG_TEST_20230703;uid=sa;pwd=Microsoft2008;",
/*"Default": "Server=192.168.0.216;Database=NewJitPG;uid=sa;pwd=ChangkeTec@2021;",*/
"Default": "Server=dev.ccwin-in.com,6208;Database=NewJitPG_15;uid=sa;pwd=ChangkeTec@2021;",
"Default": "Server=dev.ccwin-in.com,6208;Database=NewJitPG_HQ;uid=sa;pwd=ChangkeTec@2021;",
"ABP": "Server=dev.ccwin-in.com,6208;Database=ABP;User ID=sa;Password=ChangkeTec@2021;",
"WMS": "Server=dev.ccwin-in.com,6208;Database=CPAT_WMS;User ID=sa;Password=ChangkeTec@2021;"
},

4
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Job.ConsoleBatchImportBrokenNum/appsettings.json

@ -37,10 +37,10 @@
//"Default": "Server=192.168.0.140;Database=NewJitPG_TEST_20230703;uid=sa;pwd=Microsoft2008;",
//"ABP": "Server=192.168.0.140;Database=ABP;User ID=sa;Password=Microsoft2008;",
//"WMS": "Server=192.168.0.140;Database=CPAT_WMS_TEST;User ID=sa;Password=Microsoft2008;"
//"Default": "Server=dev.ccwin-in.com,6208;Database=NewJitPG_15;uid=sa;pwd=ChangkeTec@2021;",
//"Default": "Server=dev.ccwin-in.com,6208;Database=NewJitPG_HQ;uid=sa;pwd=ChangkeTec@2021;",
//"ABP": "Server=dev.ccwin-in.com,6208;Database=ABP;User ID=sa;Password=ChangkeTec@2021;",
//"WMS": "Server=dev.ccwin-in.com,6208;Database=CPAT_WMS;User ID=sa;Password=ChangkeTec@2021;"
"Default": "Server=192.168.0.228;Database=NewJitPG_15;uid=sa;pwd=ChangkeTec@2021;",
"Default": "Server=192.168.0.228;Database=NewJitPG_HQ;uid=sa;pwd=ChangkeTec@2021;",
"ABP": "Server=192.168.0.228;Database=ABP;User ID=sa;Password=ChangkeTec@2021;",
"WMS": "Server=192.168.0.228;Database=CPAT_WMS;User ID=sa;Password=ChangkeTec@2021;"

2
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Job.ConsoleGetEDIFile/appsettings.json

@ -49,7 +49,7 @@
//"Default": "Server=192.168.0.140;Database=NewJitPG_TEST_20230703;uid=sa;pwd=Microsoft2008;",
//"ABP": "Server=192.168.0.140;Database=ABP;User ID=sa;Password=Microsoft2008;",
//"WMS": "Server=192.168.0.140;Database=CPAT_WMS_TEST;User ID=sa;Password=Microsoft2008;"
"Default": "Server=dev.ccwin-in.com,6208;Database=NewJitPG_15;uid=sa;pwd=ChangkeTec@2021;",
"Default": "Server=dev.ccwin-in.com,6208;Database=NewJitPG_HQ;uid=sa;pwd=ChangkeTec@2021;",
"ABP": "Server=dev.ccwin-in.com,6208;Database=ABP;User ID=sa;Password=ChangkeTec@2021;",
"WMS": "Server=dev.ccwin-in.com,6208;Database=CPAT_WMS;User ID=sa;Password=ChangkeTec@2021;"
},

12
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Job.ConsoleSyncToWms/appsettings.json

@ -17,12 +17,16 @@
//"Default": "Server=192.168.0.140;Database=NewJitPG_TEST_20230703;uid=sa;pwd=Microsoft2008;",
//"ABP": "Server=192.168.0.140;Database=ABP;User ID=sa;Password=Microsoft2008;",
//"WMS": "Server=192.168.0.140;Database=CPAT_WMS_TEST;User ID=sa;Password=Microsoft2008;"
"Default": "Server=dev.ccwin-in.com,6208;Database=NewJitPG_15;uid=sa;pwd=ChangkeTec@2021;",
"ABP": "Server=dev.ccwin-in.com,6208;Database=ABP;User ID=sa;Password=ChangkeTec@2021;",
"WMS": "Server=dev.ccwin-in.com,6208;Database=CPAT_WMS;User ID=sa;Password=ChangkeTec@2021;"
//"Default": "Server=192.168.0.228;Database=NewJitPG_15;uid=sa;pwd=ChangkeTec@2021;",
//"Default": "Server=dev.ccwin-in.com,6208;Database=NewJitPG_HQ;uid=sa;pwd=ChangkeTec@2021;",
//"ABP": "Server=dev.ccwin-in.com,6208;Database=ABP;User ID=sa;Password=ChangkeTec@2021;",
//"WMS": "Server=dev.ccwin-in.com,6208;Database=CPAT_WMS;User ID=sa;Password=ChangkeTec@2021;"
//"Default": "Server=192.168.0.228;Database=NewJitPG_HQ_Temp;uid=sa;pwd=ChangkeTec@2021;",
//"ABP": "Server=192.168.0.228;Database=ABP;User ID=sa;Password=ChangkeTec@2021;",
//"WMS": "Server=192.168.0.228;Database=CPAT_WMS;User ID=sa;Password=ChangkeTec@2021;"
"Default": "Server=192.168.0.228;Database=NewJitPG_HQ;uid=sa;pwd=ChangkeTec@2021;",
"ABP": "Server=192.168.0.228;Database=ABP;User ID=sa;Password=ChangkeTec@2021;",
"WMS": "Server=192.168.0.228;Database=CPAT_WMS;User ID=sa;Password=ChangkeTec@2021;"
},

13
src/Modules/新版JIT或JIS系统服务端/src/WY.NewJit.Web/appsettings.json

@ -11,10 +11,11 @@
//"Default": "Server=192.168.0.140;Database=ABP;User ID=sa;Password=Microsoft2008;",
//"WMS": "Server=192.168.0.140;Database=CPAT_WMS_TEST;User ID=sa;Password=Microsoft2008;"
"NewJitPG": "Server=dev.ccwin-in.com,6208;Database=NewJitPG_15;uid=sa;pwd=ChangkeTec@2021;",
"Default": "Server=dev.ccwin-in.com,6208;Database=ABP;User ID=sa;Password=ChangkeTec@2021;",
"NewJitPG": "Server=dev.ccwin-in.com,6208;Database=NewJitPG_HQ;uid=sa;pwd=ChangkeTec@2021;",
"WMS": "Server=dev.ccwin-in.com,6208;Database=CPAT_WMS;User ID=sa;Password=ChangkeTec@2021;"
//"NewJitPG": "Server=192.168.0.68;Database=NewJitPG_HQ;uid=sa;pwd=Microsoft@2022;",
//"WMS": "Server=192.168.0.140;Database=CPAT_WMS_TEST;User ID=sa;Password=Microsoft2008;"
},
"AuthServer": {
"Authority": "http://dev.ccwin-in.com:16077",
@ -66,10 +67,10 @@
},
"ProductLineTimeoutRemind": {
"01": 30,
"05": 30,
"07": 30,
"08": 30
"01": 40,
"05": 40,
"07": 40,
"08": 40
}
},
"Serilog": {

11
vue/public/config.js

@ -0,0 +1,11 @@
// 开发
window.SITE_CONFIG['config_ip'] = 'http://192.168.0.228'
window.SITE_CONFIG['config_auth_port'] = '7696'
window.SITE_CONFIG['config_public_port'] = '7692'
window.SITE_CONFIG['config_backend_port'] = '7692'
// 发布
// window.SITE_CONFIG['config_ip'] = 'http://192.168.0.68'
// window.SITE_CONFIG['config_auth_port'] = '8066'
// window.SITE_CONFIG['config_public_port'] = '8092'
// window.SITE_CONFIG['config_backend_port'] = '8092'

5
vue/public/index.html

@ -6,7 +6,12 @@
<meta name="renderer" content="webkit">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<script>
// 初始化
window.SITE_CONFIG = {};
</script>
<title><%= webpackConfig.name %></title>
<script src="./config.js"></script>
<!-- <link rel="stylesheet" href="./css/style.css" type="text/css" />-->
<!-- <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css"> -->

6
vue/src/App.vue

@ -6,7 +6,6 @@
<script>
import {mapGetters} from 'vuex'
export default {
name: 'App',
computed: {
@ -42,5 +41,10 @@
},
}
localStorage.setItem('config_ip',window.SITE_CONFIG['config_ip'])
localStorage.setItem('config_auth_port',window.SITE_CONFIG['config_auth_port'])
localStorage.setItem('config_public_port',window.SITE_CONFIG['config_public_port'])
localStorage.setItem('config_backend_port',window.SITE_CONFIG['config_backend_port'])
</script>

175
vue/src/components/ImportExcel-normal/index.vue

@ -0,0 +1,175 @@
<template>
<el-dialog
:visible="show"
:title="title"
:append-to-body="true"
:close-on-click-modal="false"
width="600px"
@close="closeView"
v-loading="loading"
>
<el-upload
ref="upload"
class="avatar-uploader"
drag
action="#"
accept=".xlsx, .xls"
:http-request="httpRequestfiles"
:headers="httpHeader"
:file-list="fileuploadList"
:before-upload="beforeAvatarUpload"
:before-remove="beforeRemove"
:on-remove="handleRemove"
:on-change="handleChange"
:limit="10"
>
<i class="el-icon-upload"></i>
<div class="el-upload__text">
将文件拖到此处
<em>点击上传</em>
</div>
</el-upload>
<span slot="footer" class="dialog-footer">
<el-button @click="closeView" >取消</el-button>
<el-button type="primary" @click="sureClick">立即导入</el-button>
</span>
</el-dialog>
</template>
<script>
import { getToken } from "@/utils/auth"; // get token from cookie
export default {
name: "ImportExcelNormal",
props: {
show: {
type: Boolean,
default: false,
},
title:{
type: String,
default: "导入文件",
},
//
importURL:{
type: String,
default: null,
}
},
computed:{
httpHeader() {
//token
return {
Authorization: "Bearer " + getToken(),
};
},
},
watch: {
show: function (val) {
this.fileuploadList = []
}
},
data(){
return {
fileuploadList: [],
isLt2M: "",
loading:false
}
},
methods:{
//
closeView() {
this.$emit("update:show", false);
this.$emit("close");
},
httpRequestfiles(data) {
let _this = this;
let rd = new FileReader(); //
let file = data.file;
this.fileuploadList.push(file);
rd.readAsDataURL(file); // base64
},
beforeAvatarUpload(file) {
var FileExt = file.name.replace(/.+\./, "");
if (["xlsx"].indexOf(FileExt.toLowerCase()) === -1) {
this.$message({
type: "warning",
message: "只支持xlsx类型文件!",
});
this.isFileType = "0";
return false;
} else {
this.isFileType = "1";
}
this.isLt2M = file.size / 1024 / 1024 < 100 ? "1" : "0";
if (this.isLt2M === "0") {
this.$message.error("上传文件大小不能超过 100MB!");
}
return this.isLt2M === "1" ? true : false;
},
beforeRemove(file, fileList) {
if (this.isLt2M === "1" && this.isFileType === "1") {
return this.$confirm(`确定移除 ${file.name}`);
}
},
handleRemove(file, fileList) {
//
const index = this.fileuploadList.indexOf(file.originFileObj);
const newFileList = this.fileuploadList.slice();
newFileList.splice(index, 1);
this.fileuploadList = newFileList;
},
handleChange(file, fileList) {
this.fileuploadList = []
},
//
sureClick() {
if (
this.fileuploadList === [] ||
JSON.stringify(this.fileuploadList) === "[]"
) {
this.$message.error("请选择导入文件");
return false;
}
this.saveTemplateData();
},
saveTemplateData() {
this.loading = true;
if (JSON.stringify(this.fileuploadList) != "[]") {
let fd = new FormData();
const { fileuploadList } = this;
fileuploadList.forEach((file) => {
fd.append("files", file); //
});
const webapi = this.importURL;
this.$axios
.posts(webapi, fd)
.then(async (res) => {
this.loading = false;
if (res.status) {
this.$parent.importNormalCallback(res,fileuploadList,fd)
} else {
this.$message({
message: res.message,
type: "error",
showClose:true
});
}
})
.catch(() => {
this.loading = false;
this.$message({
message: "导入失败!2222",
type: "error",
});
});
} else {
this.loading = false;
this.$message({
message: "未上传任何附件,请查检!",
type: "warning",
});
}
},
}
}
</script>

108
vue/src/router/modules/fis.js

@ -17,11 +17,31 @@ const pgfis = {
},
children: [
{
path: '/customerPartCfg',
component: () => import('@/views/pg-fis/basedate/customerPartCfg'),
path: '/pg-planControl',
component: () => import('@/views/pg-fis/basedate/planControl/index.vue'),
name: 'pg-planControl',//命名路由
meta: {
title: '计划管理',
//roles: ['SettleAccount.Reports'],
icon: '客户零件'
}
},
// {
// path: '/customerPartCfg',
// component: () => import('@/views/pg-fis/basedate/customerPartCfg'),
// name: 'customerPartCfg',//命名路由
// meta: {
// title: '客户零件管理',
// //roles: ['SettleAccount.Reports'],
// icon: '发货'
// }
// },
{
path: '/SAPItemConfig',
component: () => import('@/views/pg-fis/basedate/SAPItemConfig'),
name: 'customerPartCfg',//命名路由
meta: {
title: '客户零件管理',
title: '物料管理',
//roles: ['SettleAccount.Reports'],
icon: '发货'
}
@ -36,16 +56,16 @@ const pgfis = {
icon: '发货'
}
},
{
path: '/pg-partSwitch',
component: () => import('@/views/pg-fis/basedate/partSwitch'),
name: 'pg-partSwitch',//命名路由
meta: {
title: '零件切换管理',
//roles: ['SettleAccount.Reports'],
icon: '发货'
}
},
// {
// path: '/pg-partSwitch',
// component: () => import('@/views/pg-fis/basedate/partSwitch'),
// name: 'pg-partSwitch',//命名路由
// meta: {
// title: '零件切换管理',
// //roles: ['SettleAccount.Reports'],
// icon: '发货'
// }
// },
{
path: '/pg-unknownAssembly',
component: () => import('@/views/pg-fis/basedate/unknownAssembly'),
@ -66,16 +86,16 @@ const pgfis = {
icon: '供货'
}
},
{
path: '/pg-M100BIll',
component: () => import('@/views/pg-fis/basedate/m100BIll'),
name: 'pg-M100BIll',//命名路由
meta: {
title: 'M100单据信息维护',
//roles: ['SettleAccount.Reports'],
icon: '客户零件'
}
},
// {
// path: '/pg-M100BIll',
// component: () => import('@/views/pg-fis/basedate/m100BIll'),
// name: 'pg-M100BIll',//命名路由
// meta: {
// title: 'M100单据信息维护',
// //roles: ['SettleAccount.Reports'],
// icon: '客户零件'
// }
// },
// {
// path: '/pg-M100Online',
// component: () => import('@/views/pg-fis/basedate/m100Online'),
@ -106,26 +126,26 @@ const pgfis = {
// icon: '客户零件'
// }
// },
{
path: '/pg-R100Online',
component: () => import('@/views/pg-fis/basedate/r100Online'),
name: 'pg-R100Online',//命名路由
meta: {
title: 'R100上线信息',
//roles: ['SettleAccount.Reports'],
icon: '客户零件'
}
},
{
path: '/pg-weldingAssembly',
component: () => import('@/views/pg-fis/basedate/weldingAssembly'),
name: 'pg-weldingAssembly',//命名路由
meta: {
title: '焊装总装对比',
//roles: ['SettleAccount.Reports'],
icon: '客户零件'
}
},
// {
// path: '/pg-R100Online',
// component: () => import('@/views/pg-fis/basedate/r100Online'),
// name: 'pg-R100Online',//命名路由
// meta: {
// title: 'R100上线信息',
// //roles: ['SettleAccount.Reports'],
// icon: '客户零件'
// }
// },
// {
// path: '/pg-weldingAssembly',
// component: () => import('@/views/pg-fis/basedate/weldingAssembly'),
// name: 'pg-weldingAssembly',//命名路由
// meta: {
// title: '焊装总装对比',
// //roles: ['SettleAccount.Reports'],
// icon: '客户零件'
// }
// },
{
path: '/pg-logRemind',
component: () => import('@/views/pg-fis/basedate/logRemind'),
@ -145,7 +165,7 @@ const pgfis = {
//roles: ['SettleAccount.Reports'],
icon: '客户零件'
}
}
},
]
}

4
vue/src/router/modules/fisprint.js

@ -21,7 +21,7 @@ const pgfisPrint = {
component: () => import('@/views/pg-fis/basedate/m100Online/normalPritIndex.vue'),
name: 'pg-M100Online',//命名路由
meta: {
title: '日常打印M100信息',
title: '日常打印E001信息',
//roles: ['SettleAccount.Reports'],
icon: '客户零件'
}
@ -31,7 +31,7 @@ const pgfisPrint = {
component: () => import('@/views/pg-fis/basedate/select'),
name: 'select',//命名路由
meta: {
title: 'M100查询',
title: 'E001查询',
//roles: ['SettleAccount.Reports'],
icon: '结算对比'
}

2
vue/src/settings.js

@ -1,5 +1,5 @@
module.exports = {
title: '长春派格汽车塑料技术有限公司结算管理系统',
title: '长春派格汽车塑料技术有限公司FIS准时化排序系统',
/**
* @type {boolean} true | false

6
vue/src/views/login/index.vue

@ -2,8 +2,8 @@
<div class="wrapper">
<div class="left">
<div class="container"><span class="one">SAS/JIT-长春派格汽车塑料技术有限公司结算管理系统</span><span class="two"></span></div>
<!-- <div class="container"><span class="one">SAS/JIT-长春派格汽车塑料技术有限公司结算管理系统</span><span class="two"></span></div> -->
<div class="container"><span class="one">长春派格汽车塑料技术有限公司FIS准时化排序系统</span><span class="two"></span></div>
<!-- <div class="container"><span class="one">闻荫科技-长春派格结算管理系统</span><span class="two"></span></div> -->
<div class="left-pic"/>
@ -12,7 +12,7 @@
长春市闻荫科技
<a
target="_blank"
href="http://www.ccwin-in.com">©2021 闻荫科技-长春派格结算管理系统</a>
href="http://www.ccwin-in.com">©2021 闻荫科技-长春派格汽车塑料技术有限公司FIS准时化排序系统</a>
</div>
</div>
</div>

317
vue/src/views/pg-fis/basedate/SAPItemConfig/index.vue

@ -0,0 +1,317 @@
<!--零件匹配关系页-->
<template>
<div class="cr-body-content">
<div ref="box">
<flexbox class="content-header">
<el-form
:model="listQuery"
ref="queryForm"
v-show="showSearch"
:inline="true"
>
<el-form-item label="物料号:" prop="MaterialNum">
<el-input
v-model="listQuery.MaterialNum"
clearable
size="small"
placeholder=""
style="width: 200px"
class="search-container"
@keyup.enter.native="handleFilter"
/>
</el-form-item>
<el-form-item label="物料描述:" prop="MaterialDescription">
<el-input
v-model="listQuery.MaterialDescription"
clearable
size="small"
placeholder=""
style="width: 200px"
class="search-container"
@keyup.enter.native="handleFilter"
/>
</el-form-item>
<el-form-item label="物料组:" prop="MaterialGroup">
<el-input
v-model="listQuery.MaterialGroup"
clearable
size="small"
placeholder=""
style="width: 200px"
class="search-container"
@keyup.enter.native="handleFilter"
/>
</el-form-item>
<el-form-item>
<el-button
size="mini"
type="success"
icon="el-icon-search"
@click="handleFilter"
>搜索
</el-button>
</el-form-item>
<el-form-item>
<el-button
icon="el-icon-refresh"
size="mini"
@click="resetQuery('queryForm')"
>重置
</el-button>
</el-form-item>
<el-form-item>
<el-button
class="filter-item"
plain
size="mini"
type="warning"
icon="el-icon-bottom"
@click="handleDownload()"
>导出Excel
</el-button>
</el-form-item>
</el-form>
</flexbox>
</div>
<!--表格渲染-->
<el-table
ref="multipleTable"
v-loading="listLoading"
element-loading-text="拼命加载中..."
element-loading-spinner="el-icon-loading"
class="cr-table"
:data="list"
:height="tableHeight"
size="small"
stripe
border
highlight-current-row
style="width: 100%"
@sort-change="sortChange"
@selection-change="handleSelectionChange"
@row-click="handleRowClick"
>
<!-- <el-table-column type="selection" width="44px"></el-table-column> -->
<!-- <el-table-column
label="版本"
prop="version"
sortable="custom"
align="center"
width="100px"
>fixed 默认固定在左边
<template slot-scope="scope">
<el-tooltip :content="scope.row.version" placement="top">
<span class="link-type">{{ scope.row.version }}</span>
</el-tooltip>
</template>
</el-table-column> -->
<!-- show-overflow-tooltip -->
<el-table-column
v-for="(item, index) in getDefaultField"
:key="index"
:prop="item.prop"
:label="item.label"
:min-width="item.width"
:formatter="fieldFormatter"
sortable="custom"
:gutter="0"
>
<template slot="header" slot-scope="scope">
{{ scope.column.label }}
</template>
</el-table-column>
</el-table>
<div class="table-footer">
<!-- 分页控件 style="margin-top: -25px;margin-bottom:-25px;float:right;"-->
<pagination
v-show="totalCount > 0"
:total="totalCount"
:page.sync="page"
:limit.sync="listQuery.MaxResultCount"
@pagination="getList"
/>
</div>
</div>
</template>
<script>
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
import permission from "@/directive/permission/index.js";
import CRMTableHead from "../../components/CRMTableHead";
import moment from "moment";
import Lockr from "lockr";
import { downloadFile } from "@/utils/crmindex.js";
import XhJSSelect from "@/components/CreateCom/Xh-JS-Select-Label.vue";
export default {
name: "SAPItemConfig",
components: { Pagination, CRMTableHead, XhJSSelect },
directives: { permission },
data() {
return {
list: null,
totalCount: 0,
listLoading: true,
listQuery: {
SkipCount: 0,
MaxResultCount: 15,
MaterialNum:null,
MaterialDescription:null,
MaterialGroup:null,
MaterialType:3,
},
showSearch: true,
page: 1,
multipleSelection: [],
tableHeight: document.documentElement.clientHeight - 260,
sortState:false, //
partType1Query:{
dicTypeName:"客户零件类型1",
},
partType2Query:{
dicTypeName:"客户零件类型2",
},
};
},
mounted() {
this.$nextTick(() => {
var offsetHei = document.documentElement.clientHeight;
let boxH = this.$refs.box.offsetHeight;
this.tableHeight = offsetHei - boxH - 57 - 79;//57footer79
});
},
created() {
this.getList();
},
computed: {
/** 列表字段 */
getDefaultField() {
var tempsTabs = [
{ label: "物料号", prop: "materialNum",width: 160 },
{ label: "物料描述", prop: "materialDescription",width: 180 },
{ label: "大小量纲", prop: "materialDescription2",width: 160 },
{ label: "补充备注", prop: "materialMemo",width: 160 },
{ label: "物料组", prop: "materialGroup",width: 160 },
];
return tempsTabs;
},
},
methods: {
/** 格式化字段 */
fieldFormatter(row, column) {
/* if (column.property === "state") {
return { 0: "其他", 2: "已结" }[row[column.property]];
}*/
return row[column.property] || "--";
},
//
async handleDownload() {
this.listLoading = true;
this.$axios
.posts(
"/api/newjit/material/export",
this.listQuery
)
.then((res) => {
let filename = res.item;
this.$axios
.BolbGets("/api/newjit/exclude-part-cfg/download/" + filename)
.then((response) => {
if (filename.indexOf("_") != -1) {
let downName =
filename.slice(0, filename.lastIndexOf("_")) +
filename.slice(filename.lastIndexOf("."));
downloadFile(response, downName);
this.$notify({
title: "成功",
message: "数据-导出成功!",
type: "success",
duration: 2000,
});
} else {
downloadFile(response, filename);
this.$notify({
title: "成功",
message: "数据-导出成功!",
type: "success",
duration: 2000,
});
}
this.listLoading = false;
});
});
},
getList() {
this.listLoading = true;
this.listQuery.SkipCount = (this.page - 1) * 10;
this.$axios
.gets(
"/api/newjit/material/list",
this.listQuery
)
.then((response) => {
this.list = response.items;
this.totalCount = response.totalCount;
setTimeout(() => {
//
this.listLoading = false;
}, 500);
})
.catch(() => {
this.listLoading = false;
});
},
/** 筛选操作 */
handleFilter() {
this.page = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery(refName) {
this.$refs[refName].resetFields();
this.handleFilter();
},
sortChange(data) {
const { prop, order } = data;
if (!prop || !order) {
this.handleFilter();
return;
}
this.listQuery.Sorting = prop + " " + order;
if(this.listQuery.Filters.length>0 && this.listQuery.Filters[0].column === "Enabled")
{
this.sortState = false;
}
else
{
this.sortState = true;
}
this.handleFilter();
},
handleSelectionChange(val) {
this.multipleSelection = val;
},
handleRowClick(row, column, event) {
this.$refs.multipleTable.clearSelection();
this.$refs.multipleTable.toggleRowSelection(row);
},
},
};
</script>
<style lang="scss" scoped>
@import "../../../pg-fis/styles/crmtable.scss";
</style>
<style lang="scss">
.el-table .cell.el-tooltip {
white-space: pre-wrap;
}
</style>

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save