20230131062801_init.cs 308 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839
  1. using System;
  2. using Microsoft.EntityFrameworkCore.Metadata;
  3. using Microsoft.EntityFrameworkCore.Migrations;
  4. #nullable disable
  5. namespace Business.Migrations
  6. {
  7. public partial class init : Migration
  8. {
  9. protected override void Up(MigrationBuilder migrationBuilder)
  10. {
  11. migrationBuilder.AlterDatabase()
  12. .Annotation("MySql:CharSet", "utf8mb4");
  13. migrationBuilder.CreateTable(
  14. name: "base_flow",
  15. columns: table => new
  16. {
  17. Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
  18. TenantId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
  19. FormId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
  20. Title = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: false)
  21. .Annotation("MySql:CharSet", "utf8mb4"),
  22. Code = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false)
  23. .Annotation("MySql:CharSet", "utf8mb4"),
  24. UseDate = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false)
  25. .Annotation("MySql:CharSet", "utf8mb4"),
  26. Level = table.Column<int>(type: "int", nullable: false),
  27. Remark = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: true)
  28. .Annotation("MySql:CharSet", "utf8mb4"),
  29. Status = table.Column<int>(type: "int", nullable: false, defaultValue: 0),
  30. IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: false),
  31. ExtraProperties = table.Column<string>(type: "longtext", nullable: true)
  32. .Annotation("MySql:CharSet", "utf8mb4"),
  33. ConcurrencyStamp = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: true)
  34. .Annotation("MySql:CharSet", "utf8mb4"),
  35. CreationTime = table.Column<DateTime>(type: "datetime", nullable: false),
  36. CreatorId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
  37. LastModificationTime = table.Column<DateTime>(type: "datetime", nullable: true),
  38. LastModifierId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci")
  39. },
  40. constraints: table =>
  41. {
  42. table.PrimaryKey("PK_base_flow", x => x.Id);
  43. })
  44. .Annotation("MySql:CharSet", "utf8mb4");
  45. migrationBuilder.CreateTable(
  46. name: "base_flow_line",
  47. columns: table => new
  48. {
  49. Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
  50. TenantId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
  51. BaseFlowId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
  52. Label = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: true)
  53. .Annotation("MySql:CharSet", "utf8mb4"),
  54. From = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false)
  55. .Annotation("MySql:CharSet", "utf8mb4"),
  56. To = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false)
  57. .Annotation("MySql:CharSet", "utf8mb4"),
  58. Remark = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: true)
  59. .Annotation("MySql:CharSet", "utf8mb4"),
  60. IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: false),
  61. ExtraProperties = table.Column<string>(type: "longtext", nullable: true)
  62. .Annotation("MySql:CharSet", "utf8mb4"),
  63. ConcurrencyStamp = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: true)
  64. .Annotation("MySql:CharSet", "utf8mb4")
  65. },
  66. constraints: table =>
  67. {
  68. table.PrimaryKey("PK_base_flow_line", x => x.Id);
  69. })
  70. .Annotation("MySql:CharSet", "utf8mb4");
  71. migrationBuilder.CreateTable(
  72. name: "base_flow_line_form",
  73. columns: table => new
  74. {
  75. Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
  76. TenantId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
  77. BaseFlowId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
  78. FlowLineId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
  79. FieldId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
  80. FieldName = table.Column<string>(type: "varchar(20)", maxLength: 20, nullable: true)
  81. .Annotation("MySql:CharSet", "utf8mb4"),
  82. FieldType = table.Column<string>(type: "varchar(20)", maxLength: 20, nullable: true)
  83. .Annotation("MySql:CharSet", "utf8mb4"),
  84. Condition = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: true)
  85. .Annotation("MySql:CharSet", "utf8mb4"),
  86. IntContent = table.Column<int>(type: "int", nullable: false),
  87. Content = table.Column<string>(type: "varchar(1000)", maxLength: 1000, nullable: true)
  88. .Annotation("MySql:CharSet", "utf8mb4"),
  89. Remark = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: true)
  90. .Annotation("MySql:CharSet", "utf8mb4"),
  91. IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: false),
  92. ExtraProperties = table.Column<string>(type: "longtext", nullable: true)
  93. .Annotation("MySql:CharSet", "utf8mb4"),
  94. ConcurrencyStamp = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: true)
  95. .Annotation("MySql:CharSet", "utf8mb4")
  96. },
  97. constraints: table =>
  98. {
  99. table.PrimaryKey("PK_base_flow_line_form", x => x.Id);
  100. })
  101. .Annotation("MySql:CharSet", "utf8mb4");
  102. migrationBuilder.CreateTable(
  103. name: "base_flow_node",
  104. columns: table => new
  105. {
  106. Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
  107. TenantId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
  108. BaseFlowId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
  109. NodeId = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: false)
  110. .Annotation("MySql:CharSet", "utf8mb4"),
  111. Name = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: false)
  112. .Annotation("MySql:CharSet", "utf8mb4"),
  113. Type = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false)
  114. .Annotation("MySql:CharSet", "utf8mb4"),
  115. Left = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false)
  116. .Annotation("MySql:CharSet", "utf8mb4"),
  117. Top = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false)
  118. .Annotation("MySql:CharSet", "utf8mb4"),
  119. Ico = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true)
  120. .Annotation("MySql:CharSet", "utf8mb4"),
  121. State = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true)
  122. .Annotation("MySql:CharSet", "utf8mb4"),
  123. Executor = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true)
  124. .Annotation("MySql:CharSet", "utf8mb4"),
  125. Users = table.Column<string>(type: "varchar(1000)", maxLength: 1000, nullable: true)
  126. .Annotation("MySql:CharSet", "utf8mb4"),
  127. Roles = table.Column<string>(type: "varchar(1000)", maxLength: 1000, nullable: true)
  128. .Annotation("MySql:CharSet", "utf8mb4"),
  129. Remark = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: true)
  130. .Annotation("MySql:CharSet", "utf8mb4"),
  131. IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: false),
  132. ExtraProperties = table.Column<string>(type: "longtext", nullable: true)
  133. .Annotation("MySql:CharSet", "utf8mb4"),
  134. ConcurrencyStamp = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: true)
  135. .Annotation("MySql:CharSet", "utf8mb4")
  136. },
  137. constraints: table =>
  138. {
  139. table.PrimaryKey("PK_base_flow_node", x => x.Id);
  140. })
  141. .Annotation("MySql:CharSet", "utf8mb4");
  142. migrationBuilder.CreateTable(
  143. name: "base_form",
  144. columns: table => new
  145. {
  146. Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
  147. TenantId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
  148. Api = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false)
  149. .Annotation("MySql:CharSet", "utf8mb4"),
  150. FormName = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false)
  151. .Annotation("MySql:CharSet", "utf8mb4"),
  152. DisplayName = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: false)
  153. .Annotation("MySql:CharSet", "utf8mb4"),
  154. Description = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false)
  155. .Annotation("MySql:CharSet", "utf8mb4"),
  156. Disabled = table.Column<bool>(type: "tinyint(1)", nullable: false),
  157. IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: false),
  158. Namespace = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true)
  159. .Annotation("MySql:CharSet", "utf8mb4"),
  160. EntityName = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true)
  161. .Annotation("MySql:CharSet", "utf8mb4"),
  162. TableName = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true)
  163. .Annotation("MySql:CharSet", "utf8mb4"),
  164. Remark = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: true)
  165. .Annotation("MySql:CharSet", "utf8mb4"),
  166. ExtraProperties = table.Column<string>(type: "longtext", nullable: true)
  167. .Annotation("MySql:CharSet", "utf8mb4"),
  168. ConcurrencyStamp = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: true)
  169. .Annotation("MySql:CharSet", "utf8mb4"),
  170. CreationTime = table.Column<DateTime>(type: "datetime", nullable: false),
  171. CreatorId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
  172. LastModificationTime = table.Column<DateTime>(type: "datetime", nullable: true),
  173. LastModifierId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci")
  174. },
  175. constraints: table =>
  176. {
  177. table.PrimaryKey("PK_base_form", x => x.Id);
  178. })
  179. .Annotation("MySql:CharSet", "utf8mb4");
  180. migrationBuilder.CreateTable(
  181. name: "base_form_datas",
  182. columns: table => new
  183. {
  184. Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
  185. TenantId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
  186. FormId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
  187. Data = table.Column<string>(type: "longtext", nullable: true)
  188. .Annotation("MySql:CharSet", "utf8mb4"),
  189. IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: false),
  190. ExtraProperties = table.Column<string>(type: "longtext", nullable: true)
  191. .Annotation("MySql:CharSet", "utf8mb4"),
  192. ConcurrencyStamp = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: true)
  193. .Annotation("MySql:CharSet", "utf8mb4"),
  194. CreationTime = table.Column<DateTime>(type: "datetime", nullable: false),
  195. CreatorId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
  196. LastModificationTime = table.Column<DateTime>(type: "datetime", nullable: true),
  197. LastModifierId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci")
  198. },
  199. constraints: table =>
  200. {
  201. table.PrimaryKey("PK_base_form_datas", x => x.Id);
  202. })
  203. .Annotation("MySql:CharSet", "utf8mb4");
  204. migrationBuilder.CreateTable(
  205. name: "base_form_fields",
  206. columns: table => new
  207. {
  208. Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
  209. TenantId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
  210. FormId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
  211. FieldType = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false)
  212. .Annotation("MySql:CharSet", "utf8mb4"),
  213. DataType = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false)
  214. .Annotation("MySql:CharSet", "utf8mb4"),
  215. FieldName = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false)
  216. .Annotation("MySql:CharSet", "utf8mb4"),
  217. Label = table.Column<string>(type: "varchar(128)", maxLength: 128, nullable: false)
  218. .Annotation("MySql:CharSet", "utf8mb4"),
  219. Placeholder = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true)
  220. .Annotation("MySql:CharSet", "utf8mb4"),
  221. DefaultValue = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: true)
  222. .Annotation("MySql:CharSet", "utf8mb4"),
  223. FieldOrder = table.Column<int>(type: "int", nullable: false),
  224. Icon = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true)
  225. .Annotation("MySql:CharSet", "utf8mb4"),
  226. Maxlength = table.Column<int>(type: "int", nullable: true),
  227. IsReadonly = table.Column<bool>(type: "tinyint(1)", nullable: false),
  228. IsRequired = table.Column<bool>(type: "tinyint(1)", nullable: false),
  229. IsIndex = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: false),
  230. IsSort = table.Column<bool>(type: "tinyint(1)", nullable: false),
  231. Disabled = table.Column<bool>(type: "tinyint(1)", nullable: false),
  232. Regx = table.Column<string>(type: "longtext", nullable: true)
  233. .Annotation("MySql:CharSet", "utf8mb4"),
  234. Span = table.Column<int>(type: "int", nullable: false, defaultValue: 24),
  235. ExtraProperties = table.Column<string>(type: "longtext", nullable: true)
  236. .Annotation("MySql:CharSet", "utf8mb4"),
  237. ConcurrencyStamp = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: true)
  238. .Annotation("MySql:CharSet", "utf8mb4")
  239. },
  240. constraints: table =>
  241. {
  242. table.PrimaryKey("PK_base_form_fields", x => x.Id);
  243. })
  244. .Annotation("MySql:CharSet", "utf8mb4");
  245. migrationBuilder.CreateTable(
  246. name: "base_form_fields_opts",
  247. columns: table => new
  248. {
  249. Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
  250. TenantId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
  251. FormId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
  252. FormFieldId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
  253. Label = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false)
  254. .Annotation("MySql:CharSet", "utf8mb4"),
  255. Value = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false)
  256. .Annotation("MySql:CharSet", "utf8mb4"),
  257. ExtraProperties = table.Column<string>(type: "longtext", nullable: true)
  258. .Annotation("MySql:CharSet", "utf8mb4"),
  259. ConcurrencyStamp = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: true)
  260. .Annotation("MySql:CharSet", "utf8mb4")
  261. },
  262. constraints: table =>
  263. {
  264. table.PrimaryKey("PK_base_form_fields_opts", x => x.Id);
  265. })
  266. .Annotation("MySql:CharSet", "utf8mb4");
  267. migrationBuilder.CreateTable(
  268. name: "base_form_workflow",
  269. columns: table => new
  270. {
  271. Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
  272. TenantId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
  273. IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: false),
  274. FormId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
  275. BaseFlowId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
  276. EntityId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
  277. Status = table.Column<int>(type: "int", nullable: false, defaultValue: 0),
  278. NodeId = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false)
  279. .Annotation("MySql:CharSet", "utf8mb4"),
  280. ExtraProperties = table.Column<string>(type: "longtext", nullable: true)
  281. .Annotation("MySql:CharSet", "utf8mb4"),
  282. ConcurrencyStamp = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: true)
  283. .Annotation("MySql:CharSet", "utf8mb4"),
  284. CreationTime = table.Column<DateTime>(type: "datetime", nullable: false),
  285. CreatorId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
  286. LastModificationTime = table.Column<DateTime>(type: "datetime", nullable: true),
  287. LastModifierId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci")
  288. },
  289. constraints: table =>
  290. {
  291. table.PrimaryKey("PK_base_form_workflow", x => x.Id);
  292. })
  293. .Annotation("MySql:CharSet", "utf8mb4");
  294. migrationBuilder.CreateTable(
  295. name: "crm_customer",
  296. columns: table => new
  297. {
  298. customer_id = table.Column<long>(type: "bigint", nullable: false, comment: "客户主键id")
  299. .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
  300. customer_no = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "客户编号")
  301. .Annotation("MySql:CharSet", "utf8mb4"),
  302. customer_name = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: true, comment: "客户名称")
  303. .Annotation("MySql:CharSet", "utf8mb4"),
  304. customer_level = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: true, comment: "客户级别")
  305. .Annotation("MySql:CharSet", "utf8mb4"),
  306. mobile = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "手机号码")
  307. .Annotation("MySql:CharSet", "utf8mb4"),
  308. telephone = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "电话号码")
  309. .Annotation("MySql:CharSet", "utf8mb4"),
  310. email = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "邮件地址")
  311. .Annotation("MySql:CharSet", "utf8mb4"),
  312. contact = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "联系人")
  313. .Annotation("MySql:CharSet", "utf8mb4"),
  314. post_code = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "邮政编码")
  315. .Annotation("MySql:CharSet", "utf8mb4"),
  316. country = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: true, comment: "国别地区")
  317. .Annotation("MySql:CharSet", "utf8mb4"),
  318. province = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: true, comment: "省份")
  319. .Annotation("MySql:CharSet", "utf8mb4"),
  320. city = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: true, comment: "城市")
  321. .Annotation("MySql:CharSet", "utf8mb4"),
  322. region = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: true, comment: "区")
  323. .Annotation("MySql:CharSet", "utf8mb4"),
  324. address = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: true, comment: "地址")
  325. .Annotation("MySql:CharSet", "utf8mb4"),
  326. sale_mode = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: true, comment: "销售模式")
  327. .Annotation("MySql:CharSet", "utf8mb4"),
  328. short_name = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: true, comment: "客户简称")
  329. .Annotation("MySql:CharSet", "utf8mb4"),
  330. short_number = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: true, comment: "客户简码")
  331. .Annotation("MySql:CharSet", "utf8mb4"),
  332. state = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "状态")
  333. .Annotation("MySql:CharSet", "utf8mb4"),
  334. value_add_rate = table.Column<decimal>(type: "decimal(18,10)", precision: 18, scale: 10, nullable: true, comment: "增值税率"),
  335. carrying_aos = table.Column<int>(type: "int", nullable: false, comment: "默认运输提前期_天"),
  336. corperate = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: true, comment: "法人代表")
  337. .Annotation("MySql:CharSet", "utf8mb4"),
  338. currency = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "结算币种")
  339. .Annotation("MySql:CharSet", "utf8mb4"),
  340. employee_name = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "专营业务员")
  341. .Annotation("MySql:CharSet", "utf8mb4"),
  342. employee_no = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "专营业务员_工号")
  343. .Annotation("MySql:CharSet", "utf8mb4"),
  344. op_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "操作时间"),
  345. cust_type_number = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: true, comment: "客户类别编码")
  346. .Annotation("MySql:CharSet", "utf8mb4"),
  347. cust_type = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: true, comment: "客户类别")
  348. .Annotation("MySql:CharSet", "utf8mb4"),
  349. cust_group_number = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: true, comment: "客户分组编号")
  350. .Annotation("MySql:CharSet", "utf8mb4"),
  351. cust_group_name = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: true, comment: "客户分组名称")
  352. .Annotation("MySql:CharSet", "utf8mb4"),
  353. create_by = table.Column<long>(type: "bigint", nullable: true, comment: "创建人id"),
  354. create_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "创建人名称")
  355. .Annotation("MySql:CharSet", "utf8mb4"),
  356. create_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "创建时间"),
  357. update_by = table.Column<long>(type: "bigint", nullable: true, comment: "修改人"),
  358. update_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "修改人名称")
  359. .Annotation("MySql:CharSet", "utf8mb4"),
  360. update_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改时间"),
  361. tenant_id = table.Column<long>(type: "bigint", nullable: false, comment: "企业ID"),
  362. factory_id = table.Column<long>(type: "bigint", nullable: true, comment: "工厂ID"),
  363. org_id = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
  364. IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: false, comment: "删除标识")
  365. },
  366. constraints: table =>
  367. {
  368. table.PrimaryKey("PK_crm_customer", x => x.customer_id);
  369. },
  370. comment: "客户表")
  371. .Annotation("MySql:CharSet", "utf8mb4");
  372. migrationBuilder.CreateTable(
  373. name: "crm_seorder",
  374. columns: table => new
  375. {
  376. seorder_id = table.Column<long>(type: "bigint", nullable: false, comment: "销售订单id")
  377. .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
  378. bill_no = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "订单编号")
  379. .Annotation("MySql:CharSet", "utf8mb4"),
  380. order_type = table.Column<int>(type: "int", nullable: true, comment: "订单类别(销售、计划)"),
  381. trade_type = table.Column<int>(type: "int", nullable: true, comment: "贸易类型"),
  382. sale_style = table.Column<int>(type: "int", nullable: true, comment: "销售订单类型"),
  383. sale_style_no = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "销售订单类型编码")
  384. .Annotation("MySql:CharSet", "utf8mb4"),
  385. custom_id = table.Column<int>(type: "int", nullable: true, comment: "客户id"),
  386. custom_name = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "客户名称")
  387. .Annotation("MySql:CharSet", "utf8mb4"),
  388. custom_no = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "客户编码")
  389. .Annotation("MySql:CharSet", "utf8mb4"),
  390. custom_level = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "客户级别")
  391. .Annotation("MySql:CharSet", "utf8mb4"),
  392. date = table.Column<DateTime>(type: "datetime", nullable: true, comment: "签订日期"),
  393. rdate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "采购下单日期"),
  394. urgent = table.Column<int>(type: "int", nullable: true, comment: "加急级别"),
  395. currency = table.Column<int>(type: "int", maxLength: 50, nullable: true, comment: "币种"),
  396. exchange_rate = table.Column<decimal>(type: "decimal(20,8)", precision: 20, scale: 8, nullable: true, comment: "汇率"),
  397. biller = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "制单人")
  398. .Annotation("MySql:CharSet", "utf8mb4"),
  399. emp_no = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "业务员工号")
  400. .Annotation("MySql:CharSet", "utf8mb4"),
  401. emp_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "业务员名称")
  402. .Annotation("MySql:CharSet", "utf8mb4"),
  403. auditor = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "审核人")
  404. .Annotation("MySql:CharSet", "utf8mb4"),
  405. audit_date = table.Column<DateTime>(type: "datetime", nullable: true, comment: "审核日期"),
  406. status = table.Column<int>(type: "int", nullable: true, comment: "订单状态"),
  407. closed = table.Column<bool>(type: "tinyint(1)", nullable: false, comment: "是否关闭1关闭0未关闭"),
  408. op_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "操作时间"),
  409. bill_from = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: true, comment: "订单来源")
  410. .Annotation("MySql:CharSet", "utf8mb4"),
  411. project_name = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: true, comment: "项目名称")
  412. .Annotation("MySql:CharSet", "utf8mb4"),
  413. project_code = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: true, comment: "项目编号")
  414. .Annotation("MySql:CharSet", "utf8mb4"),
  415. out_stock_type = table.Column<int>(type: "int", nullable: true, comment: "销售出库类型"),
  416. sale_dept_id = table.Column<long>(type: "bigint", nullable: true, comment: "销售部门id"),
  417. sale_dept_name = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "销售部门名称")
  418. .Annotation("MySql:CharSet", "utf8mb4"),
  419. sale_dept_code = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "销售部门编号")
  420. .Annotation("MySql:CharSet", "utf8mb4"),
  421. create_dept = table.Column<long>(type: "bigint", nullable: true, comment: "创建部门id"),
  422. create_by = table.Column<long>(type: "bigint", nullable: true, comment: "创建人id"),
  423. create_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "创建人名称")
  424. .Annotation("MySql:CharSet", "utf8mb4"),
  425. create_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "创建时间"),
  426. update_by = table.Column<long>(type: "bigint", nullable: true, comment: "修改人"),
  427. update_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "修改人名称")
  428. .Annotation("MySql:CharSet", "utf8mb4"),
  429. update_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改时间"),
  430. tenant_id = table.Column<long>(type: "bigint", nullable: false, comment: "企业ID"),
  431. factory_id = table.Column<long>(type: "bigint", nullable: true, comment: "工厂ID"),
  432. org_id = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
  433. IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: false, comment: "删除标识")
  434. },
  435. constraints: table =>
  436. {
  437. table.PrimaryKey("PK_crm_seorder", x => x.seorder_id);
  438. },
  439. comment: "销售订单")
  440. .Annotation("MySql:CharSet", "utf8mb4");
  441. migrationBuilder.CreateTable(
  442. name: "crm_seorderentry",
  443. columns: table => new
  444. {
  445. seorderentry_id = table.Column<long>(type: "bigint", nullable: false, comment: "销售订单明细表id")
  446. .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
  447. seorder_id = table.Column<long>(type: "bigint", nullable: false, comment: "销售订单id"),
  448. bill_no = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "销售订单编号")
  449. .Annotation("MySql:CharSet", "utf8mb4"),
  450. entry_seq = table.Column<int>(type: "int", nullable: true, comment: "行号"),
  451. map_number = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: true, comment: "对应代码")
  452. .Annotation("MySql:CharSet", "utf8mb4"),
  453. map_name = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: true, comment: "代码名称")
  454. .Annotation("MySql:CharSet", "utf8mb4"),
  455. item_number = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: true, comment: "产品代码")
  456. .Annotation("MySql:CharSet", "utf8mb4"),
  457. fms_number = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: true, comment: "FMS旧料号")
  458. .Annotation("MySql:CharSet", "utf8mb4"),
  459. item_name = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: true, comment: "产品名称")
  460. .Annotation("MySql:CharSet", "utf8mb4"),
  461. specification = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: true, comment: "规格型号")
  462. .Annotation("MySql:CharSet", "utf8mb4"),
  463. urgent = table.Column<int>(type: "int", nullable: true, comment: "加急级别"),
  464. bom_number = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: true, comment: "BOM编号")
  465. .Annotation("MySql:CharSet", "utf8mb4"),
  466. unit = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "单位")
  467. .Annotation("MySql:CharSet", "utf8mb4"),
  468. qty = table.Column<decimal>(type: "decimal(20,8)", precision: 20, scale: 8, nullable: true, comment: "订单数量"),
  469. price = table.Column<decimal>(type: "decimal(20,8)", precision: 20, scale: 8, nullable: true, comment: "单价"),
  470. tax_price = table.Column<decimal>(type: "decimal(20,8)", precision: 20, scale: 8, nullable: true, comment: "含税单价"),
  471. amount = table.Column<decimal>(type: "decimal(20,8)", precision: 20, scale: 8, nullable: true, comment: "金额"),
  472. tax_rate = table.Column<decimal>(type: "decimal(20,8)", precision: 20, scale: 8, nullable: true, comment: "税率"),
  473. discount_rate = table.Column<decimal>(type: "decimal(20,8)", precision: 20, scale: 8, nullable: true, comment: "折扣率"),
  474. discount_amount = table.Column<decimal>(type: "decimal(20,8)", precision: 20, scale: 8, nullable: true, comment: "折扣额"),
  475. aux_price_discount = table.Column<decimal>(type: "decimal(20,8)", precision: 20, scale: 8, nullable: true, comment: "实际含税单价"),
  476. tax_amtount = table.Column<decimal>(type: "decimal(20,8)", precision: 20, scale: 8, nullable: true, comment: "销项税额"),
  477. total_amount = table.Column<decimal>(type: "decimal(20,8)", precision: 20, scale: 8, nullable: true, comment: "价税合计"),
  478. plan_date = table.Column<DateTime>(type: "datetime", nullable: true, comment: "客户要求交期"),
  479. date = table.Column<DateTime>(type: "datetime", nullable: true, comment: "最终交货日期"),
  480. planner_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "计划员")
  481. .Annotation("MySql:CharSet", "utf8mb4"),
  482. planner_no = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "计划员_工号")
  483. .Annotation("MySql:CharSet", "utf8mb4"),
  484. remark = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: true, comment: "备注")
  485. .Annotation("MySql:CharSet", "utf8mb4"),
  486. soure_bill_no = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "源单编号")
  487. .Annotation("MySql:CharSet", "utf8mb4"),
  488. custom_order_bill_no = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "客户订单号")
  489. .Annotation("MySql:CharSet", "utf8mb4"),
  490. custom_order_entryid = table.Column<int>(type: "int", nullable: true, comment: "客户订单行号"),
  491. sys_capacity_date = table.Column<DateTime>(type: "datetime", nullable: true, comment: "系统建议交期(产能)"),
  492. adjust_date = table.Column<DateTime>(type: "datetime", nullable: true, comment: "调整建议交期"),
  493. mrp_closed = table.Column<bool>(type: "tinyint(1)", nullable: true, comment: "mrp关闭"),
  494. op_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "操作时间"),
  495. custom_order_itemno = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "客户料号")
  496. .Annotation("MySql:CharSet", "utf8mb4"),
  497. state = table.Column<bool>(type: "tinyint(1)", nullable: false, comment: "数据状态标识 0停用 1启用"),
  498. rstate = table.Column<int>(type: "int", nullable: true, comment: "评审状态"),
  499. rnumber = table.Column<int>(type: "int", nullable: true, comment: "评审次数"),
  500. progress = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: true, comment: "订单进度")
  501. .Annotation("MySql:CharSet", "utf8mb4"),
  502. deliver_notice_count = table.Column<decimal>(type: "decimal(20,8)", precision: 20, scale: 8, nullable: true, comment: "发货通知单数量"),
  503. deliver_count = table.Column<decimal>(type: "decimal(20,8)", precision: 20, scale: 8, nullable: true, comment: "发货数量(已出库数量)"),
  504. se_reject_reason = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "业务员工号")
  505. .Annotation("MySql:CharSet", "utf8mb4"),
  506. out_stock_type = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "出库类型")
  507. .Annotation("MySql:CharSet", "utf8mb4"),
  508. is_checked = table.Column<bool>(type: "tinyint(1)", nullable: true, comment: "是否完成检测,0未完成,1完成"),
  509. sys_material_date = table.Column<DateTime>(type: "datetime", nullable: true, comment: "系统建议交期(物料)"),
  510. contract_no = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "合同编号")
  511. .Annotation("MySql:CharSet", "utf8mb4"),
  512. create_dept = table.Column<long>(type: "bigint", nullable: true, comment: "创建部门id"),
  513. create_by = table.Column<long>(type: "bigint", nullable: true, comment: "创建人id"),
  514. create_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "创建人名称")
  515. .Annotation("MySql:CharSet", "utf8mb4"),
  516. create_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "创建时间"),
  517. update_by = table.Column<long>(type: "bigint", nullable: true, comment: "修改人"),
  518. update_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "修改人名称")
  519. .Annotation("MySql:CharSet", "utf8mb4"),
  520. update_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改时间"),
  521. tenant_id = table.Column<long>(type: "bigint", nullable: false, comment: "企业ID"),
  522. factory_id = table.Column<long>(type: "bigint", nullable: true, comment: "工厂ID"),
  523. org_id = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
  524. IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: false, comment: "删除标识")
  525. },
  526. constraints: table =>
  527. {
  528. table.PrimaryKey("PK_crm_seorderentry", x => x.seorderentry_id);
  529. },
  530. comment: "销售订单明细表")
  531. .Annotation("MySql:CharSet", "utf8mb4");
  532. migrationBuilder.CreateTable(
  533. name: "crm_seorderprog",
  534. columns: table => new
  535. {
  536. seorderprog_id = table.Column<long>(type: "bigint", nullable: false, comment: "销售订单进度表")
  537. .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
  538. seorder_id = table.Column<long>(type: "bigint", nullable: false, comment: "销售订单id"),
  539. bill_no = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "销售订单编号")
  540. .Annotation("MySql:CharSet", "utf8mb4"),
  541. entry_seq = table.Column<int>(type: "int", nullable: true, comment: "销售订单行号"),
  542. seprog_type = table.Column<int>(type: "int", nullable: true, comment: "进度类型"),
  543. seprog_stage = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "进度阶段")
  544. .Annotation("MySql:CharSet", "utf8mb4"),
  545. seprog_stage_id = table.Column<long>(type: "bigint", nullable: true, comment: "进度阶段id"),
  546. seprog_stime = table.Column<DateTime>(type: "datetime", nullable: true, comment: "开始时间"),
  547. seprog_etime = table.Column<DateTime>(type: "datetime", nullable: true, comment: "完成时间"),
  548. seprog_by_id = table.Column<long>(type: "bigint", nullable: true, comment: "提交人id"),
  549. seprog_by_name = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "提交人姓名")
  550. .Annotation("MySql:CharSet", "utf8mb4"),
  551. create_dept = table.Column<long>(type: "bigint", nullable: true, comment: "创建部门id"),
  552. create_by = table.Column<long>(type: "bigint", nullable: true, comment: "创建人id"),
  553. create_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "创建人名称")
  554. .Annotation("MySql:CharSet", "utf8mb4"),
  555. create_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "创建时间"),
  556. update_by = table.Column<long>(type: "bigint", nullable: true, comment: "修改人"),
  557. update_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "修改人名称")
  558. .Annotation("MySql:CharSet", "utf8mb4"),
  559. update_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改时间"),
  560. tenant_id = table.Column<long>(type: "bigint", nullable: false, comment: "企业ID"),
  561. factory_id = table.Column<long>(type: "bigint", nullable: true, comment: "工厂ID"),
  562. org_id = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
  563. IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: false, comment: "删除标识")
  564. },
  565. constraints: table =>
  566. {
  567. table.PrimaryKey("PK_crm_seorderprog", x => x.seorderprog_id);
  568. },
  569. comment: "销售订单进度表")
  570. .Annotation("MySql:CharSet", "utf8mb4");
  571. migrationBuilder.CreateTable(
  572. name: "crm_seorderreview",
  573. columns: table => new
  574. {
  575. review_id = table.Column<long>(type: "bigint", nullable: false, comment: "销售订单评审id")
  576. .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
  577. seorder_id = table.Column<long>(type: "bigint", nullable: false, comment: "销售订单id"),
  578. review_type = table.Column<string>(type: "longtext", nullable: false, comment: "业务类型")
  579. .Annotation("MySql:CharSet", "utf8mb4"),
  580. bill_no = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "销售订单编号")
  581. .Annotation("MySql:CharSet", "utf8mb4"),
  582. entry_seq = table.Column<int>(type: "int", nullable: true, comment: "销售订单行号"),
  583. review_stime = table.Column<DateTime>(type: "datetime", nullable: true, comment: "提交时间"),
  584. review_by_id = table.Column<long>(type: "bigint", nullable: true, comment: "提交人id"),
  585. review_by_name = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "提交人姓名")
  586. .Annotation("MySql:CharSet", "utf8mb4"),
  587. review_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "评审时间"),
  588. reviewer_id = table.Column<long>(type: "bigint", nullable: true, comment: "评审人id"),
  589. reviewer_name = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "评审人姓名")
  590. .Annotation("MySql:CharSet", "utf8mb4"),
  591. review_result = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: true, comment: "评审结果")
  592. .Annotation("MySql:CharSet", "utf8mb4"),
  593. reject_reason = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: true, comment: "拒绝原因")
  594. .Annotation("MySql:CharSet", "utf8mb4"),
  595. review_reject_level = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: true, comment: "拒绝等级")
  596. .Annotation("MySql:CharSet", "utf8mb4"),
  597. review_reject_remark = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: true, comment: "拒绝备注")
  598. .Annotation("MySql:CharSet", "utf8mb4"),
  599. review_adjust_time = table.Column<DateTime>(type: "datetime", maxLength: 255, nullable: true, comment: "可接受交期"),
  600. review_title = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: true, comment: "标题")
  601. .Annotation("MySql:CharSet", "utf8mb4"),
  602. audit_procedure_id = table.Column<long>(type: "bigint", nullable: true, comment: "当前审批步骤id"),
  603. audit_procedure_name = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: true, comment: "当前审批步骤名称")
  604. .Annotation("MySql:CharSet", "utf8mb4"),
  605. create_by = table.Column<long>(type: "bigint", nullable: true, comment: "创建人id"),
  606. create_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "创建人名称")
  607. .Annotation("MySql:CharSet", "utf8mb4"),
  608. create_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "创建时间"),
  609. update_by = table.Column<long>(type: "bigint", nullable: true, comment: "修改人"),
  610. update_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "修改人名称")
  611. .Annotation("MySql:CharSet", "utf8mb4"),
  612. update_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改时间"),
  613. tenant_id = table.Column<long>(type: "bigint", nullable: false, comment: "企业ID"),
  614. factory_id = table.Column<long>(type: "bigint", nullable: true, comment: "工厂ID"),
  615. org_id = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
  616. IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: false, comment: "删除标识")
  617. },
  618. constraints: table =>
  619. {
  620. table.PrimaryKey("PK_crm_seorderreview", x => x.review_id);
  621. },
  622. comment: "销售订单评审表")
  623. .Annotation("MySql:CharSet", "utf8mb4");
  624. migrationBuilder.CreateTable(
  625. name: "ic_bom",
  626. columns: table => new
  627. {
  628. bom_id = table.Column<long>(type: "bigint", nullable: false, comment: "主键")
  629. .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
  630. bom_number = table.Column<string>(type: "varchar(20)", maxLength: 20, nullable: true, comment: "bom单编号")
  631. .Annotation("MySql:CharSet", "utf8mb4"),
  632. icitem_id = table.Column<long>(type: "bigint", nullable: false, comment: "物料id"),
  633. item_number = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "物料代码")
  634. .Annotation("MySql:CharSet", "utf8mb4"),
  635. item_name = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: true, comment: "物料名称")
  636. .Annotation("MySql:CharSet", "utf8mb4"),
  637. bom_num = table.Column<int>(type: "int", nullable: false, comment: "序号"),
  638. fse_status = table.Column<int>(type: "int", nullable: false, comment: "使用状态"),
  639. begin_day = table.Column<DateTime>(type: "datetime", nullable: true, comment: "生效日期"),
  640. end_day = table.Column<DateTime>(type: "datetime", nullable: true, comment: "失效日期"),
  641. tech_id = table.Column<long>(type: "bigint", nullable: false, comment: "工艺主键"),
  642. tech_name = table.Column<string>(type: "varchar(20)", maxLength: 20, nullable: true, comment: "工艺名称")
  643. .Annotation("MySql:CharSet", "utf8mb4"),
  644. product_principal = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "生产负责人")
  645. .Annotation("MySql:CharSet", "utf8mb4"),
  646. product_designer = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "产品设计员")
  647. .Annotation("MySql:CharSet", "utf8mb4"),
  648. version = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "版本")
  649. .Annotation("MySql:CharSet", "utf8mb4"),
  650. chartnumber = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "图表编号")
  651. .Annotation("MySql:CharSet", "utf8mb4"),
  652. biller = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "图片")
  653. .Annotation("MySql:CharSet", "utf8mb4"),
  654. checker = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "检验人")
  655. .Annotation("MySql:CharSet", "utf8mb4"),
  656. check_date = table.Column<DateTime>(type: "datetime", nullable: true, comment: "检验时间"),
  657. user = table.Column<string>(type: "varchar(20)", maxLength: 20, nullable: true, comment: "bom创建人")
  658. .Annotation("MySql:CharSet", "utf8mb4"),
  659. use_date = table.Column<DateTime>(type: "datetime", nullable: true, comment: "bom创建时间"),
  660. unit = table.Column<string>(type: "varchar(20)", maxLength: 20, nullable: true, comment: "单位")
  661. .Annotation("MySql:CharSet", "utf8mb4"),
  662. create_by = table.Column<long>(type: "bigint", nullable: true, comment: "创建人id"),
  663. create_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "创建人名称")
  664. .Annotation("MySql:CharSet", "utf8mb4"),
  665. create_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "创建时间"),
  666. update_by = table.Column<long>(type: "bigint", nullable: true, comment: "修改人"),
  667. update_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "修改人名称")
  668. .Annotation("MySql:CharSet", "utf8mb4"),
  669. update_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改时间"),
  670. tenant_id = table.Column<long>(type: "bigint", nullable: false, comment: "企业ID"),
  671. factory_id = table.Column<long>(type: "bigint", nullable: true, comment: "工厂ID"),
  672. org_id = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
  673. IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: false, comment: "删除标识")
  674. },
  675. constraints: table =>
  676. {
  677. table.PrimaryKey("PK_ic_bom", x => x.bom_id);
  678. },
  679. comment: "物料BOM")
  680. .Annotation("MySql:CharSet", "utf8mb4");
  681. migrationBuilder.CreateTable(
  682. name: "ic_bom_child",
  683. columns: table => new
  684. {
  685. bom_child_id = table.Column<long>(type: "bigint", nullable: false, comment: "主键")
  686. .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
  687. bom_id = table.Column<long>(type: "bigint", nullable: false, comment: "bom主键"),
  688. bom_number = table.Column<string>(type: "varchar(20)", maxLength: 20, nullable: true, comment: "bom单编号")
  689. .Annotation("MySql:CharSet", "utf8mb4"),
  690. is_bom = table.Column<int>(type: "int", nullable: false, comment: "是否是BOM"),
  691. icitem_id = table.Column<long>(type: "bigint", nullable: false, comment: "物料id"),
  692. item_number = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "物料代码")
  693. .Annotation("MySql:CharSet", "utf8mb4"),
  694. item_name = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: true, comment: "物料名称")
  695. .Annotation("MySql:CharSet", "utf8mb4"),
  696. unit = table.Column<string>(type: "varchar(20)", maxLength: 20, nullable: true, comment: "单位")
  697. .Annotation("MySql:CharSet", "utf8mb4"),
  698. qty = table.Column<decimal>(type: "decimal(20,8)", precision: 20, scale: 8, nullable: true, comment: "用量"),
  699. scrap = table.Column<decimal>(type: "decimal(20,8)", precision: 20, scale: 8, nullable: true, comment: "损耗率"),
  700. backflush = table.Column<int>(type: "int", nullable: false, comment: "是否倒冲"),
  701. iskeyitem = table.Column<int>(type: "int", nullable: false, comment: "是否关键件"),
  702. haveicsubs = table.Column<int>(type: "int", nullable: false, comment: "存在替代关系"),
  703. substitute_code = table.Column<string>(type: "varchar(20)", maxLength: 20, nullable: true, comment: "群组代码")
  704. .Annotation("MySql:CharSet", "utf8mb4"),
  705. is_replace = table.Column<int>(type: "int", nullable: false, comment: "是否群组替代"),
  706. icitem_ids = table.Column<string>(type: "varchar(2000)", maxLength: 2000, nullable: true, comment: "组合模式")
  707. .Annotation("MySql:CharSet", "utf8mb4"),
  708. note = table.Column<string>(type: "varchar(1000)", maxLength: 1000, nullable: true, comment: "备注")
  709. .Annotation("MySql:CharSet", "utf8mb4"),
  710. entryid = table.Column<int>(type: "int", nullable: false, comment: "顺序号"),
  711. type = table.Column<int>(type: "int", nullable: false, comment: "物料类型"),
  712. erp_cls = table.Column<int>(type: "int", nullable: false, comment: "物料属性"),
  713. use_status = table.Column<int>(type: "int", nullable: false, comment: "使用状态"),
  714. begin_day = table.Column<DateTime>(type: "datetime", nullable: true, comment: "生效日期"),
  715. end_day = table.Column<DateTime>(type: "datetime", nullable: true, comment: "失效日期"),
  716. op_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "操作时间"),
  717. child_num = table.Column<int>(type: "int", nullable: false, comment: "序号"),
  718. create_by = table.Column<long>(type: "bigint", nullable: true, comment: "创建人id"),
  719. create_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "创建人名称")
  720. .Annotation("MySql:CharSet", "utf8mb4"),
  721. create_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "创建时间"),
  722. update_by = table.Column<long>(type: "bigint", nullable: true, comment: "修改人"),
  723. update_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "修改人名称")
  724. .Annotation("MySql:CharSet", "utf8mb4"),
  725. update_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改时间"),
  726. tenant_id = table.Column<long>(type: "bigint", nullable: false, comment: "企业ID"),
  727. factory_id = table.Column<long>(type: "bigint", nullable: true, comment: "工厂ID"),
  728. org_id = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
  729. IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: false, comment: "删除标识")
  730. },
  731. constraints: table =>
  732. {
  733. table.PrimaryKey("PK_ic_bom_child", x => x.bom_child_id);
  734. },
  735. comment: "物料BOM明细")
  736. .Annotation("MySql:CharSet", "utf8mb4");
  737. migrationBuilder.CreateTable(
  738. name: "ic_factory_details",
  739. columns: table => new
  740. {
  741. icitem_dtl_id = table.Column<long>(type: "bigint", nullable: false, comment: "主键")
  742. .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
  743. icitem_id = table.Column<long>(type: "bigint", nullable: false, comment: "物料id"),
  744. icitem_name = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "物料名称")
  745. .Annotation("MySql:CharSet", "utf8mb4"),
  746. factory_fode = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "工厂编码")
  747. .Annotation("MySql:CharSet", "utf8mb4"),
  748. note = table.Column<string>(type: "varchar(1000)", maxLength: 1000, nullable: true, comment: "特殊备注")
  749. .Annotation("MySql:CharSet", "utf8mb4"),
  750. product_line = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "产品线")
  751. .Annotation("MySql:CharSet", "utf8mb4"),
  752. pick_type = table.Column<long>(type: "bigint", nullable: false, comment: "领料类型"),
  753. batch_manager = table.Column<int>(type: "int", nullable: false, comment: "是否采用业务批次管理"),
  754. stock_time = table.Column<int>(type: "int", nullable: false, comment: "是否需要库龄管理"),
  755. check_cycunit = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "盘点周期单位")
  756. .Annotation("MySql:CharSet", "utf8mb4"),
  757. check_cycle = table.Column<decimal>(type: "decimal(20,8)", precision: 20, scale: 8, nullable: true, comment: "盘点周期"),
  758. days_per = table.Column<int>(type: "int", nullable: false, comment: "每周_月第天"),
  759. last_checkdate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "上次盘点日期"),
  760. default_chkloc = table.Column<long>(type: "bigint", nullable: false, comment: "默认待检仓库"),
  761. default_chksp = table.Column<long>(type: "bigint", nullable: false, comment: "默认待检仓位"),
  762. default_loc = table.Column<long>(type: "bigint", nullable: false, comment: "默认仓库"),
  763. default_sp = table.Column<long>(type: "bigint", nullable: false, comment: "默认仓位"),
  764. item_shelve = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "货架信息")
  765. .Annotation("MySql:CharSet", "utf8mb4"),
  766. default_manager = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "默认仓管员")
  767. .Annotation("MySql:CharSet", "utf8mb4"),
  768. low_limit = table.Column<decimal>(type: "decimal(20,8)", precision: 20, scale: 8, nullable: true, comment: "最低存量"),
  769. high_limit = table.Column<decimal>(type: "decimal(20,8)", precision: 20, scale: 8, nullable: true, comment: "最高存量"),
  770. qty_max = table.Column<decimal>(type: "decimal(20,8)", precision: 20, scale: 8, nullable: true, comment: "最大订货量"),
  771. daily_consume = table.Column<decimal>(type: "decimal(20,8)", precision: 20, scale: 8, nullable: true, comment: "日消耗量"),
  772. mcv_acct = table.Column<long>(type: "bigint", nullable: false, comment: "材料成本差异科目代码"),
  773. pcv_acct = table.Column<long>(type: "bigint", nullable: false, comment: "加工费差异科目代码"),
  774. sl_acct = table.Column<long>(type: "bigint", nullable: false, comment: "废品损失科目代码"),
  775. cav_acct = table.Column<long>(type: "bigint", nullable: false, comment: "标准成本调整差异科目代码"),
  776. warehouse_note = table.Column<string>(type: "varchar(1000)", maxLength: 1000, nullable: true, comment: "库存备注")
  777. .Annotation("MySql:CharSet", "utf8mb4"),
  778. ordissu_days = table.Column<decimal>(type: "decimal(20,8)", precision: 20, scale: 8, nullable: true, comment: "工单发料时间/天"),
  779. raw_matreceiv_days = table.Column<decimal>(type: "decimal(20,8)", precision: 20, scale: 8, nullable: true, comment: "原材料收货处理时间/天"),
  780. prdenter_days = table.Column<decimal>(type: "decimal(20,8)", precision: 20, scale: 8, nullable: true, comment: "成品入库时间/天"),
  781. mat_enter_days = table.Column<decimal>(type: "decimal(20,8)", precision: 20, scale: 8, nullable: true, comment: "原材料入库时间/天"),
  782. prd_out_days = table.Column<decimal>(type: "decimal(20,8)", precision: 20, scale: 8, nullable: true, comment: "成品发货时间/天"),
  783. create_by = table.Column<long>(type: "bigint", nullable: true, comment: "创建人id"),
  784. create_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "创建人名称")
  785. .Annotation("MySql:CharSet", "utf8mb4"),
  786. create_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "创建时间"),
  787. update_by = table.Column<long>(type: "bigint", nullable: true, comment: "修改人"),
  788. update_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "修改人名称")
  789. .Annotation("MySql:CharSet", "utf8mb4"),
  790. update_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改时间"),
  791. tenant_id = table.Column<long>(type: "bigint", nullable: false, comment: "企业ID"),
  792. factory_id = table.Column<long>(type: "bigint", nullable: true, comment: "工厂ID"),
  793. org_id = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
  794. IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: false, comment: "删除标识")
  795. },
  796. constraints: table =>
  797. {
  798. table.PrimaryKey("PK_ic_factory_details", x => x.icitem_dtl_id);
  799. },
  800. comment: "工厂物料明细表")
  801. .Annotation("MySql:CharSet", "utf8mb4");
  802. migrationBuilder.CreateTable(
  803. name: "ic_item",
  804. columns: table => new
  805. {
  806. icitem_id = table.Column<long>(type: "bigint", nullable: false, comment: "物料id")
  807. .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
  808. number = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "物料编码")
  809. .Annotation("MySql:CharSet", "utf8mb4"),
  810. name = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "物料名称")
  811. .Annotation("MySql:CharSet", "utf8mb4"),
  812. model = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: true, comment: "规格型号")
  813. .Annotation("MySql:CharSet", "utf8mb4"),
  814. full_name = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: true, comment: "全名")
  815. .Annotation("MySql:CharSet", "utf8mb4"),
  816. fms_number = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "fms旧料号")
  817. .Annotation("MySql:CharSet", "utf8mb4"),
  818. erp_oldnumber = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "erp旧料号")
  819. .Annotation("MySql:CharSet", "utf8mb4"),
  820. chart_number = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "图号")
  821. .Annotation("MySql:CharSet", "utf8mb4"),
  822. fversion = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "版本号")
  823. .Annotation("MySql:CharSet", "utf8mb4"),
  824. box_model = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: true, comment: "盒贴规格")
  825. .Annotation("MySql:CharSet", "utf8mb4"),
  826. erp_cls = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "物料属性")
  827. .Annotation("MySql:CharSet", "utf8mb4"),
  828. item_level = table.Column<long>(type: "bigint", nullable: false, comment: "物料等级"),
  829. hb_level = table.Column<long>(type: "bigint", nullable: false, comment: "环保等级"),
  830. standard_manhour = table.Column<decimal>(type: "decimal(20,8)", precision: 20, scale: 8, nullable: true, comment: "单位标准工时_小时"),
  831. unititem_amount = table.Column<decimal>(type: "decimal(20,8)", precision: 20, scale: 8, nullable: true, comment: "单位材料定额_元"),
  832. source = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: true, comment: "来源")
  833. .Annotation("MySql:CharSet", "utf8mb4"),
  834. is_equipment = table.Column<int>(type: "int", nullable: false, comment: "是否为设备"),
  835. unit_qty = table.Column<decimal>(type: "decimal(20,8)", precision: 20, scale: 8, nullable: true, comment: "单位包装数量"),
  836. check_bybarcode = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "严格进行二维码数量校验")
  837. .Annotation("MySql:CharSet", "utf8mb4"),
  838. iskeyitem = table.Column<int>(type: "int", nullable: false, comment: "是否关键件"),
  839. gross_weight = table.Column<decimal>(type: "decimal(20,8)", precision: 20, scale: 8, nullable: true, comment: "毛重"),
  840. net_weight = table.Column<decimal>(type: "decimal(20,8)", precision: 20, scale: 8, nullable: true, comment: "净重"),
  841. maund = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "重量单位")
  842. .Annotation("MySql:CharSet", "utf8mb4"),
  843. length = table.Column<decimal>(type: "decimal(20,8)", precision: 20, scale: 8, nullable: true, comment: "长度"),
  844. cubic_measure = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "长度单位")
  845. .Annotation("MySql:CharSet", "utf8mb4"),
  846. width = table.Column<decimal>(type: "decimal(20,8)", precision: 20, scale: 8, nullable: true, comment: "宽度"),
  847. height = table.Column<decimal>(type: "decimal(20,8)", precision: 20, scale: 8, nullable: true, comment: "高度"),
  848. size = table.Column<decimal>(type: "decimal(20,8)", precision: 20, scale: 8, nullable: true, comment: "体积"),
  849. matatt = table.Column<long>(type: "bigint", nullable: false, comment: "物料类别"),
  850. allowpur = table.Column<int>(type: "int", nullable: false, comment: "允许采购"),
  851. allowsale = table.Column<int>(type: "int", nullable: false, comment: "允许销售"),
  852. allowmanu = table.Column<int>(type: "int", nullable: false, comment: "允许生产"),
  853. allowout = table.Column<int>(type: "int", nullable: false, comment: "允许委外"),
  854. allowbatch = table.Column<int>(type: "int", nullable: false, comment: "批号管理"),
  855. allowserial = table.Column<int>(type: "int", nullable: false, comment: "序列号管理"),
  856. photo = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "图片")
  857. .Annotation("MySql:CharSet", "utf8mb4"),
  858. picktype = table.Column<long>(type: "bigint", nullable: false, comment: "领料类型"),
  859. output_type_id = table.Column<long>(type: "bigint", nullable: false, comment: "出库类型"),
  860. enable_warning = table.Column<int>(type: "int", nullable: false, comment: "启用预警"),
  861. create_by = table.Column<long>(type: "bigint", nullable: true, comment: "创建人id"),
  862. create_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "创建人名称")
  863. .Annotation("MySql:CharSet", "utf8mb4"),
  864. create_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "创建时间"),
  865. update_by = table.Column<long>(type: "bigint", nullable: true, comment: "修改人"),
  866. update_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "修改人名称")
  867. .Annotation("MySql:CharSet", "utf8mb4"),
  868. update_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改时间"),
  869. tenant_id = table.Column<long>(type: "bigint", nullable: false, comment: "企业ID"),
  870. factory_id = table.Column<long>(type: "bigint", nullable: true, comment: "工厂ID"),
  871. org_id = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
  872. IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: false, comment: "删除标识")
  873. },
  874. constraints: table =>
  875. {
  876. table.PrimaryKey("PK_ic_item", x => x.icitem_id);
  877. },
  878. comment: "物料详情")
  879. .Annotation("MySql:CharSet", "utf8mb4");
  880. migrationBuilder.CreateTable(
  881. name: "ic_item_ie",
  882. columns: table => new
  883. {
  884. ic_item_ie_id = table.Column<long>(type: "bigint", nullable: false, comment: "主键")
  885. .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
  886. icitem_id = table.Column<long>(type: "bigint", nullable: false, comment: "物料id"),
  887. isbackflush = table.Column<int>(type: "int", nullable: false, comment: "是否倒冲"),
  888. product_principal = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "生产负责人")
  889. .Annotation("MySql:CharSet", "utf8mb4"),
  890. back_flush_stock = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "倒冲仓库")
  891. .Annotation("MySql:CharSet", "utf8mb4"),
  892. back_flush_sp = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "倒冲仓位")
  893. .Annotation("MySql:CharSet", "utf8mb4"),
  894. put_integer = table.Column<int>(type: "int", nullable: false, comment: "投料自动取整"),
  895. ir_note = table.Column<string>(type: "varchar(1000)", maxLength: 1000, nullable: true, comment: "ie备注")
  896. .Annotation("MySql:CharSet", "utf8mb4"),
  897. create_by = table.Column<long>(type: "bigint", nullable: true, comment: "创建人id"),
  898. create_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "创建人名称")
  899. .Annotation("MySql:CharSet", "utf8mb4"),
  900. create_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "创建时间"),
  901. update_by = table.Column<long>(type: "bigint", nullable: true, comment: "修改人"),
  902. update_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "修改人名称")
  903. .Annotation("MySql:CharSet", "utf8mb4"),
  904. update_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改时间"),
  905. tenant_id = table.Column<long>(type: "bigint", nullable: false, comment: "企业ID"),
  906. factory_id = table.Column<long>(type: "bigint", nullable: true, comment: "工厂ID"),
  907. org_id = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
  908. IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: false, comment: "删除标识")
  909. },
  910. constraints: table =>
  911. {
  912. table.PrimaryKey("PK_ic_item_ie", x => x.ic_item_ie_id);
  913. },
  914. comment: "物料ie信息表")
  915. .Annotation("MySql:CharSet", "utf8mb4");
  916. migrationBuilder.CreateTable(
  917. name: "ic_item_inventory",
  918. columns: table => new
  919. {
  920. icitem_inventory_id = table.Column<long>(type: "bigint", nullable: false, comment: "主键")
  921. .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
  922. icitem_stock_id = table.Column<long>(type: "bigint", nullable: false, comment: "物料库存主键"),
  923. stock_id = table.Column<long>(type: "bigint", nullable: false, comment: "仓库id"),
  924. stock_name = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "仓库名称")
  925. .Annotation("MySql:CharSet", "utf8mb4"),
  926. stock_place_id = table.Column<long>(type: "bigint", nullable: false, comment: "库位id"),
  927. stock_place_code = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "库位编码")
  928. .Annotation("MySql:CharSet", "utf8mb4"),
  929. batch_no = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "批次号")
  930. .Annotation("MySql:CharSet", "utf8mb4"),
  931. qty = table.Column<decimal>(type: "decimal(20,8)", precision: 20, scale: 8, nullable: true, comment: "数量"),
  932. bal = table.Column<decimal>(type: "decimal(20,8)", precision: 20, scale: 8, nullable: true, comment: "金额"),
  933. kf_period = table.Column<decimal>(type: "decimal(20,8)", precision: 20, scale: 8, nullable: true, comment: "保质期时长"),
  934. kf_date = table.Column<DateTime>(type: "datetime", nullable: true, comment: "保质期时间"),
  935. qty_lock = table.Column<decimal>(type: "decimal(20,8)", precision: 20, scale: 8, nullable: true, comment: "锁定库存"),
  936. sec_qty = table.Column<decimal>(type: "decimal(20,8)", precision: 20, scale: 8, nullable: true, comment: "安全库存"),
  937. unit = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "单位")
  938. .Annotation("MySql:CharSet", "utf8mb4"),
  939. rq = table.Column<DateTime>(type: "datetime", nullable: true, comment: "日期"),
  940. create_by = table.Column<long>(type: "bigint", nullable: true, comment: "创建人id"),
  941. create_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "创建人名称")
  942. .Annotation("MySql:CharSet", "utf8mb4"),
  943. create_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "创建时间"),
  944. update_by = table.Column<long>(type: "bigint", nullable: true, comment: "修改人"),
  945. update_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "修改人名称")
  946. .Annotation("MySql:CharSet", "utf8mb4"),
  947. update_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改时间"),
  948. tenant_id = table.Column<long>(type: "bigint", nullable: false, comment: "企业ID"),
  949. factory_id = table.Column<long>(type: "bigint", nullable: true, comment: "工厂ID"),
  950. org_id = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
  951. IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: false, comment: "删除标识")
  952. },
  953. constraints: table =>
  954. {
  955. table.PrimaryKey("PK_ic_item_inventory", x => x.icitem_inventory_id);
  956. },
  957. comment: "物料库存信息表")
  958. .Annotation("MySql:CharSet", "utf8mb4");
  959. migrationBuilder.CreateTable(
  960. name: "ic_item_pur",
  961. columns: table => new
  962. {
  963. icitem_pur_id = table.Column<long>(type: "bigint", nullable: false, comment: "主键")
  964. .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
  965. icitem_id = table.Column<long>(type: "bigint", nullable: false, comment: "物料id"),
  966. icitem_name = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "物料名称")
  967. .Annotation("MySql:CharSet", "utf8mb4"),
  968. ic_plan_id = table.Column<long>(type: "bigint", nullable: false, comment: "采购计划id"),
  969. supplier_id = table.Column<long>(type: "bigint", nullable: false, comment: "供应商id"),
  970. supplier_number = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "供应商编码")
  971. .Annotation("MySql:CharSet", "utf8mb4"),
  972. supplier_name = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "供应商名称")
  973. .Annotation("MySql:CharSet", "utf8mb4"),
  974. purchgroup = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "采购组")
  975. .Annotation("MySql:CharSet", "utf8mb4"),
  976. purcher = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "采购员")
  977. .Annotation("MySql:CharSet", "utf8mb4"),
  978. purchase_unit = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "采购计量单位")
  979. .Annotation("MySql:CharSet", "utf8mb4"),
  980. netpurchase_price = table.Column<decimal>(type: "decimal(20,8)", precision: 20, scale: 8, nullable: true, comment: "采购净价(不含税)"),
  981. taxrate = table.Column<decimal>(type: "decimal(20,8)", precision: 20, scale: 8, nullable: true, comment: "税率"),
  982. currency_type = table.Column<long>(type: "bigint", nullable: false, comment: "币种"),
  983. create_by = table.Column<long>(type: "bigint", nullable: true, comment: "创建人id"),
  984. create_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "创建人名称")
  985. .Annotation("MySql:CharSet", "utf8mb4"),
  986. create_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "创建时间"),
  987. update_by = table.Column<long>(type: "bigint", nullable: true, comment: "修改人"),
  988. update_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "修改人名称")
  989. .Annotation("MySql:CharSet", "utf8mb4"),
  990. update_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改时间"),
  991. tenant_id = table.Column<long>(type: "bigint", nullable: false, comment: "企业ID"),
  992. factory_id = table.Column<long>(type: "bigint", nullable: true, comment: "工厂ID"),
  993. org_id = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
  994. IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: false, comment: "删除标识")
  995. },
  996. constraints: table =>
  997. {
  998. table.PrimaryKey("PK_ic_item_pur", x => x.icitem_pur_id);
  999. },
  1000. comment: "物料采购报价单")
  1001. .Annotation("MySql:CharSet", "utf8mb4");
  1002. migrationBuilder.CreateTable(
  1003. name: "ic_item_stock",
  1004. columns: table => new
  1005. {
  1006. icitem_stock_id = table.Column<long>(type: "bigint", nullable: false, comment: "主键")
  1007. .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
  1008. icitem_id = table.Column<long>(type: "bigint", nullable: false, comment: "物料id"),
  1009. icitem_name = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "物料名称")
  1010. .Annotation("MySql:CharSet", "utf8mb4"),
  1011. sqty = table.Column<decimal>(type: "decimal(20,8)", precision: 20, scale: 8, nullable: true, comment: "物料库存量"),
  1012. quantity_in_transit = table.Column<decimal>(type: "decimal(20,8)", precision: 20, scale: 8, nullable: true, comment: "调拨在途数量"),
  1013. factory_fode = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "工厂编码")
  1014. .Annotation("MySql:CharSet", "utf8mb4"),
  1015. create_by = table.Column<long>(type: "bigint", nullable: true, comment: "创建人id"),
  1016. create_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "创建人名称")
  1017. .Annotation("MySql:CharSet", "utf8mb4"),
  1018. create_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "创建时间"),
  1019. update_by = table.Column<long>(type: "bigint", nullable: true, comment: "修改人"),
  1020. update_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "修改人名称")
  1021. .Annotation("MySql:CharSet", "utf8mb4"),
  1022. update_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改时间"),
  1023. tenant_id = table.Column<long>(type: "bigint", nullable: false, comment: "企业ID"),
  1024. factory_id = table.Column<long>(type: "bigint", nullable: true, comment: "工厂ID"),
  1025. org_id = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
  1026. IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: false, comment: "删除标识")
  1027. },
  1028. constraints: table =>
  1029. {
  1030. table.PrimaryKey("PK_ic_item_stock", x => x.icitem_stock_id);
  1031. },
  1032. comment: "物料库存表")
  1033. .Annotation("MySql:CharSet", "utf8mb4");
  1034. migrationBuilder.CreateTable(
  1035. name: "ic_metering_unit",
  1036. columns: table => new
  1037. {
  1038. ic_metering_unit_id = table.Column<long>(type: "bigint", nullable: false, comment: "主键")
  1039. .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
  1040. icitem_id = table.Column<long>(type: "bigint", nullable: false, comment: "物料id"),
  1041. icitem_name = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "物料名称")
  1042. .Annotation("MySql:CharSet", "utf8mb4"),
  1043. unit_group = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "计量单位组")
  1044. .Annotation("MySql:CharSet", "utf8mb4"),
  1045. unit = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "基本计量单位")
  1046. .Annotation("MySql:CharSet", "utf8mb4"),
  1047. order_unit = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "采购计量单位")
  1048. .Annotation("MySql:CharSet", "utf8mb4"),
  1049. sale_unit = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "销售计量单位")
  1050. .Annotation("MySql:CharSet", "utf8mb4"),
  1051. product_unit = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "生产计量单位")
  1052. .Annotation("MySql:CharSet", "utf8mb4"),
  1053. store_unit = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "库存计量单位")
  1054. .Annotation("MySql:CharSet", "utf8mb4"),
  1055. qty_decimal = table.Column<int>(type: "int", nullable: false, comment: "数量精度"),
  1056. create_by = table.Column<long>(type: "bigint", nullable: true, comment: "创建人id"),
  1057. create_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "创建人名称")
  1058. .Annotation("MySql:CharSet", "utf8mb4"),
  1059. create_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "创建时间"),
  1060. update_by = table.Column<long>(type: "bigint", nullable: true, comment: "修改人"),
  1061. update_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "修改人名称")
  1062. .Annotation("MySql:CharSet", "utf8mb4"),
  1063. update_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改时间"),
  1064. tenant_id = table.Column<long>(type: "bigint", nullable: false, comment: "企业ID"),
  1065. factory_id = table.Column<long>(type: "bigint", nullable: true, comment: "工厂ID"),
  1066. org_id = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
  1067. IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: false, comment: "删除标识")
  1068. },
  1069. constraints: table =>
  1070. {
  1071. table.PrimaryKey("PK_ic_metering_unit", x => x.ic_metering_unit_id);
  1072. },
  1073. comment: "物料计量表")
  1074. .Annotation("MySql:CharSet", "utf8mb4");
  1075. migrationBuilder.CreateTable(
  1076. name: "ic_plan",
  1077. columns: table => new
  1078. {
  1079. ic_plan_id = table.Column<long>(type: "bigint", nullable: false, comment: "主键")
  1080. .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
  1081. icitem_id = table.Column<long>(type: "bigint", nullable: false, comment: "物料id"),
  1082. icitem_name = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "物料名称")
  1083. .Annotation("MySql:CharSet", "utf8mb4"),
  1084. planner_name = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "计划员")
  1085. .Annotation("MySql:CharSet", "utf8mb4"),
  1086. planner_num = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "计划员_工号")
  1087. .Annotation("MySql:CharSet", "utf8mb4"),
  1088. factory_code = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "工厂编码")
  1089. .Annotation("MySql:CharSet", "utf8mb4"),
  1090. fix_leadtime = table.Column<decimal>(type: "decimal(20,8)", precision: 20, scale: 8, nullable: true, comment: "固定提前期(天)"),
  1091. plan_trategy = table.Column<int>(type: "int", nullable: false, comment: "计划策略"),
  1092. order_trategy = table.Column<int>(type: "int", nullable: false, comment: "订货策略"),
  1093. order_inter_val = table.Column<decimal>(type: "decimal(20,8)", precision: 20, scale: 8, nullable: true, comment: "订货间隔期_天"),
  1094. lead_time = table.Column<decimal>(type: "decimal(20,8)", precision: 20, scale: 8, nullable: true, comment: "变动提前期"),
  1095. bat_change_economy = table.Column<decimal>(type: "decimal(20,8)", precision: 20, scale: 8, nullable: true, comment: "变动提前期批量"),
  1096. total_tqq = table.Column<decimal>(type: "decimal(20,8)", precision: 20, scale: 8, nullable: true, comment: "累计提前期"),
  1097. order_point = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "再订货点")
  1098. .Annotation("MySql:CharSet", "utf8mb4"),
  1099. isfixedreorder = table.Column<int>(type: "int", nullable: false, comment: "设置为固定再订货点"),
  1100. secinv = table.Column<decimal>(type: "decimal(20,8)", precision: 20, scale: 8, nullable: true, comment: "安全库存数量"),
  1101. secinv_ratio = table.Column<decimal>(type: "decimal(20,8)", precision: 20, scale: 8, nullable: true, comment: "安全库存触发采购比例"),
  1102. book_plan = table.Column<int>(type: "int", nullable: false, comment: "是否需要进行订补货计划的运算"),
  1103. aux_prop_plan = table.Column<int>(type: "int", nullable: false, comment: "辅助属性参与计划运算"),
  1104. plannote = table.Column<string>(type: "varchar(1000)", maxLength: 1000, nullable: true, comment: "计划备注")
  1105. .Annotation("MySql:CharSet", "utf8mb4"),
  1106. create_by = table.Column<long>(type: "bigint", nullable: true, comment: "创建人id"),
  1107. create_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "创建人名称")
  1108. .Annotation("MySql:CharSet", "utf8mb4"),
  1109. create_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "创建时间"),
  1110. update_by = table.Column<long>(type: "bigint", nullable: true, comment: "修改人"),
  1111. update_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "修改人名称")
  1112. .Annotation("MySql:CharSet", "utf8mb4"),
  1113. update_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改时间"),
  1114. tenant_id = table.Column<long>(type: "bigint", nullable: false, comment: "企业ID"),
  1115. factory_id = table.Column<long>(type: "bigint", nullable: true, comment: "工厂ID"),
  1116. org_id = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
  1117. IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: false, comment: "删除标识")
  1118. },
  1119. constraints: table =>
  1120. {
  1121. table.PrimaryKey("PK_ic_plan", x => x.ic_plan_id);
  1122. },
  1123. comment: "物料采购计划表")
  1124. .Annotation("MySql:CharSet", "utf8mb4");
  1125. migrationBuilder.CreateTable(
  1126. name: "ic_substitute",
  1127. columns: table => new
  1128. {
  1129. substitute_id = table.Column<long>(type: "bigint", nullable: false, comment: "主键")
  1130. .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
  1131. substitute_code = table.Column<string>(type: "varchar(20)", maxLength: 20, nullable: true, comment: "群组代码")
  1132. .Annotation("MySql:CharSet", "utf8mb4"),
  1133. substitute_type = table.Column<int>(type: "int", nullable: false, comment: "替代类型"),
  1134. create_by = table.Column<long>(type: "bigint", nullable: true, comment: "创建人id"),
  1135. create_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "创建人名称")
  1136. .Annotation("MySql:CharSet", "utf8mb4"),
  1137. create_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "创建时间"),
  1138. update_by = table.Column<long>(type: "bigint", nullable: true, comment: "修改人"),
  1139. update_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "修改人名称")
  1140. .Annotation("MySql:CharSet", "utf8mb4"),
  1141. update_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改时间"),
  1142. tenant_id = table.Column<long>(type: "bigint", nullable: false, comment: "企业ID"),
  1143. factory_id = table.Column<long>(type: "bigint", nullable: true, comment: "工厂ID"),
  1144. org_id = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
  1145. IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: false, comment: "删除标识")
  1146. },
  1147. constraints: table =>
  1148. {
  1149. table.PrimaryKey("PK_ic_substitute", x => x.substitute_id);
  1150. },
  1151. comment: "替代群组")
  1152. .Annotation("MySql:CharSet", "utf8mb4");
  1153. migrationBuilder.CreateTable(
  1154. name: "ic_substitute_all",
  1155. columns: table => new
  1156. {
  1157. substitute_allid = table.Column<long>(type: "bigint", nullable: false, comment: "主键")
  1158. .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
  1159. substitute_id = table.Column<long>(type: "bigint", nullable: false, comment: "群组主键"),
  1160. substitute_code = table.Column<string>(type: "varchar(20)", maxLength: 20, nullable: true, comment: "群组代码")
  1161. .Annotation("MySql:CharSet", "utf8mb4"),
  1162. replace_relation = table.Column<string>(type: "varchar(2000)", maxLength: 2000, nullable: true, comment: "替代关系")
  1163. .Annotation("MySql:CharSet", "utf8mb4"),
  1164. replace_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "替代名称")
  1165. .Annotation("MySql:CharSet", "utf8mb4"),
  1166. replace_way = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "替代方式")
  1167. .Annotation("MySql:CharSet", "utf8mb4"),
  1168. product_line = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "产品线")
  1169. .Annotation("MySql:CharSet", "utf8mb4"),
  1170. use_model = table.Column<string>(type: "varchar(5000)", maxLength: 5000, nullable: true, comment: "使用机型")
  1171. .Annotation("MySql:CharSet", "utf8mb4"),
  1172. order_num = table.Column<int>(type: "int", nullable: false, comment: "排序"),
  1173. create_by = table.Column<long>(type: "bigint", nullable: true, comment: "创建人id"),
  1174. create_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "创建人名称")
  1175. .Annotation("MySql:CharSet", "utf8mb4"),
  1176. create_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "创建时间"),
  1177. update_by = table.Column<long>(type: "bigint", nullable: true, comment: "修改人"),
  1178. update_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "修改人名称")
  1179. .Annotation("MySql:CharSet", "utf8mb4"),
  1180. update_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改时间"),
  1181. tenant_id = table.Column<long>(type: "bigint", nullable: false, comment: "企业ID"),
  1182. factory_id = table.Column<long>(type: "bigint", nullable: true, comment: "工厂ID"),
  1183. org_id = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
  1184. IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: false, comment: "删除标识")
  1185. },
  1186. constraints: table =>
  1187. {
  1188. table.PrimaryKey("PK_ic_substitute_all", x => x.substitute_allid);
  1189. },
  1190. comment: "物料替代多群组")
  1191. .Annotation("MySql:CharSet", "utf8mb4");
  1192. migrationBuilder.CreateTable(
  1193. name: "ic_substitute_all_dtl",
  1194. columns: table => new
  1195. {
  1196. substitute_dtlid = table.Column<long>(type: "bigint", nullable: false, comment: "主键")
  1197. .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
  1198. substitute_allid = table.Column<long>(type: "bigint", nullable: false, comment: "替代多群组主键"),
  1199. substitute_code = table.Column<string>(type: "varchar(20)", maxLength: 20, nullable: true, comment: "群组代码")
  1200. .Annotation("MySql:CharSet", "utf8mb4"),
  1201. icitem_id = table.Column<long>(type: "bigint", nullable: false, comment: "物料主键"),
  1202. ismain = table.Column<int>(type: "int", nullable: false, comment: "主/替"),
  1203. use_amount = table.Column<decimal>(type: "decimal(20,8)", precision: 20, scale: 8, nullable: true, comment: "使用数量"),
  1204. replace_amount = table.Column<decimal>(type: "decimal(20,8)", precision: 20, scale: 8, nullable: true, comment: "替代数量"),
  1205. create_by = table.Column<long>(type: "bigint", nullable: true, comment: "创建人id"),
  1206. create_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "创建人名称")
  1207. .Annotation("MySql:CharSet", "utf8mb4"),
  1208. create_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "创建时间"),
  1209. update_by = table.Column<long>(type: "bigint", nullable: true, comment: "修改人"),
  1210. update_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "修改人名称")
  1211. .Annotation("MySql:CharSet", "utf8mb4"),
  1212. update_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改时间"),
  1213. tenant_id = table.Column<long>(type: "bigint", nullable: false, comment: "企业ID"),
  1214. factory_id = table.Column<long>(type: "bigint", nullable: true, comment: "工厂ID"),
  1215. org_id = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
  1216. IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: false, comment: "删除标识")
  1217. },
  1218. constraints: table =>
  1219. {
  1220. table.PrimaryKey("PK_ic_substitute_all_dtl", x => x.substitute_dtlid);
  1221. },
  1222. comment: "物料替代多群组明细")
  1223. .Annotation("MySql:CharSet", "utf8mb4");
  1224. migrationBuilder.CreateTable(
  1225. name: "mes_loss_time_record",
  1226. columns: table => new
  1227. {
  1228. loss_time_record_id = table.Column<long>(type: "bigint", nullable: false, comment: "主键ID")
  1229. .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
  1230. morder_id = table.Column<long>(type: "bigint", nullable: false, comment: "工单id"),
  1231. morder_no = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false, comment: "工单编号")
  1232. .Annotation("MySql:CharSet", "utf8mb4"),
  1233. start_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "损失开始时间"),
  1234. end_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "损失结束时间"),
  1235. product_org = table.Column<long>(type: "bigint", nullable: false, comment: "生产车间"),
  1236. product_line = table.Column<long>(type: "bigint", nullable: false, comment: "生产产线"),
  1237. record_time = table.Column<DateTime>(type: "datetime", nullable: false, comment: "记录时间"),
  1238. record_id = table.Column<long>(type: "bigint", nullable: false, comment: "记录人id"),
  1239. record_no = table.Column<string>(type: "longtext", nullable: false, comment: "记录人工号")
  1240. .Annotation("MySql:CharSet", "utf8mb4"),
  1241. isstop = table.Column<int>(type: "int", nullable: false, comment: "是否停线"),
  1242. cause = table.Column<string>(type: "varchar(500)", maxLength: 500, nullable: true, comment: "原因")
  1243. .Annotation("MySql:CharSet", "utf8mb4"),
  1244. desc = table.Column<string>(type: "varchar(500)", maxLength: 500, nullable: true, comment: "问题描述")
  1245. .Annotation("MySql:CharSet", "utf8mb4"),
  1246. create_by = table.Column<long>(type: "bigint", nullable: true, comment: "创建人id"),
  1247. create_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "创建人名称")
  1248. .Annotation("MySql:CharSet", "utf8mb4"),
  1249. create_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "创建时间"),
  1250. update_by = table.Column<long>(type: "bigint", nullable: true, comment: "修改人"),
  1251. update_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "修改人名称")
  1252. .Annotation("MySql:CharSet", "utf8mb4"),
  1253. update_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改时间"),
  1254. tenant_id = table.Column<long>(type: "bigint", nullable: false, comment: "企业ID"),
  1255. factory_id = table.Column<long>(type: "bigint", nullable: true, comment: "工厂ID"),
  1256. org_id = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
  1257. IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: false, comment: "删除标识")
  1258. },
  1259. constraints: table =>
  1260. {
  1261. table.PrimaryKey("PK_mes_loss_time_record", x => x.loss_time_record_id);
  1262. },
  1263. comment: "损失时间记录表")
  1264. .Annotation("MySql:CharSet", "utf8mb4");
  1265. migrationBuilder.CreateTable(
  1266. name: "mes_meaction",
  1267. columns: table => new
  1268. {
  1269. meaction_id = table.Column<long>(type: "bigint", nullable: false, comment: "生产动作Id")
  1270. .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
  1271. morder_id = table.Column<long>(type: "bigint", nullable: false, comment: "生产工单id"),
  1272. morder_no = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false, comment: "生产工单号")
  1273. .Annotation("MySql:CharSet", "utf8mb4"),
  1274. oprtime = table.Column<DateTime>(type: "datetime", nullable: true, comment: "操作时间"),
  1275. oprtype = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "操作类型")
  1276. .Annotation("MySql:CharSet", "utf8mb4"),
  1277. oprby = table.Column<long>(type: "bigint", nullable: true, comment: "操作人id"),
  1278. oprbyname = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "操作人名称")
  1279. .Annotation("MySql:CharSet", "utf8mb4"),
  1280. oprbyno = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: true, comment: "操作人工号")
  1281. .Annotation("MySql:CharSet", "utf8mb4"),
  1282. create_by = table.Column<long>(type: "bigint", nullable: true, comment: "创建人id"),
  1283. create_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "创建人名称")
  1284. .Annotation("MySql:CharSet", "utf8mb4"),
  1285. create_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "创建时间"),
  1286. update_by = table.Column<long>(type: "bigint", nullable: true, comment: "修改人"),
  1287. update_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "修改人名称")
  1288. .Annotation("MySql:CharSet", "utf8mb4"),
  1289. update_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改时间"),
  1290. tenant_id = table.Column<long>(type: "bigint", nullable: false, comment: "企业ID"),
  1291. factory_id = table.Column<long>(type: "bigint", nullable: true, comment: "工厂ID"),
  1292. org_id = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
  1293. IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: false, comment: "删除标识")
  1294. },
  1295. constraints: table =>
  1296. {
  1297. table.PrimaryKey("PK_mes_meaction", x => x.meaction_id);
  1298. },
  1299. comment: "生产动作表")
  1300. .Annotation("MySql:CharSet", "utf8mb4");
  1301. migrationBuilder.CreateTable(
  1302. name: "mes_mebycard",
  1303. columns: table => new
  1304. {
  1305. mebycard_id = table.Column<long>(type: "bigint", nullable: false, comment: "刷卡id")
  1306. .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
  1307. mebycard_moid = table.Column<long>(type: "bigint", nullable: false, comment: "生产工单号id"),
  1308. mebycard_mono = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false, comment: "生产工单号")
  1309. .Annotation("MySql:CharSet", "utf8mb4"),
  1310. mebycard_pid = table.Column<long>(type: "bigint", nullable: false, comment: "工序id"),
  1311. mebycard_pno = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: false, comment: "工序编码")
  1312. .Annotation("MySql:CharSet", "utf8mb4"),
  1313. mebycard_pname = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: false, comment: "工序名称")
  1314. .Annotation("MySql:CharSet", "utf8mb4"),
  1315. mebycard_byno = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: false, comment: "刷卡人员卡号")
  1316. .Annotation("MySql:CharSet", "utf8mb4"),
  1317. mebycard_time = table.Column<DateTime>(type: "datetime", nullable: false, comment: "刷卡时间"),
  1318. create_by = table.Column<long>(type: "bigint", nullable: true, comment: "创建人id"),
  1319. create_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "创建人名称")
  1320. .Annotation("MySql:CharSet", "utf8mb4"),
  1321. create_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "创建时间"),
  1322. update_by = table.Column<long>(type: "bigint", nullable: true, comment: "修改人"),
  1323. update_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "修改人名称")
  1324. .Annotation("MySql:CharSet", "utf8mb4"),
  1325. update_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改时间"),
  1326. tenant_id = table.Column<long>(type: "bigint", nullable: false, comment: "企业ID"),
  1327. factory_id = table.Column<long>(type: "bigint", nullable: true, comment: "工厂ID"),
  1328. org_id = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
  1329. IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: false, comment: "删除标识")
  1330. },
  1331. constraints: table =>
  1332. {
  1333. table.PrimaryKey("PK_mes_mebycard", x => x.mebycard_id);
  1334. },
  1335. comment: "产线刷卡记录")
  1336. .Annotation("MySql:CharSet", "utf8mb4");
  1337. migrationBuilder.CreateTable(
  1338. name: "mes_merecheck",
  1339. columns: table => new
  1340. {
  1341. merecheck_id = table.Column<long>(type: "bigint", nullable: false, comment: "生产报检记录Id")
  1342. .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
  1343. morder_id = table.Column<long>(type: "bigint", nullable: false, comment: "生产工单id"),
  1344. morder_no = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false, comment: "生产工单号")
  1345. .Annotation("MySql:CharSet", "utf8mb4"),
  1346. qty = table.Column<decimal>(type: "decimal(20,10)", precision: 20, scale: 10, nullable: false, comment: "报检数量"),
  1347. oprtime = table.Column<DateTime>(type: "datetime", nullable: false, comment: "报检时间"),
  1348. oprby = table.Column<long>(type: "bigint", nullable: false, comment: "报检人id"),
  1349. create_by = table.Column<long>(type: "bigint", nullable: true, comment: "创建人id"),
  1350. create_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "创建人名称")
  1351. .Annotation("MySql:CharSet", "utf8mb4"),
  1352. create_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "创建时间"),
  1353. update_by = table.Column<long>(type: "bigint", nullable: true, comment: "修改人"),
  1354. update_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "修改人名称")
  1355. .Annotation("MySql:CharSet", "utf8mb4"),
  1356. update_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改时间"),
  1357. tenant_id = table.Column<long>(type: "bigint", nullable: false, comment: "企业ID"),
  1358. factory_id = table.Column<long>(type: "bigint", nullable: true, comment: "工厂ID"),
  1359. org_id = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
  1360. IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: false, comment: "删除标识")
  1361. },
  1362. constraints: table =>
  1363. {
  1364. table.PrimaryKey("PK_mes_merecheck", x => x.merecheck_id);
  1365. },
  1366. comment: "生产报检记录")
  1367. .Annotation("MySql:CharSet", "utf8mb4");
  1368. migrationBuilder.CreateTable(
  1369. name: "mes_mereport",
  1370. columns: table => new
  1371. {
  1372. mereport_id = table.Column<long>(type: "bigint", nullable: false, comment: "生产报工记录Id")
  1373. .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
  1374. morder_id = table.Column<long>(type: "bigint", nullable: false, comment: "生产工单id"),
  1375. morder_no = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false, comment: "生产工单号")
  1376. .Annotation("MySql:CharSet", "utf8mb4"),
  1377. qty = table.Column<decimal>(type: "decimal(20,10)", precision: 20, scale: 10, nullable: false, comment: "报工数量"),
  1378. report_time = table.Column<DateTime>(type: "datetime", nullable: false, comment: "报工时间"),
  1379. report_by = table.Column<long>(type: "bigint", nullable: false, comment: "报工人id"),
  1380. report_byno = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false, comment: "报工人工号")
  1381. .Annotation("MySql:CharSet", "utf8mb4"),
  1382. instock_qty = table.Column<decimal>(type: "decimal(20,10)", precision: 20, scale: 10, nullable: false, comment: "报工数量"),
  1383. create_by = table.Column<long>(type: "bigint", nullable: true, comment: "创建人id"),
  1384. create_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "创建人名称")
  1385. .Annotation("MySql:CharSet", "utf8mb4"),
  1386. create_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "创建时间"),
  1387. update_by = table.Column<long>(type: "bigint", nullable: true, comment: "修改人"),
  1388. update_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "修改人名称")
  1389. .Annotation("MySql:CharSet", "utf8mb4"),
  1390. update_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改时间"),
  1391. tenant_id = table.Column<long>(type: "bigint", nullable: false, comment: "企业ID"),
  1392. factory_id = table.Column<long>(type: "bigint", nullable: true, comment: "工厂ID"),
  1393. org_id = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
  1394. IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: false, comment: "删除标识")
  1395. },
  1396. constraints: table =>
  1397. {
  1398. table.PrimaryKey("PK_mes_mereport", x => x.mereport_id);
  1399. },
  1400. comment: "生产报工记录")
  1401. .Annotation("MySql:CharSet", "utf8mb4");
  1402. migrationBuilder.CreateTable(
  1403. name: "mes_moentry",
  1404. columns: table => new
  1405. {
  1406. moentry_id = table.Column<long>(type: "bigint", nullable: false, comment: "生产工单子表id")
  1407. .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
  1408. moentry_moid = table.Column<long>(type: "bigint", nullable: false, comment: "工单主表id"),
  1409. moentry_mono = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: false, comment: "工单编号")
  1410. .Annotation("MySql:CharSet", "utf8mb4"),
  1411. soentry_id = table.Column<long>(type: "bigint", nullable: false, comment: "订单行id"),
  1412. fentry_id = table.Column<long>(type: "bigint", nullable: false, comment: "订单行号"),
  1413. fbill_no = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: false, comment: "订单编号")
  1414. .Annotation("MySql:CharSet", "utf8mb4"),
  1415. unit = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: false, comment: "单位")
  1416. .Annotation("MySql:CharSet", "utf8mb4"),
  1417. morder_production_number = table.Column<decimal>(type: "decimal(20,8)", precision: 20, scale: 8, nullable: true, comment: "工单生产数量(计划数量)"),
  1418. need_number = table.Column<decimal>(type: "decimal(20,8)", precision: 20, scale: 8, nullable: true, comment: "需求数量"),
  1419. remaining_number = table.Column<decimal>(type: "decimal(20,8)", precision: 20, scale: 8, nullable: true, comment: "剩余可用数量"),
  1420. create_by = table.Column<long>(type: "bigint", nullable: true, comment: "创建人id"),
  1421. create_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "创建人名称")
  1422. .Annotation("MySql:CharSet", "utf8mb4"),
  1423. create_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "创建时间"),
  1424. update_by = table.Column<long>(type: "bigint", nullable: true, comment: "修改人"),
  1425. update_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "修改人名称")
  1426. .Annotation("MySql:CharSet", "utf8mb4"),
  1427. update_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改时间"),
  1428. tenant_id = table.Column<long>(type: "bigint", nullable: false, comment: "企业ID"),
  1429. factory_id = table.Column<long>(type: "bigint", nullable: true, comment: "工厂ID"),
  1430. org_id = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
  1431. IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: false, comment: "删除标识")
  1432. },
  1433. constraints: table =>
  1434. {
  1435. table.PrimaryKey("PK_mes_moentry", x => x.moentry_id);
  1436. },
  1437. comment: "生成工单子表")
  1438. .Annotation("MySql:CharSet", "utf8mb4");
  1439. migrationBuilder.CreateTable(
  1440. name: "mes_mooccupy",
  1441. columns: table => new
  1442. {
  1443. moo_id = table.Column<long>(type: "bigint", nullable: false, comment: "工单占用ID")
  1444. .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
  1445. moo_id_type = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false, comment: "类型--原始,分配")
  1446. .Annotation("MySql:CharSet", "utf8mb4"),
  1447. moo_id_billid = table.Column<long>(type: "bigint", nullable: false, comment: "订单id"),
  1448. fbill_no = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false, comment: "订单号")
  1449. .Annotation("MySql:CharSet", "utf8mb4"),
  1450. fentry_id = table.Column<long>(type: "bigint", nullable: false, comment: "行号"),
  1451. fitem_number = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false, comment: "物料编码")
  1452. .Annotation("MySql:CharSet", "utf8mb4"),
  1453. fitem_name = table.Column<string>(type: "varchar(500)", maxLength: 500, nullable: false, comment: "物料名称")
  1454. .Annotation("MySql:CharSet", "utf8mb4"),
  1455. fmodel = table.Column<string>(type: "varchar(500)", maxLength: 500, nullable: false, comment: "规格型号")
  1456. .Annotation("MySql:CharSet", "utf8mb4"),
  1457. moo_moid = table.Column<long>(type: "bigint", nullable: false, comment: "工单id"),
  1458. moo_mo = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false, comment: "工单号")
  1459. .Annotation("MySql:CharSet", "utf8mb4"),
  1460. moo_qty = table.Column<decimal>(type: "decimal(20,8)", precision: 20, scale: 8, nullable: true, comment: "占用量"),
  1461. moo_stime = table.Column<DateTime>(type: "datetime", nullable: true, comment: "开始时间"),
  1462. moo_etime = table.Column<DateTime>(type: "datetime", nullable: true, comment: "结束时间"),
  1463. moo_state = table.Column<int>(type: "int", nullable: false, comment: "占用状态-1占用 默认0"),
  1464. moo_cbr = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "变更人")
  1465. .Annotation("MySql:CharSet", "utf8mb4"),
  1466. moo_ctime = table.Column<DateTime>(type: "datetime", nullable: true, comment: "变更时间"),
  1467. moo_creason = table.Column<string>(type: "varchar(500)", maxLength: 500, nullable: true, comment: "变更原因")
  1468. .Annotation("MySql:CharSet", "utf8mb4"),
  1469. create_by = table.Column<long>(type: "bigint", nullable: true, comment: "创建人id"),
  1470. create_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "创建人名称")
  1471. .Annotation("MySql:CharSet", "utf8mb4"),
  1472. create_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "创建时间"),
  1473. update_by = table.Column<long>(type: "bigint", nullable: true, comment: "修改人"),
  1474. update_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "修改人名称")
  1475. .Annotation("MySql:CharSet", "utf8mb4"),
  1476. update_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改时间"),
  1477. tenant_id = table.Column<long>(type: "bigint", nullable: false, comment: "企业ID"),
  1478. factory_id = table.Column<long>(type: "bigint", nullable: true, comment: "工厂ID"),
  1479. org_id = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
  1480. IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: false, comment: "删除标识")
  1481. },
  1482. constraints: table =>
  1483. {
  1484. table.PrimaryKey("PK_mes_mooccupy", x => x.moo_id);
  1485. },
  1486. comment: "在制工单占用记录表")
  1487. .Annotation("MySql:CharSet", "utf8mb4");
  1488. migrationBuilder.CreateTable(
  1489. name: "mes_morder",
  1490. columns: table => new
  1491. {
  1492. morder_id = table.Column<long>(type: "bigint", nullable: false, comment: "生产工单id")
  1493. .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
  1494. parent_id = table.Column<long>(type: "bigint", nullable: true, comment: "上级工单id"),
  1495. relation_moid = table.Column<long>(type: "bigint", nullable: true, comment: "关联工单id"),
  1496. relation_mono = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "关联编号")
  1497. .Annotation("MySql:CharSet", "utf8mb4"),
  1498. morder_no = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false, comment: "生产工单编号")
  1499. .Annotation("MySql:CharSet", "utf8mb4"),
  1500. morder_type = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "生产工单类型(类型:计划工单、销售工单、委外工单、预测工单)")
  1501. .Annotation("MySql:CharSet", "utf8mb4"),
  1502. morder_icitem_type = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: true, comment: "工单所属物料类型")
  1503. .Annotation("MySql:CharSet", "utf8mb4"),
  1504. work_order_type = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: true, comment: "工单类型(类型:发货工单、试产工单、备库工单、常规工单、返工工单)")
  1505. .Annotation("MySql:CharSet", "utf8mb4"),
  1506. morder_date = table.Column<DateTime>(type: "datetime", nullable: true, comment: "生产工单日期"),
  1507. morder_state = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "生产工单状态(订单状态:初始,下达,暂停、完成)")
  1508. .Annotation("MySql:CharSet", "utf8mb4"),
  1509. moentry_prd = table.Column<long>(type: "bigint", nullable: true, comment: "生产组织id"),
  1510. moentry_prdname = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "生产组织名称")
  1511. .Annotation("MySql:CharSet", "utf8mb4"),
  1512. moentry_wrkc = table.Column<long>(type: "bigint", nullable: true, comment: "工作中心id"),
  1513. moentry_wrkcname = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "工作中心名称")
  1514. .Annotation("MySql:CharSet", "utf8mb4"),
  1515. planner_num = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "计划员工号")
  1516. .Annotation("MySql:CharSet", "utf8mb4"),
  1517. planner_name = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "计划员名称")
  1518. .Annotation("MySql:CharSet", "utf8mb4"),
  1519. moentry_stime = table.Column<DateTime>(type: "datetime", nullable: true, comment: "生产工单开始日期"),
  1520. moentry_etime = table.Column<DateTime>(type: "datetime", nullable: true, comment: "生产工单结束日期"),
  1521. moentry_sys_stime = table.Column<DateTime>(type: "datetime", nullable: true, comment: "系统建议开工时间"),
  1522. moentry_sys_etime = table.Column<DateTime>(type: "datetime", nullable: true, comment: "系统建议完工时间"),
  1523. reality_start_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "实际开始时间"),
  1524. reality_end_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "实际结束时间"),
  1525. planner_start_date = table.Column<DateTime>(type: "datetime", nullable: true, comment: "计划员设定开始时间"),
  1526. planner_end_date = table.Column<DateTime>(type: "datetime", nullable: true, comment: "计划员设定结束时间"),
  1527. mat_start_date = table.Column<DateTime>(type: "datetime", nullable: true, comment: "基于物料开始时间"),
  1528. mat_end_date = table.Column<DateTime>(type: "datetime", nullable: true, comment: "基于物料结束时间"),
  1529. product_code = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "产品代码")
  1530. .Annotation("MySql:CharSet", "utf8mb4"),
  1531. product_name = table.Column<string>(type: "varchar(500)", maxLength: 500, nullable: true, comment: "产品名称")
  1532. .Annotation("MySql:CharSet", "utf8mb4"),
  1533. fms_number = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "fms旧料号")
  1534. .Annotation("MySql:CharSet", "utf8mb4"),
  1535. fmodel = table.Column<string>(type: "varchar(500)", maxLength: 500, nullable: true, comment: "规格型号")
  1536. .Annotation("MySql:CharSet", "utf8mb4"),
  1537. bom_number = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "bom编码")
  1538. .Annotation("MySql:CharSet", "utf8mb4"),
  1539. morder_progress = table.Column<string>(type: "varchar(1000)", maxLength: 1000, nullable: true, comment: "工单进度")
  1540. .Annotation("MySql:CharSet", "utf8mb4"),
  1541. morder_need_time = table.Column<decimal>(type: "decimal(20,8)", precision: 20, scale: 8, nullable: true, comment: "工单所需工时"),
  1542. work_number = table.Column<decimal>(type: "decimal(20,8)", precision: 20, scale: 8, nullable: true, comment: "报工数量"),
  1543. inspection_number = table.Column<decimal>(type: "decimal(20,8)", precision: 20, scale: 8, nullable: true, comment: "报检数量"),
  1544. qualified_number = table.Column<decimal>(type: "decimal(20,8)", precision: 20, scale: 8, nullable: true, comment: "合格数量"),
  1545. inventory_number = table.Column<decimal>(type: "decimal(20,8)", precision: 20, scale: 8, nullable: true, comment: "入库数量"),
  1546. notice_qty = table.Column<decimal>(type: "decimal(20,8)", precision: 20, scale: 8, nullable: true, comment: "已开入库通知单数量"),
  1547. moentry_startup_status = table.Column<int>(type: "int", nullable: true, comment: "启动状态"),
  1548. start_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "开始时间"),
  1549. pause_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "最近暂停时间"),
  1550. restart_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "最近重启时间"),
  1551. project_name = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: true, comment: "项目名称")
  1552. .Annotation("MySql:CharSet", "utf8mb4"),
  1553. overdue_Remark = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: true, comment: "逾期原因备注")
  1554. .Annotation("MySql:CharSet", "utf8mb4"),
  1555. picking_qty = table.Column<decimal>(type: "decimal(20,8)", precision: 20, scale: 8, nullable: true, comment: "已领料数量"),
  1556. morder_fstate = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "前状态--计划、下达、完成、关闭")
  1557. .Annotation("MySql:CharSet", "utf8mb4"),
  1558. morder_batchno = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: true, comment: "工单批号--(批号管理的物料出入库要使用)")
  1559. .Annotation("MySql:CharSet", "utf8mb4"),
  1560. convey_date = table.Column<DateTime>(type: "datetime", nullable: true, comment: "下达日期"),
  1561. create_by = table.Column<long>(type: "bigint", nullable: true, comment: "创建人id"),
  1562. create_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "创建人名称")
  1563. .Annotation("MySql:CharSet", "utf8mb4"),
  1564. create_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "创建时间"),
  1565. update_by = table.Column<long>(type: "bigint", nullable: true, comment: "修改人"),
  1566. update_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "修改人名称")
  1567. .Annotation("MySql:CharSet", "utf8mb4"),
  1568. update_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改时间"),
  1569. tenant_id = table.Column<long>(type: "bigint", nullable: false, comment: "企业ID"),
  1570. factory_id = table.Column<long>(type: "bigint", nullable: true, comment: "工厂ID"),
  1571. org_id = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
  1572. IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: false, comment: "删除标识")
  1573. },
  1574. constraints: table =>
  1575. {
  1576. table.PrimaryKey("PK_mes_morder", x => x.morder_id);
  1577. },
  1578. comment: "工单主表")
  1579. .Annotation("MySql:CharSet", "utf8mb4");
  1580. migrationBuilder.CreateTable(
  1581. name: "mes_morder_loss_time",
  1582. columns: table => new
  1583. {
  1584. id = table.Column<long>(type: "bigint", nullable: false, comment: "工单损失时间主键")
  1585. .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
  1586. morder_id = table.Column<long>(type: "bigint", nullable: false, comment: "生产工单id"),
  1587. morder_no = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false, comment: "生产工单编号")
  1588. .Annotation("MySql:CharSet", "utf8mb4"),
  1589. morder_no_row = table.Column<int>(type: "int", nullable: false, comment: "生产工单编号"),
  1590. start_time = table.Column<DateTime>(type: "datetime", nullable: false, comment: "损失开始时间"),
  1591. end_time = table.Column<DateTime>(type: "datetime", nullable: false, comment: "损失结束时间"),
  1592. recorder_id = table.Column<long>(type: "bigint", nullable: false, comment: "记录人id"),
  1593. recorder_name = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: false, comment: "记录人名称")
  1594. .Annotation("MySql:CharSet", "utf8mb4"),
  1595. staff_qty = table.Column<decimal>(type: "decimal(20,8)", precision: 20, scale: 8, nullable: false, comment: "人员数量"),
  1596. loss_work_hours = table.Column<decimal>(type: "decimal(20,8)", precision: 20, scale: 8, nullable: false, comment: "损失时间(用户输入)"),
  1597. sys_loss_time = table.Column<decimal>(type: "decimal(20,8)", precision: 20, scale: 8, nullable: false, comment: "系统计算损失时间"),
  1598. workc_id = table.Column<long>(type: "bigint", nullable: false, comment: "工作中心id"),
  1599. workc_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false, comment: "工作中心名称")
  1600. .Annotation("MySql:CharSet", "utf8mb4"),
  1601. dept_id = table.Column<long>(type: "bigint", nullable: false, comment: "责任单位id"),
  1602. dept_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false, comment: "责任单位名称")
  1603. .Annotation("MySql:CharSet", "utf8mb4"),
  1604. reason = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: false, comment: "损失时间原因")
  1605. .Annotation("MySql:CharSet", "utf8mb4"),
  1606. description = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: true, comment: "描述")
  1607. .Annotation("MySql:CharSet", "utf8mb4"),
  1608. is_stop_production = table.Column<int>(type: "int", nullable: false, comment: "是否停产(0未停产,1停产)"),
  1609. card_no = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "用工卡号")
  1610. .Annotation("MySql:CharSet", "utf8mb4"),
  1611. create_by = table.Column<long>(type: "bigint", nullable: true, comment: "创建人id"),
  1612. create_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "创建人名称")
  1613. .Annotation("MySql:CharSet", "utf8mb4"),
  1614. create_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "创建时间"),
  1615. update_by = table.Column<long>(type: "bigint", nullable: true, comment: "修改人"),
  1616. update_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "修改人名称")
  1617. .Annotation("MySql:CharSet", "utf8mb4"),
  1618. update_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改时间"),
  1619. tenant_id = table.Column<long>(type: "bigint", nullable: false, comment: "企业ID"),
  1620. factory_id = table.Column<long>(type: "bigint", nullable: true, comment: "工厂ID"),
  1621. org_id = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
  1622. IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: false, comment: "删除标识")
  1623. },
  1624. constraints: table =>
  1625. {
  1626. table.PrimaryKey("PK_mes_morder_loss_time", x => x.id);
  1627. },
  1628. comment: "工单损失时间表")
  1629. .Annotation("MySql:CharSet", "utf8mb4");
  1630. migrationBuilder.CreateTable(
  1631. name: "mes_oorder",
  1632. columns: table => new
  1633. {
  1634. oorder_id = table.Column<long>(type: "bigint", nullable: false, comment: "委外订单id")
  1635. .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
  1636. oorder_no = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "生产工单编号")
  1637. .Annotation("MySql:CharSet", "utf8mb4"),
  1638. oorder_type = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "生产工单类型")
  1639. .Annotation("MySql:CharSet", "utf8mb4"),
  1640. oorder_date = table.Column<DateTime>(type: "datetime", nullable: true, comment: "委外订单日期"),
  1641. oorder_state = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "订单状态")
  1642. .Annotation("MySql:CharSet", "utf8mb4"),
  1643. ooentry_prd = table.Column<long>(type: "bigint", nullable: true, comment: "生产组织"),
  1644. ooentry_prdname = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "生产组织名称")
  1645. .Annotation("MySql:CharSet", "utf8mb4"),
  1646. ooentry_wrkc = table.Column<long>(type: "bigint", nullable: true, comment: "工作中心id"),
  1647. ooentry_wrkcname = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "工作中心名称")
  1648. .Annotation("MySql:CharSet", "utf8mb4"),
  1649. planner_num = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "计划员工号")
  1650. .Annotation("MySql:CharSet", "utf8mb4"),
  1651. planner_name = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "计划员名称")
  1652. .Annotation("MySql:CharSet", "utf8mb4"),
  1653. ooentry_stime = table.Column<DateTime>(type: "datetime", nullable: true, comment: "计划开工日期"),
  1654. ooentry_etime = table.Column<DateTime>(type: "datetime", nullable: true, comment: "计划完工日期"),
  1655. product_code = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "产品代码")
  1656. .Annotation("MySql:CharSet", "utf8mb4"),
  1657. ffms_number = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "fms旧料号")
  1658. .Annotation("MySql:CharSet", "utf8mb4"),
  1659. product_name = table.Column<string>(type: "varchar(500)", maxLength: 500, nullable: true, comment: "产品名称")
  1660. .Annotation("MySql:CharSet", "utf8mb4"),
  1661. specification_model = table.Column<string>(type: "varchar(500)", maxLength: 500, nullable: true, comment: "规格型号")
  1662. .Annotation("MySql:CharSet", "utf8mb4"),
  1663. bom_number = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "bom编码")
  1664. .Annotation("MySql:CharSet", "utf8mb4"),
  1665. unit = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "单位")
  1666. .Annotation("MySql:CharSet", "utf8mb4"),
  1667. morder_progress = table.Column<string>(type: "varchar(500)", maxLength: 500, nullable: true, comment: "工单进度")
  1668. .Annotation("MySql:CharSet", "utf8mb4"),
  1669. morder_production_number = table.Column<decimal>(type: "decimal(20,10)", precision: 20, scale: 10, nullable: true, comment: "工单生产数量(计划数量)"),
  1670. need_number = table.Column<decimal>(type: "decimal(20,10)", precision: 20, scale: 10, nullable: true, comment: "需求数量"),
  1671. remaining_number = table.Column<decimal>(type: "decimal(20,10)", precision: 20, scale: 10, nullable: true, comment: "剩余可用数量"),
  1672. work_number = table.Column<decimal>(type: "decimal(20,8)", precision: 20, scale: 8, nullable: true, comment: "报工数量"),
  1673. inspection_number = table.Column<decimal>(type: "decimal(20,8)", precision: 20, scale: 8, nullable: true, comment: "报检数量"),
  1674. qualified_number = table.Column<decimal>(type: "decimal(20,8)", precision: 20, scale: 8, nullable: true, comment: "合格数量"),
  1675. inventory_number = table.Column<decimal>(type: "decimal(20,8)", precision: 20, scale: 8, nullable: true, comment: "入库数量"),
  1676. notice_qty = table.Column<decimal>(type: "decimal(20,8)", precision: 20, scale: 8, nullable: true, comment: "已开通知单数量"),
  1677. moentry_on = table.Column<int>(type: "int", nullable: true, comment: "启动状态"),
  1678. start_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "开始时间"),
  1679. pause_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "最近暂停时间"),
  1680. restart_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "最近重启时间"),
  1681. project_name = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: true, comment: "项目名称")
  1682. .Annotation("MySql:CharSet", "utf8mb4"),
  1683. sent_status = table.Column<int>(type: "int", nullable: true, comment: "发料状态 1-待发料 2-已发料"),
  1684. production_unit = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: true, comment: "加工单位")
  1685. .Annotation("MySql:CharSet", "utf8mb4"),
  1686. production_unit_code = table.Column<string>(type: "varchar(20)", maxLength: 20, nullable: true, comment: "加工单位编码")
  1687. .Annotation("MySql:CharSet", "utf8mb4"),
  1688. need_icitem_status = table.Column<int>(type: "int", nullable: true, comment: "加工单位编码"),
  1689. create_by = table.Column<long>(type: "bigint", nullable: true, comment: "创建人id"),
  1690. create_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "创建人名称")
  1691. .Annotation("MySql:CharSet", "utf8mb4"),
  1692. create_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "创建时间"),
  1693. update_by = table.Column<long>(type: "bigint", nullable: true, comment: "修改人"),
  1694. update_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "修改人名称")
  1695. .Annotation("MySql:CharSet", "utf8mb4"),
  1696. update_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改时间"),
  1697. tenant_id = table.Column<long>(type: "bigint", nullable: false, comment: "企业ID"),
  1698. factory_id = table.Column<long>(type: "bigint", nullable: true, comment: "工厂ID"),
  1699. org_id = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
  1700. IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: false, comment: "删除标识")
  1701. },
  1702. constraints: table =>
  1703. {
  1704. table.PrimaryKey("PK_mes_oorder", x => x.oorder_id);
  1705. },
  1706. comment: "委外订单表")
  1707. .Annotation("MySql:CharSet", "utf8mb4");
  1708. migrationBuilder.CreateTable(
  1709. name: "mes_prd_sendmat",
  1710. columns: table => new
  1711. {
  1712. prdsm_id = table.Column<long>(type: "bigint", nullable: false, comment: "发料单id")
  1713. .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
  1714. prdsm_type = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false, comment: "单据类型 (发料、叫料、补料、退料)")
  1715. .Annotation("MySql:CharSet", "utf8mb4"),
  1716. prdsm_no = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false, comment: "单据编号")
  1717. .Annotation("MySql:CharSet", "utf8mb4"),
  1718. prdsm_date = table.Column<DateTime>(type: "datetime", nullable: false, comment: "单据日期"),
  1719. prdsm_prdid = table.Column<long>(type: "bigint", nullable: false, comment: "生产组织id"),
  1720. prdsm_workcid = table.Column<long>(type: "bigint", nullable: false, comment: "工作中心id"),
  1721. prdsm_moid = table.Column<long>(type: "bigint", nullable: false, comment: "生产工单id"),
  1722. prdsm_mono = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false, comment: "生产工单号")
  1723. .Annotation("MySql:CharSet", "utf8mb4"),
  1724. prdsm_by = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false, comment: "制单人")
  1725. .Annotation("MySql:CharSet", "utf8mb4"),
  1726. prdsm_note = table.Column<string>(type: "varchar(500)", maxLength: 500, nullable: true, comment: "备注")
  1727. .Annotation("MySql:CharSet", "utf8mb4"),
  1728. prdsm_state = table.Column<int>(type: "int", nullable: true, comment: "状态"),
  1729. prdsm_reason = table.Column<string>(type: "varchar(500)", maxLength: 500, nullable: true, comment: "补料理由")
  1730. .Annotation("MySql:CharSet", "utf8mb4"),
  1731. prdsm_qty = table.Column<decimal>(type: "decimal(20,10)", precision: 20, scale: 10, nullable: false, comment: "叫料数量"),
  1732. prdsm_ddate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "配送日期"),
  1733. prdsm_po_no = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: true, comment: "关联委外po单号")
  1734. .Annotation("MySql:CharSet", "utf8mb4"),
  1735. prdsm_po_row = table.Column<int>(type: "int", nullable: true, comment: "关联委外po行号"),
  1736. srcbill_type = table.Column<int>(type: "int", nullable: false, comment: "原单类型"),
  1737. srcbill_state = table.Column<int>(type: "int", nullable: false, comment: "源单状态")
  1738. },
  1739. constraints: table =>
  1740. {
  1741. table.PrimaryKey("PK_mes_prd_sendmat", x => x.prdsm_id);
  1742. },
  1743. comment: "发料单")
  1744. .Annotation("MySql:CharSet", "utf8mb4");
  1745. migrationBuilder.CreateTable(
  1746. name: "mes_prd_sendmat_list",
  1747. columns: table => new
  1748. {
  1749. prdsml_id = table.Column<long>(type: "bigint", nullable: false, comment: "发料单详情id")
  1750. .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
  1751. prdsm_id = table.Column<long>(type: "bigint", nullable: false, comment: "发料单id"),
  1752. prdsml_procno = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "工序编码")
  1753. .Annotation("MySql:CharSet", "utf8mb4"),
  1754. prdsml_procname = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "工序名称")
  1755. .Annotation("MySql:CharSet", "utf8mb4"),
  1756. fitem_number = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: true, comment: "物料编码")
  1757. .Annotation("MySql:CharSet", "utf8mb4"),
  1758. fitem_name = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: true, comment: "物料编码")
  1759. .Annotation("MySql:CharSet", "utf8mb4"),
  1760. fmodel = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: true, comment: "物料编码")
  1761. .Annotation("MySql:CharSet", "utf8mb4"),
  1762. prdsml_qtyper = table.Column<decimal>(type: "decimal(20,10)", precision: 20, scale: 10, nullable: true, comment: "单位数量"),
  1763. prdsml_cqtyper = table.Column<decimal>(type: "decimal(20,10)", precision: 20, scale: 10, nullable: true, comment: "确认单位数量"),
  1764. prdsml_unit = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "计量单位")
  1765. .Annotation("MySql:CharSet", "utf8mb4"),
  1766. prdsml_qtyto = table.Column<decimal>(type: "decimal(20,10)", precision: 20, scale: 10, nullable: true, comment: "应发数量"),
  1767. prdsml_qtyplan = table.Column<decimal>(type: "decimal(20,10)", precision: 20, scale: 10, nullable: true, comment: "计划数量"),
  1768. prdsml_qtyissued = table.Column<decimal>(type: "decimal(20,10)", precision: 20, scale: 10, nullable: false, comment: "已发数量"),
  1769. prdsml_whid = table.Column<long>(type: "bigint", nullable: false, comment: "发料仓库id"),
  1770. prdsml_whno = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "发料仓库编码")
  1771. .Annotation("MySql:CharSet", "utf8mb4"),
  1772. prdsml_whname = table.Column<string>(type: "varchar(500)", maxLength: 500, nullable: true, comment: "发料仓库名称")
  1773. .Annotation("MySql:CharSet", "utf8mb4"),
  1774. prdsm_breason = table.Column<string>(type: "varchar(500)", maxLength: 500, nullable: true, comment: "退料原因")
  1775. .Annotation("MySql:CharSet", "utf8mb4"),
  1776. fbackflush = table.Column<int>(type: "int", nullable: true, comment: "是否倒冲"),
  1777. prsml_row = table.Column<int>(type: "int", nullable: true, comment: "行号"),
  1778. fmateriel_type = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: true, comment: "子项属性")
  1779. .Annotation("MySql:CharSet", "utf8mb4"),
  1780. fisKey_item = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: true, comment: "子项属性")
  1781. .Annotation("MySql:CharSet", "utf8mb4"),
  1782. send_date = table.Column<DateTime>(type: "datetime", nullable: true, comment: "计划发料日期"),
  1783. station = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: false, comment: "工位")
  1784. .Annotation("MySql:CharSet", "utf8mb4"),
  1785. fdiscard_aux_qty = table.Column<decimal>(type: "decimal(20,10)", precision: 20, scale: 10, nullable: true, comment: "报废数量"),
  1786. fqty_supply = table.Column<decimal>(type: "decimal(20,10)", precision: 20, scale: 10, nullable: true, comment: "补料数量"),
  1787. fqty_send_back = table.Column<decimal>(type: "decimal(20,10)", precision: 20, scale: 10, nullable: true, comment: "退料数量"),
  1788. create_by = table.Column<long>(type: "bigint", nullable: true, comment: "创建人id"),
  1789. create_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "创建人名称")
  1790. .Annotation("MySql:CharSet", "utf8mb4"),
  1791. create_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "创建时间"),
  1792. update_by = table.Column<long>(type: "bigint", nullable: true, comment: "修改人"),
  1793. update_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "修改人名称")
  1794. .Annotation("MySql:CharSet", "utf8mb4"),
  1795. update_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改时间"),
  1796. tenant_id = table.Column<long>(type: "bigint", nullable: false, comment: "企业ID"),
  1797. factory_id = table.Column<long>(type: "bigint", nullable: true, comment: "工厂ID"),
  1798. org_id = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
  1799. IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: false, comment: "删除标识")
  1800. },
  1801. constraints: table =>
  1802. {
  1803. table.PrimaryKey("PK_mes_prd_sendmat_list", x => x.prdsml_id);
  1804. },
  1805. comment: "发料单详情")
  1806. .Annotation("MySql:CharSet", "utf8mb4");
  1807. migrationBuilder.CreateTable(
  1808. name: "mes_prdlog",
  1809. columns: table => new
  1810. {
  1811. prdlog_id = table.Column<long>(type: "bigint", nullable: false, comment: "生产操作日志id")
  1812. .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
  1813. prdlog_type = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false, comment: "业务类型")
  1814. .Annotation("MySql:CharSet", "utf8mb4"),
  1815. prdlog_no = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: false, comment: "业务类型")
  1816. .Annotation("MySql:CharSet", "utf8mb4"),
  1817. prdlog_entryid = table.Column<int>(type: "int", nullable: false, comment: "行号"),
  1818. prdlog_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "执行时间"),
  1819. prdlog_by_id = table.Column<long>(type: "bigint", nullable: true, comment: "执行人id"),
  1820. prdlog_by_name = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "执行人姓名")
  1821. .Annotation("MySql:CharSet", "utf8mb4"),
  1822. prdlog_note = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: true, comment: "内容")
  1823. .Annotation("MySql:CharSet", "utf8mb4"),
  1824. create_by = table.Column<long>(type: "bigint", nullable: true, comment: "创建人id"),
  1825. create_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "创建人名称")
  1826. .Annotation("MySql:CharSet", "utf8mb4"),
  1827. create_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "创建时间"),
  1828. update_by = table.Column<long>(type: "bigint", nullable: true, comment: "修改人"),
  1829. update_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "修改人名称")
  1830. .Annotation("MySql:CharSet", "utf8mb4"),
  1831. update_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改时间"),
  1832. tenant_id = table.Column<long>(type: "bigint", nullable: false, comment: "企业ID"),
  1833. factory_id = table.Column<long>(type: "bigint", nullable: true, comment: "工厂ID"),
  1834. org_id = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
  1835. IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: false, comment: "删除标识")
  1836. },
  1837. constraints: table =>
  1838. {
  1839. table.PrimaryKey("PK_mes_prdlog", x => x.prdlog_id);
  1840. },
  1841. comment: "生产操作日志")
  1842. .Annotation("MySql:CharSet", "utf8mb4");
  1843. migrationBuilder.CreateTable(
  1844. name: "mes_process",
  1845. columns: table => new
  1846. {
  1847. proc_id = table.Column<long>(type: "bigint", nullable: false, comment: "工序主键")
  1848. .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
  1849. proc_name = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: false, comment: "工序名称")
  1850. .Annotation("MySql:CharSet", "utf8mb4"),
  1851. short_desc = table.Column<string>(type: "varchar(500)", maxLength: 500, nullable: true, comment: "简述")
  1852. .Annotation("MySql:CharSet", "utf8mb4"),
  1853. long_desc = table.Column<string>(type: "varchar(2000)", maxLength: 2000, nullable: true, comment: "详细描述")
  1854. .Annotation("MySql:CharSet", "utf8mb4"),
  1855. subids = table.Column<string>(type: "varchar(2000)", maxLength: 2000, nullable: true, comment: "组合工序id")
  1856. .Annotation("MySql:CharSet", "utf8mb4"),
  1857. create_by = table.Column<long>(type: "bigint", nullable: true, comment: "创建人id"),
  1858. create_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "创建人名称")
  1859. .Annotation("MySql:CharSet", "utf8mb4"),
  1860. create_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "创建时间"),
  1861. update_by = table.Column<long>(type: "bigint", nullable: true, comment: "修改人"),
  1862. update_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "修改人名称")
  1863. .Annotation("MySql:CharSet", "utf8mb4"),
  1864. update_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改时间"),
  1865. tenant_id = table.Column<long>(type: "bigint", nullable: false, comment: "企业ID"),
  1866. factory_id = table.Column<long>(type: "bigint", nullable: true, comment: "工厂ID"),
  1867. org_id = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
  1868. IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: false, comment: "删除标识")
  1869. },
  1870. constraints: table =>
  1871. {
  1872. table.PrimaryKey("PK_mes_process", x => x.proc_id);
  1873. },
  1874. comment: "工序表")
  1875. .Annotation("MySql:CharSet", "utf8mb4");
  1876. migrationBuilder.CreateTable(
  1877. name: "mes_product_work_time",
  1878. columns: table => new
  1879. {
  1880. id = table.Column<long>(type: "bigint", nullable: false, comment: "生产时间记录id")
  1881. .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
  1882. work_date = table.Column<DateTime>(type: "datetime", nullable: true, comment: "生产时间记录id"),
  1883. start = table.Column<DateTime>(type: "datetime", nullable: true, comment: "开始时间"),
  1884. stop = table.Column<DateTime>(type: "datetime", nullable: true, comment: "结束时间"),
  1885. card_no = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: true, comment: "卡号")
  1886. .Annotation("MySql:CharSet", "utf8mb4"),
  1887. product_line = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: true, comment: "产线")
  1888. .Annotation("MySql:CharSet", "utf8mb4"),
  1889. create_by = table.Column<long>(type: "bigint", nullable: true, comment: "创建人id"),
  1890. create_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "创建人名称")
  1891. .Annotation("MySql:CharSet", "utf8mb4"),
  1892. create_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "创建时间"),
  1893. update_by = table.Column<long>(type: "bigint", nullable: true, comment: "修改人"),
  1894. update_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "修改人名称")
  1895. .Annotation("MySql:CharSet", "utf8mb4"),
  1896. update_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改时间"),
  1897. tenant_id = table.Column<long>(type: "bigint", nullable: false, comment: "企业ID"),
  1898. factory_id = table.Column<long>(type: "bigint", nullable: true, comment: "工厂ID"),
  1899. org_id = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
  1900. IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: false, comment: "删除标识")
  1901. },
  1902. constraints: table =>
  1903. {
  1904. table.PrimaryKey("PK_mes_product_work_time", x => x.id);
  1905. },
  1906. comment: "mo的生产时间记录")
  1907. .Annotation("MySql:CharSet", "utf8mb4");
  1908. migrationBuilder.CreateTable(
  1909. name: "mes_schedule_occupy",
  1910. columns: table => new
  1911. {
  1912. id = table.Column<long>(type: "bigint", nullable: false, comment: "排程时间占用记录id")
  1913. .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
  1914. start_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "开始时间"),
  1915. end_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "结束时间"),
  1916. working_minute = table.Column<decimal>(type: "decimal(20,8)", precision: 20, scale: 8, nullable: true, comment: "工作时长(h)"),
  1917. status = table.Column<int>(type: "int", nullable: false, comment: "状态 0-待使用,1-已使用"),
  1918. is_Locked = table.Column<int>(type: "int", nullable: false, comment: "是否锁定 0-正常,1-锁定"),
  1919. prd_org_id = table.Column<long>(type: "bigint", nullable: false, comment: "生产组织id"),
  1920. work_center_id = table.Column<long>(type: "bigint", nullable: false, comment: "工作中心id"),
  1921. work_calendar_id = table.Column<long>(type: "bigint", nullable: false, comment: "工作日历id"),
  1922. create_by = table.Column<long>(type: "bigint", nullable: true, comment: "创建人id"),
  1923. create_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "创建人名称")
  1924. .Annotation("MySql:CharSet", "utf8mb4"),
  1925. create_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "创建时间"),
  1926. update_by = table.Column<long>(type: "bigint", nullable: true, comment: "修改人"),
  1927. update_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "修改人名称")
  1928. .Annotation("MySql:CharSet", "utf8mb4"),
  1929. update_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改时间"),
  1930. tenant_id = table.Column<long>(type: "bigint", nullable: false, comment: "企业ID"),
  1931. factory_id = table.Column<long>(type: "bigint", nullable: true, comment: "工厂ID"),
  1932. org_id = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
  1933. IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: false, comment: "删除标识")
  1934. },
  1935. constraints: table =>
  1936. {
  1937. table.PrimaryKey("PK_mes_schedule_occupy", x => x.id);
  1938. },
  1939. comment: "排程时间占用记录表")
  1940. .Annotation("MySql:CharSet", "utf8mb4");
  1941. migrationBuilder.CreateTable(
  1942. name: "mes_stock_enter",
  1943. columns: table => new
  1944. {
  1945. id = table.Column<long>(type: "bigint", nullable: false, comment: "入库单id")
  1946. .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
  1947. fitem_number = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: true, comment: "物料编码")
  1948. .Annotation("MySql:CharSet", "utf8mb4"),
  1949. fitem_name = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: true, comment: "物料名称")
  1950. .Annotation("MySql:CharSet", "utf8mb4"),
  1951. ffull_name = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: true, comment: "全名")
  1952. .Annotation("MySql:CharSet", "utf8mb4"),
  1953. fmodel = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: true, comment: "规格型号")
  1954. .Annotation("MySql:CharSet", "utf8mb4"),
  1955. order_no = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "工单号")
  1956. .Annotation("MySql:CharSet", "utf8mb4"),
  1957. edate = table.Column<DateTime>(type: "datetime", nullable: false, comment: "入库日期"),
  1958. eqty = table.Column<int>(type: "int", nullable: false, comment: "入库数量"),
  1959. eby = table.Column<long>(type: "bigint", nullable: false, comment: "入库人id"),
  1960. ebyname = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: false, comment: "入库人姓名")
  1961. .Annotation("MySql:CharSet", "utf8mb4"),
  1962. create_by = table.Column<long>(type: "bigint", nullable: true, comment: "创建人id"),
  1963. create_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "创建人名称")
  1964. .Annotation("MySql:CharSet", "utf8mb4"),
  1965. create_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "创建时间"),
  1966. update_by = table.Column<long>(type: "bigint", nullable: true, comment: "修改人"),
  1967. update_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "修改人名称")
  1968. .Annotation("MySql:CharSet", "utf8mb4"),
  1969. update_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改时间"),
  1970. tenant_id = table.Column<long>(type: "bigint", nullable: false, comment: "企业ID"),
  1971. factory_id = table.Column<long>(type: "bigint", nullable: true, comment: "工厂ID"),
  1972. org_id = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
  1973. IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: false, comment: "删除标识")
  1974. },
  1975. constraints: table =>
  1976. {
  1977. table.PrimaryKey("PK_mes_stock_enter", x => x.id);
  1978. },
  1979. comment: "入库单")
  1980. .Annotation("MySql:CharSet", "utf8mb4");
  1981. migrationBuilder.CreateTable(
  1982. name: "mes_stock_out",
  1983. columns: table => new
  1984. {
  1985. id = table.Column<long>(type: "bigint", nullable: false, comment: "出库单Id")
  1986. .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
  1987. out_no = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: false, comment: "出库单号")
  1988. .Annotation("MySql:CharSet", "utf8mb4"),
  1989. stock_name = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: true, comment: "仓库名称")
  1990. .Annotation("MySql:CharSet", "utf8mb4"),
  1991. stock_no = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: true, comment: "仓库编码")
  1992. .Annotation("MySql:CharSet", "utf8mb4"),
  1993. fitem_number = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "物料编码")
  1994. .Annotation("MySql:CharSet", "utf8mb4"),
  1995. fitem_name = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: false, comment: "物料名称")
  1996. .Annotation("MySql:CharSet", "utf8mb4"),
  1997. ffull_name = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: true, comment: "全名")
  1998. .Annotation("MySql:CharSet", "utf8mb4"),
  1999. fmodel = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: true, comment: "规格型号")
  2000. .Annotation("MySql:CharSet", "utf8mb4"),
  2001. order_no = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: false, comment: "销售订单号")
  2002. .Annotation("MySql:CharSet", "utf8mb4"),
  2003. order_number = table.Column<int>(type: "int", nullable: true, comment: "订单行号"),
  2004. shipn_no = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "发运通知单号")
  2005. .Annotation("MySql:CharSet", "utf8mb4"),
  2006. edate = table.Column<DateTime>(type: "datetime", nullable: false, comment: "出库日期"),
  2007. eqty = table.Column<int>(type: "int", nullable: false, comment: "出库数量"),
  2008. unit = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "计量单位")
  2009. .Annotation("MySql:CharSet", "utf8mb4"),
  2010. eby = table.Column<long>(type: "bigint", nullable: false, comment: "出库人id"),
  2011. eby_name = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: false, comment: "出库人姓名")
  2012. .Annotation("MySql:CharSet", "utf8mb4"),
  2013. create_by = table.Column<long>(type: "bigint", nullable: true, comment: "创建人id"),
  2014. create_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "创建人名称")
  2015. .Annotation("MySql:CharSet", "utf8mb4"),
  2016. create_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "创建时间"),
  2017. update_by = table.Column<long>(type: "bigint", nullable: true, comment: "修改人"),
  2018. update_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "修改人名称")
  2019. .Annotation("MySql:CharSet", "utf8mb4"),
  2020. update_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改时间"),
  2021. tenant_id = table.Column<long>(type: "bigint", nullable: false, comment: "企业ID"),
  2022. factory_id = table.Column<long>(type: "bigint", nullable: true, comment: "工厂ID"),
  2023. org_id = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
  2024. IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: false, comment: "删除标识")
  2025. },
  2026. constraints: table =>
  2027. {
  2028. table.PrimaryKey("PK_mes_stock_out", x => x.id);
  2029. },
  2030. comment: "出库单")
  2031. .Annotation("MySql:CharSet", "utf8mb4");
  2032. migrationBuilder.CreateTable(
  2033. name: "mes_stockoccupy",
  2034. columns: table => new
  2035. {
  2036. soccupy_id = table.Column<long>(type: "bigint", nullable: false, comment: "成品库存占用id")
  2037. .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
  2038. soccupy_type = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false, comment: "类型")
  2039. .Annotation("MySql:CharSet", "utf8mb4"),
  2040. soentry_id = table.Column<long>(type: "bigint", nullable: true, comment: "订单行id"),
  2041. fentry_id = table.Column<long>(type: "bigint", nullable: true, comment: "订单行号"),
  2042. fbill_no = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "订单编号")
  2043. .Annotation("MySql:CharSet", "utf8mb4"),
  2044. fitem_number = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "物料编码")
  2045. .Annotation("MySql:CharSet", "utf8mb4"),
  2046. fitem_name = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: true, comment: "物料名称")
  2047. .Annotation("MySql:CharSet", "utf8mb4"),
  2048. fmodel = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: true, comment: "规格型号")
  2049. .Annotation("MySql:CharSet", "utf8mb4"),
  2050. warehouse_id = table.Column<long>(type: "bigint", nullable: false, comment: "仓库id"),
  2051. warehouse_name = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "仓库名称")
  2052. .Annotation("MySql:CharSet", "utf8mb4"),
  2053. warehouse_type = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "仓库类型")
  2054. .Annotation("MySql:CharSet", "utf8mb4"),
  2055. occupyqty = table.Column<decimal>(type: "decimal(20,2)", precision: 20, scale: 2, nullable: true, comment: "占用量"),
  2056. soccupy_stime = table.Column<DateTime>(type: "datetime", nullable: true, comment: "开始时间"),
  2057. soccupy_etime = table.Column<DateTime>(type: "datetime", nullable: true, comment: "结束时间"),
  2058. soccupy_state = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "占用状态")
  2059. .Annotation("MySql:CharSet", "utf8mb4"),
  2060. soccupy_cby = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "变更人")
  2061. .Annotation("MySql:CharSet", "utf8mb4"),
  2062. soccupy_ctime = table.Column<DateTime>(type: "datetime", nullable: true, comment: "变更时间"),
  2063. soccupy_creason = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: true, comment: "变更原因")
  2064. .Annotation("MySql:CharSet", "utf8mb4"),
  2065. create_by = table.Column<long>(type: "bigint", nullable: true, comment: "创建人id"),
  2066. create_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "创建人名称")
  2067. .Annotation("MySql:CharSet", "utf8mb4"),
  2068. create_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "创建时间"),
  2069. update_by = table.Column<long>(type: "bigint", nullable: true, comment: "修改人"),
  2070. update_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "修改人名称")
  2071. .Annotation("MySql:CharSet", "utf8mb4"),
  2072. update_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改时间"),
  2073. tenant_id = table.Column<long>(type: "bigint", nullable: false, comment: "企业ID"),
  2074. factory_id = table.Column<long>(type: "bigint", nullable: true, comment: "工厂ID"),
  2075. org_id = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
  2076. IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: false, comment: "删除标识")
  2077. },
  2078. constraints: table =>
  2079. {
  2080. table.PrimaryKey("PK_mes_stockoccupy", x => x.soccupy_id);
  2081. },
  2082. comment: "成品库存占用表")
  2083. .Annotation("MySql:CharSet", "utf8mb4");
  2084. migrationBuilder.CreateTable(
  2085. name: "mes_swipe_card",
  2086. columns: table => new
  2087. {
  2088. id = table.Column<long>(type: "bigint", nullable: false, comment: "mes打卡记录id")
  2089. .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
  2090. product_org = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: false, comment: "生产车间")
  2091. .Annotation("MySql:CharSet", "utf8mb4"),
  2092. product_line = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: false, comment: "生产产线")
  2093. .Annotation("MySql:CharSet", "utf8mb4"),
  2094. card_no = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: false, comment: "卡号")
  2095. .Annotation("MySql:CharSet", "utf8mb4"),
  2096. order_no = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "工单编号")
  2097. .Annotation("MySql:CharSet", "utf8mb4"),
  2098. up_line_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "上线时间"),
  2099. off_line_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "下线时间"),
  2100. type = table.Column<int>(type: "int", nullable: false, comment: "刷卡类型"),
  2101. swipe_date = table.Column<DateTime>(type: "datetime", nullable: false, comment: "刷卡日期")
  2102. },
  2103. constraints: table =>
  2104. {
  2105. table.PrimaryKey("PK_mes_swipe_card", x => x.id);
  2106. },
  2107. comment: "mes打卡记录表")
  2108. .Annotation("MySql:CharSet", "utf8mb4");
  2109. migrationBuilder.CreateTable(
  2110. name: "mes_tech_proc_accessory",
  2111. columns: table => new
  2112. {
  2113. tech_proc_acc_id = table.Column<long>(type: "bigint", nullable: false, comment: "治具主键")
  2114. .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
  2115. tech_proc_id = table.Column<long>(type: "bigint", nullable: false, comment: "工艺工序主键"),
  2116. equip_id = table.Column<long>(type: "bigint", nullable: false, comment: "工装id"),
  2117. equip_no = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: false, comment: "工装编号")
  2118. .Annotation("MySql:CharSet", "utf8mb4"),
  2119. qty = table.Column<int>(type: "int", nullable: false, comment: "数量"),
  2120. create_by = table.Column<long>(type: "bigint", nullable: true, comment: "创建人id"),
  2121. create_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "创建人名称")
  2122. .Annotation("MySql:CharSet", "utf8mb4"),
  2123. create_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "创建时间"),
  2124. update_by = table.Column<long>(type: "bigint", nullable: true, comment: "修改人"),
  2125. update_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "修改人名称")
  2126. .Annotation("MySql:CharSet", "utf8mb4"),
  2127. update_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改时间"),
  2128. tenant_id = table.Column<long>(type: "bigint", nullable: false, comment: "企业ID"),
  2129. factory_id = table.Column<long>(type: "bigint", nullable: true, comment: "工厂ID"),
  2130. org_id = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
  2131. IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: false, comment: "删除标识")
  2132. },
  2133. constraints: table =>
  2134. {
  2135. table.PrimaryKey("PK_mes_tech_proc_accessory", x => x.tech_proc_acc_id);
  2136. },
  2137. comment: "治具表(工装表)")
  2138. .Annotation("MySql:CharSet", "utf8mb4");
  2139. migrationBuilder.CreateTable(
  2140. name: "mes_tech_proc_document",
  2141. columns: table => new
  2142. {
  2143. tech_proc_doc_id = table.Column<long>(type: "bigint", nullable: false, comment: "工序作业指导书主键")
  2144. .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
  2145. tech_proc_id = table.Column<long>(type: "bigint", nullable: false, comment: "工艺工序主键"),
  2146. upload_id = table.Column<long>(type: "bigint", nullable: false, comment: "作业指导书主键"),
  2147. name = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: true, comment: "作业指导书名称")
  2148. .Annotation("MySql:CharSet", "utf8mb4"),
  2149. create_by = table.Column<long>(type: "bigint", nullable: true, comment: "创建人id"),
  2150. create_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "创建人名称")
  2151. .Annotation("MySql:CharSet", "utf8mb4"),
  2152. create_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "创建时间"),
  2153. update_by = table.Column<long>(type: "bigint", nullable: true, comment: "修改人"),
  2154. update_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "修改人名称")
  2155. .Annotation("MySql:CharSet", "utf8mb4"),
  2156. update_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改时间"),
  2157. tenant_id = table.Column<long>(type: "bigint", nullable: false, comment: "企业ID"),
  2158. factory_id = table.Column<long>(type: "bigint", nullable: true, comment: "工厂ID"),
  2159. org_id = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
  2160. IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: false, comment: "删除标识")
  2161. },
  2162. constraints: table =>
  2163. {
  2164. table.PrimaryKey("PK_mes_tech_proc_document", x => x.tech_proc_doc_id);
  2165. },
  2166. comment: "工序作业指导书表")
  2167. .Annotation("MySql:CharSet", "utf8mb4");
  2168. migrationBuilder.CreateTable(
  2169. name: "mes_tech_proc_workshop",
  2170. columns: table => new
  2171. {
  2172. tech_proc_workshop_id = table.Column<long>(type: "bigint", nullable: false, comment: "工位表主键")
  2173. .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
  2174. tech_proc_id = table.Column<long>(type: "bigint", nullable: false, comment: "工艺工序id"),
  2175. workshop_id = table.Column<long>(type: "bigint", nullable: false, comment: "工位id"),
  2176. serialno = table.Column<int>(type: "int", nullable: true, comment: "序列号"),
  2177. create_by = table.Column<long>(type: "bigint", nullable: true, comment: "创建人id"),
  2178. create_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "创建人名称")
  2179. .Annotation("MySql:CharSet", "utf8mb4"),
  2180. create_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "创建时间"),
  2181. update_by = table.Column<long>(type: "bigint", nullable: true, comment: "修改人"),
  2182. update_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "修改人名称")
  2183. .Annotation("MySql:CharSet", "utf8mb4"),
  2184. update_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改时间"),
  2185. tenant_id = table.Column<long>(type: "bigint", nullable: false, comment: "企业ID"),
  2186. factory_id = table.Column<long>(type: "bigint", nullable: true, comment: "工厂ID"),
  2187. org_id = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
  2188. IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: false, comment: "删除标识")
  2189. },
  2190. constraints: table =>
  2191. {
  2192. table.PrimaryKey("PK_mes_tech_proc_workshop", x => x.tech_proc_workshop_id);
  2193. },
  2194. comment: "工艺路径关联工位表")
  2195. .Annotation("MySql:CharSet", "utf8mb4");
  2196. migrationBuilder.CreateTable(
  2197. name: "mes_tech_proc_workshop_equipment",
  2198. columns: table => new
  2199. {
  2200. tech_proc_equip_id = table.Column<long>(type: "bigint", nullable: false, comment: "主键")
  2201. .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
  2202. equip_id = table.Column<long>(type: "bigint", nullable: false, comment: "设备id"),
  2203. equip_name = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: true, comment: "设备名称")
  2204. .Annotation("MySql:CharSet", "utf8mb4"),
  2205. tech_proc_id = table.Column<long>(type: "bigint", nullable: false, comment: "工艺工序id"),
  2206. work_calendar_id = table.Column<long>(type: "bigint", nullable: true, comment: "工作日历id"),
  2207. create_by = table.Column<long>(type: "bigint", nullable: true, comment: "创建人id"),
  2208. create_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "创建人名称")
  2209. .Annotation("MySql:CharSet", "utf8mb4"),
  2210. create_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "创建时间"),
  2211. update_by = table.Column<long>(type: "bigint", nullable: true, comment: "修改人"),
  2212. update_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "修改人名称")
  2213. .Annotation("MySql:CharSet", "utf8mb4"),
  2214. update_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改时间"),
  2215. tenant_id = table.Column<long>(type: "bigint", nullable: false, comment: "企业ID"),
  2216. factory_id = table.Column<long>(type: "bigint", nullable: true, comment: "工厂ID"),
  2217. org_id = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
  2218. IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: false, comment: "删除标识")
  2219. },
  2220. constraints: table =>
  2221. {
  2222. table.PrimaryKey("PK_mes_tech_proc_workshop_equipment", x => x.tech_proc_equip_id);
  2223. },
  2224. comment: "工艺路径关联设备表")
  2225. .Annotation("MySql:CharSet", "utf8mb4");
  2226. migrationBuilder.CreateTable(
  2227. name: "mes_tech_proc_workshop_icitem",
  2228. columns: table => new
  2229. {
  2230. tech_proc_icitem_id = table.Column<long>(type: "bigint", nullable: false, comment: "主键")
  2231. .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
  2232. tech_proc_id = table.Column<long>(type: "bigint", nullable: false, comment: "工艺工序id"),
  2233. icitem_id = table.Column<long>(type: "bigint", nullable: false, comment: "物料id"),
  2234. qty = table.Column<int>(type: "int", nullable: false, comment: "数量"),
  2235. create_by = table.Column<long>(type: "bigint", nullable: true, comment: "创建人id"),
  2236. create_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "创建人名称")
  2237. .Annotation("MySql:CharSet", "utf8mb4"),
  2238. create_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "创建时间"),
  2239. update_by = table.Column<long>(type: "bigint", nullable: true, comment: "修改人"),
  2240. update_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "修改人名称")
  2241. .Annotation("MySql:CharSet", "utf8mb4"),
  2242. update_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改时间"),
  2243. tenant_id = table.Column<long>(type: "bigint", nullable: false, comment: "企业ID"),
  2244. factory_id = table.Column<long>(type: "bigint", nullable: true, comment: "工厂ID"),
  2245. org_id = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
  2246. IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: false, comment: "删除标识")
  2247. },
  2248. constraints: table =>
  2249. {
  2250. table.PrimaryKey("PK_mes_tech_proc_workshop_icitem", x => x.tech_proc_icitem_id);
  2251. },
  2252. comment: "发料到工位表")
  2253. .Annotation("MySql:CharSet", "utf8mb4");
  2254. migrationBuilder.CreateTable(
  2255. name: "mes_tech_proc_workshop_staff",
  2256. columns: table => new
  2257. {
  2258. tech_proc_workshop_equip_id = table.Column<long>(type: "bigint", nullable: false, comment: "主键")
  2259. .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
  2260. tech_proc_workshop_id = table.Column<long>(type: "bigint", nullable: false, comment: "工艺工位id"),
  2261. staff_id = table.Column<long>(type: "bigint", nullable: false, comment: "员工id"),
  2262. staff_name = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: true, comment: "员工姓名")
  2263. .Annotation("MySql:CharSet", "utf8mb4"),
  2264. create_by = table.Column<long>(type: "bigint", nullable: true, comment: "创建人id"),
  2265. create_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "创建人名称")
  2266. .Annotation("MySql:CharSet", "utf8mb4"),
  2267. create_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "创建时间"),
  2268. update_by = table.Column<long>(type: "bigint", nullable: true, comment: "修改人"),
  2269. update_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "修改人名称")
  2270. .Annotation("MySql:CharSet", "utf8mb4"),
  2271. update_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改时间"),
  2272. tenant_id = table.Column<long>(type: "bigint", nullable: false, comment: "企业ID"),
  2273. factory_id = table.Column<long>(type: "bigint", nullable: true, comment: "工厂ID"),
  2274. org_id = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
  2275. IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: false, comment: "删除标识")
  2276. },
  2277. constraints: table =>
  2278. {
  2279. table.PrimaryKey("PK_mes_tech_proc_workshop_staff", x => x.tech_proc_workshop_equip_id);
  2280. },
  2281. comment: "工序工位员工信息表")
  2282. .Annotation("MySql:CharSet", "utf8mb4");
  2283. migrationBuilder.CreateTable(
  2284. name: "mes_tech_process",
  2285. columns: table => new
  2286. {
  2287. tech_proc_id = table.Column<long>(type: "bigint", nullable: false, comment: "工艺工序主键")
  2288. .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
  2289. tech_id = table.Column<long>(type: "bigint", nullable: false, comment: "工艺主键"),
  2290. proc_id = table.Column<long>(type: "bigint", nullable: false, comment: "工序主键"),
  2291. level = table.Column<int>(type: "int", nullable: false, comment: "组合层级"),
  2292. is_schedule = table.Column<int>(type: "int", nullable: false, comment: "是否需要排产:1-是;0-否"),
  2293. readytime = table.Column<decimal>(type: "decimal(20,8)", precision: 20, scale: 8, nullable: true, comment: "前置准备时间"),
  2294. type = table.Column<int>(type: "int", nullable: false, comment: "效率计算类型 1-节拍时间;2-UPH"),
  2295. uph = table.Column<decimal>(type: "decimal(20,8)", precision: 20, scale: 8, nullable: true, comment: "UPH"),
  2296. ct = table.Column<decimal>(type: "decimal(20,8)", precision: 20, scale: 8, nullable: true, comment: "节拍时间"),
  2297. effect_ratio = table.Column<decimal>(type: "decimal(10,4)", precision: 10, scale: 4, nullable: true, comment: "效率系数"),
  2298. mototrack = table.Column<int>(type: "int", nullable: true, comment: "是否需要跟踪工序"),
  2299. nextprocid = table.Column<long>(type: "bigint", nullable: true, comment: "下一工序id"),
  2300. parentprocid = table.Column<long>(type: "bigint", nullable: true, comment: "父级工序id"),
  2301. needqc = table.Column<int>(type: "int", nullable: true, comment: "是否需要质检"),
  2302. maxworkshop = table.Column<int>(type: "int", nullable: true, comment: "最大并行工位数"),
  2303. create_by = table.Column<long>(type: "bigint", nullable: true, comment: "创建人id"),
  2304. create_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "创建人名称")
  2305. .Annotation("MySql:CharSet", "utf8mb4"),
  2306. create_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "创建时间"),
  2307. update_by = table.Column<long>(type: "bigint", nullable: true, comment: "修改人"),
  2308. update_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "修改人名称")
  2309. .Annotation("MySql:CharSet", "utf8mb4"),
  2310. update_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改时间"),
  2311. tenant_id = table.Column<long>(type: "bigint", nullable: false, comment: "企业ID"),
  2312. factory_id = table.Column<long>(type: "bigint", nullable: true, comment: "工厂ID"),
  2313. org_id = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
  2314. IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: false, comment: "删除标识")
  2315. },
  2316. constraints: table =>
  2317. {
  2318. table.PrimaryKey("PK_mes_tech_process", x => x.tech_proc_id);
  2319. },
  2320. comment: "工艺关联工序表")
  2321. .Annotation("MySql:CharSet", "utf8mb4");
  2322. migrationBuilder.CreateTable(
  2323. name: "mes_technique",
  2324. columns: table => new
  2325. {
  2326. tech_id = table.Column<long>(type: "bigint", nullable: false, comment: "工艺路径主键")
  2327. .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
  2328. tech_name = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: false, comment: "工艺路径名称")
  2329. .Annotation("MySql:CharSet", "utf8mb4"),
  2330. level = table.Column<int>(type: "int", nullable: false, comment: "效率计算层级"),
  2331. bom = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: true, comment: "产品")
  2332. .Annotation("MySql:CharSet", "utf8mb4"),
  2333. bomver = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: true, comment: "产品版本")
  2334. .Annotation("MySql:CharSet", "utf8mb4"),
  2335. desc = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: true, comment: "描述")
  2336. .Annotation("MySql:CharSet", "utf8mb4"),
  2337. create_by = table.Column<long>(type: "bigint", nullable: true, comment: "创建人id"),
  2338. create_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "创建人名称")
  2339. .Annotation("MySql:CharSet", "utf8mb4"),
  2340. create_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "创建时间"),
  2341. update_by = table.Column<long>(type: "bigint", nullable: true, comment: "修改人"),
  2342. update_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "修改人名称")
  2343. .Annotation("MySql:CharSet", "utf8mb4"),
  2344. update_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改时间"),
  2345. tenant_id = table.Column<long>(type: "bigint", nullable: false, comment: "企业ID"),
  2346. factory_id = table.Column<long>(type: "bigint", nullable: true, comment: "工厂ID"),
  2347. org_id = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
  2348. IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: false, comment: "删除标识")
  2349. },
  2350. constraints: table =>
  2351. {
  2352. table.PrimaryKey("PK_mes_technique", x => x.tech_id);
  2353. },
  2354. comment: "工艺路径表")
  2355. .Annotation("MySql:CharSet", "utf8mb4");
  2356. migrationBuilder.CreateTable(
  2357. name: "mes_workshop",
  2358. columns: table => new
  2359. {
  2360. workshop_id = table.Column<long>(type: "bigint", nullable: false, comment: "工位表主键")
  2361. .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
  2362. name = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: true, comment: "工位名称")
  2363. .Annotation("MySql:CharSet", "utf8mb4"),
  2364. subids = table.Column<string>(type: "varchar(2000)", maxLength: 2000, nullable: true, comment: "组合工位ids")
  2365. .Annotation("MySql:CharSet", "utf8mb4"),
  2366. geoinfo = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: true, comment: "坐标")
  2367. .Annotation("MySql:CharSet", "utf8mb4"),
  2368. building = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: true, comment: "楼栋")
  2369. .Annotation("MySql:CharSet", "utf8mb4"),
  2370. floor = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: true, comment: "楼层")
  2371. .Annotation("MySql:CharSet", "utf8mb4"),
  2372. zone = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: true, comment: "区域")
  2373. .Annotation("MySql:CharSet", "utf8mb4"),
  2374. work_calendar_id = table.Column<long>(type: "bigint", nullable: true, comment: "工作日历id"),
  2375. create_by = table.Column<long>(type: "bigint", nullable: true, comment: "创建人id"),
  2376. create_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "创建人名称")
  2377. .Annotation("MySql:CharSet", "utf8mb4"),
  2378. create_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "创建时间"),
  2379. update_by = table.Column<long>(type: "bigint", nullable: true, comment: "修改人"),
  2380. update_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "修改人名称")
  2381. .Annotation("MySql:CharSet", "utf8mb4"),
  2382. update_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改时间"),
  2383. tenant_id = table.Column<long>(type: "bigint", nullable: false, comment: "企业ID"),
  2384. factory_id = table.Column<long>(type: "bigint", nullable: true, comment: "工厂ID"),
  2385. org_id = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
  2386. IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: false, comment: "删除标识")
  2387. },
  2388. constraints: table =>
  2389. {
  2390. table.PrimaryKey("PK_mes_workshop", x => x.workshop_id);
  2391. },
  2392. comment: "工位表")
  2393. .Annotation("MySql:CharSet", "utf8mb4");
  2394. migrationBuilder.CreateTable(
  2395. name: "mes_workshop_shelf",
  2396. columns: table => new
  2397. {
  2398. workshop_shelf_id = table.Column<long>(type: "bigint", nullable: false, comment: "主键")
  2399. .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
  2400. workshop_id = table.Column<long>(type: "bigint", nullable: false, comment: "工位id"),
  2401. serialno = table.Column<int>(type: "int", nullable: true, comment: "线边仓序列号"),
  2402. sheifno = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: true, comment: "仓库编号")
  2403. .Annotation("MySql:CharSet", "utf8mb4"),
  2404. geoinfo = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: true, comment: "坐标")
  2405. .Annotation("MySql:CharSet", "utf8mb4"),
  2406. create_by = table.Column<long>(type: "bigint", nullable: true, comment: "创建人id"),
  2407. create_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "创建人名称")
  2408. .Annotation("MySql:CharSet", "utf8mb4"),
  2409. create_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "创建时间"),
  2410. update_by = table.Column<long>(type: "bigint", nullable: true, comment: "修改人"),
  2411. update_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "修改人名称")
  2412. .Annotation("MySql:CharSet", "utf8mb4"),
  2413. update_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改时间"),
  2414. tenant_id = table.Column<long>(type: "bigint", nullable: false, comment: "企业ID"),
  2415. factory_id = table.Column<long>(type: "bigint", nullable: true, comment: "工厂ID"),
  2416. org_id = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
  2417. IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: false, comment: "删除标识")
  2418. },
  2419. constraints: table =>
  2420. {
  2421. table.PrimaryKey("PK_mes_workshop_shelf", x => x.workshop_shelf_id);
  2422. },
  2423. comment: "工位关联线边仓表")
  2424. .Annotation("MySql:CharSet", "utf8mb4");
  2425. migrationBuilder.CreateTable(
  2426. name: "sim_base",
  2427. columns: table => new
  2428. {
  2429. sim_id = table.Column<long>(type: "bigint", nullable: false, comment: "主键id")
  2430. .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
  2431. sim_grade = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: true, comment: "sim等级")
  2432. .Annotation("MySql:CharSet", "utf8mb4"),
  2433. sim_level = table.Column<int>(type: "int", nullable: true, comment: "sim层级顺序"),
  2434. rise_cycle = table.Column<decimal>(type: "decimal(10,0)", precision: 10, scale: 0, nullable: true, comment: "上升周期"),
  2435. interval_days = table.Column<decimal>(type: "decimal(10,0)", precision: 10, scale: 0, nullable: true, comment: "间隔天数"),
  2436. rise_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "上升时间"),
  2437. create_by = table.Column<long>(type: "bigint", nullable: true, comment: "创建人id"),
  2438. create_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "创建人名称")
  2439. .Annotation("MySql:CharSet", "utf8mb4"),
  2440. create_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "创建时间"),
  2441. update_by = table.Column<long>(type: "bigint", nullable: true, comment: "修改人"),
  2442. update_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "修改人名称")
  2443. .Annotation("MySql:CharSet", "utf8mb4"),
  2444. update_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改时间"),
  2445. tenant_id = table.Column<long>(type: "bigint", nullable: false, comment: "企业ID"),
  2446. factory_id = table.Column<long>(type: "bigint", nullable: true, comment: "工厂ID"),
  2447. org_id = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
  2448. IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: false, comment: "删除标识")
  2449. },
  2450. constraints: table =>
  2451. {
  2452. table.PrimaryKey("PK_sim_base", x => x.sim_id);
  2453. },
  2454. comment: "sim基本表")
  2455. .Annotation("MySql:CharSet", "utf8mb4");
  2456. migrationBuilder.CreateTable(
  2457. name: "sim_issue_type",
  2458. columns: table => new
  2459. {
  2460. issue_type_id = table.Column<long>(type: "bigint", nullable: false, comment: "上升时间")
  2461. .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
  2462. type_code = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: true, comment: "类别代码")
  2463. .Annotation("MySql:CharSet", "utf8mb4"),
  2464. type_name = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: true, comment: "类别名称")
  2465. .Annotation("MySql:CharSet", "utf8mb4"),
  2466. app_scenario = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: true, comment: "应用场景")
  2467. .Annotation("MySql:CharSet", "utf8mb4"),
  2468. issue_grade = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: true, comment: "问题等级")
  2469. .Annotation("MySql:CharSet", "utf8mb4"),
  2470. duty_person = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: true, comment: "责任人")
  2471. .Annotation("MySql:CharSet", "utf8mb4"),
  2472. duty_dept = table.Column<long>(type: "bigint", nullable: true, comment: "责任部门id"),
  2473. create_by = table.Column<long>(type: "bigint", nullable: true, comment: "创建人id"),
  2474. create_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "创建人名称")
  2475. .Annotation("MySql:CharSet", "utf8mb4"),
  2476. create_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "创建时间"),
  2477. update_by = table.Column<long>(type: "bigint", nullable: true, comment: "修改人"),
  2478. update_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "修改人名称")
  2479. .Annotation("MySql:CharSet", "utf8mb4"),
  2480. update_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改时间"),
  2481. tenant_id = table.Column<long>(type: "bigint", nullable: false, comment: "企业ID"),
  2482. factory_id = table.Column<long>(type: "bigint", nullable: true, comment: "工厂ID"),
  2483. org_id = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
  2484. IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: false, comment: "删除标识")
  2485. },
  2486. constraints: table =>
  2487. {
  2488. table.PrimaryKey("PK_sim_issue_type", x => x.issue_type_id);
  2489. },
  2490. comment: "sim事项类别表")
  2491. .Annotation("MySql:CharSet", "utf8mb4");
  2492. migrationBuilder.CreateTable(
  2493. name: "sim_plant",
  2494. columns: table => new
  2495. {
  2496. plant_id = table.Column<long>(type: "bigint", nullable: false, comment: "主键id")
  2497. .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
  2498. plant_name = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: true, comment: "事项名称")
  2499. .Annotation("MySql:CharSet", "utf8mb4"),
  2500. create_by = table.Column<long>(type: "bigint", nullable: true, comment: "创建人id"),
  2501. create_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "创建人名称")
  2502. .Annotation("MySql:CharSet", "utf8mb4"),
  2503. create_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "创建时间"),
  2504. update_by = table.Column<long>(type: "bigint", nullable: true, comment: "修改人"),
  2505. update_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "修改人名称")
  2506. .Annotation("MySql:CharSet", "utf8mb4"),
  2507. update_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改时间"),
  2508. tenant_id = table.Column<long>(type: "bigint", nullable: false, comment: "企业ID"),
  2509. factory_id = table.Column<long>(type: "bigint", nullable: true, comment: "工厂ID"),
  2510. org_id = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
  2511. IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: false, comment: "删除标识")
  2512. },
  2513. constraints: table =>
  2514. {
  2515. table.PrimaryKey("PK_sim_plant", x => x.plant_id);
  2516. },
  2517. comment: "sim事项表")
  2518. .Annotation("MySql:CharSet", "utf8mb4");
  2519. migrationBuilder.CreateTable(
  2520. name: "sim_user_relation",
  2521. columns: table => new
  2522. {
  2523. id = table.Column<long>(type: "bigint", nullable: false, comment: "主键id")
  2524. .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
  2525. sim_id = table.Column<long>(type: "bigint", nullable: false, comment: "base_sim表ID"),
  2526. user_id = table.Column<long>(type: "bigint", nullable: false, comment: "用户id"),
  2527. create_by = table.Column<long>(type: "bigint", nullable: true, comment: "创建人id"),
  2528. create_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "创建人名称")
  2529. .Annotation("MySql:CharSet", "utf8mb4"),
  2530. create_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "创建时间"),
  2531. update_by = table.Column<long>(type: "bigint", nullable: true, comment: "修改人"),
  2532. update_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "修改人名称")
  2533. .Annotation("MySql:CharSet", "utf8mb4"),
  2534. update_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改时间"),
  2535. tenant_id = table.Column<long>(type: "bigint", nullable: false, comment: "企业ID"),
  2536. factory_id = table.Column<long>(type: "bigint", nullable: true, comment: "工厂ID"),
  2537. org_id = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
  2538. IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: false, comment: "删除标识")
  2539. },
  2540. constraints: table =>
  2541. {
  2542. table.PrimaryKey("PK_sim_user_relation", x => x.id);
  2543. },
  2544. comment: "sim用户关联表")
  2545. .Annotation("MySql:CharSet", "utf8mb4");
  2546. migrationBuilder.CreateTable(
  2547. name: "srm_po_list",
  2548. columns: table => new
  2549. {
  2550. polist_id = table.Column<long>(type: "bigint", nullable: false, comment: "主键")
  2551. .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
  2552. po_id = table.Column<long>(type: "bigint", nullable: false, comment: "po单id"),
  2553. po_billno = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "po单号")
  2554. .Annotation("MySql:CharSet", "utf8mb4"),
  2555. polist_row = table.Column<int>(type: "int", nullable: false, comment: "行号"),
  2556. pr_id = table.Column<long>(type: "bigint", nullable: false, comment: "pr申请单id"),
  2557. pr_billno = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "pr申请单号")
  2558. .Annotation("MySql:CharSet", "utf8mb4"),
  2559. po_mono = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "关联工单号")
  2560. .Annotation("MySql:CharSet", "utf8mb4"),
  2561. pr_purchase_id = table.Column<long>(type: "bigint", nullable: false, comment: "供应商id"),
  2562. pr_purchase_name = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "供应商名称")
  2563. .Annotation("MySql:CharSet", "utf8mb4"),
  2564. stock_id = table.Column<long>(type: "bigint", nullable: false, comment: "收货仓库id"),
  2565. stock_name = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "收货仓库名称")
  2566. .Annotation("MySql:CharSet", "utf8mb4"),
  2567. icitem_id = table.Column<long>(type: "bigint", nullable: false, comment: "物料id"),
  2568. icitem_name = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: true, comment: "物料名称")
  2569. .Annotation("MySql:CharSet", "utf8mb4"),
  2570. qty = table.Column<decimal>(type: "decimal(20,8)", precision: 20, scale: 8, nullable: true, comment: "订单数量"),
  2571. netprice = table.Column<decimal>(type: "decimal(20,8)", precision: 20, scale: 8, nullable: true, comment: "净价"),
  2572. rate = table.Column<decimal>(type: "decimal(20,8)", precision: 20, scale: 8, nullable: true, comment: "税率"),
  2573. price = table.Column<decimal>(type: "decimal(20,8)", precision: 20, scale: 8, nullable: true, comment: "含税单价"),
  2574. total_price = table.Column<decimal>(type: "decimal(20,8)", precision: 20, scale: 8, nullable: true, comment: "总价"),
  2575. plan_qty = table.Column<decimal>(type: "decimal(20,8)", precision: 20, scale: 8, nullable: true, comment: "计划数量"),
  2576. unit = table.Column<long>(type: "bigint", nullable: false, comment: "单位"),
  2577. state = table.Column<int>(type: "int", nullable: false, comment: "数据状态标识"),
  2578. rarrdate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "需求到货日期"),
  2579. rstate = table.Column<int>(type: "int", nullable: false, comment: "评审状态"),
  2580. rnumber = table.Column<int>(type: "int", nullable: false, comment: "评审次数"),
  2581. rqty = table.Column<decimal>(type: "decimal(20,8)", precision: 20, scale: 8, nullable: true, comment: "已收货数量"),
  2582. esqty = table.Column<decimal>(type: "decimal(20,8)", precision: 20, scale: 8, nullable: true, comment: "已入库数量"),
  2583. procurement_rarr_date = table.Column<decimal>(type: "decimal(20,8)", precision: 20, scale: 8, nullable: true, comment: "采购到货日期"),
  2584. rparrive_date = table.Column<decimal>(type: "decimal(20,8)", precision: 20, scale: 8, nullable: true, comment: "再计划到货日期"),
  2585. purchase_date = table.Column<decimal>(type: "decimal(20,8)", precision: 20, scale: 8, nullable: true, comment: "供应商交期"),
  2586. pur_affirmdate = table.Column<decimal>(type: "decimal(20,8)", precision: 20, scale: 8, nullable: true, comment: "采购确认到货日期"),
  2587. currencytype = table.Column<long>(type: "bigint", nullable: false, comment: "币别"),
  2588. create_by = table.Column<long>(type: "bigint", nullable: true, comment: "创建人id"),
  2589. create_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "创建人名称")
  2590. .Annotation("MySql:CharSet", "utf8mb4"),
  2591. create_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "创建时间"),
  2592. update_by = table.Column<long>(type: "bigint", nullable: true, comment: "修改人"),
  2593. update_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "修改人名称")
  2594. .Annotation("MySql:CharSet", "utf8mb4"),
  2595. update_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改时间"),
  2596. tenant_id = table.Column<long>(type: "bigint", nullable: false, comment: "企业ID"),
  2597. factory_id = table.Column<long>(type: "bigint", nullable: true, comment: "工厂ID"),
  2598. org_id = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
  2599. IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: false, comment: "删除标识")
  2600. },
  2601. constraints: table =>
  2602. {
  2603. table.PrimaryKey("PK_srm_po_list", x => x.polist_id);
  2604. },
  2605. comment: "采购订单明细详情")
  2606. .Annotation("MySql:CharSet", "utf8mb4");
  2607. migrationBuilder.CreateTable(
  2608. name: "srm_po_main",
  2609. columns: table => new
  2610. {
  2611. po_Id = table.Column<long>(type: "bigint", nullable: false, comment: "主键")
  2612. .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
  2613. po_billno = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "PO单号")
  2614. .Annotation("MySql:CharSet", "utf8mb4"),
  2615. po_purchaser = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "采购员")
  2616. .Annotation("MySql:CharSet", "utf8mb4"),
  2617. po_purchaser_no = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "采购员工号")
  2618. .Annotation("MySql:CharSet", "utf8mb4"),
  2619. po_purchase_id = table.Column<long>(type: "bigint", nullable: false, comment: "供应商id"),
  2620. po_purchase_name = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "供应商名称")
  2621. .Annotation("MySql:CharSet", "utf8mb4"),
  2622. po_ssend_date = table.Column<DateTime>(type: "datetime", nullable: true, comment: "下单日期"),
  2623. po_total = table.Column<decimal>(type: "decimal(20,8)", precision: 20, scale: 8, nullable: true, comment: "订单总价"),
  2624. po_delivery = table.Column<long>(type: "bigint", nullable: false, comment: "交货方式"),
  2625. po_tax_rate = table.Column<decimal>(type: "decimal(20,8)", precision: 20, scale: 8, nullable: true, comment: "税率"),
  2626. po_express = table.Column<int>(type: "int", nullable: false, comment: "是否加急"),
  2627. state = table.Column<int>(type: "int", nullable: false, comment: "数据状态"),
  2628. po_note = table.Column<string>(type: "varchar(1000)", maxLength: 1000, nullable: true, comment: "备注")
  2629. .Annotation("MySql:CharSet", "utf8mb4"),
  2630. rstate = table.Column<int>(type: "int", nullable: false, comment: "评审状态"),
  2631. rnumber = table.Column<decimal>(type: "decimal(20,8)", precision: 20, scale: 8, nullable: true, comment: "评审次数"),
  2632. review_rtime = table.Column<DateTime>(type: "datetime", nullable: true, comment: "评审通过时间"),
  2633. po_order_type = table.Column<int>(type: "int", nullable: false, comment: "单据类型"),
  2634. currency = table.Column<long>(type: "bigint", nullable: false, comment: "币别"),
  2635. bill_type = table.Column<int>(type: "int", nullable: false, comment: "金蝶单据类型值"),
  2636. create_by = table.Column<long>(type: "bigint", nullable: true, comment: "创建人id"),
  2637. create_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "创建人名称")
  2638. .Annotation("MySql:CharSet", "utf8mb4"),
  2639. create_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "创建时间"),
  2640. update_by = table.Column<long>(type: "bigint", nullable: true, comment: "修改人"),
  2641. update_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "修改人名称")
  2642. .Annotation("MySql:CharSet", "utf8mb4"),
  2643. update_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改时间"),
  2644. tenant_id = table.Column<long>(type: "bigint", nullable: false, comment: "企业ID"),
  2645. factory_id = table.Column<long>(type: "bigint", nullable: true, comment: "工厂ID"),
  2646. org_id = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
  2647. IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: false, comment: "删除标识")
  2648. },
  2649. constraints: table =>
  2650. {
  2651. table.PrimaryKey("PK_srm_po_main", x => x.po_Id);
  2652. },
  2653. comment: "采购订单")
  2654. .Annotation("MySql:CharSet", "utf8mb4");
  2655. migrationBuilder.CreateTable(
  2656. name: "srm_po_occupy",
  2657. columns: table => new
  2658. {
  2659. pooccupy_id = table.Column<long>(type: "bigint", nullable: false, comment: "主键")
  2660. .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
  2661. polist_id = table.Column<long>(type: "bigint", nullable: false, comment: "采购订单id"),
  2662. polist_row = table.Column<int>(type: "int", nullable: false, comment: "采购订单行号"),
  2663. eid = table.Column<long>(type: "bigint", nullable: false, comment: "客户订单行id"),
  2664. bill_no = table.Column<long>(type: "bigint", nullable: false, comment: "客户订单id"),
  2665. type = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "类型")
  2666. .Annotation("MySql:CharSet", "utf8mb4"),
  2667. entry_id = table.Column<int>(type: "int", nullable: false, comment: "行号"),
  2668. qty = table.Column<decimal>(type: "decimal(20,8)", precision: 20, scale: 8, nullable: true, comment: "占用量"),
  2669. stime = table.Column<DateTime>(type: "datetime", nullable: true, comment: "开始时间"),
  2670. etime = table.Column<DateTime>(type: "datetime", nullable: true, comment: "结束时间"),
  2671. state = table.Column<int>(type: "int", nullable: false, comment: "占用状态"),
  2672. cby = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "变更人")
  2673. .Annotation("MySql:CharSet", "utf8mb4"),
  2674. creason = table.Column<string>(type: "varchar(1000)", maxLength: 1000, nullable: true, comment: "变更原因")
  2675. .Annotation("MySql:CharSet", "utf8mb4"),
  2676. ctime = table.Column<DateTime>(type: "datetime", nullable: true, comment: "变更时间"),
  2677. create_by = table.Column<long>(type: "bigint", nullable: true, comment: "创建人id"),
  2678. create_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "创建人名称")
  2679. .Annotation("MySql:CharSet", "utf8mb4"),
  2680. create_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "创建时间"),
  2681. update_by = table.Column<long>(type: "bigint", nullable: true, comment: "修改人"),
  2682. update_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "修改人名称")
  2683. .Annotation("MySql:CharSet", "utf8mb4"),
  2684. update_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改时间"),
  2685. tenant_id = table.Column<long>(type: "bigint", nullable: false, comment: "企业ID"),
  2686. factory_id = table.Column<long>(type: "bigint", nullable: true, comment: "工厂ID"),
  2687. org_id = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
  2688. IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: false, comment: "删除标识")
  2689. },
  2690. constraints: table =>
  2691. {
  2692. table.PrimaryKey("PK_srm_po_occupy", x => x.pooccupy_id);
  2693. },
  2694. comment: "采购订单占用详情")
  2695. .Annotation("MySql:CharSet", "utf8mb4");
  2696. migrationBuilder.CreateTable(
  2697. name: "srm_pr_main",
  2698. columns: table => new
  2699. {
  2700. pr_id = table.Column<long>(type: "bigint", nullable: false, comment: "主键")
  2701. .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
  2702. pr_billno = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "pr单号")
  2703. .Annotation("MySql:CharSet", "utf8mb4"),
  2704. pr_mono = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "关联工单号")
  2705. .Annotation("MySql:CharSet", "utf8mb4"),
  2706. entity_id = table.Column<int>(type: "int", nullable: false, comment: "工单行号"),
  2707. pr_purchaseid = table.Column<long>(type: "bigint", nullable: false, comment: "供应商id"),
  2708. pr_purchasenumber = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "供应商编码")
  2709. .Annotation("MySql:CharSet", "utf8mb4"),
  2710. pr_purchasename = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "供应商名称")
  2711. .Annotation("MySql:CharSet", "utf8mb4"),
  2712. pr_purchaser = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "采购员")
  2713. .Annotation("MySql:CharSet", "utf8mb4"),
  2714. pr_purchaser_num = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "采购员工号")
  2715. .Annotation("MySql:CharSet", "utf8mb4"),
  2716. pr_rqty = table.Column<decimal>(type: "decimal(20,8)", precision: 20, scale: 8, nullable: true, comment: "需求数量"),
  2717. pr_aqty = table.Column<decimal>(type: "decimal(20,8)", precision: 20, scale: 8, nullable: true, comment: "申请数量"),
  2718. pr_sqty = table.Column<decimal>(type: "decimal(20,8)", precision: 20, scale: 8, nullable: true, comment: "建议数量"),
  2719. icitem_id = table.Column<long>(type: "bigint", nullable: false, comment: "物料id"),
  2720. icitem_name = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "物料名称")
  2721. .Annotation("MySql:CharSet", "utf8mb4"),
  2722. pr_order_type = table.Column<int>(type: "int", nullable: false, comment: "单据类型"),
  2723. pr_ssend_date = table.Column<DateTime>(type: "datetime", nullable: true, comment: "系统建议下单日期"),
  2724. pr_sarrive_date = table.Column<DateTime>(type: "datetime", nullable: true, comment: "系统建议到达日期"),
  2725. pr_bsarrive_date = table.Column<DateTime>(type: "datetime", nullable: true, comment: "采购员建议到货日期"),
  2726. pr_oarrive_date = table.Column<DateTime>(type: "datetime", nullable: true, comment: "订单到货日期"),
  2727. pr_psend_date = table.Column<DateTime>(type: "datetime", nullable: true, comment: "计划下单日期"),
  2728. pr_parrive_date = table.Column<DateTime>(type: "datetime", nullable: true, comment: "计划到达日期"),
  2729. pr_rarrive_date = table.Column<DateTime>(type: "datetime", nullable: true, comment: "需求到货日期"),
  2730. pr_rparrive_date = table.Column<DateTime>(type: "datetime", nullable: true, comment: "再计划到货日期"),
  2731. pr_pur_affirm_date = table.Column<DateTime>(type: "datetime", nullable: true, comment: "采购确认到货日期"),
  2732. pr_sysprice = table.Column<decimal>(type: "decimal(20,8)", precision: 20, scale: 8, nullable: true, comment: "系统价格(含税)"),
  2733. pr_orderprice = table.Column<decimal>(type: "decimal(20,8)", precision: 20, scale: 8, nullable: true, comment: "订单价格(含税)"),
  2734. pr_price = table.Column<decimal>(type: "decimal(20,8)", precision: 20, scale: 8, nullable: true, comment: "采购净价(不含税)"),
  2735. pr_rate = table.Column<decimal>(type: "decimal(20,8)", precision: 20, scale: 8, nullable: true, comment: "税率"),
  2736. pr_unit = table.Column<string>(type: "varchar(20)", maxLength: 20, nullable: true, comment: "单位")
  2737. .Annotation("MySql:CharSet", "utf8mb4"),
  2738. state = table.Column<int>(type: "int", nullable: false, comment: "状态"),
  2739. old_apply_aqty = table.Column<decimal>(type: "decimal(20,8)", precision: 20, scale: 8, nullable: true, comment: "已申请数量"),
  2740. pr_type = table.Column<int>(type: "int", nullable: false, comment: "申请类型"),
  2741. currencytype = table.Column<long>(type: "bigint", nullable: false, comment: "币种"),
  2742. secInv_ratio = table.Column<decimal>(type: "decimal(20,8)", precision: 20, scale: 8, nullable: true, comment: "安全库存触发采购比例"),
  2743. remark = table.Column<string>(type: "varchar(1000)", maxLength: 1000, nullable: true, comment: "备注")
  2744. .Annotation("MySql:CharSet", "utf8mb4"),
  2745. pr_rreason = table.Column<string>(type: "varchar(1000)", maxLength: 1000, nullable: true, comment: "拒绝原因")
  2746. .Annotation("MySql:CharSet", "utf8mb4"),
  2747. create_by = table.Column<long>(type: "bigint", nullable: true, comment: "创建人id"),
  2748. create_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "创建人名称")
  2749. .Annotation("MySql:CharSet", "utf8mb4"),
  2750. create_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "创建时间"),
  2751. update_by = table.Column<long>(type: "bigint", nullable: true, comment: "修改人"),
  2752. update_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "修改人名称")
  2753. .Annotation("MySql:CharSet", "utf8mb4"),
  2754. update_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改时间"),
  2755. tenant_id = table.Column<long>(type: "bigint", nullable: false, comment: "企业ID"),
  2756. factory_id = table.Column<long>(type: "bigint", nullable: true, comment: "工厂ID"),
  2757. org_id = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
  2758. IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: false, comment: "删除标识")
  2759. },
  2760. constraints: table =>
  2761. {
  2762. table.PrimaryKey("PK_srm_pr_main", x => x.pr_id);
  2763. },
  2764. comment: "采购申请单")
  2765. .Annotation("MySql:CharSet", "utf8mb4");
  2766. migrationBuilder.CreateTable(
  2767. name: "srm_purchase",
  2768. columns: table => new
  2769. {
  2770. ic_purchase_id = table.Column<long>(type: "bigint", nullable: false, comment: "主键")
  2771. .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
  2772. icitem_id = table.Column<long>(type: "bigint", nullable: false, comment: "物料id"),
  2773. icitem_name = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "物料名称")
  2774. .Annotation("MySql:CharSet", "utf8mb4"),
  2775. ic_plan_id = table.Column<long>(type: "bigint", nullable: false, comment: "计划id"),
  2776. order_rector_name = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "采购负责人")
  2777. .Annotation("MySql:CharSet", "utf8mb4"),
  2778. order_rector_num = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "采购负责人_工号")
  2779. .Annotation("MySql:CharSet", "utf8mb4"),
  2780. factory_code = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "工厂编码")
  2781. .Annotation("MySql:CharSet", "utf8mb4"),
  2782. order_dept = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "采购部门")
  2783. .Annotation("MySql:CharSet", "utf8mb4"),
  2784. order_price = table.Column<decimal>(type: "decimal(20,8)", precision: 20, scale: 8, nullable: true, comment: "采购单价"),
  2785. sale_price = table.Column<decimal>(type: "decimal(20,8)", precision: 20, scale: 8, nullable: true, comment: "销售单价"),
  2786. qty_min = table.Column<decimal>(type: "decimal(20,8)", precision: 20, scale: 8, nullable: true, comment: "最小订货量"),
  2787. batch_append_qty = table.Column<decimal>(type: "decimal(20,8)", precision: 20, scale: 8, nullable: true, comment: "批量增量"),
  2788. pov_acct = table.Column<long>(type: "bigint", nullable: false, comment: "采购订单差异科目代码"),
  2789. piv_acct = table.Column<long>(type: "bigint", nullable: false, comment: "采购发票差异科目代码"),
  2790. create_by = table.Column<long>(type: "bigint", nullable: true, comment: "创建人id"),
  2791. create_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "创建人名称")
  2792. .Annotation("MySql:CharSet", "utf8mb4"),
  2793. create_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "创建时间"),
  2794. update_by = table.Column<long>(type: "bigint", nullable: true, comment: "修改人"),
  2795. update_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "修改人名称")
  2796. .Annotation("MySql:CharSet", "utf8mb4"),
  2797. update_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改时间"),
  2798. tenant_id = table.Column<long>(type: "bigint", nullable: false, comment: "企业ID"),
  2799. factory_id = table.Column<long>(type: "bigint", nullable: true, comment: "工厂ID"),
  2800. org_id = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
  2801. IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: false, comment: "删除标识")
  2802. },
  2803. constraints: table =>
  2804. {
  2805. table.PrimaryKey("PK_srm_purchase", x => x.ic_purchase_id);
  2806. },
  2807. comment: "物料采购信息表")
  2808. .Annotation("MySql:CharSet", "utf8mb4");
  2809. migrationBuilder.CreateTable(
  2810. name: "srm_supplier",
  2811. columns: table => new
  2812. {
  2813. supplier_id = table.Column<long>(type: "bigint", nullable: false, comment: "供应商主键id")
  2814. .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
  2815. supplier_no = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "供应商编号")
  2816. .Annotation("MySql:CharSet", "utf8mb4"),
  2817. supplier_name = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: true, comment: "供应商名称")
  2818. .Annotation("MySql:CharSet", "utf8mb4"),
  2819. supplier_full_name = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: true, comment: "供应商全称")
  2820. .Annotation("MySql:CharSet", "utf8mb4"),
  2821. supplier_help_code = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "供应商助记码")
  2822. .Annotation("MySql:CharSet", "utf8mb4"),
  2823. supplier_short_name = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: true, comment: "供应商简称")
  2824. .Annotation("MySql:CharSet", "utf8mb4"),
  2825. supplier_address = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: true, comment: "供应商地址")
  2826. .Annotation("MySql:CharSet", "utf8mb4"),
  2827. state = table.Column<string>(type: "longtext", nullable: true, comment: "状态")
  2828. .Annotation("MySql:CharSet", "utf8mb4"),
  2829. region = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: true, comment: "区域")
  2830. .Annotation("MySql:CharSet", "utf8mb4"),
  2831. trade = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: true, comment: "行业")
  2832. .Annotation("MySql:CharSet", "utf8mb4"),
  2833. contact = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "联系人")
  2834. .Annotation("MySql:CharSet", "utf8mb4"),
  2835. telephone = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "联系电话")
  2836. .Annotation("MySql:CharSet", "utf8mb4"),
  2837. mobile = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "移动电话")
  2838. .Annotation("MySql:CharSet", "utf8mb4"),
  2839. fax = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "传真号码")
  2840. .Annotation("MySql:CharSet", "utf8mb4"),
  2841. post_code = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "邮政编码")
  2842. .Annotation("MySql:CharSet", "utf8mb4"),
  2843. email = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "邮件地址")
  2844. .Annotation("MySql:CharSet", "utf8mb4"),
  2845. taxid = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: true, comment: "税务登记号")
  2846. .Annotation("MySql:CharSet", "utf8mb4"),
  2847. bank = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: true, comment: "开户银行")
  2848. .Annotation("MySql:CharSet", "utf8mb4"),
  2849. bank_account = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "银行账号")
  2850. .Annotation("MySql:CharSet", "utf8mb4"),
  2851. value_add_rate = table.Column<decimal>(type: "decimal(18,10)", precision: 18, scale: 10, nullable: true, comment: "增值税率"),
  2852. type = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "供应商分类")
  2853. .Annotation("MySql:CharSet", "utf8mb4"),
  2854. po_mode = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "采购模式")
  2855. .Annotation("MySql:CharSet", "utf8mb4"),
  2856. vmi_stock = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: true, comment: "VMI仓")
  2857. .Annotation("MySql:CharSet", "utf8mb4"),
  2858. stockid_assignee = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: true, comment: "受托代销虚仓")
  2859. .Annotation("MySql:CharSet", "utf8mb4"),
  2860. branch_info = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: true, comment: "分支机构信息")
  2861. .Annotation("MySql:CharSet", "utf8mb4"),
  2862. regmark = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: true, comment: "注册商标")
  2863. .Annotation("MySql:CharSet", "utf8mb4"),
  2864. licence = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: true, comment: "营业执照")
  2865. .Annotation("MySql:CharSet", "utf8mb4"),
  2866. regster_date = table.Column<DateTime>(type: "datetime", nullable: true, comment: "注册日期"),
  2867. approve_date = table.Column<DateTime>(type: "datetime", nullable: true, comment: "批准日期"),
  2868. begin_day = table.Column<DateTime>(type: "datetime", nullable: true, comment: "生效日期"),
  2869. end_day = table.Column<DateTime>(type: "datetime", nullable: true, comment: "失效日期"),
  2870. supply_grade = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "供应商等级")
  2871. .Annotation("MySql:CharSet", "utf8mb4"),
  2872. supply_type = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "供应类别")
  2873. .Annotation("MySql:CharSet", "utf8mb4"),
  2874. company_type = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "公司类别")
  2875. .Annotation("MySql:CharSet", "utf8mb4"),
  2876. auto_create_mr = table.Column<bool>(type: "tinyint(1)", nullable: true, comment: "交货自动生成收货单据"),
  2877. auto_validate_order = table.Column<bool>(type: "tinyint(1)", nullable: true, comment: "自动确认订单"),
  2878. isuse_supplier_portal = table.Column<bool>(type: "tinyint(1)", nullable: true, comment: "启用供应商门户"),
  2879. department = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "分管部门")
  2880. .Annotation("MySql:CharSet", "utf8mb4"),
  2881. employee_name = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "专营业务员")
  2882. .Annotation("MySql:CharSet", "utf8mb4"),
  2883. employee_no = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "专营业务员_工号")
  2884. .Annotation("MySql:CharSet", "utf8mb4"),
  2885. currency = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "结算币种")
  2886. .Annotation("MySql:CharSet", "utf8mb4"),
  2887. settlement = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "结算方式")
  2888. .Annotation("MySql:CharSet", "utf8mb4"),
  2889. name_en = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: true, comment: "英文名称")
  2890. .Annotation("MySql:CharSet", "utf8mb4"),
  2891. addr_en = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: true, comment: "英文地址")
  2892. .Annotation("MySql:CharSet", "utf8mb4"),
  2893. country = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: true, comment: "国别地区")
  2894. .Annotation("MySql:CharSet", "utf8mb4"),
  2895. checker = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "审核人")
  2896. .Annotation("MySql:CharSet", "utf8mb4"),
  2897. op_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "操作时间"),
  2898. create_by = table.Column<long>(type: "bigint", nullable: true, comment: "创建人id"),
  2899. create_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "创建人名称")
  2900. .Annotation("MySql:CharSet", "utf8mb4"),
  2901. create_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "创建时间"),
  2902. update_by = table.Column<long>(type: "bigint", nullable: true, comment: "修改人"),
  2903. update_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "修改人名称")
  2904. .Annotation("MySql:CharSet", "utf8mb4"),
  2905. update_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改时间"),
  2906. tenant_id = table.Column<long>(type: "bigint", nullable: false, comment: "企业ID"),
  2907. factory_id = table.Column<long>(type: "bigint", nullable: true, comment: "工厂ID"),
  2908. org_id = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
  2909. IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: false, comment: "删除标识")
  2910. },
  2911. constraints: table =>
  2912. {
  2913. table.PrimaryKey("PK_srm_supplier", x => x.supplier_id);
  2914. },
  2915. comment: "供应商表")
  2916. .Annotation("MySql:CharSet", "utf8mb4");
  2917. migrationBuilder.CreateTable(
  2918. name: "sys_code",
  2919. columns: table => new
  2920. {
  2921. sys_code_id = table.Column<long>(type: "bigint", nullable: false, comment: "主键id")
  2922. .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
  2923. code_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false, comment: "编码生成名称")
  2924. .Annotation("MySql:CharSet", "utf8mb4"),
  2925. code_rule = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false, comment: "编码生成规则")
  2926. .Annotation("MySql:CharSet", "utf8mb4"),
  2927. code_date = table.Column<DateTime>(type: "datetime", nullable: false, comment: "编码生成时间"),
  2928. code_value = table.Column<long>(type: "bigint", nullable: false, comment: "编码生成当前值"),
  2929. chinese_name = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: true, comment: "中文注释")
  2930. .Annotation("MySql:CharSet", "utf8mb4")
  2931. },
  2932. constraints: table =>
  2933. {
  2934. table.PrimaryKey("PK_sys_code", x => x.sys_code_id);
  2935. },
  2936. comment: "系统编码表")
  2937. .Annotation("MySql:CharSet", "utf8mb4");
  2938. migrationBuilder.CreateTable(
  2939. name: "sys_code_pre",
  2940. columns: table => new
  2941. {
  2942. id = table.Column<long>(type: "bigint", nullable: false, comment: "主键id")
  2943. .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
  2944. code_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false, comment: "编码生成名称")
  2945. .Annotation("MySql:CharSet", "utf8mb4"),
  2946. pre_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false, comment: "编码生成前置名称")
  2947. .Annotation("MySql:CharSet", "utf8mb4"),
  2948. code_date = table.Column<DateTime>(type: "datetime", nullable: false, comment: "编码生成时间"),
  2949. code_value = table.Column<long>(type: "bigint", nullable: false, comment: "编码生成当前值")
  2950. },
  2951. constraints: table =>
  2952. {
  2953. table.PrimaryKey("PK_sys_code_pre", x => x.id);
  2954. },
  2955. comment: "系统编码前置表")
  2956. .Annotation("MySql:CharSet", "utf8mb4");
  2957. migrationBuilder.CreateTable(
  2958. name: "sys_config",
  2959. columns: table => new
  2960. {
  2961. config_id = table.Column<long>(type: "bigint", nullable: false, comment: "主键id")
  2962. .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
  2963. type = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false, comment: "配置类型")
  2964. .Annotation("MySql:CharSet", "utf8mb4"),
  2965. financeis_close = table.Column<bool>(type: "tinyint(1)", nullable: false, comment: "账务状态(0-关帐,1-开帐)"),
  2966. next_open_date = table.Column<DateTime>(type: "datetime", nullable: true, comment: "下一个开帐日期"),
  2967. is_show = table.Column<bool>(type: "tinyint(1)", nullable: false, comment: "是否显示(0不显示、1显示)")
  2968. },
  2969. constraints: table =>
  2970. {
  2971. table.PrimaryKey("PK_sys_config", x => x.config_id);
  2972. },
  2973. comment: "系统配置表")
  2974. .Annotation("MySql:CharSet", "utf8mb4");
  2975. migrationBuilder.CreateTable(
  2976. name: "sys_measure_unit",
  2977. columns: table => new
  2978. {
  2979. unit_id = table.Column<long>(type: "bigint", nullable: false, comment: "主键id")
  2980. .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
  2981. unit_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "单位名称")
  2982. .Annotation("MySql:CharSet", "utf8mb4"),
  2983. unit_code = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "单位编码")
  2984. .Annotation("MySql:CharSet", "utf8mb4"),
  2985. is_standard = table.Column<bool>(type: "tinyint(1)", nullable: false, comment: "是否是标准单位0-否,1是"),
  2986. status = table.Column<bool>(type: "tinyint(1)", nullable: false, comment: "状态:0-无效,1-有效")
  2987. },
  2988. constraints: table =>
  2989. {
  2990. table.PrimaryKey("PK_sys_measure_unit", x => x.unit_id);
  2991. },
  2992. comment: "计量单位表")
  2993. .Annotation("MySql:CharSet", "utf8mb4");
  2994. migrationBuilder.CreateTable(
  2995. name: "sys_post",
  2996. columns: table => new
  2997. {
  2998. post_id = table.Column<long>(type: "bigint", nullable: false, comment: "主键id")
  2999. .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
  3000. post_code = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "岗位编码")
  3001. .Annotation("MySql:CharSet", "utf8mb4"),
  3002. post_name = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: true, comment: "岗位名称")
  3003. .Annotation("MySql:CharSet", "utf8mb4"),
  3004. post_remark = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: true, comment: "岗位备注")
  3005. .Annotation("MySql:CharSet", "utf8mb4"),
  3006. post_level = table.Column<int>(type: "int", nullable: true, comment: "岗位级别"),
  3007. post_path = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: true, comment: "岗位路径")
  3008. .Annotation("MySql:CharSet", "utf8mb4"),
  3009. post_sort = table.Column<int>(type: "int", nullable: true, comment: "岗位排序"),
  3010. parent_id = table.Column<long>(type: "bigint", nullable: true, comment: "上级岗位"),
  3011. dept_id = table.Column<long>(type: "bigint", nullable: true, comment: "部门id"),
  3012. state = table.Column<bool>(type: "tinyint(255)", maxLength: 255, nullable: false, comment: "数据状态标识 1启用 -1停用"),
  3013. create_by = table.Column<long>(type: "bigint", nullable: true, comment: "创建人id"),
  3014. create_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "创建人名称")
  3015. .Annotation("MySql:CharSet", "utf8mb4"),
  3016. create_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "创建时间"),
  3017. update_by = table.Column<long>(type: "bigint", nullable: true, comment: "修改人"),
  3018. update_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "修改人名称")
  3019. .Annotation("MySql:CharSet", "utf8mb4"),
  3020. update_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改时间"),
  3021. tenant_id = table.Column<long>(type: "bigint", nullable: false, comment: "企业ID"),
  3022. factory_id = table.Column<long>(type: "bigint", nullable: true, comment: "工厂ID"),
  3023. org_id = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
  3024. IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: false, comment: "删除标识")
  3025. },
  3026. constraints: table =>
  3027. {
  3028. table.PrimaryKey("PK_sys_post", x => x.post_id);
  3029. },
  3030. comment: "岗位表")
  3031. .Annotation("MySql:CharSet", "utf8mb4");
  3032. migrationBuilder.CreateTable(
  3033. name: "sys_post_staff",
  3034. columns: table => new
  3035. {
  3036. id = table.Column<long>(type: "bigint", nullable: false, comment: "主键id")
  3037. .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
  3038. staff_id = table.Column<long>(type: "bigint", nullable: false, comment: "员工id"),
  3039. post_id = table.Column<long>(type: "bigint", nullable: false, comment: "岗位id"),
  3040. create_by = table.Column<long>(type: "bigint", nullable: true, comment: "创建人id"),
  3041. create_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "创建人名称")
  3042. .Annotation("MySql:CharSet", "utf8mb4"),
  3043. create_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "创建时间"),
  3044. update_by = table.Column<long>(type: "bigint", nullable: true, comment: "修改人"),
  3045. update_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "修改人名称")
  3046. .Annotation("MySql:CharSet", "utf8mb4"),
  3047. update_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改时间"),
  3048. tenant_id = table.Column<long>(type: "bigint", nullable: false, comment: "企业ID"),
  3049. factory_id = table.Column<long>(type: "bigint", nullable: true, comment: "工厂ID"),
  3050. org_id = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
  3051. IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: false, comment: "删除标识")
  3052. },
  3053. constraints: table =>
  3054. {
  3055. table.PrimaryKey("PK_sys_post_staff", x => x.id);
  3056. },
  3057. comment: "员工岗位关联表")
  3058. .Annotation("MySql:CharSet", "utf8mb4");
  3059. migrationBuilder.CreateTable(
  3060. name: "sys_schedule",
  3061. columns: table => new
  3062. {
  3063. schedule_id = table.Column<long>(type: "bigint", nullable: false, comment: "班次主键id")
  3064. .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
  3065. schedule_no = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "班次编码")
  3066. .Annotation("MySql:CharSet", "utf8mb4"),
  3067. schedule_name = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: true, comment: "班次名称")
  3068. .Annotation("MySql:CharSet", "utf8mb4"),
  3069. schedule_start_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "起始工作时间"),
  3070. schedule_end_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "结束工作时间"),
  3071. is_across = table.Column<bool>(type: "tinyint(1)", nullable: false, comment: "是否跨天 1是 0否"),
  3072. remark = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: true, comment: "备注")
  3073. .Annotation("MySql:CharSet", "utf8mb4"),
  3074. validate_hours = table.Column<int>(type: "int", nullable: true, comment: "有效时长"),
  3075. work_hours = table.Column<int>(type: "int", nullable: true, comment: "工作时长"),
  3076. state = table.Column<bool>(type: "tinyint(1)", nullable: false, comment: "数据状态标识 1启用 0停用"),
  3077. create_by = table.Column<long>(type: "bigint", nullable: true, comment: "创建人id"),
  3078. create_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "创建人名称")
  3079. .Annotation("MySql:CharSet", "utf8mb4"),
  3080. create_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "创建时间"),
  3081. update_by = table.Column<long>(type: "bigint", nullable: true, comment: "修改人"),
  3082. update_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "修改人名称")
  3083. .Annotation("MySql:CharSet", "utf8mb4"),
  3084. update_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改时间"),
  3085. tenant_id = table.Column<long>(type: "bigint", nullable: false, comment: "企业ID"),
  3086. factory_id = table.Column<long>(type: "bigint", nullable: true, comment: "工厂ID"),
  3087. org_id = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
  3088. IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: false, comment: "删除标识")
  3089. },
  3090. constraints: table =>
  3091. {
  3092. table.PrimaryKey("PK_sys_schedule", x => x.schedule_id);
  3093. },
  3094. comment: "班次表")
  3095. .Annotation("MySql:CharSet", "utf8mb4");
  3096. migrationBuilder.CreateTable(
  3097. name: "sys_shift",
  3098. columns: table => new
  3099. {
  3100. shift_id = table.Column<long>(type: "bigint", nullable: false, comment: "主键id")
  3101. .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
  3102. shift_no = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "班制编码")
  3103. .Annotation("MySql:CharSet", "utf8mb4"),
  3104. shift_name = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: true, comment: "班制名称")
  3105. .Annotation("MySql:CharSet", "utf8mb4"),
  3106. is_across = table.Column<bool>(type: "tinyint(1)", nullable: false, comment: "岗位id"),
  3107. remark = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: true, comment: "备注")
  3108. .Annotation("MySql:CharSet", "utf8mb4"),
  3109. validate_hours = table.Column<int>(type: "int", nullable: true, comment: "有效时长"),
  3110. state = table.Column<bool>(type: "tinyint(1)", nullable: false, comment: "数据状态标识 1启用 0停用"),
  3111. create_by = table.Column<long>(type: "bigint", nullable: true, comment: "创建人id"),
  3112. create_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "创建人名称")
  3113. .Annotation("MySql:CharSet", "utf8mb4"),
  3114. create_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "创建时间"),
  3115. update_by = table.Column<long>(type: "bigint", nullable: true, comment: "修改人"),
  3116. update_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "修改人名称")
  3117. .Annotation("MySql:CharSet", "utf8mb4"),
  3118. update_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改时间"),
  3119. tenant_id = table.Column<long>(type: "bigint", nullable: false, comment: "企业ID"),
  3120. factory_id = table.Column<long>(type: "bigint", nullable: true, comment: "工厂ID"),
  3121. org_id = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
  3122. IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: false, comment: "删除标识")
  3123. },
  3124. constraints: table =>
  3125. {
  3126. table.PrimaryKey("PK_sys_shift", x => x.shift_id);
  3127. },
  3128. comment: "班制表")
  3129. .Annotation("MySql:CharSet", "utf8mb4");
  3130. migrationBuilder.CreateTable(
  3131. name: "sys_shift_invalid_time",
  3132. columns: table => new
  3133. {
  3134. invalid_time_id = table.Column<long>(type: "bigint", nullable: false, comment: "数据状态标识 1启用 0停用")
  3135. .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
  3136. schedule_id = table.Column<long>(type: "bigint", nullable: false, comment: "班次id"),
  3137. start_time = table.Column<DateTime>(type: "datetime", nullable: false, comment: "开始时间"),
  3138. end_time = table.Column<DateTime>(type: "datetime", nullable: false, comment: "结束时间"),
  3139. create_by = table.Column<long>(type: "bigint", nullable: true, comment: "创建人id"),
  3140. create_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "创建人名称")
  3141. .Annotation("MySql:CharSet", "utf8mb4"),
  3142. create_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "创建时间"),
  3143. update_by = table.Column<long>(type: "bigint", nullable: true, comment: "修改人"),
  3144. update_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "修改人名称")
  3145. .Annotation("MySql:CharSet", "utf8mb4"),
  3146. update_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改时间"),
  3147. tenant_id = table.Column<long>(type: "bigint", nullable: false, comment: "企业ID"),
  3148. factory_id = table.Column<long>(type: "bigint", nullable: true, comment: "工厂ID"),
  3149. org_id = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
  3150. IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: false, comment: "删除标识")
  3151. },
  3152. constraints: table =>
  3153. {
  3154. table.PrimaryKey("PK_sys_shift_invalid_time", x => x.invalid_time_id);
  3155. },
  3156. comment: "班次无效时间表")
  3157. .Annotation("MySql:CharSet", "utf8mb4");
  3158. migrationBuilder.CreateTable(
  3159. name: "sys_shift_schedule",
  3160. columns: table => new
  3161. {
  3162. id = table.Column<long>(type: "bigint", nullable: false, comment: "主键id")
  3163. .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
  3164. shift_id = table.Column<long>(type: "bigint", maxLength: 50, nullable: false, comment: "班制id"),
  3165. schedule_id = table.Column<long>(type: "bigint", maxLength: 255, nullable: false, comment: "班次id"),
  3166. create_by = table.Column<long>(type: "bigint", nullable: true, comment: "创建人id"),
  3167. create_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "创建人名称")
  3168. .Annotation("MySql:CharSet", "utf8mb4"),
  3169. create_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "创建时间"),
  3170. update_by = table.Column<long>(type: "bigint", nullable: true, comment: "修改人"),
  3171. update_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "修改人名称")
  3172. .Annotation("MySql:CharSet", "utf8mb4"),
  3173. update_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改时间"),
  3174. tenant_id = table.Column<long>(type: "bigint", nullable: false, comment: "企业ID"),
  3175. factory_id = table.Column<long>(type: "bigint", nullable: true, comment: "工厂ID"),
  3176. org_id = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
  3177. IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: false, comment: "删除标识")
  3178. },
  3179. constraints: table =>
  3180. {
  3181. table.PrimaryKey("PK_sys_shift_schedule", x => x.id);
  3182. },
  3183. comment: "班制班次关联表")
  3184. .Annotation("MySql:CharSet", "utf8mb4");
  3185. migrationBuilder.CreateTable(
  3186. name: "sys_staff",
  3187. columns: table => new
  3188. {
  3189. staff_id = table.Column<long>(type: "bigint", nullable: false, comment: "主键id")
  3190. .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
  3191. staff_no = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "员工编码")
  3192. .Annotation("MySql:CharSet", "utf8mb4"),
  3193. user_id = table.Column<long>(type: "bigint", nullable: true, comment: "用户id"),
  3194. user_name = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: true, comment: "用户名称")
  3195. .Annotation("MySql:CharSet", "utf8mb4"),
  3196. chinese_name = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: true, comment: "中文名")
  3197. .Annotation("MySql:CharSet", "utf8mb4"),
  3198. phone = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "电话")
  3199. .Annotation("MySql:CharSet", "utf8mb4"),
  3200. photo = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: true, comment: "照片")
  3201. .Annotation("MySql:CharSet", "utf8mb4"),
  3202. org_name = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: true, comment: "组织名称")
  3203. .Annotation("MySql:CharSet", "utf8mb4"),
  3204. birthday = table.Column<DateOnly>(type: "date", nullable: true, comment: "生日"),
  3205. email = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: true, comment: "邮箱")
  3206. .Annotation("MySql:CharSet", "utf8mb4"),
  3207. sex = table.Column<string>(type: "varchar(1)", maxLength: 1, nullable: true, comment: "性别 1 男 2 女")
  3208. .Annotation("MySql:CharSet", "utf8mb4"),
  3209. card_no = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "卡号")
  3210. .Annotation("MySql:CharSet", "utf8mb4"),
  3211. emp_no = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "工号")
  3212. .Annotation("MySql:CharSet", "utf8mb4"),
  3213. id_no = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "身份证号")
  3214. .Annotation("MySql:CharSet", "utf8mb4"),
  3215. mobile = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "移动电话")
  3216. .Annotation("MySql:CharSet", "utf8mb4"),
  3217. politics = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "政治面貌")
  3218. .Annotation("MySql:CharSet", "utf8mb4"),
  3219. staff_remark = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: true, comment: "备注")
  3220. .Annotation("MySql:CharSet", "utf8mb4"),
  3221. dept_id = table.Column<long>(type: "bigint", nullable: true, comment: "部门id"),
  3222. dept_no = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "部门编号")
  3223. .Annotation("MySql:CharSet", "utf8mb4"),
  3224. dept_name = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: true, comment: "部门名称")
  3225. .Annotation("MySql:CharSet", "utf8mb4"),
  3226. state = table.Column<bool>(type: "tinyint(255)", maxLength: 255, nullable: false, comment: "数据状态标识 1启用 0停用"),
  3227. create_by = table.Column<long>(type: "bigint", nullable: true, comment: "创建人id"),
  3228. create_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "创建人名称")
  3229. .Annotation("MySql:CharSet", "utf8mb4"),
  3230. create_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "创建时间"),
  3231. update_by = table.Column<long>(type: "bigint", nullable: true, comment: "修改人"),
  3232. update_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "修改人名称")
  3233. .Annotation("MySql:CharSet", "utf8mb4"),
  3234. update_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改时间"),
  3235. tenant_id = table.Column<long>(type: "bigint", nullable: false, comment: "企业ID"),
  3236. factory_id = table.Column<long>(type: "bigint", nullable: true, comment: "工厂ID"),
  3237. org_id = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
  3238. IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: false, comment: "删除标识")
  3239. },
  3240. constraints: table =>
  3241. {
  3242. table.PrimaryKey("PK_sys_staff", x => x.staff_id);
  3243. },
  3244. comment: "员工表")
  3245. .Annotation("MySql:CharSet", "utf8mb4");
  3246. migrationBuilder.CreateTable(
  3247. name: "sys_upload",
  3248. columns: table => new
  3249. {
  3250. upload_id = table.Column<long>(type: "bigint", nullable: false, comment: "主键id")
  3251. .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
  3252. file_url = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: true, comment: "文件存储路径")
  3253. .Annotation("MySql:CharSet", "utf8mb4"),
  3254. data_type = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: true, comment: "文件数据类型")
  3255. .Annotation("MySql:CharSet", "utf8mb4"),
  3256. file_type = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: true, comment: "文件后缀")
  3257. .Annotation("MySql:CharSet", "utf8mb4"),
  3258. original_file_name = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: true, comment: "源文件名称")
  3259. .Annotation("MySql:CharSet", "utf8mb4")
  3260. },
  3261. constraints: table =>
  3262. {
  3263. table.PrimaryKey("PK_sys_upload", x => x.upload_id);
  3264. },
  3265. comment: "文件上传表")
  3266. .Annotation("MySql:CharSet", "utf8mb4");
  3267. migrationBuilder.CreateTable(
  3268. name: "wms_prdprogress",
  3269. columns: table => new
  3270. {
  3271. progress_id = table.Column<long>(type: "bigint", nullable: false, comment: "进度字典主键id")
  3272. .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
  3273. prdprog_type = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: true, comment: "进度类型")
  3274. .Annotation("MySql:CharSet", "utf8mb4"),
  3275. prdprog_name = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: true, comment: "进度名称")
  3276. .Annotation("MySql:CharSet", "utf8mb4"),
  3277. prdprog_seq = table.Column<int>(type: "int", nullable: false, comment: "进度顺序"),
  3278. state = table.Column<bool>(type: "tinyint(1)", nullable: false, comment: "进度状态1启用0停用"),
  3279. create_by = table.Column<long>(type: "bigint", nullable: true, comment: "创建人id"),
  3280. create_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "创建人名称")
  3281. .Annotation("MySql:CharSet", "utf8mb4"),
  3282. create_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "创建时间"),
  3283. update_by = table.Column<long>(type: "bigint", nullable: true, comment: "修改人"),
  3284. update_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "修改人名称")
  3285. .Annotation("MySql:CharSet", "utf8mb4"),
  3286. update_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改时间"),
  3287. tenant_id = table.Column<long>(type: "bigint", nullable: false, comment: "企业ID"),
  3288. factory_id = table.Column<long>(type: "bigint", nullable: true, comment: "工厂ID"),
  3289. org_id = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
  3290. IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: false, comment: "删除标识")
  3291. },
  3292. constraints: table =>
  3293. {
  3294. table.PrimaryKey("PK_wms_prdprogress", x => x.progress_id);
  3295. },
  3296. comment: "进度字典")
  3297. .Annotation("MySql:CharSet", "utf8mb4");
  3298. migrationBuilder.CreateTable(
  3299. name: "wms_shipnotice",
  3300. columns: table => new
  3301. {
  3302. shipnotice_id = table.Column<long>(type: "bigint", nullable: false, comment: "发运通知单主键id")
  3303. .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
  3304. shipnotice_no = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: false, comment: "发运通知单号")
  3305. .Annotation("MySql:CharSet", "utf8mb4"),
  3306. shipplan_id = table.Column<long>(type: "bigint", nullable: false, comment: "发货计划id"),
  3307. shipplan_no = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "发货计划号")
  3308. .Annotation("MySql:CharSet", "utf8mb4"),
  3309. shipnotice_date = table.Column<DateTime>(type: "datetime", nullable: false, comment: "发运时间"),
  3310. state = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: false, comment: "状态")
  3311. .Annotation("MySql:CharSet", "utf8mb4"),
  3312. address = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: true, comment: "发运地址")
  3313. .Annotation("MySql:CharSet", "utf8mb4"),
  3314. create_by = table.Column<long>(type: "bigint", nullable: true, comment: "创建人id"),
  3315. create_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "创建人名称")
  3316. .Annotation("MySql:CharSet", "utf8mb4"),
  3317. create_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "创建时间"),
  3318. update_by = table.Column<long>(type: "bigint", nullable: true, comment: "修改人"),
  3319. update_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "修改人名称")
  3320. .Annotation("MySql:CharSet", "utf8mb4"),
  3321. update_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改时间"),
  3322. tenant_id = table.Column<long>(type: "bigint", nullable: false, comment: "企业ID"),
  3323. factory_id = table.Column<long>(type: "bigint", nullable: true, comment: "工厂ID"),
  3324. org_id = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
  3325. IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: false, comment: "删除标识")
  3326. },
  3327. constraints: table =>
  3328. {
  3329. table.PrimaryKey("PK_wms_shipnotice", x => x.shipnotice_id);
  3330. },
  3331. comment: "发货通知单")
  3332. .Annotation("MySql:CharSet", "utf8mb4");
  3333. migrationBuilder.CreateTable(
  3334. name: "wms_shipnoticelist",
  3335. columns: table => new
  3336. {
  3337. shipnoticelist_id = table.Column<long>(type: "bigint", nullable: false, comment: "发运通知单详情id")
  3338. .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
  3339. shipnotice_id = table.Column<long>(type: "bigint", maxLength: 80, nullable: false, comment: "发货计划号"),
  3340. shipplanlist_id = table.Column<long>(type: "bigint", nullable: true, comment: "发货详情id"),
  3341. shipplanl_soid = table.Column<long>(type: "bigint", nullable: true, comment: "销售单id"),
  3342. shipplanl_sono = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "销售单号")
  3343. .Annotation("MySql:CharSet", "utf8mb4"),
  3344. shipplanl_soeid = table.Column<int>(type: "int", nullable: true, comment: "销售单行号"),
  3345. shipnotice_custid = table.Column<long>(type: "bigint", nullable: true, comment: "客户id"),
  3346. shipnotice_custno = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "客户编号")
  3347. .Annotation("MySql:CharSet", "utf8mb4"),
  3348. shipnotice_custname = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: true, comment: "客户名称")
  3349. .Annotation("MySql:CharSet", "utf8mb4"),
  3350. shipplanl_iqty = table.Column<decimal>(type: "decimal(20,10)", precision: 20, scale: 10, nullable: true, comment: "计划发货数量"),
  3351. shipplanl_fqty = table.Column<decimal>(type: "decimal(20,10)", precision: 20, scale: 10, nullable: true, comment: "实际发货数量"),
  3352. state = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: false, comment: "状态")
  3353. .Annotation("MySql:CharSet", "utf8mb4"),
  3354. address = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: true, comment: "发运地址")
  3355. .Annotation("MySql:CharSet", "utf8mb4"),
  3356. create_by = table.Column<long>(type: "bigint", nullable: true, comment: "创建人id"),
  3357. create_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "创建人名称")
  3358. .Annotation("MySql:CharSet", "utf8mb4"),
  3359. create_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "创建时间"),
  3360. update_by = table.Column<long>(type: "bigint", nullable: true, comment: "修改人"),
  3361. update_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "修改人名称")
  3362. .Annotation("MySql:CharSet", "utf8mb4"),
  3363. update_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改时间"),
  3364. tenant_id = table.Column<long>(type: "bigint", nullable: false, comment: "企业ID"),
  3365. factory_id = table.Column<long>(type: "bigint", nullable: true, comment: "工厂ID"),
  3366. org_id = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
  3367. IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: false, comment: "删除标识")
  3368. },
  3369. constraints: table =>
  3370. {
  3371. table.PrimaryKey("PK_wms_shipnoticelist", x => x.shipnoticelist_id);
  3372. },
  3373. comment: "发货通知单明细表")
  3374. .Annotation("MySql:CharSet", "utf8mb4");
  3375. migrationBuilder.CreateTable(
  3376. name: "wms_shipplan",
  3377. columns: table => new
  3378. {
  3379. shipplan_id = table.Column<long>(type: "bigint", nullable: false, comment: "发货计划表主键")
  3380. .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
  3381. shipplan_no = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "发货计划编号")
  3382. .Annotation("MySql:CharSet", "utf8mb4"),
  3383. shipplan_date = table.Column<DateTime>(type: "datetime", nullable: true, comment: "发货计划时间"),
  3384. state = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: true, comment: "状态")
  3385. .Annotation("MySql:CharSet", "utf8mb4"),
  3386. create_by = table.Column<long>(type: "bigint", nullable: true, comment: "创建人id"),
  3387. create_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "创建人名称")
  3388. .Annotation("MySql:CharSet", "utf8mb4"),
  3389. create_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "创建时间"),
  3390. update_by = table.Column<long>(type: "bigint", nullable: true, comment: "修改人"),
  3391. update_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "修改人名称")
  3392. .Annotation("MySql:CharSet", "utf8mb4"),
  3393. update_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改时间"),
  3394. tenant_id = table.Column<long>(type: "bigint", nullable: false, comment: "企业ID"),
  3395. factory_id = table.Column<long>(type: "bigint", nullable: true, comment: "工厂ID"),
  3396. org_id = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
  3397. IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: false, comment: "删除标识")
  3398. },
  3399. constraints: table =>
  3400. {
  3401. table.PrimaryKey("PK_wms_shipplan", x => x.shipplan_id);
  3402. },
  3403. comment: "发货计划表")
  3404. .Annotation("MySql:CharSet", "utf8mb4");
  3405. migrationBuilder.CreateTable(
  3406. name: "work_calendar",
  3407. columns: table => new
  3408. {
  3409. work_calendar_id = table.Column<long>(type: "bigint", nullable: false, comment: "工作日历主键")
  3410. .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
  3411. work_calendar_no = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: true, comment: "工作日历编码")
  3412. .Annotation("MySql:CharSet", "utf8mb4"),
  3413. work_calendar_name = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: true, comment: "工作日历名称")
  3414. .Annotation("MySql:CharSet", "utf8mb4"),
  3415. shift_id = table.Column<long>(type: "bigint", nullable: true, comment: "班制id"),
  3416. start_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "开始时间"),
  3417. end_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "结束时间"),
  3418. standard_period = table.Column<int>(type: "int", nullable: true, comment: "标准周期"),
  3419. work_period = table.Column<int>(type: "int", nullable: true, comment: "工作周期"),
  3420. rest_period = table.Column<int>(type: "int", nullable: true, comment: "休息周期"),
  3421. calendar1 = table.Column<int>(type: "int", nullable: true, comment: "周1"),
  3422. calendar2 = table.Column<int>(type: "int", nullable: true, comment: "周2"),
  3423. calendar3 = table.Column<int>(type: "int", nullable: true, comment: "周3"),
  3424. calendar4 = table.Column<int>(type: "int", nullable: true, comment: "周4"),
  3425. calendar5 = table.Column<int>(type: "int", nullable: true, comment: "周5"),
  3426. calendar6 = table.Column<int>(type: "int", nullable: true, comment: "周6"),
  3427. calendar7 = table.Column<int>(type: "int", nullable: true, comment: "周7"),
  3428. create_by = table.Column<long>(type: "bigint", nullable: true, comment: "创建人id"),
  3429. create_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "创建人名称")
  3430. .Annotation("MySql:CharSet", "utf8mb4"),
  3431. create_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "创建时间"),
  3432. update_by = table.Column<long>(type: "bigint", nullable: true, comment: "修改人"),
  3433. update_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "修改人名称")
  3434. .Annotation("MySql:CharSet", "utf8mb4"),
  3435. update_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改时间"),
  3436. tenant_id = table.Column<long>(type: "bigint", nullable: false, comment: "企业ID"),
  3437. factory_id = table.Column<long>(type: "bigint", nullable: true, comment: "工厂ID"),
  3438. org_id = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
  3439. IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: false, comment: "删除标识")
  3440. },
  3441. constraints: table =>
  3442. {
  3443. table.PrimaryKey("PK_work_calendar", x => x.work_calendar_id);
  3444. },
  3445. comment: "工作日历表")
  3446. .Annotation("MySql:CharSet", "utf8mb4");
  3447. migrationBuilder.CreateTable(
  3448. name: "work_calendar_list",
  3449. columns: table => new
  3450. {
  3451. work_cal_list_id = table.Column<long>(type: "bigint", nullable: false, comment: "工作日历明细主键")
  3452. .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
  3453. work_calendar_id = table.Column<long>(type: "bigint", nullable: false, comment: "工作日历id"),
  3454. work_cal_list_date = table.Column<DateTime>(type: "datetime", nullable: true, comment: "日期"),
  3455. work_cal_list_type = table.Column<int>(type: "int", nullable: true, comment: "类型:1-工作日;0-休息日"),
  3456. work_cal_list_times = table.Column<int>(type: "int", nullable: true, comment: "工作时长(分钟)"),
  3457. work_cal_list_num = table.Column<int>(type: "int", nullable: true, comment: "班次数"),
  3458. create_by = table.Column<long>(type: "bigint", nullable: true, comment: "创建人id"),
  3459. create_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "创建人名称")
  3460. .Annotation("MySql:CharSet", "utf8mb4"),
  3461. create_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "创建时间"),
  3462. update_by = table.Column<long>(type: "bigint", nullable: true, comment: "修改人"),
  3463. update_by_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "修改人名称")
  3464. .Annotation("MySql:CharSet", "utf8mb4"),
  3465. update_time = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改时间"),
  3466. tenant_id = table.Column<long>(type: "bigint", nullable: false, comment: "企业ID"),
  3467. factory_id = table.Column<long>(type: "bigint", nullable: true, comment: "工厂ID"),
  3468. org_id = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
  3469. IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: false, comment: "删除标识")
  3470. },
  3471. constraints: table =>
  3472. {
  3473. table.PrimaryKey("PK_work_calendar_list", x => x.work_cal_list_id);
  3474. },
  3475. comment: "工作日历明细表")
  3476. .Annotation("MySql:CharSet", "utf8mb4");
  3477. migrationBuilder.CreateIndex(
  3478. name: "IX_base_flow_FormId",
  3479. table: "base_flow",
  3480. column: "FormId");
  3481. migrationBuilder.CreateIndex(
  3482. name: "IX_base_form_workflow_EntityId",
  3483. table: "base_form_workflow",
  3484. column: "EntityId");
  3485. migrationBuilder.CreateIndex(
  3486. name: "IX_base_form_workflow_NodeId",
  3487. table: "base_form_workflow",
  3488. column: "NodeId");
  3489. }
  3490. protected override void Down(MigrationBuilder migrationBuilder)
  3491. {
  3492. migrationBuilder.DropTable(
  3493. name: "base_flow");
  3494. migrationBuilder.DropTable(
  3495. name: "base_flow_line");
  3496. migrationBuilder.DropTable(
  3497. name: "base_flow_line_form");
  3498. migrationBuilder.DropTable(
  3499. name: "base_flow_node");
  3500. migrationBuilder.DropTable(
  3501. name: "base_form");
  3502. migrationBuilder.DropTable(
  3503. name: "base_form_datas");
  3504. migrationBuilder.DropTable(
  3505. name: "base_form_fields");
  3506. migrationBuilder.DropTable(
  3507. name: "base_form_fields_opts");
  3508. migrationBuilder.DropTable(
  3509. name: "base_form_workflow");
  3510. migrationBuilder.DropTable(
  3511. name: "crm_customer");
  3512. migrationBuilder.DropTable(
  3513. name: "crm_seorder");
  3514. migrationBuilder.DropTable(
  3515. name: "crm_seorderentry");
  3516. migrationBuilder.DropTable(
  3517. name: "crm_seorderprog");
  3518. migrationBuilder.DropTable(
  3519. name: "crm_seorderreview");
  3520. migrationBuilder.DropTable(
  3521. name: "ic_bom");
  3522. migrationBuilder.DropTable(
  3523. name: "ic_bom_child");
  3524. migrationBuilder.DropTable(
  3525. name: "ic_factory_details");
  3526. migrationBuilder.DropTable(
  3527. name: "ic_item");
  3528. migrationBuilder.DropTable(
  3529. name: "ic_item_ie");
  3530. migrationBuilder.DropTable(
  3531. name: "ic_item_inventory");
  3532. migrationBuilder.DropTable(
  3533. name: "ic_item_pur");
  3534. migrationBuilder.DropTable(
  3535. name: "ic_item_stock");
  3536. migrationBuilder.DropTable(
  3537. name: "ic_metering_unit");
  3538. migrationBuilder.DropTable(
  3539. name: "ic_plan");
  3540. migrationBuilder.DropTable(
  3541. name: "ic_substitute");
  3542. migrationBuilder.DropTable(
  3543. name: "ic_substitute_all");
  3544. migrationBuilder.DropTable(
  3545. name: "ic_substitute_all_dtl");
  3546. migrationBuilder.DropTable(
  3547. name: "mes_loss_time_record");
  3548. migrationBuilder.DropTable(
  3549. name: "mes_meaction");
  3550. migrationBuilder.DropTable(
  3551. name: "mes_mebycard");
  3552. migrationBuilder.DropTable(
  3553. name: "mes_merecheck");
  3554. migrationBuilder.DropTable(
  3555. name: "mes_mereport");
  3556. migrationBuilder.DropTable(
  3557. name: "mes_moentry");
  3558. migrationBuilder.DropTable(
  3559. name: "mes_mooccupy");
  3560. migrationBuilder.DropTable(
  3561. name: "mes_morder");
  3562. migrationBuilder.DropTable(
  3563. name: "mes_morder_loss_time");
  3564. migrationBuilder.DropTable(
  3565. name: "mes_oorder");
  3566. migrationBuilder.DropTable(
  3567. name: "mes_prd_sendmat");
  3568. migrationBuilder.DropTable(
  3569. name: "mes_prd_sendmat_list");
  3570. migrationBuilder.DropTable(
  3571. name: "mes_prdlog");
  3572. migrationBuilder.DropTable(
  3573. name: "mes_process");
  3574. migrationBuilder.DropTable(
  3575. name: "mes_product_work_time");
  3576. migrationBuilder.DropTable(
  3577. name: "mes_schedule_occupy");
  3578. migrationBuilder.DropTable(
  3579. name: "mes_stock_enter");
  3580. migrationBuilder.DropTable(
  3581. name: "mes_stock_out");
  3582. migrationBuilder.DropTable(
  3583. name: "mes_stockoccupy");
  3584. migrationBuilder.DropTable(
  3585. name: "mes_swipe_card");
  3586. migrationBuilder.DropTable(
  3587. name: "mes_tech_proc_accessory");
  3588. migrationBuilder.DropTable(
  3589. name: "mes_tech_proc_document");
  3590. migrationBuilder.DropTable(
  3591. name: "mes_tech_proc_workshop");
  3592. migrationBuilder.DropTable(
  3593. name: "mes_tech_proc_workshop_equipment");
  3594. migrationBuilder.DropTable(
  3595. name: "mes_tech_proc_workshop_icitem");
  3596. migrationBuilder.DropTable(
  3597. name: "mes_tech_proc_workshop_staff");
  3598. migrationBuilder.DropTable(
  3599. name: "mes_tech_process");
  3600. migrationBuilder.DropTable(
  3601. name: "mes_technique");
  3602. migrationBuilder.DropTable(
  3603. name: "mes_workshop");
  3604. migrationBuilder.DropTable(
  3605. name: "mes_workshop_shelf");
  3606. migrationBuilder.DropTable(
  3607. name: "sim_base");
  3608. migrationBuilder.DropTable(
  3609. name: "sim_issue_type");
  3610. migrationBuilder.DropTable(
  3611. name: "sim_plant");
  3612. migrationBuilder.DropTable(
  3613. name: "sim_user_relation");
  3614. migrationBuilder.DropTable(
  3615. name: "srm_po_list");
  3616. migrationBuilder.DropTable(
  3617. name: "srm_po_main");
  3618. migrationBuilder.DropTable(
  3619. name: "srm_po_occupy");
  3620. migrationBuilder.DropTable(
  3621. name: "srm_pr_main");
  3622. migrationBuilder.DropTable(
  3623. name: "srm_purchase");
  3624. migrationBuilder.DropTable(
  3625. name: "srm_supplier");
  3626. migrationBuilder.DropTable(
  3627. name: "sys_code");
  3628. migrationBuilder.DropTable(
  3629. name: "sys_code_pre");
  3630. migrationBuilder.DropTable(
  3631. name: "sys_config");
  3632. migrationBuilder.DropTable(
  3633. name: "sys_measure_unit");
  3634. migrationBuilder.DropTable(
  3635. name: "sys_post");
  3636. migrationBuilder.DropTable(
  3637. name: "sys_post_staff");
  3638. migrationBuilder.DropTable(
  3639. name: "sys_schedule");
  3640. migrationBuilder.DropTable(
  3641. name: "sys_shift");
  3642. migrationBuilder.DropTable(
  3643. name: "sys_shift_invalid_time");
  3644. migrationBuilder.DropTable(
  3645. name: "sys_shift_schedule");
  3646. migrationBuilder.DropTable(
  3647. name: "sys_staff");
  3648. migrationBuilder.DropTable(
  3649. name: "sys_upload");
  3650. migrationBuilder.DropTable(
  3651. name: "wms_prdprogress");
  3652. migrationBuilder.DropTable(
  3653. name: "wms_shipnotice");
  3654. migrationBuilder.DropTable(
  3655. name: "wms_shipnoticelist");
  3656. migrationBuilder.DropTable(
  3657. name: "wms_shipplan");
  3658. migrationBuilder.DropTable(
  3659. name: "work_calendar");
  3660. migrationBuilder.DropTable(
  3661. name: "work_calendar_list");
  3662. }
  3663. }
  3664. }