学 赵 1 year ago
parent
commit
4ec07e35d3
  1. 11
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/components/list/index.js
  2. 4
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/invoice/invoice_map_group.js
  3. 3
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/job-service.js
  4. 18
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/router/business.js
  5. 171
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/invoice/invoice_map_group.js
  6. 11
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Constant/ApplicationConsts.cs
  7. 7
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_SA_SERVICE.cs
  8. 7
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_SA_SERVICE.cs
  9. 4
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/JobHostdService.cs
  10. 33
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_SA_SERVICE.cs
  11. 13
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PURCHASE_PRICE_SERVICE.cs
  12. 7
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/TB_RePartsRelationship_SERVICE.cs
  13. 143
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/VmiAppService.cs
  14. 6
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/CodeSettingTables/CodeSettingAppService.cs
  15. 8
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/MaterialRelationships/MaterialRelationshipAppService.cs
  16. 7
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppService.cs
  17. 7
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppServiceBJ.cs
  18. 17
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/TaskJobs/JobAppService.cs
  19. 68
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiBalance.cs
  20. 101
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiLog.cs
  21. 43
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiType.cs
  22. 8
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs
  23. 5035
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230807024652_vmi8.Designer.cs
  24. 391
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230807024652_vmi8.cs
  25. 5048
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230807054442_vmi9.Designer.cs
  26. 62
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230807054442_vmi9.cs
  27. 138
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/SettleAccountDbContextModelSnapshot.cs

11
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/components/list/index.js

@ -421,7 +421,7 @@ export default {
downLineEndDateTime: "", downLineEndDateTime: "",
ln: "", ln: "",
pn: "", pn: "",
enumBusinessType: route.meta.enumBusinessType, businessType: route.meta.businessType,
}; };
const exportModel = ref(defaultExportModel); const exportModel = ref(defaultExportModel);
const defaultImportModel = config.import?.schema ? schemaToModel(config.import.schema) : {}; const defaultImportModel = config.import?.schema ? schemaToModel(config.import.schema) : {};
@ -689,7 +689,7 @@ export default {
formData.append(q, importModel.value[q]); formData.append(q, importModel.value[q]);
} }
}); });
if (config.query.schema.properties.businessType.default) { if (config.query.schema.properties.businessType?.default) {
formData.append("businessType", config.query.schema.properties.businessType.default); formData.append("businessType", config.query.schema.properties.businessType.default);
} }
for (let i = 0; i < fileList.value.length; i++) { for (let i = 0; i < fileList.value.length; i++) {
@ -836,9 +836,10 @@ export default {
} }
function isNotJit() { function isNotJit() {
return ( return (
route.meta.enumBusinessType !== "ZhiGongJian" || route.meta.businessType !== 3 ||
route.meta.enumBusinessType !== "BeiJian" || route.meta.businessType !== 4 ||
route.meta.enumBusinessType !== "YingDuJian" route.meta.businessType !== 7 ||
route.meta.businessType !== 8
); );
} }
onMounted(async () => { onMounted(async () => {

4
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/invoice/invoice_map_group.js

@ -40,11 +40,13 @@ const exportUrl = "settleaccount/invoice_service/export";
const rejectUrl = "settleaccount/invoice_service/reject"; const rejectUrl = "settleaccount/invoice_service/reject";
const passedUrl = "settleaccount/invoice_service/approval-passed"; const passedUrl = "settleaccount/invoice_service/approval-passed";
const sync_qadUrl = "settleaccount/invoice_service/sync_qad"; const sync_qadUrl = "settleaccount/invoice_service/sync_qad";
const importJsonUrl = "settleaccount/vmi/excel-to-json";
const queryMethod = "POST"; const queryMethod = "POST";
const exportMethod = "POST"; const exportMethod = "POST";
const rejectMethod = "POST"; const rejectMethod = "POST";
const passedMethod = "POST"; const passedMethod = "POST";
const sync_qadMethod = "POST"; const sync_qadMethod = "POST";
const importJsonMethod = "POST";
export default function () { export default function () {
return { return {
@ -109,10 +111,12 @@ export default function () {
rejectUrl, rejectUrl,
passedUrl, passedUrl,
sync_qadUrl, sync_qadUrl,
importJsonUrl,
exportMethod, exportMethod,
rejectMethod, rejectMethod,
passedMethod, passedMethod,
sync_qadMethod, sync_qadMethod,
importJsonMethod,
schema: schema, schema: schema,
}, },
}; };

3
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/job-service.js

@ -29,7 +29,8 @@ const schema = {
}, },
createdAt: { createdAt: {
title: "创建时间", title: "创建时间",
type: "DateTime", type: "string",
input: "datetime",
}, },
remark: { remark: {
title: "说明", title: "说明",

18
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/router/business.js

@ -1211,7 +1211,7 @@ export default [
path: "hbpo_jit_pub_sa_detail_service", path: "hbpo_jit_pub_sa_detail_service",
meta: { meta: {
type: "page", type: "page",
title: "HBPO结算数据明细", title: "4",
icon: "file", icon: "file",
isHidden: true, isHidden: true,
}, },
@ -1291,7 +1291,7 @@ export default [
type: "page", type: "page",
title: "BBAC发运与结算比对", title: "BBAC发运与结算比对",
icon: "file", icon: "file",
enumBusinessType: "ZhiGongJian", businessType: 3,
}, },
children: [ children: [
{ {
@ -1346,7 +1346,7 @@ export default [
type: "page", type: "page",
title: "HBPO发运与结算比对", title: "HBPO发运与结算比对",
icon: "file", icon: "file",
enumBusinessType: "ZhiGongJian", businessType: 4,
}, },
children: [ children: [
{ {
@ -1778,7 +1778,7 @@ export default [
type: "page", type: "page",
title: "发运与结算比对", title: "发运与结算比对",
icon: "file", icon: "file",
enumBusinessType: "BeiJian", businessType: 7,
}, },
children: [ children: [
{ {
@ -2210,7 +2210,7 @@ export default [
type: "page", type: "page",
title: "发运与结算比对", title: "发运与结算比对",
icon: "file", icon: "file",
enumBusinessType: "YingDuJian", businessType: 8,
}, },
children: [ children: [
{ {
@ -2551,14 +2551,6 @@ export default [
pattern: "paged", pattern: "paged",
}, },
}, },
{
path: "reopen",
meta: {
type: "button",
title: "重开",
icon: "file",
},
},
], ],
}, },
{ {

171
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/invoice/invoice_map_group.js

@ -1,43 +1,123 @@
import AppList from "../../../components/list/index.js"; import AppList from "../../../components/list/index.js";
import html from "html"; import html from "html";
import { ref } from "vue"; import { reactive, ref } from "vue";
import useConfig from "../../../models/invoice/invoice_map_group.js"; import useConfig from "../../../models/invoice/invoice_map_group.js";
import request from "../../../request/index.js"; import request from "../../../request/index.js";
import AppTable from "../../components/table/index.js"; import AppTable from "../../components/table/index.js";
import { ElMessageBox } from "element-plus";
export default { export default {
components: { AppList, AppTable }, components: { AppList, AppTable },
template: html`<app-list :config="config" @command="onCommand" /> template: html`<app-list :config="config" @command="onCommand" />
<el-drawer v-model="drawer" destroy-on-close size="50%" class="page-drawer"> <el-drawer v-model="drawer" destroy-on-close size="50%" class="page-drawer">
<template #header> <span class="el-dialog__title"> INVOICE_GRP_DETAIL_DTO </span> </template> <template #header> <span class="el-dialog__title"> 结算明细 </span> </template>
<el-row style="height:calc(100vh - 160px);" v-loading="loading"> <el-row style="height:calc(100vh - 160px);" v-loading="loading">
<el-col> <el-col>
<el-tabs> <el-tabs>
<el-tab-pane label="invoicE_WAIT_DETAIL" v-if="model.invoicE_WAIT_DETAIL.length"> <el-tab-pane label="发票和结算分组对应关系" v-if="model.invoicE_WAIT_DETAIL.length">
<el-scrollbar> <el-scrollbar>
<app-table :data="model.invoicE_WAIT_DETAIL" :columns="columns1" /> <app-table :data="model.invoicE_WAIT_DETAIL" :columns="columns1" />
</el-scrollbar> </el-scrollbar>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="invoicE_MAP_GROUP" v-if="model.invoicE_MAP_GROUP.length"> <el-tab-pane label="已结分组包含不可结算零件" v-if="model.invoicE_MAP_GROUP.length">
<el-auto-resizer> <el-scrollbar>
<template #default="{ height, width }"> <app-table :data="model.invoicE_MAP_GROUP" :columns="columns2" />
<el-table-v2 :data="model.invoicE_MAP_GROUP" :columns="columns2" :width="width" :height="height" /> </el-scrollbar>
</template>
</el-auto-resizer>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="invoicE_NOT_SETTLE" v-if="model.invoicE_NOT_SETTLE.length"> <el-tab-pane label="invoicE_NOT_SETTLE" v-if="model.invoicE_NOT_SETTLE.length">
<el-auto-resizer> <el-scrollbar>
<template #default="{ height, width }"> <app-table :data="model.invoicE_NOT_SETTLE" :columns="columns3" />
<el-table-v2 :data="model.invoicE_NOT_SETTLE" :columns="columns3" :width="width" :height="height" /> </el-scrollbar>
</template>
</el-auto-resizer>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
</el-col> </el-col>
</el-row> </el-row>
<template #footer> <template #footer>
<span class="dialog-footer"> <span class="dialog-footer">
<el-button type="primary" @click="drawer=false"> {{$t('confirm')}} </el-button> <el-button type="primary" @click="drawer=false"> 返回 </el-button>
<el-button
type="primary"
@click="dialogVisible = true"
v-if="model.adJ_DETAIL.length===0&&prop==='invbillNum'"
>
重开
</el-button>
<el-dialog v-model="dialogVisible" title="发票调整明细" width="50%" :before-close="handleClose">
<template #title>
<div style="display: flex; justify-content: space-between; align-items: center;">
<span>发票调整明细</span>
<span>
<el-button type="primary" @click="innerVisible = true" style="margin-left: auto;">新建</el-button>
<el-button type="primary" @click="openImport = true" style="margin-left: 10px;">导入 </el-button>
<el-button type="primary" @click="deleteRow" style="margin-left: 10px;">删除</el-button>
<el-button type="primary" @click="dialogVisible = false" style="margin-left: 10px;">关闭</el-button>
</span>
</div>
</template>
<el-table :data="invoiceValue">
<el-table-column type="selection" width="50">
<el-checkbox v-model="selectedRows"></el-checkbox>
</el-table-column>
<el-table-column property="oldInvBillNum" label="作废发票号" />
<el-table-column property="invBillNum" label="发票号" />
<el-table-column property="settleDate" label="下线日期" />
<el-table-column property="invGroupNum" label="发票分组号" />
<el-table-column property="lu" label="零件号" />
<el-table-column property="pn" label="标识号" />
<el-table-column property="qty" label="数量" />
<el-table-column property="groupNum" label="结算分组" />
</el-table>
<el-dialog v-model="innerVisible" width="45%" title="新建数据">
<el-form :inline="true" :model="formInline" label-width="100px">
<span>
<el-button type="primary" @click="submitForm">提交</el-button>
<el-button type="primary" @click="">下一页</el-button>
</span>
<el-form-item label="作废发票号">
<el-input v-model="formInline.oldInvBillNum"></el-input>
</el-form-item>
<el-form-item label="发票号">
<el-input v-model.number="formInline.invBillNum " type="string"></el-input>
</el-form-item>
<el-form-item label="下线日期">
<el-input v-model.number="formInline.settleDate " type="string"></el-input>
</el-form-item>
<el-form-item label="发票分组号">
<el-input v-model.number="formInline.invGroupNum " type="string"></el-input>
</el-form-item>
<el-form-item label="零件号">
<el-input v-model.number="formInline.lu" type="string"></el-input>
</el-form-item>
<el-form-item label="标识号">
<el-input v-model.number="formInline.pn" type="string"></el-input>
</el-form-item>
<el-form-item label="数量">
<el-input v-model.number="formInline.qty" type="number"></el-input>
</el-form-item>
<el-form-item label="结算分组">
<el-input v-model.number="formInline.groupNum " type="string"></el-input>
</el-form-item>
</el-form>
</el-dialog>
<el-dialog v-model="openImport" width="30%">
<app-form>
<el-form-item :label="$t('文件')" label-width="80px">
<el-upload
ref="uploadRef"
class="upload"
drag
accept=".xlsx"
:auto-upload="false"
:on-change="handleChange"
>
<el-icon class="el-icon--upload"><ep-upload-filled /></el-icon>
</el-upload>
<el-button type="primary" @click="openImportHandler" style="margin-left: 10px;">确定</el-button>
</el-form-item>
</app-form>
</el-dialog>
<el-button type="primary" @click="dialogVisible = false" style="margin-left: 10px;">下一页</el-button>
</el-dialog>
</span> </span>
</template> </template>
</el-drawer>`, </el-drawer>`,
@ -53,6 +133,51 @@ export default {
} }
</style>`, </style>`,
setup() { setup() {
const openImportHandler = async () => {
const data = {};
const response = await request("settleaccount/vmi/excel-to-json", data, { method: "POST" });
console.log(response.data);
};
const formInline = reactive({
oldInvBillNum: "",
invBillNum: "",
settleDate: "",
invGroupNum: "",
lu: "",
pn: "",
qty: null,
groupNum: "",
});
//create
const submitForm = () => {
const newFormInline = { ...formInline };
invoiceValue.value.push(newFormInline);
Object.keys(formInline).forEach((key) => {
delete formInline[key];
});
innerVisible.value = false;
};
//delete
const selectedRows = ref([]);
const invoiceValue = ref([]);
const deleteRow = () => {
const indexes = selectedRows.value.map((row) => invoiceValue.value.indexOf(row));
indexes.sort((a, b) => b - a);
indexes.forEach((index) => {
invoiceValue.value.splice(index, 1);
});
selectedRows.value = [];
};
const innerVisible = ref(false);
const openImport = ref(false);
const dialogVisible = ref(false);
const handleClose = (done) => {
ElMessageBox.confirm("确认关闭")
.then(() => {
done();
})
.catch(() => {});
};
const config = useConfig(); const config = useConfig();
const drawer = ref(false); const drawer = ref(false);
const loading = ref(false); const loading = ref(false);
@ -60,8 +185,11 @@ export default {
invoicE_WAIT_DETAIL: [], invoicE_WAIT_DETAIL: [],
invoicE_MAP_GROUP: [], invoicE_MAP_GROUP: [],
invoicE_NOT_SETTLE: [], invoicE_NOT_SETTLE: [],
adJ_DETAIL: [],
}); });
const prop = ref("");
const onCommand = async (item, rows) => { const onCommand = async (item, rows) => {
prop.value = item.path;
drawer.value = true; drawer.value = true;
loading.value = true; loading.value = true;
const data = { [item.path]: rows[0][item.path] }; const data = { [item.path]: rows[0][item.path] };
@ -114,7 +242,7 @@ export default {
title: "发票号", title: "发票号",
}, },
{ {
dataKey: "inGroupNum", dataKey: "invGroupNum",
title: "发票分组号", title: "发票分组号",
}, },
{ {
@ -157,6 +285,17 @@ export default {
columns1, columns1,
columns2, columns2,
columns3, columns3,
innerVisible,
dialogVisible,
handleClose,
prop,
formInline,
submitForm,
invoiceValue,
deleteRow,
selectedRows,
openImport,
openImportHandler,
}; };
}, },
}; };

11
code/src/Modules/SettleAccount/src/SettleAccount.Application/Constant/ApplicationConsts.cs

@ -1,4 +1,4 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
@ -112,6 +112,15 @@ namespace Win.Sfs.SettleAccount.Constant
/// </summary> /// </summary>
public const string SuccessStr = "Success"; public const string SuccessStr = "Success";
/// <summary>
/// Success
/// </summary>
public const int SuccessCode = 200;
/// <summary>
/// 导入失败Code
/// </summary>
public const int ImportFailCode = 400;
/// <summary> /// <summary>
/// FIS发出未结算输出表 /// FIS发出未结算输出表

7
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_SA_SERVICE.cs

@ -109,7 +109,7 @@ public class BBAC_SA_SERVICE : SettleAccountApplicationBase<BBAC_SA>
/// 导入 /// 导入
/// </summary> /// </summary>
[HttpPost] [HttpPost]
public async Task<string> ImportAsync([FromForm] IFormFileCollection files) public async Task<IActionResult> ImportAsync([FromForm] IFormFileCollection files)
{ {
#region 导入数据转换、数据校验 #region 导入数据转换、数据校验
ExportImporter _exportImporter = new ExportImporter(); ExportImporter _exportImporter = new ExportImporter();
@ -138,7 +138,8 @@ public class BBAC_SA_SERVICE : SettleAccountApplicationBase<BBAC_SA>
if (checkList.Count > 0) if (checkList.Count > 0)
{ {
return await ExportErrorReportAsync(checkList); string fileName = await ExportErrorReportAsync(checkList);
return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, fileName = fileName });
} }
#endregion #endregion
@ -147,7 +148,7 @@ public class BBAC_SA_SERVICE : SettleAccountApplicationBase<BBAC_SA>
//await SaDataHandleAsync(importBBACSaDetails); //await SaDataHandleAsync(importBBACSaDetails);
} }
return ApplicationConsts.SuccessStr; return new JsonResult(new { Code = 200, Message = "导入成功" });
} }
#endregion #endregion

7
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_SA_SERVICE.cs

@ -108,7 +108,7 @@ public class HBPO_SA_SERVICE : SettleAccountApplicationBase<HBPO_SA>
/// 导入 /// 导入
/// </summary> /// </summary>
[HttpPost] [HttpPost]
public async Task<string> ImportAsync([FromForm] IFormFileCollection files) public async Task<IActionResult> ImportAsync([FromForm] IFormFileCollection files)
{ {
#region 导入数据转换、数据校验 #region 导入数据转换、数据校验
ExportImporter _exportImporter = new ExportImporter(); ExportImporter _exportImporter = new ExportImporter();
@ -136,7 +136,8 @@ public class HBPO_SA_SERVICE : SettleAccountApplicationBase<HBPO_SA>
if (checkList.Count > 0) if (checkList.Count > 0)
{ {
return await ExportErrorReportAsync(checkList); string fileName = await ExportErrorReportAsync(checkList);
return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, fileName = fileName });
} }
#endregion #endregion
@ -149,7 +150,7 @@ public class HBPO_SA_SERVICE : SettleAccountApplicationBase<HBPO_SA>
await SaDataHandleAsync(importCN5HBOPSaDetails, "CN5"); await SaDataHandleAsync(importCN5HBOPSaDetails, "CN5");
} }
return ApplicationConsts.SuccessStr; return new JsonResult(new { Code = 200, Message = "导入成功" });
} }
#endregion #endregion

4
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/JobHostdService.cs

@ -7,9 +7,11 @@ using System.Net;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using Cronos; using Cronos;
using Microsoft.AspNetCore.SignalR;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Hosting;
using SettleAccount.Job.SignalR;
using Volo.Abp.Application.Services; using Volo.Abp.Application.Services;
using Win.Sfs.SettleAccount.Entities.BQ.Vmi; using Win.Sfs.SettleAccount.Entities.BQ.Vmi;
@ -86,6 +88,7 @@ public class JobHostdService : BackgroundService, IApplicationService
if (!jobItem.IsRunning) if (!jobItem.IsRunning)
{ {
jobLogId = this.JobItemStart(job.Id); jobLogId = this.JobItemStart(job.Id);
scope.ServiceProvider.GetRequiredService<IHubContext<PageHub>>().Clients.All.ServerToClient("JobItem", "refresh", "");
if (jobLogId.HasValue) if (jobLogId.HasValue)
{ {
try try
@ -100,6 +103,7 @@ public class JobHostdService : BackgroundService, IApplicationService
Console.WriteLine(ex.ToString()); Console.WriteLine(ex.ToString());
this.JobItemFaild(job.Id, jobLogId.Value, ex); this.JobItemFaild(job.Id, jobLogId.Value, ex);
} }
scope.ServiceProvider.GetRequiredService<IHubContext<PageHub>>().Clients.All.ServerToClient("JobItem", "refresh", "");
} }
} }
} }

33
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_SA_SERVICE.cs

@ -107,9 +107,9 @@ public class PUB_SA_SERVICE : SettleAccountApplicationBase<PUB_SA>
/// 导入 /// 导入
/// </summary> /// </summary>
[HttpPost] [HttpPost]
public async Task<string> ImportByBusinessTypeAsync([FromForm] PUB_SAImportRequestDto pubSaImportRequestDto) public async Task<IActionResult> ImportByBusinessTypeAsync([FromForm] PUB_SAImportRequestDto pubSaImportRequestDto)
{ {
string result = string.Empty; IActionResult result = new JsonResult(null);
switch (pubSaImportRequestDto.BusinessType) switch (pubSaImportRequestDto.BusinessType)
{ {
case EnumBusinessType.None: case EnumBusinessType.None:
@ -428,7 +428,7 @@ public class PUB_SA_SERVICE : SettleAccountApplicationBase<PUB_SA>
/// <summary> /// <summary>
/// 直供件BBAC导入 /// 直供件BBAC导入
/// </summary> /// </summary>
private async Task<string> ImportZhiGongJianBBACAsync([FromForm] IFormFileCollection files) private async Task<IActionResult> ImportZhiGongJianBBACAsync([FromForm] IFormFileCollection files)
{ {
#region 导入数据转换 #region 导入数据转换
ExportImporter _exportImporter = new ExportImporter(); ExportImporter _exportImporter = new ExportImporter();
@ -440,7 +440,8 @@ public class PUB_SA_SERVICE : SettleAccountApplicationBase<PUB_SA>
var checkList = await CheckAsync(importPubSaDetails); var checkList = await CheckAsync(importPubSaDetails);
if (checkList.Count > 0) if (checkList.Count > 0)
{ {
return await ExportErrorReportAsync(checkList); string fileName = await ExportErrorReportAsync(checkList);
return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, fileName = fileName });
} }
#endregion #endregion
@ -450,7 +451,7 @@ public class PUB_SA_SERVICE : SettleAccountApplicationBase<PUB_SA>
/// <summary> /// <summary>
/// 直供件HBPO导入 /// 直供件HBPO导入
/// </summary> /// </summary>
private async Task<string> ImportZhiGongJianHBPOAsync([FromForm] IFormFileCollection files) private async Task<IActionResult> ImportZhiGongJianHBPOAsync([FromForm] IFormFileCollection files)
{ {
#region 导入数据转换 #region 导入数据转换
ExportImporter _exportImporter = new ExportImporter(); ExportImporter _exportImporter = new ExportImporter();
@ -469,7 +470,8 @@ public class PUB_SA_SERVICE : SettleAccountApplicationBase<PUB_SA>
var checkList = await CheckAsync(importPubSaDetails); var checkList = await CheckAsync(importPubSaDetails);
if (checkList.Count > 0) if (checkList.Count > 0)
{ {
return await ExportErrorReportAsync(checkList); string fileName = await ExportErrorReportAsync(checkList);
return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, fileName = fileName });
} }
#endregion #endregion
@ -479,7 +481,7 @@ public class PUB_SA_SERVICE : SettleAccountApplicationBase<PUB_SA>
/// <summary> /// <summary>
/// 买单件HBPO导入 /// 买单件HBPO导入
/// </summary> /// </summary>
private async Task<string> ImportMaiDanJianHBPOAsync([FromForm] IFormFileCollection files) private async Task<IActionResult> ImportMaiDanJianHBPOAsync([FromForm] IFormFileCollection files)
{ {
#region 导入数据转换 #region 导入数据转换
ExportImporter _exportImporter = new ExportImporter(); ExportImporter _exportImporter = new ExportImporter();
@ -497,7 +499,8 @@ public class PUB_SA_SERVICE : SettleAccountApplicationBase<PUB_SA>
var checkList = await CheckAsync(importPubSaDetails); var checkList = await CheckAsync(importPubSaDetails);
if (checkList.Count > 0) if (checkList.Count > 0)
{ {
return await ExportErrorReportAsync(checkList); string fileName = await ExportErrorReportAsync(checkList);
return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, fileName = fileName });
} }
#endregion #endregion
@ -507,7 +510,7 @@ public class PUB_SA_SERVICE : SettleAccountApplicationBase<PUB_SA>
/// <summary> /// <summary>
/// 备件导入 /// 备件导入
/// </summary> /// </summary>
private async Task<string> ImportBeiJianAsync([FromForm] IFormFileCollection files) private async Task<IActionResult> ImportBeiJianAsync([FromForm] IFormFileCollection files)
{ {
#region 导入数据转换 #region 导入数据转换
ExportImporter _exportImporter = new ExportImporter(); ExportImporter _exportImporter = new ExportImporter();
@ -525,7 +528,8 @@ public class PUB_SA_SERVICE : SettleAccountApplicationBase<PUB_SA>
var checkList = await CheckAsync(importPubSaDetails); var checkList = await CheckAsync(importPubSaDetails);
if (checkList.Count > 0) if (checkList.Count > 0)
{ {
return await ExportErrorReportAsync(checkList); string fileName = await ExportErrorReportAsync(checkList);
return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, fileName = fileName });
} }
#endregion #endregion
@ -535,7 +539,7 @@ public class PUB_SA_SERVICE : SettleAccountApplicationBase<PUB_SA>
/// <summary> /// <summary>
/// 印度件导入 /// 印度件导入
/// </summary> /// </summary>
private async Task<string> ImportYinDuJianAsync([FromForm] IFormFileCollection files) private async Task<IActionResult> ImportYinDuJianAsync([FromForm] IFormFileCollection files)
{ {
#region 导入数据转换 #region 导入数据转换
ExportImporter _exportImporter = new ExportImporter(); ExportImporter _exportImporter = new ExportImporter();
@ -547,7 +551,8 @@ public class PUB_SA_SERVICE : SettleAccountApplicationBase<PUB_SA>
var checkList = await CheckAsync(importPubSaDetails); var checkList = await CheckAsync(importPubSaDetails);
if (checkList.Count > 0) if (checkList.Count > 0)
{ {
return await ExportErrorReportAsync(checkList); string fileName = await ExportErrorReportAsync(checkList);
return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, fileName = fileName });
} }
#endregion #endregion
@ -580,7 +585,7 @@ public class PUB_SA_SERVICE : SettleAccountApplicationBase<PUB_SA>
/// <summary> /// <summary>
/// 结算数据处理 /// 结算数据处理
/// </summary> /// </summary>
private async Task<string> SaDataHandleAsync(List<PUB_SA_DETAIL> pubSaDetails, EnumBusinessType businessType) private async Task<IActionResult> SaDataHandleAsync(List<PUB_SA_DETAIL> pubSaDetails, EnumBusinessType businessType)
{ {
//客户零件关系 //客户零件关系
var materialRelationships = new List<MaterialRelationship>(); var materialRelationships = new List<MaterialRelationship>();
@ -636,7 +641,7 @@ public class PUB_SA_SERVICE : SettleAccountApplicationBase<PUB_SA>
} }
#endregion #endregion
return ApplicationConsts.SuccessStr; return new JsonResult(new { Code = 200, Message = "导入成功" });
} }
/// <summary> /// <summary>

13
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PURCHASE_PRICE_SERVICE.cs

@ -48,7 +48,7 @@ public class PURCHASE_PRICE_SERVICE : SettleAccountApplicationBase<PURCHASE_PRIC
/// 导入 /// 导入
/// </summary> /// </summary>
[HttpPost] [HttpPost]
public async Task<string> ImportAsync([FromForm] IFormFileCollection files) public async Task<IActionResult> ImportAsync([FromForm] IFormFileCollection files)
{ {
ExportImporter _exportImporter = new ExportImporter(); ExportImporter _exportImporter = new ExportImporter();
var result = await _exportImporter.UploadExcelImport<PURCHASE_PRICE_IMPORT_DTO>(files, _excelImportService); var result = await _exportImporter.UploadExcelImport<PURCHASE_PRICE_IMPORT_DTO>(files, _excelImportService);
@ -68,6 +68,11 @@ public class PURCHASE_PRICE_SERVICE : SettleAccountApplicationBase<PURCHASE_PRIC
checkList.Add(new ErrorExportDto(string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Format("零件号{0}有重复", itm.Key.LU), string.Empty)); checkList.Add(new ErrorExportDto(string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Format("零件号{0}有重复", itm.Key.LU), string.Empty));
} }
} }
if (checkList.Count > 0)
{
string fileName = await ExportErrorReportAsync(checkList);
return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, fileName = fileName });
}
foreach (var itm in _ls) foreach (var itm in _ls)
{ {
var _first = _repository.FirstOrDefault(p => p.LU == itm.LU); var _first = _repository.FirstOrDefault(p => p.LU == itm.LU);
@ -81,11 +86,7 @@ public class PURCHASE_PRICE_SERVICE : SettleAccountApplicationBase<PURCHASE_PRIC
await _repository.InsertAsync(itm); await _repository.InsertAsync(itm);
} }
} }
if (checkList.Count > 0) return new JsonResult(new { Code = 200, Message = "导入成功" });
{
return await ExportErrorReportAsync(checkList);
}
return ApplicationConsts.SuccessStr;
} }
/// <summary> /// <summary>

7
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/TB_RePartsRelationship_SERVICE.cs

@ -58,7 +58,7 @@ public class TB_RePartsRelationship_SERVICE : SettleAccountApplicationBase<TB_Re
/// 导入 /// 导入
/// </summary> /// </summary>
[HttpPost] [HttpPost]
public async Task<string> ImportAsync([FromForm] IFormFileCollection files) public async Task<IActionResult> ImportAsync([FromForm] IFormFileCollection files)
{ {
ExportImporter _exportImporter = new ExportImporter(); ExportImporter _exportImporter = new ExportImporter();
var result = await _exportImporter.UploadExcelImport<TB_RePartsRelationship_IMPORT_DTO>(files, _excelImportService); var result = await _exportImporter.UploadExcelImport<TB_RePartsRelationship_IMPORT_DTO>(files, _excelImportService);
@ -91,7 +91,8 @@ public class TB_RePartsRelationship_SERVICE : SettleAccountApplicationBase<TB_Re
} }
if (checkList.Count > 0) if (checkList.Count > 0)
{ {
return await ExportErrorReportAsync(checkList); string fileName = await ExportErrorReportAsync(checkList);
return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, fileName = fileName });
} }
foreach (var itm in _ls) foreach (var itm in _ls)
{ {
@ -106,7 +107,7 @@ public class TB_RePartsRelationship_SERVICE : SettleAccountApplicationBase<TB_Re
await _repository.InsertAsync(itm); await _repository.InsertAsync(itm);
} }
} }
return ApplicationConsts.SuccessStr; return new JsonResult(new { Code = 200, Message = "导入成功" });
} }
/// <summary> /// <summary>

143
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/VmiAppService.cs

@ -43,9 +43,11 @@ namespace Win.Sfs.SettleAccount.Entities.BQ;
public interface IVmiService : IApplicationService, ITransientDependency, IJobService public interface IVmiService : IApplicationService, ITransientDependency, IJobService
{ {
void Change(VmiLogType logType, VmiType vmiType, string erpToLoc, string partCode, string lu, string number, decimal qty, object source, string groupId); Task In(VmiLogType logType, string changedNumber, VmiBalance data);
void UnDo(string groupId); Task Out(VmiLogType logType, string changedNumber, VmiLog data);
Task UnDo(string groupId);
} }
[AllowAnonymous] [AllowAnonymous]
@ -126,7 +128,7 @@ public class VmiAppService : ApplicationService, IVmiService, IJobService, ITran
[DisableValidation] [DisableValidation]
public virtual Task Invoke(IServiceProvider serviceProvider) public virtual Task Invoke(IServiceProvider serviceProvider)
{ {
this._hubContext.Clients.All.ServerToClient("JobItem", "refresh", ""); //this._hubContext.Clients.All.ServerToClient("JobItem", "refresh", "");
Directory.CreateDirectory(Path.Combine(Directory.GetCurrentDirectory(), "wwwroot/files/vmi")); Directory.CreateDirectory(Path.Combine(Directory.GetCurrentDirectory(), "wwwroot/files/vmi"));
var date = DateTime.Now.ToString("yyyyMMddHH"); var date = DateTime.Now.ToString("yyyyMMddHH");
var connectionString = $"Data Source=wwwroot/files/vmi/{date}.db"; var connectionString = $"Data Source=wwwroot/files/vmi/{date}.db";
@ -141,6 +143,7 @@ public class VmiAppService : ApplicationService, IVmiService, IJobService, ITran
{ {
foreach (var item in query) foreach (var item in query)
{ {
item.BackupTime = DateTime.Now;
list.Add(item); list.Add(item);
if (list.Count == 10000) if (list.Count == 10000)
{ {
@ -163,51 +166,96 @@ public class VmiAppService : ApplicationService, IVmiService, IJobService, ITran
throw; throw;
} }
} }
this._hubContext.Clients.All.ServerToClient("JobItem", "refresh", ""); //this._hubContext.Clients.All.ServerToClient("JobItem", "refresh", "");
return Task.CompletedTask; return Task.CompletedTask;
} }
/// <summary> /// <summary>
/// 入库 /// 发运入库\反结入库\调整入库
/// </summary> /// </summary>
/// <param name="logType">库存事务类型</param> /// <param name="logType"></param>
/// <param name="vmiType">入库出库类型</param> /// <param name="changedNumber"></param>
/// <param name="erpToLoc">唯一索引</param> /// <param name="data"></param>
/// <param name="partCode">唯一索引</param> /// <returns></returns>
/// <param name="lu">唯一索引</param>
/// <param name="number">关联单号</param>
/// <param name="qty">变动数量</param>
/// <param name="source">来源单据</param>
/// <param name="groupId">分组号</param>
[HttpPost] [HttpPost]
[UnitOfWork] public async Task In(VmiLogType logType, string changedNumber, VmiBalance data)
public void Change(VmiLogType logType, VmiType vmiType, string erpToLoc, string partCode, string lu, string number, decimal qty, object source, string groupId) {
var balance = this._balanceRepository.FirstOrDefault(o => o.BillType == data.BillType &&
o.PartCode == data.PartCode &&
o.VinCode == data.VinCode &&
o.ErpToLoc == data.ErpToLoc &&
o.OrderNum == data.OrderNum);
var log = new VmiLog
{
LogType = logType,
ChangedType = VmiType.In,
ChangedNumber = changedNumber,
ChangedTime = DateTime.Now,
ChangedBy = _currentUser.UserName,
ChangedQty = data.Qty,
};
log.InjectFrom(data);
if (balance == null)
{
balance = new VmiBalance();
balance.InjectFrom(data);
balance.SetId();
await _balanceRepository.InsertAsync(balance).ConfigureAwait(false);
}
else
{
var qty = balance.Qty + data.Qty;
balance.InjectFrom(data);
balance.Qty = qty;
this._balanceRepository.UpdateAsync(balance).Wait();
}
await _logRepository.InsertAsync(log).ConfigureAwait(false);
}
/// <summary>
/// 结算出库\退货出库\调整出库
/// </summary>
/// <param name="logType"></param>
/// <param name="changedNumber"></param>
/// <param name="data"></param>
/// <returns></returns>
[HttpPost]
public async Task Out(VmiLogType logType, string changedNumber, VmiLog data)
{ {
var balance = this._balanceRepository.FirstOrDefault(o => o.ErpToLoc == erpToLoc && o.PartCode == partCode && o.LU == lu); var balance = this._balanceRepository.FirstOrDefault(o => o.BillType == data.BillType &&
var log = new VmiLog(GuidGenerator.Create()) o.PartCode == data.PartCode &&
o.VinCode == data.VinCode &&
o.ErpToLoc == data.ErpToLoc &&
o.OrderNum == data.OrderNum);
var log = new VmiLog
{ {
CreatedTime = DateTime.Now,
CreatedBy = _currentUser.UserName,
RelationNumber = number,
Qty = qty,
ChangedType = vmiType,
LogType = logType, LogType = logType,
GroupId = groupId ChangedType = VmiType.Out,
ChangedNumber = changedNumber,
}; };
log.InjectFrom(source); log.InjectFrom(data);
log.LogType = logType;
log.ChangedType = VmiType.Out;
log.ChangedTime = DateTime.Now;
log.ChangedBy = _currentUser.UserName;
log.ChangedQty = data.Qty;
if (balance == null) if (balance == null)
{ {
balance = new VmiBalance(GuidGenerator.Create()) { ErpToLoc = erpToLoc, PartCode = partCode, LU = lu, Qty = qty }; balance = new VmiBalance();
balance.InjectFrom(source); balance.InjectFrom(data);
this._balanceRepository.InsertAsync(balance).Wait(); balance.SetId();
await _balanceRepository.InsertAsync(balance).ConfigureAwait(false);
} }
else else
{ {
balance.Qty += qty; var qty = balance.Qty - data.Qty;
balance.Qty = qty;
this._balanceRepository.UpdateAsync(balance).Wait(); this._balanceRepository.UpdateAsync(balance).Wait();
} }
this._logRepository.InsertAsync(log); await _logRepository.InsertAsync(log).ConfigureAwait(false);
new InfluxHelper(_cfg).Insert(log);
} }
/// <summary> /// <summary>
@ -215,15 +263,34 @@ public class VmiAppService : ApplicationService, IVmiService, IJobService, ITran
/// </summary> /// </summary>
[NonAction] [NonAction]
[UnitOfWork] [UnitOfWork]
public void UnDo(string groupId) public async Task UnDo(string groupId)
{ {
var logs = this._logRepository.Where(o => o.GroupId == groupId).AsNoTracking(); var logList = this._logRepository.Where(o => o.GroupId == groupId).AsNoTracking().OrderBy(o => o.ChangedTime);
foreach (var item in logs) foreach (var item in logList)
{ {
//var balance = this._balanceRepository.FirstOrDefault(o => o.ErpToLoc == item.ErpToLoc&& o.PartCode == item. && o.LU == item.LogType); var balance = this._balanceRepository.FirstOrDefault(o => o.BillType == item.BillType &&
//var log = new VmiLog(); o.PartCode == item.PartCode &&
//log.InjectFrom(item); o.VinCode == item.VinCode &&
//log.CreatedTime = item.CreatedTime; o.ErpToLoc == item.ErpToLoc &&
o.OrderNum == item.OrderNum);
if (balance == null)
{
balance = new VmiBalance();
balance.InjectFrom(item);
await _balanceRepository.InsertAsync(balance).ConfigureAwait(false);
}
else
{
balance.Qty += item.ChangedQty;
this._balanceRepository.UpdateAsync(balance).Wait();
}
var log = new VmiLog();
log.InjectFrom(item);
log.LogType = VmiLogType.Type300;
log.ChangedType = VmiType.In;
log.ChangedTime = DateTime.Now;
log.ChangedBy = _currentUser.UserName;
await _logRepository.InsertAsync(log).ConfigureAwait(false);
} }
} }

6
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/CodeSettingTables/CodeSettingAppService.cs

@ -1,4 +1,4 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
@ -65,7 +65,7 @@ namespace Win.Sfs.SettleAccount.Entities.CodeSettingTables
/// </summary> /// </summary>
[HttpPost] [HttpPost]
[DisableRequestSizeLimit] [DisableRequestSizeLimit]
public async Task<string> CodeSettingUploadExcelImport([FromForm] IFormFileCollection files) public async Task<IActionResult> CodeSettingUploadExcelImport([FromForm] IFormFileCollection files)
{ {
ExportImporter _exportImporter = new ExportImporter(); ExportImporter _exportImporter = new ExportImporter();
var result = await _exportImporter.UploadExcelImport<CodeSettingImportDto>(files, _excelImportService); var result = await _exportImporter.UploadExcelImport<CodeSettingImportDto>(files, _excelImportService);
@ -87,7 +87,7 @@ namespace Win.Sfs.SettleAccount.Entities.CodeSettingTables
} }
var bulkConfig = new BulkConfig { SetOutputIdentity = true, BatchSize = 10000 }; var bulkConfig = new BulkConfig { SetOutputIdentity = true, BatchSize = 10000 };
//_repository.GetDbContext().BulkInsert(_ls, bulkConfig); //_repository.GetDbContext().BulkInsert(_ls, bulkConfig);
return ApplicationConsts.SuccessStr; return new JsonResult(new { Code = 200, Message = "导入成功" });
} }
/// <summary> /// <summary>

8
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/MaterialRelationships/MaterialRelationshipAppService.cs

@ -10,6 +10,7 @@ using Volo.Abp.Application.Dtos;
using Volo.Abp.Caching; using Volo.Abp.Caching;
using Win.Abp.Snowflakes; using Win.Abp.Snowflakes;
using Win.Sfs.BaseData.ImportExcelCommon; using Win.Sfs.BaseData.ImportExcelCommon;
using Win.Sfs.SettleAccount.Bases;
using Win.Sfs.SettleAccount.CommonManagers; using Win.Sfs.SettleAccount.CommonManagers;
using Win.Sfs.SettleAccount.Constant; using Win.Sfs.SettleAccount.Constant;
using Win.Sfs.SettleAccount.Entities.BQ.Dtos; using Win.Sfs.SettleAccount.Entities.BQ.Dtos;
@ -51,7 +52,7 @@ public class MaterialRelationshipAppService : SettleAccountApplicationBase<Mater
/// 导入 /// 导入
/// </summary> /// </summary>
[HttpPost] [HttpPost]
public async Task<string> ImportAsync([FromForm] MaterialRelationshipImportRequestDto materialRelationshipImportRequestDto) public async Task<IActionResult> ImportAsync([FromForm] MaterialRelationshipImportRequestDto materialRelationshipImportRequestDto)
{ {
ExportImporter _exportImporter = new ExportImporter(); ExportImporter _exportImporter = new ExportImporter();
var result = await _exportImporter.UploadExcelImport<MaterialRelationshipImportDto>(materialRelationshipImportRequestDto.Files, _excelImportService); var result = await _exportImporter.UploadExcelImport<MaterialRelationshipImportDto>(materialRelationshipImportRequestDto.Files, _excelImportService);
@ -73,7 +74,8 @@ public class MaterialRelationshipAppService : SettleAccountApplicationBase<Mater
} }
if (checkList.Count > 0) if (checkList.Count > 0)
{ {
return await ExportErrorReportAsync(checkList); string fileName = await ExportErrorReportAsync(checkList);
return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, fileName = fileName });
} }
foreach (var itm in _ls) foreach (var itm in _ls)
{ {
@ -90,7 +92,7 @@ public class MaterialRelationshipAppService : SettleAccountApplicationBase<Mater
await _repository.InsertAsync(itm); await _repository.InsertAsync(itm);
} }
} }
return ApplicationConsts.SuccessStr; return new JsonResult(new { Code = 200, Message = "导入成功" });
} }
/// <summary> /// <summary>

7
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppService.cs

@ -70,7 +70,7 @@ public class PriceListAppService : SettleAccountApplicationBase<PriceList>
/// 导入 /// 导入
/// </summary> /// </summary>
[HttpPost] [HttpPost]
public virtual async Task<string> ImportAsync([FromForm] IFormFileCollection files, string version) public virtual async Task<IActionResult> ImportAsync([FromForm] IFormFileCollection files, string version)
{ {
var checkList = new List<ErrorExportDto>(); var checkList = new List<ErrorExportDto>();
ExportImporter _exportImporter = new ExportImporter(); ExportImporter _exportImporter = new ExportImporter();
@ -100,7 +100,8 @@ public class PriceListAppService : SettleAccountApplicationBase<PriceList>
} }
if (checkList.Count > 0) if (checkList.Count > 0)
{ {
return await ExportErrorReportAsync(checkList); string fileName = await ExportErrorReportAsync(checkList);
return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, fileName = fileName });
} }
#endregion #endregion
@ -110,7 +111,7 @@ public class PriceListAppService : SettleAccountApplicationBase<PriceList>
} }
await _priceListManager.ImportAsync(entityList.ToList(), version); await _priceListManager.ImportAsync(entityList.ToList(), version);
return ApplicationConsts.SuccessStr; return new JsonResult(new { Code = 200, Message = "导入成功" });
} }
/// <summary> /// <summary>

7
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppServiceBJ.cs

@ -48,7 +48,7 @@ namespace Win.Sfs.SettleAccount.Entities.Prices
/// 导入 /// 导入
/// </summary> /// </summary>
[HttpPost] [HttpPost]
public async Task<string> ImportAsync([FromForm] IFormFileCollection files, string version) public async Task<IActionResult> ImportAsync([FromForm] IFormFileCollection files, string version)
{ {
var checkList = new List<ErrorExportDto>(); var checkList = new List<ErrorExportDto>();
ExportImporter _exportImporter = new ExportImporter(); ExportImporter _exportImporter = new ExportImporter();
@ -79,7 +79,8 @@ namespace Win.Sfs.SettleAccount.Entities.Prices
} }
if (checkList.Count > 0) if (checkList.Count > 0)
{ {
return await ExportErrorReportAsync(checkList); string fileName = await ExportErrorReportAsync(checkList);
return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, fileName = fileName });
} }
#endregion #endregion
@ -89,7 +90,7 @@ namespace Win.Sfs.SettleAccount.Entities.Prices
} }
await _priceListManagerBJ.ImportAsync(entityList, version); await _priceListManagerBJ.ImportAsync(entityList, version);
return ApplicationConsts.SuccessStr; return new JsonResult(new { Code = 200, Message = "导入成功" });
} }
/// <summary> /// <summary>

17
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/TaskJobs/JobAppService.cs

@ -3,8 +3,10 @@ using System.Collections.Generic;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Application.Services; using Volo.Abp.Application.Services;
using Volo.Abp.Uow; using Volo.Abp.Uow;
using Win.Sfs.SettleAccount.MaterialRelationships;
namespace Win.Sfs.SettleAccount.Entities.TaskJobs; namespace Win.Sfs.SettleAccount.Entities.TaskJobs;
@ -24,13 +26,24 @@ public class JobAppService: ApplicationService
/// </summary> /// </summary>
/// <remarks> /// <remarks>
[HttpPost] [HttpPost]
[Route("list")] [Route("listold")]
[UnitOfWork(false)] [UnitOfWork(false)]
public virtual async Task<List<JobDto>> GetListAsync(JobRequestDto input) public virtual async Task<List<JobDto>> GetListOldAsync(JobRequestDto input)
{ {
return await _service.GetListAsync(input); return await _service.GetListAsync(input);
} }
/// <summary>
/// 根据筛选条件获取实体列表
/// </summary>
[HttpPost]
[Route("list")]
[UnitOfWork(false)]
public virtual async Task<PagedResultDto<JobDto>> GetListAsync(JobRequestDto input)
{
var lists = await _service.GetListAsync(input);
return new PagedResultDto<JobDto>(lists.Count, lists);
}
[HttpGet] [HttpGet]
[Route("{id}")] [Route("{id}")]

68
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiBalance.cs

@ -1,5 +1,8 @@
using System; using System;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using System.Security.Cryptography;
using System.Text;
using System.Text.Json;
using Volo.Abp.Domain.Entities; using Volo.Abp.Domain.Entities;
using Win.Sfs.SettleAccount.Entities.BQ.Syncs; using Win.Sfs.SettleAccount.Entities.BQ.Syncs;
@ -8,45 +11,54 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Vmi;
/// <summary> /// <summary>
/// ERP库位+零件号+生产码 /// ERP库位+零件号+生产码
/// </summary> /// </summary>
public class VmiBalance : BasicAggregateRoot<Guid> public class VmiBalance : BasicAggregateRoot<Guid>, IHasConcurrencyStamp
{ {
public VmiBalance(Guid id) public VmiBalance()
{ {
this.Id = id; ConcurrencyStamp = Guid.NewGuid().ToString("N");
} }
[Display(Name = "ERP库位")] /// <summary>
public string ErpToLoc { get; set; } /// LU零件号
/// </summary>
[Display(Name = "LU零件号")] [Display(Name = "LU零件号")]
public string LU { get; set; }
[Display(Name = "客户零件号")]
public string PartCode { get; set; } public string PartCode { get; set; }
[Display(Name = "生产码")] [Display(Name = "生产码")]
public string VinCode { get; set; } public string VinCode { get; set; }
/// <summary>
/// 根据零件关系表匹配
/// </summary>
[Display(Name = "客户零件号")]
public string CustomerPartCode { get; set; }
[Display(Name = "生产码类型")] [Display(Name = "生产码类型")]
public EnumDeliverSubBillType DeliverSubBillType { get; set; } public string CodeType { get; set; }
[Display(Name = "发货类型")] [Display(Name = "发货类型")]
public EnumDeliverBjBmpBillType DeliverBillType { get; set; } public EnumDeliverBjBmpBillType BillType { get; set; }
[Display(Name = "数量")] [Display(Name = "数量")]
public decimal Qty { get; set; } public decimal Qty { get; set; }
[Display(Name = "发运日期")] [Display(Name = "发运日期")]
public DateTime ShippingDate { get; set; } public DateTime BillTime { get; set; }
[Display(Name = "订单日期")] [Display(Name = "订单日期")]
public DateTime CreationTime { get; set; } public DateTime DeliverTime { get; set; }
/// <summary>
/// ERP库位
/// </summary>
[Display(Name = "ERP库位")]
public string ErpToLoc { get; set; }
[Display(Name = "EDI顺序号")] [Display(Name = "EDI顺序号")]
public string SeqNumber { get; set; } public string Seq { get; set; }
[Display(Name = "客户订单号")] [Display(Name = "客户订单号")]
public string CustomOrderNumber { get; set; } public string OrderNum { get; set; }
[Display(Name = "塑件唯一码")] [Display(Name = "塑件唯一码")]
public string UniqueCode { get; set; } public string UniqueCode { get; set; }
@ -57,6 +69,30 @@ public class VmiBalance : BasicAggregateRoot<Guid>
[Display(Name = "PJIS生产顺序号")] [Display(Name = "PJIS生产顺序号")]
public string PjsNum { get; set; } public string PjsNum { get; set; }
[Display(Name = "配置码")]
public string Configcode { get; set; }
[Display(Name = "工厂")]
public string factory { get; set; }
[Display(Name = "发货子类型")]
public EnumDeliverSubBillType SubBillType { get; set; }
[Display(Name = "WMS实发生产码")]
public string RealCode { get; set; }
[Display(Name = "备注")] [Display(Name = "备注")]
public string Remark { get; set; } public string ReMark { get; set; }
public string ConcurrencyStamp { get; set; }
public DateTime? BackupTime { get; set; }
public VmiBalance SetId()
{
var data = new { BillType, PartCode, VinCode, ErpToLoc, OrderNum };
var json = JsonSerializer.Serialize(data);
var bytes = MD5.Create().ComputeHash(Encoding.UTF8.GetBytes(json));
this.Id = new Guid(bytes);
return this;
}
} }

101
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiLog.cs

@ -19,69 +19,99 @@ public class VmiLog : BasicAggregateRoot<Guid>
this.Id = id; this.Id = id;
} }
#region 非需求显示字段 /// <summary>
/// 分组编号
[Display(Name = "分组编号")] /// </summary>
public string GroupId { get; set; } public string GroupId { get; set; }
[Display(Name = "库存事务分类")] /// <summary>
/// 库存事务分类
/// </summary>
public VmiLogType LogType { get; set; } public VmiLogType LogType { get; set; }
[Display(Name = "库存变动")] [Display(Name = "库存变动")]
public decimal Count { get; set; } public decimal ChangedQty { get; set; }
#endregion 非需求显示字段
[Display(Name = "变动单号")] [Display(Name = "变动单号")]
public string RelationNumber { get; set; } public string ChangedNumber { get; set; }
[Display(Name = "变动时间")] [Display(Name = "变动时间")]
public DateTime CreatedTime { get; set; } = DateTime.Now; public DateTime ChangedTime { get; set; } = DateTime.Now;
[Display(Name = "变动类型")] [Display(Name = "变动类型")]
public VmiType ChangedType { get; set; } public VmiType ChangedType { get; set; }
[Display(Name = "便动人")] [Display(Name = "便动人")]
public string CreatedBy { get; set; } public string ChangedBy { get; set; }
[Display(Name = "是否补货")]
public bool? IsReplenished { get; set; }
[Display(Name = "实扣LU零件号")] #region 附加信息
public string No1 { get; set; }
[Display(Name = "实扣客户零件号")] //[Display(Name = "实扣厂内零件号")]
public string No2 { get; set; } //public string PartCode { get; set; }
[Display(Name = "结算LU零件号")] [Display(Name = "结算厂内零件号")]
public string No3 { get; set; } public string PartCode2 { get; set; }
[Display(Name = "结算客户零件号")] //[Display(Name = "结算客户零件号")]
public string No4 { get; set; } //public string CustomerPartCode { get; set; }
[Display(Name = "实扣生产码")] //[Display(Name = "EDI订单生产码")]
public string No5 { get; set; } //public string VinCode { get; set; }
[Display(Name = "结算生产码")] [Display(Name = "结算生产码")]
public string No6 { get; set; } public string SettlementVinCode { get; set; }
#endregion 附加信息
#region 库存备份
/// <summary>
/// LU零件号
/// </summary>
[Display(Name = "LU零件号")]
public string PartCode { get; set; }
[Display(Name = "生产码")]
public string VinCode { get; set; }
/// <summary>
/// 根据零件关系表匹配
/// </summary>
[Display(Name = "客户零件号")]
public string CustomerPartCode { get; set; }
[Display(Name = "生产码类型")] [Display(Name = "生产码类型")]
public string DeliverSubBillType { get; set; } public string CodeType { get; set; }
[Display(Name = "发货类型")] [Display(Name = "发货类型")]
public EnumDeliverBjBmpBillType DeliverBillType { get; set; } public EnumDeliverBjBmpBillType BillType { get; set; }
[Display(Name = "数量")] [Display(Name = "数量")]
public decimal Qty { get; set; } public decimal Qty { get; set; }
[Display(Name = "发运日期")] [Display(Name = "发运日期")]
public DateTime ShippingDate { get; set; } public DateTime BillTime { get; set; }
[Display(Name = "订单日期")] [Display(Name = "订单日期")]
public DateTime CreationTime { get; set; } public DateTime DeliverTime { get; set; }
/// <summary>
/// ERP库位
/// </summary>
[Display(Name = "ERP库位")]
public string ErpToLoc { get; set; }
[Display(Name = "EDI顺序号")] [Display(Name = "EDI顺序号")]
public string SeqNumber { get; set; } public string Seq { get; set; }
[Display(Name = "客户订单号")] [Display(Name = "客户订单号")]
public string CustomOrderNumber { get; set; } public string OrderNum { get; set; }
[Display(Name = "塑件唯一码")]
public string UniqueCode { get; set; }
[Display(Name = "EDI总成号")] [Display(Name = "EDI总成号")]
public string MatchNumber { get; set; } public string MatchNumber { get; set; }
@ -89,9 +119,20 @@ public class VmiLog : BasicAggregateRoot<Guid>
[Display(Name = "PJIS生产顺序号")] [Display(Name = "PJIS生产顺序号")]
public string PjsNum { get; set; } public string PjsNum { get; set; }
[Display(Name = "ERP库位")] [Display(Name = "配置码")]
public string ErpToLoc { get; set; } public string Configcode { get; set; }
[Display(Name = "工厂")]
public string factory { get; set; }
[Display(Name = "发货子类型")]
public EnumDeliverSubBillType SubBillType { get; set; }
[Display(Name = "WMS实发生产码")]
public string RealCode { get; set; }
[Display(Name = "备注")] [Display(Name = "备注")]
public string Desc { get; set; } public string ReMark { get; set; }
#endregion 库存备份
} }

43
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiType.cs

@ -18,38 +18,41 @@ public enum VmiType
Out Out
} }
public enum VmiLogRunType public enum VmiLogType
{ {
/// <summary> /// <summary>
/// 初次执行 /// 发运入库
/// </summary>
Do,
/// <summary>
/// 撤销
/// </summary>
UnDo,
/// <summary>
/// 重做
/// </summary> /// </summary>
ReDo
}
public enum VmiLogType
{
[Display(Name = "发运入库")] [Display(Name = "发运入库")]
Type100 = 100, Type100 = 100,
/// <summary>
/// 结算出库
/// </summary>
[Display(Name = "结算出库")] [Display(Name = "结算出库")]
Type200 = 200, Type200 = 200,
[Display(Name = "客户退货")] /// <summary>
/// 反结入库
/// </summary>
[Display(Name = "反结入库")]
Type300 = 300, Type300 = 300,
[Display(Name = "调整入库")] /// <summary>
/// 退货出库
/// </summary>
[Display(Name = "退货出库")]
Type400 = 400, Type400 = 400,
[Display(Name = "调整出库")] /// <summary>
/// 调整入库
/// </summary>
[Display(Name = "调整入库")]
Type500 = 500, Type500 = 500,
/// <summary>
/// 调整出库
/// </summary>
[Display(Name = "调整出库")]
Type600 = 600,
} }

8
code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs

@ -1261,13 +1261,13 @@ namespace Win.Sfs.SettleAccount
// b.HasIndex(o => o.Name).IsUnique(); // b.HasIndex(o => o.Name).IsUnique();
//}); //});
builder.Entity<VmiBalance>(b => builder.Entity<VmiBalance>((Action<Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder<VmiBalance>>)(b =>
{ {
b.ToTable($"{options.TablePrefix}_VmiBalance", options.Schema); b.ToTable($"{options.TablePrefix}_VmiBalance", options.Schema);
b.ConfigureByConvention(); b.ConfigureByConvention();
b.HasAlternateKey(o => new { o.ErpToLoc, o.PartCode, o.LU }); b.HasAlternateKey(o => (new { o.BillType, o.PartCode, o.VinCode, o.ErpToLoc, o.OrderNum }));
}); }));
builder.Entity<VmiBalance>().HasData(new VmiBalance("test".ToGuid()) { ErpToLoc = "key1", PartCode = "key2", LU = "key3", Remark = "test" }); builder.Entity<VmiBalance>().HasData(new VmiBalance { BillType = EnumDeliverBjBmpBillType.JIS件, PartCode = "PartCode", VinCode = "VinCode", ErpToLoc = "ErpToLoc", OrderNum = "OrderNum" }.SetId());
builder.Entity<VmiLog>(b => builder.Entity<VmiLog>(b =>
{ {

5035
code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230807024652_vmi8.Designer.cs

File diff suppressed because it is too large

391
code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230807024652_vmi8.cs

@ -0,0 +1,391 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace Win.Sfs.SettleAccount.Migrations
{
public partial class vmi8 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropUniqueConstraint(
name: "AK_Set_VmiBalance_ErpToLoc_PartCode_LU",
table: "Set_VmiBalance");
migrationBuilder.DeleteData(
table: "Set_VmiBalance",
keyColumn: "Id",
keyValue: new Guid("cd6b8f09-2146-73d3-cade-4e832627b4f6"));
migrationBuilder.RenameColumn(
name: "ShippingDate",
table: "Set_VmiLog",
newName: "DeliverTime");
migrationBuilder.RenameColumn(
name: "SeqNumber",
table: "Set_VmiLog",
newName: "factory");
migrationBuilder.RenameColumn(
name: "RelationNumber",
table: "Set_VmiLog",
newName: "VinCode");
migrationBuilder.RenameColumn(
name: "No6",
table: "Set_VmiLog",
newName: "UniqueCode");
migrationBuilder.RenameColumn(
name: "No5",
table: "Set_VmiLog",
newName: "SettlementVinCode");
migrationBuilder.RenameColumn(
name: "No4",
table: "Set_VmiLog",
newName: "Seq");
migrationBuilder.RenameColumn(
name: "No3",
table: "Set_VmiLog",
newName: "RealCode");
migrationBuilder.RenameColumn(
name: "No2",
table: "Set_VmiLog",
newName: "ReMark");
migrationBuilder.RenameColumn(
name: "No1",
table: "Set_VmiLog",
newName: "PartCode2");
migrationBuilder.RenameColumn(
name: "Desc",
table: "Set_VmiLog",
newName: "PartCode");
migrationBuilder.RenameColumn(
name: "DeliverSubBillType",
table: "Set_VmiLog",
newName: "OrderNum");
migrationBuilder.RenameColumn(
name: "DeliverBillType",
table: "Set_VmiLog",
newName: "SubBillType");
migrationBuilder.RenameColumn(
name: "CustomOrderNumber",
table: "Set_VmiLog",
newName: "CustomerPartCode");
migrationBuilder.RenameColumn(
name: "CreationTime",
table: "Set_VmiLog",
newName: "ChangedTime");
migrationBuilder.RenameColumn(
name: "CreatedTime",
table: "Set_VmiLog",
newName: "BillTime");
migrationBuilder.RenameColumn(
name: "CreatedBy",
table: "Set_VmiLog",
newName: "Configcode");
migrationBuilder.RenameColumn(
name: "Remark",
table: "Set_VmiBalance",
newName: "ReMark");
migrationBuilder.RenameColumn(
name: "ShippingDate",
table: "Set_VmiBalance",
newName: "DeliverTime");
migrationBuilder.RenameColumn(
name: "SeqNumber",
table: "Set_VmiBalance",
newName: "factory");
migrationBuilder.RenameColumn(
name: "LU",
table: "Set_VmiBalance",
newName: "OrderNum");
migrationBuilder.RenameColumn(
name: "DeliverSubBillType",
table: "Set_VmiBalance",
newName: "SubBillType");
migrationBuilder.RenameColumn(
name: "DeliverBillType",
table: "Set_VmiBalance",
newName: "BillType");
migrationBuilder.RenameColumn(
name: "CustomOrderNumber",
table: "Set_VmiBalance",
newName: "Seq");
migrationBuilder.RenameColumn(
name: "CreationTime",
table: "Set_VmiBalance",
newName: "BillTime");
migrationBuilder.AddColumn<int>(
name: "BillType",
table: "Set_VmiLog",
type: "int",
nullable: false,
defaultValue: 0);
migrationBuilder.AddColumn<string>(
name: "ChangedBy",
table: "Set_VmiLog",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "ChangedNumber",
table: "Set_VmiLog",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "CodeType",
table: "Set_VmiLog",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<bool>(
name: "IsReplenished",
table: "Set_VmiLog",
type: "bit",
nullable: true);
migrationBuilder.AlterColumn<string>(
name: "VinCode",
table: "Set_VmiBalance",
type: "nvarchar(450)",
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "nvarchar(max)",
oldNullable: true);
migrationBuilder.AddColumn<string>(
name: "CodeType",
table: "Set_VmiBalance",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "Configcode",
table: "Set_VmiBalance",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "CustomerPartCode",
table: "Set_VmiBalance",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddUniqueConstraint(
name: "AK_Set_VmiBalance_BillType_PartCode_VinCode_ErpToLoc_OrderNum",
table: "Set_VmiBalance",
columns: new[] { "BillType", "PartCode", "VinCode", "ErpToLoc", "OrderNum" });
migrationBuilder.InsertData(
table: "Set_VmiBalance",
columns: new[] { "Id", "BillTime", "BillType", "CodeType", "Configcode", "CustomerPartCode", "DeliverTime", "ErpToLoc", "MatchNumber", "OrderNum", "PartCode", "PjsNum", "Qty", "ReMark", "Seq", "SubBillType", "UniqueCode", "VinCode", "factory" },
values: new object[] { new Guid("ea936b34-ecd0-7dbd-85a9-57cd8b730873"), new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), 1, null, null, null, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), "ErpToLoc", null, "OrderNum", "PartCode", null, 0m, null, null, 0, null, "VinCode", null });
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropUniqueConstraint(
name: "AK_Set_VmiBalance_BillType_PartCode_VinCode_ErpToLoc_OrderNum",
table: "Set_VmiBalance");
migrationBuilder.DeleteData(
table: "Set_VmiBalance",
keyColumn: "Id",
keyValue: new Guid("ea936b34-ecd0-7dbd-85a9-57cd8b730873"));
migrationBuilder.DropColumn(
name: "BillType",
table: "Set_VmiLog");
migrationBuilder.DropColumn(
name: "ChangedBy",
table: "Set_VmiLog");
migrationBuilder.DropColumn(
name: "ChangedNumber",
table: "Set_VmiLog");
migrationBuilder.DropColumn(
name: "CodeType",
table: "Set_VmiLog");
migrationBuilder.DropColumn(
name: "IsReplenished",
table: "Set_VmiLog");
migrationBuilder.DropColumn(
name: "CodeType",
table: "Set_VmiBalance");
migrationBuilder.DropColumn(
name: "Configcode",
table: "Set_VmiBalance");
migrationBuilder.DropColumn(
name: "CustomerPartCode",
table: "Set_VmiBalance");
migrationBuilder.RenameColumn(
name: "factory",
table: "Set_VmiLog",
newName: "SeqNumber");
migrationBuilder.RenameColumn(
name: "VinCode",
table: "Set_VmiLog",
newName: "RelationNumber");
migrationBuilder.RenameColumn(
name: "UniqueCode",
table: "Set_VmiLog",
newName: "No6");
migrationBuilder.RenameColumn(
name: "SubBillType",
table: "Set_VmiLog",
newName: "DeliverBillType");
migrationBuilder.RenameColumn(
name: "SettlementVinCode",
table: "Set_VmiLog",
newName: "No5");
migrationBuilder.RenameColumn(
name: "Seq",
table: "Set_VmiLog",
newName: "No4");
migrationBuilder.RenameColumn(
name: "RealCode",
table: "Set_VmiLog",
newName: "No3");
migrationBuilder.RenameColumn(
name: "ReMark",
table: "Set_VmiLog",
newName: "No2");
migrationBuilder.RenameColumn(
name: "PartCode2",
table: "Set_VmiLog",
newName: "No1");
migrationBuilder.RenameColumn(
name: "PartCode",
table: "Set_VmiLog",
newName: "Desc");
migrationBuilder.RenameColumn(
name: "OrderNum",
table: "Set_VmiLog",
newName: "DeliverSubBillType");
migrationBuilder.RenameColumn(
name: "DeliverTime",
table: "Set_VmiLog",
newName: "ShippingDate");
migrationBuilder.RenameColumn(
name: "CustomerPartCode",
table: "Set_VmiLog",
newName: "CustomOrderNumber");
migrationBuilder.RenameColumn(
name: "Configcode",
table: "Set_VmiLog",
newName: "CreatedBy");
migrationBuilder.RenameColumn(
name: "ChangedTime",
table: "Set_VmiLog",
newName: "CreationTime");
migrationBuilder.RenameColumn(
name: "BillTime",
table: "Set_VmiLog",
newName: "CreatedTime");
migrationBuilder.RenameColumn(
name: "ReMark",
table: "Set_VmiBalance",
newName: "Remark");
migrationBuilder.RenameColumn(
name: "factory",
table: "Set_VmiBalance",
newName: "SeqNumber");
migrationBuilder.RenameColumn(
name: "SubBillType",
table: "Set_VmiBalance",
newName: "DeliverSubBillType");
migrationBuilder.RenameColumn(
name: "Seq",
table: "Set_VmiBalance",
newName: "CustomOrderNumber");
migrationBuilder.RenameColumn(
name: "OrderNum",
table: "Set_VmiBalance",
newName: "LU");
migrationBuilder.RenameColumn(
name: "DeliverTime",
table: "Set_VmiBalance",
newName: "ShippingDate");
migrationBuilder.RenameColumn(
name: "BillType",
table: "Set_VmiBalance",
newName: "DeliverBillType");
migrationBuilder.RenameColumn(
name: "BillTime",
table: "Set_VmiBalance",
newName: "CreationTime");
migrationBuilder.AlterColumn<string>(
name: "VinCode",
table: "Set_VmiBalance",
type: "nvarchar(max)",
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(450)");
migrationBuilder.AddUniqueConstraint(
name: "AK_Set_VmiBalance_ErpToLoc_PartCode_LU",
table: "Set_VmiBalance",
columns: new[] { "ErpToLoc", "PartCode", "LU" });
migrationBuilder.InsertData(
table: "Set_VmiBalance",
columns: new[] { "Id", "CreationTime", "CustomOrderNumber", "DeliverBillType", "DeliverSubBillType", "ErpToLoc", "LU", "MatchNumber", "PartCode", "PjsNum", "Qty", "Remark", "SeqNumber", "ShippingDate", "UniqueCode", "VinCode" },
values: new object[] { new Guid("cd6b8f09-2146-73d3-cade-4e832627b4f6"), new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), null, 0, 0, "key1", "key3", null, "key2", null, 0m, "test", null, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), null, null });
}
}
}

5048
code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230807054442_vmi9.Designer.cs

File diff suppressed because it is too large

62
code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230807054442_vmi9.cs

@ -0,0 +1,62 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace Win.Sfs.SettleAccount.Migrations
{
public partial class vmi9 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.RenameColumn(
name: "Count",
table: "Set_VmiLog",
newName: "ChangedQty");
migrationBuilder.AddColumn<DateTime>(
name: "BackupTime",
table: "Set_VmiBalance",
type: "datetime2",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "ConcurrencyStamp",
table: "Set_VmiBalance",
type: "nvarchar(40)",
maxLength: 40,
nullable: true);
migrationBuilder.AddColumn<string>(
name: "RealCode",
table: "Set_VmiBalance",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.UpdateData(
table: "Set_VmiBalance",
keyColumn: "Id",
keyValue: new Guid("ea936b34-ecd0-7dbd-85a9-57cd8b730873"),
column: "ConcurrencyStamp",
value: "887ca64c266c48ac82dca90534f64225");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "BackupTime",
table: "Set_VmiBalance");
migrationBuilder.DropColumn(
name: "ConcurrencyStamp",
table: "Set_VmiBalance");
migrationBuilder.DropColumn(
name: "RealCode",
table: "Set_VmiBalance");
migrationBuilder.RenameColumn(
name: "ChangedQty",
table: "Set_VmiLog",
newName: "Count");
}
}
}

138
code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/SettleAccountDbContextModelSnapshot.cs

@ -3958,29 +3958,44 @@ namespace Win.Sfs.SettleAccount.Migrations
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier"); .HasColumnType("uniqueidentifier");
b.Property<DateTime>("CreationTime") b.Property<DateTime?>("BackupTime")
.HasColumnType("datetime2"); .HasColumnType("datetime2");
b.Property<string>("CustomOrderNumber") b.Property<DateTime>("BillTime")
.HasColumnType("nvarchar(max)"); .HasColumnType("datetime2");
b.Property<int>("DeliverBillType") b.Property<int>("BillType")
.HasColumnType("int"); .HasColumnType("int");
b.Property<int>("DeliverSubBillType") b.Property<string>("CodeType")
.HasColumnType("int"); .HasColumnType("nvarchar(max)");
b.Property<string>("ErpToLoc") b.Property<string>("ConcurrencyStamp")
.IsRequired() .IsConcurrencyToken()
.HasColumnType("nvarchar(450)"); .HasMaxLength(40)
.HasColumnType("nvarchar(40)")
.HasColumnName("ConcurrencyStamp");
b.Property<string>("LU") b.Property<string>("Configcode")
.HasColumnType("nvarchar(max)");
b.Property<string>("CustomerPartCode")
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("DeliverTime")
.HasColumnType("datetime2");
b.Property<string>("ErpToLoc")
.IsRequired() .IsRequired()
.HasColumnType("nvarchar(450)"); .HasColumnType("nvarchar(450)");
b.Property<string>("MatchNumber") b.Property<string>("MatchNumber")
.HasColumnType("nvarchar(max)"); .HasColumnType("nvarchar(max)");
b.Property<string>("OrderNum")
.IsRequired()
.HasColumnType("nvarchar(450)");
b.Property<string>("PartCode") b.Property<string>("PartCode")
.IsRequired() .IsRequired()
.HasColumnType("nvarchar(450)"); .HasColumnType("nvarchar(450)");
@ -3991,40 +4006,48 @@ namespace Win.Sfs.SettleAccount.Migrations
b.Property<decimal>("Qty") b.Property<decimal>("Qty")
.HasColumnType("decimal(18,2)"); .HasColumnType("decimal(18,2)");
b.Property<string>("Remark") b.Property<string>("ReMark")
.HasColumnType("nvarchar(max)"); .HasColumnType("nvarchar(max)");
b.Property<string>("SeqNumber") b.Property<string>("RealCode")
.HasColumnType("nvarchar(max)"); .HasColumnType("nvarchar(max)");
b.Property<DateTime>("ShippingDate") b.Property<string>("Seq")
.HasColumnType("datetime2"); .HasColumnType("nvarchar(max)");
b.Property<int>("SubBillType")
.HasColumnType("int");
b.Property<string>("UniqueCode") b.Property<string>("UniqueCode")
.HasColumnType("nvarchar(max)"); .HasColumnType("nvarchar(max)");
b.Property<string>("VinCode") b.Property<string>("VinCode")
.IsRequired()
.HasColumnType("nvarchar(450)");
b.Property<string>("factory")
.HasColumnType("nvarchar(max)"); .HasColumnType("nvarchar(max)");
b.HasKey("Id"); b.HasKey("Id");
b.HasAlternateKey("ErpToLoc", "PartCode", "LU"); b.HasAlternateKey("BillType", "PartCode", "VinCode", "ErpToLoc", "OrderNum");
b.ToTable("Set_VmiBalance"); b.ToTable("Set_VmiBalance");
b.HasData( b.HasData(
new new
{ {
Id = new Guid("cd6b8f09-2146-73d3-cade-4e832627b4f6"), Id = new Guid("ea936b34-ecd0-7dbd-85a9-57cd8b730873"),
CreationTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), BillTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
DeliverBillType = 0, BillType = 1,
DeliverSubBillType = 0, ConcurrencyStamp = "887ca64c266c48ac82dca90534f64225",
ErpToLoc = "key1", DeliverTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
LU = "key3", ErpToLoc = "ErpToLoc",
PartCode = "key2", OrderNum = "OrderNum",
PartCode = "PartCode",
Qty = 0m, Qty = 0m,
Remark = "test", SubBillType = 0,
ShippingDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified) VinCode = "VinCode"
}); });
}); });
@ -4034,77 +4057,92 @@ namespace Win.Sfs.SettleAccount.Migrations
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier"); .HasColumnType("uniqueidentifier");
b.Property<int>("ChangedType") b.Property<DateTime>("BillTime")
.HasColumnType("datetime2");
b.Property<int>("BillType")
.HasColumnType("int"); .HasColumnType("int");
b.Property<decimal>("Count") b.Property<string>("ChangedBy")
.HasColumnType("decimal(18,2)"); .HasColumnType("nvarchar(max)");
b.Property<string>("CreatedBy") b.Property<string>("ChangedNumber")
.HasColumnType("nvarchar(max)"); .HasColumnType("nvarchar(max)");
b.Property<DateTime>("CreatedTime") b.Property<decimal>("ChangedQty")
.HasColumnType("datetime2"); .HasColumnType("decimal(18,2)");
b.Property<DateTime>("CreationTime") b.Property<DateTime>("ChangedTime")
.HasColumnType("datetime2"); .HasColumnType("datetime2");
b.Property<string>("CustomOrderNumber") b.Property<int>("ChangedType")
.HasColumnType("nvarchar(max)");
b.Property<int>("DeliverBillType")
.HasColumnType("int"); .HasColumnType("int");
b.Property<string>("DeliverSubBillType") b.Property<string>("CodeType")
.HasColumnType("nvarchar(max)");
b.Property<string>("Configcode")
.HasColumnType("nvarchar(max)"); .HasColumnType("nvarchar(max)");
b.Property<string>("Desc") b.Property<string>("CustomerPartCode")
.HasColumnType("nvarchar(max)"); .HasColumnType("nvarchar(max)");
b.Property<DateTime>("DeliverTime")
.HasColumnType("datetime2");
b.Property<string>("ErpToLoc") b.Property<string>("ErpToLoc")
.HasColumnType("nvarchar(max)"); .HasColumnType("nvarchar(max)");
b.Property<string>("GroupId") b.Property<string>("GroupId")
.HasColumnType("nvarchar(max)"); .HasColumnType("nvarchar(max)");
b.Property<bool?>("IsReplenished")
.HasColumnType("bit");
b.Property<int>("LogType") b.Property<int>("LogType")
.HasColumnType("int"); .HasColumnType("int");
b.Property<string>("MatchNumber") b.Property<string>("MatchNumber")
.HasColumnType("nvarchar(max)"); .HasColumnType("nvarchar(max)");
b.Property<string>("No1") b.Property<string>("OrderNum")
.HasColumnType("nvarchar(max)"); .HasColumnType("nvarchar(max)");
b.Property<string>("No2") b.Property<string>("PartCode")
.HasColumnType("nvarchar(max)"); .HasColumnType("nvarchar(max)");
b.Property<string>("No3") b.Property<string>("PartCode2")
.HasColumnType("nvarchar(max)"); .HasColumnType("nvarchar(max)");
b.Property<string>("No4") b.Property<string>("PjsNum")
.HasColumnType("nvarchar(max)"); .HasColumnType("nvarchar(max)");
b.Property<string>("No5") b.Property<decimal>("Qty")
.HasColumnType("decimal(18,2)");
b.Property<string>("ReMark")
.HasColumnType("nvarchar(max)"); .HasColumnType("nvarchar(max)");
b.Property<string>("No6") b.Property<string>("RealCode")
.HasColumnType("nvarchar(max)"); .HasColumnType("nvarchar(max)");
b.Property<string>("PjsNum") b.Property<string>("Seq")
.HasColumnType("nvarchar(max)"); .HasColumnType("nvarchar(max)");
b.Property<decimal>("Qty") b.Property<string>("SettlementVinCode")
.HasColumnType("decimal(18,2)"); .HasColumnType("nvarchar(max)");
b.Property<string>("RelationNumber") b.Property<int>("SubBillType")
.HasColumnType("int");
b.Property<string>("UniqueCode")
.HasColumnType("nvarchar(max)"); .HasColumnType("nvarchar(max)");
b.Property<string>("SeqNumber") b.Property<string>("VinCode")
.HasColumnType("nvarchar(max)"); .HasColumnType("nvarchar(max)");
b.Property<DateTime>("ShippingDate") b.Property<string>("factory")
.HasColumnType("datetime2"); .HasColumnType("nvarchar(max)");
b.HasKey("Id"); b.HasKey("Id");

Loading…
Cancel
Save