Compare commits
56 Commits
Author | SHA1 | Date |
---|---|---|
liuyunfeng | 7fb9f195b9 | 6 months ago |
liuyunfeng | 11cc50a3da | 7 months ago |
liuyunfeng | ea965197bd | 7 months ago |
liuyunfeng | 21c69df191 | 7 months ago |
安虹睿 | affc9ff148 | 7 months ago |
安虹睿 | a0e2ddd494 | 7 months ago |
liuyunfeng | b0a3fba68f | 7 months ago |
安虹睿 | fe67e8e466 | 7 months ago |
安虹睿 | 37b57845c3 | 7 months ago |
安虹睿 | 024f8ef66b | 7 months ago |
安虹睿 | c649b81d42 | 7 months ago |
安虹睿 | db02e83d55 | 7 months ago |
liuyunfeng | 9312425ed4 | 7 months ago |
liuyunfeng | 5d3b517c43 | 7 months ago |
liuyunfeng | 9195f1ca22 | 7 months ago |
liuyunfeng | ac9a1ada55 | 7 months ago |
安虹睿 | f423d71a7c | 7 months ago |
liuyunfeng | 04ff49a2f8 | 10 months ago |
安虹睿 | 6f6623a1d4 | 10 months ago |
安虹睿 | cb6b565fb7 | 10 months ago |
安虹睿 | c4261cce92 | 10 months ago |
安虹睿 | 6580fd9440 | 10 months ago |
liuyunfeng | c4679816a9 | 10 months ago |
liuyunfeng | 8c4b13e190 | 10 months ago |
安虹睿 | 0facf74942 | 10 months ago |
安虹睿 | a8d13b6f53 | 10 months ago |
安虹睿 | de5ac5285d | 10 months ago |
lvzb | ed9f48faa6 | 10 months ago |
lvzb | 814f942d0c | 10 months ago |
lvzb | 6767578cc6 | 10 months ago |
lvzb | 5176d63ddf | 10 months ago |
安虹睿 | cc319f4be9 | 10 months ago |
安虹睿 | af0ebb512d | 10 months ago |
liuyunfeng | 9c95697be9 | 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 | 10 months ago |
lvzb | 2887117563 | 10 months ago |
liuyunfeng | 73cfc90d97 | 10 months ago |
liuyunfeng | 9a2b97aa7c | 10 months ago |
安虹睿 | 8f47014ff8 | 11 months ago |
安虹睿 | be7c11f251 | 11 months ago |
安虹睿 | 2a677a0a2f | 11 months ago |
安虹睿 | 24a1753366 | 11 months ago |
lvzb | 5907e39946 | 11 months ago |
lvzb | 5eea910a74 | 11 months ago |
lvzb | 08071e6e4b | 11 months ago |
lvzb | 4a7cad660b | 11 months ago |
liuyunfeng | 5061147c98 | 11 months ago |
liuyunfeng | cdda6c33bb | 11 months ago |
liuyunfeng | 428f65d5b1 | 11 months ago |
114 changed files with 31569 additions and 2880 deletions
@ -0,0 +1,6 @@ |
|||||
|
{ |
||||
|
"name": "FIS1.5", |
||||
|
"lockfileVersion": 2, |
||||
|
"requires": true, |
||||
|
"packages": {} |
||||
|
} |
@ -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; } |
||||
|
} |
||||
|
} |
@ -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; } |
||||
|
} |
||||
|
} |
@ -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; } |
||||
|
} |
||||
|
} |
@ -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; } |
||||
|
} |
||||
|
} |
@ -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; } |
||||
|
|
||||
|
} |
||||
|
} |
@ -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
|
||||
|
} |
||||
|
|
||||
|
} |
@ -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; } |
||||
|
} |
||||
|
} |
@ -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; } |
||||
|
} |
||||
|
} |
@ -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; } |
||||
|
} |
||||
|
} |
@ -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; } |
||||
|
} |
||||
|
} |
@ -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); |
||||
|
} |
||||
|
} |
@ -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; } |
||||
|
} |
||||
|
} |
@ -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; } |
||||
|
} |
||||
|
} |
@ -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); |
||||
|
} |
||||
|
} |
@ -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
|
||||
|
} |
||||
|
} |
@ -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
|
||||
|
} |
||||
|
} |
@ -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); |
||||
|
} |
||||
|
} |
@ -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
|
||||
|
} |
||||
|
} |
@ -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; } |
||||
|
|
||||
|
} |
||||
|
} |
@ -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; } |
||||
|
|
||||
|
} |
||||
|
} |
@ -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) |
||||
|
{ |
||||
|
} |
||||
|
} |
||||
|
} |
@ -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); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
|
||||
|
} |
||||
|
} |
@ -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
|
||||
|
} |
||||
|
} |
@ -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; |
||||
|
} |
||||
|
} |
||||
|
} |
@ -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); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
} |
@ -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; } |
||||
|
} |
||||
|
} |
@ -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; |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
} |
@ -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);
|
|
||||
} |
|
||||
} |
|
||||
} |
|
@ -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); |
|
||||
} |
|
||||
} |
|
||||
} |
|
File diff suppressed because it is too large
File diff suppressed because it is too large
File diff suppressed because it is too large
@ -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"); |
||||
|
} |
||||
|
} |
||||
|
} |
File diff suppressed because it is too large
@ -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"); |
||||
|
} |
||||
|
} |
||||
|
} |
File diff suppressed because it is too large
@ -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); |
||||
|
} |
||||
|
} |
||||
|
} |
File diff suppressed because it is too large
@ -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"); |
||||
|
} |
||||
|
} |
||||
|
} |
File diff suppressed because it is too large
@ -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'
|
@ -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> |
@ -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;//57为footer高度,79为页面上部标签高度 |
||||
|
}); |
||||
|
}, |
||||
|
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…
Reference in new issue