diff --git a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/settle/commerce.js b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/settle/commerce.js
index e3245b91..51f184b8 100644
--- a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/settle/commerce.js
+++ b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/settle/commerce.js
@@ -70,12 +70,14 @@ export default function (businessType, type) {
const receivedUrl = `settleaccount/${service}/received`;
const rejectUrl = `settleaccount/${service}/reject`;
const reissueUrl = `settleaccount/${service}/reissue-invoice`;
+ const approvalUrl = `settleaccount/${service}/approval-passed`;
const queryMethod = "POST";
const exportMethod = "POST";
const invoiceMethod = "POST";
const receivedMethod = "POST";
const rejectMethod = "POST";
const reissueMethod = "POST";
+ const approvalMethod = "POST";
return {
query: {
url: queryUrl,
@@ -143,11 +145,13 @@ export default function (businessType, type) {
receivedUrl,
rejectUrl,
reissueUrl,
+ approvalUrl,
exportMethod,
invoiceMethod,
receivedMethod,
rejectMethod,
reissueMethod,
+ approvalMethod,
schema: schema,
},
};
diff --git a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/settle/inventory-detail.js b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/settle/inventory-detail.js
new file mode 100644
index 00000000..9ef56e43
--- /dev/null
+++ b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/settle/inventory-detail.js
@@ -0,0 +1,137 @@
+//库存扣减
+import { version, state3 } from "../_options.js";
+
+const schema = {
+ title: "寄售库库存扣减审批",
+ type: "object",
+ properties: {
+ version,
+ state: state3,
+ billNum: {
+ title: "发票号",
+ type: "string",
+ link: true,
+ },
+ settleBillNum: {
+ title: "关联结算单号",
+ type: "string",
+ },
+ invGroupNum: {
+ title: "发票分组号",
+ type: "string",
+ link: true,
+ },
+ site: {
+ title: "地点",
+ type: "string",
+ },
+ },
+};
+
+export default function (businessType) {
+ let service;
+ if (businessType === "JisBBAC") {
+ service = "b-bAC_PD_SERVICE";
+ } else if (businessType === "JisHBPO") {
+ service = "h-bPO_PD_SERVICE";
+ } else {
+ service = "p-uB_PD_SERVICE";
+ }
+
+ const queryUrl = `settleaccount/${service}/detail-query`;
+ const queryMethod = "POST";
+
+ return {
+ query: {
+ url: queryUrl,
+ method: queryMethod,
+ hasFilter: true,
+ schema: {
+ title: "不可结算单",
+ type: "object",
+ properties: {
+ filters: {
+ title: "项目",
+ type: "array",
+ hidden: true,
+ items: {
+ type: "object",
+ properties: {
+ logic: {
+ type: "int",
+ },
+ column: {
+ type: "string",
+ },
+ action: {
+ type: "int",
+ },
+ value: {
+ type: "string",
+ },
+ },
+ },
+ default: [
+ {
+ logic: "and",
+ column: "version",
+ action: "equal",
+ value: null,
+ readOnly: true,
+ },
+ {
+ logic: "and",
+ column: "billNum",
+ action: "equal",
+ value: null,
+ readOnly: true,
+ },
+ {
+ logic: "and",
+ column: "settleBillNum",
+ action: "equal",
+ value: null,
+ readOnly: true,
+ },
+ {
+ logic: "and",
+ column: "invGroupNum",
+ action: "equal",
+ value: null,
+ readOnly: true,
+ },
+ {
+ logic: "and",
+ column: "state",
+ action: "equal",
+ value: null,
+ readOnly: true,
+ },
+ ],
+ },
+ skipCount: {
+ hidden: true,
+ default: 0,
+ },
+ maxResultCount: {
+ hidden: true,
+ default: 10,
+ },
+ sorting: {
+ hidden: true,
+ },
+ businessType: {
+ hidden: true,
+ default: 0,
+ },
+ },
+ },
+ },
+ table: {
+ schema: schema,
+ },
+ edit: {
+ schema: schema,
+ },
+ };
+}
diff --git a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/settle/inventory.js b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/settle/inventory.js
index 23b532a7..d5bc6874 100644
--- a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/settle/inventory.js
+++ b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/settle/inventory.js
@@ -10,7 +10,8 @@ const schema = {
billNum: {
title: "发票号",
type: "string",
- link: true,
+ oneToMany: "/settle/inventory-detail",
+ config: "/models/settle/inventory-detail.js",
},
settleBillNum: {
title: "关联结算单号",
@@ -96,7 +97,7 @@ export default function (businessType) {
},
{
logic: "and",
- column: "invGroupNum",
+ column: "settleBillNum",
action: "equal",
value: null,
readOnly: true,
@@ -108,6 +109,13 @@ export default function (businessType) {
value: null,
readOnly: true,
},
+ {
+ logic: "and",
+ column: "state",
+ action: "equal",
+ value: null,
+ readOnly: true,
+ },
],
},
skipCount: {
diff --git a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/router/business.js b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/router/business.js
index 205a5d15..e86414c7 100644
--- a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/router/business.js
+++ b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/router/business.js
@@ -116,7 +116,7 @@ export default [
children: [createButton("query", "title=查询&isTop=true")],
},
{
- ...createPage("settle/vmi-detail", "title=寄售库库存扣减审批明细&isHidden=true"),
+ ...createPage("settle/inventory-detail", "title=寄售库库存扣减审批明细&isHidden=true"),
children: [createButton("query", "title=查询&isTop=true")],
},
{
@@ -339,7 +339,7 @@ export default [
children: [
createButton("query", "title=查询&isTop=true"),
createButton("import", "title=导入开票文件&isTop=true"),
- createButton("compare", "title=财务审核通过&isTop=true"),
+ createButton("approval", "title=财务审核通过&isTop=true"),
createButton("export-group", "title=导出发票分组&pattern=paged"),
createButton("reject", "title=退回&isTop=true"),
createButton("sync", "title=同步到QAD&isTop=true"),
diff --git a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/settle/finance.js b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/settle/finance.js
index 52e77763..f03f849b 100644
--- a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/settle/finance.js
+++ b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/settle/finance.js
@@ -26,7 +26,7 @@ export default {
? `确认退回选中的${rows.length}行数据吗?`
: `确认选中的${rows.length}行数据客户已收票吗?`;
const data = item.path === "approval" ? rows.map((o) => o.invbillNum) : item.path === "reject" ? rows[0]["invGroupNum"] : rows.map((o) => o.invbillNum);
- const url = item.path === "approval" ? config.edit.invoiceUrl : item.path === "reject" ? config.edit.rejectUrl : config.edit.receivedUrl;
+ const url = item.path === "approval" ? config.edit.approvalUrl : item.path === "reject" ? config.edit.rejectUrl : config.edit.receivedUrl;
await appListRef.value.onClick(async () => await request(url, data, { method: "POST" }), message, true);
}
} else if (item.path === "export-group") {
diff --git a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/settle/inventory.js b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/settle/inventory.js
index 85e3d300..1567947e 100644
--- a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/settle/inventory.js
+++ b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/settle/inventory.js
@@ -27,7 +27,7 @@ export default {
? `确认退回选中的${rows.length}行数据吗?`
: `确认选中的${rows.length}行数据客户已收票吗?`;
const data = item.path === "approval" ? rows.map((o) => o.invbillNum) : item.path === "reject" ? rows[0]["invGroupNum"] : rows.map((o) => o.invbillNum);
- const url = item.path === "approval" ? config.edit.invoiceUrl : item.path === "reject" ? config.edit.rejectUrl : config.edit.receivedUrl;
+ const url = item.path === "approval" ? config.edit.approvalUrl : item.path === "reject" ? config.edit.rejectUrl : config.edit.receivedUrl;
await appListRef.value.onClick(async () => await request(url, data, { method: "POST" }), message, true);
}
} else if (item.path === "export-group") {
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_SA_DTO.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_SA_DTO.cs
index c8eb3775..bff87824 100644
--- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_SA_DTO.cs
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_SA_DTO.cs
@@ -107,17 +107,22 @@ public class BBACSaImportRequestDto
/// 文件
///
public IFormFileCollection Files { get; set; }
-
///
/// 期间
///
[Display(Name = "期间")]
public int Version { get; set; }
+ ///
+ /// 地点
+ ///
+ [Display(Name = "地点")]
+ public string Site { get; set; }
}
///
/// BBAC结算明细导入
///
+[Importer(HeaderRowIndex = 3)]
public class BBAC_SA_DETAIL_IMPORT_DTO
{
///
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_SA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_SA_SERVICE.cs
index aa3ecc37..51b74e00 100644
--- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_SA_SERVICE.cs
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_SA_SERVICE.cs
@@ -1,12 +1,15 @@
using System;
using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.LinqAsync;
using System.Security.Policy;
using System.Threading.Tasks;
using AutoMapper;
using DocumentFormat.OpenXml.Drawing.Charts;
+using DocumentFormat.OpenXml.Wordprocessing;
using EFCore.BulkExtensions;
+using FlexLabs.EntityFrameworkCore.Upsert.Internal;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
@@ -80,6 +83,12 @@ public class BBAC_SA_SERVICE : SettleAccountApplicationBase
///
private readonly EnumBusinessType _businessType = EnumBusinessType.JisBBAC;
+ ///
+ /// 地点
+ ///
+ [Display(Name = "地点")]
+ public string Site { get; set; }
+
///
/// 构造
///
@@ -114,6 +123,7 @@ public class BBAC_SA_SERVICE : SettleAccountApplicationBase
[HttpPost]
public async Task ImportAsync([FromForm] BBACSaImportRequestDto bbacSaImportRequestDto)
{
+ Site = bbacSaImportRequestDto.Site;
#region 导入数据转换、数据校验
ExportImporter _exportImporter = new ExportImporter();
var importDtos = await _exportImporter.UploadExcelImport(bbacSaImportRequestDto.Files, _excelImportService).ConfigureAwait(false);
@@ -131,6 +141,7 @@ public class BBAC_SA_SERVICE : SettleAccountApplicationBase
importBBACSaDetails.ForEach(importBBACSaDetail =>
{
importBBACSaDetail.Version = bbacSaImportRequestDto.Version;
+ importBBACSaDetail.Site = Site;
});
//数据校验
@@ -321,7 +332,8 @@ public class BBAC_SA_SERVICE : SettleAccountApplicationBase
{
BillNum = bbacSaBillNum,
State = "1",
- BusinessType = _businessType
+ BusinessType = _businessType,
+ Site = Site
};
//可结算单号
var bbacCanSaBillNum = OrderNumberGenerator.GenerateOrderNumber("C");
@@ -332,7 +344,8 @@ public class BBAC_SA_SERVICE : SettleAccountApplicationBase
InvGroupNum = bbacCanSaBillNum,
SettleBillNum = bbacSaBillNum,
State = SettleBillState.未结状态,
- BusinessType = _businessType
+ BusinessType = _businessType,
+ Site = Site
};
//可结算明细
var bbacCanSaDetails = new List();
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_SA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_SA_SERVICE.cs
index 907674da..049a53e3 100644
--- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_SA_SERVICE.cs
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_SA_SERVICE.cs
@@ -189,63 +189,6 @@ public class HBPO_SA_SERVICE : SettleAccountApplicationBase
return new PagedResultDto(totalCount, dtos);
}
- ///
- /// 删除
- ///
- [HttpPost]
- public async Task DeleteAsync(Guid id)
- {
- //结算主表
- HBPO_SA hbpoSaDelEntity;
- //结算明细
- List hbpoSaDetailDelEntitys;
- //可结算主表
- List hbpoCanSaDelEntitys;
- //可结算明细
- List hbpoCanSaDetailDelEntitys;
- //不可结算
- List hbpoNotSaDetailDelEntitys;
-
- hbpoSaDelEntity = await _hbpoSaRepository.FindAsync(id);
- if (hbpoSaDelEntity == null)
- {
- throw new UserFriendlyException($"未获取到结算单!", "400");
- }
- //结算单据
- string hbpoSaBillNum = hbpoSaDelEntity.BillNum;
-
- hbpoCanSaDelEntitys = await _hbpoCanSaRepository.GetListAsync(t => t.SettleBillNum == hbpoSaBillNum);
- //验证可结算主表状态
- if (hbpoCanSaDelEntitys.Any(t => t.State != SettleBillState.未结状态))
- {
- throw new UserFriendlyException($"该单据可结算单状态无法删除!", "400");
- }
-
- hbpoSaDetailDelEntitys = await _hbpoSaDetailRepository.GetListAsync(t => t.BillNum == hbpoSaBillNum);
- hbpoCanSaDetailDelEntitys = await _hbpoCanSaDetailRepository.GetListAsync(t => t.SettleBillNum == hbpoSaBillNum);
- hbpoNotSaDetailDelEntitys = await _hbpoNotSaDetailRepository.GetListAsync(t => t.SettleBillNum == hbpoSaBillNum);
-
- //删除
- await _hbpoSaRepository.DeleteAsync(hbpoSaDelEntity);
- if (hbpoSaDetailDelEntitys.Any())
- {
- await _hbpoSaDetailRepository.DeleteManyAsync(hbpoSaDetailDelEntitys);
- }
- if (hbpoCanSaDelEntitys.Any())
- {
- await _hbpoCanSaRepository.DeleteManyAsync(hbpoCanSaDelEntitys);
- }
- if (hbpoCanSaDetailDelEntitys.Any())
- {
- await _hbpoCanSaDetailRepository.DeleteManyAsync(hbpoCanSaDetailDelEntitys);
- }
- if (hbpoNotSaDetailDelEntitys.Any())
- {
- await _hbpoNotSaDetailRepository.DeleteManyAsync(hbpoNotSaDetailDelEntitys);
- }
-
- }
-
///
/// 删除
///
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_SA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_SA_SERVICE.cs
index ba69f89a..9fd1a10a 100644
--- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_SA_SERVICE.cs
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_SA_SERVICE.cs
@@ -170,60 +170,6 @@ public class PUB_SA_SERVICE : SettleAccountApplicationBase
return new PagedResultDto(totalCount, dtos);
}
- ///
- /// 删除
- ///
- [HttpPost]
- public async Task DeleteAsync(Guid id)
- {
- //结算主表
- List pubSas = new List();
- //结算明细
- List pubSaDetails = new List();
- //可结算主表
- List pubCanSas = new List();
- //可结算明细
- List pubCanSaDetails = new List();
- //不可结算
- List pubNotSaDetails = new List();
-
- try
- {
- var pubSaDelItems = await GetPubSaDelItemsAsync(id);
- pubSas.AddRange(pubSaDelItems.pubSas);
- pubSaDetails.AddRange(pubSaDelItems.pubSaDetails);
- pubCanSas.AddRange(pubSaDelItems.pubCanSas);
- pubCanSaDetails.AddRange(pubSaDelItems.pubCanSaDetails);
- pubNotSaDetails.AddRange(pubSaDelItems.pubNotSaDetails);
- }
- catch (Exception)
- {
- throw;
- }
-
- //删除
- if (pubSas.Any())
- {
- await _repository.DeleteManyAsync(pubSas);
- }
- if (pubSaDetails.Any())
- {
- await _pubSaDetailRepository.DbContext.BulkDeleteAsync(pubSaDetails).ConfigureAwait(false);
- }
- if (pubCanSas.Any())
- {
- await _pubCanSaRepository.DeleteManyAsync(pubCanSas);
- }
- if (pubCanSaDetails.Any())
- {
- await _pubCanSaDetailRepository.DbContext.BulkDeleteAsync(pubCanSaDetails).ConfigureAwait(false);
- }
- if (pubNotSaDetails.Any())
- {
- await _pubNotSaDetailRepository.DbContext.BulkDeleteAsync(pubNotSaDetails).ConfigureAwait(false);
- }
- }
-
///
/// 删除
///
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisBBACSeSyncBaseAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisBBACSeSyncBaseAppService.cs
index 8a67bef4..5891d4a9 100644
--- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisBBACSeSyncBaseAppService.cs
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisBBACSeSyncBaseAppService.cs
@@ -114,7 +114,7 @@ public class JisBBACSeSyncBaseAppService : ApplicationService, IInvocable
var luRePartCodes = jisSeDetails.Where(t => !string.IsNullOrEmpty(t.LU) && !string.IsNullOrEmpty(t.FactoryPartCode)).Select(t => new { t.LU, t.FactoryPartCode }).Distinct().ToList();
if (luRePartCodes.Any())
{
- var materialRelationships = luRePartCodes.Select(t => new MaterialRelationship(GuidGenerator.Create(), t.LU, "", t.FactoryPartCode, businessType));
+ var materialRelationships = luRePartCodes.Select(t => new MaterialRelationship(GuidGenerator.Create(), t.FactoryPartCode, "", t.LU, businessType));
await this.AddNewMaterialRelationships(materialRelationships).ConfigureAwait(false);
}
@@ -177,7 +177,7 @@ public class JisBBACSeSyncBaseAppService : ApplicationService, IInvocable
var luRePartCodes = jisSeDetails.Where(t => !string.IsNullOrEmpty(t.LU) && !string.IsNullOrEmpty(t.FactoryPartCode)).Select(t => new { t.LU, t.FactoryPartCode }).Distinct().ToList();
if (luRePartCodes.Any())
{
- var materialRelationships = luRePartCodes.Select(t => new MaterialRelationship(GuidGenerator.Create(), t.LU, "", t.FactoryPartCode, businessType));
+ var materialRelationships = luRePartCodes.Select(t => new MaterialRelationship(GuidGenerator.Create(), t.FactoryPartCode, "", t.LU, businessType));
await this.AddNewMaterialRelationships(materialRelationships).ConfigureAwait(false);
}
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisHBPOSeSyncBaseAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisHBPOSeSyncBaseAppService.cs
index 911506fa..e2e3c19a 100644
--- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisHBPOSeSyncBaseAppService.cs
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisHBPOSeSyncBaseAppService.cs
@@ -114,7 +114,7 @@ public class JisHBPOSeSyncBaseAppService : ApplicationService, IInvocable
var luRePartCodes = jisSeDetails.Where(t => !string.IsNullOrEmpty(t.LU) && !string.IsNullOrEmpty(t.FactoryPartCode)).Select(t => new { t.LU, t.FactoryPartCode }).Distinct().ToList();
if (luRePartCodes.Any())
{
- var materialRelationships = luRePartCodes.Select(t => new MaterialRelationship(GuidGenerator.Create(), t.LU, "", t.FactoryPartCode, businessType));
+ var materialRelationships = luRePartCodes.Select(t => new MaterialRelationship(GuidGenerator.Create(), t.FactoryPartCode, "", t.LU, businessType));
await this.AddNewMaterialRelationships(materialRelationships).ConfigureAwait(false);
}
@@ -177,7 +177,7 @@ public class JisHBPOSeSyncBaseAppService : ApplicationService, IInvocable
var luRePartCodes = jisSeDetails.Where(t => !string.IsNullOrEmpty(t.LU) && !string.IsNullOrEmpty(t.FactoryPartCode)).Select(t => new { t.LU, t.FactoryPartCode }).Distinct().ToList();
if (luRePartCodes.Any())
{
- var materialRelationships = luRePartCodes.Select(t => new MaterialRelationship(GuidGenerator.Create(), t.LU, "", t.FactoryPartCode, businessType));
+ var materialRelationships = luRePartCodes.Select(t => new MaterialRelationship(GuidGenerator.Create(), t.FactoryPartCode, "", t.LU, businessType));
await this.AddNewMaterialRelationships(materialRelationships).ConfigureAwait(false);
}
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JitSeSyncAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JitSeSyncAppService.cs
index 591537a8..6302dc9d 100644
--- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JitSeSyncAppService.cs
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JitSeSyncAppService.cs
@@ -110,9 +110,8 @@ public class JitSeSyncAppService : ApplicationService, IInvocable
var luRePartCodes = pubSeDetails.Where(t => !string.IsNullOrEmpty(t.LU) && !string.IsNullOrEmpty(t.FactoryPartCode)).Select(t => new { t.LU, t.FactoryPartCode }).Distinct().ToList();
if (luRePartCodes.Any())
{
- var materialRelationships = luRePartCodes.Select(t => new MaterialRelationship(GuidGenerator.Create(), t.LU, "", t.FactoryPartCode, businessType));
+ var materialRelationships = luRePartCodes.Select(t => new MaterialRelationship(GuidGenerator.Create(), t.FactoryPartCode, "", t.LU, businessType));
await this.AddNewMaterialRelationships(materialRelationships).ConfigureAwait(false);
- //await _materialRelationshipManager.AddNewMaterialRelationships(materialRelationships).ConfigureAwait(false);
}
}
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/VmiAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/VmiAppService.cs
index 0a05c2c7..316d9ef4 100644
--- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/VmiAppService.cs
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/VmiAppService.cs
@@ -6,11 +6,9 @@ using System.IO;
using System.Linq;
using System.Linq.Dynamic.Core;
using System.Reflection;
-using System.Text.Json;
using System.Threading;
using System.Threading.Tasks;
using ClosedXML.Excel;
-using EFCore.BulkExtensions;
using LinqToDB.Data;
using LinqToDB.EntityFrameworkCore;
using Magicodes.ExporterAndImporter.Core;
@@ -692,198 +690,3 @@ public class LogRequestDto : RequestDto
{
public List LogTypes { get; set; } = new List();
}
-
-///
-/// 异步更新库存
-///
-public class VmiAsyncBalanceService : ApplicationService, IJobService, ITransientDependency
-{
- private readonly IServiceProvider _serviceProvider;
-
- public VmiAsyncBalanceService(IServiceProvider serviceProvider)
- {
- this._serviceProvider = serviceProvider;
- }
-
- public async Task Invoke(IServiceProvider serviceProvider)
- {
- using var scope = _serviceProvider.CreateScope();
- var db = scope.ServiceProvider.GetRequiredService();
- using var transaction = db.Database.BeginTransaction();
- try
- {
- var messages = db.Set().Where(o => !o.isConsumed).OrderBy(o => o.Number).ToList();
- var repo = db.Set();
- foreach (var message in messages)
- {
- var log = JsonSerializer.Deserialize(message.Message);
- var balance = db.Set().FirstOrDefault(
- o => o.DeliverBillType == log.DeliverBillType &&
- o.CodeType == log.CodeType &&
- o.DeliverBillType == log.DeliverBillType &&
- o.VinCode == log.VinCode &&
- o.ErpToLoc == log.ErpToLoc &&
- o.OrderNum == log.OrderNum &&
- o.factory == log.factory &&
- o.Configcode == log.Configcode);
- if (balance == null)
- {
- balance = new VmiBalance(GuidGenerator.Create());
- balance.InjectFrom(log);
- await repo.AddAsync(balance).ConfigureAwait(false);
- log.InjectFrom(balance);
- }
- else
- {
- var logType = log.LogType;
-
- var qty = balance.Qty;// + log.ty
- if (logType == VmiLogType.Type100)
- {
- //发运入库,负库存字段需要更新
- if (balance.Qty < decimal.Zero)
- {
- balance.InjectFrom(log);
- }
- }
- else if (logType == VmiLogType.Type300)
- {
- //反结入库,只更新库存
- }
- else if (logType == VmiLogType.Type500)
- {
- //调整入库,更新库存和其他字段
- balance.InjectFrom(log);
- }
- // 更新库存
- balance.Qty = qty;
- if (balance.Qty == decimal.Zero)
- {
- //删除0库存
- repo.Remove(balance);
- }
- if (logType == VmiLogType.Type100 && balance.Qty < decimal.Zero && log.Qty > 0)
- {
- //更新补货
- var log2 = db.Set().FirstOrDefault(o => o.Id == log.Id);
- if (log2 != null)
- {
- log2.IsReplenished = true;
- }
- }
- }
- message.isConsumed = true;
- }
- transaction.Commit();
- }
- catch (Exception ex)
- {
- Console.WriteLine(ex.ToString());
- transaction.Rollback();
- throw;
- }
- }
-}
-
-///
-/// 消息表定时清理
-///
-public class VmiAsyncMessageService : ApplicationService, IJobService, ITransientDependency
-{
- private readonly IServiceProvider _serviceProvider;
-
- public VmiAsyncMessageService(IServiceProvider serviceProvider)
- {
- this._serviceProvider = serviceProvider;
- }
-
- public Task Invoke(IServiceProvider serviceProvider)
- {
- using var scope = _serviceProvider.CreateScope();
- var db = scope.ServiceProvider.GetRequiredService();
- db.Set().Where(o => o.isConsumed).BatchDelete();
- var count = db.Set().Where(o => !o.isConsumed).Count();
- scope.ServiceProvider.GetService>().Clients.All.ServerToClient("VmiBalance", count.ToString(), "");
- return Task.CompletedTask;
- }
-}
-
-///
-/// 库存事务定时备份
-///
-public class VmiLogbackupService : ApplicationService, IJobService, ITransientDependency
-{
- private readonly IServiceProvider _serviceProvider;
-
- public VmiLogbackupService(IServiceProvider serviceProvider)
- {
- this._serviceProvider = serviceProvider;
- }
-
- public Task Invoke(IServiceProvider serviceProvider)
- {
- using var scope = _serviceProvider.CreateScope();
- var db = scope.ServiceProvider.GetRequiredService();
- using var transaction = db.Database.BeginTransaction();
- try
- {
- var task = db.Set().FirstOrDefault(o => o.Number == "Set_VmiLog");
- if (task != null)
- {
- var now = DateTime.Now;
- task.LastUpdate = now;
- var query = db.Set().Where(o => o.UpdatedTime >= task.LastUpdate && o.UpdatedTime < now);
- foreach (var item in query)
- {
- //同步到questdb
- }
- }
- }
- catch
- {
- transaction.Rollback();
- throw;
- }
- return Task.CompletedTask;
- }
-}
-
-///
-/// 库存余额定时备份
-///
-public class VmiLogBalanceService : ApplicationService, IJobService, ITransientDependency
-{
- private readonly IServiceProvider _serviceProvider;
-
- public VmiLogBalanceService(IServiceProvider serviceProvider)
- {
- this._serviceProvider = serviceProvider;
- }
-
- public Task Invoke(IServiceProvider serviceProvider)
- {
- using var scope = _serviceProvider.CreateScope();
- var db = scope.ServiceProvider.GetRequiredService();
- using var transaction = db.Database.BeginTransaction();
- try
- {
- var task = db.Set().FirstOrDefault(o => o.Number == "Set_VmiBalance");
- if (task != null)
- {
- var now = DateTime.Now;
- task.LastUpdate = now;
- var query = db.Set().Where(o => o.UpdatedTime >= task.LastUpdate && o.UpdatedTime < now);
- foreach (var item in query)
- {
- //同步到questdb
- }
- }
- }
- catch
- {
- transaction.Rollback();
- throw;
- }
- return Task.CompletedTask;
- }
-}
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/VmiAsyncBalanceService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/VmiAsyncBalanceService.cs
new file mode 100644
index 00000000..72848192
--- /dev/null
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/VmiAsyncBalanceService.cs
@@ -0,0 +1,106 @@
+using System;
+using System.Linq;
+using System.Linq.Dynamic.Core;
+using System.Text.Json;
+using System.Threading.Tasks;
+using Magicodes.ExporterAndImporter.Core.Extension;
+using Microsoft.Extensions.DependencyInjection;
+using Omu.ValueInjecter;
+using Volo.Abp.Application.Services;
+using Volo.Abp.DependencyInjection;
+using Win.Sfs.SettleAccount.Entities.BQ.Vmi;
+using Win.Sfs.Shared.RepositoryBase;
+
+namespace Win.Sfs.SettleAccount.Entities.BQ;
+
+///
+/// 异步更新库存
+///
+public class VmiAsyncBalanceService : ApplicationService, IJobService, ITransientDependency
+{
+ private readonly IServiceProvider _serviceProvider;
+
+ public VmiAsyncBalanceService(IServiceProvider serviceProvider)
+ {
+ this._serviceProvider = serviceProvider;
+ }
+
+ public async Task Invoke(IServiceProvider serviceProvider)
+ {
+ using var scope = _serviceProvider.CreateScope();
+ var db = scope.ServiceProvider.GetRequiredService();
+ using var transaction = db.Database.BeginTransaction();
+ try
+ {
+ var messages = db.Set().Where(o => !o.isConsumed).OrderBy(o => o.Number).ToList();
+ var repo = db.Set();
+ foreach (var message in messages)
+ {
+ var log = JsonSerializer.Deserialize(message.Message);
+ var balance = db.Set().FirstOrDefault(
+ o => o.DeliverBillType == log.DeliverBillType &&
+ o.CodeType == log.CodeType &&
+ o.DeliverBillType == log.DeliverBillType &&
+ o.VinCode == log.VinCode &&
+ o.ErpToLoc == log.ErpToLoc &&
+ o.OrderNum == log.OrderNum &&
+ o.factory == log.factory &&
+ o.Configcode == log.Configcode);
+ if (balance == null)
+ {
+ balance = new VmiBalance(GuidGenerator.Create());
+ balance.InjectFrom(log);
+ await repo.AddAsync(balance).ConfigureAwait(false);
+ log.InjectFrom(balance);
+ }
+ else
+ {
+ var logType = log.LogType;
+
+ var qty = balance.Qty;// + log.ty
+ if (logType == VmiLogType.Type100)
+ {
+ //发运入库,负库存字段需要更新
+ if (balance.Qty < decimal.Zero)
+ {
+ balance.InjectFrom(log);
+ }
+ }
+ else if (logType == VmiLogType.Type300)
+ {
+ //反结入库,只更新库存
+ }
+ else if (logType == VmiLogType.Type500)
+ {
+ //调整入库,更新库存和其他字段
+ balance.InjectFrom(log);
+ }
+ // 更新库存
+ balance.Qty = qty;
+ if (balance.Qty == decimal.Zero)
+ {
+ //删除0库存
+ repo.Remove(balance);
+ }
+ if (logType == VmiLogType.Type100 && balance.Qty < decimal.Zero && log.Qty > 0)
+ {
+ //更新补货
+ var log2 = db.Set().FirstOrDefault(o => o.Id == log.Id);
+ if (log2 != null)
+ {
+ log2.IsReplenished = true;
+ }
+ }
+ }
+ message.isConsumed = true;
+ }
+ transaction.Commit();
+ }
+ catch (Exception ex)
+ {
+ Console.WriteLine(ex.ToString());
+ transaction.Rollback();
+ throw;
+ }
+ }
+}
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/VmiAsyncMessageService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/VmiAsyncMessageService.cs
new file mode 100644
index 00000000..8196fc31
--- /dev/null
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/VmiAsyncMessageService.cs
@@ -0,0 +1,116 @@
+using System;
+using System.Linq;
+using System.Linq.Dynamic.Core;
+using System.Threading.Tasks;
+using EFCore.BulkExtensions;
+using Microsoft.AspNetCore.SignalR;
+using Microsoft.Extensions.DependencyInjection;
+using SettleAccount.Job.SignalR;
+using Volo.Abp.Application.Services;
+using Volo.Abp.DependencyInjection;
+using Win.Sfs.SettleAccount.Entities.BQ.Vmi;
+
+namespace Win.Sfs.SettleAccount.Entities.BQ;
+
+///
+/// 消息表定时清理
+///
+public class VmiAsyncMessageService : ApplicationService, IJobService, ITransientDependency
+{
+ private readonly IServiceProvider _serviceProvider;
+
+ public VmiAsyncMessageService(IServiceProvider serviceProvider)
+ {
+ this._serviceProvider = serviceProvider;
+ }
+
+ public Task Invoke(IServiceProvider serviceProvider)
+ {
+ using var scope = _serviceProvider.CreateScope();
+ var db = scope.ServiceProvider.GetRequiredService();
+ db.Set().Where(o => o.isConsumed).BatchDelete();
+ var count = db.Set().Where(o => !o.isConsumed).Count();
+ scope.ServiceProvider.GetService>().Clients.All.ServerToClient("VmiBalance", count.ToString(), "");
+ return Task.CompletedTask;
+ }
+}
+
+///
+/// 库存事务定时备份
+///
+public class VmiLogbackupService : ApplicationService, IJobService, ITransientDependency
+{
+ private readonly IServiceProvider _serviceProvider;
+
+ public VmiLogbackupService(IServiceProvider serviceProvider)
+ {
+ this._serviceProvider = serviceProvider;
+ }
+
+ public Task Invoke(IServiceProvider serviceProvider)
+ {
+ using var scope = _serviceProvider.CreateScope();
+ var db = scope.ServiceProvider.GetRequiredService();
+ using var transaction = db.Database.BeginTransaction();
+ try
+ {
+ var task = db.Set().FirstOrDefault(o => o.Number == "Set_VmiLog");
+ if (task != null)
+ {
+ var now = DateTime.Now;
+ task.LastUpdate = now;
+ var query = db.Set().Where(o => o.UpdatedTime >= task.LastUpdate && o.UpdatedTime < now);
+ foreach (var item in query)
+ {
+ //同步到questdb
+ }
+ }
+ }
+ catch
+ {
+ transaction.Rollback();
+ throw;
+ }
+ return Task.CompletedTask;
+ }
+}
+
+///
+/// 库存余额定时备份
+///
+public class VmiLogBalanceService : ApplicationService, IJobService, ITransientDependency
+{
+ private readonly IServiceProvider _serviceProvider;
+
+ public VmiLogBalanceService(IServiceProvider serviceProvider)
+ {
+ this._serviceProvider = serviceProvider;
+ }
+
+ public Task Invoke(IServiceProvider serviceProvider)
+ {
+ using var scope = _serviceProvider.CreateScope();
+ var db = scope.ServiceProvider.GetRequiredService();
+ using var transaction = db.Database.BeginTransaction();
+ try
+ {
+ var task = db.Set().FirstOrDefault(o => o.Number == "Set_VmiBalance");
+ if (task != null)
+ {
+ var now = DateTime.Now;
+ task.LastUpdate = now;
+ var query = db.Set().Where(o => o.UpdatedTime >= task.LastUpdate && o.UpdatedTime < now);
+ foreach (var item in query)
+ {
+ //同步到questdb
+ }
+ }
+ }
+ catch
+ {
+ transaction.Rollback();
+ throw;
+ }
+ return Task.CompletedTask;
+ }
+}
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/ImportExcelCommon/ExportImporter.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/ImportExcelCommon/ExportImporter.cs
index 8efe2992..8110cc2b 100644
--- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/ImportExcelCommon/ExportImporter.cs
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/ImportExcelCommon/ExportImporter.cs
@@ -108,7 +108,8 @@ namespace Win.Sfs.SettleAccount.ExcelImporter
}
else
{
- throw new BusinessException("8989", import.Exception.Message.ToString());
+ throw new UserFriendlyException(import.Exception.Message.ToString(), "403");
+ //throw new BusinessException("8989", import.Exception.Message.ToString());
}
}
else
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/PUB_SA.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/PUB_SA.cs
index 2b248ed1..53ca36bc 100644
--- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/PUB_SA.cs
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/PUB_SA.cs
@@ -25,6 +25,12 @@ public class PUB_SA : AuditedAggregateRoot
///
[Display(Name = "业务分类")]
public EnumBusinessType BusinessType { get; set; }
+ ///
+ /// 地点
+ ///
+ [Display(Name = "地点")]
+ [MaxLength(64)]
+ public string Site { get; set; }
public PUB_SA(Guid guid, int version, string billNum, string state)
{
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230823062342_20230823-1.Designer.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230823062342_20230823-1.Designer.cs
new file mode 100644
index 00000000..f00ef6f7
--- /dev/null
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230823062342_20230823-1.Designer.cs
@@ -0,0 +1,5743 @@
+//
+using System;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Metadata;
+using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+using Volo.Abp.EntityFrameworkCore;
+using Win.Sfs.SettleAccount;
+
+namespace Win.Sfs.SettleAccount.Migrations
+{
+ [DbContext(typeof(SettleAccountDbContext))]
+ [Migration("20230823062342_20230823-1")]
+ partial class _202308231
+ {
+ protected override void BuildTargetModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder
+ .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.SqlServer)
+ .HasAnnotation("Relational:MaxIdentifierLength", 128)
+ .HasAnnotation("ProductVersion", "5.0.17")
+ .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
+
+ modelBuilder.Entity("SettleAccount.Domain.BQ.BBAC_CAN_SA", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("BillNum")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("BusinessType")
+ .HasColumnType("int");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)")
+ .HasColumnName("ConcurrencyStamp");
+
+ b.Property("CreationTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("CreationTime");
+
+ b.Property("CreatorId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("CreatorId");
+
+ b.Property("ExtraProperties")
+ .HasColumnType("nvarchar(max)")
+ .HasColumnName("ExtraProperties");
+
+ b.Property("InvGroupNum")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("LastModificationTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("LastModificationTime");
+
+ b.Property("LastModifierId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("LastModifierId");
+
+ b.Property("SettleBillNum")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("Site")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("State")
+ .HasMaxLength(50)
+ .HasColumnType("int");
+
+ b.Property("Version")
+ .HasColumnType("int");
+
+ b.HasKey("Id");
+
+ b.ToTable("Set_BBAC_CAN_SA");
+ });
+
+ modelBuilder.Entity("SettleAccount.Domain.BQ.BBAC_CAN_SA_DETAIL", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("BillNum")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("BusinessType")
+ .HasColumnType("int");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)")
+ .HasColumnName("ConcurrencyStamp");
+
+ b.Property("ContractDocID")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("CreationTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("CreationTime");
+
+ b.Property("CreatorId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("CreatorId");
+
+ b.Property("ErpLoc")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("ExtraProperties")
+ .HasColumnType("nvarchar(max)")
+ .HasColumnName("ExtraProperties");
+
+ b.Property("GroupNum")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("InvGroupNum")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("InvbillNum")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("IsMaiDan")
+ .HasColumnType("bit");
+
+ b.Property("IsReturn")
+ .HasMaxLength(50)
+ .HasColumnType("bit");
+
+ b.Property("KeyCode")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("LU")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("LastModificationTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("LastModificationTime");
+
+ b.Property("LastModifierId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("LastModifierId");
+
+ b.Property("PN")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("PartCode")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Price")
+ .HasColumnType("decimal(18,2)");
+
+ b.Property("Qty")
+ .HasColumnType("decimal(18,2)");
+
+ b.Property("RealPartCode")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("SettleBillNum")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("SettleDate")
+ .HasColumnType("datetime2");
+
+ b.Property("Site")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("Version")
+ .HasColumnType("int");
+
+ b.HasKey("Id");
+
+ b.ToTable("Set_BBAC_CAN_SA_DETAIL");
+ });
+
+ modelBuilder.Entity("SettleAccount.Domain.BQ.BBAC_NOT_SA_DETAIL", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("BusinessType")
+ .HasColumnType("int");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)")
+ .HasColumnName("ConcurrencyStamp");
+
+ b.Property("ContractDocID")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("CreationTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("CreationTime");
+
+ b.Property("CreatorId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("CreatorId");
+
+ b.Property("ErpLoc")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("ExtraProperties")
+ .HasColumnType("nvarchar(max)")
+ .HasColumnName("ExtraProperties");
+
+ b.Property("GroupNum")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("InvGroupNum")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("IsMaiDan")
+ .HasColumnType("bit");
+
+ b.Property("IsReturn")
+ .HasMaxLength(50)
+ .HasColumnType("bit");
+
+ b.Property("KeyCode")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("LU")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("LastModificationTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("LastModificationTime");
+
+ b.Property("LastModifierId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("LastModifierId");
+
+ b.Property("PN")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("PartCode")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Price")
+ .HasColumnType("decimal(18,2)");
+
+ b.Property("Qty")
+ .HasColumnType("decimal(18,2)");
+
+ b.Property("RealPartCode")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("SettleBillNum")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("SettleDate")
+ .HasColumnType("datetime2");
+
+ b.Property("Site")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("Version")
+ .HasColumnType("int");
+
+ b.HasKey("Id");
+
+ b.ToTable("Set_BBAC_NOT_SA_DETAIL");
+ });
+
+ modelBuilder.Entity("SettleAccount.Domain.BQ.BBAC_PD", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("BillNum")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)")
+ .HasColumnName("ConcurrencyStamp");
+
+ b.Property("CreationTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("CreationTime");
+
+ b.Property("CreatorId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("CreatorId");
+
+ b.Property("DeleterId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("DeleterId");
+
+ b.Property("DeletionTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("DeletionTime");
+
+ b.Property("ExtraProperties")
+ .HasColumnType("nvarchar(max)")
+ .HasColumnName("ExtraProperties");
+
+ b.Property("InvGroupNum")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("IsDeleted")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bit")
+ .HasDefaultValue(false)
+ .HasColumnName("IsDeleted");
+
+ b.Property("LastModificationTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("LastModificationTime");
+
+ b.Property("LastModifierId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("LastModifierId");
+
+ b.Property("SettleBillNum")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("Site")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("State")
+ .HasColumnType("int");
+
+ b.Property("Version")
+ .HasColumnType("int");
+
+ b.HasKey("Id");
+
+ b.ToTable("Set_BBAC_PD");
+ });
+
+ modelBuilder.Entity("SettleAccount.Domain.BQ.BBAC_PD_DETAIL", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("BillNum")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)")
+ .HasColumnName("ConcurrencyStamp");
+
+ b.Property("CreationTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("CreationTime");
+
+ b.Property("CreatorId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("CreatorId");
+
+ b.Property("DeleterId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("DeleterId");
+
+ b.Property("DeletionTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("DeletionTime");
+
+ b.Property("Extend1")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Extend2")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Extend3")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Extend4")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("ExtraProperties")
+ .HasColumnType("nvarchar(max)")
+ .HasColumnName("ExtraProperties");
+
+ b.Property("GroupNum")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("InvGroupNum")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("IsDeleted")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bit")
+ .HasDefaultValue(false)
+ .HasColumnName("IsDeleted");
+
+ b.Property("IsMaiDan")
+ .HasColumnType("bit");
+
+ b.Property("KeyCode")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("LU")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("LastModificationTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("LastModificationTime");
+
+ b.Property("LastModifierId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("LastModifierId");
+
+ b.Property("PN")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("Price")
+ .HasColumnType("decimal(18,2)");
+
+ b.Property("Qty")
+ .HasColumnType("decimal(18,2)");
+
+ b.Property("RELU")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("REPN")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("SettleDate")
+ .HasColumnType("datetime2");
+
+ b.Property("Site")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("Version")
+ .HasColumnType("int");
+
+ b.HasKey("Id");
+
+ b.ToTable("Set_BBAC_PD_DETAIL");
+ });
+
+ modelBuilder.Entity("SettleAccount.Domain.BQ.BBAC_SA", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("BillNum")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("BusinessType")
+ .HasColumnType("int");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)")
+ .HasColumnName("ConcurrencyStamp");
+
+ b.Property("CreationTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("CreationTime");
+
+ b.Property("CreatorId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("CreatorId");
+
+ b.Property("DNBillNum")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("ExtraProperties")
+ .HasColumnType("nvarchar(max)")
+ .HasColumnName("ExtraProperties");
+
+ b.Property("LastModificationTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("LastModificationTime");
+
+ b.Property("LastModifierId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("LastModifierId");
+
+ b.Property("Site")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("State")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("Version")
+ .HasColumnType("int");
+
+ b.HasKey("Id");
+
+ b.ToTable("Set_BBAC_SA");
+ });
+
+ modelBuilder.Entity("SettleAccount.Domain.BQ.BBAC_SA_DETAIL", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("BillNum")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("BusinessType")
+ .HasColumnType("int");
+
+ b.Property("Category")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)")
+ .HasColumnName("ConcurrencyStamp");
+
+ b.Property("CreationTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("CreationTime");
+
+ b.Property("CreatorId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("CreatorId");
+
+ b.Property("ExtraProperties")
+ .HasColumnType("nvarchar(max)")
+ .HasColumnName("ExtraProperties");
+
+ b.Property("GroupNum")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("IsReturn")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("KeyCode")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("LU")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("LastModificationTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("LastModificationTime");
+
+ b.Property("LastModifierId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("LastModifierId");
+
+ b.Property("PN")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("PartCode")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Price")
+ .HasColumnType("decimal(18,2)");
+
+ b.Property("Qty")
+ .HasColumnType("decimal(18,2)");
+
+ b.Property("SettleDate")
+ .HasColumnType("datetime2");
+
+ b.Property("Site")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("Version")
+ .HasColumnType("int");
+
+ b.HasKey("Id");
+
+ b.ToTable("Set_BBAC_SA_DETAIL");
+ });
+
+ modelBuilder.Entity("SettleAccount.Domain.BQ.BBAC_SE_DETAIL", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("AssembleData")
+ .HasColumnType("datetime2");
+
+ b.Property("AssemblyCode")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("Batch")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("BeginDate")
+ .HasColumnType("datetime2");
+
+ b.Property("BillCharacter")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("BillNum")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("BillTime")
+ .HasColumnType("datetime2");
+
+ b.Property("BillType")
+ .HasColumnType("int");
+
+ b.Property("BusinessType")
+ .HasColumnType("int");
+
+ b.Property("CodeType")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)")
+ .HasColumnName("ConcurrencyStamp");
+
+ b.Property("CreateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("CreationTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("CreationTime");
+
+ b.Property("CreatorId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("CreatorId");
+
+ b.Property("CustPartCode")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("DeleterId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("DeleterId");
+
+ b.Property("DeletionTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("DeletionTime");
+
+ b.Property("DeliverBillType")
+ .HasColumnType("int");
+
+ b.Property("DeliverCode")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("DeliverSubBillType")
+ .HasColumnType("int");
+
+ b.Property("ErpToLoc")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("ExtraProperties")
+ .HasColumnType("nvarchar(max)")
+ .HasColumnName("ExtraProperties");
+
+ b.Property("Factory")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("FactoryPartCode")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("FromLoc")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("InjectionCode")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("IsDeleted")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bit")
+ .HasDefaultValue(false)
+ .HasColumnName("IsDeleted");
+
+ b.Property("IsHaveEdiData")
+ .HasColumnType("bit");
+
+ b.Property("JISNum")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("KeyCode")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("LU")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("LastModificationTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("LastModificationTime");
+
+ b.Property("LastModifierId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("LastModifierId");
+
+ b.Property("MESConfigCode")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("MatchNumber")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Oper")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("OrderNum")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("OrigiCode")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("PN")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("PartCode")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("PartDesc")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("PjsNum")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Position")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("ProType")
+ .HasColumnType("int");
+
+ b.Property("Qty")
+ .HasColumnType("decimal(18,2)");
+
+ b.Property("RealCode")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("RealPartCode")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("RefBillNum")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("RefVinCode")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property