Browse Source

更新版本

FoShanPG
Administrator 3 years ago
parent
commit
4e3ebd6392
  1. 10
      src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/appsettings.Development.json
  2. 6
      src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/appsettings.json
  3. 606
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSCusomerKanbanAppService.cs
  4. 225
      src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/WMS/TaskList.cs
  5. 66
      src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs
  6. 335
      src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20220413040718_5677.Designer.cs
  7. 131
      src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20220413040718_5677.cs
  8. 215
      src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/SettleAccountDbContextModelSnapshot.cs

10
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": {

6
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": {

606
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
{
/// <summary>
/// 红旗H平台准时化-出库
/// </summary>
//[AllowAnonymous]
[Authorize(SettleAccountPermissions.WMSHQ.Default)]
[Route("api/settleaccount/WMSCusomerKanbanoutput")]
public class WMSCusomerKanbanAppService :
SettleAccountApplicationBase<WmsCustomerKanbanOutPutDetial>
{
private readonly ISettleAccountBranchEfCoreRepository<WmsCustomerKanbanOutPutDetial, Guid> _wmsRepository;
private readonly ISettleAccountBranchEfCoreRepository<WmsCustomerKanbanOutPut, Guid> _wmsVersionRepository;
private readonly WMSEfCoreRepository<WmsCustomerKanbanOutPutDetial> _wmsefRespository;
private readonly WMSEfCoreRepository<TB_BILL> _wmstbRespository;
private readonly ISettleAccountBranchEfCoreRepository<TaskJob, Guid> _job;
private readonly IExcelImportAppService _excelImportService;
private readonly TaskJobService _service;
/// <summary>
///
/// </summary>
/// <param name="wmsRepository"></param>
/// <param name="job"></param>
/// <param name="wmsVersionRepository"></param>
/// <param name="wmsefRespository"></param>
/// <param name="wmstbRespository"></param>
public WMSCusomerKanbanAppService(
IExcelImportAppService excelImportService,
ISettleAccountBranchEfCoreRepository<WmsCustomerKanbanOutPutDetial, Guid> wmsRepository,
ISettleAccountBranchEfCoreRepository<TaskJob, Guid> job,
ISettleAccountBranchEfCoreRepository<WmsCustomerKanbanOutPut, Guid> wmsVersionRepository,
WMSEfCoreRepository<WmsCustomerKanbanOutPutDetial> wmsefRespository,
WMSEfCoreRepository<TB_BILL> wmstbRespository,
IDistributedCache<WmsCustomerKanbanOutPutDetial> 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<long> GetCountAsync(WmsKanbanOutPutDetialRequestDto input)
{
return await _wmsRepository.GetCountByFilterAsync(GuidGenerator.Create(), input.Filters);
}
private async Task<long> GetCountAsync(WmsKanbanOutPutRequestDto input)
{
return await _wmsVersionRepository.GetCountByFilterAsync(GuidGenerator.Create(), input.Filters);
}
/// <summary>
/// 准时化出库主表
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost]
[Route("WmsCustomerKanbanList")]
//[Authorize(SettleAccountPermissions.SettleAccounts.Default)]
virtual public async Task<PagedResultDto<WmsCustomerKanbanOutPut>> 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<WmsCustomerKanbanOutPut>(totalCount, entities);
}
/// <summary>
/// 准时化出库明细
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost]
[Route("WmsCustomerKanbanDetailList")]
//[Authorize(SettleAccountPermissions.SettleAccounts.Default)]
virtual public async Task<PagedResultDto<WmsCustomerKanbanOutPutDetial>> 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<WmsCustomerKanbanOutPutDetial>(totalCount, entities);
}
/// <summary>
/// 任务明细标记已确认
/// </summary>
/// <param name="files">上传的文件(前端已经限制只能上传一个附件)</param>
/// <returns></returns>
[HttpPost]
[Route("WmsCustomerKanbanOutPutAudit")]
[DisableRequestSizeLimit]
public async Task<bool> WmsHQHKanbanAudit(List<Guid> 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;
}
/// <summary>
///更新备注
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpGet]
[Route("UpdateRemark")]
public async Task<bool> 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;
}
///// <summary>
///// 选择任务,生成出库单,只包含已确认的单据
///// </summary>
///// <param name="ids"></param>
///// <param name="version"></param>
///// <returns></returns>
//[HttpPost]
//[Route("WmsWithOutKanbanOutPut")]
//public async Task<string> 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<WmsCustomerKanbanOutPutDetial> _lst = new List<WmsCustomerKanbanOutPutDetial>();
// 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<SettleKBWithOutCode>();
// 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; ;
//}
/// <summary>
/// 选择任务,生成出库单,只包含已确认的单据
/// </summary>
/// <param name="ids"></param>
/// <param name="version"></param>
/// <returns></returns>
[HttpPost]
[Route("WmsCustomerKanbanOutPut")]
public async Task<string> 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<WmsCustomerKanbanOutPutDetial> _lst = new List<WmsCustomerKanbanOutPutDetial>();
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<WmsCustomerKanbanOutPutDetial>();
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; ;
}
/// <summary>
/// 出库界面功能,核准出库功能
/// </summary>
/// <param name="version"></param>
/// <param name="p_list"></param>
/// <returns></returns>
[HttpPost]
[Route("WmsCustomerKanbanOutPut-Pass")]
[UnitOfWork(false)]
public async Task<bool> 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;
}
/// <summary>
///出库界面功能, 撤销核准出库
/// </summary>
/// <param name="ids"></param>
/// <param name="version"></param>
/// <returns></returns>
[HttpPost]
[Route("WmsCustomerKanbanOutPut-Cancel")]
[UnitOfWork(false)]
public async Task<bool> WmsCustomerKanbanOutPutCancel(WmsJitRequestDto input)
{
if (input.Guids != null && input.Guids.Count() > 0)
{
List<string> _ls = new List<string>();
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;
}
/// <summary>
/// 出库界面功能删除
/// </summary>
/// <param name="version"></param>
/// <param name="p_list"></param>
/// <returns></returns>
[HttpPost]
[Route("WmsOutPutDelete")]
[UnitOfWork(false)]
public async Task<bool> 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<string> ExcelImport([FromForm] IFormFileCollection files, string version,string customerCode)
{
var _billNum = "CKB(" +customerCode+")"+ DateTime.Now.ToString("yyyyMMddhhmmss");
var checkList = new List<ErrorExportDto>();
ExportImporter _exportImporter = new ExportImporter();
var result = await _exportImporter.ExtendExcelOfSheetOneImport<WmsCustomerKanbanOutPutDetial>(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<WmsCustomerKanbanOutPutDetial> _lst = new List<WmsCustomerKanbanOutPutDetial>();
var _lsCopy = new List<WmsCustomerKanbanOutPutDetial>();
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;
}
/// <summary>
/// 导出
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost]
[Route("Export")]
//[Authorize(SettleAccountPermissions.SettleAccounts.Default)]
virtual public async Task<string> 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;
}
}
}

225
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<Guid>
{
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; }
}
/// <summary>
/// H平台出库单
/// </summary>
public class WmsCustomerKanbanOutPutDetial : FullAuditedAggregateRootBase<Guid>
{
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)]
/// <summary>
/// 扩展字段1
/// </summary>
public string Extend1 { set; get; }
[ImporterHeader(Name = "收货仓库", IsIgnore = true)]
[ExporterHeader(DisplayName = "收货仓库", IsIgnore = true)]
public string Extend2 { set; get; }
/// <summary>
/// 扩展字段3
/// </summary>
[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
/// <summary>
/// 准时化出库主表
/// </summary>
@ -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<Guid>

66
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<WmsCustomerKanbanOutPut>(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<WmsCustomerKanbanOutPutDetial>(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)
{

335
src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20220311042548_Init.Designer.cs → 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<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<string>("BillNum")
.IsRequired()
.HasMaxLength(36)
.HasColumnType("nvarchar(36)");
b.Property<Guid>("BranchId")
.HasColumnType("uniqueidentifier");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasMaxLength(40)
.HasColumnType("nvarchar(40)")
.HasColumnName("ConcurrencyStamp");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime2")
.HasColumnName("CreationTime");
b.Property<string>("Creator")
.HasColumnType("nvarchar(max)");
b.Property<Guid?>("CreatorId")
.HasColumnType("uniqueidentifier")
.HasColumnName("CreatorId");
b.Property<string>("CustomerCode")
.IsRequired()
.HasMaxLength(36)
.HasColumnType("nvarchar(36)");
b.Property<Guid?>("DeleterId")
.HasColumnType("uniqueidentifier")
.HasColumnName("DeleterId");
b.Property<DateTime?>("DeletionTime")
.HasColumnType("datetime2")
.HasColumnName("DeletionTime");
b.Property<bool>("Enabled")
.HasColumnType("bit");
b.Property<string>("ExtraProperties")
.HasColumnType("nvarchar(max)")
.HasColumnName("ExtraProperties");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnType("bit")
.HasDefaultValue(false)
.HasColumnName("IsDeleted");
b.Property<DateTime?>("LastModificationTime")
.HasColumnType("datetime2")
.HasColumnName("LastModificationTime");
b.Property<Guid?>("LastModifierId")
.HasColumnType("uniqueidentifier")
.HasColumnName("LastModifierId");
b.Property<string>("Remark")
.HasColumnType("nvarchar(max)");
b.Property<string>("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<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<decimal>("Amt")
.HasColumnType("decimal(18,2)");
b.Property<string>("BillNum")
.IsRequired()
.HasMaxLength(36)
.HasColumnType("nvarchar(36)");
b.Property<Guid>("BranchId")
.HasColumnType("uniqueidentifier");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasMaxLength(40)
.HasColumnType("nvarchar(40)")
.HasColumnName("ConcurrencyStamp");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime2")
.HasColumnName("CreationTime");
b.Property<Guid?>("CreatorId")
.HasColumnType("uniqueidentifier")
.HasColumnName("CreatorId");
b.Property<string>("CustomerCode")
.HasMaxLength(36)
.HasColumnType("nvarchar(36)");
b.Property<Guid?>("DeleterId")
.HasColumnType("uniqueidentifier")
.HasColumnName("DeleterId");
b.Property<DateTime?>("DeletionTime")
.HasColumnType("datetime2")
.HasColumnName("DeletionTime");
b.Property<bool>("Enabled")
.HasColumnType("bit");
b.Property<string>("Extend1")
.HasMaxLength(36)
.HasColumnType("nvarchar(36)");
b.Property<string>("Extend2")
.HasMaxLength(36)
.HasColumnType("nvarchar(36)");
b.Property<string>("ExtraProperties")
.HasColumnType("nvarchar(max)")
.HasColumnName("ExtraProperties");
b.Property<string>("InPut")
.HasMaxLength(36)
.HasColumnType("nvarchar(36)");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnType("bit")
.HasDefaultValue(false)
.HasColumnName("IsDeleted");
b.Property<string>("Kanban")
.HasMaxLength(36)
.HasColumnType("nvarchar(36)");
b.Property<DateTime?>("LastModificationTime")
.HasColumnType("datetime2")
.HasColumnName("LastModificationTime");
b.Property<Guid?>("LastModifierId")
.HasColumnType("uniqueidentifier")
.HasColumnName("LastModifierId");
b.Property<string>("MaterialCode")
.HasMaxLength(36)
.HasColumnType("nvarchar(36)");
b.Property<string>("MaterialDesc")
.HasColumnType("nvarchar(max)");
b.Property<string>("MaterialGroup")
.HasColumnType("nvarchar(max)");
b.Property<string>("OutPut")
.HasMaxLength(36)
.HasColumnType("nvarchar(36)");
b.Property<decimal>("Price")
.HasColumnType("decimal(18,2)");
b.Property<decimal>("Qty")
.HasColumnType("decimal(18,2)");
b.Property<string>("Remark")
.HasColumnType("nvarchar(max)");
b.Property<string>("SapMaterialCode")
.HasMaxLength(36)
.HasColumnType("nvarchar(36)");
b.Property<int>("State")
.HasColumnType("int");
b.Property<Guid>("TaskId")
.HasColumnType("uniqueidentifier");
b.Property<string>("Version")
.IsRequired()
.HasMaxLength(36)
.HasColumnType("nvarchar(36)");
b.Property<string>("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<Guid>("Id")
@ -11639,6 +11851,125 @@ namespace Win.Sfs.SettleAccount.Migrations
b.ToTable("Set_WmsDetailReport");
});
modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.WmsDetailWithCodeReport", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<decimal>("Amt")
.HasColumnType("decimal(18,2)");
b.Property<string>("BillNum")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<Guid>("BranchId")
.HasColumnType("uniqueidentifier");
b.Property<string>("Client")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasMaxLength(40)
.HasColumnType("nvarchar(40)")
.HasColumnName("ConcurrencyStamp");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime2")
.HasColumnName("CreationTime");
b.Property<Guid?>("CreatorId")
.HasColumnType("uniqueidentifier")
.HasColumnName("CreatorId");
b.Property<Guid?>("DeleterId")
.HasColumnType("uniqueidentifier")
.HasColumnName("DeleterId");
b.Property<DateTime?>("DeletionTime")
.HasColumnType("datetime2")
.HasColumnName("DeletionTime");
b.Property<decimal>("DiffQty")
.HasColumnType("decimal(18,2)");
b.Property<bool>("Enabled")
.HasColumnType("bit");
b.Property<string>("EstimateType")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("ExtraProperties")
.HasColumnType("nvarchar(max)")
.HasColumnName("ExtraProperties");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnType("bit")
.HasDefaultValue(false)
.HasColumnName("IsDeleted");
b.Property<DateTime?>("LastModificationTime")
.HasColumnType("datetime2")
.HasColumnName("LastModificationTime");
b.Property<Guid?>("LastModifierId")
.HasColumnType("uniqueidentifier")
.HasColumnName("LastModifierId");
b.Property<string>("LineNumber")
.HasColumnType("nvarchar(max)");
b.Property<string>("MaterialCode")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("MaterialDesc")
.HasMaxLength(150)
.HasColumnType("nvarchar(150)");
b.Property<string>("MaterialGroup")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<decimal>("OutputQty")
.HasColumnType("decimal(18,2)");
b.Property<decimal>("Price")
.HasColumnType("decimal(18,2)");
b.Property<decimal>("Qty")
.HasColumnType("decimal(18,2)");
b.Property<string>("Remark")
.HasColumnType("nvarchar(max)");
b.Property<string>("Remark1")
.HasColumnType("nvarchar(max)");
b.Property<int>("State")
.HasColumnType("int");
b.Property<string>("SwitchCode")
.HasColumnType("nvarchar(max)");
b.Property<string>("Type")
.HasColumnType("nvarchar(max)");
b.Property<string>("Version")
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Set_WmsDetailWithCodeReport");
});
modelBuilder.Entity("Win.Sfs.SettleAccount.EstimatedInventories.EstimatedInventoryDetail", b =>
{
b.Property<Guid>("Id")

131
src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20220311042548_Init.cs → 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<Guid>(type: "uniqueidentifier", nullable: false),
Version = table.Column<string>(type: "nvarchar(36)", maxLength: 36, nullable: false),
BillNum = table.Column<string>(type: "nvarchar(36)", maxLength: 36, nullable: false),
Creator = table.Column<string>(type: "nvarchar(max)", nullable: true),
CustomerCode = table.Column<string>(type: "nvarchar(36)", maxLength: 36, nullable: false),
ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: true),
ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: true),
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true),
BranchId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
Enabled = table.Column<bool>(type: "bit", nullable: false),
Remark = table.Column<string>(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<Guid>(type: "uniqueidentifier", nullable: false),
CustomerCode = table.Column<string>(type: "nvarchar(36)", maxLength: 36, nullable: true),
Kanban = table.Column<string>(type: "nvarchar(36)", maxLength: 36, nullable: true),
MaterialCode = table.Column<string>(type: "nvarchar(36)", maxLength: 36, nullable: true),
WmsBillNum = table.Column<string>(type: "nvarchar(36)", maxLength: 36, nullable: false),
SapMaterialCode = table.Column<string>(type: "nvarchar(36)", maxLength: 36, nullable: true),
MaterialDesc = table.Column<string>(type: "nvarchar(max)", nullable: true),
MaterialGroup = table.Column<string>(type: "nvarchar(max)", nullable: true),
OutPut = table.Column<string>(type: "nvarchar(36)", maxLength: 36, nullable: true),
InPut = table.Column<string>(type: "nvarchar(36)", maxLength: 36, nullable: true),
State = table.Column<int>(type: "int", nullable: false),
Extend1 = table.Column<string>(type: "nvarchar(36)", maxLength: 36, nullable: true),
Extend2 = table.Column<string>(type: "nvarchar(36)", maxLength: 36, nullable: true),
Version = table.Column<string>(type: "nvarchar(36)", maxLength: 36, nullable: false),
Qty = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
Price = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
Amt = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
BillNum = table.Column<string>(type: "nvarchar(36)", maxLength: 36, nullable: false),
TaskId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: true),
ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: true),
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true),
BranchId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
Enabled = table.Column<bool>(type: "bit", nullable: false),
Remark = table.Column<string>(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<Guid>(type: "uniqueidentifier", nullable: false),
Amt = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
LineNumber = table.Column<string>(type: "nvarchar(max)", nullable: true),
Version = table.Column<string>(type: "nvarchar(max)", nullable: true),
Client = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
Type = table.Column<string>(type: "nvarchar(max)", nullable: true),
BillNum = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
SwitchCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
Qty = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
OutputQty = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
DiffQty = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
Price = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
MaterialCode = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
EstimateType = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
MaterialGroup = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
MaterialDesc = table.Column<string>(type: "nvarchar(150)", maxLength: 150, nullable: true),
Remark1 = table.Column<string>(type: "nvarchar(max)", nullable: true),
State = table.Column<int>(type: "int", nullable: false),
ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: true),
ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: true),
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true),
BranchId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
Enabled = table.Column<bool>(type: "bit", nullable: false),
Remark = table.Column<string>(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");

215
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<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<string>("BillNum")
.IsRequired()
.HasMaxLength(36)
.HasColumnType("nvarchar(36)");
b.Property<Guid>("BranchId")
.HasColumnType("uniqueidentifier");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasMaxLength(40)
.HasColumnType("nvarchar(40)")
.HasColumnName("ConcurrencyStamp");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime2")
.HasColumnName("CreationTime");
b.Property<string>("Creator")
.HasColumnType("nvarchar(max)");
b.Property<Guid?>("CreatorId")
.HasColumnType("uniqueidentifier")
.HasColumnName("CreatorId");
b.Property<string>("CustomerCode")
.IsRequired()
.HasMaxLength(36)
.HasColumnType("nvarchar(36)");
b.Property<Guid?>("DeleterId")
.HasColumnType("uniqueidentifier")
.HasColumnName("DeleterId");
b.Property<DateTime?>("DeletionTime")
.HasColumnType("datetime2")
.HasColumnName("DeletionTime");
b.Property<bool>("Enabled")
.HasColumnType("bit");
b.Property<string>("ExtraProperties")
.HasColumnType("nvarchar(max)")
.HasColumnName("ExtraProperties");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnType("bit")
.HasDefaultValue(false)
.HasColumnName("IsDeleted");
b.Property<DateTime?>("LastModificationTime")
.HasColumnType("datetime2")
.HasColumnName("LastModificationTime");
b.Property<Guid?>("LastModifierId")
.HasColumnType("uniqueidentifier")
.HasColumnName("LastModifierId");
b.Property<string>("Remark")
.HasColumnType("nvarchar(max)");
b.Property<string>("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<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<decimal>("Amt")
.HasColumnType("decimal(18,2)");
b.Property<string>("BillNum")
.IsRequired()
.HasMaxLength(36)
.HasColumnType("nvarchar(36)");
b.Property<Guid>("BranchId")
.HasColumnType("uniqueidentifier");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasMaxLength(40)
.HasColumnType("nvarchar(40)")
.HasColumnName("ConcurrencyStamp");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime2")
.HasColumnName("CreationTime");
b.Property<Guid?>("CreatorId")
.HasColumnType("uniqueidentifier")
.HasColumnName("CreatorId");
b.Property<string>("CustomerCode")
.HasMaxLength(36)
.HasColumnType("nvarchar(36)");
b.Property<Guid?>("DeleterId")
.HasColumnType("uniqueidentifier")
.HasColumnName("DeleterId");
b.Property<DateTime?>("DeletionTime")
.HasColumnType("datetime2")
.HasColumnName("DeletionTime");
b.Property<bool>("Enabled")
.HasColumnType("bit");
b.Property<string>("Extend1")
.HasMaxLength(36)
.HasColumnType("nvarchar(36)");
b.Property<string>("Extend2")
.HasMaxLength(36)
.HasColumnType("nvarchar(36)");
b.Property<string>("ExtraProperties")
.HasColumnType("nvarchar(max)")
.HasColumnName("ExtraProperties");
b.Property<string>("InPut")
.HasMaxLength(36)
.HasColumnType("nvarchar(36)");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnType("bit")
.HasDefaultValue(false)
.HasColumnName("IsDeleted");
b.Property<string>("Kanban")
.HasMaxLength(36)
.HasColumnType("nvarchar(36)");
b.Property<DateTime?>("LastModificationTime")
.HasColumnType("datetime2")
.HasColumnName("LastModificationTime");
b.Property<Guid?>("LastModifierId")
.HasColumnType("uniqueidentifier")
.HasColumnName("LastModifierId");
b.Property<string>("MaterialCode")
.HasMaxLength(36)
.HasColumnType("nvarchar(36)");
b.Property<string>("MaterialDesc")
.HasColumnType("nvarchar(max)");
b.Property<string>("MaterialGroup")
.HasColumnType("nvarchar(max)");
b.Property<string>("OutPut")
.HasMaxLength(36)
.HasColumnType("nvarchar(36)");
b.Property<decimal>("Price")
.HasColumnType("decimal(18,2)");
b.Property<decimal>("Qty")
.HasColumnType("decimal(18,2)");
b.Property<string>("Remark")
.HasColumnType("nvarchar(max)");
b.Property<string>("SapMaterialCode")
.HasMaxLength(36)
.HasColumnType("nvarchar(36)");
b.Property<int>("State")
.HasColumnType("int");
b.Property<Guid>("TaskId")
.HasColumnType("uniqueidentifier");
b.Property<string>("Version")
.IsRequired()
.HasMaxLength(36)
.HasColumnType("nvarchar(36)");
b.Property<string>("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<Guid>("Id")
@ -11654,9 +11866,6 @@ namespace Win.Sfs.SettleAccount.Migrations
b.Property<Guid>("BranchId")
.HasColumnType("uniqueidentifier");
b.Property<string>("CNumber")
.HasColumnType("nvarchar(max)");
b.Property<string>("Client")
.IsRequired()
.HasMaxLength(50)

Loading…
Cancel
Save