学 赵
1 year ago
33 changed files with 5419 additions and 226 deletions
@ -1,7 +1,8 @@ |
|||||
import './style.css'; |
import './style.css'; |
||||
|
|
||||
import { createApp } from 'vue'; |
import { createApp } from 'vue'; |
||||
|
import VXETable from 'vxe-table'; |
||||
|
|
||||
import App from './App.vue'; |
import App from './App.vue'; |
||||
|
|
||||
createApp(App).mount('#app'); |
createApp(App).use(VXETable).mount('#app'); |
||||
|
@ -0,0 +1,38 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using Microsoft.AspNetCore.Authorization; |
||||
|
using Microsoft.AspNetCore.Mvc; |
||||
|
using SettleAccount.Domain.BQ; |
||||
|
using Win.Sfs.SettleAccount.EntityFrameworkCore; |
||||
|
using Win.Sfs.Shared.RepositoryBase; |
||||
|
|
||||
|
namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 备件发运同步
|
||||
|
/// </summary>
|
||||
|
[AllowAnonymous] |
||||
|
[Route("api/settleaccount/[controller]/[action]")]
|
||||
|
public class BeiSeSyncAppService : JitSeSyncAppService |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 构造
|
||||
|
/// </summary>
|
||||
|
public BeiSeSyncAppService( |
||||
|
WMSBJBMPTDbContext wmsBJBMPTContext, |
||||
|
INormalEfCoreRepository<SyncPositionFlag, Guid> syncPositionFlagRepository, |
||||
|
INormalEfCoreRepository<PUB_SE_DETAIL, Guid> pubSeDetailRepository |
||||
|
) : base(wmsBJBMPTContext, syncPositionFlagRepository, pubSeDetailRepository) |
||||
|
{ |
||||
|
base.SeSyncConfigInfo = new SeSyncConfig() |
||||
|
{ |
||||
|
SyncTableName = "BeiSeSync", |
||||
|
SyncDeliverBillType = EnumDeliverBjBmpBillType.北汽4S备件, |
||||
|
SyncDeliverSubBillTypes = new List<EnumDeliverSubBillType> |
||||
|
{ |
||||
|
EnumDeliverSubBillType.无 |
||||
|
}, |
||||
|
BusinessType = EnumBusinessType.BeiJian |
||||
|
}; |
||||
|
} |
||||
|
} |
@ -0,0 +1,97 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Linq; |
||||
|
using System.Linq.Expressions; |
||||
|
using System.Threading.Tasks; |
||||
|
using Coravel.Invocable; |
||||
|
using Microsoft.AspNetCore.Mvc; |
||||
|
using SettleAccount.Domain.BQ; |
||||
|
using Volo.Abp.Application.Services; |
||||
|
using Win.Sfs.SettleAccount.EntityFrameworkCore; |
||||
|
using Win.Sfs.Shared.RepositoryBase; |
||||
|
|
||||
|
namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// Jit发运数据同步
|
||||
|
/// </summary>
|
||||
|
[ApiExplorerSettings(IgnoreApi = true)] |
||||
|
public class JitSeSyncAppService : ApplicationService, IInvocable |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// WMS数据上下文
|
||||
|
/// </summary>
|
||||
|
private readonly WMSBJBMPTDbContext _wmsBJBMPTContext; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 同步位置标记
|
||||
|
/// </summary>
|
||||
|
private readonly INormalEfCoreRepository<SyncPositionFlag, Guid> _syncPositionFlagRepository; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// Jit发运数据仓储
|
||||
|
/// </summary>
|
||||
|
private readonly INormalEfCoreRepository<PUB_SE_DETAIL, Guid> _pubSeDetailRepository; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 构造
|
||||
|
/// </summary>
|
||||
|
public JitSeSyncAppService( |
||||
|
WMSBJBMPTDbContext wmsBJBMPTContext, |
||||
|
INormalEfCoreRepository<SyncPositionFlag, Guid> syncPositionFlagRepository, |
||||
|
INormalEfCoreRepository<PUB_SE_DETAIL, Guid> pubSeDetailRepository) |
||||
|
{ |
||||
|
_wmsBJBMPTContext = wmsBJBMPTContext; |
||||
|
_syncPositionFlagRepository = syncPositionFlagRepository; |
||||
|
_pubSeDetailRepository = pubSeDetailRepository; |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 发运同步配置
|
||||
|
/// </summary>
|
||||
|
public SeSyncConfig SeSyncConfigInfo { get; set; } |
||||
|
|
||||
|
[HttpPost] |
||||
|
public async Task Invoke() |
||||
|
{ |
||||
|
//同步表名称
|
||||
|
var syncTableName = SeSyncConfigInfo.SyncTableName; |
||||
|
//同步发运主类型
|
||||
|
var deliverBillType = SeSyncConfigInfo.SyncDeliverBillType; |
||||
|
//同步发运子类型
|
||||
|
var deliverSubBillTypes = SeSyncConfigInfo.SyncDeliverSubBillTypes; |
||||
|
//业务类别
|
||||
|
var businessType = SeSyncConfigInfo.BusinessType; |
||||
|
|
||||
|
Expression<Func<TM_BJBMPT_OTHER_RECORD, bool>> predicate = (t) => t.DeliverBillType == deliverBillType && (!deliverSubBillTypes.Any() || deliverSubBillTypes.Contains(t.DeliverSubBillType)); |
||||
|
var syncPositionFlag = await _syncPositionFlagRepository.FindAsync(t => t.TableName == syncTableName); |
||||
|
if (syncPositionFlag != null) |
||||
|
{ |
||||
|
predicate = (t) => t.DeliverBillType == deliverBillType && t.UID > int.Parse(syncPositionFlag.Position) && (!deliverSubBillTypes.Any() || deliverSubBillTypes.Contains(t.DeliverSubBillType)); |
||||
|
} |
||||
|
//WMS发运记录
|
||||
|
var wmsSeRecords = _wmsBJBMPTContext.TM_BJBMPT_OTHER_RECORD.Where(predicate).OrderBy(b => b.UID).ToList(); |
||||
|
|
||||
|
var pubSeDetails = ObjectMapper.Map<List<TM_BJBMPT_OTHER_RECORD>, List<PUB_SE_DETAIL>>(wmsSeRecords); |
||||
|
if (pubSeDetails.Any()) |
||||
|
{ |
||||
|
pubSeDetails.ForEach(t => t.BusinessType = businessType); |
||||
|
await _pubSeDetailRepository.InsertManyAsync(pubSeDetails); |
||||
|
|
||||
|
if (syncPositionFlag != null) |
||||
|
{ |
||||
|
syncPositionFlag.Position = wmsSeRecords.Last().UID.ToString(); |
||||
|
await _syncPositionFlagRepository.UpdateAsync(syncPositionFlag); |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
syncPositionFlag = new SyncPositionFlag() |
||||
|
{ |
||||
|
TableName = syncTableName, |
||||
|
Position = wmsSeRecords.Last().UID.ToString() |
||||
|
}; |
||||
|
await _syncPositionFlagRepository.InsertAsync(syncPositionFlag); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
@ -0,0 +1,38 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using Microsoft.AspNetCore.Authorization; |
||||
|
using Microsoft.AspNetCore.Mvc; |
||||
|
using SettleAccount.Domain.BQ; |
||||
|
using Win.Sfs.SettleAccount.EntityFrameworkCore; |
||||
|
using Win.Sfs.Shared.RepositoryBase; |
||||
|
|
||||
|
namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 印度件发运同步
|
||||
|
/// </summary>
|
||||
|
[AllowAnonymous] |
||||
|
[Route("api/settleaccount/[controller]/[action]")]
|
||||
|
public class YinDuSeSyncAppService : JitSeSyncAppService |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 构造
|
||||
|
/// </summary>
|
||||
|
public YinDuSeSyncAppService( |
||||
|
WMSBJBMPTDbContext wmsBJBMPTContext, |
||||
|
INormalEfCoreRepository<SyncPositionFlag, Guid> syncPositionFlagRepository, |
||||
|
INormalEfCoreRepository<PUB_SE_DETAIL, Guid> pubSeDetailRepository |
||||
|
) : base(wmsBJBMPTContext, syncPositionFlagRepository, pubSeDetailRepository) |
||||
|
{ |
||||
|
base.SeSyncConfigInfo = new SeSyncConfig() |
||||
|
{ |
||||
|
SyncTableName = "YinDuSeSync", |
||||
|
SyncDeliverBillType = EnumDeliverBjBmpBillType.印度件, |
||||
|
SyncDeliverSubBillTypes = new List<EnumDeliverSubBillType> |
||||
|
{ |
||||
|
EnumDeliverSubBillType.无 |
||||
|
}, |
||||
|
BusinessType = EnumBusinessType.YinDuJian |
||||
|
}; |
||||
|
} |
||||
|
} |
@ -0,0 +1,38 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using Microsoft.AspNetCore.Authorization; |
||||
|
using Microsoft.AspNetCore.Mvc; |
||||
|
using SettleAccount.Domain.BQ; |
||||
|
using Win.Sfs.SettleAccount.EntityFrameworkCore; |
||||
|
using Win.Sfs.Shared.RepositoryBase; |
||||
|
|
||||
|
namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 直供件HBPO发运同步
|
||||
|
/// </summary>
|
||||
|
[AllowAnonymous] |
||||
|
[Route("api/settleaccount/[controller]/[action]")]
|
||||
|
public class ZhiGongHBPOSeSyncAppService : JitSeSyncAppService |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 构造
|
||||
|
/// </summary>
|
||||
|
public ZhiGongHBPOSeSyncAppService( |
||||
|
WMSBJBMPTDbContext wmsBJBMPTContext, |
||||
|
INormalEfCoreRepository<SyncPositionFlag, Guid> syncPositionFlagRepository, |
||||
|
INormalEfCoreRepository<PUB_SE_DETAIL, Guid> pubSeDetailRepository |
||||
|
) : base(wmsBJBMPTContext, syncPositionFlagRepository, pubSeDetailRepository) |
||||
|
{ |
||||
|
base.SeSyncConfigInfo = new SeSyncConfig() |
||||
|
{ |
||||
|
SyncTableName = "ZhiGongHBPOSeSync", |
||||
|
SyncDeliverBillType = EnumDeliverBjBmpBillType.JIT直供件, |
||||
|
SyncDeliverSubBillTypes = new List<EnumDeliverSubBillType> |
||||
|
{ |
||||
|
EnumDeliverSubBillType.JIT直供件HBPO |
||||
|
}, |
||||
|
BusinessType = EnumBusinessType.ZhiGongJianHBPO |
||||
|
}; |
||||
|
} |
||||
|
} |
@ -1,6 +1,8 @@ |
|||||
|
using System.Threading.Tasks; |
||||
|
|
||||
namespace Win.Sfs.SettleAccount.Entities.BQ.Vmi; |
namespace Win.Sfs.SettleAccount.Entities.BQ.Vmi; |
||||
|
|
||||
public interface IJobService |
public interface IJobService |
||||
{ |
{ |
||||
void Invoke(); |
Task Invoke(); |
||||
} |
} |
||||
|
@ -1,76 +1,63 @@ |
|||||
using System.ComponentModel.DataAnnotations; |
using System.ComponentModel.DataAnnotations; |
||||
|
|
||||
namespace Win.Sfs.SettleAccount |
namespace Win.Sfs.SettleAccount; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 业务类别
|
||||
|
/// </summary>
|
||||
|
public enum EnumBusinessType |
||||
{ |
{ |
||||
/// <summary>
|
/// <summary>
|
||||
/// 业务类别
|
/// 未定义
|
||||
/// </summary>
|
/// </summary>
|
||||
public enum EnumBusinessType |
[Display(Name = "未定义")] |
||||
{ |
None = 0, |
||||
/// <summary>
|
|
||||
/// 未定义
|
|
||||
/// </summary>
|
|
||||
[Display(Name = "未定义")] |
|
||||
None = 0, |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// JisBBAC
|
|
||||
/// </summary>
|
|
||||
[Display(Name = "JisBBAC")] |
|
||||
JisBBAC = 1, |
|
||||
|
|
||||
/// <summary>
|
|
||||
/// JisHBPO
|
|
||||
/// </summary>
|
|
||||
[Display(Name = "JisHBPO")] |
|
||||
JisHBPO = 2, |
|
||||
|
|
||||
/// <summary>
|
/// <summary>
|
||||
/// 直供件BBAC
|
/// JisBBAC
|
||||
/// </summary>
|
/// </summary>
|
||||
[Display(Name = "直供件BBAC")] |
[Display(Name = "JisBBAC")] |
||||
ZhiGongJianBBAC = 3, |
JisBBAC = 1, |
||||
|
|
||||
/// <summary>
|
/// <summary>
|
||||
/// 直供件HBPO
|
/// JisHBPO
|
||||
/// </summary>
|
/// </summary>
|
||||
[Display(Name = "直供件HBPO")] |
[Display(Name = "JisHBPO")] |
||||
ZhiGongJianHBPO = 4, |
JisHBPO = 2, |
||||
|
|
||||
/// <summary>
|
/// <summary>
|
||||
/// 买单件BBAC
|
/// 直供件BBAC
|
||||
/// </summary>
|
/// </summary>
|
||||
[Display(Name = "买单件BBAC")] |
[Display(Name = "直供件BBAC")] |
||||
MaiDanJianBBAC = 5, |
ZhiGongJianBBAC = 3, |
||||
|
|
||||
/// <summary>
|
/// <summary>
|
||||
/// 买单件HBPO
|
/// 直供件HBPO
|
||||
/// </summary>
|
/// </summary>
|
||||
[Display(Name = "买单件HBPO")] |
[Display(Name = "直供件HBPO")] |
||||
MaiDanJianHBPO = 6, |
ZhiGongJianHBPO = 4, |
||||
|
|
||||
/// <summary>
|
/// <summary>
|
||||
/// 备件
|
/// 买单件BBAC
|
||||
/// </summary>
|
/// </summary>
|
||||
[Display(Name = "备件")] |
[Display(Name = "买单件BBAC")] |
||||
BeiJian = 7, |
MaiDanJianBBAC = 5, |
||||
|
|
||||
/// <summary>
|
/// <summary>
|
||||
/// 印度件
|
/// 买单件HBPO
|
||||
/// </summary>
|
/// </summary>
|
||||
[Display(Name = "印度件")] |
[Display(Name = "买单件HBPO")] |
||||
YingDuJian = 8, |
MaiDanJianHBPO = 6, |
||||
|
|
||||
///// <summary>
|
/// <summary>
|
||||
/////
|
/// 备件
|
||||
///// </summary>
|
/// </summary>
|
||||
//[Display(Name = "HBPO-JIS")]
|
[Display(Name = "备件")] |
||||
//HBPO = 5,
|
BeiJian = 7, |
||||
|
|
||||
///// <summary>
|
/// <summary>
|
||||
///// 印度件
|
/// 印度件
|
||||
///// </summary>
|
/// </summary>
|
||||
//[Display(Name = "BBAC-JIS")]
|
[Display(Name = "印度件")] |
||||
//BBAC = 6
|
YinDuJian = 8 |
||||
} |
|
||||
} |
} |
||||
|
File diff suppressed because it is too large
@ -0,0 +1,56 @@ |
|||||
|
using System; |
||||
|
using Microsoft.EntityFrameworkCore.Migrations; |
||||
|
|
||||
|
namespace Win.Sfs.SettleAccount.Migrations |
||||
|
{ |
||||
|
public partial class vmi6 : Migration |
||||
|
{ |
||||
|
protected override void Up(MigrationBuilder migrationBuilder) |
||||
|
{ |
||||
|
migrationBuilder.AlterColumn<DateTime>( |
||||
|
name: "End", |
||||
|
table: "Set_JobLog", |
||||
|
type: "datetime2", |
||||
|
nullable: true, |
||||
|
oldClrType: typeof(DateTime), |
||||
|
oldType: "datetime2"); |
||||
|
|
||||
|
migrationBuilder.AddColumn<string>( |
||||
|
name: "Host", |
||||
|
table: "Set_JobLog", |
||||
|
type: "nvarchar(max)", |
||||
|
nullable: true); |
||||
|
|
||||
|
migrationBuilder.UpdateData( |
||||
|
table: "Set_JobItem", |
||||
|
keyColumn: "Id", |
||||
|
keyValue: new Guid("ef3d8e8a-a88e-ca1f-e615-714c6bc48824"), |
||||
|
column: "Service", |
||||
|
value: "Win.Sfs.SettleAccount.Entities.BQ.VmiAppService"); |
||||
|
} |
||||
|
|
||||
|
protected override void Down(MigrationBuilder migrationBuilder) |
||||
|
{ |
||||
|
migrationBuilder.DropColumn( |
||||
|
name: "Host", |
||||
|
table: "Set_JobLog"); |
||||
|
|
||||
|
migrationBuilder.AlterColumn<DateTime>( |
||||
|
name: "End", |
||||
|
table: "Set_JobLog", |
||||
|
type: "datetime2", |
||||
|
nullable: false, |
||||
|
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), |
||||
|
oldClrType: typeof(DateTime), |
||||
|
oldType: "datetime2", |
||||
|
oldNullable: true); |
||||
|
|
||||
|
migrationBuilder.UpdateData( |
||||
|
table: "Set_JobItem", |
||||
|
keyColumn: "Id", |
||||
|
keyValue: new Guid("ef3d8e8a-a88e-ca1f-e615-714c6bc48824"), |
||||
|
column: "Service", |
||||
|
value: "Win.Sfs.SettleAccount.Entities.BQ.VmiService"); |
||||
|
} |
||||
|
} |
||||
|
} |
Loading…
Reference in new issue