Browse Source

修改BusinessType为枚举 迁移EF

master
mahao 1 year ago
parent
commit
e102997a82
  1. 4
      code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/INVOICE_GRP_DTO.cs
  2. 10
      code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PUB_CAN_SA_DTO.cs
  3. 6
      code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PUB_NOT_SA_DTO.cs
  4. 6
      code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/TB_RePartsRelationship_DTO.cs
  5. 4
      code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Prices/PriceListDtoBase.cs
  6. 88
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_SA_SERVICE.cs
  7. 4
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/INVOICE_GRP.cs
  8. 8
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/PUB_CAN_SA.cs
  9. 6
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/PUB_NOT_SA_DETAIL.cs
  10. 7
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/PUB_PD_DETAIL.cs
  11. 8
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/PUB_SE_DETAIL.cs
  12. 7
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/TB_RePartsRelationship.cs
  13. 2
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Prices/PriceList.cs
  14. 40
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/EnumBusinessType.cs
  15. 3992
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230714063941_20230714-3.Designer.cs
  16. 181
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230714063941_20230714-3.cs
  17. 32
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/SettleAccountDbContextModelSnapshot.cs

4
code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/INVOICE_GRP_DTO.cs

@ -55,7 +55,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
///业务类别
/// </summary>
[Display(Name = "业务类别")]
public string BusinessType { get; set; }
public EnumBusinessType BusinessType { get; set; }
/// <summary>
/// 发票状态
/// </summary>
@ -103,7 +103,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
///业务类别
/// </summary>
[ExporterHeader(DisplayName = "业务类别")]
public string BusinessType { get; set; }
public EnumBusinessType BusinessType { get; set; }
}

10
code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PUB_CAN_SA_DTO.cs

@ -38,7 +38,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
///业务分类
/// </summary>
[Display(Name = "业务分类")]
public string BusinessType { get; set; }
public EnumBusinessType BusinessType { get; set; }
/// <summary>
///明细记录行数
/// </summary>
@ -58,7 +58,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
[Display(Name = "状态")]
public int State { get; set; }
[Display(Name = "业务分类")]
public string BusinessType { get; set; }
public EnumBusinessType BusinessType { get; set; }
[Display(Name = "发票分组号")]
public string InvGroupNum { get; set; }
@ -81,7 +81,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
///业务类别
/// </summary>
[Display(Name = "业务类别")]
public string BusinessType { get; set; }
public EnumBusinessType BusinessType { get; set; }
[Display(Name ="期间")]
public int Version { get; set; }
[Display(Name = "价格")]
@ -126,7 +126,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
///业务类别
/// </summary>
[ExporterHeader(DisplayName = "业务类别")]
public string BusinessType { get; set; }
public EnumBusinessType BusinessType { get; set; }
[ExporterHeader(DisplayName = "单价")]
public decimal Price { get; set; }
@ -173,7 +173,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
///业务类别
/// </summary>
[Display(Name = "业务类别")]
public string BusinessType { get; set; }
public EnumBusinessType BusinessType { get; set; }
/// <summary>
///
/// </summary>

6
code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PUB_NOT_SA_DTO.cs

@ -28,7 +28,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
///业务类别
/// </summary>
[Display(Name = "业务类别")]
public string BusinessType { get; set; }
public EnumBusinessType BusinessType { get; set; }
[Display(Name = "期间")]
public int Version { get; set; }
[Display(Name = "价格")]
@ -91,7 +91,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
///业务类别
/// </summary>
[Display(Name = "业务类别")]
public string BusinessType { get; set; }
public EnumBusinessType BusinessType { get; set; }
[Display(Name = "期间")]
public int Version { get; set; }
[Display(Name = "价格")]
@ -145,7 +145,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
public string Site { get; set; }
[Display(Name = "业务分类")]
public string BusinessType { get; set; }
public EnumBusinessType BusinessType { get; set; }
public int Version { get; set; }
public string SettleBillNum { get; set; }

6
code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/TB_RePartsRelationship_DTO.cs

@ -32,7 +32,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
/// 业务类型
/// </summary>
[Display(Name = "业务类型")]
public string BusinessType { set; get; }
public EnumBusinessType BusinessType { get; set; }
}
/// <summary>
@ -66,7 +66,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
/// </summary>
[Display(Name = "业务类型")]
[ImporterHeader(Name = "业务类型")]
public string BusinessType { set; get; }
public EnumBusinessType BusinessType { get; set; }
}
/// <summary>
@ -100,7 +100,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
/// </summary>
[Display(Name = "业务类型")]
[ExporterHeader(DisplayName = "业务类型")]
public string BusinessType { set; get; }
public EnumBusinessType BusinessType { get; set; }
}
}

4
code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Prices/PriceListDtoBase.cs

@ -417,7 +417,7 @@ namespace Win.Sfs.SettleAccount.Entities.Prices
/// 业务类别
/// </summary>
[Display(Name = "业务类别")]
public string BusinessType { get; set; }
public EnumBusinessType BusinessType { get; set; }
/// <summary>
/// 版本
@ -465,7 +465,7 @@ namespace Win.Sfs.SettleAccount.Entities.Prices
/// 业务类别
/// </summary>
[Display(Name = "业务类别")]
public string BusinessType { get; set; }
public EnumBusinessType BusinessType { get; set; }
/// <summary>
/// 版本

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

@ -2,16 +2,19 @@
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using NPOI.Util;
using SettleAccount.Bases;
using SettleAccount.Domain.BQ;
using Shouldly;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Volo.Abp;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Caching;
using Win.Abp.Snowflakes;
using Win.Sfs.BaseData.ImportExcelCommon;
using Win.Sfs.SettleAccount.Bases;
using Win.Sfs.SettleAccount.CommonManagers;
using Win.Sfs.SettleAccount.Constant;
using Win.Sfs.SettleAccount.Entities.BQ.Dtos;
@ -93,10 +96,10 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
//销售价格
var priceListEntitys = await _priceListRepository.GetAllAsync();
var billNum = GuidGenerator.Create().ToString();
var pubSaBillNum = OrderNumberGenerator.GenerateOrderNumber("SA");
var pubSa = new PUB_SA()
{
BillNum = billNum,
BillNum = pubSaBillNum,
State = "1"
};
@ -116,40 +119,45 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
}
s.LU = s.LU;
s.BillNum = billNum;
s.Site = "直供件";
s.BillNum = pubSaBillNum;
s.Site = "XX工厂";
s.KeyCode = s.LU + s.PN;
//根据物料号、结算日期获取价格
var priceListEntity = priceListEntitys.Find(t => t.LU == s.LU && s.SettleDate > t.BeginTime && s.SettleDate < t.EndTime);
s.Price = priceListEntity?.Price ?? 0;
});
//可结算
var pubCanSaBillNum = OrderNumberGenerator.GenerateOrderNumber("INV");
var pubCanSa = new PUB_CAN_SA()
{
BillNum = pubCanSaBillNum,
SettleBillNum = pubSaBillNum,
State = SettleBillState.,
BusinessType = EnumBusinessType.ZhiGongJian
};
var pubCanSaDetails = new List<PUB_CAN_SA_DETAIL>();
//不可结算
var pubNotSaDetails = new List<PUB_NOT_SA_DETAIL>();
//不可结算 结算分组号码
//不可结算 结算分组号码(根据价格区分结算、不可结算)
var pubNotSaGroupNum = _ls.FindAll(t => t.Price != 0).Select(t => t.GroupNum).Distinct();
var pubSaDetailsCanSe = _ls.FindAll(t => pubNotSaGroupNum.Contains(t.GroupNum) == false);
var pubSaDetailsNotCanSe = _ls.FindAll(t => pubNotSaGroupNum.Contains(t.GroupNum) == true);
var pubCanSaDetailsd = _ls.FindAll(t => pubNotSaGroupNum.Contains(t.GroupNum) == false);
var ddd = _ls.FindAll(t => pubNotSaGroupNum.Contains(t.GroupNum) == true);
//可结算
var pubCanSaDetails = ObjectMapper.Map<List<PUB_SA_DETAIL>, List<PUB_CAN_SA_DETAIL>>(pubSaDetailsCanSe);
//不可结算
var pubNotSaDetails = ObjectMapper.Map<List<PUB_SA_DETAIL>, List<PUB_NOT_SA_DETAIL>>(pubSaDetailsNotCanSe);
//await _repository.InsertAsync(pubSa);
//await _pubSaDetailRepository.InsertManyAsync(_ls);
//添加入库
await _repository.InsertAsync(pubSa);
await _pubSaDetailRepository.InsertManyAsync(_ls);
if (pubCanSaDetails.Count > 0)
{
pubCanSa.InvGroupNum = pubCanSaDetails.Count.ToString();
await _pubCanSaRepository.InsertAsync(pubCanSa);
await _pubCanSaDetailRepository.InsertManyAsync(pubCanSaDetails);
}
if (pubNotSaDetails.Count > 0)
{
await _pubNotSaDetailRepository.InsertManyAsync(pubNotSaDetails);
@ -195,7 +203,53 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
[HttpPost]
public async Task DeleteAsync(Guid id)
{
await _repository.DeleteAsync(id);
//结算主表
PUB_SA pubSaDelEntity;
//结算明细
IEnumerable<PUB_SA_DETAIL> pubSaDetailDelEntitys = default;
//可结算主表
IEnumerable<PUB_CAN_SA> pubCanSaDelEntitys = default;
//可结算明细
IEnumerable<PUB_CAN_SA_DETAIL> pubCanSaDetailDelEntitys = default;
//不可结算
IEnumerable<PUB_NOT_SA_DETAIL> pubNotSaDetailDelEntitys = default;
pubSaDelEntity = await _repository.FindAsync(id);
if (pubSaDelEntity != null) return;
//结算单据
string pubSaBillNum = pubSaDelEntity.BillNum;
pubCanSaDelEntitys = _pubCanSaRepository.Where(t => t.SettleBillNum == pubSaBillNum);
//验证可结算主表状态
if (pubCanSaDelEntitys.Any(t => t.State != SettleBillState.))
{
throw new UserFriendlyException($"该单据可结算单状态无法删除!");
}
pubCanSaDetailDelEntitys = _pubCanSaDetailRepository.Where(t => t.SettleBillNum == pubSaBillNum);
pubNotSaDetailDelEntitys = _pubNotSaDetailRepository.Where(t => t.SettleBillNum == pubSaBillNum);
//删除
await _repository.DeleteAsync(pubSaDelEntity);
if (pubSaDetailDelEntitys != null)
{
await _pubSaDetailRepository.DeleteManyAsync(pubSaDetailDelEntitys);
}
if (pubCanSaDelEntitys != null)
{
await _pubCanSaRepository.DeleteManyAsync(pubCanSaDelEntitys);
}
if (pubCanSaDetailDelEntitys != null)
{
await _pubCanSaDetailRepository.DeleteManyAsync(pubCanSaDetailDelEntitys);
}
if (pubNotSaDetailDelEntitys != null)
{
await _pubNotSaDetailRepository.DeleteManyAsync(pubNotSaDetailDelEntitys);
}
}
#endregion

4
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/INVOICE_GRP.cs

@ -29,13 +29,13 @@ public class INVOICE_GRP : FullAuditedAggregateRoot<Guid>
/// 1-HBPO 2-BBAC(和买单件一起开票,扣减库存时要注意分开) 3-JIT 4-备件、5-印度件
/// </summary>
[Display(Name = "业务类别")]
public string BusinessType { get; set; } = null!;
public EnumBusinessType BusinessType { get; set; }
[Display(Name = "业务类别")]
public InvoiceBillState State { get; set; }
public INVOICE_GRP(Guid guid, string realnvBillNum, string invbillNum, decimal amt, decimal taxAmt, string invGroupNum, string fileName, string businessType, InvoiceBillState state)
public INVOICE_GRP(Guid guid, string realnvBillNum, string invbillNum, decimal amt, decimal taxAmt, string invGroupNum, string fileName, EnumBusinessType businessType, InvoiceBillState state)
{
Id= guid;
RealnvBillNum = realnvBillNum;

8
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/PUB_CAN_SA.cs

@ -26,12 +26,12 @@ public class PUB_CAN_SA :FullAuditedAggregateRoot<Guid>
/// 1、JIT 2、买单件 3、备件 3、印度件
/// </summary>
[Display(Name = "业务分类")]
public string BusinessType { get; set; } = null!;
public EnumBusinessType BusinessType { get; set; }
[Display(Name = "明细记录行数")]
public string InvGroupNum { get; set; } = null!;
public PUB_CAN_SA(int version, string settleBillNum, string billNum, SettleBillState state, string businessType, string invGroupNum)
public PUB_CAN_SA(int version, string settleBillNum, string billNum, SettleBillState state, EnumBusinessType businessType, string invGroupNum)
{
Version = version;
SettleBillNum = settleBillNum;
@ -109,7 +109,7 @@ public class PUB_CAN_SA_DETAIL : SA_CAN_BASE
/// 1、JIT 2、买单件 3、备件 3、印度件
/// </summary>
[Display(Name = "业务类别")]
public string BusinessType { get; set; } = null!;
public EnumBusinessType BusinessType { get; set; }
/// <summary>
/// 对应字段DeliveryNode
@ -117,7 +117,7 @@ public class PUB_CAN_SA_DETAIL : SA_CAN_BASE
//[Display(Name = "结算分组")]
//public string GroupNum { get; set; } = null!;
public PUB_CAN_SA_DETAIL(string keyCode, int version, string billNum, string settleBillNum, string lU, string pN, string site, decimal qty, decimal price, string invGroupNum, DateTime settleDate, string businessType, string groupNum)
public PUB_CAN_SA_DETAIL(string keyCode, int version, string billNum, string settleBillNum, string lU, string pN, string site, decimal qty, decimal price, string invGroupNum, DateTime settleDate, EnumBusinessType businessType, string groupNum)
{
KeyCode = keyCode;
Version = version;

6
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/PUB_NOT_SA_DETAIL.cs

@ -1,6 +1,8 @@
using SettleAccount.Bases;
using System;
using System.ComponentModel.DataAnnotations;
using Win.Sfs.SettleAccount;
namespace SettleAccount.Domain.BQ;
[Display(Name = "PUB不可结算导入明细")]
@ -64,11 +66,11 @@ public class PUB_NOT_SA_DETAIL : SA_NOT_BASE
//[Display(Name = "结算日期(收货日期)")]
//public DateTime SettleDate { get; set; }
[Display(Name = "业务分类")]
public string BusinessType { get; set; } = null!;
public EnumBusinessType BusinessType { get; set; }
//[Display(Name = "结算分组")]
//public string GroupNum { get; set; } = null!;
public PUB_NOT_SA_DETAIL(string keyCode, int version, string settleBillNum, string lU, string pN, string site, decimal qty, string extend1, string extend2, string extend3, decimal price, string invGroupNum, DateTime settleDate, string businessType, string groupNum)
public PUB_NOT_SA_DETAIL(string keyCode, int version, string settleBillNum, string lU, string pN, string site, decimal qty, string extend1, string extend2, string extend3, decimal price, string invGroupNum, DateTime settleDate, EnumBusinessType businessType, string groupNum)
{
KeyCode = keyCode;
Version = version;

7
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/PUB_PD_DETAIL.cs

@ -1,8 +1,7 @@
using SettleAccount.Bases;
using System;
using System.ComponentModel.DataAnnotations;
using Win.Sfs.SettleAccount;
namespace SettleAccount.Domain.BQ;
[Display(Name = "PUB待扣减实体")]
@ -42,7 +41,7 @@ public class PUB_PD_DETAIL :PD_BASE
/// 1、JIT 2、买单件 3、备件 3、印度件
/// </summary>
[Display(Name = "业务类别")]
public string BusinessType { get; set; } = null!;
public EnumBusinessType BusinessType { get; set; }
//[Display(Name = "发票分组号")]
//public string InvGroupNum { get; set; } = null!;
@ -53,7 +52,7 @@ public class PUB_PD_DETAIL :PD_BASE
//[Display(Name = "结算分组")]
//public string GroupNum { get; set; } = null!;
public PUB_PD_DETAIL(Guid guid, string keyCode, int version, string billNum, string lU, string rELU, string pN, string rEPN, string site, decimal qty, decimal price, string businessType, string invGroupNum, DateTime settleDate, string groupNum)
public PUB_PD_DETAIL(Guid guid, string keyCode, int version, string billNum, string lU, string rELU, string pN, string rEPN, string site, decimal qty, decimal price, EnumBusinessType businessType, string invGroupNum, DateTime settleDate, string groupNum)
{
Id = guid;
KeyCode = keyCode;

8
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/PUB_SE_DETAIL.cs

@ -1,9 +1,7 @@
using SettleAccount.Bases;
using System;
using System.ComponentModel.DataAnnotations;
using Win.Sfs.SettleAccount;
namespace SettleAccount.Domain.BQ;
[Display(Name = "PUB发运数据")]
@ -37,7 +35,7 @@ public class PUB_SE_DETAIL :SE_BASE
/// 1、JIT 2、买单件 3、备件 3、印度件
/// </summary>
[Display(Name = "业务分类")]
public string BusinessType { get; set; } = null!;
public EnumBusinessType BusinessType { get; set; }
[Display(Name = "订单时间")]
public DateTime BeginDate { get; set; }
@ -48,7 +46,7 @@ public class PUB_SE_DETAIL :SE_BASE
//[Display(Name = "Wms发货单号")]
//public string WmsBillNum { get; set; } = null!;
public PUB_SE_DETAIL(Guid guid, string keyCode, int version, string lU, string pN, decimal qty, string extend1, string extend2, string extend3, string businessType, DateTime beginDate, DateTime shippingDate, string wmsBillNum)
public PUB_SE_DETAIL(Guid guid, string keyCode, int version, string lU, string pN, decimal qty, string extend1, string extend2, string extend3, EnumBusinessType businessType, DateTime beginDate, DateTime shippingDate, string wmsBillNum)
{
Id=guid;
KeyCode = keyCode;

7
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/TB_RePartsRelationship.cs

@ -1,6 +1,7 @@
using System;
using System.ComponentModel.DataAnnotations;
using Volo.Abp.Domain.Entities.Auditing;
using Win.Sfs.SettleAccount;
namespace SettleAccount.Domain.BQ;
@ -23,9 +24,9 @@ public class TB_RePartsRelationship : FullAuditedAggregateRoot<Guid>
[Display(Name = "客户编码")]
public string ClientCode { set; get; } = null!;
[Display(Name = "业务类型")]
public string BusinessType { set; get; } = null!;
public EnumBusinessType BusinessType { get; set; }
public TB_RePartsRelationship(string lU, string repLU, string clientCode, string businessType)
public TB_RePartsRelationship(string lU, string repLU, string clientCode, EnumBusinessType businessType)
{
LU = lU;
RepLU = repLU;
@ -33,7 +34,7 @@ public class TB_RePartsRelationship : FullAuditedAggregateRoot<Guid>
BusinessType = businessType;
}
public void Update(string lU, string repLU, string clientCode, string businessType)
public void Update(string lU, string repLU, string clientCode, EnumBusinessType businessType)
{
LU = lU;
RepLU = repLU;

2
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Prices/PriceList.cs

@ -85,7 +85,7 @@ namespace Win.Sfs.SettleAccount.Entities.Prices
/// 业务类别
/// </summary>
[Display(Name = "业务类别")]
public string BusinessType { get; set; }
public EnumBusinessType BusinessType { get; set; }

40
code/src/Modules/SettleAccount/src/SettleAccount.Domain/EnumBusinessType.cs

@ -0,0 +1,40 @@
using System.ComponentModel.DataAnnotations;
namespace Win.Sfs.SettleAccount
{
/// <summary>
/// 业务类别
/// </summary>
public enum EnumBusinessType
{
/// <summary>
///未定义
/// </summary>
[Display(Name = "未定义")]
None = 0,
/// <summary>
///直供件
/// </summary>
[Display(Name = "直供件")]
ZhiGongJian = 1,
/// <summary>
///买单件
/// </summary>
[Display(Name = "买单件")]
MaiDanJian = 2,
/// <summary>
///备件
/// </summary>
[Display(Name = "备件")]
BeiJian = 3,
/// <summary>
///印度件
/// </summary>
[Display(Name = "印度件")]
YingDuJian = 4
}
}

3992
code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230714063941_20230714-3.Designer.cs

File diff suppressed because it is too large

181
code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230714063941_20230714-3.cs

@ -0,0 +1,181 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace Win.Sfs.SettleAccount.Migrations
{
public partial class _202307143 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<int>(
name: "BusinessType",
table: "Set_TB_RePartsRelationship",
type: "int",
nullable: false,
defaultValue: 0,
oldClrType: typeof(string),
oldType: "nvarchar(max)",
oldNullable: true);
migrationBuilder.AlterColumn<int>(
name: "BusinessType",
table: "Set_PUB_SE_DETAIL",
type: "int",
maxLength: 50,
nullable: false,
defaultValue: 0,
oldClrType: typeof(string),
oldType: "nvarchar(50)",
oldMaxLength: 50,
oldNullable: true);
migrationBuilder.AlterColumn<int>(
name: "BusinessType",
table: "Set_PUB_PD_DETAIL",
type: "int",
maxLength: 50,
nullable: false,
defaultValue: 0,
oldClrType: typeof(string),
oldType: "nvarchar(50)",
oldMaxLength: 50,
oldNullable: true);
migrationBuilder.AlterColumn<int>(
name: "BusinessType",
table: "Set_PUB_NOT_SA_DETAIL",
type: "int",
maxLength: 50,
nullable: false,
defaultValue: 0,
oldClrType: typeof(string),
oldType: "nvarchar(50)",
oldMaxLength: 50,
oldNullable: true);
migrationBuilder.AlterColumn<int>(
name: "BusinessType",
table: "Set_PUB_CAN_SA_DETAIL",
type: "int",
maxLength: 50,
nullable: false,
defaultValue: 0,
oldClrType: typeof(string),
oldType: "nvarchar(50)",
oldMaxLength: 50,
oldNullable: true);
migrationBuilder.AlterColumn<int>(
name: "BusinessType",
table: "Set_PUB_CAN_SA",
type: "int",
maxLength: 50,
nullable: false,
defaultValue: 0,
oldClrType: typeof(string),
oldType: "nvarchar(50)",
oldMaxLength: 50,
oldNullable: true);
migrationBuilder.AlterColumn<int>(
name: "BusinessType",
table: "Set_PriceList",
type: "int",
nullable: false,
defaultValue: 0,
oldClrType: typeof(string),
oldType: "nvarchar(max)",
oldNullable: true);
migrationBuilder.AlterColumn<int>(
name: "BusinessType",
table: "Set_INVOICE_GRP",
type: "int",
maxLength: 50,
nullable: false,
defaultValue: 0,
oldClrType: typeof(string),
oldType: "nvarchar(50)",
oldMaxLength: 50,
oldNullable: true);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "BusinessType",
table: "Set_TB_RePartsRelationship",
type: "nvarchar(max)",
nullable: true,
oldClrType: typeof(int),
oldType: "int");
migrationBuilder.AlterColumn<string>(
name: "BusinessType",
table: "Set_PUB_SE_DETAIL",
type: "nvarchar(50)",
maxLength: 50,
nullable: true,
oldClrType: typeof(int),
oldType: "int",
oldMaxLength: 50);
migrationBuilder.AlterColumn<string>(
name: "BusinessType",
table: "Set_PUB_PD_DETAIL",
type: "nvarchar(50)",
maxLength: 50,
nullable: true,
oldClrType: typeof(int),
oldType: "int",
oldMaxLength: 50);
migrationBuilder.AlterColumn<string>(
name: "BusinessType",
table: "Set_PUB_NOT_SA_DETAIL",
type: "nvarchar(50)",
maxLength: 50,
nullable: true,
oldClrType: typeof(int),
oldType: "int",
oldMaxLength: 50);
migrationBuilder.AlterColumn<string>(
name: "BusinessType",
table: "Set_PUB_CAN_SA_DETAIL",
type: "nvarchar(50)",
maxLength: 50,
nullable: true,
oldClrType: typeof(int),
oldType: "int",
oldMaxLength: 50);
migrationBuilder.AlterColumn<string>(
name: "BusinessType",
table: "Set_PUB_CAN_SA",
type: "nvarchar(50)",
maxLength: 50,
nullable: true,
oldClrType: typeof(int),
oldType: "int",
oldMaxLength: 50);
migrationBuilder.AlterColumn<string>(
name: "BusinessType",
table: "Set_PriceList",
type: "nvarchar(max)",
nullable: true,
oldClrType: typeof(int),
oldType: "int");
migrationBuilder.AlterColumn<string>(
name: "BusinessType",
table: "Set_INVOICE_GRP",
type: "nvarchar(50)",
maxLength: 50,
nullable: true,
oldClrType: typeof(int),
oldType: "int",
oldMaxLength: 50);
}
}
}

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

@ -1909,9 +1909,9 @@ namespace Win.Sfs.SettleAccount.Migrations
b.Property<decimal>("Amt")
.HasColumnType("decimal(18,2)");
b.Property<string>("BusinessType")
b.Property<int>("BusinessType")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
.HasColumnType("int");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
@ -2363,9 +2363,9 @@ namespace Win.Sfs.SettleAccount.Migrations
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("BusinessType")
b.Property<int>("BusinessType")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
.HasColumnType("int");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
@ -2436,9 +2436,9 @@ namespace Win.Sfs.SettleAccount.Migrations
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("BusinessType")
b.Property<int>("BusinessType")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
.HasColumnType("int");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
@ -2531,9 +2531,9 @@ namespace Win.Sfs.SettleAccount.Migrations
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<string>("BusinessType")
b.Property<int>("BusinessType")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
.HasColumnType("int");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
@ -2642,9 +2642,9 @@ namespace Win.Sfs.SettleAccount.Migrations
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("BusinessType")
b.Property<int>("BusinessType")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
.HasColumnType("int");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
@ -2905,9 +2905,9 @@ namespace Win.Sfs.SettleAccount.Migrations
b.Property<DateTime>("BeginDate")
.HasColumnType("datetime2");
b.Property<string>("BusinessType")
b.Property<int>("BusinessType")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
.HasColumnType("int");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
@ -3054,8 +3054,8 @@ namespace Win.Sfs.SettleAccount.Migrations
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<string>("BusinessType")
.HasColumnType("nvarchar(max)");
b.Property<int>("BusinessType")
.HasColumnType("int");
b.Property<string>("ClientCode")
.HasColumnType("nvarchar(max)");
@ -3572,8 +3572,8 @@ namespace Win.Sfs.SettleAccount.Migrations
b.Property<Guid>("BranchId")
.HasColumnType("uniqueidentifier");
b.Property<string>("BusinessType")
.HasColumnType("nvarchar(max)");
b.Property<int>("BusinessType")
.HasColumnType("int");
b.Property<string>("ClientCode")
.HasColumnType("nvarchar(max)");

Loading…
Cancel
Save