学 赵
2 years ago
50 changed files with 17010 additions and 378 deletions
@ -0,0 +1,101 @@ |
|||||
|
const schema = { |
||||
|
title: "定时任务", |
||||
|
type: "object", |
||||
|
properties: { |
||||
|
isDisabled: { |
||||
|
title: "是否禁用", |
||||
|
type: "boolean", |
||||
|
}, |
||||
|
name: { |
||||
|
title: "名称", |
||||
|
type: "string", |
||||
|
}, |
||||
|
cron: { |
||||
|
title: "表达式", |
||||
|
type: "string", |
||||
|
}, |
||||
|
service: { |
||||
|
title: "服务", |
||||
|
type: "string", |
||||
|
}, |
||||
|
isRunning: { |
||||
|
title: "运行中", |
||||
|
type: "boolean", |
||||
|
readOnly: true, |
||||
|
}, |
||||
|
}, |
||||
|
}; |
||||
|
|
||||
|
const queryUrl = "settleaccount/job-item/get-list"; |
||||
|
const createUrl = "settleaccount/job-item/create"; |
||||
|
const updateUrl = "settleaccount/job-item/update/%s"; |
||||
|
const deleteUrl = "settleaccount/job-item/delete-list"; |
||||
|
const detailsUrl = "settleaccount/job-item/details/%s"; |
||||
|
const queryMethod = "POST"; |
||||
|
const createMethod = "POST"; |
||||
|
const updateMethod = "POST"; |
||||
|
const deleteMethod = "POST"; |
||||
|
const detailsMethod = "POST"; |
||||
|
|
||||
|
export default function () { |
||||
|
return { |
||||
|
query: { |
||||
|
url: queryUrl, |
||||
|
method: queryMethod, |
||||
|
schema: { |
||||
|
title: "定时任务", |
||||
|
type: "object", |
||||
|
properties: { |
||||
|
filters: { |
||||
|
type: "array", |
||||
|
hidden: true, |
||||
|
items: { |
||||
|
type: "object", |
||||
|
properties: { |
||||
|
logic: { |
||||
|
type: "int", |
||||
|
}, |
||||
|
column: { |
||||
|
type: "string", |
||||
|
}, |
||||
|
action: { |
||||
|
type: "int", |
||||
|
}, |
||||
|
value: { |
||||
|
type: "string", |
||||
|
}, |
||||
|
}, |
||||
|
}, |
||||
|
default: [], |
||||
|
}, |
||||
|
skipCount: { |
||||
|
hidden: true, |
||||
|
default: 0, |
||||
|
}, |
||||
|
maxResultCount: { |
||||
|
hidden: true, |
||||
|
default: 10, |
||||
|
}, |
||||
|
sorting: { |
||||
|
hidden: true, |
||||
|
}, |
||||
|
}, |
||||
|
}, |
||||
|
}, |
||||
|
table: { |
||||
|
schema: schema, |
||||
|
}, |
||||
|
|
||||
|
edit: { |
||||
|
createUrl, |
||||
|
updateUrl, |
||||
|
deleteUrl, |
||||
|
detailsUrl, |
||||
|
createMethod, |
||||
|
updateMethod, |
||||
|
deleteMethod, |
||||
|
detailsMethod, |
||||
|
schema: schema, |
||||
|
}, |
||||
|
}; |
||||
|
} |
@ -0,0 +1,92 @@ |
|||||
|
const schema = { |
||||
|
title: "定时任务", |
||||
|
type: "object", |
||||
|
properties: { |
||||
|
start: { |
||||
|
title: "开始", |
||||
|
type: "string", |
||||
|
input: "datetime", |
||||
|
}, |
||||
|
end: { |
||||
|
title: "结束", |
||||
|
type: "string", |
||||
|
input: "datetime", |
||||
|
}, |
||||
|
|
||||
|
success: { |
||||
|
title: "成功", |
||||
|
type: "boolean", |
||||
|
}, |
||||
|
exception: { |
||||
|
title: "异常", |
||||
|
type: "string", |
||||
|
}, |
||||
|
}, |
||||
|
}; |
||||
|
|
||||
|
const queryUrl = "settleaccount/job-log/get-list"; |
||||
|
const queryMethod = "POST"; |
||||
|
|
||||
|
export default function () { |
||||
|
return { |
||||
|
query: { |
||||
|
url: queryUrl, |
||||
|
method: queryMethod, |
||||
|
schema: { |
||||
|
title: "定时任务", |
||||
|
type: "object", |
||||
|
properties: { |
||||
|
filters: { |
||||
|
type: "array", |
||||
|
hidden: true, |
||||
|
items: { |
||||
|
type: "object", |
||||
|
properties: { |
||||
|
logic: { |
||||
|
type: "int", |
||||
|
}, |
||||
|
column: { |
||||
|
type: "string", |
||||
|
}, |
||||
|
action: { |
||||
|
type: "int", |
||||
|
}, |
||||
|
value: { |
||||
|
type: "string", |
||||
|
}, |
||||
|
}, |
||||
|
}, |
||||
|
default: [ |
||||
|
{ |
||||
|
logic: "and", |
||||
|
column: "jobId", |
||||
|
action: "equal", |
||||
|
value: null, |
||||
|
readOnly: true, |
||||
|
hidden: true, |
||||
|
}, |
||||
|
], |
||||
|
}, |
||||
|
skipCount: { |
||||
|
hidden: true, |
||||
|
default: 0, |
||||
|
}, |
||||
|
maxResultCount: { |
||||
|
hidden: true, |
||||
|
default: 10, |
||||
|
}, |
||||
|
sorting: { |
||||
|
hidden: true, |
||||
|
}, |
||||
|
}, |
||||
|
}, |
||||
|
}, |
||||
|
table: { |
||||
|
schema: schema, |
||||
|
}, |
||||
|
|
||||
|
edit: { |
||||
|
schema: schema, |
||||
|
}, |
||||
|
}; |
||||
|
} |
@ -0,0 +1,22 @@ |
|||||
|
import AppList from "../../components/list/index.js"; |
||||
|
import html from "html"; |
||||
|
import useConfig from "../../models/job-item.js"; |
||||
|
import { defineAsyncComponent, ref, reactive, onMounted, watch } from "vue"; |
||||
|
import useConfig2 from "../../models/job-log.js"; |
||||
|
|
||||
|
export default { |
||||
|
components: { AppList }, |
||||
|
template: html`<app-list :config="config" @command="onCommand" ref="appListRef" />`, |
||||
|
setup() { |
||||
|
const config = useConfig(); |
||||
|
const appListRef = ref(null); |
||||
|
const onCommand = async (item, rows, showList) => { |
||||
|
console.log(item.path, item, rows); |
||||
|
console.log(showList); |
||||
|
const config = useConfig2(); |
||||
|
// config.query.schema.properties.filters.default[0].value = rows[0].id;
|
||||
|
showList({ jobId: rows[0].id }, "/base-data/job-log", config); |
||||
|
}; |
||||
|
return { config, onCommand }; |
||||
|
}, |
||||
|
}; |
@ -0,0 +1,15 @@ |
|||||
|
import AppList from "../../components/list/index.js"; |
||||
|
import html from "html"; |
||||
|
import useConfig from "../../models/job-log.js"; |
||||
|
|
||||
|
export default { |
||||
|
components: { AppList }, |
||||
|
template: html`<app-list :config="config" @command="onCommand" />`, |
||||
|
setup() { |
||||
|
const config = useConfig(); |
||||
|
const onCommand = async (item, rows) => { |
||||
|
console.log(item.path, item, rows); |
||||
|
}; |
||||
|
return { config, onCommand }; |
||||
|
}, |
||||
|
}; |
@ -0,0 +1,15 @@ |
|||||
|
import AppList from "../../../components/list/index.js"; |
||||
|
import html from "html"; |
||||
|
import useConfig from "../../../models/pub_sa_detail_service.js"; |
||||
|
|
||||
|
export default { |
||||
|
components: { AppList }, |
||||
|
template: html`<app-list :config="config" @command="onCommand" />`, |
||||
|
setup() { |
||||
|
const config = useConfig(); |
||||
|
const onCommand = async (item, rows) => { |
||||
|
console.log(item.path, item, rows); |
||||
|
}; |
||||
|
return { config, onCommand }; |
||||
|
}, |
||||
|
}; |
@ -0,0 +1,15 @@ |
|||||
|
import AppList from "../../../components/list/index.js"; |
||||
|
import html from "html"; |
||||
|
import useConfig from "../../../models/pub_sa_service.js"; |
||||
|
|
||||
|
export default { |
||||
|
components: { AppList }, |
||||
|
template: html`<app-list :config="config" @command="onCommand" />`, |
||||
|
setup() { |
||||
|
const config = useConfig(); |
||||
|
const onCommand = async (item, rows) => { |
||||
|
console.log(item.path, item, rows); |
||||
|
}; |
||||
|
return { config, onCommand }; |
||||
|
}, |
||||
|
}; |
@ -0,0 +1,15 @@ |
|||||
|
import AppList from "../../../components/list/index.js"; |
||||
|
import html from "html"; |
||||
|
import useConfig from "../../../models/pub_se_detail_service.js"; |
||||
|
|
||||
|
export default { |
||||
|
components: { AppList }, |
||||
|
template: html`<app-list :config="config" @command="onCommand" />`, |
||||
|
setup() { |
||||
|
const config = useConfig(); |
||||
|
const onCommand = async (item, rows) => { |
||||
|
console.log(item.path, item, rows); |
||||
|
}; |
||||
|
return { config, onCommand }; |
||||
|
}, |
||||
|
}; |
@ -0,0 +1,143 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Linq; |
||||
|
using System.Linq.Expressions; |
||||
|
using System.Threading.Tasks; |
||||
|
using Coravel.Invocable; |
||||
|
using Microsoft.AspNetCore.Authorization; |
||||
|
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>
|
||||
|
/// HBPO发运数据同步服务
|
||||
|
/// </summary>
|
||||
|
[AllowAnonymous] |
||||
|
[Route("api/settleaccount/[controller]/[action]")]
|
||||
|
public class BBACSeSyncAppService : ApplicationService, IInvocable |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// WMS数据上下文
|
||||
|
/// </summary>
|
||||
|
private readonly WMSBJBMPTDbContext _wmsBJBMPTContext; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 同步位置标记
|
||||
|
/// </summary>
|
||||
|
private readonly INormalEfCoreRepository<SyncPositionFlag, Guid> _syncPositionFlagRepository; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// HBPO发运数据仓储
|
||||
|
/// </summary>
|
||||
|
private readonly INormalEfCoreRepository<BBAC_SE_DETAIL, Guid> _bbacSeDetailRepository; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 构造
|
||||
|
/// </summary>
|
||||
|
public BBACSeSyncAppService( |
||||
|
WMSBJBMPTDbContext wmsBJBMPTContext, |
||||
|
INormalEfCoreRepository<SyncPositionFlag, Guid> syncPositionFlagRepository, |
||||
|
INormalEfCoreRepository<BBAC_SE_DETAIL, Guid> bbacSeDetailRepository) |
||||
|
{ |
||||
|
_wmsBJBMPTContext = wmsBJBMPTContext; |
||||
|
_syncPositionFlagRepository = syncPositionFlagRepository; |
||||
|
_bbacSeDetailRepository = bbacSeDetailRepository; |
||||
|
} |
||||
|
|
||||
|
[HttpPost] |
||||
|
public async Task Invoke() |
||||
|
{ |
||||
|
await SyncJitRecord(); |
||||
|
//await SyncJisRecord();
|
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 同步JitRecord
|
||||
|
/// </summary>
|
||||
|
/// <returns></returns>
|
||||
|
private async Task SyncJitRecord() |
||||
|
{ |
||||
|
//同步表名称
|
||||
|
var syncTableName = "TM_BJBMPT_JIT_RECORD"; |
||||
|
//BBAC类型集合
|
||||
|
var EnumDeliverSubBillTypes = new List<EnumDeliverSubBillType> |
||||
|
{ |
||||
|
EnumDeliverSubBillType.保险杠BBAC, |
||||
|
EnumDeliverSubBillType.买单件保险杠BBAC, |
||||
|
EnumDeliverSubBillType.买单件小件BBAC, |
||||
|
EnumDeliverSubBillType.小件BBAC, |
||||
|
EnumDeliverSubBillType.JIT直供件BBAC |
||||
|
}; |
||||
|
|
||||
|
Expression<Func<TM_BJBMPT_JIT_RECORD, bool>> predicate = (t) => t.DeliverBillType == EnumDeliverBjBmpBillType.JIS件 && EnumDeliverSubBillTypes.Contains(t.DeliverSubBillType); |
||||
|
var syncPositionFlag = await _syncPositionFlagRepository.FindAsync(t => t.TableName == syncTableName); |
||||
|
if (syncPositionFlag != null) |
||||
|
{ |
||||
|
Expression<Func<TM_BJBMPT_JIT_RECORD, bool>> expression = (t) => t.UID > int.Parse(syncPositionFlag.Position); |
||||
|
var body = expression.Body; |
||||
|
predicate = Expression.Lambda<Func<TM_BJBMPT_JIT_RECORD, bool>>(Expression.And(predicate.Body, body), predicate.Parameters); |
||||
|
} |
||||
|
|
||||
|
var jitRecords = _wmsBJBMPTContext.TM_BJBMPT_JIT_RECORD.Where(predicate).OrderBy(b => b.UID).ToList(); |
||||
|
|
||||
|
var bbacSeDetails = ObjectMapper.Map<List<TM_BJBMPT_JIT_RECORD>, List<BBAC_SE_DETAIL>>(jitRecords); |
||||
|
if (bbacSeDetails.Any()) |
||||
|
{ |
||||
|
await _bbacSeDetailRepository.InsertManyAsync(bbacSeDetails); |
||||
|
|
||||
|
if (syncPositionFlag != null) |
||||
|
{ |
||||
|
syncPositionFlag.Position = jitRecords.Last().UID.ToString(); |
||||
|
await _syncPositionFlagRepository.UpdateAsync(syncPositionFlag); |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
syncPositionFlag = new SyncPositionFlag() |
||||
|
{ |
||||
|
TableName = syncTableName, |
||||
|
Position = jitRecords.Last().UID.ToString() |
||||
|
}; |
||||
|
await _syncPositionFlagRepository.InsertAsync(syncPositionFlag); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
private async Task SyncJisRecord() |
||||
|
{ |
||||
|
//同步表名称
|
||||
|
var syncTableName = "TM_BJBMPT_JIS_RECORD"; |
||||
|
Expression<Func<TM_BJBMPT_JIS_RECORD, bool>> predicate = (t) => true; |
||||
|
var syncPositionFlag = await _syncPositionFlagRepository.FindAsync(t => t.TableName == syncTableName); |
||||
|
if (syncPositionFlag != null) |
||||
|
{ |
||||
|
predicate = (t) => t.UID > int.Parse(syncPositionFlag.Position); |
||||
|
} |
||||
|
|
||||
|
var jisRecords = _wmsBJBMPTContext.TM_BJBMPT_JIS_RECORD.Where(predicate).OrderBy(b => b.UID).ToList(); |
||||
|
|
||||
|
var bbacSeDetails = ObjectMapper.Map<List<TM_BJBMPT_JIS_RECORD>, List<BBAC_SE_DETAIL>>(jisRecords); |
||||
|
if (bbacSeDetails.Any()) |
||||
|
{ |
||||
|
await _bbacSeDetailRepository.InsertManyAsync(bbacSeDetails); |
||||
|
|
||||
|
if (syncPositionFlag != null) |
||||
|
{ |
||||
|
syncPositionFlag.Position = jisRecords.Last().UID.ToString(); |
||||
|
await _syncPositionFlagRepository.UpdateAsync(syncPositionFlag); |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
syncPositionFlag = new SyncPositionFlag() |
||||
|
{ |
||||
|
TableName = syncTableName, |
||||
|
Position = jisRecords.Last().UID.ToString() |
||||
|
}; |
||||
|
await _syncPositionFlagRepository.InsertAsync(syncPositionFlag); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
@ -0,0 +1,213 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Linq; |
||||
|
using System.Linq.Expressions; |
||||
|
using System.Threading.Tasks; |
||||
|
using Coravel.Invocable; |
||||
|
using Microsoft.AspNetCore.Authorization; |
||||
|
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>
|
||||
|
/// HBPO发运数据同步服务
|
||||
|
/// </summary>
|
||||
|
[AllowAnonymous] |
||||
|
[Route("api/settleaccount/[controller]/[action]")]
|
||||
|
public class HBPOSeSyncAppService : ApplicationService, IInvocable //IJobService
|
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// WMS数据上下文
|
||||
|
/// </summary>
|
||||
|
private readonly WMSBJBMPTDbContext _wmsBJBMPTContext; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 同步位置标记
|
||||
|
/// </summary>
|
||||
|
private readonly INormalEfCoreRepository<SyncPositionFlag, Guid> _syncPositionFlagRepository; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// HBPO发运数据仓储
|
||||
|
/// </summary>
|
||||
|
private readonly INormalEfCoreRepository<HBPO_SE_DETAIL, Guid> _hbpoSeDetailRepository; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 构造
|
||||
|
/// </summary>
|
||||
|
public HBPOSeSyncAppService( |
||||
|
WMSBJBMPTDbContext wmsBJBMPTContext, |
||||
|
INormalEfCoreRepository<SyncPositionFlag, Guid> syncPositionFlagRepository, |
||||
|
INormalEfCoreRepository<HBPO_SE_DETAIL, Guid> hbpoSeDetailRepository) |
||||
|
{ |
||||
|
_wmsBJBMPTContext = wmsBJBMPTContext; |
||||
|
_syncPositionFlagRepository = syncPositionFlagRepository; |
||||
|
_hbpoSeDetailRepository = hbpoSeDetailRepository; |
||||
|
} |
||||
|
|
||||
|
//private readonly IRepository<TM_BJBMPT_JIT_RECORD> _TMBJBMPTJITRECORDRepository;
|
||||
|
|
||||
|
//public HBPOSeSyncAppService(IRepository<TM_BJBMPT_JIT_RECORD> TMBJBMPTJITRECORDRepository)
|
||||
|
//{
|
||||
|
// _TMBJBMPTJITRECORDRepository = TMBJBMPTJITRECORDRepository;
|
||||
|
//}
|
||||
|
|
||||
|
[HttpPost] |
||||
|
public async Task Invoke() |
||||
|
{ |
||||
|
await SyncJitRecord(); |
||||
|
//await SyncJisRecord();
|
||||
|
//if (!dbContext.GetService<IRelationalDatabaseCreator>().Exists() && dbContext.Database.EnsureCreated())
|
||||
|
//{
|
||||
|
// this._balanceRepository.AsNoTracking().ForEachAsync(o =>
|
||||
|
// {
|
||||
|
// dbContext.Set<VmiBalance>().Add(o);
|
||||
|
// });
|
||||
|
// dbContext.SaveChanges();
|
||||
|
// var snapshot = new VmiSnapshot { Name = date, Path = connectionString };
|
||||
|
// this._snapshotRepository.InsertAsync(snapshot).Wait();
|
||||
|
//}
|
||||
|
|
||||
|
|
||||
|
//using (var context = new HouseDbContext(optionsBuilder.Options))
|
||||
|
//{
|
||||
|
// var one = context.Notices.FirstOrDefault(n => n.Id == notice.Id);
|
||||
|
// // 当然你也可以直接初始化其他的Service
|
||||
|
// var nService = new NoticeService(context, null);
|
||||
|
// var one = nService.FindOne(notice.Id);
|
||||
|
//}
|
||||
|
|
||||
|
|
||||
|
|
||||
|
//var TM_BJBMPT_JIT_RECORDs = _wmsBJBMPTContext.TM_BJBMPT_JIT_RECORD
|
||||
|
// .Where(b => b.UID > 3)
|
||||
|
// .OrderBy(b => b.BillTime)
|
||||
|
// .ToList();
|
||||
|
//foreach (var TM_BJBMPT_JIT_RECORD in TM_BJBMPT_JIT_RECORDs)
|
||||
|
//{
|
||||
|
// Console.WriteLine($"{TM_BJBMPT_JIT_RECORD.UID}");
|
||||
|
//}
|
||||
|
|
||||
|
//using (var db = new WMSBJBMPTDbContext())
|
||||
|
//{
|
||||
|
// var blogs = db.TM_BJBMPT_JIT_RECORD
|
||||
|
// .Where(b => b.UID > 3)
|
||||
|
// .OrderBy(b => b.BillTime)
|
||||
|
// .ToList();
|
||||
|
|
||||
|
// foreach (var blog in blogs)
|
||||
|
// {
|
||||
|
// Console.WriteLine($"{blog.UID}");
|
||||
|
// }
|
||||
|
//}
|
||||
|
Console.WriteLine($"{GetType().FullName}执行了"); |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 同步JitRecord
|
||||
|
/// </summary>
|
||||
|
/// <returns></returns>
|
||||
|
private async Task SyncJitRecord() |
||||
|
{ |
||||
|
//同步表名称
|
||||
|
var syncTableName = "TM_BJBMPT_JIT_RECORD"; |
||||
|
//HBPO类型集合
|
||||
|
var EnumDeliverSubBillTypes = new List<EnumDeliverSubBillType> |
||||
|
{ |
||||
|
EnumDeliverSubBillType.保险杠HBPO, |
||||
|
EnumDeliverSubBillType.买单件保险杠HBPO, |
||||
|
EnumDeliverSubBillType.买单件小件HBPO, |
||||
|
EnumDeliverSubBillType.小件HBPO, |
||||
|
EnumDeliverSubBillType.JIT直供件HBPO |
||||
|
}; |
||||
|
|
||||
|
Expression<Func<TM_BJBMPT_JIT_RECORD, bool>> predicate = (t) => t.DeliverBillType == EnumDeliverBjBmpBillType.JIS件 && EnumDeliverSubBillTypes.Contains(t.DeliverSubBillType); |
||||
|
var syncPositionFlag = await _syncPositionFlagRepository.FindAsync(t => t.TableName == syncTableName); |
||||
|
if (syncPositionFlag != null) |
||||
|
{ |
||||
|
//var inv = Expression.Invoke(t=>t.UID > int.Parse(syncPositionFlag.Position), predicate.Parameters);
|
||||
|
//return Expression.Lambda<Func<T, bool>>(Expression.And(exp.Body, inv), exp.Parameters);
|
||||
|
|
||||
|
//predicate.And(t => t.UID > int.Parse(syncPositionFlag.Position));
|
||||
|
|
||||
|
Expression<Func<TM_BJBMPT_JIT_RECORD, bool>> expression = (t) => t.UID > int.Parse(syncPositionFlag.Position); |
||||
|
var body = expression.Body; |
||||
|
|
||||
|
//var inv = Expression.Invoke(condition, exp.Parameters);
|
||||
|
predicate = Expression.Lambda<Func<TM_BJBMPT_JIT_RECORD, bool>>(Expression.And(predicate.Body, body), predicate.Parameters); |
||||
|
|
||||
|
//Expression.Lambda<Func<T, bool>>(Expression.Equal(member, constant), parameter);
|
||||
|
//var expression = predicate.And(t => t.UID > int.Parse(syncPositionFlag.Position));
|
||||
|
|
||||
|
} |
||||
|
|
||||
|
Console.WriteLine($"表达式:{predicate}"); |
||||
|
|
||||
|
var jitRecords = _wmsBJBMPTContext.TM_BJBMPT_JIT_RECORD |
||||
|
.Where(predicate) |
||||
|
.OrderBy(b => b.UID) |
||||
|
.ToList(); |
||||
|
|
||||
|
var hbpoSeDetails = ObjectMapper.Map<List<TM_BJBMPT_JIT_RECORD>, List<HBPO_SE_DETAIL>>(jitRecords); |
||||
|
if (hbpoSeDetails.Any()) |
||||
|
{ |
||||
|
await _hbpoSeDetailRepository.InsertManyAsync(hbpoSeDetails); |
||||
|
|
||||
|
if (syncPositionFlag != null) |
||||
|
{ |
||||
|
syncPositionFlag.Position = jitRecords.Last().UID.ToString(); |
||||
|
await _syncPositionFlagRepository.UpdateAsync(syncPositionFlag); |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
syncPositionFlag = new SyncPositionFlag() |
||||
|
{ |
||||
|
TableName = syncTableName, |
||||
|
Position = jitRecords.Last().UID.ToString() |
||||
|
}; |
||||
|
await _syncPositionFlagRepository.InsertAsync(syncPositionFlag); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
private async Task SyncJisRecord() |
||||
|
{ |
||||
|
//同步表名称
|
||||
|
var syncTableName = "TM_BJBMPT_JIS_RECORD"; |
||||
|
Expression<Func<TM_BJBMPT_JIS_RECORD, bool>> predicate = (t) => true; |
||||
|
var syncPositionFlag = await _syncPositionFlagRepository.FindAsync(t => t.TableName == syncTableName); |
||||
|
if (syncPositionFlag != null) |
||||
|
{ |
||||
|
predicate = (t) => t.UID > int.Parse(syncPositionFlag.Position); |
||||
|
} |
||||
|
|
||||
|
var jisRecords = _wmsBJBMPTContext.TM_BJBMPT_JIS_RECORD |
||||
|
.Where(predicate) |
||||
|
.OrderBy(b => b.UID) |
||||
|
.ToList(); |
||||
|
|
||||
|
var hbpoSeDetails = ObjectMapper.Map<List<TM_BJBMPT_JIS_RECORD>, List<HBPO_SE_DETAIL>>(jisRecords); |
||||
|
if (hbpoSeDetails.Any()) |
||||
|
{ |
||||
|
await _hbpoSeDetailRepository.InsertManyAsync(hbpoSeDetails); |
||||
|
|
||||
|
if (syncPositionFlag != null) |
||||
|
{ |
||||
|
syncPositionFlag.Position = jisRecords.Last().UID.ToString(); |
||||
|
await _syncPositionFlagRepository.UpdateAsync(syncPositionFlag); |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
syncPositionFlag = new SyncPositionFlag() |
||||
|
{ |
||||
|
TableName = syncTableName, |
||||
|
Position = jisRecords.Last().UID.ToString() |
||||
|
}; |
||||
|
await _syncPositionFlagRepository.InsertAsync(syncPositionFlag); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
@ -0,0 +1,31 @@ |
|||||
|
using System.Collections.Generic; |
||||
|
using System.ComponentModel; |
||||
|
using DocumentFormat.OpenXml.Office2010.ExcelAc; |
||||
|
|
||||
|
namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 发运同步配置
|
||||
|
/// </summary>
|
||||
|
public class SeSyncConfig |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 同步表名称
|
||||
|
/// </summary>
|
||||
|
public string SyncTableName { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 同步发运主类型
|
||||
|
/// </summary>
|
||||
|
public EnumDeliverBjBmpBillType SyncDeliverBillType { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 同步发运子类型
|
||||
|
/// </summary>
|
||||
|
public List<EnumDeliverSubBillType> SyncDeliverSubBillTypes { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
///
|
||||
|
/// </summary>
|
||||
|
public EnumBusinessType BusinessType { get; set; } |
||||
|
} |
@ -0,0 +1,122 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Linq; |
||||
|
using System.Linq.Expressions; |
||||
|
using System.Threading.Tasks; |
||||
|
using Coravel.Invocable; |
||||
|
using Microsoft.AspNetCore.Authorization; |
||||
|
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>
|
||||
|
/// 直供件BBAC发运同步
|
||||
|
/// </summary>
|
||||
|
[AllowAnonymous] |
||||
|
[Route("api/settleaccount/[controller]/[action]")]
|
||||
|
public class ZhiGongBBACSeSyncAppService : JitSeSyncAppService |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 构造
|
||||
|
/// </summary>
|
||||
|
public ZhiGongBBACSeSyncAppService( |
||||
|
WMSBJBMPTDbContext wmsBJBMPTContext, |
||||
|
INormalEfCoreRepository<SyncPositionFlag, Guid> syncPositionFlagRepository, |
||||
|
INormalEfCoreRepository<PUB_SE_DETAIL, Guid> pubSeDetailRepository |
||||
|
) : base(wmsBJBMPTContext, syncPositionFlagRepository, pubSeDetailRepository) |
||||
|
{ |
||||
|
base.SeSyncConfigInfo = new SeSyncConfig() |
||||
|
{ |
||||
|
SyncTableName = "ZhiGongBBACSeSync", |
||||
|
SyncDeliverBillType = EnumDeliverBjBmpBillType.JIT直供件, |
||||
|
SyncDeliverSubBillTypes = new List<EnumDeliverSubBillType> |
||||
|
{ |
||||
|
EnumDeliverSubBillType.JIT直供件BBAC |
||||
|
} |
||||
|
}; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// Jit发运数据同步
|
||||
|
/// </summary>
|
||||
|
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; |
||||
|
} |
||||
|
|
||||
|
public SeSyncConfig SeSyncConfigInfo { get; set; } |
||||
|
|
||||
|
[HttpPost] |
||||
|
public async Task Invoke() |
||||
|
{ |
||||
|
//同步表名称
|
||||
|
var syncTableName = SeSyncConfigInfo.SyncTableName; |
||||
|
//同步发运主类型
|
||||
|
var deliverBillType = SeSyncConfigInfo.SyncDeliverBillType; |
||||
|
//同步发运子类型
|
||||
|
var deliverSubBillTypes = SeSyncConfigInfo.SyncDeliverSubBillTypes; |
||||
|
|
||||
|
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) |
||||
|
{ |
||||
|
Expression<Func<TM_BJBMPT_OTHER_RECORD, bool>> expression = (t) => t.UID > int.Parse(syncPositionFlag.Position); |
||||
|
var body = expression.Body; |
||||
|
predicate = Expression.Lambda<Func<TM_BJBMPT_OTHER_RECORD, bool>>(Expression.And(predicate.Body, body), predicate.Parameters); |
||||
|
} |
||||
|
|
||||
|
var jitRecords = _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>>(jitRecords); |
||||
|
if (pubSeDetails.Any()) |
||||
|
{ |
||||
|
await _pubSeDetailRepository.InsertManyAsync(pubSeDetails); |
||||
|
|
||||
|
if (syncPositionFlag != null) |
||||
|
{ |
||||
|
syncPositionFlag.Position = jitRecords.Last().UID.ToString(); |
||||
|
await _syncPositionFlagRepository.UpdateAsync(syncPositionFlag); |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
syncPositionFlag = new SyncPositionFlag() |
||||
|
{ |
||||
|
TableName = syncTableName, |
||||
|
Position = jitRecords.Last().UID.ToString() |
||||
|
}; |
||||
|
await _syncPositionFlagRepository.InsertAsync(syncPositionFlag); |
||||
|
} |
||||
|
} |
||||
|
await Task.CompletedTask; |
||||
|
} |
||||
|
} |
@ -0,0 +1,28 @@ |
|||||
|
using System; |
||||
|
using System.ComponentModel.DataAnnotations; |
||||
|
using Volo.Abp.Domain.Entities.Auditing; |
||||
|
|
||||
|
namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 同步位置标记
|
||||
|
/// </summary>
|
||||
|
public class SyncPositionFlag : AuditedAggregateRoot<Guid> |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 表名称
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "表名称")] |
||||
|
public string TableName { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 位置(可排序)
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "位置")] |
||||
|
public string Position { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 构造
|
||||
|
/// </summary>
|
||||
|
public SyncPositionFlag() { } |
||||
|
} |
@ -0,0 +1,107 @@ |
|||||
|
using System; |
||||
|
using System.ComponentModel; |
||||
|
using System.ComponentModel.DataAnnotations; |
||||
|
using System.ComponentModel.DataAnnotations.Schema; |
||||
|
|
||||
|
namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs; |
||||
|
|
||||
|
public class TM_BJBMPT_JIS_RECORD |
||||
|
{ |
||||
|
[Key] |
||||
|
[DatabaseGenerated(DatabaseGeneratedOption.Identity)] |
||||
|
public int UID { get; set; } |
||||
|
|
||||
|
[DisplayName("JIS单据编号")] |
||||
|
public string JISNum { get; set; } |
||||
|
|
||||
|
[DisplayName("发货时间")] |
||||
|
public DateTime? BillTime { get; set; } |
||||
|
|
||||
|
[DisplayName("发货人")] |
||||
|
public string Oper { get; set; } |
||||
|
|
||||
|
[DisplayName("JIS排序单号")] |
||||
|
public string OrderNum { get; set; } |
||||
|
|
||||
|
[DisplayName("订单序号")] |
||||
|
public string Seq { get; set; } |
||||
|
|
||||
|
[DisplayName("JIS实际生产码")] |
||||
|
public string RealCode { get; set; } |
||||
|
|
||||
|
[DisplayName("订单生产码")] |
||||
|
public string VinCode { get; set; } |
||||
|
|
||||
|
[DisplayName("JIS生产码类型")] |
||||
|
public string CodeType { get; set; } |
||||
|
|
||||
|
[DisplayName("订单零件号")] |
||||
|
public string PartCode { get; set; } |
||||
|
|
||||
|
[DisplayName("数量")] |
||||
|
public decimal? Qty { get; set; } |
||||
|
|
||||
|
[DisplayName("发货单号")] |
||||
|
public string BillNum { get; set; } |
||||
|
|
||||
|
public string MESConfigCode { get; set; } |
||||
|
|
||||
|
[DisplayName("来源库位")] |
||||
|
public string FromLoc { get; set; } |
||||
|
|
||||
|
[DisplayName("目标库位")] |
||||
|
public string ToLoc { get; set; } |
||||
|
|
||||
|
public string RealPartCode { get; set; } |
||||
|
|
||||
|
public string Batch { get; set; } |
||||
|
|
||||
|
[DisplayName("参照订单生产码")] |
||||
|
public string RefVinCode { get; set; } |
||||
|
|
||||
|
//[DisplayName("单据类型")]
|
||||
|
//public EnumBillType BillType { get; set; }
|
||||
|
|
||||
|
//[DisplayName("子单据类型")]
|
||||
|
//public EnumSubBillType SubBillType { get; set; }
|
||||
|
|
||||
|
[DisplayName("单据性质")] |
||||
|
public string BillCharacter { get; set; } |
||||
|
|
||||
|
[DisplayName("事务类型")] |
||||
|
public EnumDelTransType TransType { get; set; } |
||||
|
|
||||
|
[DisplayName("发运主类型")] |
||||
|
public EnumDeliverBjBmpBillType DeliverBillType { get; set; } |
||||
|
|
||||
|
[DisplayName("发运子类型")] |
||||
|
public EnumDeliverSubBillType DeliverSubBillType { get; set; } |
||||
|
|
||||
|
[DisplayName("发货关联单号")] |
||||
|
public string RefBillNum { get; set; } |
||||
|
|
||||
|
[DisplayName("Erp目标库位")] |
||||
|
public string ErpToLoc { get; set; } |
||||
|
|
||||
|
[DisplayName("原生产码")] |
||||
|
public string OrigiCode { get; set; } |
||||
|
|
||||
|
[DisplayName("备注")] |
||||
|
public string Remark { get; set; } |
||||
|
|
||||
|
[DisplayName("塑件唯一码")] |
||||
|
public string UniqueCode { get; set; } |
||||
|
|
||||
|
[DisplayName("PJS顺序号")] |
||||
|
public string PjsNum { get; set; } |
||||
|
|
||||
|
[DisplayName("虚拟小总成")] |
||||
|
public string MatchNumber { get; set; } |
||||
|
|
||||
|
//[DisplayName("业务类型")]
|
||||
|
//public EnumProTpe ProType { get; set; }
|
||||
|
|
||||
|
public string DeliverCode { get; set; } |
||||
|
|
||||
|
public string Position { get; set; } |
||||
|
} |
@ -0,0 +1,178 @@ |
|||||
|
using System; |
||||
|
using System.ComponentModel; |
||||
|
using System.ComponentModel.DataAnnotations; |
||||
|
using System.ComponentModel.DataAnnotations.Schema; |
||||
|
|
||||
|
namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// Jis小件
|
||||
|
/// </summary>
|
||||
|
public class TM_BJBMPT_JIT_RECORD |
||||
|
{ |
||||
|
[Key] |
||||
|
[DatabaseGenerated(DatabaseGeneratedOption.Identity)] |
||||
|
public int UID { get; set; } |
||||
|
|
||||
|
[DisplayName("JIT订单号")] |
||||
|
public string JISNum { get; set; } |
||||
|
|
||||
|
[DisplayName("JIT排序生产码")] |
||||
|
public string VinCode { get; set; } |
||||
|
|
||||
|
[DisplayName("JIT排序生产码类型")] |
||||
|
public string CodeType { get; set; } |
||||
|
|
||||
|
[DisplayName("订单零件号")] |
||||
|
public string PartCode { get; set; } |
||||
|
|
||||
|
[DisplayName("订单零件号")] |
||||
|
public string RealPartCode { get; set; } |
||||
|
|
||||
|
[DisplayName("订单序号")] |
||||
|
public string Seq { get; set; } |
||||
|
|
||||
|
[DisplayName("发货条码")] |
||||
|
public string DeliverCode { get; set; } |
||||
|
|
||||
|
[DisplayName("数量")] |
||||
|
public decimal? Qty { get; set; } |
||||
|
|
||||
|
[DisplayName("发货单号")] |
||||
|
public string BillNum { get; set; } |
||||
|
|
||||
|
[DisplayName("发货时间")] |
||||
|
public DateTime? BillTime { get; set; } |
||||
|
|
||||
|
[DisplayName("发货人")] |
||||
|
public string Oper { get; set; } |
||||
|
|
||||
|
[DisplayName("客户位置")] |
||||
|
public string Position { get; set; } |
||||
|
|
||||
|
public string MESConfigCode { get; set; } |
||||
|
|
||||
|
[DisplayName("生产线")] |
||||
|
public string Line { get; set; } |
||||
|
|
||||
|
[DisplayName("目标库位")] |
||||
|
public string ToLoc { get; set; } |
||||
|
|
||||
|
[DisplayName("备注")] |
||||
|
public string Remark { get; set; } |
||||
|
|
||||
|
//[DisplayName("单据类型")]
|
||||
|
//public EnumBillType BillType { get; set; }
|
||||
|
|
||||
|
//[DisplayName("子单据类型")]
|
||||
|
//public EnumSubBillType SubBillType { get; set; }
|
||||
|
|
||||
|
[DisplayName("事务类型")] |
||||
|
public EnumDelTransType TransType { get; set; } |
||||
|
|
||||
|
[DisplayName("发运主类型")] |
||||
|
public EnumDeliverBjBmpBillType DeliverBillType { get; set; } |
||||
|
|
||||
|
[DisplayName("发运子类型")] |
||||
|
public EnumDeliverSubBillType DeliverSubBillType { get; set; } |
||||
|
|
||||
|
[DisplayName("单据性质")] |
||||
|
public string BillCharacter { get; set; } |
||||
|
|
||||
|
//[DisplayName("业务类型")]
|
||||
|
//public EnumProTpe ProType { get; set; }
|
||||
|
|
||||
|
public string OrderNum { get; set; } |
||||
|
|
||||
|
public string RealCode { get; set; } |
||||
|
|
||||
|
public string FromLoc { get; set; } |
||||
|
|
||||
|
public string RefBillNum { get; set; } |
||||
|
|
||||
|
public string ErpToLoc { get; set; } |
||||
|
|
||||
|
public string UniqueCode { get; set; } |
||||
|
|
||||
|
public string PjsNum { get; set; } |
||||
|
|
||||
|
public string MatchNumber { get; set; } |
||||
|
|
||||
|
public string RefVinCode { get; set; } |
||||
|
} |
||||
|
|
||||
|
public enum EnumProTpe |
||||
|
{ |
||||
|
无 = 0, |
||||
|
Jit发货 = 1, |
||||
|
Jit补发订单 = 2, |
||||
|
Jit备件 = 3, |
||||
|
Jit买单件 = 4, |
||||
|
Jit匹配件 = 5, |
||||
|
Jis发货 = 6, |
||||
|
Jis备件 = 7, |
||||
|
Jis买单件 = 8, |
||||
|
Jis匹配件 = 9, |
||||
|
Jis补发订单 = 10, |
||||
|
Jis退货 = 11, |
||||
|
Jis备件退货 = 12, |
||||
|
Jis买单件退货 = 13, |
||||
|
Jis匹配件退货 = 14, |
||||
|
Jis补发订单退货 = 15, |
||||
|
Jit退货 = 16, |
||||
|
Jit备件退货 = 17, |
||||
|
Jit买单件退货 = 18, |
||||
|
Jit匹配件退货 = 19, |
||||
|
Jit补发订单退货 = 20, |
||||
|
北汽4S发货 = 21, |
||||
|
HBPO发货 = 22, |
||||
|
直供件发货 = 23, |
||||
|
印度件发货 = 24, |
||||
|
北汽4S退货 = 25, |
||||
|
HBPO退货 = 26, |
||||
|
直供件退货 = 27, |
||||
|
印度件退货 = 28, |
||||
|
} |
||||
|
|
||||
|
public enum EnumBillType { } |
||||
|
|
||||
|
public enum EnumSubBillType { } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 事务类型
|
||||
|
/// </summary>
|
||||
|
public enum EnumDelTransType |
||||
|
{ |
||||
|
发货 = 1, |
||||
|
退货 = -1, |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 发运主类型
|
||||
|
/// </summary>
|
||||
|
public enum EnumDeliverBjBmpBillType |
||||
|
{ |
||||
|
无 = 0, |
||||
|
JIS件 = 1, |
||||
|
JIT直供件 = 2, |
||||
|
印度件 = 3, |
||||
|
北汽4S备件 = 4, |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 发运子类型
|
||||
|
/// </summary>
|
||||
|
public enum EnumDeliverSubBillType |
||||
|
{ |
||||
|
无 = 0, |
||||
|
保险杠BBAC = 1, |
||||
|
保险杠HBPO = 2, |
||||
|
买单件保险杠BBAC = 3, |
||||
|
买单件保险杠HBPO = 4, |
||||
|
买单件小件BBAC = 5, |
||||
|
买单件小件HBPO = 6, |
||||
|
小件BBAC = 7, |
||||
|
小件HBPO = 8, |
||||
|
JIT直供件BBAC = 9, |
||||
|
JIT直供件HBPO = 10, |
||||
|
} |
@ -0,0 +1,91 @@ |
|||||
|
using System; |
||||
|
using System.ComponentModel; |
||||
|
using System.ComponentModel.DataAnnotations; |
||||
|
using System.ComponentModel.DataAnnotations.Schema; |
||||
|
|
||||
|
namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// Jit(非Jis
|
||||
|
/// </summary>
|
||||
|
public class TM_BJBMPT_OTHER_RECORD |
||||
|
{ |
||||
|
[Key] |
||||
|
[DatabaseGenerated(DatabaseGeneratedOption.Identity)] |
||||
|
public long UID { get; set; } |
||||
|
|
||||
|
[DisplayName("发货单号")] |
||||
|
public string BillNum { get; set; } |
||||
|
|
||||
|
[DisplayName("发货时间")] |
||||
|
public DateTime? BillTime { get; set; } |
||||
|
|
||||
|
[DisplayName("零件号")] |
||||
|
public string PartCode { get; set; } |
||||
|
|
||||
|
[DisplayName("批次")] |
||||
|
public string Batch { get; set; } |
||||
|
|
||||
|
[DisplayName("发货人")] |
||||
|
public string Oper { get; set; } |
||||
|
|
||||
|
[DisplayName("DN单据号")] |
||||
|
public string DnBillNum { get; set; } |
||||
|
|
||||
|
[DisplayName("DN单据时间")] |
||||
|
public DateTime? DnBillTime { get; set; } |
||||
|
|
||||
|
[DisplayName("DN单添加人")] |
||||
|
public string DnOper { get; set; } |
||||
|
|
||||
|
[DisplayName("交付索引")] |
||||
|
public string DeliveryIndex { get; set; } |
||||
|
|
||||
|
[DisplayName("客户")] |
||||
|
public string CustId { get; set; } |
||||
|
|
||||
|
[DisplayName("发货仓库")] |
||||
|
public string DeliveryHose { get; set; } |
||||
|
|
||||
|
[DisplayName("来源库位")] |
||||
|
public string FromLocCode { get; set; } |
||||
|
|
||||
|
[DisplayName("来源仓库")] |
||||
|
public string FromHose { get; set; } |
||||
|
|
||||
|
[DisplayName("来源ERP库存")] |
||||
|
public string FromErpLocCode { get; set; } |
||||
|
|
||||
|
[DisplayName("目标库位")] |
||||
|
public string ToLocCode { get; set; } |
||||
|
|
||||
|
[DisplayName("目标仓库")] |
||||
|
public string ToHose { get; set; } |
||||
|
|
||||
|
[DisplayName("目标Erp库位")] |
||||
|
public string ToErpLocCode { get; set; } |
||||
|
|
||||
|
[DisplayName("数量")] |
||||
|
public decimal? Qty { get; set; } |
||||
|
|
||||
|
//[DisplayName("单据类型")]
|
||||
|
//public EnumBillType BillType { get; set; }
|
||||
|
|
||||
|
//[DisplayName("子单据类型")]
|
||||
|
//public EnumSubBillType SubBillType { get; set; }
|
||||
|
|
||||
|
[DisplayName("事务类型")] |
||||
|
public EnumDelTransType TransType { get; set; } |
||||
|
|
||||
|
[DisplayName("发运主类型")] |
||||
|
public EnumDeliverBjBmpBillType DeliverBillType { get; set; } |
||||
|
|
||||
|
[DisplayName("发运子类型")] |
||||
|
public EnumDeliverSubBillType DeliverSubBillType { get; set; } |
||||
|
|
||||
|
//[DisplayName("业务类型")]
|
||||
|
//public EnumProTpe ProType { get; set; }
|
||||
|
|
||||
|
[DisplayName("备注")] |
||||
|
public string Remark { get; set; } |
||||
|
} |
@ -0,0 +1,39 @@ |
|||||
|
using Microsoft.EntityFrameworkCore; |
||||
|
using Volo.Abp.Data; |
||||
|
using Win.Sfs.SettleAccount.Entities.BQ.Syncs; |
||||
|
|
||||
|
namespace Win.Sfs.SettleAccount.EntityFrameworkCore; |
||||
|
|
||||
|
[ConnectionStringName("WMSBJBMPT")] |
||||
|
public class WMSBJBMPTDbContext : DbContext |
||||
|
{ |
||||
|
public DbSet<TM_BJBMPT_JIT_RECORD> TM_BJBMPT_JIT_RECORD { get; set; } |
||||
|
public DbSet<TM_BJBMPT_JIS_RECORD> TM_BJBMPT_JIS_RECORD { get; set; } |
||||
|
public DbSet<TM_BJBMPT_OTHER_RECORD> TM_BJBMPT_OTHER_RECORD { get; set; } |
||||
|
|
||||
|
public WMSBJBMPTDbContext() |
||||
|
{ |
||||
|
} |
||||
|
|
||||
|
public WMSBJBMPTDbContext(DbContextOptions<WMSBJBMPTDbContext> options) : base(options) |
||||
|
{ |
||||
|
} |
||||
|
|
||||
|
//protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
||||
|
//{
|
||||
|
// if (!optionsBuilder.IsConfigured)
|
||||
|
// {
|
||||
|
// IConfiguration config = new ConfigurationBuilder()
|
||||
|
// .SetBasePath(Directory.GetCurrentDirectory())
|
||||
|
// .AddJsonFile("appsettings.json")
|
||||
|
// .Build();
|
||||
|
// var ConnectStr = config.GetConnectionString("WMSBJBMPT");
|
||||
|
// optionsBuilder.UseSqlServer(ConnectStr);
|
||||
|
// }
|
||||
|
//}
|
||||
|
|
||||
|
protected override void OnModelCreating(ModelBuilder modelBuilder) |
||||
|
{ |
||||
|
base.OnModelCreating(modelBuilder); |
||||
|
} |
||||
|
} |
File diff suppressed because it is too large
@ -0,0 +1,24 @@ |
|||||
|
using System; |
||||
|
using Microsoft.EntityFrameworkCore.Migrations; |
||||
|
|
||||
|
namespace Win.Sfs.SettleAccount.Migrations |
||||
|
{ |
||||
|
public partial class _202307262 : Migration |
||||
|
{ |
||||
|
protected override void Up(MigrationBuilder migrationBuilder) |
||||
|
{ |
||||
|
migrationBuilder.InsertData( |
||||
|
table: "Set_JobItem", |
||||
|
columns: new[] { "Id", "ConcurrencyStamp", "Cron", "IsRunning", "Name", "Service" }, |
||||
|
values: new object[] { new Guid("92cce083-20a8-5335-31ea-e390c57cac1f"), null, "0 0/1 * * * ?", false, "HBPO发运数据同步", "Win.Sfs.SettleAccount.Entities.BQ.HBPOSeSyncAppService" }); |
||||
|
} |
||||
|
|
||||
|
protected override void Down(MigrationBuilder migrationBuilder) |
||||
|
{ |
||||
|
migrationBuilder.DeleteData( |
||||
|
table: "Set_JobItem", |
||||
|
keyColumn: "Id", |
||||
|
keyValue: new Guid("92cce083-20a8-5335-31ea-e390c57cac1f")); |
||||
|
} |
||||
|
} |
||||
|
} |
File diff suppressed because it is too large
@ -0,0 +1,34 @@ |
|||||
|
using System; |
||||
|
using Microsoft.EntityFrameworkCore.Migrations; |
||||
|
|
||||
|
namespace Win.Sfs.SettleAccount.Migrations |
||||
|
{ |
||||
|
public partial class _202307263 : Migration |
||||
|
{ |
||||
|
protected override void Up(MigrationBuilder migrationBuilder) |
||||
|
{ |
||||
|
migrationBuilder.DeleteData( |
||||
|
table: "Set_JobItem", |
||||
|
keyColumn: "Id", |
||||
|
keyValue: new Guid("92cce083-20a8-5335-31ea-e390c57cac1f")); |
||||
|
|
||||
|
migrationBuilder.InsertData( |
||||
|
table: "Set_JobItem", |
||||
|
columns: new[] { "Id", "ConcurrencyStamp", "Cron", "IsRunning", "Name", "Service" }, |
||||
|
values: new object[] { new Guid("d50400b0-b0d4-38d1-fcdf-b1e7ac1d3a68"), null, "0 0/1 * * * ?", false, "HBPO发运数据同步", "Win.Sfs.SettleAccount.Entities.BQ.HBPOSeSyncAppService" }); |
||||
|
} |
||||
|
|
||||
|
protected override void Down(MigrationBuilder migrationBuilder) |
||||
|
{ |
||||
|
migrationBuilder.DeleteData( |
||||
|
table: "Set_JobItem", |
||||
|
keyColumn: "Id", |
||||
|
keyValue: new Guid("d50400b0-b0d4-38d1-fcdf-b1e7ac1d3a68")); |
||||
|
|
||||
|
migrationBuilder.InsertData( |
||||
|
table: "Set_JobItem", |
||||
|
columns: new[] { "Id", "ConcurrencyStamp", "Cron", "IsRunning", "Name", "Service" }, |
||||
|
values: new object[] { new Guid("92cce083-20a8-5335-31ea-e390c57cac1f"), null, "0 0/1 * * * ?", false, "HBPO发运数据同步", "Win.Sfs.SettleAccount.Entities.BQ.HBPOSeSyncAppService" }); |
||||
|
} |
||||
|
} |
||||
|
} |
File diff suppressed because it is too large
@ -0,0 +1,46 @@ |
|||||
|
using System; |
||||
|
using Microsoft.EntityFrameworkCore.Migrations; |
||||
|
|
||||
|
namespace Win.Sfs.SettleAccount.Migrations |
||||
|
{ |
||||
|
public partial class _202307271 : Migration |
||||
|
{ |
||||
|
protected override void Up(MigrationBuilder migrationBuilder) |
||||
|
{ |
||||
|
migrationBuilder.DeleteData( |
||||
|
table: "Set_JobItem", |
||||
|
keyColumn: "Id", |
||||
|
keyValue: new Guid("d50400b0-b0d4-38d1-fcdf-b1e7ac1d3a68")); |
||||
|
|
||||
|
migrationBuilder.CreateTable( |
||||
|
name: "Set_SyncPositionFlag", |
||||
|
columns: table => new |
||||
|
{ |
||||
|
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false), |
||||
|
TableName = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
Position = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
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) |
||||
|
}, |
||||
|
constraints: table => |
||||
|
{ |
||||
|
table.PrimaryKey("PK_Set_SyncPositionFlag", x => x.Id); |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
protected override void Down(MigrationBuilder migrationBuilder) |
||||
|
{ |
||||
|
migrationBuilder.DropTable( |
||||
|
name: "Set_SyncPositionFlag"); |
||||
|
|
||||
|
migrationBuilder.InsertData( |
||||
|
table: "Set_JobItem", |
||||
|
columns: new[] { "Id", "ConcurrencyStamp", "Cron", "IsDisabled", "IsRunning", "Name", "Service" }, |
||||
|
values: new object[] { new Guid("d50400b0-b0d4-38d1-fcdf-b1e7ac1d3a68"), null, "0 0/1 * * * ?", false, false, "HBPO发运数据同步", "Win.Sfs.SettleAccount.Entities.BQ.HBPOSeSyncAppService" }); |
||||
|
} |
||||
|
} |
||||
|
} |
Loading…
Reference in new issue