diff --git a/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/appsettings.Development.json b/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/appsettings.Development.json
index 64c7cff5..f93b6041 100644
--- a/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/appsettings.Development.json
+++ b/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/appsettings.Development.json
@@ -7,11 +7,11 @@
// "SettleAccountService": "Server=LAPTOP-V3U07C2O;Database=SettleAccountService;user id=sa;Password=1q2w!@#;"
//},
"ConnectionStrings": {
- //"Default": "Server=127.0.0.1;Database=ABP;user id=sa;Password=1",
- //"SettleAccountService": "Server=127.0.0.1;Database=SettleAccountService;user id=sa;Password=1;"
- "Default": "Server=192.168.0.140;Database=ABP;User ID=sa;Password=Microsoft2008;",
- "SettleAccountService": "Server=192.168.0.140;Database=SettleAccountService;user id=sa;password=Microsoft2008;",
- "Wms": "Server=192.168.0.63;Database=CPAT_WMS;user id=sa;password=Microsoft2008;"
+ "Default": "Server=127.0.0.1;Database=ABP;user id=sa;Password=1",
+ "SettleAccountService": "Server=127.0.0.1;Database=SettleAccountService;user id=sa;Password=1;"
+ //"Default": "Server=192.168.0.140;Database=ABP;User ID=sa;Password=Microsoft2008;",
+ //"SettleAccountService": "Server=192.168.0.140;Database=SettleAccountService;user id=sa;password=Microsoft2008;",
+ //"Wms": "Server=192.168.0.63;Database=CPAT_WMS;user id=sa;password=Microsoft2008;"
},
"Logging": {
diff --git a/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/appsettings.json b/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/appsettings.json
index 7f7de9a0..5f69ce88 100644
--- a/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/appsettings.json
+++ b/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/appsettings.json
@@ -9,9 +9,9 @@
"ConnectionStrings": {
//"Default": "Server=127.0.0.1;Database=ABP;user id=sa;Password=1",
//"SettleAccountService": "Server=127.0.0.1;Database=SettleAccountService;user id=sa;Password=1;"
- "Default": "Server=192.168.0.140;Database=ABP;User ID=sa;Password=Microsoft2008;",
- "SettleAccountService": "Server=192.168.0.140;Database=SettleAccountService;user id=sa;password=Microsoft2008;",
- "Wms": "Server=192.168.0.63;Database=CPAT_WMS;user id=sa;password=Microsoft2008;"
+ "Default": "Server=127.0.0.1;Database=ABP;User ID=sa;Password=1;",
+ "SettleAccountService": "Server=127.0.0.1;Database=SettleAccountService;user id=sa;password=1;",
+ "Wms": "Server=127.0.0.1;Database=CPAT_WMS;user id=sa;password=1;"
},
"Logging": {
diff --git a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSCusomerKanbanAppService.cs b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSCusomerKanbanAppService.cs
new file mode 100644
index 00000000..4c94f027
--- /dev/null
+++ b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSCusomerKanbanAppService.cs
@@ -0,0 +1,606 @@
+using System;
+using System.Collections.Generic;
+using System.Threading.Tasks;
+using Microsoft.AspNetCore.Authorization;
+using Microsoft.AspNetCore.Http;
+using Microsoft.AspNetCore.Mvc;
+using Microsoft.Extensions.Caching.Distributed;
+using AutoMapper;
+using System.Linq;
+using System.Text;
+using Volo.Abp.Guids;
+using Volo.Abp.Application.Services;
+using Volo.Abp.Caching;
+
+using Volo.Abp.ObjectMapping;
+using Win.Sfs.SettleAccount.ExcelImporter;
+using Win.Sfs.Shared.CacheBase;
+using Win.Utils;
+using Volo.Abp.Application.Dtos;
+using Win.Sfs.BaseData.ImportExcelCommon;
+using Volo.Abp.Domain.Repositories;
+using EFCore.BulkExtensions;
+using System.IO;
+using Microsoft.EntityFrameworkCore;
+using Win.Sfs.SettleAccount.Entities.SettleAccountVersion;
+using Win.Sfs.SettleAccount.FISes;
+using Win.Sfs.Shared.Enums.SettleAccount;
+using Win.Sfs.Shared.Filter;
+using Shouldly;
+using Magicodes.ExporterAndImporter.Csv;
+using Magicodes.ExporterAndImporter.Core;
+using Magicodes.ExporterAndImporter.Excel;
+using System.Data.Common;
+using Volo.Abp.Uow;
+using Volo.Abp;
+using Win.Abp.Snowflakes;
+using Win.Sfs.SettleAccount.CommonManagers;
+using Win.Sfs.SettleAccount.ExportReports;
+using Win.Sfs.SettleAccount.Constant;
+using Win.Sfs.SettleAccount.MaterialRelationships;
+using Win.Sfs.SettleAccount.Entities.TaskJobs;
+using Magicodes.ExporterAndImporter.Core.Models;
+
+using TaskJob.Services;
+using TaskJob.EventArgs;
+using Win.Sfs.SettleAccount.Entities.WMS;
+using Win.Sfs.SettleAccount.Entities.Wms;
+using Win.Sfs.SettleAccount.Repository;
+using WY.NewJit.Extends.PaiGe.WMS;
+using Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report;
+
+namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
+{
+ ///
+ /// 红旗H平台准时化-出库
+ ///
+
+ //[AllowAnonymous]
+ [Authorize(SettleAccountPermissions.WMSHQ.Default)]
+ [Route("api/settleaccount/WMSCusomerKanbanoutput")]
+ public class WMSCusomerKanbanAppService :
+ SettleAccountApplicationBase
+ {
+
+ private readonly ISettleAccountBranchEfCoreRepository _wmsRepository;
+ private readonly ISettleAccountBranchEfCoreRepository _wmsVersionRepository;
+ private readonly WMSEfCoreRepository _wmsefRespository;
+
+ private readonly WMSEfCoreRepository _wmstbRespository;
+ private readonly ISettleAccountBranchEfCoreRepository _job;
+ private readonly IExcelImportAppService _excelImportService;
+
+
+ private readonly TaskJobService _service;
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public WMSCusomerKanbanAppService(
+
+
+ IExcelImportAppService excelImportService,
+
+ ISettleAccountBranchEfCoreRepository wmsRepository,
+ ISettleAccountBranchEfCoreRepository job,
+ ISettleAccountBranchEfCoreRepository wmsVersionRepository,
+ WMSEfCoreRepository wmsefRespository,
+ WMSEfCoreRepository wmstbRespository,
+ IDistributedCache cache,
+ ISnowflakeIdGenerator snowflakeIdGenerator,
+ ICommonManager commonManager
+ ) : base(cache, excelImportService, snowflakeIdGenerator, commonManager)
+ {
+ _job = job;
+ _wmstbRespository = wmstbRespository;
+ _wmsRepository = wmsRepository;
+ _wmsVersionRepository = wmsVersionRepository;
+ _wmsefRespository = wmsefRespository;
+ _excelImportService = excelImportService;
+ }
+
+ private async Task GetCountAsync(WmsKanbanOutPutDetialRequestDto input)
+ {
+ return await _wmsRepository.GetCountByFilterAsync(GuidGenerator.Create(), input.Filters);
+ }
+
+ private async Task GetCountAsync(WmsKanbanOutPutRequestDto input)
+ {
+ return await _wmsVersionRepository.GetCountByFilterAsync(GuidGenerator.Create(), input.Filters);
+ }
+
+ ///
+ /// 准时化出库主表
+ ///
+ ///
+ ///
+ [HttpPost]
+ [Route("WmsCustomerKanbanList")]
+ //[Authorize(SettleAccountPermissions.SettleAccounts.Default)]
+ virtual public async Task> GetListAsync( WmsKanbanOutPutRequestDto input)
+ {
+
+ var entities = await _wmsVersionRepository.GetListByFilterAsync(GuidGenerator.Create(), input.Filters, input.Sorting, input.MaxResultCount,
+ input.SkipCount, true);
+
+ var totalCount = await GetCountAsync(input);
+
+
+ return new PagedResultDto(totalCount, entities);
+ }
+
+ ///
+ /// 准时化出库明细
+ ///
+ ///
+ ///
+ [HttpPost]
+ [Route("WmsCustomerKanbanDetailList")]
+ //[Authorize(SettleAccountPermissions.SettleAccounts.Default)]
+ virtual public async Task> GetListAsync(WmsKanbanOutPutDetialRequestDto input)
+ {
+ //不用传version 单号能保证唯一
+ input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "BillNum", Logic = EnumFilterLogic.And, Value = input.BillNum });
+ var entities = await _wmsRepository.GetListByFilterAsync(GuidGenerator.Create(), input.Filters, input.Sorting, input.MaxResultCount,
+ input.SkipCount, true);
+
+ var totalCount = await GetCountAsync(input);
+ return new PagedResultDto(totalCount, entities);
+ }
+ ///
+ /// 任务明细标记已确认
+ ///
+ /// 上传的文件(前端已经限制只能上传一个附件)
+ ///
+ [HttpPost]
+ [Route("WmsCustomerKanbanOutPutAudit")]
+ [DisableRequestSizeLimit]
+
+ public async Task WmsHQHKanbanAudit(List ids)
+ {
+ var _joblist =await _job.Where(p => ids.Contains(p.Id)).ToListAsync();
+ foreach (var itm in _joblist)
+ {
+ itm.FileName = "已确认";
+ await _job.UpdateAsync(itm);
+ }
+
+ return true;
+ }
+ ///
+ ///更新备注
+ ///
+ ///
+ ///
+ [HttpGet]
+ [Route("UpdateRemark")]
+
+ public async Task UpdateRemark(Guid id, string remark)
+ {
+ var entity = _wmsVersionRepository.FirstOrDefault(p => p.Id == id);
+ if (entity != null)
+ {
+ entity.Remark = remark;
+ await _wmsVersionRepository.UpdateAsync(entity);
+
+ }
+ return true;
+ }
+
+
+
+ /////
+ ///// 选择任务,生成出库单,只包含已确认的单据
+ /////
+ /////
+ /////
+ /////
+ //[HttpPost]
+ //[Route("WmsWithOutKanbanOutPut")]
+ //public async Task WmsWithOutKanbanOutPut(WmsJitRequestDto input)
+ //{
+ // var _billNum = "KA" + DateTime.Now.ToString("yyyyMMddhhmmss");
+
+ // var _joblist = _job.Where(p => input.Guids.Contains(p.Id) && p.FileName == "已确认").ToList();
+ // if (_joblist.Count() > 0)
+ // {
+ // var fileList = _joblist.Select(p => p.RealDownFileName).ToList();
+ // List _lst = new List();
+ // foreach (var filename in fileList)
+ // {
+ // string fileSavePath = Environment.CurrentDirectory + @"\wwwroot\files\host\my-file-container\" + filename;
+ // ExcelHelper _excelHelper = new ExcelHelper(fileSavePath);
+ // var _list = _excelHelper.ExcelToList();
+ // foreach (var itm in _list)
+ // {
+
+ // var _entity= new WmsCustomerKanbanOutPutDetial(GuidGenerator.Create(), string.Empty, string.Empty, itm.MaterialCode, itm.MaterialDesc
+ // , itm.SapMaterialGroup, string.Empty, string.Empty, 0, string.Empty, string.Empty, itm.Version, itm.SapMaterialCode,
+ // _billNum, Guid.Empty, string.Empty, itm.InvoiceQty,itm.
+ // );
+
+ // _lst.Add(_entity);
+ // }
+
+ // }
+
+ // var outPutDetail = await _wmsRepository.Where(p => p.Version == input.Version && p.Kanban==string.Empty).ToListAsync();
+
+
+ // await _wmsRepository.GetDbContext().BulkInsertAsync(_lst, new BulkConfig() { BulkCopyTimeout = 0, BatchSize = 10000 });
+ // int _count = _wmsVersionRepository.Count(p => p.Version == input.Version && p.BillNum == _billNum);
+ // if (_count == 0)
+ // {
+ // var _version = new WmsCustomerKanbanOutPut(GuidGenerator.Create(), input.Version, _billNum, CurrentUser.Email);
+
+ // await _wmsVersionRepository.InsertAsync(_version, true);
+ // }
+
+ // foreach (var job in _joblist)
+ // {
+ // job.FileName = _billNum;
+ // await _job.UpdateAsync(job);
+ // }
+ // }
+
+ // return ApplicationConsts.SuccessStr; ;
+ //}
+
+
+ ///
+ /// 选择任务,生成出库单,只包含已确认的单据
+ ///
+ ///
+ ///
+ ///
+ [HttpPost]
+ [Route("WmsCustomerKanbanOutPut")]
+ public async Task WmsCustomerKanbanOutPut(WmsJitRequestDto input)
+ {
+ var _billNum = "CKB" + DateTime.Now.ToString("yyyyMMddhhmmss");
+
+ var _joblist = _job.Where(p => input.Guids.Contains(p.Id) && p.FileName == "已确认").ToList();
+ if (_joblist.Count() > 0)
+ {
+ var fileList = _joblist.Select(p => p.RealDownFileName).ToList();
+ List _lst = new List();
+ foreach (var filename in fileList)
+ {
+ string fileSavePath = Environment.CurrentDirectory + @"\wwwroot\files\host\my-file-container\" + filename;
+ ExcelHelper _excelHelper = new ExcelHelper(fileSavePath);
+ var _list = _excelHelper.ExcelToList();
+ foreach (var itm in _list)
+ {
+ itm.SetData(GuidGenerator.Create(),string.Empty,!string.IsNullOrEmpty(itm.WmsBillNum)? itm.WmsBillNum:string.Empty,input.Version,GuidGenerator.Create(),itm.CustomerCode);
+ }
+ _lst.AddRange(_list.ToArray());
+ }
+
+ var outPutDetail = await _wmsRepository.Where(p => p.Version == input.Version && p.State != 4 ).ToListAsync();
+
+ var error = from itm1 in outPutDetail
+ join itm2 in _lst on
+ new { itm1.MaterialCode, itm1.Kanban }
+ equals
+ new { itm2.MaterialCode, itm2.Kanban }
+ select itm1;
+ var errList = error.GroupBy(p => new { p.BillNum }).Select(p => new { BillNum = p.Key.BillNum, Number = p.Sum(itm => itm.Qty) });
+ if (errList.Count() == 0)
+ {
+
+ var query = from itm1 in _lst
+ join itm2 in outPutDetail on
+ new { itm1.MaterialCode, itm1.Kanban }
+ equals
+ new { itm2.MaterialCode, itm2.Kanban } into temp1
+ from tm1 in temp1.DefaultIfEmpty()
+ where tm1 == null
+ select itm1;
+ var _wmslst = query.ToList();
+ foreach (var itm in _wmslst)
+ {
+ itm.BillNum = _billNum;
+ }
+ await _wmsRepository.GetDbContext().BulkInsertAsync(_wmslst, new BulkConfig() { BulkCopyTimeout = 0, BatchSize = 10000 });
+ int _count = _wmsVersionRepository.Count(p => p.Version == input.Version && p.BillNum == _billNum);
+ if (_count == 0)
+ {
+ var _version = new WmsCustomerKanbanOutPut(GuidGenerator.Create(), input.Version, _billNum, CurrentUser.Email,"");
+ _version.Remark = !string.IsNullOrEmpty(_joblist.FirstOrDefault().Remark) ? _joblist.FirstOrDefault().Remark : string.Empty;
+ await _wmsVersionRepository.InsertAsync(_version, true);
+ }
+
+ foreach (var job in _joblist)
+ {
+ job.FileName = _billNum;
+ await _job.UpdateAsync(job);
+ }
+ }
+ else
+ {
+ StringBuilder _buffer = new StringBuilder();
+ foreach (var itm in errList)
+ {
+ _buffer.AppendFormat("出库单号:{0}重复记录数:{1}条", itm.BillNum, itm.Number);
+ }
+ var _errinfo = _buffer.ToString();
+
+ foreach (var job in _joblist)
+ {
+ job.FileName = _errinfo;
+ await _job.UpdateAsync(job);
+ }
+ }
+ }
+ else
+ {
+ _billNum = string.Empty;
+ }
+ return ApplicationConsts.SuccessStr; ;
+ }
+ ///
+ /// 出库界面功能,核准出库功能
+ ///
+ ///
+ ///
+ ///
+ [HttpPost]
+ [Route("WmsCustomerKanbanOutPut-Pass")]
+ [UnitOfWork(false)]
+ public async Task WmsCustomerKanbanOutPutPass(WmsJitRequestDto input)
+ {
+ var sql = "DECLARE @return_value int\n" +
+ "EXEC @return_value = [dbo].[p_wms_output]\n" +
+ " @billnum = N'{0}',\n" +
+ " @type = 23,\n" +
+ " @date = N'{1}'\n" +
+ "SELECT 'Return Value' = @return_value";
+ await _wmsRepository.GetDbContext().Database.ExecuteSqlRawAsync(
+ string.Format(sql, input.BillNum, input.AccountDate.ToShortDateString())
+ );
+
+
+
+ return true;
+
+ }
+ ///
+ ///出库界面功能, 撤销核准出库
+ ///
+ ///
+ ///
+ ///
+ [HttpPost]
+ [Route("WmsCustomerKanbanOutPut-Cancel")]
+ [UnitOfWork(false)]
+ public async Task WmsCustomerKanbanOutPutCancel(WmsJitRequestDto input)
+ {
+ if (input.Guids != null && input.Guids.Count() > 0)
+ {
+ List _ls = new List();
+ foreach (var itm in input.Guids)
+ {
+ _ls.Add(string.Format("{0}", itm));
+ }
+
+ string str = string.Join(",", _ls.ToArray());
+
+ var sql = "DECLARE @return_value int\n" +
+ "EXEC @return_value = [dbo].[p_wms_output_cancel]\n" +
+ " @Guids ='{0}', \n" +
+ " @billnum = N'{1}',\n" +
+ " @type = 23,\n" +
+ " @accountdate = N'{2}'\n" +
+ "SELECT 'Return Value' = @return_value";
+
+ sql = string.Format(sql, str, input.BillNum, input.AccountDate.ToShortDateString());
+
+ await _wmsRepository.GetDbContext().Database.ExecuteSqlRawAsync(
+ sql
+ );
+
+ }
+
+ return true;
+ }
+ ///
+ /// 出库界面功能删除
+ ///
+ ///
+ ///
+ ///
+ [HttpPost]
+ [Route("WmsOutPutDelete")]
+ [UnitOfWork(false)]
+ public async Task WmsOutPutDelete(WmsJitRequestDto input)
+ {
+ var count = _wmsRepository.Count(p => p.BillNum == input.BillNum && p.State != 0);
+
+ if (count > 0)
+ {
+ return false;
+ }
+ var sql = "DECLARE @return_value int\n" +
+ "EXEC @return_value = [dbo].[p_wms_output_cancel_all]\n" +
+ " @billnum = N'{0}',\n" +
+ " @type = 23\n" +
+ "SELECT 'Return Value' = @return_value";
+ await _wmsRepository.GetDbContext().Database.ExecuteSqlRawAsync(
+ string.Format(sql, input.BillNum)
+ );
+
+
+
+ return true;
+ }
+ [HttpPost]
+ [Route("ExcelImport")]
+ [DisableRequestSizeLimit]
+ //[Authorize(SettleAccountPermissions.SettleAccounts.Default)]
+ public async Task ExcelImport([FromForm] IFormFileCollection files, string version,string customerCode)
+ {
+ var _billNum = "CKB(" +customerCode+")"+ DateTime.Now.ToString("yyyyMMddhhmmss");
+ var checkList = new List();
+ ExportImporter _exportImporter = new ExportImporter();
+ var result = await _exportImporter.ExtendExcelOfSheetOneImport(files, _excelImportService);
+
+ //检验1:导入模板中的第一页签数据不能为空
+ if (result == null || result.Count() == 0)
+ {
+ checkList.Add(new ErrorExportDto(version, "红旗批量出库单导入", string.Empty, string.Empty, string.Empty, string.Empty, "导入模板中第一页签没有数据,请检查!", string.Empty));
+ }
+ if (checkList.Count > 0)
+ {
+ return await ExportErrorReportAsync(checkList);
+ }
+
+
+ var filteResult = result.Where(p =>!string.IsNullOrEmpty(p.Kanban));//过滤掉看板号为空的数据
+
+ //检验2:导入模板中的结算数据是否为0
+ foreach (var itm in filteResult)
+ {
+ if (itm.Qty == 0)
+ {
+ checkList.Add(new ErrorExportDto(version, "红旗批量出库单导入", string.Empty, string.Empty, string.Empty, string.Empty, string.Format("导入模板中看板号{0}的结算数量为0,影响出库请检查!", itm.Kanban), string.Empty));
+ }
+ }
+
+
+ List _lst = new List();
+ var _lsCopy = new List();
+ foreach (var itm in filteResult)
+ {
+ WmsCustomerKanbanOutPutDetial _detail = new WmsCustomerKanbanOutPutDetial(
+ GuidGenerator.Create(),
+ !string.IsNullOrEmpty(itm.WmsBillNum) ? itm.WmsBillNum : string.Empty,
+ itm.Kanban,
+ itm.MaterialCode,
+ itm.MaterialDesc,
+ itm.MaterialGroup,
+ string.Empty,
+ string.Empty,
+ 0,
+ !string.IsNullOrEmpty(itm.Extend1)?itm.Extend1: string.Empty,
+ !string.IsNullOrEmpty(itm.Extend2) ? itm.Extend2 : string.Empty,
+ version,
+ itm.MaterialCode,
+ itm.BillNum,
+ GuidGenerator.Create()
+ , string.Empty
+ ,itm.Qty
+
+ ,itm.Price
+ ,itm.Amt
+ ,itm.CustomerCode
+ );
+ _lsCopy.Add(_detail);
+ }
+ _lst.AddRange(_lsCopy.ToArray());
+
+ //检验3:导入模板中看板号+物料号,不能重复
+ var _isRepeatOfReportList = from arc in _lst
+ group arc by new { arc.Kanban, arc.MaterialCode, arc.Version }
+ into g
+ where g.Count() > 1
+ select g;
+ foreach (var itm in _isRepeatOfReportList)
+ {
+ checkList.Add(new ErrorExportDto(version, "红旗批量出库单", string.Empty, string.Empty, string.Empty, string.Empty, string.Format("导入模板中看板号{0}组合物料号{1}有重复,请检查!", itm.Key.Kanban, itm.Key.MaterialCode), string.Empty));
+ }
+ if (checkList.Count > 0)
+ {
+ return await ExportErrorReportAsync(checkList);
+ }
+
+
+
+ var outPutDetail = await _wmsRepository.Where(p => p.Version == version && p.State != 4 ).ToListAsync();
+
+
+ var error = from itm1 in outPutDetail
+ join itm2 in _lst on
+ new { itm1.MaterialCode, itm1.Kanban }
+ equals
+ new { itm2.MaterialCode, itm2.Kanban}
+ select itm1;
+ var errList = error.GroupBy(p => new { p.BillNum }).Select(p => new { BillNum = p.Key.BillNum, Number = p.Count() });
+
+
+ foreach (var itm in errList)
+ {
+ checkList.Add(new ErrorExportDto() { Message = string.Format("出库单号:{0}重复记录数:{1}条", itm.BillNum, itm.Number) });
+ }
+ if (checkList.Count > 0)
+ {
+
+ return await ExportErrorReportAsync(checkList);
+ }
+
+ var query = from itm1 in _lst
+ join itm2 in outPutDetail on
+ new { itm1.MaterialCode, itm1.Kanban }
+ equals
+ new { itm2.MaterialCode, itm2.Kanban } into temp1
+ from tm1 in temp1.DefaultIfEmpty()
+ where tm1 == null
+ select itm1;
+ var _wmslst = query.ToList();
+ foreach (var itm in _wmslst)
+ {
+ itm.BillNum = _billNum;
+ }
+ await _wmsRepository.GetDbContext().BulkInsertAsync(_wmslst, new BulkConfig() { BulkCopyTimeout = 0, BatchSize = 10000 });
+ int _count = _wmsVersionRepository.Count(p => p.Version == version && p.BillNum == _billNum);
+ if (_count == 0)
+ {
+ var _version = new WmsCustomerKanbanOutPut(GuidGenerator.Create(), version, _billNum, CurrentUser.Email,customerCode);
+
+ await _wmsVersionRepository.InsertAsync(_version, true);
+ }
+ return ApplicationConsts.SuccessStr;
+ }
+ ///
+ /// 导出
+ ///
+ ///
+ ///
+ [HttpPost]
+ [Route("Export")]
+ //[Authorize(SettleAccountPermissions.SettleAccounts.Default)]
+ virtual public async Task ExportAsync(WmsKanbanOutPutDetialRequestDto input)
+ {
+ input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "BillNum", Logic = EnumFilterLogic.And, Value = input.BillNum });
+ var entities = await _wmsRepository.GetListByFilterAsync(GuidGenerator.Create(), input.Filters, input.Sorting, int.MaxValue,
+ 0, true);
+
+ IExporter _excel = new ExcelExporter();
+ byte[] result = null;
+
+ var _fileName = string.Format("自定义客户出库单_{0}.xlsx", Guid.NewGuid().ToString());
+ result = await _excel.ExportAsByteArray(entities);
+
+
+ result.ShouldNotBeNull();
+
+ //保存导出文件到服务器存成二进制
+ await _excelImportService.SaveBlobAsync(
+ new SaveExcelImportInputDto
+ {
+ Name = _fileName,
+ Content = result
+ }
+ );
+ return _fileName;
+
+
+
+ }
+
+
+ }
+}
\ No newline at end of file
diff --git a/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/WMS/TaskList.cs b/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/WMS/TaskList.cs
index 58316dcc..cde2f7db 100644
--- a/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/WMS/TaskList.cs
+++ b/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/WMS/TaskList.cs
@@ -56,6 +56,180 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
}
+
+ #region 客户代码
+
+ public class WmsCustomerKanbanOutPut : FullAuditedAggregateRootBase
+ {
+ public WmsCustomerKanbanOutPut()
+ {
+ }
+
+ public WmsCustomerKanbanOutPut(Guid id, string version, string billNum, string creator,string customercode) : base(id)
+ {
+ Id = id;
+ Version = version;
+ BillNum = billNum;
+ Creator = creator;
+ CustomerCode = customercode;
+ }
+
+ public string Version { set; get; }
+ public string BillNum { set; get; }
+ public string Creator { set; get; }
+ public string CustomerCode { set; get; }
+ }
+
+
+ ///
+ /// H平台出库单
+ ///
+ public class WmsCustomerKanbanOutPutDetial : FullAuditedAggregateRootBase
+ {
+ public WmsCustomerKanbanOutPutDetial()
+ {
+ }
+
+ public WmsCustomerKanbanOutPutDetial(Guid id, string wmsBillNum, string kanban, string sapmaterialCode, string materialDesc, string materialGroup,
+ string outPut, string inPut, int state, string extend1, string extend2, string extend3, string materialCode, string billNum,
+ Guid taskId, string remark, decimal qty, decimal price, decimal amt,string customerCode)
+ {
+ Id = id;
+ WmsBillNum = wmsBillNum;
+ Kanban = kanban;
+ SapMaterialCode = sapmaterialCode;
+ MaterialDesc = materialDesc;
+ MaterialGroup = materialGroup;
+ OutPut = outPut;
+ InPut = inPut;
+ State = state;
+ Extend1 = extend1;
+ Extend2 = extend2;
+ Version = extend3;
+ MaterialCode = materialCode;
+ BillNum = billNum;
+ TaskId = taskId;
+ Remark = remark;
+ Qty = qty;
+
+ Price = price;
+ Amt = amt;
+ CustomerCode = customerCode;
+ }
+ public void SetData(Guid id, string remark, string wmsbillnum, string version, Guid taskId,string customerCode)
+ {
+ Id = id;
+ Remark = remark;
+ WmsBillNum = wmsbillnum;
+ Version = version;
+ TaskId = taskId;
+ CustomerCode = customerCode;
+ }
+
+
+ [ImporterHeader(Name = "客户编码")]
+ [ExporterHeader(DisplayName = "客户编码")]
+ public string CustomerCode { set; get; }
+
+ [ImporterHeader(Name = "看板编号")]
+ [ExporterHeader(DisplayName = "看板编号")]
+ //KENN号
+ public string Kanban { set; get; }
+
+ [ImporterHeader(Name = "客户零件号", IsIgnore = true)]
+ [ExporterHeader(DisplayName = "客户零件号", IsIgnore = true)]
+ public string MaterialCode { set; get; }
+ [ImporterHeader(Name = "交货单号")]
+ [ExporterHeader(DisplayName = "交货单号")]
+ public string WmsBillNum { set; get; }
+ //[ImporterHeader(Name = "订货看板编号")]
+ ////KENN号
+ //public string OrderBillNum { set; get; }
+ [ImporterHeader(Name = "SAP零件号")]
+ [ExporterHeader(DisplayName = "SAP零件号")]
+ //物料号
+ public string SapMaterialCode { set; get; }
+ [ImporterHeader(Name = "零件中文名称")]
+ [ExporterHeader(DisplayName = "零件中文名称")]
+ //物料描述
+ public string MaterialDesc { set; get; }
+ [ImporterHeader(Name = "物料组(车型)")]
+ [ExporterHeader(DisplayName = "物料组(车型)")]
+ //物料组(车型)
+ public string MaterialGroup { set; get; }
+ [ImporterHeader(Name = "出库库位", IsIgnore = true)]
+ [ExporterHeader(DisplayName = "出库库位", IsIgnore = true)]
+ //出库库位
+ public string OutPut { set; get; }
+ [ImporterHeader(Name = "入库库位", IsIgnore = true)]
+ [ExporterHeader(DisplayName = "入库库位", IsIgnore = true)]
+ //入库库位
+ public string InPut { set; get; }
+ [ImporterHeader(Name = "状态", IsIgnore = true)]
+ [ExporterHeader(DisplayName = "状态", IsIgnore = true)]
+ public int State { get; set; }
+ [ImporterHeader(Name = "发货零件号",IsIgnore =true)]
+ [ExporterHeader(DisplayName = "发货零件号",IsIgnore =true)]
+ ///
+ /// 扩展字段1
+ ///
+ public string Extend1 { set; get; }
+
+ [ImporterHeader(Name = "收货仓库", IsIgnore = true)]
+ [ExporterHeader(DisplayName = "收货仓库", IsIgnore = true)]
+ public string Extend2 { set; get; }
+ ///
+ /// 扩展字段3
+ ///
+ [ImporterHeader(Name = "版本号", IsIgnore = true)]
+ [ExporterHeader(DisplayName = "版本号", IsIgnore = true)]
+ public string Version { set; get; }
+ [ImporterHeader(Name = "结算数量")]
+ [ExporterHeader(DisplayName = "结算数量")]
+ public decimal Qty { set; get; }
+ [ImporterHeader(Name = "结算单价")]
+ [ExporterHeader(DisplayName = "结算单价")]
+ public decimal Price { set; get; }
+ [ImporterHeader(Name = "结算金额")]
+ [ExporterHeader(DisplayName = "结算金额")]
+ public decimal Amt { set; get; }
+ [ImporterHeader(Name = "数量", IsIgnore = true)]
+ [ExporterHeader(DisplayName = "数量", IsIgnore = true)]
+ public string BillNum { set; get; }
+ [ImporterHeader(Name = "任务描述", IsIgnore = true)]
+ [ExporterHeader(DisplayName = "任务描述", IsIgnore = true)]
+ public Guid TaskId { set; get; }
+
+
+
+ }
+
+
+
+
+
+
+
+
+
+ #endregion
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
///
/// 准时化出库主表
///
@@ -509,48 +683,43 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
[ExporterHeader(DisplayName = "开票金额")]
public decimal Amt { set; get; }
- //以下继承的全部不导出
+
+
+ }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
- //[ExporterHeader(DisplayName = "BranchId", IsIgnore = true)]
- //public Guid BranchId { set; get; }
- //[ExporterHeader(DisplayName = "Enabled", IsIgnore = true)]
- //public bool Enabled { set; get; }
- //[ExporterHeader(DisplayName = "Remark", IsIgnore = true)]
- //public string Remark { set; get; }
- //[ExporterHeader(DisplayName = "IsDeleted", IsIgnore = true)]
- //public bool IsDeleted { set; get; }
- //[ExporterHeader(DisplayName = "DeleterId", IsIgnore = true)]
- //public bool DeleterId { set; get; }
- //[ExporterHeader(DisplayName = "DeletionTime", IsIgnore = true)]
- //public DateTime DeletionTime { set; get; }
- //[ExporterHeader(DisplayName = "LastModificationTime", IsIgnore = true)]
- //public DateTime LastModificationTime { set; get; }
- //[ExporterHeader(DisplayName = "LastModifierId", IsIgnore = true)]
- //public Guid LastModifierId { set; get; }
- //[ExporterHeader(DisplayName = "CreationTime", IsIgnore = true)]
- //public DateTime CreationTime { set; get; }
- //[ExporterHeader(DisplayName = "CreatorId", IsIgnore = true)]
- //public Guid CreatorId { set; get; }
- //[ExporterHeader(DisplayName = "ExtraProperties", IsIgnore = true)]
- //public string ExtraProperties { set; get; }
- //[ExporterHeader(DisplayName = "ConcurrencyStamp", IsIgnore = true)]
- //public DateTime ConcurrencyStamp { set; get; }
- //[ExporterHeader(DisplayName = "Id", IsIgnore = true)]
- //public Guid Id { set; get; }
- }
public class WmsHQWithOutKanbanOutPut : FullAuditedAggregateRootBase
diff --git a/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs
index bc7bcc6d..0e3364fa 100644
--- a/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs
+++ b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs
@@ -381,7 +381,8 @@ namespace Win.Sfs.SettleAccount
builder.ConfigureWmsDetailDiffReport(options);
//有条码
builder.ConfigureWmsDetailWithCodeReport(options);
-
+ builder.ConfigureWmsCustomerKanbanOutPut(options);
+ builder.ConfigureWmsCustomerKanbanOutPutDetial(options);
#endregion
@@ -1791,6 +1792,69 @@ namespace Win.Sfs.SettleAccount
});
}
+
+
+
+
+
+ private static void ConfigureWmsCustomerKanbanOutPut(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options)
+ {
+
+ builder.Entity(b =>
+ {
+ b.ToTable($"{options.TablePrefix}_WmsCustomerKanbanOutPut", options.Schema);
+ b.ConfigureByConvention();
+ b.Property(x => x.BillNum).IsRequired().HasMaxLength(CommonConsts.MaxCodeLength);
+ b.Property(x => x.Version).IsRequired().HasMaxLength(CommonConsts.MaxCodeLength);
+ b.Property(x => x.CustomerCode).IsRequired().HasMaxLength(CommonConsts.MaxCodeLength);
+ b.HasIndex(x => new { x.BillNum });
+ });
+
+ }
+ private static void ConfigureWmsCustomerKanbanOutPutDetial(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options)
+ {
+
+ builder.Entity(b =>
+ {
+ b.ToTable($"{options.TablePrefix}_WmsCustomerKanbanOutPutDetial", options.Schema);
+ b.ConfigureByConvention();
+ b.Property(x => x.BillNum).IsRequired().HasMaxLength(CommonConsts.MaxCodeLength);
+ b.Property(x => x.WmsBillNum).IsRequired().HasMaxLength(CommonConsts.MaxCodeLength);
+ b.Property(x => x.Version).IsRequired().HasMaxLength(CommonConsts.MaxCodeLength);
+ b.Property(x => x.OutPut).HasMaxLength(CommonConsts.MaxCodeLength);
+ b.Property(x => x.InPut).HasMaxLength(CommonConsts.MaxCodeLength);
+ b.Property(x => x.CustomerCode).HasMaxLength(CommonConsts.MaxCodeLength);
+ b.Property(x => x.Kanban).HasMaxLength(CommonConsts.MaxCodeLength);
+ b.Property(x => x.SapMaterialCode).HasMaxLength(CommonConsts.MaxCodeLength);
+ b.Property(x => x.Extend1).HasMaxLength(CommonConsts.MaxCodeLength);
+ b.Property(x => x.Extend2).HasMaxLength(CommonConsts.MaxCodeLength);
+ b.Property(x => x.MaterialCode).HasMaxLength(CommonConsts.MaxCodeLength);
+ b.HasIndex(x => new { x.Version }).IsUnique().HasFilter(IsDeletedFilter);
+ });
+
+ }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
private static void ConfigureWmsHQHSharePartOutPutVersion(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options)
{
diff --git a/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20220311042548_Init.Designer.cs b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20220413040718_5677.Designer.cs
similarity index 97%
rename from src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20220311042548_Init.Designer.cs
rename to src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20220413040718_5677.Designer.cs
index 73b16919..1a1eeef3 100644
--- a/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20220311042548_Init.Designer.cs
+++ b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20220413040718_5677.Designer.cs
@@ -11,8 +11,8 @@ using Win.Sfs.SettleAccount;
namespace Win.Sfs.SettleAccount.Migrations
{
[DbContext(typeof(SettleAccountDbContext))]
- [Migration("20220311042548_Init")]
- partial class Init
+ [Migration("20220413040718_5677")]
+ partial class _5677
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
@@ -8301,6 +8301,218 @@ namespace Win.Sfs.SettleAccount.Migrations
b.ToTable("Set_SparePart_Version");
});
+ modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.WMS.WmsCustomerKanbanOutPut", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("BillNum")
+ .IsRequired()
+ .HasMaxLength(36)
+ .HasColumnType("nvarchar(36)");
+
+ b.Property("BranchId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasMaxLength(40)
+ .HasColumnType("nvarchar(40)")
+ .HasColumnName("ConcurrencyStamp");
+
+ b.Property("CreationTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("CreationTime");
+
+ b.Property("Creator")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("CreatorId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("CreatorId");
+
+ b.Property("CustomerCode")
+ .IsRequired()
+ .HasMaxLength(36)
+ .HasColumnType("nvarchar(36)");
+
+ b.Property("DeleterId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("DeleterId");
+
+ b.Property("DeletionTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("DeletionTime");
+
+ b.Property("Enabled")
+ .HasColumnType("bit");
+
+ b.Property("ExtraProperties")
+ .HasColumnType("nvarchar(max)")
+ .HasColumnName("ExtraProperties");
+
+ 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("Remark")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Version")
+ .IsRequired()
+ .HasMaxLength(36)
+ .HasColumnType("nvarchar(36)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("BillNum");
+
+ b.ToTable("Set_WmsCustomerKanbanOutPut");
+ });
+
+ modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.WMS.WmsCustomerKanbanOutPutDetial", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Amt")
+ .HasColumnType("decimal(18,2)");
+
+ b.Property("BillNum")
+ .IsRequired()
+ .HasMaxLength(36)
+ .HasColumnType("nvarchar(36)");
+
+ b.Property("BranchId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasMaxLength(40)
+ .HasColumnType("nvarchar(40)")
+ .HasColumnName("ConcurrencyStamp");
+
+ b.Property("CreationTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("CreationTime");
+
+ b.Property("CreatorId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("CreatorId");
+
+ b.Property("CustomerCode")
+ .HasMaxLength(36)
+ .HasColumnType("nvarchar(36)");
+
+ b.Property("DeleterId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("DeleterId");
+
+ b.Property("DeletionTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("DeletionTime");
+
+ b.Property("Enabled")
+ .HasColumnType("bit");
+
+ b.Property("Extend1")
+ .HasMaxLength(36)
+ .HasColumnType("nvarchar(36)");
+
+ b.Property("Extend2")
+ .HasMaxLength(36)
+ .HasColumnType("nvarchar(36)");
+
+ b.Property("ExtraProperties")
+ .HasColumnType("nvarchar(max)")
+ .HasColumnName("ExtraProperties");
+
+ b.Property("InPut")
+ .HasMaxLength(36)
+ .HasColumnType("nvarchar(36)");
+
+ b.Property("IsDeleted")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bit")
+ .HasDefaultValue(false)
+ .HasColumnName("IsDeleted");
+
+ b.Property("Kanban")
+ .HasMaxLength(36)
+ .HasColumnType("nvarchar(36)");
+
+ b.Property("LastModificationTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("LastModificationTime");
+
+ b.Property("LastModifierId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("LastModifierId");
+
+ b.Property("MaterialCode")
+ .HasMaxLength(36)
+ .HasColumnType("nvarchar(36)");
+
+ b.Property("MaterialDesc")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("MaterialGroup")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("OutPut")
+ .HasMaxLength(36)
+ .HasColumnType("nvarchar(36)");
+
+ b.Property("Price")
+ .HasColumnType("decimal(18,2)");
+
+ b.Property("Qty")
+ .HasColumnType("decimal(18,2)");
+
+ b.Property("Remark")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("SapMaterialCode")
+ .HasMaxLength(36)
+ .HasColumnType("nvarchar(36)");
+
+ b.Property("State")
+ .HasColumnType("int");
+
+ b.Property("TaskId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Version")
+ .IsRequired()
+ .HasMaxLength(36)
+ .HasColumnType("nvarchar(36)");
+
+ b.Property("WmsBillNum")
+ .IsRequired()
+ .HasMaxLength(36)
+ .HasColumnType("nvarchar(36)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("Version")
+ .IsUnique()
+ .HasFilter("IsDeleted=0");
+
+ b.ToTable("Set_WmsCustomerKanbanOutPutDetial");
+ });
+
modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.WMS.WmsHQCarOutPut", b =>
{
b.Property("Id")
@@ -11639,6 +11851,125 @@ namespace Win.Sfs.SettleAccount.Migrations
b.ToTable("Set_WmsDetailReport");
});
+ modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.WmsDetailWithCodeReport", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Amt")
+ .HasColumnType("decimal(18,2)");
+
+ b.Property("BillNum")
+ .IsRequired()
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("BranchId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Client")
+ .IsRequired()
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasMaxLength(40)
+ .HasColumnType("nvarchar(40)")
+ .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("DiffQty")
+ .HasColumnType("decimal(18,2)");
+
+ b.Property("Enabled")
+ .HasColumnType("bit");
+
+ b.Property("EstimateType")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("ExtraProperties")
+ .HasColumnType("nvarchar(max)")
+ .HasColumnName("ExtraProperties");
+
+ 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("LineNumber")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("MaterialCode")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("MaterialDesc")
+ .HasMaxLength(150)
+ .HasColumnType("nvarchar(150)");
+
+ b.Property("MaterialGroup")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("OutputQty")
+ .HasColumnType("decimal(18,2)");
+
+ b.Property("Price")
+ .HasColumnType("decimal(18,2)");
+
+ b.Property("Qty")
+ .HasColumnType("decimal(18,2)");
+
+ b.Property("Remark")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Remark1")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("State")
+ .HasColumnType("int");
+
+ b.Property("SwitchCode")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Type")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Version")
+ .HasColumnType("nvarchar(max)");
+
+ b.HasKey("Id");
+
+ b.ToTable("Set_WmsDetailWithCodeReport");
+ });
+
modelBuilder.Entity("Win.Sfs.SettleAccount.EstimatedInventories.EstimatedInventoryDetail", b =>
{
b.Property("Id")
diff --git a/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20220311042548_Init.cs b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20220413040718_5677.cs
similarity index 97%
rename from src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20220311042548_Init.cs
rename to src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20220413040718_5677.cs
index 578ab1a1..3b3ddd67 100644
--- a/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20220311042548_Init.cs
+++ b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20220413040718_5677.cs
@@ -3,7 +3,7 @@ using Microsoft.EntityFrameworkCore.Migrations;
namespace Win.Sfs.SettleAccount.Migrations
{
- public partial class Init : Migration
+ public partial class _5677 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
@@ -3412,6 +3412,74 @@ namespace Win.Sfs.SettleAccount.Migrations
table.PrimaryKey("PK_Set_Unsettle_Version", x => x.Id);
});
+ migrationBuilder.CreateTable(
+ name: "Set_WmsCustomerKanbanOutPut",
+ columns: table => new
+ {
+ Id = table.Column(type: "uniqueidentifier", nullable: false),
+ Version = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false),
+ BillNum = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false),
+ Creator = table.Column(type: "nvarchar(max)", nullable: true),
+ CustomerCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false),
+ ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true),
+ ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true),
+ CreationTime = table.Column(type: "datetime2", nullable: false),
+ CreatorId = table.Column(type: "uniqueidentifier", nullable: true),
+ LastModificationTime = table.Column(type: "datetime2", nullable: true),
+ LastModifierId = table.Column(type: "uniqueidentifier", nullable: true),
+ IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false),
+ DeleterId = table.Column(type: "uniqueidentifier", nullable: true),
+ DeletionTime = table.Column(type: "datetime2", nullable: true),
+ BranchId = table.Column(type: "uniqueidentifier", nullable: false),
+ Enabled = table.Column(type: "bit", nullable: false),
+ Remark = table.Column(type: "nvarchar(max)", nullable: true)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_Set_WmsCustomerKanbanOutPut", x => x.Id);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "Set_WmsCustomerKanbanOutPutDetial",
+ columns: table => new
+ {
+ Id = table.Column(type: "uniqueidentifier", nullable: false),
+ CustomerCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true),
+ Kanban = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true),
+ MaterialCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true),
+ WmsBillNum = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false),
+ SapMaterialCode = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true),
+ MaterialDesc = table.Column(type: "nvarchar(max)", nullable: true),
+ MaterialGroup = table.Column(type: "nvarchar(max)", nullable: true),
+ OutPut = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true),
+ InPut = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true),
+ State = table.Column(type: "int", nullable: false),
+ Extend1 = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true),
+ Extend2 = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true),
+ Version = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false),
+ Qty = table.Column(type: "decimal(18,2)", nullable: false),
+ Price = table.Column(type: "decimal(18,2)", nullable: false),
+ Amt = table.Column(type: "decimal(18,2)", nullable: false),
+ BillNum = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: false),
+ TaskId = table.Column(type: "uniqueidentifier", nullable: false),
+ ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true),
+ ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true),
+ CreationTime = table.Column(type: "datetime2", nullable: false),
+ CreatorId = table.Column(type: "uniqueidentifier", nullable: true),
+ LastModificationTime = table.Column(type: "datetime2", nullable: true),
+ LastModifierId = table.Column(type: "uniqueidentifier", nullable: true),
+ IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false),
+ DeleterId = table.Column(type: "uniqueidentifier", nullable: true),
+ DeletionTime = table.Column(type: "datetime2", nullable: true),
+ BranchId = table.Column(type: "uniqueidentifier", nullable: false),
+ Enabled = table.Column(type: "bit", nullable: false),
+ Remark = table.Column(type: "nvarchar(max)", nullable: true)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_Set_WmsCustomerKanbanOutPutDetial", x => x.Id);
+ });
+
migrationBuilder.CreateTable(
name: "Set_WmsDetailDiffReport",
columns: table => new
@@ -3494,6 +3562,46 @@ namespace Win.Sfs.SettleAccount.Migrations
table.PrimaryKey("PK_Set_WmsDetailReport", x => x.Id);
});
+ migrationBuilder.CreateTable(
+ name: "Set_WmsDetailWithCodeReport",
+ columns: table => new
+ {
+ Id = table.Column(type: "uniqueidentifier", nullable: false),
+ Amt = table.Column(type: "decimal(18,2)", nullable: false),
+ LineNumber = table.Column(type: "nvarchar(max)", nullable: true),
+ Version = table.Column(type: "nvarchar(max)", nullable: true),
+ Client = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false),
+ Type = table.Column(type: "nvarchar(max)", nullable: true),
+ BillNum = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false),
+ SwitchCode = table.Column(type: "nvarchar(max)", nullable: true),
+ Qty = table.Column(type: "decimal(18,2)", nullable: false),
+ OutputQty = table.Column(type: "decimal(18,2)", nullable: false),
+ DiffQty = table.Column(type: "decimal(18,2)", nullable: false),
+ Price = table.Column(type: "decimal(18,2)", nullable: false),
+ MaterialCode = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true),
+ EstimateType = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true),
+ MaterialGroup = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true),
+ MaterialDesc = table.Column(type: "nvarchar(150)", maxLength: 150, nullable: true),
+ Remark1 = table.Column(type: "nvarchar(max)", nullable: true),
+ State = table.Column(type: "int", nullable: false),
+ ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true),
+ ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true),
+ CreationTime = table.Column(type: "datetime2", nullable: false),
+ CreatorId = table.Column(type: "uniqueidentifier", nullable: true),
+ LastModificationTime = table.Column(type: "datetime2", nullable: true),
+ LastModifierId = table.Column(type: "uniqueidentifier", nullable: true),
+ IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false),
+ DeleterId = table.Column(type: "uniqueidentifier", nullable: true),
+ DeletionTime = table.Column(type: "datetime2", nullable: true),
+ BranchId = table.Column(type: "uniqueidentifier", nullable: false),
+ Enabled = table.Column(type: "bit", nullable: false),
+ Remark = table.Column(type: "nvarchar(max)", nullable: true)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_Set_WmsDetailWithCodeReport", x => x.Id);
+ });
+
migrationBuilder.CreateTable(
name: "Set_WmsHQCarOutPut",
columns: table => new
@@ -5520,6 +5628,18 @@ namespace Win.Sfs.SettleAccount.Migrations
unique: true,
filter: "IsDeleted=0");
+ migrationBuilder.CreateIndex(
+ name: "IX_Set_WmsCustomerKanbanOutPut_BillNum",
+ table: "Set_WmsCustomerKanbanOutPut",
+ column: "BillNum");
+
+ migrationBuilder.CreateIndex(
+ name: "IX_Set_WmsCustomerKanbanOutPutDetial_Version",
+ table: "Set_WmsCustomerKanbanOutPutDetial",
+ column: "Version",
+ unique: true,
+ filter: "IsDeleted=0");
+
migrationBuilder.CreateIndex(
name: "IX_Set_WmsHQCarOutPut_BillNum",
table: "Set_WmsHQCarOutPut",
@@ -6045,12 +6165,21 @@ namespace Win.Sfs.SettleAccount.Migrations
migrationBuilder.DropTable(
name: "Set_Unsettle_Version");
+ migrationBuilder.DropTable(
+ name: "Set_WmsCustomerKanbanOutPut");
+
+ migrationBuilder.DropTable(
+ name: "Set_WmsCustomerKanbanOutPutDetial");
+
migrationBuilder.DropTable(
name: "Set_WmsDetailDiffReport");
migrationBuilder.DropTable(
name: "Set_WmsDetailReport");
+ migrationBuilder.DropTable(
+ name: "Set_WmsDetailWithCodeReport");
+
migrationBuilder.DropTable(
name: "Set_WmsHQCarOutPut");
diff --git a/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/SettleAccountDbContextModelSnapshot.cs b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/SettleAccountDbContextModelSnapshot.cs
index 5a2a7651..bcd68c85 100644
--- a/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/SettleAccountDbContextModelSnapshot.cs
+++ b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/SettleAccountDbContextModelSnapshot.cs
@@ -8299,6 +8299,218 @@ namespace Win.Sfs.SettleAccount.Migrations
b.ToTable("Set_SparePart_Version");
});
+ modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.WMS.WmsCustomerKanbanOutPut", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("BillNum")
+ .IsRequired()
+ .HasMaxLength(36)
+ .HasColumnType("nvarchar(36)");
+
+ b.Property("BranchId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasMaxLength(40)
+ .HasColumnType("nvarchar(40)")
+ .HasColumnName("ConcurrencyStamp");
+
+ b.Property("CreationTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("CreationTime");
+
+ b.Property("Creator")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("CreatorId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("CreatorId");
+
+ b.Property("CustomerCode")
+ .IsRequired()
+ .HasMaxLength(36)
+ .HasColumnType("nvarchar(36)");
+
+ b.Property("DeleterId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("DeleterId");
+
+ b.Property("DeletionTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("DeletionTime");
+
+ b.Property("Enabled")
+ .HasColumnType("bit");
+
+ b.Property("ExtraProperties")
+ .HasColumnType("nvarchar(max)")
+ .HasColumnName("ExtraProperties");
+
+ 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("Remark")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Version")
+ .IsRequired()
+ .HasMaxLength(36)
+ .HasColumnType("nvarchar(36)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("BillNum");
+
+ b.ToTable("Set_WmsCustomerKanbanOutPut");
+ });
+
+ modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.WMS.WmsCustomerKanbanOutPutDetial", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Amt")
+ .HasColumnType("decimal(18,2)");
+
+ b.Property("BillNum")
+ .IsRequired()
+ .HasMaxLength(36)
+ .HasColumnType("nvarchar(36)");
+
+ b.Property("BranchId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasMaxLength(40)
+ .HasColumnType("nvarchar(40)")
+ .HasColumnName("ConcurrencyStamp");
+
+ b.Property("CreationTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("CreationTime");
+
+ b.Property("CreatorId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("CreatorId");
+
+ b.Property("CustomerCode")
+ .HasMaxLength(36)
+ .HasColumnType("nvarchar(36)");
+
+ b.Property("DeleterId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("DeleterId");
+
+ b.Property("DeletionTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("DeletionTime");
+
+ b.Property("Enabled")
+ .HasColumnType("bit");
+
+ b.Property("Extend1")
+ .HasMaxLength(36)
+ .HasColumnType("nvarchar(36)");
+
+ b.Property("Extend2")
+ .HasMaxLength(36)
+ .HasColumnType("nvarchar(36)");
+
+ b.Property("ExtraProperties")
+ .HasColumnType("nvarchar(max)")
+ .HasColumnName("ExtraProperties");
+
+ b.Property("InPut")
+ .HasMaxLength(36)
+ .HasColumnType("nvarchar(36)");
+
+ b.Property("IsDeleted")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bit")
+ .HasDefaultValue(false)
+ .HasColumnName("IsDeleted");
+
+ b.Property("Kanban")
+ .HasMaxLength(36)
+ .HasColumnType("nvarchar(36)");
+
+ b.Property("LastModificationTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("LastModificationTime");
+
+ b.Property("LastModifierId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("LastModifierId");
+
+ b.Property("MaterialCode")
+ .HasMaxLength(36)
+ .HasColumnType("nvarchar(36)");
+
+ b.Property("MaterialDesc")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("MaterialGroup")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("OutPut")
+ .HasMaxLength(36)
+ .HasColumnType("nvarchar(36)");
+
+ b.Property("Price")
+ .HasColumnType("decimal(18,2)");
+
+ b.Property("Qty")
+ .HasColumnType("decimal(18,2)");
+
+ b.Property("Remark")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("SapMaterialCode")
+ .HasMaxLength(36)
+ .HasColumnType("nvarchar(36)");
+
+ b.Property("State")
+ .HasColumnType("int");
+
+ b.Property("TaskId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Version")
+ .IsRequired()
+ .HasMaxLength(36)
+ .HasColumnType("nvarchar(36)");
+
+ b.Property("WmsBillNum")
+ .IsRequired()
+ .HasMaxLength(36)
+ .HasColumnType("nvarchar(36)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("Version")
+ .IsUnique()
+ .HasFilter("IsDeleted=0");
+
+ b.ToTable("Set_WmsCustomerKanbanOutPutDetial");
+ });
+
modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.WMS.WmsHQCarOutPut", b =>
{
b.Property("Id")
@@ -11654,9 +11866,6 @@ namespace Win.Sfs.SettleAccount.Migrations
b.Property("BranchId")
.HasColumnType("uniqueidentifier");
- b.Property