| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425 |
- using System;
- using Microsoft.EntityFrameworkCore.Migrations;
- #nullable disable
- namespace Business.Migrations
- {
- public partial class demoInit : Migration
- {
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.CreateTable(
- name: "b_bom_pretreatment",
- columns: table => new
- {
- Id = table.Column<long>(type: "bigint", nullable: false),
- sourceid = table.Column<long>(type: "bigint", nullable: false, comment: "所属BOM"),
- fid = table.Column<long>(type: "bigint", nullable: false, comment: "本级id"),
- parent_id = table.Column<long>(type: "bigint", nullable: true, comment: "父级"),
- bom_child_id = table.Column<long>(type: "bigint", nullable: true, comment: "bom明细主键"),
- bom_number = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true, comment: "bom编号"),
- item_id = table.Column<long>(type: "bigint", nullable: true, comment: "物料id"),
- item_name = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "物料名称"),
- model = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true, comment: "规格型号"),
- item_number = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "物料编号"),
- level = table.Column<int>(type: "int", nullable: false, comment: "level"),
- bom_id = table.Column<long>(type: "bigint", nullable: true, comment: "BOMid"),
- num = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true, comment: "项次号"),
- num_order = table.Column<long>(type: "bigint", nullable: true, comment: "供排序使用"),
- type = table.Column<int>(type: "int", nullable: false, comment: "类型"),
- qty = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "单位用量"),
- unit = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "单位"),
- erp_cls = table.Column<int>(type: "int", nullable: false, comment: "物料属性"),
- erp_cls_name = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "物料属性名称"),
- backflush = table.Column<int>(type: "int", nullable: false, comment: "是否倒冲"),
- haveicsubs = table.Column<int>(type: "int", nullable: false, comment: "存在替代关系"),
- substitute_code = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true, comment: "群组代码"),
- substitute_strategy = table.Column<int>(type: "int", nullable: false, comment: "替代策略"),
- substitute_mode = table.Column<int>(type: "int", nullable: false, comment: "替代方式"),
- version = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "版本"),
- create_by = table.Column<long>(type: "bigint", nullable: true, comment: "创建人id"),
- create_by_name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "创建人名称"),
- create_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "创建时间"),
- update_by = table.Column<long>(type: "bigint", nullable: true, comment: "修改人"),
- update_by_name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "修改人名称"),
- update_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "修改时间"),
- tenant_id = table.Column<long>(type: "bigint", nullable: false, comment: "企业ID"),
- factory_id = table.Column<long>(type: "bigint", nullable: true, comment: "工厂ID"),
- org_id = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
- IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false, comment: "删除标识")
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_b_bom_pretreatment", x => x.Id);
- },
- comment: "Bom预处理");
- migrationBuilder.CreateTable(
- name: "crm_customer",
- columns: table => new
- {
- Id = table.Column<long>(type: "bigint", nullable: false),
- customer_no = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "客户编号"),
- customer_name = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "客户名称"),
- customer_level = table.Column<int>(type: "int", maxLength: 255, nullable: true, comment: "客户级别"),
- mobile = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "手机号码"),
- telephone = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "电话号码"),
- email = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "邮件地址"),
- contact = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "联系人"),
- post_code = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "邮政编码"),
- country = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "国别地区"),
- province = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "省份"),
- city = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "城市"),
- region = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "区"),
- address = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "地址"),
- sale_mode = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "销售模式"),
- short_name = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "客户简称"),
- short_number = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "客户简码"),
- state = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "状态"),
- value_add_rate = table.Column<decimal>(type: "decimal(18,10)", precision: 18, scale: 10, nullable: true, comment: "增值税率"),
- carrying_aos = table.Column<int>(type: "int", nullable: false, comment: "默认运输提前期_天"),
- corperate = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "法人代表"),
- currency = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "结算币种"),
- employee_name = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "专营业务员"),
- employee_no = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "专营业务员_工号"),
- op_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "操作时间"),
- cust_type_number = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "客户类别编码"),
- cust_type = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "客户类别"),
- cust_group_number = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "客户分组编号"),
- cust_group_name = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "客户分组名称"),
- create_by = table.Column<long>(type: "bigint", nullable: true, comment: "创建人id"),
- create_by_name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "创建人名称"),
- create_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "创建时间"),
- update_by = table.Column<long>(type: "bigint", nullable: true, comment: "修改人"),
- update_by_name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "修改人名称"),
- update_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "修改时间"),
- tenant_id = table.Column<long>(type: "bigint", nullable: false, comment: "企业ID"),
- factory_id = table.Column<long>(type: "bigint", nullable: true, comment: "工厂ID"),
- org_id = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
- IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false, comment: "删除标识")
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_crm_customer", x => x.Id);
- },
- comment: "客户");
- migrationBuilder.CreateTable(
- name: "crm_seorder",
- columns: table => new
- {
- Id = table.Column<long>(type: "bigint", nullable: false),
- bill_no = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "订单编号"),
- order_type = table.Column<int>(type: "int", nullable: true, comment: "订单类别(销售、计划)"),
- trade_type = table.Column<int>(type: "int", nullable: true, comment: "贸易类型"),
- sale_style = table.Column<int>(type: "int", nullable: true, comment: "销售订单类型"),
- sale_style_no = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "销售订单类型编码"),
- custom_id = table.Column<int>(type: "int", nullable: true, comment: "客户id"),
- custom_name = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "客户名称"),
- custom_no = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "客户编码"),
- custom_level = table.Column<int>(type: "int", maxLength: 80, nullable: true, comment: "客户级别"),
- date = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "签订日期"),
- rdate = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "采购下单日期"),
- urgent = table.Column<int>(type: "int", nullable: false, comment: "加急级别"),
- currency = table.Column<int>(type: "int", maxLength: 50, nullable: true, comment: "币种"),
- exchange_rate = table.Column<decimal>(type: "decimal(20,8)", precision: 20, scale: 8, nullable: true, comment: "汇率"),
- biller = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "制单人"),
- emp_no = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "业务员工号"),
- emp_name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "业务员名称"),
- auditor = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "审核人"),
- audit_date = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "审核日期"),
- status = table.Column<int>(type: "int", nullable: true, comment: "订单状态"),
- closed = table.Column<bool>(type: "bit", nullable: false, comment: "是否关闭1关闭0未关闭"),
- op_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "操作时间"),
- bill_from = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "订单来源"),
- project_name = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "项目名称"),
- project_code = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "项目编号"),
- out_stock_type = table.Column<int>(type: "int", nullable: true, comment: "销售出库类型"),
- sale_dept_id = table.Column<long>(type: "bigint", nullable: true, comment: "销售部门id"),
- sale_dept_name = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "销售部门名称"),
- sale_dept_code = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "销售部门编号"),
- create_dept = table.Column<long>(type: "bigint", nullable: true, comment: "创建部门id"),
- create_by = table.Column<long>(type: "bigint", nullable: true, comment: "创建人id"),
- create_by_name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "创建人名称"),
- create_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "创建时间"),
- update_by = table.Column<long>(type: "bigint", nullable: true, comment: "修改人"),
- update_by_name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "修改人名称"),
- update_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "修改时间"),
- tenant_id = table.Column<long>(type: "bigint", nullable: false, comment: "企业ID"),
- factory_id = table.Column<long>(type: "bigint", nullable: true, comment: "工厂ID"),
- org_id = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
- IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false, comment: "删除标识")
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_crm_seorder", x => x.Id);
- },
- comment: "销售订单表");
- migrationBuilder.CreateTable(
- name: "crm_seorderentry",
- columns: table => new
- {
- Id = table.Column<long>(type: "bigint", nullable: false),
- seorder_id = table.Column<long>(type: "bigint", nullable: true, comment: "销售订单id"),
- bill_no = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "销售订单编号"),
- entry_seq = table.Column<int>(type: "int", nullable: true, comment: "行号"),
- map_number = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "对应代码"),
- map_name = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "代码名称"),
- item_number = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "产品代码"),
- fms_number = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "FMS旧料号"),
- item_name = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "产品名称"),
- specification = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "规格型号"),
- urgent = table.Column<int>(type: "int", nullable: true, comment: "加急级别"),
- bom_number = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "BOM编号"),
- unit = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "单位"),
- qty = table.Column<decimal>(type: "decimal(20,8)", precision: 20, scale: 8, nullable: true, comment: "订单数量"),
- price = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "单价"),
- tax_price = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "含税单价"),
- amount = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "金额"),
- tax_rate = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "税率"),
- discount_rate = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "折扣率"),
- discount_amount = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "折扣额"),
- aux_price_discount = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "实际含税单价"),
- tax_amtount = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "销项税额"),
- total_amount = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "价税合计"),
- plan_date = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "客户要求交期"),
- date = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "最终交货日期"),
- planner_name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "计划员"),
- planner_no = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "计划员_工号"),
- remark = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "备注"),
- soure_bill_no = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "源单编号"),
- custom_order_bill_no = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "客户订单号"),
- custom_order_entryid = table.Column<int>(type: "int", nullable: true, comment: "客户订单行号"),
- sys_capacity_date = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "系统建议交期(产能)"),
- adjust_date = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "调整建议交期"),
- mrp_closed = table.Column<bool>(type: "bit", nullable: true, comment: "mrp关闭"),
- op_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "操作时间"),
- custom_order_itemno = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "客户料号"),
- state = table.Column<bool>(type: "bit", nullable: true, comment: "数据状态标识 0停用 1启用"),
- rstate = table.Column<int>(type: "int", nullable: true, comment: "评审状态"),
- rnumber = table.Column<int>(type: "int", nullable: true, comment: "评审次数"),
- progress = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "订单进度"),
- deliver_notice_count = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "发货通知单数量"),
- deliver_count = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "发货数量(已出库数量)"),
- se_reject_reason = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "业务员工号"),
- out_stock_type = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "出库类型"),
- is_checked = table.Column<bool>(type: "bit", nullable: true, comment: "是否完成检测,0未完成,1完成"),
- sys_material_date = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "系统建议交期(物料)"),
- contract_no = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "合同编号"),
- create_dept = table.Column<long>(type: "bigint", nullable: true, comment: "创建部门id"),
- create_by = table.Column<long>(type: "bigint", nullable: true, comment: "创建人id"),
- create_by_name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "创建人名称"),
- create_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "创建时间"),
- update_by = table.Column<long>(type: "bigint", nullable: true, comment: "修改人"),
- update_by_name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "修改人名称"),
- update_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "修改时间"),
- tenant_id = table.Column<long>(type: "bigint", nullable: false, comment: "企业ID"),
- factory_id = table.Column<long>(type: "bigint", nullable: true, comment: "工厂ID"),
- org_id = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
- IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false, comment: "删除标识")
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_crm_seorderentry", x => x.Id);
- },
- comment: "销售订单明细表");
- migrationBuilder.CreateTable(
- name: "ic_bom",
- columns: table => new
- {
- Id = table.Column<long>(type: "bigint", nullable: false),
- bom_number = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true, comment: "bom单编号"),
- icitem_id = table.Column<long>(type: "bigint", nullable: false, comment: "物料id"),
- item_number = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "物料代码"),
- item_name = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true, comment: "物料名称"),
- bom_num = table.Column<int>(type: "int", nullable: true, comment: "序号"),
- use_status = table.Column<int>(type: "int", nullable: true, comment: "使用状态"),
- begin_day = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "生效日期"),
- end_day = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "失效日期"),
- product_principal = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "生产负责人"),
- product_designer = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "产品设计员"),
- version = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "版本"),
- chartnumber = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "图表编号"),
- biller = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "图片"),
- checker = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "检验人"),
- check_date = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "检验时间"),
- user = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true, comment: "bom创建人"),
- use_date = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "bom创建时间"),
- unit = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true, comment: "单位"),
- create_by = table.Column<long>(type: "bigint", nullable: true, comment: "创建人id"),
- create_by_name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "创建人名称"),
- create_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "创建时间"),
- update_by = table.Column<long>(type: "bigint", nullable: true, comment: "修改人"),
- update_by_name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "修改人名称"),
- update_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "修改时间"),
- tenant_id = table.Column<long>(type: "bigint", nullable: false, comment: "企业ID"),
- factory_id = table.Column<long>(type: "bigint", nullable: true, comment: "工厂ID"),
- org_id = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
- IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false, comment: "删除标识")
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_ic_bom", x => x.Id);
- },
- comment: "物料BOM");
- migrationBuilder.CreateTable(
- name: "ic_bom_child",
- columns: table => new
- {
- Id = table.Column<long>(type: "bigint", nullable: false),
- bom_id = table.Column<long>(type: "bigint", nullable: false, comment: "bom主键"),
- bom_number = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true, comment: "bom单编号"),
- is_bom = table.Column<int>(type: "int", nullable: true, comment: "是否是BOM"),
- icitem_id = table.Column<long>(type: "bigint", nullable: false, comment: "物料id"),
- item_number = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "物料代码"),
- item_name = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true, comment: "物料名称"),
- unit = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true, comment: "单位"),
- qty = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "用量"),
- scrap = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "损耗率"),
- backflush = table.Column<int>(type: "int", nullable: true, comment: "是否倒冲"),
- iskeyitem = table.Column<int>(type: "int", nullable: true, comment: "是否关键件"),
- haveicsubs = table.Column<int>(type: "int", nullable: true, comment: "存在替代关系"),
- substitute_code = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true, comment: "群组代码"),
- is_replace = table.Column<int>(type: "int", nullable: true, comment: "是否群组替代"),
- icitem_ids = table.Column<string>(type: "nvarchar(2000)", maxLength: 2000, nullable: true, comment: "组合模式"),
- note = table.Column<string>(type: "nvarchar(1000)", maxLength: 1000, nullable: true, comment: "备注"),
- entryid = table.Column<int>(type: "int", nullable: true, comment: "顺序号"),
- type = table.Column<int>(type: "int", nullable: true, comment: "物料类型"),
- erp_cls = table.Column<int>(type: "int", nullable: true, comment: "物料属性"),
- use_status = table.Column<int>(type: "int", nullable: true, comment: "使用状态"),
- begin_day = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "生效日期"),
- end_day = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "失效日期"),
- op_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "操作时间"),
- child_num = table.Column<int>(type: "int", nullable: true, comment: "序号"),
- version = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "版本"),
- create_by = table.Column<long>(type: "bigint", nullable: true, comment: "创建人id"),
- create_by_name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "创建人名称"),
- create_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "创建时间"),
- update_by = table.Column<long>(type: "bigint", nullable: true, comment: "修改人"),
- update_by_name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "修改人名称"),
- update_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "修改时间"),
- tenant_id = table.Column<long>(type: "bigint", nullable: false, comment: "企业ID"),
- factory_id = table.Column<long>(type: "bigint", nullable: true, comment: "工厂ID"),
- org_id = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
- IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false, comment: "删除标识")
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_ic_bom_child", x => x.Id);
- },
- comment: "物料BOM明细");
- migrationBuilder.CreateTable(
- name: "ic_item",
- columns: table => new
- {
- Id = table.Column<long>(type: "bigint", nullable: false),
- number = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "物料编码"),
- name = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "物料名称"),
- model = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true, comment: "规格型号"),
- full_name = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "全名"),
- fms_number = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "fms旧料号"),
- erp_oldnumber = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "erp旧料号"),
- chart_number = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "图号"),
- fversion = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "版本号"),
- box_model = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true, comment: "盒贴规格"),
- erp_cls = table.Column<int>(type: "int", nullable: true, comment: "物料属性"),
- erp_cls_name = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "物料属性"),
- unit = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "单位"),
- item_level = table.Column<long>(type: "bigint", nullable: true, comment: "物料等级"),
- standard_manhour = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "单位标准工时_小时"),
- unititem_amount = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "单位材料定额_元"),
- source = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true, comment: "来源"),
- is_equipment = table.Column<int>(type: "int", nullable: true, comment: "是否为设备"),
- unit_qty = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "单位包装数量"),
- iskeyitem = table.Column<int>(type: "int", nullable: true, comment: "是否关键件"),
- gross_weight = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "毛重"),
- net_weight = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "净重"),
- maund = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "重量单位"),
- length = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "长度"),
- cubic_measure = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "长度单位"),
- width = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "宽度"),
- height = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "高度"),
- size = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "体积"),
- allowpur = table.Column<int>(type: "int", nullable: true, comment: "允许采购"),
- allowsale = table.Column<int>(type: "int", nullable: true, comment: "允许销售"),
- allowmanu = table.Column<int>(type: "int", nullable: true, comment: "允许生产"),
- allowout = table.Column<int>(type: "int", nullable: true, comment: "允许委外"),
- allowbatch = table.Column<int>(type: "int", nullable: true, comment: "批号管理"),
- allowserial = table.Column<int>(type: "int", nullable: true, comment: "序列号管理"),
- photo = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "图片"),
- picktype = table.Column<long>(type: "bigint", nullable: true, comment: "领料类型"),
- output_type_id = table.Column<long>(type: "bigint", nullable: true, comment: "出库类型"),
- enable_warning = table.Column<int>(type: "int", nullable: true, comment: "启用预警"),
- life_state = table.Column<int>(type: "int", nullable: true, comment: "生命周期状态"),
- moq = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "经济生产批量"),
- maq = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "最大生产批量"),
- is_clean = table.Column<int>(type: "int", nullable: true, comment: "是否备料前预处理"),
- clean_leadtime = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "预处理提前期"),
- sterilize_leadtime = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "工序委外提前期"),
- transfer_leadtime = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "平台调拨提前期"),
- standard_period = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "标准工期"),
- fmr = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "FMR分类"),
- abc = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "ABC分类"),
- fix_leadtime = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "固定提前期(天)"),
- plan_trategy = table.Column<int>(type: "int", nullable: true, comment: "计划策略"),
- order_trategy = table.Column<int>(type: "int", nullable: true, comment: "订货策略"),
- order_inter_val = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "订货间隔期_天"),
- lead_time = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "变动提前期"),
- bat_change_economy = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "变动提前期批量"),
- total_tqq = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "累计提前期"),
- order_point = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "再订货点"),
- isfixedreorder = table.Column<int>(type: "int", nullable: true, comment: "设置为固定再订货点"),
- secinv = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "安全库存数量"),
- secinv_ratio = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "安全库存触发采购比例"),
- self_inspection_date = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "自检提前期"),
- Warehousing_date = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "入库提前期"),
- Shipping_date = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "发运提前期"),
- product_line = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "产品线"),
- batch_manager = table.Column<int>(type: "int", nullable: false, comment: "是否采用业务批次管理"),
- ordissu_days = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "工单发料时间/天"),
- transportation_leadtime = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: false, comment: "运输中提前期_天"),
- stock_leadtime = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: false, comment: "仓库中提前期_天"),
- production_leadtime = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: false, comment: "生产中提前期_天"),
- order_leadtime = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: false, comment: "下单前置期_天"),
- minpackqty = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: false, comment: "最小包装量"),
- minorderqty = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: false, comment: "最小订单量"),
- isbackflush = table.Column<int>(type: "int", nullable: true, comment: "是否倒冲"),
- put_integer = table.Column<int>(type: "int", nullable: true, comment: "投料自动取整"),
- create_by = table.Column<long>(type: "bigint", nullable: true, comment: "创建人id"),
- create_by_name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "创建人名称"),
- create_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "创建时间"),
- update_by = table.Column<long>(type: "bigint", nullable: true, comment: "修改人"),
- update_by_name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "修改人名称"),
- update_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "修改时间"),
- tenant_id = table.Column<long>(type: "bigint", nullable: false, comment: "企业ID"),
- factory_id = table.Column<long>(type: "bigint", nullable: true, comment: "工厂ID"),
- org_id = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
- IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false, comment: "删除标识")
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_ic_item", x => x.Id);
- },
- comment: "物料详情");
- migrationBuilder.CreateTable(
- name: "ic_item_inventory",
- columns: table => new
- {
- Id = table.Column<long>(type: "bigint", nullable: false),
- icitem_stock_id = table.Column<long>(type: "bigint", nullable: false, comment: "物料库存主键"),
- stock_id = table.Column<long>(type: "bigint", nullable: false, comment: "仓库id"),
- stock_name = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "仓库名称"),
- stock_place_id = table.Column<long>(type: "bigint", nullable: false, comment: "库位id"),
- stock_place_code = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "库位编码"),
- batch_no = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "批次号"),
- qty = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "数量"),
- bal = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "金额"),
- kf_period = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "保质期时长"),
- kf_date = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "保质期时间"),
- qty_lock = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "锁定库存"),
- sec_qty = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "安全库存"),
- unit = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "单位"),
- rq = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "日期"),
- create_by = table.Column<long>(type: "bigint", nullable: true, comment: "创建人id"),
- create_by_name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "创建人名称"),
- create_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "创建时间"),
- update_by = table.Column<long>(type: "bigint", nullable: true, comment: "修改人"),
- update_by_name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "修改人名称"),
- update_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "修改时间"),
- tenant_id = table.Column<long>(type: "bigint", nullable: false, comment: "企业ID"),
- factory_id = table.Column<long>(type: "bigint", nullable: true, comment: "工厂ID"),
- org_id = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
- IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false, comment: "删除标识")
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_ic_item_inventory", x => x.Id);
- },
- comment: "物料库存明细表");
- migrationBuilder.CreateTable(
- name: "ic_item_stock",
- columns: table => new
- {
- Id = table.Column<long>(type: "bigint", nullable: false),
- icitem_id = table.Column<long>(type: "bigint", nullable: false, comment: "物料id"),
- icitem_name = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "物料名称"),
- sqty = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "物料库存量"),
- quantity_in_transit = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "调拨在途数量"),
- factory_fode = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "工厂编码"),
- create_by = table.Column<long>(type: "bigint", nullable: true, comment: "创建人id"),
- create_by_name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "创建人名称"),
- create_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "创建时间"),
- update_by = table.Column<long>(type: "bigint", nullable: true, comment: "修改人"),
- update_by_name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "修改人名称"),
- update_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "修改时间"),
- tenant_id = table.Column<long>(type: "bigint", nullable: false, comment: "企业ID"),
- factory_id = table.Column<long>(type: "bigint", nullable: true, comment: "工厂ID"),
- org_id = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
- IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false, comment: "删除标识")
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_ic_item_stock", x => x.Id);
- },
- comment: "物料库存表");
- migrationBuilder.CreateTable(
- name: "ic_substitute",
- columns: table => new
- {
- Id = table.Column<long>(type: "bigint", nullable: false),
- substitute_code = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true, comment: "群组代码"),
- substitute_type = table.Column<int>(type: "int", nullable: true, comment: "替代类型"),
- substitute_strategy = table.Column<int>(type: "int", nullable: true, comment: "替代策略"),
- substitute_mode = table.Column<int>(type: "int", nullable: true, comment: "替代方式"),
- create_by = table.Column<long>(type: "bigint", nullable: true, comment: "创建人id"),
- create_by_name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "创建人名称"),
- create_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "创建时间"),
- update_by = table.Column<long>(type: "bigint", nullable: true, comment: "修改人"),
- update_by_name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "修改人名称"),
- update_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "修改时间"),
- tenant_id = table.Column<long>(type: "bigint", nullable: false, comment: "企业ID"),
- factory_id = table.Column<long>(type: "bigint", nullable: true, comment: "工厂ID"),
- org_id = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
- IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false, comment: "删除标识")
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_ic_substitute", x => x.Id);
- },
- comment: "替代群组");
- migrationBuilder.CreateTable(
- name: "ic_substitute_group",
- columns: table => new
- {
- Id = table.Column<long>(type: "bigint", nullable: false),
- substitute_group_id = table.Column<long>(type: "bigint", nullable: false, comment: "群组主键"),
- substitute_code = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true, comment: "群组代码"),
- replace_relation = table.Column<string>(type: "nvarchar(2000)", maxLength: 2000, nullable: true, comment: "替代关系"),
- replace_name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "替代名称"),
- replace_way = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "替代方式"),
- product_line = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "产品线"),
- use_model = table.Column<string>(type: "nvarchar(max)", maxLength: 5000, nullable: true, comment: "使用机型"),
- order_num = table.Column<int>(type: "int", nullable: true, comment: "群组优先级"),
- main_material = table.Column<int>(type: "int", nullable: true, comment: "主料/替代料"),
- create_by = table.Column<long>(type: "bigint", nullable: true, comment: "创建人id"),
- create_by_name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "创建人名称"),
- create_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "创建时间"),
- update_by = table.Column<long>(type: "bigint", nullable: true, comment: "修改人"),
- update_by_name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "修改人名称"),
- update_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "修改时间"),
- tenant_id = table.Column<long>(type: "bigint", nullable: false, comment: "企业ID"),
- factory_id = table.Column<long>(type: "bigint", nullable: true, comment: "工厂ID"),
- org_id = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
- IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false, comment: "删除标识")
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_ic_substitute_group", x => x.Id);
- },
- comment: "物料替代多群组");
- migrationBuilder.CreateTable(
- name: "ic_substitute_group_detail",
- columns: table => new
- {
- Id = table.Column<long>(type: "bigint", nullable: false),
- substitute_group_id = table.Column<long>(type: "bigint", nullable: false, comment: "替代多群组主键"),
- substitute_code = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true, comment: "群组代码"),
- icitem_id = table.Column<long>(type: "bigint", nullable: false, comment: "物料主键"),
- icitem_number = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true, comment: "物料编码"),
- ismain = table.Column<int>(type: "int", nullable: true, comment: "主/替"),
- seq = table.Column<int>(type: "int", nullable: true, comment: "序号"),
- replace_qty = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "替代数量"),
- create_by = table.Column<long>(type: "bigint", nullable: true, comment: "创建人id"),
- create_by_name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "创建人名称"),
- create_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "创建时间"),
- update_by = table.Column<long>(type: "bigint", nullable: true, comment: "修改人"),
- update_by_name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "修改人名称"),
- update_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "修改时间"),
- tenant_id = table.Column<long>(type: "bigint", nullable: false, comment: "企业ID"),
- factory_id = table.Column<long>(type: "bigint", nullable: true, comment: "工厂ID"),
- org_id = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
- IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false, comment: "删除标识")
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_ic_substitute_group_detail", x => x.Id);
- },
- comment: "物料替代多群组明细");
- migrationBuilder.CreateTable(
- name: "mes_moentry",
- columns: table => new
- {
- Id = table.Column<long>(type: "bigint", nullable: false),
- moentry_moid = table.Column<long>(type: "bigint", nullable: true, comment: "工单主表id"),
- moentry_mono = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "工单编号"),
- soentry_id = table.Column<long>(type: "bigint", nullable: true, comment: "订单行id"),
- fentry_id = table.Column<long>(type: "bigint", nullable: true, comment: "订单行号"),
- fbill_no = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "订单编号"),
- unit = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "单位"),
- morder_production_number = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "工单生产数量(计划数量)"),
- need_number = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "需求数量"),
- remaining_number = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "剩余可用数量"),
- create_by = table.Column<long>(type: "bigint", nullable: true, comment: "创建人id"),
- create_by_name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "创建人名称"),
- create_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "创建时间"),
- update_by = table.Column<long>(type: "bigint", nullable: true, comment: "修改人"),
- update_by_name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "修改人名称"),
- update_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "修改时间"),
- tenant_id = table.Column<long>(type: "bigint", nullable: false, comment: "企业ID"),
- factory_id = table.Column<long>(type: "bigint", nullable: true, comment: "工厂ID"),
- org_id = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
- IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false, comment: "删除标识")
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_mes_moentry", x => x.Id);
- },
- comment: "生成工单子表");
- migrationBuilder.CreateTable(
- name: "mes_mooccupy",
- columns: table => new
- {
- Id = table.Column<long>(type: "bigint", nullable: false),
- moo_id_type = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "类型--原始,分配"),
- moo_id_billid = table.Column<long>(type: "bigint", nullable: true, comment: "订单id"),
- fbill_no = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "订单号"),
- fentry_id = table.Column<long>(type: "bigint", nullable: true, comment: "行号"),
- fitem_number = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false, comment: "物料编码"),
- fitem_name = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: false, comment: "物料名称"),
- fmodel = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: true, comment: "规格型号"),
- moo_moid = table.Column<long>(type: "bigint", nullable: true, comment: "工单id"),
- moo_mo = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "工单号"),
- moo_qty = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "占用量"),
- moo_stime = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "开始时间"),
- moo_etime = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "结束时间"),
- moo_state = table.Column<int>(type: "int", nullable: true, comment: "占用状态-1占用 默认0"),
- moo_cbr = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "变更人"),
- moo_ctime = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "变更时间"),
- moo_creason = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: true, comment: "变更原因"),
- create_by = table.Column<long>(type: "bigint", nullable: true, comment: "创建人id"),
- create_by_name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "创建人名称"),
- create_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "创建时间"),
- update_by = table.Column<long>(type: "bigint", nullable: true, comment: "修改人"),
- update_by_name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "修改人名称"),
- update_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "修改时间"),
- tenant_id = table.Column<long>(type: "bigint", nullable: false, comment: "企业ID"),
- factory_id = table.Column<long>(type: "bigint", nullable: true, comment: "工厂ID"),
- org_id = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
- IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false, comment: "删除标识")
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_mes_mooccupy", x => x.Id);
- },
- comment: "在制工单占用记录表");
- migrationBuilder.CreateTable(
- name: "mes_morder",
- columns: table => new
- {
- Id = table.Column<long>(type: "bigint", nullable: false),
- parent_id = table.Column<long>(type: "bigint", nullable: true, comment: "上级工单id"),
- relation_moid = table.Column<long>(type: "bigint", nullable: true, comment: "关联工单id"),
- relation_mono = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "关联编号"),
- morder_no = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false, comment: "生产工单编号"),
- morder_type = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "生产工单类型(类型:计划工单、销售工单、委外工单、预测工单)"),
- morder_icitem_type = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "工单所属物料类型"),
- work_order_type = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "工单类型(类型:发货工单、试产工单、备库工单、常规工单、返工工单)"),
- morder_date = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "生产工单日期"),
- morder_state = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "生产工单状态(订单状态:初始,下达,暂停、完成)"),
- moentry_prd = table.Column<long>(type: "bigint", nullable: true, comment: "生产组织id"),
- moentry_prdname = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "生产组织名称"),
- moentry_wrkc = table.Column<long>(type: "bigint", nullable: true, comment: "工作中心id"),
- moentry_wrkcname = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "工作中心名称"),
- planner_num = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "计划员工号"),
- planner_name = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "计划员名称"),
- moentry_stime = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "生产工单开始日期"),
- moentry_etime = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "生产工单结束日期"),
- moentry_sys_stime = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "系统建议开工时间"),
- moentry_sys_etime = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "系统建议完工时间"),
- reality_start_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "实际开始时间"),
- reality_end_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "实际结束时间"),
- planner_start_date = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "计划员设定开始时间"),
- planner_end_date = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "计划员设定结束时间"),
- mat_start_date = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "基于物料开始时间"),
- mat_end_date = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "基于物料结束时间"),
- product_code = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "产品代码"),
- product_name = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: true, comment: "产品名称"),
- fms_number = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "fms旧料号"),
- fmodel = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: true, comment: "规格型号"),
- bom_number = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "bom编码"),
- unit = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "单位"),
- morder_progress = table.Column<string>(type: "nvarchar(1000)", maxLength: 1000, nullable: true, comment: "工单进度"),
- morder_need_time = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "工单所需工时"),
- morder_production_number = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "工单生产数量(计划数量)"),
- need_number = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "需求数量"),
- remaining_number = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "剩余可用数量"),
- work_number = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "报工数量"),
- inspection_number = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "报检数量"),
- qualified_number = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "合格数量"),
- inventory_number = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "入库数量"),
- notice_qty = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "已开入库通知单数量"),
- moentry_startup_status = table.Column<int>(type: "int", nullable: true, comment: "启动状态"),
- start_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "开始时间"),
- pause_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "最近暂停时间"),
- restart_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "最近重启时间"),
- project_name = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "项目名称"),
- overdue_Remark = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "逾期原因备注"),
- picking_qty = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "已领料数量"),
- morder_fstate = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "前状态--计划、下达、完成、关闭"),
- morder_batchno = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true, comment: "工单批号--(批号管理的物料出入库要使用)"),
- convey_date = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "下达日期"),
- urgent = table.Column<int>(type: "int", nullable: false, comment: "加急级别"),
- create_by = table.Column<long>(type: "bigint", nullable: true, comment: "创建人id"),
- create_by_name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "创建人名称"),
- create_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "创建时间"),
- update_by = table.Column<long>(type: "bigint", nullable: true, comment: "修改人"),
- update_by_name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "修改人名称"),
- update_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "修改时间"),
- tenant_id = table.Column<long>(type: "bigint", nullable: false, comment: "企业ID"),
- factory_id = table.Column<long>(type: "bigint", nullable: true, comment: "工厂ID"),
- org_id = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
- IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false, comment: "删除标识")
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_mes_morder", x => x.Id);
- },
- comment: "工单主表");
- migrationBuilder.CreateTable(
- name: "mes_oorder",
- columns: table => new
- {
- Id = table.Column<long>(type: "bigint", nullable: false),
- oorder_no = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "生产工单编号"),
- oorder_type = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "生产工单类型"),
- oorder_date = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "委外订单日期"),
- oorder_state = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "订单状态"),
- ooentry_prd = table.Column<long>(type: "bigint", nullable: true, comment: "生产组织"),
- ooentry_prdname = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "生产组织名称"),
- ooentry_wrkc = table.Column<long>(type: "bigint", nullable: true, comment: "工作中心id"),
- ooentry_wrkcname = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "工作中心名称"),
- planner_num = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "计划员工号"),
- planner_name = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "计划员名称"),
- ooentry_stime = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "计划开工日期"),
- ooentry_etime = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "计划完工日期"),
- product_code = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "产品代码"),
- ffms_number = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "fms旧料号"),
- product_name = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: true, comment: "产品名称"),
- specification_model = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: true, comment: "规格型号"),
- bom_number = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "bom编码"),
- unit = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "单位"),
- morder_progress = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: true, comment: "工单进度"),
- morder_production_number = table.Column<decimal>(type: "decimal(20,10)", precision: 20, scale: 10, nullable: true, comment: "工单生产数量(计划数量)"),
- need_number = table.Column<decimal>(type: "decimal(20,10)", precision: 20, scale: 10, nullable: true, comment: "需求数量"),
- remaining_number = table.Column<decimal>(type: "decimal(20,10)", precision: 20, scale: 10, nullable: true, comment: "剩余可用数量"),
- work_number = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "报工数量"),
- inspection_number = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "报检数量"),
- qualified_number = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "合格数量"),
- inventory_number = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "入库数量"),
- notice_qty = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "已开通知单数量"),
- moentry_on = table.Column<int>(type: "int", nullable: true, comment: "启动状态"),
- start_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "开始时间"),
- pause_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "最近暂停时间"),
- restart_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "最近重启时间"),
- project_name = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "项目名称"),
- sent_status = table.Column<int>(type: "int", nullable: true, comment: "发料状态 1-待发料 2-已发料"),
- production_unit = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true, comment: "加工单位"),
- production_unit_code = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true, comment: "加工单位编码"),
- need_icitem_status = table.Column<int>(type: "int", nullable: true, comment: "所需物料是否充足 1-充足 0-缺料"),
- sentry_id = table.Column<long>(type: "bigint", nullable: true, comment: "订单行id"),
- create_by = table.Column<long>(type: "bigint", nullable: true, comment: "创建人id"),
- create_by_name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "创建人名称"),
- create_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "创建时间"),
- update_by = table.Column<long>(type: "bigint", nullable: true, comment: "修改人"),
- update_by_name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "修改人名称"),
- update_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "修改时间"),
- tenant_id = table.Column<long>(type: "bigint", nullable: false, comment: "企业ID"),
- factory_id = table.Column<long>(type: "bigint", nullable: true, comment: "工厂ID"),
- org_id = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
- IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false, comment: "删除标识")
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_mes_oorder", x => x.Id);
- },
- comment: "委外订单表");
- migrationBuilder.CreateTable(
- name: "mes_process",
- columns: table => new
- {
- Id = table.Column<long>(type: "bigint", nullable: false),
- proc_name = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: false, comment: "工序名称"),
- short_desc = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: true, comment: "简述"),
- long_desc = table.Column<string>(type: "nvarchar(2000)", maxLength: 2000, nullable: true, comment: "详细描述"),
- subids = table.Column<string>(type: "nvarchar(2000)", maxLength: 2000, nullable: true, comment: "组合工序id"),
- create_by = table.Column<long>(type: "bigint", nullable: true, comment: "创建人id"),
- create_by_name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "创建人名称"),
- create_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "创建时间"),
- update_by = table.Column<long>(type: "bigint", nullable: true, comment: "修改人"),
- update_by_name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "修改人名称"),
- update_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "修改时间"),
- tenant_id = table.Column<long>(type: "bigint", nullable: false, comment: "企业ID"),
- factory_id = table.Column<long>(type: "bigint", nullable: true, comment: "工厂ID"),
- org_id = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
- IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false, comment: "删除标识")
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_mes_process", x => x.Id);
- },
- comment: "工序表");
- migrationBuilder.CreateTable(
- name: "mes_stockoccupy",
- columns: table => new
- {
- Id = table.Column<long>(type: "bigint", nullable: false),
- soccupy_type = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false, comment: "类型"),
- soentry_id = table.Column<long>(type: "bigint", nullable: true, comment: "订单行id"),
- fentry_id = table.Column<long>(type: "bigint", nullable: true, comment: "订单行号"),
- fbill_no = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "订单编号"),
- fitem_number = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "物料编码"),
- fitem_name = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true, comment: "物料名称"),
- fmodel = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true, comment: "规格型号"),
- warehouse_id = table.Column<long>(type: "bigint", nullable: false, comment: "仓库id"),
- warehouse_name = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "仓库名称"),
- warehouse_type = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "仓库类型"),
- occupyqty = table.Column<decimal>(type: "decimal(20,2)", precision: 20, scale: 2, nullable: true, comment: "占用量"),
- soccupy_stime = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "开始时间"),
- soccupy_etime = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "结束时间"),
- soccupy_state = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "占用状态"),
- soccupy_cby = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "变更人"),
- soccupy_ctime = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "变更时间"),
- soccupy_creason = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "变更原因"),
- create_by = table.Column<long>(type: "bigint", nullable: true, comment: "创建人id"),
- create_by_name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "创建人名称"),
- create_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "创建时间"),
- update_by = table.Column<long>(type: "bigint", nullable: true, comment: "修改人"),
- update_by_name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "修改人名称"),
- update_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "修改时间"),
- tenant_id = table.Column<long>(type: "bigint", nullable: false, comment: "企业ID"),
- factory_id = table.Column<long>(type: "bigint", nullable: true, comment: "工厂ID"),
- org_id = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
- IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false, comment: "删除标识")
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_mes_stockoccupy", x => x.Id);
- },
- comment: "成品库存占用表");
- migrationBuilder.CreateTable(
- name: "mes_tech_process",
- columns: table => new
- {
- Id = table.Column<long>(type: "bigint", nullable: false),
- tech_id = table.Column<long>(type: "bigint", nullable: false, comment: "工艺主键"),
- proc_id = table.Column<long>(type: "bigint", nullable: false, comment: "工序主键"),
- level = table.Column<int>(type: "int", nullable: false, comment: "组合层级"),
- is_schedule = table.Column<int>(type: "int", nullable: false, comment: "是否需要排产:1-是;0-否"),
- readytime = table.Column<decimal>(type: "decimal(20,8)", precision: 20, scale: 8, nullable: true, comment: "前置准备时间"),
- wctype = table.Column<int>(type: "int", nullable: true, comment: "工作中心类型"),
- lq = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "前置最小数量"),
- lqt = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "前置等待时间"),
- upp = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "子工序加工数量"),
- upe = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "一次可加工数量"),
- wsinuse = table.Column<int>(type: "int", nullable: true, comment: "实际运行工位数"),
- uph = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "UPH"),
- ct = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "节拍时间"),
- effect_ratio = table.Column<decimal>(type: "decimal(10,4)", precision: 10, scale: 4, nullable: true, comment: "效率系数"),
- mototrack = table.Column<int>(type: "int", nullable: true, comment: "是否需要跟踪工序"),
- nextprocid = table.Column<long>(type: "bigint", nullable: true, comment: "下一工序id"),
- parentprocid = table.Column<long>(type: "bigint", nullable: true, comment: "父级工序id"),
- needqc = table.Column<int>(type: "int", nullable: true, comment: "是否需要质检"),
- maxworkshop = table.Column<int>(type: "int", nullable: true, comment: "最大并行工位数"),
- create_by = table.Column<long>(type: "bigint", nullable: true, comment: "创建人id"),
- create_by_name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "创建人名称"),
- create_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "创建时间"),
- update_by = table.Column<long>(type: "bigint", nullable: true, comment: "修改人"),
- update_by_name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "修改人名称"),
- update_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "修改时间"),
- tenant_id = table.Column<long>(type: "bigint", nullable: false, comment: "企业ID"),
- factory_id = table.Column<long>(type: "bigint", nullable: true, comment: "工厂ID"),
- org_id = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
- IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false, comment: "删除标识")
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_mes_tech_process", x => x.Id);
- },
- comment: "工艺关联工序表");
- migrationBuilder.CreateTable(
- name: "mes_technique",
- columns: table => new
- {
- Id = table.Column<long>(type: "bigint", nullable: false),
- tech_name = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: false, comment: "工艺路径名称"),
- level = table.Column<int>(type: "int", nullable: true, comment: "效率计算层级"),
- bom = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true, comment: "产品"),
- bomver = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true, comment: "产品版本"),
- desc = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true, comment: "描述"),
- create_by = table.Column<long>(type: "bigint", nullable: true, comment: "创建人id"),
- create_by_name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "创建人名称"),
- create_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "创建时间"),
- update_by = table.Column<long>(type: "bigint", nullable: true, comment: "修改人"),
- update_by_name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "修改人名称"),
- update_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "修改时间"),
- tenant_id = table.Column<long>(type: "bigint", nullable: false, comment: "企业ID"),
- factory_id = table.Column<long>(type: "bigint", nullable: true, comment: "工厂ID"),
- org_id = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
- IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false, comment: "删除标识")
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_mes_technique", x => x.Id);
- },
- comment: "工艺路径表");
- migrationBuilder.CreateTable(
- name: "mes_workshop",
- columns: table => new
- {
- Id = table.Column<long>(type: "bigint", nullable: false),
- name = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true, comment: "工位名称"),
- subids = table.Column<string>(type: "nvarchar(2000)", maxLength: 2000, nullable: true, comment: "组合工位ids"),
- geoinfo = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true, comment: "坐标"),
- building = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true, comment: "楼栋"),
- floor = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true, comment: "楼层"),
- zone = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true, comment: "区域"),
- work_calendar_id = table.Column<long>(type: "bigint", nullable: true, comment: "工作日历id"),
- create_by = table.Column<long>(type: "bigint", nullable: true, comment: "创建人id"),
- create_by_name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "创建人名称"),
- create_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "创建时间"),
- update_by = table.Column<long>(type: "bigint", nullable: true, comment: "修改人"),
- update_by_name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "修改人名称"),
- update_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "修改时间"),
- tenant_id = table.Column<long>(type: "bigint", nullable: false, comment: "企业ID"),
- factory_id = table.Column<long>(type: "bigint", nullable: true, comment: "工厂ID"),
- org_id = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
- IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false, comment: "删除标识")
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_mes_workshop", x => x.Id);
- },
- comment: "工位表(工作中心)");
- migrationBuilder.CreateTable(
- name: "srm_po_list",
- columns: table => new
- {
- Id = table.Column<long>(type: "bigint", nullable: false),
- po_id = table.Column<long>(type: "bigint", nullable: false, comment: "po单id"),
- po_billno = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "po单号"),
- polist_row = table.Column<int>(type: "int", nullable: true, comment: "行号"),
- pr_id = table.Column<long>(type: "bigint", nullable: false, comment: "pr申请单id"),
- pr_billno = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "pr申请单号"),
- po_mono = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "关联工单号"),
- pr_purchase_id = table.Column<long>(type: "bigint", nullable: false, comment: "供应商id"),
- pr_purchase_name = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "供应商名称"),
- stock_id = table.Column<long>(type: "bigint", nullable: false, comment: "收货仓库id"),
- stock_name = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "收货仓库名称"),
- icitem_id = table.Column<long>(type: "bigint", nullable: false, comment: "物料id"),
- ItemNum = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true, comment: "物料编码"),
- icitem_name = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true, comment: "物料名称"),
- number = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "物料编码"),
- model = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true, comment: "规格型号"),
- deliveryconfirmstate = table.Column<int>(type: "int", nullable: true, comment: "交期确认状态"),
- logisticsstate = table.Column<int>(type: "int", nullable: true, comment: "物流状态"),
- qty = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "订单数量"),
- netprice = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "净价"),
- rate = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "税率"),
- price = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "含税单价"),
- total_price = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "总价"),
- plan_qty = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "计划数量"),
- unit = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "单位"),
- state = table.Column<int>(type: "int", nullable: true, comment: "数据状态标识"),
- rarrdate = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "需求到货日期"),
- rstate = table.Column<int>(type: "int", nullable: true, comment: "评审状态"),
- rnumber = table.Column<int>(type: "int", nullable: false, comment: "评审次数"),
- shippedqty = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "已发货数量"),
- rqty = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "已收货数量"),
- esqty = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "已入库数量"),
- procurement_rarr_date = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "采购到货日期"),
- rparrive_date = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "再计划到货日期"),
- purchase_date = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "供应商交期"),
- pur_affirmdate = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "采购确认到货日期"),
- currencytype = table.Column<long>(type: "bigint", nullable: false, comment: "币别"),
- create_by = table.Column<long>(type: "bigint", nullable: true, comment: "创建人id"),
- create_by_name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "创建人名称"),
- create_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "创建时间"),
- update_by = table.Column<long>(type: "bigint", nullable: true, comment: "修改人"),
- update_by_name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "修改人名称"),
- update_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "修改时间"),
- tenant_id = table.Column<long>(type: "bigint", nullable: false, comment: "企业ID"),
- factory_id = table.Column<long>(type: "bigint", nullable: true, comment: "工厂ID"),
- org_id = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
- IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false, comment: "删除标识")
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_srm_po_list", x => x.Id);
- },
- comment: "采购订单明细详情");
- migrationBuilder.CreateTable(
- name: "srm_po_main",
- columns: table => new
- {
- Id = table.Column<long>(type: "bigint", nullable: false),
- po_billno = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "PO单号"),
- po_purchaser = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "采购员"),
- po_purchaser_no = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "采购员工号"),
- po_ssend_date = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "下单日期"),
- po_total = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "订单总价"),
- po_delivery = table.Column<long>(type: "bigint", nullable: false, comment: "交货方式"),
- po_tax_rate = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "税率"),
- po_express = table.Column<int>(type: "int", nullable: true, comment: "是否加急"),
- state = table.Column<int>(type: "int", nullable: true, comment: "数据状态"),
- po_note = table.Column<string>(type: "nvarchar(1000)", maxLength: 1000, nullable: true, comment: "备注"),
- rstate = table.Column<int>(type: "int", nullable: true, comment: "评审状态"),
- rnumber = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "评审次数"),
- review_rtime = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "评审通过时间"),
- po_order_type = table.Column<int>(type: "int", nullable: true, comment: "单据类型"),
- currency = table.Column<long>(type: "bigint", nullable: false, comment: "币别"),
- bill_type = table.Column<int>(type: "int", nullable: true, comment: "金蝶单据类型值"),
- purchasing_orgid = table.Column<long>(type: "bigint", nullable: true, comment: "采购组织id"),
- purchasing_orgname = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "采购组织名称"),
- telephone = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "采购联系人电话"),
- supplier_id = table.Column<long>(type: "bigint", nullable: false, comment: "供应商id"),
- supplier_name = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "供应商名称"),
- supplier_no = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "供应商编号"),
- contact = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "供应商联系人"),
- suppliertelephone = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "供应商联系人电话"),
- deliveryaddress = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true, comment: "收货地址"),
- supplierdddress = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true, comment: "供应地址"),
- confirmstate = table.Column<int>(type: "int", nullable: true, comment: "确认状态"),
- logisticsstate = table.Column<int>(type: "int", nullable: true, comment: "物流状态"),
- financialstate = table.Column<int>(type: "int", nullable: true, comment: "财务状态"),
- create_by = table.Column<long>(type: "bigint", nullable: true, comment: "创建人id"),
- create_by_name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "创建人名称"),
- create_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "创建时间"),
- update_by = table.Column<long>(type: "bigint", nullable: true, comment: "修改人"),
- update_by_name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "修改人名称"),
- update_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "修改时间"),
- tenant_id = table.Column<long>(type: "bigint", nullable: false, comment: "企业ID"),
- factory_id = table.Column<long>(type: "bigint", nullable: true, comment: "工厂ID"),
- org_id = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
- IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false, comment: "删除标识")
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_srm_po_main", x => x.Id);
- },
- comment: "采购订单");
- migrationBuilder.CreateTable(
- name: "srm_po_occupy",
- columns: table => new
- {
- Id = table.Column<long>(type: "bigint", nullable: false),
- polist_id = table.Column<long>(type: "bigint", nullable: false, comment: "采购订单id"),
- polist_row = table.Column<int>(type: "int", nullable: true, comment: "采购订单行号"),
- eid = table.Column<long>(type: "bigint", nullable: true, comment: "客户订单行id"),
- bill_no = table.Column<long>(type: "bigint", nullable: true, comment: "客户订单id"),
- type = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "类型"),
- entry_id = table.Column<int>(type: "int", nullable: false, comment: "行号"),
- qty = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "占用量"),
- stime = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "开始时间"),
- etime = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "结束时间"),
- state = table.Column<int>(type: "int", nullable: true, comment: "占用状态"),
- cby = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "变更人"),
- creason = table.Column<string>(type: "nvarchar(1000)", maxLength: 1000, nullable: true, comment: "变更原因"),
- ctime = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "变更时间"),
- create_by = table.Column<long>(type: "bigint", nullable: true, comment: "创建人id"),
- create_by_name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "创建人名称"),
- create_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "创建时间"),
- update_by = table.Column<long>(type: "bigint", nullable: true, comment: "修改人"),
- update_by_name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "修改人名称"),
- update_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "修改时间"),
- tenant_id = table.Column<long>(type: "bigint", nullable: false, comment: "企业ID"),
- factory_id = table.Column<long>(type: "bigint", nullable: true, comment: "工厂ID"),
- org_id = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
- IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false, comment: "删除标识")
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_srm_po_occupy", x => x.Id);
- },
- comment: "采购订单占用详情");
- migrationBuilder.CreateTable(
- name: "srm_pr_main",
- columns: table => new
- {
- Id = table.Column<long>(type: "bigint", nullable: false),
- pr_billno = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "pr单号"),
- pr_mono = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "关联工单号"),
- entity_id = table.Column<int>(type: "int", nullable: true, comment: "工单行号"),
- pr_purchaseid = table.Column<long>(type: "bigint", nullable: false, comment: "供应商id"),
- pr_purchasenumber = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "供应商编码"),
- pr_purchasename = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "供应商名称"),
- pr_purchaser = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "采购员"),
- pr_purchaser_num = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "采购员工号"),
- pr_rqty = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "需求数量"),
- pr_aqty = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "申请数量"),
- pr_sqty = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "建议数量"),
- icitem_id = table.Column<long>(type: "bigint", nullable: false, comment: "物料id"),
- icitem_name = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "物料名称"),
- pr_order_type = table.Column<int>(type: "int", nullable: true, comment: "单据类型"),
- pr_ssend_date = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "系统建议下单日期"),
- pr_sarrive_date = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "系统建议到达日期"),
- pr_bsarrive_date = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "采购员建议到货日期"),
- pr_oarrive_date = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "订单到货日期"),
- pr_psend_date = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "计划下单日期"),
- pr_parrive_date = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "计划到达日期"),
- pr_rarrive_date = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "需求到货日期"),
- pr_rparrive_date = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "再计划到货日期"),
- pr_pur_affirm_date = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "采购确认到货日期"),
- pr_sysprice = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "系统价格(含税)"),
- pr_orderprice = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "订单价格(含税)"),
- pr_price = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "采购净价(不含税)"),
- pr_rate = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "税率"),
- pr_unit = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true, comment: "单位"),
- state = table.Column<int>(type: "int", nullable: true, comment: "状态"),
- old_apply_aqty = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "已申请数量"),
- pr_type = table.Column<int>(type: "int", nullable: true, comment: "申请类型"),
- currencytype = table.Column<long>(type: "bigint", nullable: false, comment: "币种"),
- secInv_ratio = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "安全库存触发采购比例"),
- remark = table.Column<string>(type: "nvarchar(1000)", maxLength: 1000, nullable: true, comment: "备注"),
- pr_rreason = table.Column<string>(type: "nvarchar(1000)", maxLength: 1000, nullable: true, comment: "拒绝原因"),
- sentry_id = table.Column<long>(type: "bigint", nullable: true, comment: "订单行id"),
- create_by = table.Column<long>(type: "bigint", nullable: true, comment: "创建人id"),
- create_by_name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "创建人名称"),
- create_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "创建时间"),
- update_by = table.Column<long>(type: "bigint", nullable: true, comment: "修改人"),
- update_by_name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "修改人名称"),
- update_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "修改时间"),
- tenant_id = table.Column<long>(type: "bigint", nullable: false, comment: "企业ID"),
- factory_id = table.Column<long>(type: "bigint", nullable: true, comment: "工厂ID"),
- org_id = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
- IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false, comment: "删除标识")
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_srm_pr_main", x => x.Id);
- },
- comment: "采购申请单");
- migrationBuilder.CreateTable(
- name: "srm_purchase",
- columns: table => new
- {
- Id = table.Column<long>(type: "bigint", nullable: false),
- icitem_id = table.Column<long>(type: "bigint", nullable: false, comment: "物料id"),
- icitem_name = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "物料名称"),
- sourcelist_number = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "货源清单编号"),
- supplier_id = table.Column<long>(type: "bigint", nullable: true, comment: "供应商id"),
- supplier_number = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "供应商编码"),
- supplier_name = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "供应商名称"),
- purchgroup = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "采购组"),
- purcher = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "采购员"),
- purchase_unit = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "采购计量单位"),
- netpurchase_price = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "采购净价(不含税)"),
- taxrate = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "税率"),
- currency_type = table.Column<long>(type: "bigint", nullable: true, comment: "币种"),
- order_rector_name = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "采购负责人"),
- order_rector_num = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "采购负责人_工号"),
- factory_code = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "工厂编码"),
- order_dept = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "采购部门"),
- order_price = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "采购单价"),
- sale_price = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "销售单价"),
- qty_min = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "最小订货量"),
- batch_append_qty = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "批量增量"),
- create_by = table.Column<long>(type: "bigint", nullable: true, comment: "创建人id"),
- create_by_name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "创建人名称"),
- create_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "创建时间"),
- update_by = table.Column<long>(type: "bigint", nullable: true, comment: "修改人"),
- update_by_name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "修改人名称"),
- update_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "修改时间"),
- tenant_id = table.Column<long>(type: "bigint", nullable: false, comment: "企业ID"),
- factory_id = table.Column<long>(type: "bigint", nullable: true, comment: "工厂ID"),
- org_id = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
- IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false, comment: "删除标识")
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_srm_purchase", x => x.Id);
- },
- comment: "物料采购报价单");
- migrationBuilder.CreateTable(
- name: "srm_supplier",
- columns: table => new
- {
- Id = table.Column<long>(type: "bigint", nullable: false),
- supplier_no = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "供应商编号"),
- supplier_name = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "供应商名称"),
- supplier_full_name = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "供应商全称"),
- supplier_help_code = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "供应商助记码"),
- supplier_short_name = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "供应商简称"),
- supplier_address = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "供应商地址"),
- state = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "状态"),
- region = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "区域"),
- trade = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "行业"),
- contact = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "联系人"),
- telephone = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "联系电话"),
- mobile = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "移动电话"),
- fax = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "传真号码"),
- post_code = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "邮政编码"),
- email = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "邮件地址"),
- taxid = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "税务登记号"),
- bank = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "开户银行"),
- bank_account = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "银行账号"),
- value_add_rate = table.Column<decimal>(type: "decimal(23,10)", precision: 23, scale: 10, nullable: true, comment: "增值税率"),
- type = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "供应商分类"),
- po_mode = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "采购模式"),
- vmi_stock = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "VMI仓"),
- stockid_assignee = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "受托代销虚仓"),
- branch_info = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "分支机构信息"),
- regmark = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "注册商标"),
- licence = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "营业执照"),
- regster_date = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "注册日期"),
- approve_date = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "批准日期"),
- begin_day = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "生效日期"),
- end_day = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "失效日期"),
- supply_grade = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "供应商等级"),
- supply_type = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "供应类别"),
- company_type = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "公司类别"),
- auto_create_mr = table.Column<bool>(type: "bit", nullable: true, comment: "交货自动生成收货单据"),
- auto_validate_order = table.Column<bool>(type: "bit", nullable: true, comment: "自动确认订单"),
- isuse_supplier_portal = table.Column<bool>(type: "bit", nullable: true, comment: "启用供应商门户"),
- department = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "分管部门"),
- employee_name = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "专营业务员"),
- employee_no = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "专营业务员_工号"),
- currency = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "结算币种"),
- settlement = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "结算方式"),
- name_en = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "英文名称"),
- addr_en = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "英文地址"),
- country = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "国别地区"),
- checker = table.Column<string>(type: "nvarchar(80)", maxLength: 80, nullable: true, comment: "审核人"),
- op_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "操作时间"),
- create_by = table.Column<long>(type: "bigint", nullable: true, comment: "创建人id"),
- create_by_name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "创建人名称"),
- create_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "创建时间"),
- update_by = table.Column<long>(type: "bigint", nullable: true, comment: "修改人"),
- update_by_name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "修改人名称"),
- update_time = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "修改时间"),
- tenant_id = table.Column<long>(type: "bigint", nullable: false, comment: "企业ID"),
- factory_id = table.Column<long>(type: "bigint", nullable: true, comment: "工厂ID"),
- org_id = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
- IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false, comment: "删除标识")
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_srm_supplier", x => x.Id);
- },
- comment: "供应商");
- migrationBuilder.CreateIndex(
- name: "IX_crm_customer_customer_no_tenant_id_factory_id",
- table: "crm_customer",
- columns: new[] { "customer_no", "tenant_id", "factory_id" });
- migrationBuilder.CreateIndex(
- name: "IX_crm_seorder_bill_no_tenant_id_factory_id",
- table: "crm_seorder",
- columns: new[] { "bill_no", "tenant_id", "factory_id" });
- migrationBuilder.CreateIndex(
- name: "IX_crm_seorderentry_seorder_id_bill_no_item_number_tenant_id_factory_id",
- table: "crm_seorderentry",
- columns: new[] { "seorder_id", "bill_no", "item_number", "tenant_id", "factory_id" });
- migrationBuilder.CreateIndex(
- name: "IX_ic_bom_bom_number_item_number_version_tenant_id_factory_id",
- table: "ic_bom",
- columns: new[] { "bom_number", "item_number", "version", "tenant_id", "factory_id" });
- migrationBuilder.CreateIndex(
- name: "IX_ic_bom_child_bom_id_bom_number_item_number_version_tenant_id_factory_id",
- table: "ic_bom_child",
- columns: new[] { "bom_id", "bom_number", "item_number", "version", "tenant_id", "factory_id" });
- migrationBuilder.CreateIndex(
- name: "IX_ic_item_number_name_tenant_id_factory_id",
- table: "ic_item",
- columns: new[] { "number", "name", "tenant_id", "factory_id" });
- migrationBuilder.CreateIndex(
- name: "IX_ic_item_inventory_stock_id_stock_place_id_tenant_id_factory_id",
- table: "ic_item_inventory",
- columns: new[] { "stock_id", "stock_place_id", "tenant_id", "factory_id" });
- migrationBuilder.CreateIndex(
- name: "IX_ic_item_stock_icitem_id_icitem_name_tenant_id_factory_id",
- table: "ic_item_stock",
- columns: new[] { "icitem_id", "icitem_name", "tenant_id", "factory_id" });
- migrationBuilder.CreateIndex(
- name: "IX_ic_substitute_substitute_code_tenant_id_factory_id",
- table: "ic_substitute",
- columns: new[] { "substitute_code", "tenant_id", "factory_id" });
- migrationBuilder.CreateIndex(
- name: "IX_ic_substitute_group_substitute_code_tenant_id_factory_id",
- table: "ic_substitute_group",
- columns: new[] { "substitute_code", "tenant_id", "factory_id" });
- migrationBuilder.CreateIndex(
- name: "IX_ic_substitute_group_detail_substitute_code_icitem_number_tenant_id_factory_id",
- table: "ic_substitute_group_detail",
- columns: new[] { "substitute_code", "icitem_number", "tenant_id", "factory_id" });
- migrationBuilder.CreateIndex(
- name: "IX_mes_moentry_moentry_moid_moentry_mono_tenant_id_factory_id",
- table: "mes_moentry",
- columns: new[] { "moentry_moid", "moentry_mono", "tenant_id", "factory_id" });
- migrationBuilder.CreateIndex(
- name: "IX_mes_mooccupy_moo_id_billid_tenant_id_factory_id",
- table: "mes_mooccupy",
- columns: new[] { "moo_id_billid", "tenant_id", "factory_id" });
- migrationBuilder.CreateIndex(
- name: "IX_mes_morder_morder_no_tenant_id_factory_id",
- table: "mes_morder",
- columns: new[] { "morder_no", "tenant_id", "factory_id" });
- migrationBuilder.CreateIndex(
- name: "IX_mes_stockoccupy_fbill_no_fitem_number_tenant_id_factory_id",
- table: "mes_stockoccupy",
- columns: new[] { "fbill_no", "fitem_number", "tenant_id", "factory_id" });
- migrationBuilder.CreateIndex(
- name: "IX_srm_po_list_po_billno_number_tenant_id_factory_id",
- table: "srm_po_list",
- columns: new[] { "po_billno", "number", "tenant_id", "factory_id" });
- migrationBuilder.CreateIndex(
- name: "IX_srm_po_main_po_billno_tenant_id_factory_id",
- table: "srm_po_main",
- columns: new[] { "po_billno", "tenant_id", "factory_id" });
- migrationBuilder.CreateIndex(
- name: "IX_srm_po_occupy_polist_id_tenant_id_factory_id",
- table: "srm_po_occupy",
- columns: new[] { "polist_id", "tenant_id", "factory_id" });
- migrationBuilder.CreateIndex(
- name: "IX_srm_pr_main_pr_billno_pr_purchasenumber_tenant_id_factory_id",
- table: "srm_pr_main",
- columns: new[] { "pr_billno", "pr_purchasenumber", "tenant_id", "factory_id" });
- migrationBuilder.CreateIndex(
- name: "IX_srm_purchase_icitem_id_supplier_number_tenant_id_factory_id",
- table: "srm_purchase",
- columns: new[] { "icitem_id", "supplier_number", "tenant_id", "factory_id" });
- migrationBuilder.CreateIndex(
- name: "IX_srm_supplier_supplier_no_tenant_id_factory_id",
- table: "srm_supplier",
- columns: new[] { "supplier_no", "tenant_id", "factory_id" });
- }
- protected override void Down(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.DropTable(
- name: "b_bom_pretreatment");
- migrationBuilder.DropTable(
- name: "crm_customer");
- migrationBuilder.DropTable(
- name: "crm_seorder");
- migrationBuilder.DropTable(
- name: "crm_seorderentry");
- migrationBuilder.DropTable(
- name: "ic_bom");
- migrationBuilder.DropTable(
- name: "ic_bom_child");
- migrationBuilder.DropTable(
- name: "ic_item");
- migrationBuilder.DropTable(
- name: "ic_item_inventory");
- migrationBuilder.DropTable(
- name: "ic_item_stock");
- migrationBuilder.DropTable(
- name: "ic_substitute");
- migrationBuilder.DropTable(
- name: "ic_substitute_group");
- migrationBuilder.DropTable(
- name: "ic_substitute_group_detail");
- migrationBuilder.DropTable(
- name: "mes_moentry");
- migrationBuilder.DropTable(
- name: "mes_mooccupy");
- migrationBuilder.DropTable(
- name: "mes_morder");
- migrationBuilder.DropTable(
- name: "mes_oorder");
- migrationBuilder.DropTable(
- name: "mes_process");
- migrationBuilder.DropTable(
- name: "mes_stockoccupy");
- migrationBuilder.DropTable(
- name: "mes_tech_process");
- migrationBuilder.DropTable(
- name: "mes_technique");
- migrationBuilder.DropTable(
- name: "mes_workshop");
- migrationBuilder.DropTable(
- name: "srm_po_list");
- migrationBuilder.DropTable(
- name: "srm_po_main");
- migrationBuilder.DropTable(
- name: "srm_po_occupy");
- migrationBuilder.DropTable(
- name: "srm_pr_main");
- migrationBuilder.DropTable(
- name: "srm_purchase");
- migrationBuilder.DropTable(
- name: "srm_supplier");
- }
- }
- }
|