From 1d60c6f97aa3f83123b5ad3133622df998b6909f Mon Sep 17 00:00:00 2001 From: fei550 <1420031550@qq.com> Date: Wed, 18 Sep 2024 10:48:34 +0800 Subject: [PATCH] =?UTF-8?q?=E7=84=8A=E6=8E=A5=E6=9D=90=E6=96=99=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .vs/SGGL_SeDin_New/v17/.wsuo | Bin 34304 -> 60928 bytes .vs/SGGL_SeDin_New/v17/DocumentLayout.json | 79 + DataBase/版本日志/SGGLDB_V2024-09-18.sql | 395 ++++ SGGL/BLL/BLL.csproj | 9 + SGGL/BLL/CLGL/TwArrivalStatisticsService.cs | 58 + SGGL/BLL/CLGL/TwConst.cs | 57 + SGGL/BLL/CLGL/TwInOutplandetailService.cs | 151 ++ SGGL/BLL/CLGL/TwInOutplanmasterService.cs | 477 ++++ SGGL/BLL/CLGL/TwInputdetailService.cs | 124 + SGGL/BLL/CLGL/TwInputmasterService.cs | 319 +++ SGGL/BLL/CLGL/TwMaterialstockService.cs | 157 ++ SGGL/BLL/CLGL/TwOutputdetailService..cs | 125 + SGGL/BLL/CLGL/TwOutputmasterService.cs | 329 +++ SGGL/BLL/Common/Const.cs | 25 + SGGL/BLL/DropListService.cs | 8 +- .../BLL/HJGL/WeldingManage/WeldTaskService.cs | 117 +- .../FineUIPro.Web/CLGL/ArrivalStatistics.aspx | 125 + .../CLGL/ArrivalStatistics.aspx.cs | 159 ++ .../CLGL/ArrivalStatistics.aspx.designer.cs | 143 ++ SGGL/FineUIPro.Web/CLGL/InPlanMaster.aspx | 188 ++ SGGL/FineUIPro.Web/CLGL/InPlanMaster.aspx.cs | 390 ++++ .../CLGL/InPlanMaster.aspx.designer.cs | 269 +++ .../CLGL/InPlanMasterDataIn.aspx | 35 + .../CLGL/InPlanMasterDataIn.aspx.cs | 146 ++ .../CLGL/InPlanMasterDataIn.aspx.designer.cs | 98 + SGGL/FineUIPro.Web/CLGL/InPlanMasterEdit.aspx | 179 ++ .../CLGL/InPlanMasterEdit.aspx.cs | 17 + .../CLGL/InPlanMasterEdit.aspx.designer.cs | 323 +++ SGGL/FineUIPro.Web/CLGL/InputMaster.aspx | 174 ++ SGGL/FineUIPro.Web/CLGL/InputMaster.aspx.cs | 285 +++ .../CLGL/InputMaster.aspx.designer.cs | 224 ++ SGGL/FineUIPro.Web/CLGL/InputMasterEdit.aspx | 16 + .../CLGL/InputMasterEdit.aspx.cs | 17 + .../CLGL/InputMasterEdit.aspx.designer.cs | 26 + SGGL/FineUIPro.Web/CLGL/MaterialStock.aspx | 122 + SGGL/FineUIPro.Web/CLGL/MaterialStock.aspx.cs | 223 ++ .../CLGL/MaterialStock.aspx.designer.cs | 116 + SGGL/FineUIPro.Web/CLGL/OutPlanMaster.aspx | 206 ++ SGGL/FineUIPro.Web/CLGL/OutPlanMaster.aspx.cs | 523 +++++ .../CLGL/OutPlanMaster.aspx.designer.cs | 305 +++ .../FineUIPro.Web/CLGL/OutPlanMasterEdit.aspx | 93 + .../CLGL/OutPlanMasterEdit.aspx.cs | 107 + .../CLGL/OutPlanMasterEdit.aspx.designer.cs | 152 ++ SGGL/FineUIPro.Web/CLGL/OutputMaster.aspx | 212 ++ SGGL/FineUIPro.Web/CLGL/OutputMaster.aspx.cs | 537 +++++ .../CLGL/OutputMaster.aspx.designer.cs | 296 +++ SGGL/FineUIPro.Web/CLGL/OutputMasterEdit.aspx | 21 + .../CLGL/OutputMasterEdit.aspx.cs | 17 + .../CLGL/OutputMasterEdit.aspx.designer.cs | 26 + .../File/Excel/DataIn/材料入库导入模板.xlsx | Bin 0 -> 8797 bytes SGGL/FineUIPro.Web/FineUIPro.Web.csproj | 88 + .../WeldingManage/SelectTaskWeldJoint.aspx | 2 +- .../WeldingManage/SelectTaskWeldJoint.aspx.cs | 14 +- .../HJGL/WeldingManage/WeldMatMatch.aspx | 152 +- .../HJGL/WeldingManage/WeldMatMatch.aspx.cs | 14 +- .../WeldMatMatch.aspx.designer.cs | 53 +- .../HJGL/WeldingManage/WeldTask.aspx | 2 + .../HJGL/WeldingManage/WeldTask.aspx.cs | 21 + .../WeldingManage/WeldTask.aspx.designer.cs | 101 +- SGGL/FineUIPro.Web/common/Menu_DigData.xml | 63 +- SGGL/FineUIPro.Web/common/Menu_HJGL.xml | 13 +- SGGL/FineUIPro.Web/common/Menu_HSSE.xml | 2 +- SGGL/FineUIPro.Web/common/Menu_HTGL.xml | 6 +- SGGL/FineUIPro.Web/common/Menu_JDGL.xml | 6 +- SGGL/FineUIPro.Web/common/Menu_PHTGL.xml | 2 +- SGGL/FineUIPro.Web/common/Menu_ZHGL.xml | 42 - SGGL/Model/CLGL/Tw_InOutDetailOutput.cs | 16 + SGGL/Model/CLGL/Tw_InOutMasterOutput.cs | 20 + SGGL/Model/CLGL/Tw_InputDataIn.cs | 24 + SGGL/Model/CLGL/Tw_MaterialStockOutput.cs | 9 + SGGL/Model/Model.cs | 2073 +++++++++++++++-- SGGL/Model/Model.csproj | 4 + 72 files changed, 10645 insertions(+), 282 deletions(-) create mode 100644 .vs/SGGL_SeDin_New/v17/DocumentLayout.json create mode 100644 DataBase/版本日志/SGGLDB_V2024-09-18.sql create mode 100644 SGGL/BLL/CLGL/TwArrivalStatisticsService.cs create mode 100644 SGGL/BLL/CLGL/TwConst.cs create mode 100644 SGGL/BLL/CLGL/TwInOutplandetailService.cs create mode 100644 SGGL/BLL/CLGL/TwInOutplanmasterService.cs create mode 100644 SGGL/BLL/CLGL/TwInputdetailService.cs create mode 100644 SGGL/BLL/CLGL/TwInputmasterService.cs create mode 100644 SGGL/BLL/CLGL/TwMaterialstockService.cs create mode 100644 SGGL/BLL/CLGL/TwOutputdetailService..cs create mode 100644 SGGL/BLL/CLGL/TwOutputmasterService.cs create mode 100644 SGGL/FineUIPro.Web/CLGL/ArrivalStatistics.aspx create mode 100644 SGGL/FineUIPro.Web/CLGL/ArrivalStatistics.aspx.cs create mode 100644 SGGL/FineUIPro.Web/CLGL/ArrivalStatistics.aspx.designer.cs create mode 100644 SGGL/FineUIPro.Web/CLGL/InPlanMaster.aspx create mode 100644 SGGL/FineUIPro.Web/CLGL/InPlanMaster.aspx.cs create mode 100644 SGGL/FineUIPro.Web/CLGL/InPlanMaster.aspx.designer.cs create mode 100644 SGGL/FineUIPro.Web/CLGL/InPlanMasterDataIn.aspx create mode 100644 SGGL/FineUIPro.Web/CLGL/InPlanMasterDataIn.aspx.cs create mode 100644 SGGL/FineUIPro.Web/CLGL/InPlanMasterDataIn.aspx.designer.cs create mode 100644 SGGL/FineUIPro.Web/CLGL/InPlanMasterEdit.aspx create mode 100644 SGGL/FineUIPro.Web/CLGL/InPlanMasterEdit.aspx.cs create mode 100644 SGGL/FineUIPro.Web/CLGL/InPlanMasterEdit.aspx.designer.cs create mode 100644 SGGL/FineUIPro.Web/CLGL/InputMaster.aspx create mode 100644 SGGL/FineUIPro.Web/CLGL/InputMaster.aspx.cs create mode 100644 SGGL/FineUIPro.Web/CLGL/InputMaster.aspx.designer.cs create mode 100644 SGGL/FineUIPro.Web/CLGL/InputMasterEdit.aspx create mode 100644 SGGL/FineUIPro.Web/CLGL/InputMasterEdit.aspx.cs create mode 100644 SGGL/FineUIPro.Web/CLGL/InputMasterEdit.aspx.designer.cs create mode 100644 SGGL/FineUIPro.Web/CLGL/MaterialStock.aspx create mode 100644 SGGL/FineUIPro.Web/CLGL/MaterialStock.aspx.cs create mode 100644 SGGL/FineUIPro.Web/CLGL/MaterialStock.aspx.designer.cs create mode 100644 SGGL/FineUIPro.Web/CLGL/OutPlanMaster.aspx create mode 100644 SGGL/FineUIPro.Web/CLGL/OutPlanMaster.aspx.cs create mode 100644 SGGL/FineUIPro.Web/CLGL/OutPlanMaster.aspx.designer.cs create mode 100644 SGGL/FineUIPro.Web/CLGL/OutPlanMasterEdit.aspx create mode 100644 SGGL/FineUIPro.Web/CLGL/OutPlanMasterEdit.aspx.cs create mode 100644 SGGL/FineUIPro.Web/CLGL/OutPlanMasterEdit.aspx.designer.cs create mode 100644 SGGL/FineUIPro.Web/CLGL/OutputMaster.aspx create mode 100644 SGGL/FineUIPro.Web/CLGL/OutputMaster.aspx.cs create mode 100644 SGGL/FineUIPro.Web/CLGL/OutputMaster.aspx.designer.cs create mode 100644 SGGL/FineUIPro.Web/CLGL/OutputMasterEdit.aspx create mode 100644 SGGL/FineUIPro.Web/CLGL/OutputMasterEdit.aspx.cs create mode 100644 SGGL/FineUIPro.Web/CLGL/OutputMasterEdit.aspx.designer.cs create mode 100644 SGGL/FineUIPro.Web/File/Excel/DataIn/材料入库导入模板.xlsx create mode 100644 SGGL/Model/CLGL/Tw_InOutDetailOutput.cs create mode 100644 SGGL/Model/CLGL/Tw_InOutMasterOutput.cs create mode 100644 SGGL/Model/CLGL/Tw_InputDataIn.cs create mode 100644 SGGL/Model/CLGL/Tw_MaterialStockOutput.cs diff --git a/.vs/SGGL_SeDin_New/v17/.wsuo b/.vs/SGGL_SeDin_New/v17/.wsuo index 695dc7e49b43847a29949ee386e8bb68a11f3c3e..96fcf830ea64cd53efa89b8174434b374a8ca94e 100644 GIT binary patch delta 5840 zcmeHLdu&tZ6~CY3m@IRQF(DWlLLN?HOs?_0zJ4|Y=LHFQKL`N~@iS?Fm=F>g0vQ3N zTBVjQ+`~4Cx(*PU5b7w!2yJMBlA|HxsX_CjOK*RnF4iSvgn5)KH*Ws+*eL>{_k)BU{XI+=L#+RAX!v ze5`7Q_f!HahLN-uZ5DQ!5Rb6H;rXVlW_;1m1B(HedcK^gc2F;shX|UHf%qC?E@A;< z9zu_x{;%V&4)F*+RX?ZB$J*hx?Cb*kEkqO{Xg@9DaNDW;Fo}IZFF~gN`$ea4k~{rp!Q)NJ0lsq9pNdPHA6`^)dvH zup(9<1O&|y@z;)UCEkw_i)=M@_%gSlV+8iJq$jRIzBqq$h7lO zqI?7ylpL|Zi7(_ORJxI`+tE*g$nS0V>_dLHz<2e_pdwA9O~(;QKG0OV4;zT|R63FR zgE%#c?B0d-UC8bzQa_B(8pLkYoQ+$K@nVtQ!l@YTpNaF5a>$F-F+oC8a$+YWNMyVx(4Tr9!$%D7=Bedm0DR!u`1o z+I$>SoH9F|g4OEy9{o3&JmG5y^B%Wd;vFGTa64R5DCBgFSFPyi^a`TKYxC|E>>)vn z+M|3}2uZx;uzPrq-6il+Z`2dCMI55NH#}a&;{*}LN|$Mrs-3D!63e)iWdvtL6g?sz zwYws`B!uMy(-0_KFekAUG?bd;$r>%i-K8ng!tmroIw?gB_a{HmQjkc}M%LD7>EILy zk_uqY!-%#cgI=kSPSC_~Pur-a$h{Lz? zTzn)HatYy}7>-25aXLkk9FJ}J#C(R*J!^gs@^l@PTArf?A+37lobLCDT68)>XCDb=3B(Ust!Tvf1CU zW=*4ib-xN%L{Ye=8n6G>x6j==bk=|S?Mr{T^3v_gm;E;{9r^2PZ~Lp8t81S&KNekA z-#WCzx;`56Bdp;avEF{V!Z=NNY-IcP3aX;erRc0r2v%9NA6knB6$H}e$+{Y-Nwcw1 z7|}gqCK#F94ApZTEEDeUZOJIbWs>%16)>`|MN7gfoJi1ut%Q&Fb!3pnW=EF8$ar%W zBa-E&wEKt}G@r_2wi3Q_^e{fnyt2MVOJVBCU;}&fYbh&(kM!?nv3WR#F8-w2)AOhS z?k{N2QZ3a;@**{i<}_q6O2z1|OwN%_=+x9<#74SQlN~G#Mi#axae?AovKf3uIALMk zmnhs>Enm_2@^k`CR%fwiUjUk!3jiL>AEUbtMza$fNHRyc1wYDe$zo*wR4<0%y{%8= zA-Sn}$V_xgx;o>aGS`j7(SR=Zr(jrOm6tTat4kzS3kR00!jyz!;pZH!wRd&2()ily zj#g;Qlj6R-CN+#NwNrk~#UlN&zQXbGaVRKq;g;DcFed7qFkMtP_xItWe;=i^fqU}Q z@Sxb;!Wj2@+US8zrcob$G3MiaLb1){a7tlU)G6>zXRnKwJWdDi4q_G|NH%xWCAz{+ zS5RRP&R0slGM|G#mpGXXvmpz_O9Yr-I+aMH?1GYw^oB)BJNSrX!yL?Jhcm_IMNf)0 zvnB_uM9_U!Lb*gFnN#+hmD%m|ghG-#%11?)6Y~}iW-yVEjgQz|?r6~MmZEm)bICj) z8^276<^Ln?bR;+=E=XIbh z&%ra#ygB2Bib4iQdcGkG8Bp=22Sq0!lfT{_;K^^;KnlQ z2X$Frj>76bLzEDFuk#f}n^Rp!6k3_P%<-FD21b@czEwf@1}(d+2<7V@i$^v*V2T{X z+Z!u&(6zY`s{BXU4G0d0A$On#H2!it#k>9Eiu$i@$zhig(*sbrB?ry?2KHa)2f(&k z4c$HE%6h)_*!3*?(?3E^Gz$8N?8t#Y$O^x+9sz&Eh)0}pw6Sn= zd^pm`z);Zz6@4WMYU7FFx4k)NqL*hps~mpf%3u=^?E9f&eOC z4j`R}3gexF!;D=>SavnMw#$MPAxG@SEoa<0Z@3DDq8RXDnGV#ubK!y|LA-L5Pw{iv iQ4Y6W%u~cxb|PodD@z4-cSB9lzS%EV`huNWVEZS64Vkt8 delta 1810 zcmc(fPiz}i5XSed*JitHT$8wAOHAT8jvGqcuI)|iv`xG&DYUU;2iY>E2_mEwD(WFc zic!b`i~u23J+wO)+6z^YIB;qdREe8udoC5I2P6*RL})oShX_jf#&|;{B81cfPx@)! zn>X*zes5;#KYHrtLt}Y-2e>>rx#5~W@lxFLM)wTDExC2(oR!A)BE`W`49O4 zUA_PDfb_Q30q@{)B`Tcmah>C)6ErtQ_=){g>n^JtD6WYfbWiCVTYQ>p^l^C13tH+~ z@^ZA8w9%K>Sy1-i#=$INREs_meN^i&wh6X!6uPrs4nK`Hp3dtW6PwCop_ij`Y~@|! z6X67ps$q=WRi7{TWin-DWig-%`ZO}G^Nic*V#IU?$93L%(}oQlTcO3lJl&KN!b9tW z#kOW5aAL6AUzwMMPrRTTF!K5Cgp*T*P8+*lqAL;GbNpKkhm2CacYtED;dIpl-`_p) z(d{=L)~i3S9{lOE69vqlr3Ebjq1DHDBP>^zD`7$Q@ON}4yAP$IK<9@oahSeIXLW%q zGDjv~tl&gTPgToPO~VW2DK@Ow2PPGgpBclwN65|ww_w0_ni|=oP%wiZ400+TLBh^R zWqik_V^UF~S$lvQb``#R$I6R1P)HLUYlBv|G_{mHr z9k-I^TztebPsUSL;?!L7&1A+jQ8nN#gmlTX_`!5^(Uv5iL{>OSk$i$~ObpSh`EySeuU01L!gU`tUNh+W+F`meZ_}MG+v(cJ?G#$G=&Q<%^SVY?zKD@_ zuT#{i_myc{t@>&1mr&FB>^X~8??>s@*Y7#gD$U#vkoA^Lv-jRvQGWehIDv&$bQOfo ze-j37BzU>NAr$&cD%Td*EK*d9m2?kG+E#Ot)?;Ori~pu)f@*sZdt8yY61jFSS5*1m zQ=ueOuGQ`mda%0yO|}Wh#&!Y8SwXi9^Dz@a + + + + + + + + + diff --git a/SGGL/BLL/CLGL/TwArrivalStatisticsService.cs b/SGGL/BLL/CLGL/TwArrivalStatisticsService.cs new file mode 100644 index 00000000..8eacd96f --- /dev/null +++ b/SGGL/BLL/CLGL/TwArrivalStatisticsService.cs @@ -0,0 +1,58 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BLL +{ + public class TwArrivalStatisticsService + { + public static IEnumerable GetStatistics(string projectid,string materialCode) + { + using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString)) + { + var NeedOutMateriaList = from x in db.HJGL_PipeLineMat + join y in db.HJGL_MaterialCodeLib on x.MaterialCode equals y.MaterialCode + join z in db.HJGL_Pipeline on x.PipelineId equals z.PipelineId + where z.ProjectId == projectid && (string.IsNullOrEmpty(materialCode) || x.MaterialCode .Contains( materialCode)) + group x by x.MaterialCode + into g + select new + { + g.Key, + NeedNum = g.Sum(x => x.Number) ?? 0, + }; + + var RealInMateriaList = from x in db.Tw_InputDetail + join y in db.HJGL_MaterialCodeLib on x.MaterialCode equals y.MaterialCode + group x by x.MaterialCode + into g + where (string.IsNullOrEmpty(materialCode) || g.Key.Contains( materialCode)) + select new + { + g.Key, + RealNum = g.Sum(x => x.ActNum) ?? 0, + }; + + var StatisticsList =from x in NeedOutMateriaList + join y in RealInMateriaList on x.Key equals y.Key into gg + from y in gg.DefaultIfEmpty() + join z in db.HJGL_MaterialCodeLib on x.Key equals z.MaterialCode into zz + from z in zz.DefaultIfEmpty() + select new + { + MaterialCode = x.Key, + NeedNum = x.NeedNum, + RealNum = y==null?0:y.RealNum, + MaterialName = z.MaterialName, + MaterialSpec=z.MaterialSpec, + MaterialUnit=z.MaterialUnit, + }; + return StatisticsList.ToList(); + } + } + } + +} diff --git a/SGGL/BLL/CLGL/TwConst.cs b/SGGL/BLL/CLGL/TwConst.cs new file mode 100644 index 00000000..4c4bd62a --- /dev/null +++ b/SGGL/BLL/CLGL/TwConst.cs @@ -0,0 +1,57 @@ +using System.Collections.Generic; + +namespace BLL; + +public class TwConst +{ + public enum InOutType : int + { + 入库 = 1, + 出库 = 2, + } + public enum TypeInt : int + { + 采购入库 = 10, + 退料入库 = 20, + 其他入库 = 30, + 领料出库 = 40, + 补料出库 = 50, + 其他出库 = 60, + } + public enum Category : int + { + 全部 = 0, + 管件 = 1, + 管段 = 2, + } + public enum State : int + { + 审核被拒 = -1, + 待提交 = 0, + 待审核 = 1, + 已审核 = 2, + 已完成 = 3, + } + public static Dictionary TypeIntMap = new Dictionary + { + { "采购入库" ,(int)TypeInt.采购入库}, + { "退料入库" ,(int)TypeInt.退料入库}, + { "其他入库" ,(int)TypeInt.其他入库}, + { "领料出库" ,(int)TypeInt.领料出库}, + { "补料出库" ,(int)TypeInt.补料出库}, + { "其他出库" ,(int)TypeInt.其他出库} + }; + public static Dictionary StateMap = new Dictionary + { + { "待提交" ,(int)State.待提交}, + { "待审核" ,(int)State.待审核}, + { "已审核" ,(int)State.已审核}, + { "已完成" ,(int)State.已完成}, + { "审核被拒" ,(int)State.审核被拒}, + }; + public static Dictionary CategoryMap = new Dictionary + { + { "管件" ,(int)Category.管件}, + { "管段" ,(int)Category.管段}, + }; +} \ No newline at end of file diff --git a/SGGL/BLL/CLGL/TwInOutplandetailService.cs b/SGGL/BLL/CLGL/TwInOutplandetailService.cs new file mode 100644 index 00000000..60c2338a --- /dev/null +++ b/SGGL/BLL/CLGL/TwInOutplandetailService.cs @@ -0,0 +1,151 @@ +using FineUIPro; +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using System.Text; + + +namespace BLL +{ + + public static class TwInOutplandetailService + { + + #region 获取列表 + /// + /// 记录数 + /// + public static int Count + { + get; + set; + } + public static IQueryable GetByModle(Model.Tw_InOutDetailOutput table) + { + var q = from x in Funs.DB.Tw_InOutPlanDetail + join y in Funs.DB.HJGL_Pipeline_Component on x.PipelineComponentId equals y.PipelineComponentId into yy + from y in yy.DefaultIfEmpty() + join mat in Funs.DB.HJGL_MaterialCodeLib on x.MaterialCode equals mat.MaterialCode into mm + from mat in mm.DefaultIfEmpty() + where + (string.IsNullOrEmpty(table.Id) || x.Id.Contains(table.Id)) && + (string.IsNullOrEmpty(table.InOutPlanMasterId) || x.InOutPlanMasterId.Contains(table.InOutPlanMasterId)) && + (string.IsNullOrEmpty(table.PipelineComponentId) || x.PipelineComponentId.Contains(table.PipelineComponentId)) && + (string.IsNullOrEmpty(table.MaterialCode) || x.MaterialCode.Contains(table.MaterialCode)) + select new Model.Tw_InOutDetailOutput + { + Id = x.Id, + InOutPlanMasterId = x.InOutPlanMasterId, + PipelineComponentId = x.PipelineComponentId, + MaterialCode = x.MaterialCode, + PlanNum = x.PlanNum, + ActNum = x.ActNum, + PipelineComponentCode = y.PipelineComponentCode, + MaterialName = mat.MaterialName, + } + ; + + return q; + } + + /// + /// 获取分页列表 + /// + /// + /// + /// + public static IEnumerable GetListData(Model.Tw_InOutDetailOutput table, Grid grid1) + { + var q = GetByModle(table); + Count = q.Count(); + if (Count == 0) + { + return null; + } + q = q.Skip(grid1.PageSize * grid1.PageIndex).Take(grid1.PageSize); + // q = SortConditionHelper.SortingAndPaging(q, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize); + return from x in q + select x; + } + #endregion + + public static Model.Tw_InOutPlanDetail GetById(string Id) + { + return Funs.DB.Tw_InOutPlanDetail.FirstOrDefault(x => x.Id == Id); + } + + + public static void Add(Model.Tw_InOutPlanDetail newtable) + { + if (string.IsNullOrEmpty(newtable.Id)) + { + newtable.Id = SQLHelper.GetNewID(); + } + Model.Tw_InOutPlanDetail table = new Model.Tw_InOutPlanDetail + { + Id = newtable.Id, + InOutPlanMasterId = newtable.InOutPlanMasterId, + PipelineComponentId = newtable.PipelineComponentId, + MaterialCode = newtable.MaterialCode, + PlanNum = newtable.PlanNum, + ActNum = newtable.ActNum, + }; + Funs.DB.Tw_InOutPlanDetail.InsertOnSubmit(table); + Funs.DB.SubmitChanges(); + } + + /// + /// 批量添加计划明细 + /// + /// + /// + public static void AddList(IEnumerable list, string inoutPlanMasterId) + { + foreach (var item in list) + { + item.Id= SQLHelper.GetNewID(); + item.InOutPlanMasterId = inoutPlanMasterId; + Add(item); + } + } + public static void Update(Model.Tw_InOutPlanDetail newtable) + { + + Model.Tw_InOutPlanDetail table = Funs.DB.Tw_InOutPlanDetail.FirstOrDefault(x => x.Id == newtable.Id); + if (table != null) + { + table.Id = newtable.Id; + table.InOutPlanMasterId = newtable.InOutPlanMasterId; + table.PipelineComponentId = newtable.PipelineComponentId; + table.MaterialCode = newtable.MaterialCode; + table.PlanNum = newtable.PlanNum; + table.ActNum = newtable.ActNum; + Funs.DB.SubmitChanges(); + } + + } + public static void DeleteById(string Id) + { + + Model.Tw_InOutPlanDetail table = Funs.DB.Tw_InOutPlanDetail.FirstOrDefault(x => x.Id == Id); + if (table != null) + { + Funs.DB.Tw_InOutPlanDetail.DeleteOnSubmit(table); + Funs.DB.SubmitChanges(); + } + + } + + public static void DeleteByInOutPlanMasterId (string inoutPlanMasterId) + { + var list = Funs.DB.Tw_InOutPlanDetail.Where(x => x.InOutPlanMasterId == inoutPlanMasterId); + if (list != null) + { + Funs.DB.Tw_InOutPlanDetail.DeleteAllOnSubmit(list); + Funs.DB.SubmitChanges(); + } + } + + } +} \ No newline at end of file diff --git a/SGGL/BLL/CLGL/TwInOutplanmasterService.cs b/SGGL/BLL/CLGL/TwInOutplanmasterService.cs new file mode 100644 index 00000000..bc5c6677 --- /dev/null +++ b/SGGL/BLL/CLGL/TwInOutplanmasterService.cs @@ -0,0 +1,477 @@ +using EmitMapper; +using FineUIPro; +using Microsoft.Office.Interop.Word; +using MiniExcelLibs; +using Model; +using NPOI.Util; +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using System.Numerics; +using System.Text; +using System.Web.UI.WebControls; + + +namespace BLL +{ + + public static class TwInOutplanmasterService + { + + #region 获取列表 + /// + /// 记录数 + /// + public static int Count + { + get; + set; + } + public static IQueryable GetModle(Model.Tw_InOutMasterOutput table) + { + var q = from x in Funs.DB.Tw_InOutPlanMaster + join y in Funs.DB.HJGL_WeldTask on x.WeldTaskId equals y.WeldTaskId into yy + from y in yy.DefaultIfEmpty() + join person in Funs.DB.Person_Persons on x.CreateMan equals person.PersonId into persons + from person in persons.DefaultIfEmpty() + join unit in Funs.DB.Base_Unit on x.ReqUnitId equals unit.UnitId into units + from unit in units.DefaultIfEmpty() + where + (string.IsNullOrEmpty(table.Id) || x.Id.Contains(table.Id)) && + (string.IsNullOrEmpty(table.ProjectId) || x.ProjectId.Contains(table.ProjectId)) && + (string.IsNullOrEmpty(table.CusBillCode) || x.CusBillCode.Contains(table.CusBillCode)) && + (string.IsNullOrEmpty(table.WarehouseCode) || x.WarehouseCode.Contains(table.WarehouseCode)) && + (string.IsNullOrEmpty(table.CreateMan) || x.CreateMan.Contains(table.CreateMan)) && + (string.IsNullOrEmpty(table.OutputMasterId) || x.OutputMasterId.Contains(table.OutputMasterId)) && + (string.IsNullOrEmpty(table.ReqUnitId) || x.ReqUnitId.Contains(table.ReqUnitId)) && + (string.IsNullOrEmpty(table.UnitWorkId) || x.WeldTaskId.Contains(table.UnitWorkId))&& + (table.InOutType == null || x.InOutType == table.InOutType) && + (table.TypeInt == null || x.TypeInt == table.TypeInt) && + (table.Category == null || x.Category == table.Category) && + (table.State == null || x.State == table.State) + select new Model.Tw_InOutMasterOutput + { + Id = x.Id, + ProjectId = x.ProjectId, + CusBillCode = x.CusBillCode, + WarehouseCode = x.WarehouseCode, + Source = x.Source, + InOutType = x.InOutType, + TypeInt = x.TypeInt, + State = x.State, + Category = x.Category, + CreateMan = x.CreateMan, + CreateManName = person.PersonName, + CreateDate = x.CreateDate, + OutputMasterId = x.OutputMasterId, + WeldTaskId = x.WeldTaskId, + ReqUnitId = x.ReqUnitId, + ReqUnitName = unit.UnitName, + UnitWorkId = y.UnitWorkId, + WeldTaskCode = y.TaskCode + } + ; + + return q; + } + + /// + /// 获取分页列表 + /// + /// + /// + /// + public static IEnumerable GetListData(Model.Tw_InOutMasterOutput table, Grid grid1) + { + + var q = GetModle(table); + Count = q.Count(); + if (Count == 0) + { + return null; + } + var result = q.Skip(grid1.PageSize * grid1.PageIndex).Take(grid1.PageSize).ToList(); + // q = SortConditionHelper.SortingAndPaging(q, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize); + return from x in result + select new Model.Tw_InOutMasterOutput + { + Id = x.Id, + ProjectId = x.ProjectId, + CusBillCode = x.CusBillCode, + WarehouseCode = x.WarehouseCode, + Source = x.Source, + InOutType = x.InOutType, + TypeInt = x.TypeInt, + Category = x.Category, + State = x.State, + CreateMan = x.CreateMan, + CreateManName = x.CreateManName, + CreateDate = x.CreateDate, + OutputMasterId = x.OutputMasterId, + WeldTaskId = x.WeldTaskId, + ReqUnitId = x.ReqUnitId, + ReqUnitName = x.ReqUnitName, + UnitWorkId = x.UnitWorkId, + WeldTaskCode= x.WeldTaskId!=null? x.WeldTaskId.Contains('|')? Funs.DB.HJGL_WeldTask.FirstOrDefault(e => e.UnitWorkId == x.WeldTaskId.Split('|')[0].ToString() && e.UnitId == x.WeldTaskId.Split('|')[1].ToString() && e.TaskDate.Value.Date == Convert.ToDateTime(x.WeldTaskId.Split('|')[2].ToString()).Date)?.TaskCode :"":"", + CategoryString = TwConst.CategoryMap.FirstOrDefault(y => y.Value == x.Category).Key, + TypeString = TwConst.TypeIntMap.FirstOrDefault(y => y.Value == x.TypeInt).Key, + StateString = TwConst.StateMap.FirstOrDefault(y => y.Value == x.State).Key + }; + } + + public static List GetListData(Model.Tw_InOutMasterOutput table) + { + + var q = GetModle(table); + Count = q.Count(); + if (Count == 0) + { + return null; + } + var result = q.ToList(); + // q = SortConditionHelper.SortingAndPaging(q, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize); + return (from x in result + select new Model.Tw_InOutMasterOutput + { + Id = x.Id, + ProjectId = x.ProjectId, + CusBillCode = x.CusBillCode, + WarehouseCode = x.WarehouseCode, + Source = x.Source, + InOutType = x.InOutType, + TypeInt = x.TypeInt, + Category = x.Category, + State = x.State, + CreateMan = x.CreateMan, + CreateManName = x.CreateManName, + CreateDate = x.CreateDate, + OutputMasterId = x.OutputMasterId, + WeldTaskId = x.WeldTaskId, + ReqUnitId = x.ReqUnitId, + ReqUnitName = x.ReqUnitName, + UnitWorkId = x.UnitWorkId, + WeldTaskCode = x.WeldTaskId != null ? x.WeldTaskId.Contains('|') ? Funs.DB.HJGL_WeldTask.FirstOrDefault(e => e.UnitWorkId == x.WeldTaskId.Split('|')[0].ToString() && e.UnitId == x.WeldTaskId.Split('|')[1].ToString() && e.TaskDate.Value.Date == Convert.ToDateTime(x.WeldTaskId.Split('|')[2].ToString()).Date)?.TaskCode : "" : "", + CategoryString = TwConst.CategoryMap.FirstOrDefault(y => y.Value == x.Category).Key, + TypeString = TwConst.TypeIntMap.FirstOrDefault(y => y.Value == x.TypeInt).Key, + StateString = TwConst.StateMap.FirstOrDefault(y => y.Value == x.State).Key + }).ToList(); + } + + #endregion + + /// + /// 导入数据 + /// + /// + /// + /// + /// + public static ResponeData ImportData(string path, string projectid, string creatUserId) + { + var responeData = new ResponeData(); + List temeplateDtoIns; + try + { + temeplateDtoIns = MiniExcel.Query(path, startCell: "A1").ToList(); + } + catch (Exception ex) + { + responeData.code = 0; + responeData.message = "模板错误:" + ex.ToString(); + return responeData; + } + + #region 数据校验 + if (temeplateDtoIns.Count == 0) + { + responeData.code = 0; + responeData.message = "导入数据为空!"; + return responeData; + } + var queryAll = new Tw_InOutMasterOutput() + { + ProjectId = projectid + }; + var warehouseCodeList = temeplateDtoIns.Select(x => x.WarehouseCode).Distinct().ToList(); //获取导入文件的仓库编号 + string errorWarehouseCode = ""; + foreach (var item in warehouseCodeList) + { + if (!DropListService.HJGL_WarehouseCode().Select(x=>x.Value== item).Any()) + { + errorWarehouseCode+=item+","; + } + } + + if (!string.IsNullOrEmpty(errorWarehouseCode)) + { + if (temeplateDtoIns.Count == 0) + { + responeData.code = 0; + responeData.message = errorWarehouseCode+"仓库不存在!"; + return responeData; + } + } + var materialCodeList = temeplateDtoIns.Select(x => x.MaterialCode).Distinct().ToList(); //获取导入文件的材料编码 + var IsExitMaterialCode= + from x in Funs.DB.HJGL_MaterialCodeLib + where materialCodeList.Contains(x.MaterialCode) + select x.MaterialCode; + if (IsExitMaterialCode.Count() < materialCodeList.Count) + { + var errorMaterialCode = materialCodeList.Except(IsExitMaterialCode.ToList()); + if (errorMaterialCode.Count() > 0) + { + responeData.code = 0; + responeData.message = string.Join(",", errorMaterialCode) + "材料不存在!"; + return responeData; + } + } + + var queryAllresult = GetModle(queryAll).Select(x => x.CusBillCode).Distinct().ToList();//查询所有的编号 + var CusBillCodeList = temeplateDtoIns.Select(x => x.CusBillCode).Distinct().ToList(); //获取导入文件的编号 + var IsContain = CusBillCodeList.Intersect(queryAllresult).ToList(); //判断导入文件中是有已存在的编号 + if (IsContain.Count>0) + { + responeData.code = 0; + responeData.message = string.Join(",", IsContain)+ "编号已存在!"; + return responeData; + } + #endregion + //根据申请单编号分组插入数据 + foreach (var CusBillCode in CusBillCodeList) + { + var CusBillCodeDtoIns = temeplateDtoIns.Where(x => x.CusBillCode == CusBillCode).ToList(); + + var mapper = + ObjectMapperManager.DefaultInstance.GetMapper, List>(); + var mapperDetail = + ObjectMapperManager.DefaultInstance.GetMapper, List>(); + //通过映射实体赋值 + var twInOutPlanMaster = mapper.Map(CusBillCodeDtoIns).FirstOrDefault(); + var twInOutPlanDetails = mapperDetail.Map(CusBillCodeDtoIns.Where(x => !string.IsNullOrEmpty(x.MaterialCode) && !string.IsNullOrEmpty(x.PlanNum)).ToList()); + + twInOutPlanMaster.Id = SQLHelper.GetNewID(); + twInOutPlanMaster.InOutType= (int)TwConst.InOutType.入库; + twInOutPlanMaster.State = (int)TwConst.State.待审核; + twInOutPlanMaster.TypeInt= (int)TwConst.TypeInt.采购入库; + twInOutPlanMaster.Category= (int)TwConst.Category.全部; + twInOutPlanMaster.ProjectId = projectid; + twInOutPlanMaster.CreateMan = creatUserId; + twInOutPlanMaster.CreateDate = DateTime.Now; + Add(twInOutPlanMaster); + TwInOutplandetailService.AddList(twInOutPlanDetails, twInOutPlanMaster.Id); //插入入库明细 + + } + return responeData; + + } + + public static Model.Tw_InOutPlanMaster GetById(string Id) + { + return Funs.DB.Tw_InOutPlanMaster.FirstOrDefault(x => x.Id == Id); + } + public static void Add(Model.Tw_InOutPlanMaster newtable) + { + + Model.Tw_InOutPlanMaster table = new Model.Tw_InOutPlanMaster + { + Id = newtable.Id, + ProjectId = newtable.ProjectId, + CusBillCode = newtable.CusBillCode, + WarehouseCode = newtable.WarehouseCode, + Source = newtable.Source, + Category = newtable.Category, + InOutType = newtable.InOutType, + TypeInt = newtable.TypeInt, + State = newtable.State, + CreateMan = newtable.CreateMan, + CreateDate = newtable.CreateDate, + OutputMasterId = newtable.OutputMasterId, + WeldTaskId = newtable.WeldTaskId, + ReqUnitId = newtable.ReqUnitId, + }; + Funs.DB.Tw_InOutPlanMaster.InsertOnSubmit(table); + Funs.DB.SubmitChanges(); + } + public static void Update(Model.Tw_InOutPlanMaster newtable) + { + + Model.Tw_InOutPlanMaster table = Funs.DB.Tw_InOutPlanMaster.FirstOrDefault(x => x.Id == newtable.Id); + if (table != null) + { + table.Id = newtable.Id; + table.ProjectId = newtable.ProjectId; + table.CusBillCode = newtable.CusBillCode; + table.WarehouseCode = newtable.WarehouseCode; + table.Category = newtable.Category; + table.Source = newtable.Source; + table.InOutType = newtable.InOutType; + table.TypeInt = newtable.TypeInt; + table.State = newtable.State; + table.CreateMan = newtable.CreateMan; + table.CreateDate = newtable.CreateDate; + table.OutputMasterId = newtable.OutputMasterId; + table.WeldTaskId = newtable.WeldTaskId; + table.ReqUnitId = newtable.ReqUnitId; + Funs.DB.SubmitChanges(); + } + + } + public static void DeleteById(string Id) + { + + Model.Tw_InOutPlanMaster table = Funs.DB.Tw_InOutPlanMaster.FirstOrDefault(x => x.Id == Id); + if (table != null) + { + TwInOutplandetailService.DeleteByInOutPlanMasterId(table.Id); + + Funs.DB.Tw_InOutPlanMaster.DeleteOnSubmit(table); + Funs.DB.SubmitChanges(); + + } + + } + /// + /// 根据出库单生成计划单 + /// + /// + /// + /// + public static string GenPlanMasterByOutputMasterId(string outputMasterId,TwConst.TypeInt typeInt) + { + string message = ""; + + #region 数据校验 + + //获取出库单 + var outMasterQuery = new Tw_InOutMasterOutput(); + outMasterQuery.Id = outputMasterId; + var outMaster = TwOutputmasterService.GetListData(outMasterQuery) .FirstOrDefault() ; + if (outMaster == null || outMaster.State != (int)TwConst.State.已完成) + { + message = "出库单状态错误,无法生成计划单!"; + return message; + } + //判断是否已经生成过计划单 + var queryIsExitInMaster = new Tw_InOutMasterOutput(); + queryIsExitInMaster.OutputMasterId = outMaster.Id; + queryIsExitInMaster.TypeInt= (int)typeInt; + var IsExitInMaster = GetModle(queryIsExitInMaster).FirstOrDefault(); + if (IsExitInMaster != null) + { + message = "该出库单已生成过计划单"; + return message; + } + //明细校验 + Tw_InOutDetailOutput query = new Tw_InOutDetailOutput(); + query.OutputMasterId = outputMasterId; + var details = TwOutputdetailService.GetByModle(query).ToList(); + switch (typeInt) + { + case TwConst.TypeInt.补料出库: + details = details.Where(x => x.PlanNum > x.ActNum).ToList(); + foreach (var item in details) + { + item.PlanNum = (item.PlanNum - item.ActNum); + } + if (details.Count==0) + { + message = "该出库单无需补料"; + return message; + } + break; + case TwConst.TypeInt.退料入库: + details = details.Where(x => x.PlanNum < x.ActNum).ToList(); + foreach (var item in details) + { + item.PlanNum = (item.ActNum - item.PlanNum); + } + if (details.Count == 0) + { + message = "该出库单无需退料"; + return message; + } + break; + } + #endregion + //生成计划单 + var planMasterModel = new Model.Tw_InOutMasterOutput() + { + Id = Guid.NewGuid().ToString(), + OutputMasterId = outMaster.Id, + ProjectId = outMaster.ProjectId, + WarehouseCode = outMaster.WarehouseCode, + Source = 2, + Category = outMaster.Category, + TypeInt = outMaster.TypeInt, + State = (int)TwConst.State.待审核, + CreateMan = outMaster.CreateMan, + CreateDate = DateTime.Now, + ReqUnitId = outMaster.ReqUnitId, + WeldTaskId = GetById(outMaster.InOutPlanMasterId).WeldTaskId + + }; + switch (typeInt) + { + case TwConst.TypeInt.补料出库: + planMasterModel.CusBillCode = GetCusBillCodeByTaskCode(outMaster.WeldTaskCode,TwConst.TypeInt.补料出库,(BLL.TwConst.Category)planMasterModel.Category); + planMasterModel.TypeInt= (int)TwConst.TypeInt.补料出库; + planMasterModel.InOutType= (int)TwConst.InOutType.出库; + break; + case TwConst.TypeInt.退料入库: + planMasterModel.CusBillCode = GetCusBillCodeByTaskCode(outMaster.WeldTaskCode, TwConst.TypeInt.退料入库, (BLL.TwConst.Category)planMasterModel.Category); + planMasterModel.TypeInt = (int)TwConst.TypeInt.退料入库; + planMasterModel.InOutType = (int)TwConst.InOutType.入库; + ; + break; + } + Add(planMasterModel); + //生成明细 + TwInOutplandetailService.AddList(details, planMasterModel.Id); + return message; + } + + public static string GetCusBillCodeByTaskCode(string taskCode,TwConst.TypeInt typeInt,TwConst.Category category ) + { + string cusBillCode = ""; + switch (typeInt ) + { + case TwConst.TypeInt.领料出库: + if (category== TwConst.Category.管段) + { + cusBillCode = taskCode + "-AP-P01"; + } + else if (category == TwConst.Category.管件) + { + cusBillCode = taskCode + "-AP-PF01"; + } + + break; + case TwConst.TypeInt.补料出库: + if (category == TwConst.Category.管段) + { + cusBillCode = taskCode + "-GI-P01-AP01"; + } + else if (category == TwConst.Category.管件) + { + cusBillCode = taskCode + "-GI-PF01-AP01"; + } + + break; + case TwConst.TypeInt.退料入库: + if (category == TwConst.Category.管段) + { + cusBillCode = taskCode + "-GI-P01-RE01"; + } + else if (category == TwConst.Category.管件) + { + cusBillCode = taskCode + "-GI-PF01-RE01"; + } + + break; + } + return cusBillCode; + } + } +} \ No newline at end of file diff --git a/SGGL/BLL/CLGL/TwInputdetailService.cs b/SGGL/BLL/CLGL/TwInputdetailService.cs new file mode 100644 index 00000000..a9cfabd5 --- /dev/null +++ b/SGGL/BLL/CLGL/TwInputdetailService.cs @@ -0,0 +1,124 @@ +using FineUIPro; +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using System.Text; + + +namespace BLL +{ + + public static class TwInputdetailService + { + + + + #region 获取列表 + /// + /// 记录数 + /// + public static int Count + { + get; + set; + } + public static IQueryable GetByModle(Model.Tw_InOutDetailOutput table) + { + var q = from x in Funs.DB.Tw_InputDetail + join y in Funs.DB.HJGL_Pipeline_Component on x.PipelineComponentId equals y.PipelineComponentId into yy + from y in yy.DefaultIfEmpty() + join mat in Funs.DB.HJGL_MaterialCodeLib on x.MaterialCode equals mat.MaterialCode into mm + from mat in mm.DefaultIfEmpty() + where + (string.IsNullOrEmpty(table.Id) || x.Id.Contains(table.Id)) && + (string.IsNullOrEmpty(table.InputMasterId) || x.InputMasterId.Contains(table.InputMasterId)) && + (string.IsNullOrEmpty(table.PipelineComponentId) || x.PipelineComponentId.Contains(table.PipelineComponentId)) && + (string.IsNullOrEmpty(table.MaterialCode) || x.MaterialCode.Contains(table.MaterialCode)) + select new Model.Tw_InOutDetailOutput + { + Id = x.Id, + InputMasterId = x.InputMasterId, + PipelineComponentId = x.PipelineComponentId, + MaterialCode = x.MaterialCode, + PlanNum = x.PlanNum, + ActNum = x.ActNum, + PipelineComponentCode = y.PipelineComponentCode, + MaterialName = mat.MaterialName, + } + ; + + return q; + } + + /// + /// 获取分页列表 + /// + /// + /// + /// + public static IEnumerable GetListData(Model.Tw_InOutDetailOutput table, Grid grid1) + { + var q = GetByModle(table); + Count = q.Count(); + if (Count == 0) + { + return null; + } + q = q.Skip(grid1.PageSize * grid1.PageIndex).Take(grid1.PageSize); + // q = SortConditionHelper.SortingAndPaging(q, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize); + return from x in q + select x; + } + #endregion + + public static Model.Tw_InputDetail GetById(string Id) + { + return Funs.DB.Tw_InputDetail.FirstOrDefault(x => x.Id == Id); + } + public static void Add(Model.Tw_InputDetail newtable) + { + + Model.Tw_InputDetail table = new Model.Tw_InputDetail + { + Id = newtable.Id, + InputMasterId = newtable.InputMasterId, + PipelineComponentId = newtable.PipelineComponentId, + MaterialCode = newtable.MaterialCode, + PlanNum = newtable.PlanNum, + ActNum = newtable.ActNum, + }; + Funs.DB.Tw_InputDetail.InsertOnSubmit(table); + Funs.DB.SubmitChanges(); + } + + public static void Update(Model.Tw_InputDetail newtable) + { + + Model.Tw_InputDetail table = Funs.DB.Tw_InputDetail.FirstOrDefault(x => x.Id == newtable.Id); + if (table != null) + { + table.Id = newtable.Id; + table.InputMasterId = newtable.InputMasterId; + table.PipelineComponentId = newtable.PipelineComponentId; + table.MaterialCode = newtable.MaterialCode; + table.PlanNum = newtable.PlanNum; + table.ActNum = newtable.ActNum; + Funs.DB.SubmitChanges(); + } + + } + public static void DeleteById(string Id) + { + + Model.Tw_InputDetail table = Funs.DB.Tw_InputDetail.FirstOrDefault(x => x.Id == Id); + if (table != null) + { + Funs.DB.Tw_InputDetail.DeleteOnSubmit(table); + Funs.DB.SubmitChanges(); + } + + } + + } +} \ No newline at end of file diff --git a/SGGL/BLL/CLGL/TwInputmasterService.cs b/SGGL/BLL/CLGL/TwInputmasterService.cs new file mode 100644 index 00000000..3f199d99 --- /dev/null +++ b/SGGL/BLL/CLGL/TwInputmasterService.cs @@ -0,0 +1,319 @@ +using FineUIPro; +using Model; +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using System.Text; + + +namespace BLL +{ + + public static class TwInputmasterService + { + #region 获取列表 + /// + /// 记录数 + /// + public static int Count + { + get; + set; + } + public static IQueryable GetModle(Model.Tw_InOutMasterOutput table) + { + var q = from x in Funs.DB.Tw_InputMaster + join person in Funs.DB.Person_Persons on x.CreateMan equals person.PersonId into persons + from person in persons.DefaultIfEmpty() + join unit in Funs.DB.Base_Unit on x.ReqUnitId equals unit.UnitId into units + from unit in units.DefaultIfEmpty() + where + (string.IsNullOrEmpty(table.Id) || x.Id.Contains(table.Id)) && + (string.IsNullOrEmpty(table.ProjectId) || x.ProjectId.Contains(table.ProjectId)) && + (string.IsNullOrEmpty(table.CusBillCode) || x.CusBillCode.Contains(table.CusBillCode)) && + (string.IsNullOrEmpty(table.WarehouseCode) || x.WarehouseCode.Contains(table.WarehouseCode)) && + (string.IsNullOrEmpty(table.CreateMan) || x.CreateMan.Contains(table.CreateMan)) && + (string.IsNullOrEmpty(table.ReqUnitId) || x.ReqUnitId.Contains(table.ReqUnitId)) && + (table.TypeInt == null || x.TypeInt == table.TypeInt) && + (table.Category == null || x.Category == table.Category) && + (table.State == null || x.State == table.State) + select new Model.Tw_InOutMasterOutput + { + Id = x.Id, + ProjectId = x.ProjectId, + CusBillCode = x.CusBillCode, + InOutPlanMasterId = x.InOutPlanMasterId, + WarehouseCode = x.WarehouseCode, + Source = x.Source, + Category = x.Category, + TypeInt = x.TypeInt, + State = x.State, + CreateMan = x.CreateMan, + CreateManName = person.PersonName, + CreateDate = x.CreateDate, + ReqUnitId = x.ReqUnitId, + ReqUnitName = unit.UnitName, + }; + + return q; + } + + /// + /// 获取分页列表 + /// + /// + /// + /// + public static IEnumerable GetListData(Model.Tw_InOutMasterOutput table, Grid grid1) + { + var q = GetModle(table); + Count = q.Count(); + if (Count == 0) + { + return null; + } + var result = q.Skip(grid1.PageSize * grid1.PageIndex).Take(grid1.PageSize).ToList(); + // q = SortConditionHelper.SortingAndPaging(q, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize); + return from x in result + select new Model.Tw_InOutMasterOutput + { + Id = x.Id, + ProjectId = x.ProjectId, + CusBillCode = x.CusBillCode, + InOutPlanMasterId = x.InOutPlanMasterId, + WarehouseCode = x.WarehouseCode, + Source = x.Source, + TypeInt = x.TypeInt, + State = x.State, + CreateMan = x.CreateMan, + CreateManName = x.CreateManName, + CreateDate = x.CreateDate, + ReqUnitId = x.ReqUnitId, + ReqUnitName = x.ReqUnitName, + Category = x.Category, + CategoryString = TwConst.CategoryMap.FirstOrDefault(y => y.Value == x.Category).Key, + TypeString = TwConst.TypeIntMap.FirstOrDefault(y => y.Value == x.TypeInt).Key, + StateString = TwConst.StateMap.FirstOrDefault(y => y.Value == x.State).Key + }; + } + + public static List GetListData(Model.Tw_InOutMasterOutput table ) + { + var q = GetModle(table); + Count = q.Count(); + if (Count == 0) + { + return null; + } + var result = q.ToList(); + // q = SortConditionHelper.SortingAndPaging(q, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize); + return (from x in result + select new Model.Tw_InOutMasterOutput + { + Id = x.Id, + ProjectId = x.ProjectId, + CusBillCode = x.CusBillCode, + InOutPlanMasterId = x.InOutPlanMasterId, + WarehouseCode = x.WarehouseCode, + Source = x.Source, + TypeInt = x.TypeInt, + State = x.State, + CreateMan = x.CreateMan, + CreateManName = x.CreateManName, + CreateDate = x.CreateDate, + ReqUnitId = x.ReqUnitId, + ReqUnitName = x.ReqUnitName, + Category = x.Category, + CategoryString = TwConst.CategoryMap.FirstOrDefault(y => y.Value == x.Category).Key, + TypeString = TwConst.TypeIntMap.FirstOrDefault(y => y.Value == x.TypeInt).Key, + StateString = TwConst.StateMap.FirstOrDefault(y => y.Value == x.State).Key + }).ToList(); + } + #endregion + + public static Model.Tw_InputMaster GetById(string Id) + { + return Funs.DB.Tw_InputMaster.FirstOrDefault(x => x.Id == Id); + } + + + public static void Add(Model.Tw_InputMaster newtable) + { + + Model.Tw_InputMaster table = new Model.Tw_InputMaster + { + Id = newtable.Id, + ProjectId = newtable.ProjectId, + InOutPlanMasterId = newtable.InOutPlanMasterId, + CusBillCode = newtable.CusBillCode, + WarehouseCode = newtable.WarehouseCode, + Category = newtable.Category, + Source = newtable.Source, + TypeInt = newtable.TypeInt, + State = newtable.State, + CreateMan = newtable.CreateMan, + CreateDate = newtable.CreateDate, + ReqUnitId = newtable.ReqUnitId, + }; + Funs.DB.Tw_InputMaster.InsertOnSubmit(table); + Funs.DB.SubmitChanges(); + } + + public static void Update(Model.Tw_InputMaster newtable) + { + + Model.Tw_InputMaster table = Funs.DB.Tw_InputMaster.FirstOrDefault(x => x.Id == newtable.Id); + if (table != null) + { + table.Id = newtable.Id; + table.ProjectId = newtable.ProjectId; + table.InOutPlanMasterId = newtable.InOutPlanMasterId; + table.CusBillCode = newtable.CusBillCode; + table.WarehouseCode = newtable.WarehouseCode; + table.Category = newtable.Category; + table.Source = newtable.Source; + table.TypeInt = newtable.TypeInt; + table.State = newtable.State; + table.CreateMan = newtable.CreateMan; + table.CreateDate = newtable.CreateDate; + table.ReqUnitId = newtable.ReqUnitId; + Funs.DB.SubmitChanges(); + } + + } + public static void DeleteById(string Id) + { + + Model.Tw_InputMaster table = Funs.DB.Tw_InputMaster.FirstOrDefault(x => x.Id == Id); + if (table != null) + { + Funs.DB.Tw_InputMaster.DeleteOnSubmit(table); + Funs.DB.SubmitChanges(); + } + + } + + /// + /// 根据计划单生成入库单 + /// + public static void GenInMasterByPlanId(string planId) + { + //获取计划单 + var planQueryModel = new Tw_InOutMasterOutput(); + planQueryModel.Id = planId; + var plan = TwInOutplanmasterService.GetListData(planQueryModel).FirstOrDefault(); + if (plan == null || plan.State!= (int)TwConst.State.已审核) + { + return; + } + //判断是否已经生成过入库单 + var queryIsExitInMaster = new Tw_InOutMasterOutput(); + queryIsExitInMaster.InOutPlanMasterId = planId; + queryIsExitInMaster.TypeInt = plan.TypeInt; + queryIsExitInMaster.Category = plan.Category; + var IsExitInMaster = GetModle(queryIsExitInMaster).FirstOrDefault(); + if (IsExitInMaster != null) + { + return; + } + //生成入库单 + var master = new Model.Tw_InputMaster() + { + Id = Guid.NewGuid().ToString(), + InOutPlanMasterId = plan.Id, + ProjectId = plan.ProjectId, + WarehouseCode = plan.WarehouseCode, + Source = plan.Source, + TypeInt = plan.TypeInt, + Category = plan.Category, + State = (int)TwConst.State.已完成, + CreateMan = plan.CreateMan, + CreateDate = DateTime.Now, + ReqUnitId = plan.ReqUnitId, + }; + if ((TwConst.TypeInt)plan.TypeInt!= TwConst.TypeInt.采购入库) + { + master.CusBillCode = GetCusBillCodeByTaskCode(plan.WeldTaskCode, (TwConst.TypeInt)plan.TypeInt, + (BLL.TwConst.Category)plan.Category); + + } + Add(master); + //生成明细 + Tw_InOutDetailOutput query = new Tw_InOutDetailOutput(); + query.InOutPlanMasterId= planId; + var details = TwInOutplandetailService.GetByModle(query).ToList(); + foreach (var detail in details) + { + var detailTable = new Model.Tw_InputDetail() + { + Id = Guid.NewGuid().ToString(), + InputMasterId = master.Id, + MaterialCode = detail.MaterialCode, + PlanNum = detail.PlanNum, + ActNum = detail.PlanNum, + }; + TwInputdetailService.Add(detailTable); + TwMaterialstockService.UpdateStockNum(master.ProjectId, detail.MaterialCode, master.WarehouseCode, TwConst.InOutType.入库, detailTable.ActNum); + + } + plan.State= (int)TwConst.State.已完成; + TwInOutplanmasterService.Update(plan); + } + /// + /// 根据计划单撤销入库单 + /// + /// + public static void RevokeGenInMasterByPlanId(string planId) + { + //校验计划单状态 + var plan = TwInOutplanmasterService.GetById(planId); + if (plan == null || plan.State != (int)TwConst.State.已完成) + { + return; + } + //获取入库单 + Tw_InOutMasterOutput query = new Tw_InOutMasterOutput(); + query.InOutPlanMasterId = planId; + var master = GetModle(query).FirstOrDefault(); + if (master == null) + { + return; + } + DeleteById(master.Id); //删除入库单 + //删除明细 + Tw_InOutDetailOutput queryDetail = new Tw_InOutDetailOutput(); + queryDetail.InputMasterId = master.Id; + var details = TwInputdetailService.GetByModle(queryDetail).ToList(); + foreach (var detail in details) + { + TwInputdetailService.DeleteById(detail.Id); + //撤销入库,即减去库存 + TwMaterialstockService.UpdateStockNum(master.ProjectId,detail.MaterialCode, master.WarehouseCode,TwConst.InOutType.出库, detail.ActNum); + } + plan.State = (int)TwConst.State.已审核; + TwInOutplanmasterService.Update(plan); + + } + public static string GetCusBillCodeByTaskCode(string taskCode, TwConst.TypeInt typeInt, TwConst.Category category) + { + string cusBillCode = ""; + switch (typeInt) + { + case TwConst.TypeInt.退料入库: + if (category == TwConst.Category.管段) + { + cusBillCode = taskCode + "-GI-P01-RE01"; + } + else if (category == TwConst.Category.管件) + { + cusBillCode = taskCode + "-GI-PF01-RE01"; + } + + break; + } + return cusBillCode; + } + + } +} \ No newline at end of file diff --git a/SGGL/BLL/CLGL/TwMaterialstockService.cs b/SGGL/BLL/CLGL/TwMaterialstockService.cs new file mode 100644 index 00000000..d0ac9799 --- /dev/null +++ b/SGGL/BLL/CLGL/TwMaterialstockService.cs @@ -0,0 +1,157 @@ +using FineUIPro; +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using System.Text; + + +namespace BLL +{ + + public static class TwMaterialstockService + { + + + + #region 获取列表 + /// + /// 记录数 + /// + public static int Count + { + get; + set; + } + public static IQueryable GetTw_MaterialStockByModle(Model.Tw_MaterialStockOutput table) + { + var q = from x in Funs.DB.Tw_MaterialStock + join mat in Funs.DB.HJGL_MaterialCodeLib on x.PipeLineMatCode equals mat.MaterialCode into mm + from mat in mm.DefaultIfEmpty() + where + (string.IsNullOrEmpty(table.Id) || x.Id.Contains(table.Id)) && + (string.IsNullOrEmpty(table.WarehouseCode) || x.WarehouseCode.Contains(table.WarehouseCode)) && + (string.IsNullOrEmpty(table.PipeLineMatCode) || x.PipeLineMatCode.Contains(table.PipeLineMatCode)) && + (string.IsNullOrEmpty(table.ProjectId) || x.ProjectId.Contains(table.ProjectId)) + select new Model.Tw_MaterialStockOutput + { + Id = x.Id, + WarehouseCode = x.WarehouseCode, + PipeLineMatCode = x.PipeLineMatCode, + StockNum = x.StockNum, + ProjectId = x.ProjectId, + MaterialName = mat.MaterialName, + MaterialSpec = mat.MaterialSpec, + MaterialUnit = mat.MaterialUnit, + } + ; + + return q; + } + + /// + /// 获取分页列表 + /// + /// + /// + /// + public static IEnumerable GetListData(Model.Tw_MaterialStockOutput table, Grid grid1) + { + var q = GetTw_MaterialStockByModle(table); + Count = q.Count(); + if (Count == 0) + { + return null; + } + q = q.Skip(grid1.PageSize * grid1.PageIndex).Take(grid1.PageSize); + // q = SortConditionHelper.SortingAndPaging(q, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize); + return from x in q + select x; + } + #endregion + + public static Model.Tw_MaterialStock GetTw_MaterialStockById(string Id) + { + return Funs.DB.Tw_MaterialStock.FirstOrDefault(x => x.Id == Id); + } + + public static void AddTw_MaterialStock(Model.Tw_MaterialStock newtable) + { + + Model.Tw_MaterialStock table = new Model.Tw_MaterialStock + { + Id = newtable.Id, + WarehouseCode = newtable.WarehouseCode, + PipeLineMatCode = newtable.PipeLineMatCode, + StockNum = newtable.StockNum, + ProjectId = newtable.ProjectId, + }; + Funs.DB.Tw_MaterialStock.InsertOnSubmit(table); + Funs.DB.SubmitChanges(); + } + + public static void UpdateTw_MaterialStock(Model.Tw_MaterialStock newtable) + { + + Model.Tw_MaterialStock table = Funs.DB.Tw_MaterialStock.FirstOrDefault(x => x.Id == newtable.Id); + if (table != null) + { + table.Id = newtable.Id; + table.WarehouseCode = newtable.WarehouseCode; + table.PipeLineMatCode = newtable.PipeLineMatCode; + table.StockNum = newtable.StockNum; + table.ProjectId = newtable.ProjectId; + Funs.DB.SubmitChanges(); + } + + } + public static void DeleteTw_MaterialStockById(string Id) + { + + Model.Tw_MaterialStock table = Funs.DB.Tw_MaterialStock.FirstOrDefault(x => x.Id == Id); + if (table != null) + { + Funs.DB.Tw_MaterialStock.DeleteOnSubmit(table); + Funs.DB.SubmitChanges(); + } + + } + + /// + /// 根据项目编码,材料编码,仓库编码,数量增减库存 + /// + /// + /// + /// + /// + /// + public static void UpdateStockNum(string ProjectId, string MaterialCode, string WarehouseCode,TwConst.InOutType inOutType , decimal? StockNum) + { + Model.Tw_MaterialStock table = Funs.DB.Tw_MaterialStock.FirstOrDefault(x => x.ProjectId == ProjectId && x.PipeLineMatCode == MaterialCode && x.WarehouseCode == WarehouseCode); + //如果是入库,则库存数量加上,如果是出库,则库存数量减去 + if (inOutType==TwConst.InOutType.出库) + { + StockNum=-StockNum;//出库,库存数量减去 + } + if (table != null) + { + table.StockNum = table.StockNum ?? 0; + table.StockNum += StockNum; + Funs.DB.SubmitChanges(); + } + else + { + Model.Tw_MaterialStock newtable = new Model.Tw_MaterialStock + { + Id = Guid.NewGuid().ToString(), + ProjectId = ProjectId, + PipeLineMatCode = MaterialCode, + WarehouseCode = WarehouseCode, + StockNum = StockNum??0, + }; + Funs.DB.Tw_MaterialStock.InsertOnSubmit(newtable); + Funs.DB.SubmitChanges(); + } + } + } +} \ No newline at end of file diff --git a/SGGL/BLL/CLGL/TwOutputdetailService..cs b/SGGL/BLL/CLGL/TwOutputdetailService..cs new file mode 100644 index 00000000..7918960b --- /dev/null +++ b/SGGL/BLL/CLGL/TwOutputdetailService..cs @@ -0,0 +1,125 @@ +using FineUIPro; +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using System.Text; + + +namespace BLL +{ + + public static class TwOutputdetailService + { + + #region 获取列表 + /// + /// 记录数 + /// + public static int Count + { + get; + set; + } + public static IQueryable GetByModle(Model.Tw_InOutDetailOutput table) + { + var q = from x in Funs.DB.Tw_OutputDetail + join y in Funs.DB.HJGL_Pipeline_Component on x.PipelineComponentId equals y.PipelineComponentId into yy + from y in yy.DefaultIfEmpty() + join mat in Funs.DB.HJGL_MaterialCodeLib on x.MaterialCode equals mat.MaterialCode into mm + from mat in mm.DefaultIfEmpty() + where + (string.IsNullOrEmpty(table.Id) || x.Id.Contains(table.Id)) && + (string.IsNullOrEmpty(table.OutputMasterId) || x.OutputMasterId.Contains(table.OutputMasterId)) && + (string.IsNullOrEmpty(table.PipelineComponentId) || x.PipelineComponentId.Contains(table.PipelineComponentId)) && + (string.IsNullOrEmpty(table.MaterialCode) || x.MaterialCode.Contains(table.MaterialCode)) + select new Model.Tw_InOutDetailOutput + { + Id = x.Id, + OutputMasterId = x.OutputMasterId, + PipelineComponentId = x.PipelineComponentId, + MaterialCode = x.MaterialCode, + PlanNum = x.PlanNum, + ActNum = x.ActNum, + PipelineComponentCode = y.PipelineComponentCode, + MaterialName = mat.MaterialName, + } + ; + + return q; + } + + /// + /// 获取分页列表 + /// + /// + /// + /// + public static IEnumerable GetListData(Model.Tw_InOutDetailOutput table, Grid grid1) + { + var q = GetByModle(table); + Count = q.Count(); + if (Count == 0) + { + return null; + } + q = q.Skip(grid1.PageSize * grid1.PageIndex).Take(grid1.PageSize); + // q = SortConditionHelper.SortingAndPaging(q, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize); + return from x in q + select x; + } + #endregion + + public static Model.Tw_OutputDetail GetById(string Id) + { + return Funs.DB.Tw_OutputDetail.FirstOrDefault(x => x.Id == Id); + } + + + public static void Add(Model.Tw_OutputDetail newtable) + { + + Model.Tw_OutputDetail table = new Model.Tw_OutputDetail + { + Id = newtable.Id, + OutputMasterId = newtable.OutputMasterId, + PipelineComponentId = newtable.PipelineComponentId, + MaterialCode = newtable.MaterialCode, + PlanNum = newtable.PlanNum, + ActNum = newtable.ActNum, + }; + Funs.DB.Tw_OutputDetail.InsertOnSubmit(table); + Funs.DB.SubmitChanges(); + } + + + public static void Update(Model.Tw_OutputDetail newtable) + { + + Model.Tw_OutputDetail table = Funs.DB.Tw_OutputDetail.FirstOrDefault(x => x.Id == newtable.Id); + if (table != null) + { + table.Id = newtable.Id; + table.OutputMasterId = newtable.OutputMasterId; + table.PipelineComponentId = newtable.PipelineComponentId; + table.MaterialCode = newtable.MaterialCode; + table.PlanNum = newtable.PlanNum; + table.ActNum = newtable.ActNum; + Funs.DB.SubmitChanges(); + } + + } + public static void DeleteById(string Id) + { + + Model.Tw_OutputDetail table = Funs.DB.Tw_OutputDetail.FirstOrDefault(x => x.Id == Id); + if (table != null) + { + Funs.DB.Tw_OutputDetail.DeleteOnSubmit(table); + Funs.DB.SubmitChanges(); + } + + } + + } +} \ No newline at end of file diff --git a/SGGL/BLL/CLGL/TwOutputmasterService.cs b/SGGL/BLL/CLGL/TwOutputmasterService.cs new file mode 100644 index 00000000..cc1edff1 --- /dev/null +++ b/SGGL/BLL/CLGL/TwOutputmasterService.cs @@ -0,0 +1,329 @@ +using FineUIPro; +using Model; +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using System.Text; + + +namespace BLL +{ + /// + /// 入库单逻辑层 + /// + public static class TwOutputmasterService + { + #region 获取列表 + /// + /// 记录数 + /// + public static int Count + { + get; + set; + } + public static IQueryable GetModle(Model.Tw_InOutMasterOutput table) + { + var q = from x in Funs.DB.Tw_OutputMaster + join y in Funs.DB.Tw_InOutPlanMaster on x.InOutPlanMasterId equals y.Id into yy + from y in yy.DefaultIfEmpty() + //join z in Funs.DB.HJGL_WeldTask on y.WeldTaskId equals z.WeldTaskId into zz + //from z in zz.DefaultIfEmpty() + join person in Funs.DB.Person_Persons on x.CreateMan equals person.PersonId into persons + from person in persons.DefaultIfEmpty() + join unit in Funs.DB.Base_Unit on x.ReqUnitId equals unit.UnitId into units + from unit in units.DefaultIfEmpty() + where + (string.IsNullOrEmpty(table.Id) || x.Id.Contains(table.Id)) && + (string.IsNullOrEmpty(table.InOutPlanMasterId) || x.InOutPlanMasterId .Contains(table.InOutPlanMasterId)) && + (string.IsNullOrEmpty(table.ProjectId) || x.ProjectId.Contains(table.ProjectId)) && + (string.IsNullOrEmpty(table.CusBillCode) || x.CusBillCode.Contains(table.CusBillCode)) && + (string.IsNullOrEmpty(table.WarehouseCode) || x.WarehouseCode.Contains(table.WarehouseCode)) && + (string.IsNullOrEmpty(table.CreateMan) || x.CreateMan.Contains(table.CreateMan)) && + (string.IsNullOrEmpty(table.ReqUnitId) || x.ReqUnitId.Contains(table.ReqUnitId)) && + (string.IsNullOrEmpty(table.UnitWorkId) || y.WeldTaskId.Contains(table.UnitWorkId)) && + (table.TypeInt == null || x.TypeInt == table.TypeInt) && + (table.Category == null || x.Category == table.Category) && + (table.State == null || x.State == table.State) + select new Model.Tw_InOutMasterOutput + { + Id = x.Id, + ProjectId = x.ProjectId, + CusBillCode = x.CusBillCode, + InOutPlanMasterId = x.InOutPlanMasterId, + WarehouseCode = x.WarehouseCode, + Category = x.Category, + Source = x.Source, + TypeInt = x.TypeInt, + State = x.State, + CreateMan = x.CreateMan, + CreateManName = person.PersonName, + CreateDate = x.CreateDate, + ReqUnitId = x.ReqUnitId, + ReqUnitName = unit.UnitName, + WeldTaskId = y.WeldTaskId, + }; + + return q; + } + + /// + /// 获取分页列表 + /// + /// + /// + /// + public static IEnumerable GetListData(Model.Tw_InOutMasterOutput table, Grid grid1) + { + var q = GetModle(table); + Count = q.Count(); + if (Count == 0) + { + return null; + } + var result = q.Skip(grid1.PageSize * grid1.PageIndex).Take(grid1.PageSize).ToList(); + return from x in result + select new Model.Tw_InOutMasterOutput + { + Id = x.Id, + ProjectId = x.ProjectId, + CusBillCode = x.CusBillCode, + WarehouseCode = x.WarehouseCode, + InOutPlanMasterId = x.InOutPlanMasterId, + Source = x.Source, + TypeInt = x.TypeInt, + State = x.State, + Category= x.Category, + CreateMan = x.CreateMan, + CreateManName = x.CreateManName, + CreateDate = x.CreateDate, + ReqUnitId = x.ReqUnitId, + ReqUnitName = x.ReqUnitName, + TypeString = TwConst.TypeIntMap.FirstOrDefault(y => y.Value == x.TypeInt).Key, + StateString = TwConst.StateMap.FirstOrDefault(y => y.Value == x.State).Key, + CategoryString = TwConst.CategoryMap.FirstOrDefault(y => y.Value == x.Category).Key, + WeldTaskId = x.WeldTaskId, + WeldTaskCode = x.WeldTaskId != null ? x.WeldTaskId.Contains('|') ? Funs.DB.HJGL_WeldTask.FirstOrDefault(e => e.UnitWorkId == x.WeldTaskId.Split('|')[0].ToString() && e.UnitId == x.WeldTaskId.Split('|')[1].ToString() && e.TaskDate.Value.Date == Convert.ToDateTime(x.WeldTaskId.Split('|')[2].ToString()).Date)?.TaskCode : "" : "", + + }; + } + + public static List GetListData(Model.Tw_InOutMasterOutput table) + { + var q = GetModle(table); + Count = q.Count(); + if (Count == 0) + { + return null; + } + var result = q.ToList(); + return (from x in result + select new Model.Tw_InOutMasterOutput + { + Id = x.Id, + ProjectId = x.ProjectId, + CusBillCode = x.CusBillCode, + InOutPlanMasterId = x.InOutPlanMasterId, + WarehouseCode = x.WarehouseCode, + Source = x.Source, + TypeInt = x.TypeInt, + State = x.State, + Category = x.Category, + CreateMan = x.CreateMan, + CreateManName = x.CreateManName, + CreateDate = x.CreateDate, + ReqUnitId = x.ReqUnitId, + ReqUnitName = x.ReqUnitName, + TypeString = TwConst.TypeIntMap.FirstOrDefault(y => y.Value == x.TypeInt).Key, + StateString = TwConst.StateMap.FirstOrDefault(y => y.Value == x.State).Key, + CategoryString = TwConst.CategoryMap.FirstOrDefault(y => y.Value == x.Category).Key, + WeldTaskId = x.WeldTaskId, + WeldTaskCode = x.WeldTaskId != null ? x.WeldTaskId.Contains('|') ? Funs.DB.HJGL_WeldTask.FirstOrDefault(e => e.UnitWorkId == x.WeldTaskId.Split('|')[0].ToString() && e.UnitId == x.WeldTaskId.Split('|')[1].ToString() && e.TaskDate.Value.Date == Convert.ToDateTime(x.WeldTaskId.Split('|')[2].ToString()).Date)?.TaskCode : "" : "", + + }).ToList(); + } + + #endregion + + public static Model.Tw_OutputMaster GetTw_OutputMasterById(string Id) + { + return Funs.DB.Tw_OutputMaster.FirstOrDefault(x => x.Id == Id); + } + + public static void Add(Model.Tw_OutputMaster newtable) + { + + Model.Tw_OutputMaster table = new Model.Tw_OutputMaster + { + Id = newtable.Id, + ProjectId = newtable.ProjectId, + InOutPlanMasterId = newtable.InOutPlanMasterId, + CusBillCode = newtable.CusBillCode, + WarehouseCode = newtable.WarehouseCode, + Category = newtable.Category, + Source = newtable.Source, + TypeInt = newtable.TypeInt, + State = newtable.State, + CreateMan = newtable.CreateMan, + CreateDate = newtable.CreateDate, + ReqUnitId = newtable.ReqUnitId, + }; + Funs.DB.Tw_OutputMaster.InsertOnSubmit(table); + Funs.DB.SubmitChanges(); + } + + public static void Update(Model.Tw_OutputMaster newtable) + { + + Model.Tw_OutputMaster table = Funs.DB.Tw_OutputMaster.FirstOrDefault(x => x.Id == newtable.Id); + if (table != null) + { + table.Id = newtable.Id; + table.ProjectId = newtable.ProjectId; + table.InOutPlanMasterId = newtable.InOutPlanMasterId; + table.CusBillCode = newtable.CusBillCode; + table.WarehouseCode = newtable.WarehouseCode; + table.Category = newtable.Category; + table.Source = newtable.Source; + table.TypeInt = newtable.TypeInt; + table.State = newtable.State; + table.CreateMan = newtable.CreateMan; + table.CreateDate = newtable.CreateDate; + table.ReqUnitId = newtable.ReqUnitId; + Funs.DB.SubmitChanges(); + } + + } + public static void DeleteById(string Id) + { + + Model.Tw_OutputMaster table = Funs.DB.Tw_OutputMaster.FirstOrDefault(x => x.Id == Id); + if (table != null) + { + Funs.DB.Tw_OutputMaster.DeleteOnSubmit(table); + Funs.DB.SubmitChanges(); + } + + } + + /// + /// 根据计划单生成出库单 + /// + public static void GenOutMasterByPlanId(string planId, List detailLists) + { + //获取出库单 + var planQueryModel = new Tw_InOutMasterOutput(); + planQueryModel.Id = planId; + var plan = TwInOutplanmasterService.GetListData(planQueryModel).FirstOrDefault(); + if (plan == null || plan.State != (int)TwConst.State.已审核) + { + return; + } + //判断是否已经生成过出库单 + var queryIsExitInMaster = new Tw_InOutMasterOutput(); + queryIsExitInMaster.InOutPlanMasterId = planId; + queryIsExitInMaster.TypeInt= plan.TypeInt; + var IsExitInMaster = GetModle(queryIsExitInMaster).FirstOrDefault(); + if (IsExitInMaster != null) + { + return; + } + //生成出库单 + var master = new Model.Tw_OutputMaster() + { + Id = Guid.NewGuid().ToString(), + InOutPlanMasterId = plan.Id, + ProjectId = plan.ProjectId, + CusBillCode = GetCusBillCodeByTaskCode(plan.WeldTaskCode, (TwConst.TypeInt)plan.TypeInt, (BLL.TwConst.Category)plan.Category), + WarehouseCode = plan.WarehouseCode, + Category = plan.Category, + Source = plan.Source, + TypeInt = plan.TypeInt, + State = (int)TwConst.State.已完成, + CreateMan = plan.CreateMan, + CreateDate = DateTime.Now, + ReqUnitId = plan.ReqUnitId, + }; + Add(master); + //生成出库单明细 + foreach (var detail in detailLists) + { + var detailTable = new Model.Tw_OutputDetail() + { + Id = Guid.NewGuid().ToString(), + OutputMasterId = master.Id, + MaterialCode = detail.MaterialCode, + PlanNum = detail.PlanNum, + ActNum = detail.ActNum, + }; + TwOutputdetailService.Add(detailTable); + TwMaterialstockService.UpdateStockNum(master.ProjectId, detail.MaterialCode, master.WarehouseCode, TwConst.InOutType.出库, detailTable.ActNum); + + } + plan.State = (int)TwConst.State.已完成; + TwInOutplanmasterService.Update(plan); + } + /// + /// 根据计划单撤销出库单 + /// + /// + public static void RevokeGenOutMasterByPlanId(string planId) + { + Tw_InOutMasterOutput query = new Tw_InOutMasterOutput(); + query.InOutPlanMasterId = planId; + var master = GetModle(query).FirstOrDefault(); + if (master == null) + { + return; + } + DeleteById(master.Id); //删除出库单 + //删除明细 + Tw_InOutDetailOutput queryDetail = new Tw_InOutDetailOutput(); + queryDetail.OutputMasterId = master.Id; + var details = TwOutputdetailService.GetByModle(queryDetail).ToList(); + foreach (var detail in details) + { + TwOutputdetailService.DeleteById(detail.Id); + //撤销出库,即增加库存 + TwMaterialstockService.UpdateStockNum(master.ProjectId, detail.MaterialCode, master.WarehouseCode, TwConst.InOutType.入库, detail.ActNum); + } + + + } + + public static string GetCusBillCodeByTaskCode(string taskCode, TwConst.TypeInt typeInt, TwConst.Category category) + { + string cusBillCode = ""; + switch (typeInt) + { + case TwConst.TypeInt.领料出库: + if (category == TwConst.Category.管段) + { + cusBillCode = taskCode + "-GI-P01"; + } + else if (category == TwConst.Category.管件) + { + cusBillCode = taskCode + "-GI-PF01"; + } + + break; + case TwConst.TypeInt.补料出库: + if (category == TwConst.Category.管段) + { + cusBillCode = taskCode + "-GI-P01-SI01"; + } + else if (category == TwConst.Category.管件) + { + cusBillCode = taskCode + "-GI-PF01-SI01"; + } + + break; + + } + return cusBillCode; + } + + + } +} \ No newline at end of file diff --git a/SGGL/BLL/Common/Const.cs b/SGGL/BLL/Common/Const.cs index 05bfc034..5e60407f 100644 --- a/SGGL/BLL/Common/Const.cs +++ b/SGGL/BLL/Common/Const.cs @@ -4861,6 +4861,31 @@ namespace BLL #endregion #endregion + + #region 材料管理 + public const string Tw_InPlanMasteTemplateUrl = "File\\Excel\\DataIn\\材料入库导入模板.xlsx"; + /// + /// 入库申请 + /// + public const string Tw_InPlanMasterMenuId = "324C72AF-447A-4308-AFB7-ABF788C58240"; + /// + /// 入库单管理 + /// + public const string Tw_InputMasterMenuId = "4A55351A-2440-4A2D-8509-3FFEE5FC8861"; + /// + /// 出库申请 + /// + public const string Tw_OutPlanMasterMenuId = "E910F410-07FB-41C3-AA80-8E30D1563BC1"; + /// + /// 出库单管理 + /// + public const string Tw_OutputMasterMenuId = "BCCA4D81-410C-4746-B1E4-F882BC3A25F4"; + /// + /// 库存管理 + /// + public const string Tw_MaterialStockMenuId = "803F9828-52FA-4EF7-99C7-ADA99DADE9FB"; + #endregion + #region 合同附件Id /// /// 招标文件台账模板 diff --git a/SGGL/BLL/DropListService.cs b/SGGL/BLL/DropListService.cs index 7874419e..2717abb6 100644 --- a/SGGL/BLL/DropListService.cs +++ b/SGGL/BLL/DropListService.cs @@ -240,7 +240,13 @@ namespace BLL list[1] = new ListItem("预制", "预制"); return list; } - + public static ListItem[] HJGL_WarehouseCode() + { + ListItem[] list = new ListItem[2]; + list[0] = new ListItem("现场安装", "现场安装"); + list[1] = new ListItem("工厂预制", "工厂预制"); + return list; + } /// /// 机动化程度 /// diff --git a/SGGL/BLL/HJGL/WeldingManage/WeldTaskService.cs b/SGGL/BLL/HJGL/WeldingManage/WeldTaskService.cs index e3aa4165..2015b8dd 100644 --- a/SGGL/BLL/HJGL/WeldingManage/WeldTaskService.cs +++ b/SGGL/BLL/HJGL/WeldingManage/WeldTaskService.cs @@ -1,6 +1,9 @@ -using System; +using Model; +using System; using System.Collections.Generic; using System.Linq; +using System.Linq.Expressions; +using System.Numerics; namespace BLL { @@ -29,7 +32,7 @@ namespace BLL ///获取焊接任务单编号 /// /// - public static string GetTaskCodeByDate(string projectId, string date) + public static string GetTaskCodeByDate(string projectId, string date,string unitworkid,string unitid) { string code = string.Empty; var list = (from x in Funs.DB.HJGL_WeldTask where x.ProjectId == projectId && x.TaskDate == Convert.ToDateTime(date) orderby x.TaskCode descending select x.TaskCode).Distinct().ToList(); @@ -62,6 +65,7 @@ namespace BLL { code = date + "-001"; } + code = code.Replace("-", "") + "-" + UnitService.GetUnitCodeByUnitId(unitid) + "-" + UnitWorkService.getUnitWorkByUnitWorkId(unitworkid)?.UnitWorkCode; return code; } @@ -305,6 +309,113 @@ namespace BLL } } - + public static void GenOutPlanmasterByWeldTaskId(string unitworkid,string unitid,DateTime date,string Personid) + { + Model.SGGLDB db = Funs.DB; + Model.View_HJGL_WeldingTask weldTask = db.View_HJGL_WeldingTask.FirstOrDefault(e => e.UnitWorkId==unitworkid && e.UnitId==unitid&& e.TaskDate.Value.Date==date.Date); + if (weldTask==null) + { + return; + } + string WeldTaskId= unitworkid+"|"+unitid+ "|" + string.Format("{0:yyyyMMMMdd}", date); + //判断是否已经生成过出库计划单 + var queryIsExitInMaster = new Tw_InOutMasterOutput(); + queryIsExitInMaster.WeldTaskId = WeldTaskId; + queryIsExitInMaster.InOutType=(int)TwConst.InOutType.出库; + queryIsExitInMaster.TypeInt = (int)TwConst.TypeInt.领料出库; + var IsExitInMaster = TwInOutplanmasterService.GetModle(queryIsExitInMaster).FirstOrDefault(); + if (IsExitInMaster != null) + { + return; + } + var pipelineList = db.View_HJGL_WeldingTask.Where(e => e.UnitWorkId == unitworkid && e.UnitId == unitid && e.TaskDate.Value.Date == date.Date).Select(x=>x.PipelineId).Distinct().ToList(); + + //var outMateriaList = db.HJGL_PipeLineMat.Where(x => pipelineList.Contains(x.PipelineId)) + // .GroupBy(x => x.MaterialCode).Select(x => new + // { + // x.Key, + // planNum = x.Sum(y => y.Number)??0, + // }).ToList(); + var outMateriaList = from x in db.HJGL_PipeLineMat + join y in db.HJGL_MaterialCodeLib on x.MaterialCode equals y.MaterialCode + where pipelineList.Contains(x.PipelineId) + group x by new { x.MaterialCode, y.MaterialUnit } + into g + select new + { + g.Key.MaterialCode, + planNum = g.Sum(x => x.Number) ?? 0, + MaterialName = g.Key.MaterialUnit, + }; + + var outPlanDetailListPiece = outMateriaList.Where(x => x.MaterialName.Contains("个"));//管件 + var outPlanDetailListOthere = outMateriaList.Where(x => x.MaterialName.Contains("米"));//管段 + var weldTaskCode = GetWeldTaskById(weldTask.WeldTaskId)?.TaskCode; + if (outPlanDetailListPiece.Any()) + { + Model.Tw_InOutPlanMaster table = new Model.Tw_InOutPlanMaster + { + Id = Guid.NewGuid().ToString(), + ProjectId = weldTask.ProjectId, + // CusBillCode = string.Format("{0:yyyyMMdd}", DateTime.Now) + UnitService.GetUnitCodeByUnitId(weldTask.UnitId) + "-" + UnitWorkService.getUnitWorkByUnitWorkId(weldTask.UnitWorkId)?.UnitWorkCode + "AP-PF01", + CusBillCode=TwInOutplanmasterService.GetCusBillCodeByTaskCode(weldTaskCode,TwConst.TypeInt.领料出库,TwConst.Category.管件), + WarehouseCode = PipelineService.GetPipeArea().Where(x => x.Value == PipelineService.GetPipelineByPipelineId(weldTask.PipelineId).PipeArea).Select(x => x.Text).FirstOrDefault(), + Source = 1, + InOutType = (int)TwConst.InOutType.出库, + TypeInt = (int)TwConst.TypeInt.领料出库, + State = (int)TwConst.State.待审核, + Category = (int)TwConst.Category.管件, + CreateMan = Personid, + CreateDate = DateTime.Now, + WeldTaskId = WeldTaskId, + ReqUnitId = weldTask.UnitId, + }; + TwInOutplanmasterService.Add(table); + foreach (var item in outPlanDetailListPiece) + { + Model.Tw_InOutPlanDetail detail = new Model.Tw_InOutPlanDetail + { + Id = Guid.NewGuid().ToString(), + InOutPlanMasterId = table.Id, + MaterialCode = item.MaterialCode, + PlanNum = item.planNum, + }; + TwInOutplandetailService.Add(detail); + } + } + if (outPlanDetailListOthere.Any()) + { + Model.Tw_InOutPlanMaster table = new Model.Tw_InOutPlanMaster + { + Id = Guid.NewGuid().ToString(), + ProjectId = weldTask.ProjectId, + CusBillCode =TwInOutplanmasterService.GetCusBillCodeByTaskCode(weldTaskCode, TwConst.TypeInt.领料出库, TwConst.Category.管段), + WarehouseCode = PipelineService.GetPipeArea().Where(x => x.Value == PipelineService.GetPipelineByPipelineId(weldTask.PipelineId).PipeArea).Select(x => x.Text).FirstOrDefault(), + Source = 1, + InOutType = (int)TwConst.InOutType.出库, + TypeInt = (int)TwConst.TypeInt.领料出库, + State = (int)TwConst.State.待审核, + Category = (int)TwConst.Category.管段, + CreateMan = Personid, + CreateDate = DateTime.Now, + WeldTaskId = WeldTaskId, + ReqUnitId = weldTask.UnitId, + }; + TwInOutplanmasterService.Add(table); + foreach (var item in outPlanDetailListOthere) + { + Model.Tw_InOutPlanDetail detail = new Model.Tw_InOutPlanDetail + { + Id = Guid.NewGuid().ToString(), + InOutPlanMasterId = table.Id, + MaterialCode = item.MaterialCode, + PlanNum = item.planNum, + }; + TwInOutplandetailService.Add(detail); + } + } + + + } } } diff --git a/SGGL/FineUIPro.Web/CLGL/ArrivalStatistics.aspx b/SGGL/FineUIPro.Web/CLGL/ArrivalStatistics.aspx new file mode 100644 index 00000000..89d31dcb --- /dev/null +++ b/SGGL/FineUIPro.Web/CLGL/ArrivalStatistics.aspx @@ -0,0 +1,125 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ArrivalStatistics.aspx.cs" Inherits="FineUIPro.Web.CLGL.ArrivalStatistics" %> + + + + + + + 到货统计分析 + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <%-- + + --%> + + + + + + + + + + + + + + + + + + <%-- + + + --%> + + + + + diff --git a/SGGL/FineUIPro.Web/CLGL/ArrivalStatistics.aspx.cs b/SGGL/FineUIPro.Web/CLGL/ArrivalStatistics.aspx.cs new file mode 100644 index 00000000..05deb577 --- /dev/null +++ b/SGGL/FineUIPro.Web/CLGL/ArrivalStatistics.aspx.cs @@ -0,0 +1,159 @@ +using BLL; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace FineUIPro.Web.CLGL +{ + public partial class ArrivalStatistics : PageBase + { + + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + this.ddlPageSize.SelectedValue = this.Grid1.PageSize.ToString(); + // 绑定表格 + this.BindGrid(); + } + } + + #region 绑定数据 + /// + /// 绑定数据 + /// + private void BindGrid() + { + var tb = BLL.TwArrivalStatisticsService.GetStatistics(this.CurrUser.LoginProjectId, txtMaterialCode.Text.Trim()); + //tb = GetFilteredTable(Grid1.FilteredData, tb); + Grid1.DataSource = tb; + Grid1.DataBind(); + } + #endregion + + #region GV 数据操作 + /// + /// 过滤表头 + /// + /// + /// + //protected void Grid1_FilterChange(object sender, EventArgs e) + //{ + // this.BindGrid(); + //} + + /// + /// 分页 + /// + /// + /// + protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e) + { + this.Grid1.PageIndex = e.NewPageIndex; + this.BindGrid(); + } + + /// + /// 排序 + /// + /// + /// + protected void Grid1_Sort(object sender, GridSortEventArgs e) + { + this.Grid1.SortDirection = e.SortDirection; + this.Grid1.SortField = e.SortField; + this.BindGrid(); + } + + /// + /// 分页显示条数下拉框 + /// + /// + /// + protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e) + { + this.Grid1.PageSize = Convert.ToInt32(this.ddlPageSize.SelectedValue); + this.BindGrid(); + } + #endregion + + #region 关闭弹出窗 + /// + /// 关闭弹出窗 + /// + /// + /// + protected void Window1_Close(object sender, WindowCloseEventArgs e) + { + BindGrid(); + } + #endregion + + + + #region 导出按钮 + /// 导出按钮 + /// + /// + /// + protected void btnOut_Click(object sender, EventArgs e) + { + Response.ClearContent(); + string filename = Funs.GetNewFileName(); + Response.AddHeader("content-disposition", "attachment; filename=" + System.Web.HttpUtility.UrlEncode("材料库存表" + filename, System.Text.Encoding.UTF8) + ".xls"); + Response.ContentType = "application/excel"; + Response.ContentEncoding = System.Text.Encoding.UTF8; + this.Grid1.PageSize = 500; + this.BindGrid(); + Response.Write(GetGridTableHtml(Grid1)); + Response.End(); + } + + /// + /// 导出方法 + /// + /// + /// + private string GetGridTableHtml(Grid grid) + { + StringBuilder sb = new StringBuilder(); + sb.Append(""); + sb.Append(""); + sb.Append(""); + foreach (GridColumn column in grid.Columns) + { + sb.AppendFormat("", column.HeaderText); + } + sb.Append(""); + foreach (GridRow row in grid.Rows) + { + sb.Append(""); + foreach (GridColumn column in grid.Columns) + { + string html = row.Values[column.ColumnIndex].ToString(); + if (column.ColumnID == "tfNumber") + { + html = (row.FindControl("lblNumber") as System.Web.UI.WebControls.Label).Text; + } + sb.AppendFormat("", html); + } + + sb.Append(""); + } + + sb.Append("
{0}
{0}
"); + + return sb.ToString(); + } + #endregion + + protected void btnSearch_Click(object sender, EventArgs e) + { + BindGrid(); + } + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/CLGL/ArrivalStatistics.aspx.designer.cs b/SGGL/FineUIPro.Web/CLGL/ArrivalStatistics.aspx.designer.cs new file mode 100644 index 00000000..e8989120 --- /dev/null +++ b/SGGL/FineUIPro.Web/CLGL/ArrivalStatistics.aspx.designer.cs @@ -0,0 +1,143 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.CLGL +{ + + + public partial class ArrivalStatistics + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// Panel1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel Panel1; + + /// + /// Grid1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid Grid1; + + /// + /// Toolbar2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar2; + + /// + /// txtMaterialCode 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtMaterialCode; + + /// + /// ToolbarFill1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarFill ToolbarFill1; + + /// + /// btnSearch 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSearch; + + /// + /// btnOut 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnOut; + + /// + /// lblNumber 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label lblNumber; + + /// + /// ToolbarSeparator1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1; + + /// + /// ToolbarText1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarText ToolbarText1; + + /// + /// ddlPageSize 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList ddlPageSize; + + /// + /// Window1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window1; + } +} diff --git a/SGGL/FineUIPro.Web/CLGL/InPlanMaster.aspx b/SGGL/FineUIPro.Web/CLGL/InPlanMaster.aspx new file mode 100644 index 00000000..e34da2f2 --- /dev/null +++ b/SGGL/FineUIPro.Web/CLGL/InPlanMaster.aspx @@ -0,0 +1,188 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="InPlanMaster.aspx.cs" Inherits="FineUIPro.Web.CLGL.InPlanMaster" %> + + + + + + + + 出入库计划主表 + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/CLGL/InPlanMaster.aspx.cs b/SGGL/FineUIPro.Web/CLGL/InPlanMaster.aspx.cs new file mode 100644 index 00000000..acbeab6c --- /dev/null +++ b/SGGL/FineUIPro.Web/CLGL/InPlanMaster.aspx.cs @@ -0,0 +1,390 @@ +using BLL; +using FineUIPro.Web.HSSE.EduTrain; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace FineUIPro.Web.CLGL +{ + public partial class InPlanMaster : PageBase + { + + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + this.GetButtonPower(); + InitDrpList(); + // 绑定表格 + this.BindGrid(); + } + } + + #region 绑定数据 + private void InitDrpList() + { + this.ddlPageSize.SelectedValue = this.Grid1.PageSize.ToString(); + drpWarehouse.DataTextField = "Text"; + drpWarehouse.DataValueField = "Value"; + drpWarehouse.DataSource = BLL.DropListService .HJGL_WarehouseCode(); + drpWarehouse.DataBind(); + Funs.FineUIPleaseSelect(this.drpWarehouse); + drpTypeInt.DataTextField = "Key"; + drpTypeInt.DataValueField = "Value"; + drpTypeInt.DataSource = BLL.TwConst.TypeIntMap.Where(x=>x.Key.Contains("入库")); + drpTypeInt.DataBind(); + Funs.FineUIPleaseSelect(this.drpTypeInt); + drpStates.DataTextField = "Key"; + drpStates.DataValueField = "Value"; + drpStates.DataSource = BLL.TwConst.StateMap; + drpStates.DataBind(); + Funs.FineUIPleaseSelect(this.drpStates); + + } + /// + /// 绑定数据 + /// + private void BindGrid() + { + Model.Tw_InOutMasterOutput table = new Model.Tw_InOutMasterOutput(); + table.ProjectId=this.CurrUser.LoginProjectId; + table.InOutType = (int?)TwConst.InOutType.入库; + if (drpTypeInt.SelectedValue != Const._Null) + { + table.TypeInt = Convert.ToInt32(drpTypeInt.SelectedValue); + } + if (drpStates.SelectedValue != Const._Null) + { + table.State = Convert.ToInt32(drpStates.SelectedValue); + } + if (drpWarehouse.SelectedValue != Const._Null) + { + table.WarehouseCode = drpWarehouse.SelectedValue; + } + var tb = BLL.TwInOutplanmasterService.GetListData(table, Grid1); + Grid1.RecordCount = TwInOutplanmasterService.Count; + Grid1.DataSource = tb; + Grid1.DataBind(); + + Grid2.DataSource=null; + Grid2.DataBind(); + } + private void BindDetailGrid(string inOutPlanMasterId) + { + Model.Tw_InOutDetailOutput table = new Model.Tw_InOutDetailOutput(); + table.InOutPlanMasterId = inOutPlanMasterId; + var tb = BLL.TwInOutplandetailService.GetListData(table, Grid2); + Grid2.DataSource = tb; + Grid2.DataBind(); + } + #endregion + + #region GV 数据操作 + /// + /// 过滤表头 + /// + /// + /// + //protected void Grid1_FilterChange(object sender, EventArgs e) + //{ + // this.BindGrid(); + //} + + /// + /// 分页 + /// + /// + /// + protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e) + { + this.Grid1.PageIndex = e.NewPageIndex; + this.BindGrid(); + } + + /// + /// 排序 + /// + /// + /// + protected void Grid1_Sort(object sender, GridSortEventArgs e) + { + this.Grid1.SortDirection = e.SortDirection; + this.Grid1.SortField = e.SortField; + this.BindGrid(); + } + protected void Grid1_RowClick(object sender, GridRowClickEventArgs e) + { + if (e.RowIndex >= 0) + { + string ID = Grid1.DataKeys[e.RowIndex][0].ToString(); + BindDetailGrid(ID); + } + } + /// + /// 分页显示条数下拉框 + /// + /// + /// + protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e) + { + this.Grid1.PageSize = Convert.ToInt32(this.ddlPageSize.SelectedValue); + this.BindGrid(); + } + #endregion + + #region 数据编辑事件 + protected void btnSearch_Click(object sender, EventArgs e) + { + BindGrid(); + } + + + /// + /// 新增 + /// + /// + /// + protected void btnImport_Click(object sender, EventArgs e) + { + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("InPlanMasterDataIn.aspx?", "导入 - "))); + } + + /// + /// 编辑按钮 + /// + /// + /// + protected void btnEdit_Click(object sender, EventArgs e) + { + if (Grid1.SelectedRowIndexArray.Length == 0) + { + Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning); + return; + } + string ID = Grid1.SelectedRowID; + var model = BLL.TwInOutplanmasterService.GetById(ID); + if (model != null) ///已上报时不能删除 + { + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("InPlanMasterEdit.aspx?Id={0}", ID, "编辑 - "))); + } + } + + /// + /// Grid行双击事件 + /// + /// + /// + protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e) + { + this.btnEdit_Click(null, null); + } + + /// + /// 批量删除 + /// + /// + /// + protected void btnDelete_Click(object sender, EventArgs e) + { + if (Grid1.SelectedRowIndexArray.Length > 0) + { + foreach (int rowIndex in Grid1.SelectedRowIndexArray) + { + string rowID = Grid1.DataKeys[rowIndex][0].ToString(); + var model = BLL.TwInOutplanmasterService.GetById(rowID); + if (model.State == (int)TwConst.State.已审核|| model.State == (int)TwConst.State.已完成) + { + Alert.ShowInTop("请选择有效的计划!", MessageBoxIcon.Warning); + return; + } + else + { + BLL.TwInOutplanmasterService.DeleteById(rowID); + BindGrid(); + ShowNotify("删除数据成功!", MessageBoxIcon.Success); + } + } + + + } + } + protected void btnPassMaster_OnClick(object sender, EventArgs e) + { + if (Grid1.SelectedRowIndexArray.Length == 0) + { + Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning); + return; + } + string planId = Grid1.SelectedRowID; + var planMaster = BLL.TwInOutplanmasterService.GetById(planId); + if (planMaster.State != (int)TwConst.State.待审核) + { + Alert.ShowInTop("请选择有效的计划!", MessageBoxIcon.Warning); + return; + } + else + { + planMaster.State = (int)TwConst.State.已审核; + TwInOutplanmasterService.Update(planMaster); + ShowNotify("审核通过!", MessageBoxIcon.Success); + BindGrid(); + } + + } + protected void btnGenInMaster_Click(object sender, EventArgs e) + { + if (Grid1.SelectedRowIndexArray.Length == 0) + { + Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning); + return; + } + string planId = Grid1.SelectedRowID; + var planMaster = BLL.TwInOutplanmasterService.GetById(planId); + if ( planMaster.State != (int)TwConst.State.已审核) + { + Alert.ShowInTop("请选择有效的计划!", MessageBoxIcon.Warning); + return; + } + else + { + TwInputmasterService.GenInMasterByPlanId(planId); + BindGrid(); + ShowNotify("生成入库单成功!", MessageBoxIcon.Success); + } + + } + + protected void btnRevokeGenInMaster_Click(object sender, EventArgs e) + { + if (Grid1.SelectedRowIndexArray.Length == 0) + { + Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning); + return; + } + string planId = Grid1.SelectedRowID; + var planMaster = BLL.TwInOutplanmasterService.GetById(planId); + if (planMaster.State != (int)TwConst.State.已完成) + { + Alert.ShowInTop("请选择有效的计划!", MessageBoxIcon.Warning); + return; + } + else + { + TwInputmasterService.RevokeGenInMasterByPlanId(planId); + BindGrid(); + ShowNotify("撤销入库单成功!",MessageBoxIcon.Success); + } + + } + #endregion + + #region 关闭弹出窗 + /// + /// 关闭弹出窗 + /// + /// + /// + protected void Window1_Close(object sender, WindowCloseEventArgs e) + { + BindGrid(); + } + #endregion + + #region 获取权限按钮 + /// + /// 获取按钮权限 + /// + /// + /// + private void GetButtonPower() + { + var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.PersonId, BLL.Const.Tw_InPlanMasterMenuId); + if (buttonList.Count > 0) + { + if (buttonList.Contains(BLL.Const.BtnAdd)) + { + this.btnImport.Hidden = false; + } + if (buttonList.Contains(BLL.Const.BtnModify)) + { + this.btnMenuEdit.Hidden = false; + this.btnGenInMaster.Hidden = false; + this.btnRevokeGenInMaster.Hidden = false; + this.btnPassMaster.Hidden = false; + } + if (buttonList.Contains(BLL.Const.BtnDelete)) + { + this.btnMenuDelete.Hidden = false; + } + + if (buttonList.Contains(BLL.Const.BtnAuditing)) + { + this.btnPassMaster.Hidden = false; + } + } + } + #endregion + + #region 导出按钮 + /// 导出按钮 + /// + /// + /// + protected void btnOut_Click(object sender, EventArgs e) + { + Response.ClearContent(); + string filename = Funs.GetNewFileName(); + Response.AddHeader("content-disposition", "attachment; filename=" + System.Web.HttpUtility.UrlEncode("出入库计划主表" + filename, System.Text.Encoding.UTF8) + ".xls"); + Response.ContentType = "application/excel"; + Response.ContentEncoding = System.Text.Encoding.UTF8; + this.Grid1.PageSize = 500; + this.BindGrid(); + Response.Write(GetGridTableHtml(Grid1)); + Response.End(); + } + + /// + /// 导出方法 + /// + /// + /// + private string GetGridTableHtml(Grid grid) + { + StringBuilder sb = new StringBuilder(); + sb.Append(""); + sb.Append(""); + sb.Append(""); + foreach (GridColumn column in grid.Columns) + { + sb.AppendFormat("", column.HeaderText); + } + sb.Append(""); + foreach (GridRow row in grid.Rows) + { + sb.Append(""); + foreach (GridColumn column in grid.Columns) + { + string html = row.Values[column.ColumnIndex].ToString(); + if (column.ColumnID == "tfNumber") + { + html = (row.FindControl("lblNumber") as System.Web.UI.WebControls.Label).Text; + } + sb.AppendFormat("", html); + } + + sb.Append(""); + } + + sb.Append("
{0}
{0}
"); + + return sb.ToString(); + } + #endregion + + + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/CLGL/InPlanMaster.aspx.designer.cs b/SGGL/FineUIPro.Web/CLGL/InPlanMaster.aspx.designer.cs new file mode 100644 index 00000000..5dabba52 --- /dev/null +++ b/SGGL/FineUIPro.Web/CLGL/InPlanMaster.aspx.designer.cs @@ -0,0 +1,269 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.CLGL +{ + + + public partial class InPlanMaster + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// Panel1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel Panel1; + + /// + /// Panel2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel Panel2; + + /// + /// Panel4 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel Panel4; + + /// + /// Grid1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid Grid1; + + /// + /// Toolbar2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar2; + + /// + /// drpWarehouse 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpWarehouse; + + /// + /// drpTypeInt 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpTypeInt; + + /// + /// drpStates 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpStates; + + /// + /// btnSearch 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSearch; + + /// + /// btnPassMaster 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnPassMaster; + + /// + /// btnGenInMaster 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnGenInMaster; + + /// + /// btnRevokeGenInMaster 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnRevokeGenInMaster; + + /// + /// btnImport 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnImport; + + /// + /// btnOut 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnOut; + + /// + /// lblNumber 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label lblNumber; + + /// + /// ToolbarSeparator1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1; + + /// + /// ToolbarText1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarText ToolbarText1; + + /// + /// ddlPageSize 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList ddlPageSize; + + /// + /// panelBottomRegion 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel panelBottomRegion; + + /// + /// Panel3 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel Panel3; + + /// + /// Grid2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid Grid2; + + /// + /// Label1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label Label1; + + /// + /// Window1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window1; + + /// + /// Menu1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Menu Menu1; + + /// + /// btnMenuEdit 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton btnMenuEdit; + + /// + /// btnMenuDelete 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton btnMenuDelete; + } +} diff --git a/SGGL/FineUIPro.Web/CLGL/InPlanMasterDataIn.aspx b/SGGL/FineUIPro.Web/CLGL/InPlanMasterDataIn.aspx new file mode 100644 index 00000000..fff90342 --- /dev/null +++ b/SGGL/FineUIPro.Web/CLGL/InPlanMasterDataIn.aspx @@ -0,0 +1,35 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="InPlanMasterDataIn.aspx.cs" Inherits="FineUIPro.Web.CLGL.InPlanMasterDataIn" %> + + + + + + + 导入 + + +
+ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/CLGL/InPlanMasterDataIn.aspx.cs b/SGGL/FineUIPro.Web/CLGL/InPlanMasterDataIn.aspx.cs new file mode 100644 index 00000000..f96d6564 --- /dev/null +++ b/SGGL/FineUIPro.Web/CLGL/InPlanMasterDataIn.aspx.cs @@ -0,0 +1,146 @@ +using BLL; +using Model; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace FineUIPro.Web.CLGL +{ + public partial class InPlanMasterDataIn : PageBase + { + #region 加载 + + + /// + /// 加载页面 + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + + } + } + + #endregion + + #region 导入 + + /// + /// 导入 + /// + /// + /// + protected void btnImport_Click(object sender, EventArgs e) + { + var message = string.Empty; + errorInfos = string.Empty; + if (fuAttachUrl.HasFile == false) + { + ShowNotify("请选择Excel文件!", MessageBoxIcon.Warning); + return; + } + + var IsXls = Path.GetExtension(fuAttachUrl.FileName).Trim().ToLower(); + if (IsXls != ".xlsx") + { + ShowNotify("只能选择Excel文件!", MessageBoxIcon.Warning); + return; + } + if (!string.IsNullOrEmpty(errorInfos)) errorInfos = string.Empty; + var rootPath = Server.MapPath("~/"); + var initFullPath = rootPath + initPath; + if (!Directory.Exists(initFullPath)) Directory.CreateDirectory(initFullPath); + //指定上传文件名称 + hdFileName.Text = Funs.GetNewFileName() + IsXls; + //上传文件路径 + var filePath = initFullPath + hdFileName.Text; + //文件上传服务器 + fuAttachUrl.PostedFile.SaveAs(filePath); + //文件上传服务器后的名称 + var fileName = rootPath + initPath + hdFileName.Text; + + ResponeData responeData; + responeData = TwInOutplanmasterService.ImportData(fileName, this.CurrUser.LoginProjectId, this.CurrUser.PersonId); + + + if (responeData.code == 1) + { + ShowNotify("数据导入成功!", MessageBoxIcon.Success); + PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference()); + } + else + { + Alert alert = new Alert(); + alert.Message = responeData.message; + alert.MessageBoxIcon = MessageBoxIcon.Error; + alert.Show(); + } + } + + #endregion + + #region 定义项 + + /// + /// 上传预设的虚拟路径 + /// + private readonly string initPath = Const.ExcelUrl; //"File\\Excel\\DataIn\\"; + + /// + /// 错误集合 + /// + public static string errorInfos = string.Empty; + + #endregion + + #region 模板下载 + + /// + /// 模板下载 + /// + /// + /// + protected void btnDownLoad_Click(object sender, EventArgs e) + { + PageContext.RegisterStartupScript(Confirm.GetShowReference("确定要下载模板吗?", string.Empty, + MessageBoxIcon.Question, PageManager1.GetCustomEventReference(false, "Confirm_OK"), + PageManager1.GetCustomEventReference("Confirm_Cancel"))); + } + + /// + /// 下载导入模板 + /// + /// + /// + protected void PageManager1_CustomEvent(object sender, CustomEventArgs e) + { + if (e.EventArgument == "Confirm_OK") + { + var rootPath = Server.MapPath("~/"); + var uploadfilepath = rootPath + Const.Tw_InPlanMasteTemplateUrl; + var filePath = Const.Tw_InPlanMasteTemplateUrl; + var fileName = Path.GetFileName(filePath); + var info = new FileInfo(uploadfilepath); + var fileSize = info.Length; + Response.ClearContent(); + Response.AddHeader("Content-Disposition", + "attachment;filename=" + HttpUtility.UrlEncode(fileName, Encoding.UTF8)); + Response.ContentType = "excel/plain"; + Response.ContentEncoding = Encoding.UTF8; + Response.AddHeader("Content-Length", fileSize.ToString().Trim()); + Response.TransmitFile(uploadfilepath, 0, fileSize); + Response.End(); + } + } + + #endregion + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/CLGL/InPlanMasterDataIn.aspx.designer.cs b/SGGL/FineUIPro.Web/CLGL/InPlanMasterDataIn.aspx.designer.cs new file mode 100644 index 00000000..336a62e3 --- /dev/null +++ b/SGGL/FineUIPro.Web/CLGL/InPlanMasterDataIn.aspx.designer.cs @@ -0,0 +1,98 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.CLGL +{ + + + public partial class InPlanMasterDataIn + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// Panel1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel Panel1; + + /// + /// Toolbar1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar1; + + /// + /// ToolbarFill1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarFill ToolbarFill1; + + /// + /// btnImport 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnImport; + + /// + /// btnDownLoad 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnDownLoad; + + /// + /// fuAttachUrl 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.FileUpload fuAttachUrl; + + /// + /// hdFileName 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.HiddenField hdFileName; + } +} diff --git a/SGGL/FineUIPro.Web/CLGL/InPlanMasterEdit.aspx b/SGGL/FineUIPro.Web/CLGL/InPlanMasterEdit.aspx new file mode 100644 index 00000000..63ff0925 --- /dev/null +++ b/SGGL/FineUIPro.Web/CLGL/InPlanMasterEdit.aspx @@ -0,0 +1,179 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="InPlanMasterEdit.aspx.cs" Inherits="FineUIPro.Web.CLGL.InPlanMasterEdit" %> + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + diff --git a/SGGL/FineUIPro.Web/CLGL/InPlanMasterEdit.aspx.cs b/SGGL/FineUIPro.Web/CLGL/InPlanMasterEdit.aspx.cs new file mode 100644 index 00000000..06b25c7e --- /dev/null +++ b/SGGL/FineUIPro.Web/CLGL/InPlanMasterEdit.aspx.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace FineUIPro.Web.CLGL +{ + public partial class InPlanMasterEdit : System.Web.UI.Page + { + protected void Page_Load(object sender, EventArgs e) + { + + } + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/CLGL/InPlanMasterEdit.aspx.designer.cs b/SGGL/FineUIPro.Web/CLGL/InPlanMasterEdit.aspx.designer.cs new file mode 100644 index 00000000..39eed8c9 --- /dev/null +++ b/SGGL/FineUIPro.Web/CLGL/InPlanMasterEdit.aspx.designer.cs @@ -0,0 +1,323 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.CLGL +{ + + + public partial class InPlanMasterEdit + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// Form2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form Form2; + + /// + /// TbCreate 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar TbCreate; + + /// + /// btnSave 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSave; + + /// + /// btnEditProcess 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnEditProcess; + + /// + /// TbApprove 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar TbApprove; + + /// + /// btnAgree 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnAgree; + + /// + /// btnDisgree 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnDisgree; + + /// + /// Panel4 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel Panel4; + + /// + /// txtProjectName 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtProjectName; + + /// + /// txtContractNum 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtContractNum; + + /// + /// txtSellerName 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtSellerName; + + /// + /// PanelOrderIn 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel PanelOrderIn; + + /// + /// txtOrderInDate 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DatePicker txtOrderInDate; + + /// + /// txtInvoiceDate 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtInvoiceDate; + + /// + /// txtOrderCode 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtOrderCode; + + /// + /// PanelOrderOut 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel PanelOrderOut; + + /// + /// txtOrderOutDate 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DatePicker txtOrderOutDate; + + /// + /// txtMaterialRequisitionUnit 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtMaterialRequisitionUnit; + + /// + /// txtInvoiceNumber 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtInvoiceNumber; + + /// + /// Grid1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid Grid1; + + /// + /// lblPageIndex 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label lblPageIndex; + + /// + /// Label1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label Label1; + + /// + /// Label2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label Label2; + + /// + /// Panel1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel Panel1; + + /// + /// txtSumUnitPrice 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtSumUnitPrice; + + /// + /// txtSumTax 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtSumTax; + + /// + /// txtSumAmount 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtSumAmount; + + /// + /// txtAmountInWords 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtAmountInWords; + + /// + /// Form_approve 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form Form_approve; + + /// + /// txtApproveIdea 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextArea txtApproveIdea; + + /// + /// Grid2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid Grid2; + + /// + /// Label3 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label Label3; + + /// + /// Window1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window1; + } +} diff --git a/SGGL/FineUIPro.Web/CLGL/InputMaster.aspx b/SGGL/FineUIPro.Web/CLGL/InputMaster.aspx new file mode 100644 index 00000000..3e77af5f --- /dev/null +++ b/SGGL/FineUIPro.Web/CLGL/InputMaster.aspx @@ -0,0 +1,174 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="InputMaster.aspx.cs" Inherits="FineUIPro.Web.CLGL.InputMaster" %> + + + + + + + + 入库单主表 + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/CLGL/InputMaster.aspx.cs b/SGGL/FineUIPro.Web/CLGL/InputMaster.aspx.cs new file mode 100644 index 00000000..60229a5c --- /dev/null +++ b/SGGL/FineUIPro.Web/CLGL/InputMaster.aspx.cs @@ -0,0 +1,285 @@ +using BLL; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace FineUIPro.Web.CLGL +{ + public partial class InputMaster : PageBase + { + + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + this.GetButtonPower(); + InitDrpList(); + // 绑定表格 + this.BindGrid(); + } + } + + #region 绑定数据 + private void InitDrpList() + { + this.ddlPageSize.SelectedValue = this.Grid1.PageSize.ToString(); + drpWarehouse.DataTextField = "Text"; + drpWarehouse.DataValueField = "Value"; + drpWarehouse.DataSource = BLL.DropListService.HJGL_WarehouseCode(); + drpWarehouse.DataBind(); + Funs.FineUIPleaseSelect(this.drpWarehouse); + drpTypeInt.DataTextField = "Key"; + drpTypeInt.DataValueField = "Value"; + drpTypeInt.DataSource = BLL.TwConst.TypeIntMap.Where(x => x.Key.Contains("入库")); + drpTypeInt.DataBind(); + Funs.FineUIPleaseSelect(this.drpTypeInt); + + } + /// + /// 绑定数据 + /// + private void BindGrid() + { + Model.Tw_InOutMasterOutput table = new Model.Tw_InOutMasterOutput(); + table.ProjectId = this.CurrUser.LoginProjectId; + if (drpTypeInt.SelectedValue != Const._Null) + { + table.TypeInt = Convert.ToInt32(drpTypeInt.SelectedValue); + } + if (drpWarehouse.SelectedValue != Const._Null) + { + table.WarehouseCode = drpWarehouse.SelectedValue; + } + var tb = BLL.TwInputmasterService.GetListData(table, Grid1); + Grid1.RecordCount = TwInputmasterService.Count; + Grid1.DataSource = tb; + Grid1.DataBind(); + + Grid2.DataSource = null; + Grid2.DataBind(); + } + private void BindDetailGrid(string inputMasterId) + { + Model.Tw_InOutDetailOutput table = new Model.Tw_InOutDetailOutput(); + table.InputMasterId = inputMasterId; + var tb = BLL.TwInputdetailService.GetListData(table, Grid2); + Grid2.DataSource = tb; + Grid2.DataBind(); + } + #endregion + + #region GV 数据操作 + /// + /// 过滤表头 + /// + /// + /// + //protected void Grid1_FilterChange(object sender, EventArgs e) + //{ + // this.BindGrid(); + //} + + /// + /// 分页 + /// + /// + /// + protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e) + { + this.Grid1.PageIndex = e.NewPageIndex; + this.BindGrid(); + } + + /// + /// 排序 + /// + /// + /// + protected void Grid1_Sort(object sender, GridSortEventArgs e) + { + this.Grid1.SortDirection = e.SortDirection; + this.Grid1.SortField = e.SortField; + this.BindGrid(); + } + protected void Grid1_RowClick(object sender, GridRowClickEventArgs e) + { + if (e.RowIndex >= 0) + { + string ID = Grid1.DataKeys[e.RowIndex][0].ToString(); + BindDetailGrid(ID); + } + } + /// + /// 分页显示条数下拉框 + /// + /// + /// + protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e) + { + this.Grid1.PageSize = Convert.ToInt32(this.ddlPageSize.SelectedValue); + this.BindGrid(); + } + #endregion + + #region 数据编辑事件 + protected void btnSearch_Click(object sender, EventArgs e) + { + BindGrid(); + } + + /// + /// 编辑按钮 + /// + /// + /// + protected void btnEdit_Click(object sender, EventArgs e) + { + if (Grid1.SelectedRowIndexArray.Length == 0) + { + Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning); + return; + } + string ID = Grid1.SelectedRowID; + var model = BLL.TwInputmasterService.GetById(ID); + if (model != null) ///已上报时不能删除 + { + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("InPlanMasterEdit.aspx?Id={0}", ID, "编辑 - "))); + } + } + + /// + /// Grid行双击事件 + /// + /// + /// + protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e) + { + this.btnEdit_Click(null, null); + } + + /// + /// 批量删除 + /// + /// + /// + protected void btnDelete_Click(object sender, EventArgs e) + { + if (Grid1.SelectedRowIndexArray.Length > 0) + { + foreach (int rowIndex in Grid1.SelectedRowIndexArray) + { + string rowID = Grid1.DataKeys[rowIndex][0].ToString(); + var model = BLL.TwInputmasterService.GetById(rowID); + if (model != null) + { + BLL.TwInputmasterService.DeleteById(rowID); + } + } + + BindGrid(); + ShowNotify("删除数据成功!", MessageBoxIcon.Success); + } + } + #endregion + + #region 关闭弹出窗 + /// + /// 关闭弹出窗 + /// + /// + /// + protected void Window1_Close(object sender, WindowCloseEventArgs e) + { + BindGrid(); + } + #endregion + + #region 获取权限按钮 + /// + /// 获取按钮权限 + /// + /// + /// + private void GetButtonPower() + { + var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.PersonId, BLL.Const.Tw_InputMasterMenuId); + if (buttonList.Count > 0) + { + if (buttonList.Contains(BLL.Const.BtnAdd)) + { + } + if (buttonList.Contains(BLL.Const.BtnModify)) + { + this.btnMenuEdit.Hidden = false; + } + if (buttonList.Contains(BLL.Const.BtnDelete)) + { + //this.btnMenuDelete.Hidden = false; + } + } + } + #endregion + + #region 导出按钮 + /// 导出按钮 + /// + /// + /// + protected void btnOut_Click(object sender, EventArgs e) + { + Response.ClearContent(); + string filename = Funs.GetNewFileName(); + Response.AddHeader("content-disposition", "attachment; filename=" + System.Web.HttpUtility.UrlEncode("出入库计划主表" + filename, System.Text.Encoding.UTF8) + ".xls"); + Response.ContentType = "application/excel"; + Response.ContentEncoding = System.Text.Encoding.UTF8; + this.Grid1.PageSize = 500; + this.BindGrid(); + Response.Write(GetGridTableHtml(Grid1)); + Response.End(); + } + + /// + /// 导出方法 + /// + /// + /// + private string GetGridTableHtml(Grid grid) + { + StringBuilder sb = new StringBuilder(); + sb.Append(""); + sb.Append(""); + sb.Append(""); + foreach (GridColumn column in grid.Columns) + { + sb.AppendFormat("", column.HeaderText); + } + sb.Append(""); + foreach (GridRow row in grid.Rows) + { + sb.Append(""); + foreach (GridColumn column in grid.Columns) + { + string html = row.Values[column.ColumnIndex].ToString(); + if (column.ColumnID == "tfNumber") + { + html = (row.FindControl("lblNumber") as System.Web.UI.WebControls.Label).Text; + } + sb.AppendFormat("", html); + } + + sb.Append(""); + } + + sb.Append("
{0}
{0}
"); + + return sb.ToString(); + } + #endregion + + + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/CLGL/InputMaster.aspx.designer.cs b/SGGL/FineUIPro.Web/CLGL/InputMaster.aspx.designer.cs new file mode 100644 index 00000000..cfe36810 --- /dev/null +++ b/SGGL/FineUIPro.Web/CLGL/InputMaster.aspx.designer.cs @@ -0,0 +1,224 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.CLGL +{ + + + public partial class InputMaster + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// Panel1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel Panel1; + + /// + /// Panel2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel Panel2; + + /// + /// Panel4 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel Panel4; + + /// + /// Grid1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid Grid1; + + /// + /// Toolbar2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar2; + + /// + /// drpWarehouse 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpWarehouse; + + /// + /// drpTypeInt 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpTypeInt; + + /// + /// btnSearch 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSearch; + + /// + /// btnOut 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnOut; + + /// + /// lblNumber 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label lblNumber; + + /// + /// ToolbarSeparator1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1; + + /// + /// ToolbarText1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarText ToolbarText1; + + /// + /// ddlPageSize 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList ddlPageSize; + + /// + /// panelBottomRegion 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel panelBottomRegion; + + /// + /// Panel3 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel Panel3; + + /// + /// Grid2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid Grid2; + + /// + /// Label1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label Label1; + + /// + /// Window1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window1; + + /// + /// Menu1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Menu Menu1; + + /// + /// btnMenuEdit 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton btnMenuEdit; + + /// + /// btnMenuDelete 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton btnMenuDelete; + } +} diff --git a/SGGL/FineUIPro.Web/CLGL/InputMasterEdit.aspx b/SGGL/FineUIPro.Web/CLGL/InputMasterEdit.aspx new file mode 100644 index 00000000..1840c8db --- /dev/null +++ b/SGGL/FineUIPro.Web/CLGL/InputMasterEdit.aspx @@ -0,0 +1,16 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="InputMasterEdit.aspx.cs" Inherits="FineUIPro.Web.CLGL.InputMasterEdit" %> + + + + + + + + + +
+
+
+
+ + diff --git a/SGGL/FineUIPro.Web/CLGL/InputMasterEdit.aspx.cs b/SGGL/FineUIPro.Web/CLGL/InputMasterEdit.aspx.cs new file mode 100644 index 00000000..bdc64846 --- /dev/null +++ b/SGGL/FineUIPro.Web/CLGL/InputMasterEdit.aspx.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace FineUIPro.Web.CLGL +{ + public partial class InputMasterEdit : System.Web.UI.Page + { + protected void Page_Load(object sender, EventArgs e) + { + + } + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/CLGL/InputMasterEdit.aspx.designer.cs b/SGGL/FineUIPro.Web/CLGL/InputMasterEdit.aspx.designer.cs new file mode 100644 index 00000000..4de47930 --- /dev/null +++ b/SGGL/FineUIPro.Web/CLGL/InputMasterEdit.aspx.designer.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// +// 此代码是由工具生成的。 +// +// 对此文件的更改可能会导致不正确的行为,并且如果 +// 重新生成代码,这些更改将会丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.CLGL +{ + + + public partial class InputMasterEdit + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + } +} diff --git a/SGGL/FineUIPro.Web/CLGL/MaterialStock.aspx b/SGGL/FineUIPro.Web/CLGL/MaterialStock.aspx new file mode 100644 index 00000000..105a2c02 --- /dev/null +++ b/SGGL/FineUIPro.Web/CLGL/MaterialStock.aspx @@ -0,0 +1,122 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="MaterialStock.aspx.cs" Inherits="FineUIPro.Web.CLGL.MaterialStock" %> + + + + + + + + 材料库存表 + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +<%-- + + --%> + + + + + + + + + + + + + + + + + +<%-- + + + --%> + + + + diff --git a/SGGL/FineUIPro.Web/CLGL/MaterialStock.aspx.cs b/SGGL/FineUIPro.Web/CLGL/MaterialStock.aspx.cs new file mode 100644 index 00000000..4f0467ce --- /dev/null +++ b/SGGL/FineUIPro.Web/CLGL/MaterialStock.aspx.cs @@ -0,0 +1,223 @@ +using BLL; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace FineUIPro.Web.CLGL +{ + public partial class MaterialStock : PageBase + { + + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + this.ddlPageSize.SelectedValue = this.Grid1.PageSize.ToString(); + // 绑定表格 + this.BindGrid(); + } + } + + #region 绑定数据 + /// + /// 绑定数据 + /// + private void BindGrid() + { + Model.Tw_MaterialStockOutput table = new Model.Tw_MaterialStockOutput(); + table.ProjectId = this.CurrUser.LoginProjectId; + var tb = BLL.TwMaterialstockService.GetListData(table, Grid1); + Grid1.RecordCount = TwMaterialstockService.Count; + //tb = GetFilteredTable(Grid1.FilteredData, tb); + Grid1.DataSource = tb; + Grid1.DataBind(); + } + #endregion + + #region GV 数据操作 + /// + /// 过滤表头 + /// + /// + /// + //protected void Grid1_FilterChange(object sender, EventArgs e) + //{ + // this.BindGrid(); + //} + + /// + /// 分页 + /// + /// + /// + protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e) + { + this.Grid1.PageIndex = e.NewPageIndex; + this.BindGrid(); + } + + /// + /// 排序 + /// + /// + /// + protected void Grid1_Sort(object sender, GridSortEventArgs e) + { + this.Grid1.SortDirection = e.SortDirection; + this.Grid1.SortField = e.SortField; + this.BindGrid(); + } + + /// + /// 分页显示条数下拉框 + /// + /// + /// + protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e) + { + this.Grid1.PageSize = Convert.ToInt32(this.ddlPageSize.SelectedValue); + this.BindGrid(); + } + #endregion + + #region 数据编辑事件 + /// + /// 新增 + /// + /// + /// + protected void btnNew_Click(object sender, EventArgs e) + { + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("Tw_MaterialStockEdit.aspx?Id={0}", string.Empty, "增加 - "))); + } + + /// + /// 编辑按钮 + /// + /// + /// + protected void btnEdit_Click(object sender, EventArgs e) + { + if (Grid1.SelectedRowIndexArray.Length == 0) + { + Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning); + return; + } + string ID = Grid1.SelectedRowID; + var model = BLL.TwMaterialstockService.GetTw_MaterialStockById(ID); + if (model != null) ///已上报时不能删除 + { + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("Tw_MaterialStockEdit.aspx?Id={0}", ID, "编辑 - "))); + } + } + + /// + /// Grid行双击事件 + /// + /// + /// + protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e) + { + this.btnEdit_Click(null, null); + } + + /// + /// 批量删除 + /// + /// + /// + protected void btnDelete_Click(object sender, EventArgs e) + { + if (Grid1.SelectedRowIndexArray.Length > 0) + { + foreach (int rowIndex in Grid1.SelectedRowIndexArray) + { + string rowID = Grid1.DataKeys[rowIndex][0].ToString(); + var model = BLL.TwMaterialstockService.GetTw_MaterialStockById(rowID); + if (model != null) + { + BLL.TwMaterialstockService.DeleteTw_MaterialStockById(rowID); + } + } + + BindGrid(); + ShowNotify("删除数据成功!", MessageBoxIcon.Success); + } + } + #endregion + + #region 关闭弹出窗 + /// + /// 关闭弹出窗 + /// + /// + /// + protected void Window1_Close(object sender, WindowCloseEventArgs e) + { + BindGrid(); + } + #endregion + + + + #region 导出按钮 + /// 导出按钮 + /// + /// + /// + protected void btnOut_Click(object sender, EventArgs e) + { + Response.ClearContent(); + string filename = Funs.GetNewFileName(); + Response.AddHeader("content-disposition", "attachment; filename=" + System.Web.HttpUtility.UrlEncode("材料库存表" + filename, System.Text.Encoding.UTF8) + ".xls"); + Response.ContentType = "application/excel"; + Response.ContentEncoding = System.Text.Encoding.UTF8; + this.Grid1.PageSize = 500; + this.BindGrid(); + Response.Write(GetGridTableHtml(Grid1)); + Response.End(); + } + + /// + /// 导出方法 + /// + /// + /// + private string GetGridTableHtml(Grid grid) + { + StringBuilder sb = new StringBuilder(); + sb.Append(""); + sb.Append(""); + sb.Append(""); + foreach (GridColumn column in grid.Columns) + { + sb.AppendFormat("", column.HeaderText); + } + sb.Append(""); + foreach (GridRow row in grid.Rows) + { + sb.Append(""); + foreach (GridColumn column in grid.Columns) + { + string html = row.Values[column.ColumnIndex].ToString(); + if (column.ColumnID == "tfNumber") + { + html = (row.FindControl("lblNumber") as System.Web.UI.WebControls.Label).Text; + } + sb.AppendFormat("", html); + } + + sb.Append(""); + } + + sb.Append("
{0}
{0}
"); + + return sb.ToString(); + } + #endregion + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/CLGL/MaterialStock.aspx.designer.cs b/SGGL/FineUIPro.Web/CLGL/MaterialStock.aspx.designer.cs new file mode 100644 index 00000000..5ff38c1d --- /dev/null +++ b/SGGL/FineUIPro.Web/CLGL/MaterialStock.aspx.designer.cs @@ -0,0 +1,116 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.CLGL +{ + + + public partial class MaterialStock + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// Panel1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel Panel1; + + /// + /// Grid1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid Grid1; + + /// + /// Toolbar2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar2; + + /// + /// btnOut 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnOut; + + /// + /// lblNumber 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label lblNumber; + + /// + /// ToolbarSeparator1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1; + + /// + /// ToolbarText1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarText ToolbarText1; + + /// + /// ddlPageSize 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList ddlPageSize; + + /// + /// Window1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window1; + } +} diff --git a/SGGL/FineUIPro.Web/CLGL/OutPlanMaster.aspx b/SGGL/FineUIPro.Web/CLGL/OutPlanMaster.aspx new file mode 100644 index 00000000..c0b2e035 --- /dev/null +++ b/SGGL/FineUIPro.Web/CLGL/OutPlanMaster.aspx @@ -0,0 +1,206 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="OutPlanMaster.aspx.cs" Inherits="FineUIPro.Web.CLGL.OutPlanMaster" %> + + + + + + 申请单 + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <%-- + --%> + + + + + + + diff --git a/SGGL/FineUIPro.Web/CLGL/OutPlanMaster.aspx.cs b/SGGL/FineUIPro.Web/CLGL/OutPlanMaster.aspx.cs new file mode 100644 index 00000000..dc350b6b --- /dev/null +++ b/SGGL/FineUIPro.Web/CLGL/OutPlanMaster.aspx.cs @@ -0,0 +1,523 @@ +using Apache.NMS.ActiveMQ.Threads; +using BLL; +using FineUIPro.Web.HSSE.EduTrain; +using FineUIPro.Web.ProjectData; +using System; +using System.Collections.Generic; +using System.Data; +using System.Data.SqlClient; +using System.Diagnostics; +using System.Linq; +using System.Text; +using System.Text.RegularExpressions; +using System.Threading.Tasks; +using System.Web; + +namespace FineUIPro.Web.CLGL +{ + public partial class OutPlanMaster : PageBase + { + public int pageSize = PipelineService.pageSize; + + protected void Page_Load(object sender, EventArgs e) + { + + if (!IsPostBack) + { + this.GetButtonPower(); + InitDrpList(); + this.InitTreeMenu(); + + } + } + + + private void InitDrpList() + { + drpWarehouse.DataTextField = "Text"; + drpWarehouse.DataValueField = "Value"; + drpWarehouse.DataSource = BLL.DropListService.HJGL_WarehouseCode(); + drpWarehouse.DataBind(); + Funs.FineUIPleaseSelect(this.drpWarehouse); + drpTypeInt.DataTextField = "Key"; + drpTypeInt.DataValueField = "Value"; + drpTypeInt.DataSource = BLL.TwConst.TypeIntMap.Where(x => x.Key.Contains("出库")); ; + drpTypeInt.DataBind(); + Funs.FineUIPleaseSelect(this.drpTypeInt); + drpStates.DataTextField = "Key"; + drpStates.DataValueField = "Value"; + drpStates.DataSource = BLL.TwConst.StateMap; + drpStates.DataBind(); + Funs.FineUIPleaseSelect(this.drpStates); + + } + #region 数据绑定 + /// + /// 管线数据 + /// + private void BindGrid() + { + Model.Tw_InOutMasterOutput table = new Model.Tw_InOutMasterOutput(); + table.ProjectId = this.CurrUser.LoginProjectId; + table.InOutType = (int?)TwConst.InOutType.出库; + if (drpTypeInt.SelectedValue != Const._Null) + { + table.TypeInt = Convert.ToInt32(drpTypeInt.SelectedValue); + } + if (drpStates.SelectedValue != Const._Null) + { + table.State = Convert.ToInt32(drpStates.SelectedValue); + } + if (drpWarehouse.SelectedValue != Const._Null) + { + table.WarehouseCode = drpWarehouse.SelectedValue; + } + if (!string.IsNullOrEmpty(tvControlItem.SelectedNodeID)) + { + table.UnitWorkId = tvControlItem.SelectedNodeID; + } + var tb = BLL.TwInOutplanmasterService.GetListData(table, Grid1); + Grid1.RecordCount = TwInOutplanmasterService.Count; + Grid1.DataSource = tb; + Grid1.DataBind(); + + Grid2.DataSource = null; + Grid2.DataBind(); + } + + private void BindDetailGrid(string inOutPlanMasterId) + { + Model.Tw_InOutDetailOutput table = new Model.Tw_InOutDetailOutput(); + table.InOutPlanMasterId = inOutPlanMasterId; + var tb = BLL.TwInOutplandetailService.GetListData(table, Grid2); + Grid2.DataSource = tb; + Grid2.DataBind(); + } + #endregion + + #region 排序 + + protected void Grid1_Sort(object sender, GridSortEventArgs e) + { + BindGrid(); + } + + #endregion + + #region 加载树装置-单位-工作区 + + /// + /// 加载树 + /// + private void InitTreeMenu() + { + this.tvControlItem.Nodes.Clear(); + + TreeNode rootNode1 = new TreeNode(); + rootNode1.NodeID = "1"; + rootNode1.Text = "建筑工程"; + rootNode1.CommandName = "建筑工程"; + rootNode1.Selectable = false; + this.tvControlItem.Nodes.Add(rootNode1); + + TreeNode rootNode2 = new TreeNode(); + rootNode2.NodeID = "2"; + rootNode2.Text = "安装工程"; + rootNode2.CommandName = "安装工程"; + rootNode2.Expanded = true; + this.tvControlItem.Nodes.Add(rootNode2); + + var pUnits = (from x in Funs.DB.Project_ProjectUnit where x.ProjectId == this.CurrUser.LoginProjectId select x).ToList(); + // 获取当前用户所在单位 + var currUnit = pUnits.FirstOrDefault(x => x.UnitId == this.CurrUser.UnitId); + + var unitWorkList = (from x in Funs.DB.WBS_UnitWork + where x.ProjectId == this.CurrUser.LoginProjectId + && x.SuperUnitWork == null && x.UnitId != null && x.ProjectType != null + select x).ToList(); + + List unitWork1 = null; + List unitWork2 = null; + + //// 当前为施工单位,只能操作本单位的数据 + //if (currUnit != null && currUnit.UnitType == Const.ProjectUnitType_2) + //{ + // unitWork1 = (from x in unitWorkList + // where x.UnitId == this.CurrUser.UnitId && x.ProjectType == "1" + // select x).ToList(); + // unitWork2 = (from x in unitWorkList + // where x.UnitId == this.CurrUser.UnitId && x.ProjectType == "2" + // select x).ToList(); + //} + //else + //{ + unitWork1 = (from x in unitWorkList where x.ProjectType == "1" select x).ToList(); + unitWork2 = (from x in unitWorkList where x.ProjectType == "2" select x).ToList(); + //} + + if (unitWork1.Count() > 0) + { + foreach (var q in unitWork1) + { + int a = (from x in Funs.DB.HJGL_Pipeline where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == q.UnitWorkId select x).Count(); + var unitNamesUnitIds = BLL.UnitService.getUnitNamesUnitIds(q.UnitId); + TreeNode tn1 = new TreeNode(); + tn1.NodeID = q.UnitWorkId; + tn1.Text = q.UnitWorkName + "【" + a.ToString() + "】" + "管线"; + tn1.ToolTip = "施工单位:" + unitNamesUnitIds; + tn1.EnableClickEvent = true; + rootNode1.Nodes.Add(tn1); + } + } + if (unitWork2.Count() > 0) + { + foreach (var q in unitWork2) + { + int a = (from x in Funs.DB.HJGL_Pipeline where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == q.UnitWorkId select x).Count(); + var unitNamesUnitIds = BLL.UnitService.getUnitNamesUnitIds(q.UnitId); + TreeNode tn2 = new TreeNode(); + tn2.NodeID = q.UnitWorkId; + tn2.Text = q.UnitWorkName + "【" + a.ToString() + "】" + "管线"; + tn2.ToolTip = "施工单位:" + unitNamesUnitIds; + tn2.EnableClickEvent = true; + rootNode2.Nodes.Add(tn2); + } + } + } + /// + /// 点击TreeView + /// + /// + /// + protected void tvControlItem_NodeCommand(object sender, TreeCommandEventArgs e) + { + this.BindGrid(); + + } + + /// + /// 树查询 + /// + /// + /// + protected void btnTreeFind_Click(object sender, EventArgs e) + { + this.InitTreeMenu(); + //this.BindGrid3(this.tvControlItem.SelectedNodeID); + } + + #endregion + + #region 维护事件 + protected void Grid1_RowClick(object sender, GridRowClickEventArgs e) + { + if (e.RowIndex >= 0) + { + string ID = Grid1.DataKeys[e.RowIndex][0].ToString(); + BindDetailGrid(ID); + } + } + + protected void btnSearch_Click(object sender, EventArgs e) + { + BindGrid(); + } + /// + /// 增加 + /// + /// + /// + protected void btnNew_Click(object sender, EventArgs e) + { + if (CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.PersonId, Const.HJGL_WeldJointMenuId, Const.BtnAdd)) + { + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("InOutPlanMasterEdit.aspx?}", "新增 - "))); + } + else + { + ShowNotify("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning); + } + } + + protected void btnMenuInOutPlanMasterDelete_Click(object sender, EventArgs e) + { + if (CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.PersonId, Const.HJGL_WeldJointMenuId, Const.BtnDelete)) + { + if (Grid1.SelectedRowIndexArray.Length > 0) + { + foreach (int rowIndex in Grid1.SelectedRowIndexArray) + { + string rowID = Grid1.DataKeys[rowIndex][0].ToString(); + var model = BLL.TwInOutplanmasterService.GetById(rowID); + if (model.State == (int)TwConst.State.已审核 || model.State == (int)TwConst.State.已完成) + { + Alert.ShowInTop("请选择有效的计划!", MessageBoxIcon.Warning); + return; + } + else + { + BLL.TwInOutplanmasterService.DeleteById(rowID); + + ShowNotify("删除数据成功!", MessageBoxIcon.Success); + } + } + BindGrid(); + } + } + else + { + ShowNotify("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning); + } + } + + protected void btnGenInOutMaster_Click(object sender, EventArgs e) + { + + if (Grid1.SelectedRowIndexArray.Length == 0) + { + Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning); + return; + } + string planId = Grid1.SelectedRowID; + var planMaster = BLL.TwInOutplanmasterService.GetById(planId); + if (planMaster.State != (int)TwConst.State.已审核) + { + Alert.ShowInTop("请选择有效的计划!", MessageBoxIcon.Warning); + return; + } + else + { + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("OutPlanMasterEdit.aspx?Id={0}", Grid1.SelectedRowID, "编辑 - "))); + + } + } + + protected void btnRevokeGenInOutMaster_Click(object sender, EventArgs e) + { + if (Grid1.SelectedRowIndexArray.Length == 0) + { + Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning); + return; + } + string planId = Grid1.SelectedRowID; + TwOutputmasterService.RevokeGenOutMasterByPlanId(planId); + + } + + protected void btnMenuInOutPlanMasterEdit_Click(object sender, EventArgs e) + { + + } + #endregion + + #region 报表打印 + /// + /// 报表打印 + /// + /// + /// + protected void btnPrint_Click(object sender, EventArgs e) + { + string pipelineId = this.tvControlItem.SelectedNodeID; + var q = BLL.PipelineService.GetPipelineByPipelineId(pipelineId); + + if (q != null) + { + var jotCount = (from x in Funs.DB.HJGL_WeldJoint where x.PipelineId == pipelineId select x).Count(); + var weldJotCount = (from x in Funs.DB.HJGL_WeldJoint where x.PipelineId == pipelineId && x.WeldingDailyId != null select x).Count(); + if (jotCount == weldJotCount) + { + string varValue = string.Empty; + var project = BLL.ProjectService.GetProjectByProjectId(this.CurrUser.LoginProjectId); + if (project != null) + { + varValue = project.ProjectName; + var unitWork = BLL.UnitWorkService.GetUnitWorkByUnitWorkId(q.UnitWorkId); + if (unitWork != null) + { + varValue = varValue + "|" + unitWork.UnitWorkName; + } + } + List listStr = new List(); + listStr.Add(new SqlParameter("@IsoId", pipelineId)); + listStr.Add(new SqlParameter("@Flag", "0")); + SqlParameter[] parameter = listStr.ToArray(); + DataTable tb = BLL.SQLHelper.GetDataTableRunProc("HJGL_spJointWorkRecordNew", parameter); + string page = Funs.GetPagesCountByPageSize(11, 16, tb.Rows.Count).ToString(); + + + varValue = varValue + "|" + page; + + if (!string.IsNullOrEmpty(varValue)) + { + varValue = HttpUtility.UrlEncodeUnicode(varValue); + } + if (tb.Rows.Count <= 11) + { + PageContext.RegisterStartupScript(Window2.GetShowReference(String.Format("../../ReportPrint/ExReportPrint.aspx?ispop=1&reportId={0}&replaceParameter={1}&varValue={2}&projectId={3}", BLL.Const.HJGL_JointInfoReport1Id, pipelineId, varValue, this.CurrUser.LoginProjectId))); + } + else + { + PageContext.RegisterStartupScript(Window2.GetShowReference(String.Format("../../ReportPrint/ExReportPrint.aspx?ispop=1&reportId={0}&replaceParameter={1}&varValue={2}&projectId={3}", BLL.Const.HJGL_JointInfoReport1Id, pipelineId, varValue, this.CurrUser.LoginProjectId))); + } + } + else + { + ShowNotify("请选择焊接完成管线!", MessageBoxIcon.Warning); + return; + } + } + + else + { + ShowNotify("请选择管线!", MessageBoxIcon.Warning); + return; + } + } + #endregion + + #region 关闭弹出窗口及刷新页面 + /// + /// 关闭弹出窗口 + /// + /// + /// + protected void Window1_Close(object sender, WindowCloseEventArgs e) + { + //this.InitTreeMenu();//加载树 + //this.BindGrid3(this.tvControlItem.SelectedNodeID); + } + + protected void Window2_Close(object sender, WindowCloseEventArgs e) + { + throw new NotImplementedException(); + } + + #endregion + + #region 选项卡改变事件 + /// + /// 选项卡改变事件 + /// + /// + /// + protected void TabStrip1_TabIndexChanged(object sender, EventArgs e) + { + if (this.TabStrip1.ActiveTabIndex == 0) + { + + + } + else if (this.TabStrip1.ActiveTabIndex == 1) + { + + } + } + + + #endregion + + #region 导出 + /// + /// 导出方法 + /// + /// + /// + private string GetGridTableHtml(Grid grid) + { + StringBuilder sb = new StringBuilder(); + sb.Append(""); + sb.Append(""); + sb.Append(""); + foreach (GridColumn column in grid.Columns) + { + if (column.HeaderText != "序号") + { + sb.AppendFormat("", column.HeaderText); + } + } + sb.Append(""); + foreach (GridRow row in grid.Rows) + { + sb.Append(""); + foreach (GridColumn column in grid.Columns) + { + string html = row.Values[column.ColumnIndex].ToString(); + if (column.ColumnID != "tfNumber") + { + //html = (row.FindControl("lblNumber") as AspNet.Label).Text; + sb.AppendFormat("", html); + } + //sb.AppendFormat("", html); + } + + sb.Append(""); + } + + sb.Append("
{0}
{0}{0}
"); + + return sb.ToString(); + } + + #endregion + + #region 获取权限按钮 + /// + /// 获取按钮权限 + /// + /// + /// + private void GetButtonPower() + { + var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.PersonId, BLL.Const.Tw_InPlanMasterMenuId); + if (buttonList.Count > 0) + { + if (buttonList.Contains(BLL.Const.BtnAdd)) + { + // this.btnNew.Hidden = false; + } + if (buttonList.Contains(BLL.Const.BtnModify)) + { + this.btnGenInOutMaster.Hidden = false; + this.btnRevokeGenInOutMaster.Hidden = false; + this.btnPrint.Hidden = false; + // this.btnMenuInOutPlanMasterEdit.Hidden = false; + } + if (buttonList.Contains(BLL.Const.BtnDelete)) + { + this.btnMenuInOutPlanMasterDelete.Hidden = false; + } + if (buttonList.Contains(BLL.Const.BtnAuditing)) + { + this.btnPassMaster.Hidden = false; + } + } + } + #endregion + + + protected void btnPassMaster_OnClick(object sender, EventArgs e) + { + if (Grid1.SelectedRowIndexArray.Length == 0) + { + Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning); + return; + } + string planId = Grid1.SelectedRowID; + var planMaster = BLL.TwInOutplanmasterService.GetById(planId); + if (planMaster.State != (int)TwConst.State.待审核) + { + Alert.ShowInTop("请选择有效的计划!", MessageBoxIcon.Warning); + return; + } + else + { + planMaster.State = (int)TwConst.State.已审核; + TwInOutplanmasterService.Update(planMaster); + BindGrid(); + ShowNotify("审核通过!", MessageBoxIcon.Success); + } + + } + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/CLGL/OutPlanMaster.aspx.designer.cs b/SGGL/FineUIPro.Web/CLGL/OutPlanMaster.aspx.designer.cs new file mode 100644 index 00000000..941753d6 --- /dev/null +++ b/SGGL/FineUIPro.Web/CLGL/OutPlanMaster.aspx.designer.cs @@ -0,0 +1,305 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.CLGL +{ + + + public partial class OutPlanMaster + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// Panel1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel Panel1; + + /// + /// panelLeftRegion 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel panelLeftRegion; + + /// + /// Toolbar1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar1; + + /// + /// tvPipeCode 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox tvPipeCode; + + /// + /// hdUnitWorkId 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.HiddenField hdUnitWorkId; + + /// + /// btnTreeFind 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnTreeFind; + + /// + /// tvControlItem 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Tree tvControlItem; + + /// + /// Panel2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel Panel2; + + /// + /// panelCenterRegion 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel panelCenterRegion; + + /// + /// Toolbar3 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar3; + + /// + /// drpWarehouse 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpWarehouse; + + /// + /// drpTypeInt 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpTypeInt; + + /// + /// drpStates 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpStates; + + /// + /// ToolbarFill1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarFill ToolbarFill1; + + /// + /// btnSearch 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSearch; + + /// + /// btnNew 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnNew; + + /// + /// btnPassMaster 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnPassMaster; + + /// + /// btnGenInOutMaster 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnGenInOutMaster; + + /// + /// btnRevokeGenInOutMaster 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnRevokeGenInOutMaster; + + /// + /// btnPrint 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnPrint; + + /// + /// Grid1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid Grid1; + + /// + /// lblNumber 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label lblNumber; + + /// + /// panelBottomRegion 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel panelBottomRegion; + + /// + /// TabStrip1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TabStrip TabStrip1; + + /// + /// TabDetail 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Tab TabDetail; + + /// + /// Grid2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid Grid2; + + /// + /// Window1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window1; + + /// + /// Window2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window2; + + /// + /// Menu1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Menu Menu1; + + /// + /// btnMenuInOutPlanMasterDelete 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton btnMenuInOutPlanMasterDelete; + } +} diff --git a/SGGL/FineUIPro.Web/CLGL/OutPlanMasterEdit.aspx b/SGGL/FineUIPro.Web/CLGL/OutPlanMasterEdit.aspx new file mode 100644 index 00000000..ee7c24ba --- /dev/null +++ b/SGGL/FineUIPro.Web/CLGL/OutPlanMasterEdit.aspx @@ -0,0 +1,93 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="OutPlanMasterEdit.aspx.cs" Inherits="FineUIPro.Web.CLGL.OutPlanMasterEdit" %> + + + + + + + + + + +
+
+ + + + + + + + <%-- + --%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + diff --git a/SGGL/FineUIPro.Web/CLGL/OutPlanMasterEdit.aspx.cs b/SGGL/FineUIPro.Web/CLGL/OutPlanMasterEdit.aspx.cs new file mode 100644 index 00000000..7c1852fb --- /dev/null +++ b/SGGL/FineUIPro.Web/CLGL/OutPlanMasterEdit.aspx.cs @@ -0,0 +1,107 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using BLL; +using Model; +using Newtonsoft.Json.Linq; + +namespace FineUIPro.Web.CLGL +{ + public partial class OutPlanMasterEdit : PageBase + { + public string Id + { + get + { + return (string)ViewState["Id"]; + } + set + { + ViewState["Id"] = value; + } + } + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + Id = Request.QueryString["Id"]; + if (!string.IsNullOrEmpty(Id)) + { + var model= TwInOutplanmasterService.GetById(Id); + txtCusBillCode.Text = model.CusBillCode; + txtWarehouseCode.Text = model.WarehouseCode; + txtCreateDate.Text =string.Format("{0:yyyy-MM-dd}", model.CreateDate); + txtCreateMan.Text = Person_PersonsService.GetPersonsNameById(model.CreateMan); + txtReqUnitName.Text = UnitService.GetUnitNameByUnitId(model.ReqUnitId); + + + var queryModel = new Model.Tw_InOutDetailOutput() + { + InOutPlanMasterId = Id + + }; + var detailList= TwInOutplandetailService.GetByModle(queryModel).ToList(); + foreach (var item in detailList) + { + item.ActNum=item.PlanNum; + + } + Grid1.DataSource=detailList; + Grid1.DataBind(); + } + + } + } + /// + /// 保存明细项 + /// + private List SaveDetail(string InOutPlanMasterId) + { + + //根据列表中的明细项添加 + List detailLists = new List(); + JArray teamGroupData = Grid1.GetMergedData(); + foreach (JObject teamGroupRow in teamGroupData) + { + JObject values = teamGroupRow.Value("values"); + int rowIndex = teamGroupRow.Value("index"); + Model.Tw_OutputDetail newDetail = new Model.Tw_OutputDetail + { + Id = SQLHelper.GetNewID(), + OutputMasterId = InOutPlanMasterId, + //ProNoticeCId= values.Value("ProNoticeCId"), + MaterialCode = values.Value("MaterialCode"), + PlanNum = values.Value("PlanNum"), + ActNum = values.Value("ActNum"), + }; + + detailLists.Add(newDetail); + } + return detailLists; + } + protected void btnEditProcess_Click(object sender, EventArgs e) + { + throw new NotImplementedException(); + } + + protected void btnSave_Click(object sender, EventArgs e) + { + TwOutputmasterService.GenOutMasterByPlanId(Id, SaveDetail(Id)); + ShowNotify("保存成功!", MessageBoxIcon.Success); + PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference()); + } + + protected void btnAgree_Click(object sender, EventArgs e) + { + throw new NotImplementedException(); + } + + protected void btnDisgree_Click(object sender, EventArgs e) + { + throw new NotImplementedException(); + } + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/CLGL/OutPlanMasterEdit.aspx.designer.cs b/SGGL/FineUIPro.Web/CLGL/OutPlanMasterEdit.aspx.designer.cs new file mode 100644 index 00000000..b3b6a39d --- /dev/null +++ b/SGGL/FineUIPro.Web/CLGL/OutPlanMasterEdit.aspx.designer.cs @@ -0,0 +1,152 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.CLGL +{ + + + public partial class OutPlanMasterEdit + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// Form2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form Form2; + + /// + /// TbCreate 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar TbCreate; + + /// + /// btnSave 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSave; + + /// + /// Panel4 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel Panel4; + + /// + /// txtProjectName 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtProjectName; + + /// + /// txtCusBillCode 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtCusBillCode; + + /// + /// txtWarehouseCode 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtWarehouseCode; + + /// + /// PanelOrderIn 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel PanelOrderIn; + + /// + /// txtCreateMan 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtCreateMan; + + /// + /// txtCreateDate 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtCreateDate; + + /// + /// txtReqUnitName 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtReqUnitName; + + /// + /// Grid1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid Grid1; + + /// + /// tbActNum 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox tbActNum; + + /// + /// Window1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window1; + } +} diff --git a/SGGL/FineUIPro.Web/CLGL/OutputMaster.aspx b/SGGL/FineUIPro.Web/CLGL/OutputMaster.aspx new file mode 100644 index 00000000..831582c6 --- /dev/null +++ b/SGGL/FineUIPro.Web/CLGL/OutputMaster.aspx @@ -0,0 +1,212 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="OutputMaster.aspx.cs" Inherits="FineUIPro.Web.CLGL.OutputMaster" %> + + + + + 申请单 + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/CLGL/OutputMaster.aspx.cs b/SGGL/FineUIPro.Web/CLGL/OutputMaster.aspx.cs new file mode 100644 index 00000000..1645952b --- /dev/null +++ b/SGGL/FineUIPro.Web/CLGL/OutputMaster.aspx.cs @@ -0,0 +1,537 @@ +using BLL; +using System; +using System.Collections.Generic; +using System.Data; +using System.Data.SqlClient; +using System.Linq; +using System.Text; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace FineUIPro.Web.CLGL +{ + public partial class OutputMaster : PageBase + { + public int pageSize = PipelineService.pageSize; + + protected void Page_Load(object sender, EventArgs e) + { + + if (!IsPostBack) + { + this.GetButtonPower(); + InitDrpList(); + this.InitTreeMenu(); + + } + } + + + private void InitDrpList() + { + drpWarehouse.DataTextField = "Text"; + drpWarehouse.DataValueField = "Value"; + drpWarehouse.DataSource = BLL.DropListService.HJGL_WarehouseCode(); + drpWarehouse.DataBind(); + Funs.FineUIPleaseSelect(this.drpWarehouse); + drpTypeInt.DataTextField = "Key"; + drpTypeInt.DataValueField = "Value"; + drpTypeInt.DataSource = BLL.TwConst.TypeIntMap.Where(x => x.Key.Contains("出库")); + drpTypeInt.DataBind(); + Funs.FineUIPleaseSelect(this.drpTypeInt); + drpStates.DataTextField = "Key"; + drpStates.DataValueField = "Value"; + drpStates.DataSource = BLL.TwConst.StateMap; + drpStates.DataBind(); + Funs.FineUIPleaseSelect(this.drpStates); + + } + #region 数据绑定 + /// + /// 管线数据 + /// + private void BindGrid() + { + Model.Tw_InOutMasterOutput table = new Model.Tw_InOutMasterOutput(); + table.ProjectId = this.CurrUser.LoginProjectId; + table.InOutType = (int?)TwConst.InOutType.出库; + if (drpTypeInt.SelectedValue != Const._Null) + { + table.TypeInt = Convert.ToInt32(drpTypeInt.SelectedValue); + } + if (drpStates.SelectedValue != Const._Null) + { + table.State = Convert.ToInt32(drpStates.SelectedValue); + } + if (drpWarehouse.SelectedValue != Const._Null) + { + table.WarehouseCode = drpWarehouse.SelectedValue; + } + + if (!string .IsNullOrEmpty(tvControlItem.SelectedNodeID)) + { + table.UnitWorkId=tvControlItem.SelectedNodeID; + } + var tb = BLL.TwOutputmasterService.GetListData(table, Grid1); + Grid1.RecordCount = TwOutputmasterService.Count; + Grid1.DataSource = tb; + Grid1.DataBind(); + + Grid2.DataSource = null; + Grid2.DataBind(); + } + + private void BindDetailGrid(string outputMasterId) + { + Model.Tw_InOutDetailOutput table = new Model.Tw_InOutDetailOutput(); + table.OutputMasterId = outputMasterId; + var tb = BLL.TwOutputdetailService.GetListData(table, Grid2); + Grid2.DataSource = tb; + Grid2.DataBind(); + for (int i = 0; i < Grid2.Rows.Count; i++) + { + var model = Grid2.Rows[i].DataItem as Model.Tw_InOutDetailOutput; + if (model.ActNum> model.PlanNum) + { + Grid2.Rows[i].RowCssClass = "yellow"; + } + else if (model.ActNum < model.PlanNum) + { + Grid2.Rows[i].RowCssClass = "red"; + } + + } + + } + #endregion + + #region 排序 + + protected void Grid1_Sort(object sender, GridSortEventArgs e) + { + BindGrid(); + } + + #endregion + + #region 加载树装置-单位-工作区 + + /// + /// 加载树 + /// + private void InitTreeMenu() + { + this.tvControlItem.Nodes.Clear(); + + TreeNode rootNode1 = new TreeNode(); + rootNode1.NodeID = "1"; + rootNode1.Text = "建筑工程"; + rootNode1.CommandName = "建筑工程"; + rootNode1.Selectable = false; + this.tvControlItem.Nodes.Add(rootNode1); + + TreeNode rootNode2 = new TreeNode(); + rootNode2.NodeID = "2"; + rootNode2.Text = "安装工程"; + rootNode2.CommandName = "安装工程"; + rootNode2.Expanded = true; + this.tvControlItem.Nodes.Add(rootNode2); + + var pUnits = (from x in Funs.DB.Project_ProjectUnit where x.ProjectId == this.CurrUser.LoginProjectId select x).ToList(); + // 获取当前用户所在单位 + var currUnit = pUnits.FirstOrDefault(x => x.UnitId == this.CurrUser.UnitId); + + var unitWorkList = (from x in Funs.DB.WBS_UnitWork + where x.ProjectId == this.CurrUser.LoginProjectId + && x.SuperUnitWork == null && x.UnitId != null && x.ProjectType != null + select x).ToList(); + + List unitWork1 = null; + List unitWork2 = null; + + //// 当前为施工单位,只能操作本单位的数据 + //if (currUnit != null && currUnit.UnitType == Const.ProjectUnitType_2) + //{ + // unitWork1 = (from x in unitWorkList + // where x.UnitId == this.CurrUser.UnitId && x.ProjectType == "1" + // select x).ToList(); + // unitWork2 = (from x in unitWorkList + // where x.UnitId == this.CurrUser.UnitId && x.ProjectType == "2" + // select x).ToList(); + //} + //else + //{ + unitWork1 = (from x in unitWorkList where x.ProjectType == "1" select x).ToList(); + unitWork2 = (from x in unitWorkList where x.ProjectType == "2" select x).ToList(); + //} + + if (unitWork1.Count() > 0) + { + foreach (var q in unitWork1) + { + int a = (from x in Funs.DB.HJGL_Pipeline where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == q.UnitWorkId select x).Count(); + var unitNamesUnitIds = BLL.UnitService.getUnitNamesUnitIds(q.UnitId); + TreeNode tn1 = new TreeNode(); + tn1.NodeID = q.UnitWorkId; + tn1.Text = q.UnitWorkName + "【" + a.ToString() + "】" + "管线"; + tn1.ToolTip = "施工单位:" + unitNamesUnitIds; + tn1.EnableClickEvent = true; + rootNode1.Nodes.Add(tn1); + } + } + if (unitWork2.Count() > 0) + { + foreach (var q in unitWork2) + { + int a = (from x in Funs.DB.HJGL_Pipeline where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == q.UnitWorkId select x).Count(); + var unitNamesUnitIds = BLL.UnitService.getUnitNamesUnitIds(q.UnitId); + TreeNode tn2 = new TreeNode(); + tn2.NodeID = q.UnitWorkId; + tn2.Text = q.UnitWorkName + "【" + a.ToString() + "】" + "管线"; + tn2.ToolTip = "施工单位:" + unitNamesUnitIds; + tn2.EnableClickEvent = true; + rootNode2.Nodes.Add(tn2); + } + } + } + /// + /// 点击TreeView + /// + /// + /// + protected void tvControlItem_NodeCommand(object sender, TreeCommandEventArgs e) + { + this.BindGrid(); + + } + + /// + /// 树查询 + /// + /// + /// + protected void btnTreeFind_Click(object sender, EventArgs e) + { + this.InitTreeMenu(); + } + + #endregion + + #region 维护事件 + protected void Grid1_RowClick(object sender, GridRowClickEventArgs e) + { + if (e.RowIndex >= 0) + { + string ID = Grid1.DataKeys[e.RowIndex][0].ToString(); + BindDetailGrid(ID); + } + } + + /// + /// Grid双击事件 + /// + /// + /// + protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e) + { + if (BLL.CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.PersonId, BLL.Const.Tw_OutputMasterMenuId, BLL.Const.BtnModify)) + { + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("InOutPlanMasterEdit.aspx?Id={0}", Grid1.SelectedRowID, "编辑 - "))); + } + else + { + ShowNotify("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning); + } + } + + /// + /// 增加 + /// + /// + /// + protected void btnNew_Click(object sender, EventArgs e) + { + if (CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.PersonId, Const.Tw_OutputMasterMenuId, Const.BtnAdd)) + { + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("InOutPlanMasterEdit.aspx?}", "新增 - "))); + } + else + { + ShowNotify("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning); + } + } + + protected void btnMenuInOutPlanMasterDelete_Click(object sender, EventArgs e) + { + if (CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.PersonId, Const.Tw_OutputMasterMenuId, Const.BtnDelete)) + { + if (Grid1.SelectedRowIndexArray.Length == 0) + { + Alert.ShowInTop("请至少选择一条记录", MessageBoxIcon.Warning); + return; + } + + bool isShow = true; + if (Grid1.SelectedRowIndexArray.Length > 1) + { + isShow = false; + } + foreach (int rowIndex in Grid1.SelectedRowIndexArray) + { + string rowID = Grid1.DataKeys[rowIndex][0].ToString(); + ShowNotify("删除成功!", MessageBoxIcon.Success); + + } + + this.InitTreeMenu(); + } + else + { + ShowNotify("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning); + } + } + protected void btnGenInPlanMaster_Click(object sender, EventArgs e) + { + if (CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.PersonId, Const.Tw_OutputMasterMenuId, Const.BtnModify)) + { + if (Grid1.SelectedRowIndexArray.Length == 0) + { + Alert.ShowInTop("请至少选择一条记录", MessageBoxIcon.Warning); + return; + } + + string message= TwInOutplanmasterService.GenPlanMasterByOutputMasterId(Grid1.SelectedRowID, TwConst.TypeInt.退料入库); + if (string .IsNullOrEmpty(message)) + { + ShowNotify("生成通知单成功!", MessageBoxIcon.Success); + } + else + { + ShowNotify(message, MessageBoxIcon.Warning); + } + } + else + { + ShowNotify("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning); + } + } + + protected void btnGenOutPlanMaster_Click(object sender, EventArgs e) + { + if (CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.PersonId, Const.Tw_OutputMasterMenuId, Const.BtnModify)) + { + if (Grid1.SelectedRowIndexArray.Length == 0) + { + Alert.ShowInTop("请至少选择一条记录", MessageBoxIcon.Warning); + return; + } + + string message = TwInOutplanmasterService.GenPlanMasterByOutputMasterId(Grid1.SelectedRowID, TwConst.TypeInt.补料出库); + if (string.IsNullOrEmpty(message)) + { + ShowNotify("生成通知单成功!", MessageBoxIcon.Success); + } + else + { + ShowNotify(message, MessageBoxIcon.Warning); + } + } + else + { + ShowNotify("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning); + } + } + protected void btnSearch_Click(object sender, EventArgs e) + { + BindGrid(); + } + protected void btnMenuInOutPlanMasterEdit_Click(object sender, EventArgs e) + { + + } + #endregion + + #region 报表打印 + /// + /// 报表打印 + /// + /// + /// + protected void btnPrint_Click(object sender, EventArgs e) + { + string pipelineId = this.tvControlItem.SelectedNodeID; + var q = BLL.PipelineService.GetPipelineByPipelineId(pipelineId); + + if (q != null) + { + var jotCount = (from x in Funs.DB.HJGL_WeldJoint where x.PipelineId == pipelineId select x).Count(); + var weldJotCount = (from x in Funs.DB.HJGL_WeldJoint where x.PipelineId == pipelineId && x.WeldingDailyId != null select x).Count(); + if (jotCount == weldJotCount) + { + string varValue = string.Empty; + var project = BLL.ProjectService.GetProjectByProjectId(this.CurrUser.LoginProjectId); + if (project != null) + { + varValue = project.ProjectName; + var unitWork = BLL.UnitWorkService.GetUnitWorkByUnitWorkId(q.UnitWorkId); + if (unitWork != null) + { + varValue = varValue + "|" + unitWork.UnitWorkName; + } + } + List listStr = new List(); + listStr.Add(new SqlParameter("@IsoId", pipelineId)); + listStr.Add(new SqlParameter("@Flag", "0")); + SqlParameter[] parameter = listStr.ToArray(); + DataTable tb = BLL.SQLHelper.GetDataTableRunProc("HJGL_spJointWorkRecordNew", parameter); + string page = Funs.GetPagesCountByPageSize(11, 16, tb.Rows.Count).ToString(); + + + varValue = varValue + "|" + page; + + if (!string.IsNullOrEmpty(varValue)) + { + varValue = HttpUtility.UrlEncodeUnicode(varValue); + } + if (tb.Rows.Count <= 11) + { + PageContext.RegisterStartupScript(Window2.GetShowReference(String.Format("../../ReportPrint/ExReportPrint.aspx?ispop=1&reportId={0}&replaceParameter={1}&varValue={2}&projectId={3}", BLL.Const.HJGL_JointInfoReport1Id, pipelineId, varValue, this.CurrUser.LoginProjectId))); + } + else + { + PageContext.RegisterStartupScript(Window2.GetShowReference(String.Format("../../ReportPrint/ExReportPrint.aspx?ispop=1&reportId={0}&replaceParameter={1}&varValue={2}&projectId={3}", BLL.Const.HJGL_JointInfoReport1Id, pipelineId, varValue, this.CurrUser.LoginProjectId))); + } + } + else + { + ShowNotify("请选择焊接完成管线!", MessageBoxIcon.Warning); + return; + } + } + + else + { + ShowNotify("请选择管线!", MessageBoxIcon.Warning); + return; + } + } + #endregion + + #region 关闭弹出窗口及刷新页面 + /// + /// 关闭弹出窗口 + /// + /// + /// + protected void Window1_Close(object sender, WindowCloseEventArgs e) + { + //this.InitTreeMenu();//加载树 + //this.BindGrid3(this.tvControlItem.SelectedNodeID); + } + + protected void Window2_Close(object sender, WindowCloseEventArgs e) + { + throw new NotImplementedException(); + } + + #endregion + + #region 选项卡改变事件 + /// + /// 选项卡改变事件 + /// + /// + /// + protected void TabStrip1_TabIndexChanged(object sender, EventArgs e) + { + if (this.TabStrip1.ActiveTabIndex == 0) + { + + + } + else if (this.TabStrip1.ActiveTabIndex == 1) + { + + } + } + + + #endregion + + #region 导出 + /// + /// 导出方法 + /// + /// + /// + private string GetGridTableHtml(Grid grid) + { + StringBuilder sb = new StringBuilder(); + sb.Append(""); + sb.Append(""); + sb.Append(""); + foreach (GridColumn column in grid.Columns) + { + if (column.HeaderText != "序号") + { + sb.AppendFormat("", column.HeaderText); + } + } + sb.Append(""); + foreach (GridRow row in grid.Rows) + { + sb.Append(""); + foreach (GridColumn column in grid.Columns) + { + string html = row.Values[column.ColumnIndex].ToString(); + if (column.ColumnID != "tfNumber") + { + //html = (row.FindControl("lblNumber") as AspNet.Label).Text; + sb.AppendFormat("", html); + } + //sb.AppendFormat("", html); + } + + sb.Append(""); + } + + sb.Append("
{0}
{0}{0}
"); + + return sb.ToString(); + } + + #endregion + + #region 获取权限按钮 + /// + /// 获取按钮权限 + /// + /// + /// + private void GetButtonPower() + { + var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.PersonId, BLL.Const.Tw_InPlanMasterMenuId); + if (buttonList.Count > 0) + { + if (buttonList.Contains(BLL.Const.BtnAdd)) + { + } + if (buttonList.Contains(BLL.Const.BtnModify)) + { + this.btnPrint.Hidden = false; + //this.btnMenuInOutPlanMasterEdit.Hidden = false; + this.btnGenInPlanMaster.Hidden = false; + this.btnGenOutPlanMaster.Hidden = false; + } + if (buttonList.Contains(BLL.Const.BtnDelete)) + { + //this.btnMenuInOutPlanMasterDelete.Hidden = false; + } + } + } + #endregion + + + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/CLGL/OutputMaster.aspx.designer.cs b/SGGL/FineUIPro.Web/CLGL/OutputMaster.aspx.designer.cs new file mode 100644 index 00000000..33371802 --- /dev/null +++ b/SGGL/FineUIPro.Web/CLGL/OutputMaster.aspx.designer.cs @@ -0,0 +1,296 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.CLGL +{ + + + public partial class OutputMaster + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// Panel1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel Panel1; + + /// + /// panelLeftRegion 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel panelLeftRegion; + + /// + /// Toolbar1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar1; + + /// + /// tvPipeCode 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox tvPipeCode; + + /// + /// hdUnitWorkId 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.HiddenField hdUnitWorkId; + + /// + /// btnTreeFind 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnTreeFind; + + /// + /// tvControlItem 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Tree tvControlItem; + + /// + /// Panel2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel Panel2; + + /// + /// panelCenterRegion 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel panelCenterRegion; + + /// + /// Toolbar3 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar3; + + /// + /// drpWarehouse 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpWarehouse; + + /// + /// drpTypeInt 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpTypeInt; + + /// + /// drpStates 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpStates; + + /// + /// ToolbarFill1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarFill ToolbarFill1; + + /// + /// btnSearch 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSearch; + + /// + /// btnGenInPlanMaster 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnGenInPlanMaster; + + /// + /// btnGenOutPlanMaster 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnGenOutPlanMaster; + + /// + /// btnPrint 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnPrint; + + /// + /// Grid1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid Grid1; + + /// + /// lblNumber 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label lblNumber; + + /// + /// panelBottomRegion 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel panelBottomRegion; + + /// + /// TabStrip1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TabStrip TabStrip1; + + /// + /// TabDetail 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Tab TabDetail; + + /// + /// Grid2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid Grid2; + + /// + /// Window1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window1; + + /// + /// Window2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window2; + + /// + /// Menu1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Menu Menu1; + + /// + /// btnMenuInOutPlanMasterEdit 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton btnMenuInOutPlanMasterEdit; + + /// + /// btnMenuInOutPlanMasterDelete 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton btnMenuInOutPlanMasterDelete; + } +} diff --git a/SGGL/FineUIPro.Web/CLGL/OutputMasterEdit.aspx b/SGGL/FineUIPro.Web/CLGL/OutputMasterEdit.aspx new file mode 100644 index 00000000..6cedb01d --- /dev/null +++ b/SGGL/FineUIPro.Web/CLGL/OutputMasterEdit.aspx @@ -0,0 +1,21 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="OutputMasterEdit.aspx.cs" Inherits="FineUIPro.Web.CLGL.OutputMasterEdit" %> + + + + + + + + + +
+
+
+
+ +id'); + } + + + + diff --git a/SGGL/FineUIPro.Web/CLGL/OutputMasterEdit.aspx.cs b/SGGL/FineUIPro.Web/CLGL/OutputMasterEdit.aspx.cs new file mode 100644 index 00000000..8cc24785 --- /dev/null +++ b/SGGL/FineUIPro.Web/CLGL/OutputMasterEdit.aspx.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace FineUIPro.Web.CLGL +{ + public partial class OutputMasterEdit : System.Web.UI.Page + { + protected void Page_Load(object sender, EventArgs e) + { + + } + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/CLGL/OutputMasterEdit.aspx.designer.cs b/SGGL/FineUIPro.Web/CLGL/OutputMasterEdit.aspx.designer.cs new file mode 100644 index 00000000..5c0ddb44 --- /dev/null +++ b/SGGL/FineUIPro.Web/CLGL/OutputMasterEdit.aspx.designer.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.CLGL +{ + + + public partial class OutputMasterEdit + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + } +} diff --git a/SGGL/FineUIPro.Web/File/Excel/DataIn/材料入库导入模板.xlsx b/SGGL/FineUIPro.Web/File/Excel/DataIn/材料入库导入模板.xlsx new file mode 100644 index 0000000000000000000000000000000000000000..307d9e25a604f37710394687c914ea6607251f8a GIT binary patch literal 8797 zcmeHsg#MN|$thXWiYO zyYBw}g3q40t`pas`%Xk-1*`{~gtn<8=~t@i>E= zSwH9XX2?7d+fZE?^S*^|a;2553kKwGtg45F2#lp^&gZ;Pte{}pG z=HOo*y(CWMNhc>ZbYI~*wC`+cF$O55>@KO$NTcN!ptyir{VJD^e6f}BK2VG7C6c^< zv)}c={G!OKtv;I5FFYlYAOhhBHSVR*q)X=)Xv_>QZ{(ayR=V&YQzuiWDe_95OpxYi z=Hj}7Y~}vt2Xd2#GUdQgc3m$MI}}uj?wQS}?^|P%p1XM^Hl}WAj31C5v`sT;S94 zSV>Ph)1LPTLLxKV^LV;`2x7N?f{~-1&fb01~O-p(v?ux$sC-pJrX;L#-JET|`tqj-Y_g-rHV;CxD z4(QRz(lFSdWR*r7Yh2INaQejrb-UnXK-a)=8Qeyl209fNk9CF(O1@E$)EGxWCBb<* zJ_<{Z#+wWraKHxXumno&30{Sa{kX@v%(8Mym{XA{InDv#XAy$U-T?J}{iXDBf+p4C z)vDNP2+MjPGLlVeEHks9x|^mGibiAht%iQ$%-e7P9=Z4NVw56gGZHAs=^0(@lb-H? zg0AF#9*J!6rpx2qt*53fJUN$b=-=6MXtl-mu!>*4&Ur?pvkJ^CuOq%S-Pzjv;K{?1hbcI=?5j zCyO-eG2_CG39lX)rA$4V@EkHt4EWqsgQQ$!>B#h!p^d~lqqI?4C{;gzk`t3f&cG?f z%cHHYLB4Q7KM*WP-n0YtZJsxs={PZDApN+%?bzoRHAwsEgDl-E)QK_8df29$lk|ry ztZK~y7gTNTtWYEGTnl%@$vs|?NqhJEmAicRUGcXjj=;^Z=@U2KFJPl^AHOo3tvNk?!JHNX{z41kURC)4ku z^H)m!DL@GDdJs;@|Lv_rLq)lZ6WEM(8_Mba7D9+O>&8L5qrHub-e2`_o`L3(-|;dz zbAyrICuI&KN2uria4+PH7v~ES{z*GaK?Dfd3*T;E7{zh;Xc!6Ibhnf;NFD_rw6nEc zyo-gC>WW`47T3p`K_Kw$oQa+^G&i4C=D2F_tp!{LYwnZ= zRn^u~r#^iC^{!re{uDJc$dhXPh!jIn*p$-Bew0im)KwL z7b{a1@rwFD-KazRnoYfA7>Xe5C(5|1OC^ z<(A>;GK>NMkihTwWBzruvaoP-<@j;n`fVaki=TfzPYs0bvz$->&$z_sZAt`+i#ChA zbx%B04g};7RuM-ewU?XCK#VLFd9OZIARyhHjV2#{S;-=t4SX?CMX!>R46+I-G;e&k zIZ72BkDDMcIv>F@DWw?wd870DO=I`cOsOqEL{e&7Y0hJrFiLPd;2S$PMOB>!d2xNO zZlg(AWm_@zL`0smh*|33n+)`j=1`L@Fs2^qxUJO(MWBs^+1Eg!|F}cx18nCNY!-#jhuz?~f_ZcK+(!lW1j^9Dw>l@@ zV5kLp;?WnOSD<{!^-u@HVoknMeG9?P*{CXZQW_}Ko=6OaOy1qKT%SCXktIS;B`Qe(s@($5u(xYmaYdBjqVyh03 z5hgJ%Fo0UXiHR`-Vhg3Zw;f5P8apt+FOVwh8P{9srWC%B&VPC4xxy-r!8JqO<>&u& zH0OdsN+bw=PN160s=UhT*$t}1RN9fZAZsR}$I`z=`zjacJ{)JOQeMQT{;!?>EL_9ZL%>>_ADf8+wLRe&vh`|}L z-o5VRKYsqlj%Tg`k7CnYY;;kCxpEoVN#kOo!Nw9w(1JU2N4>EJuA!gB*&?X1W3-L0v0A_po#3-C&z6yX7f&V|Xyi`HnMDpEh0Wu1 z1|ZH`C*AO~)$B#jJfJr)f6RXqi?}#Of=;*P9Zj|DeR(cD?I@yJ;0k@DsyF9sJ1sKZ zz8S2dD70U9Cf}(v_@Yi?lR*8=m)DIQ3(e(s7nalG8DY*r6tE{3lv{P>z{qBs#3xy# zhqiWsnjU;+`a#GG&yTivq}M<5XHPY(hfE>Iete;k5HK%XNt*J^lFq2%%61(Iv$pVa zg^5%p{w5hY5vH(csUouRVc7E#(i{rn%an>EJU>>$P+IoSlD#J%GYuA7pUQfN;1LSj z@it~(vg}~K+_W}2Ng3{atLiI$(7D&sil|opikt^+g?iy!6Tp+wrr^rnFq$>Jck&Xk zIPkl2*fF`gRT`|h-PpA#=$alF{YRPTO{TbV)A<;A=|ya2zrs?B^Vdd0qfOq;QNp494h z^F3PJc%8BbjJnc&Hfnr(d)Lyh94^O?N&=r!vpt;QQSEJ+}RXZsbjno>vPYBkDmi*PK}jFQC@k z7#u7==;p95Vz5=`jh;Sx`C83}&I4u`00X@pWa>d3ZY0P<9CnTfd5~GI8O4_Ctq_Jc zZN}YCV)SuQ+D!q}H#i^%)UfaRb{;rs_K|N(OzctY0hro`M!e%A z`YHk#GhxQ?wVKpP02K}1yh27vMfhuSCxny?vw^gB0#}F1`uKK_>UYbC_T}$ylFLB& zDHtv`N1nkXld--KvTi1QJ;8XMPvyo3noR0z3l<%y;?KX4)9%yYGA*X;p&^rRwiu%C zy)4;E7(k4D@+O5o2`xEge>GwRsKbm@J zu@`E}T55E#GQZJ@kd}6+C>MO@2 zipLTWT?hW)njD)iZKXwyQT=woZi$G?kjMZDiGMVv!kL?)g^pG%d>oPJgtz)6?Wp4< zO&F`kr1V4T6a$IzK`8`#a4lKoNYtj3;Vie_!-;MH!ZB0Tc`LQH0n^`WZw*HIAF~*x%l*ie$c8_K_Ei(aV$Dft8a=eyN^@U;;k9|rAhQYWVV_<) zrLbl}>I}DNg+h@k!~4Dy-x?)Y#5#}5i;N(Z$uR1^3`S2AOrWFC#qrm?$D>V_Q#Z9m zjZVc@&(}B5D~A*3z(6|s+=KSG%9f3L;)0FIr;PB^`+@7l_K7$)nnlLL;|0=53ka@c zILdG;_U8mAf$xQ1$J0OpoeSvt`u@ZW`BIP*X&G&4PvM+M62eCj?B4_p!#AL>8|J$t z8d-X<5f*V)JlGj$&N5zbWENSh@r<*sKbF>BE3qb?#O3d|Eg4Y!_$*Pmc8>2rV|&iF z^rckw2qf^u&woTk&4Yu+yJ6Od=w~l&@7H=;%JJ?Gju*bST z>d7EvCWWu0hvAZb?|0F1b@Q~daQ&@(d-ro4jlM_dYgb=G^Dt}`9X$pSB@S_M0%U=| zBA>OPr8;iJFRG}!h_-mlBkL7~LqDq%Q>7UHN(Cp>acO8ZDyI|dg(OHp|l65E&m zUb&D*-zf`xB^{SNN3{u<@*;m%z7+XDFJC(k(-lxx#*F!9{K}1SuZw<`5+f!vbS<=u zc%i@f)2IwtL+Vp57An;oDMiif$EA7Uhk&p-&|{9gOD0WkWK8#`idsgwEFJA%%=p8( zyA$P5-@P2*B~nDT7j=LyYi|xGy$EGETdYe1d3j9T9fBk`OUJ8uz}#1y_}<@1zGY=s z&^82FPF0X&XA)VO%rh7cWgUrDExiH4RF8 z_VM=f7|6xZy@?kXo`KjBMzZ~Diwpt{G(pZ_5~j%KgNZl%MZwD<+^9<)ps!J^iF6Ch zHO=E})ag+!eh%K((#~j&>@kLsTFH|lJ)CSMpXTZ5CfE#`AZCYGR%{U5Pej{yChA5z z2X_!*fFExB+@jn&){7oUsPEbCURY%wK@~4O-mJs8k~QRBS&bvNzo!hVrsH&L)*>l8NNh4s?BocMg%d8 z?@{z!UCV`|4*hQ4e6wTAQb?Z`hU7g)!dtz$91^4QH#ZxbOVb{kJBa?2+I>FRzcXy^ z7l%4B^Y&HxN&s|(E^Rp7$wTDr=wvvtM{lNg-$-Y>tYykOX?fmszL`omIAb9mLg=qs$`e#K0ImZ!PYaYlwz(@-evo>l}mBB z@1Yn2DGN5$+69g%vCpoe=@v>sd$+=A*Z=B9t;t^~Uc7)d20Nw|d`kB%1i;xqjS9S#nN2i*1C)cM3irV%nsv*@o%JoTfXcOe2)D>gY z?_sz(lJ4U(?Z%%X(sW81uckk&%X$lMi+$TQ&!)50CR7hGf`B7UB*gl21<)yV$8kHU zKktiESI5~7;cgxI&b6rU)38$Qzc~uEnh-T|>`H0&S$=#gALH!N{I6y5d1gj~0{l%G z!N0|W+YRQ9W@;{uPOcngjxH8|be;Zl8Q^K;6Q{1+$w?5hjB+R4@BP+%v4?05N9%M= z!YSvRD6WxhCZ8r8a&?x!tHXj%#U&*GGxx(}SevhXBt=1i z7Aa-o+)?7fg-YGAYG9M_y)s*RSi^=W(43$HCUz<7sj^R1W2^NTJ-yqUGJf_AJBd++ z+vO6@?bI@K8*9q*y0xpHhhZ>zf=!<@u7Z>lk0XG#Q|*rZr-hpGPmkgzUsWDBc1=3X?cw=KJzmrA<0qhC~s9=-ULpz@Hl9~PPVqz z@CQN6y3E@Y1a@fQ>4U2e%EQDYWRM;{z)Hf@c>pC{SDYRz;Gvm~)wq~pddK5X_klTg zWn%jZ_5Sxs5%E=+tP_0#qlsf5YOj9eJ}+DI-uc9^4Kcc2L?p0e9Mf9qVrpX}{sZS# z)6_E*s>q;?H(C3+?dd}(RPRj-6GH?^2bE@#gT#rucnch?u`EpEa=P`g$b5(5E>vxW zEoMuV##RVQw8xo3gQu$RDN@bHa1QwU`-xuP9Nw)vwkuNE_zE~s^nS}tJH1D6pAUkH zgoY6s%<__GqShvxwgo|i0_hAJX)mC%1i{I}b!hs@V~*y7j4KAF+6N|7zFd3krJV!D z%)#&NDT%r(bnujf+Wh9Pg6i^R<>pg{Y`^lUiJdeNHOwz#QyHp`GF*hFjR+NC++HVs zeE=Vs-(3d;L^in4{Cgw+&++^7_%CgJHRZnt_g6JO6|N02r7*!2cf;`qwzWdXYaPiD3V~Kk*M|^4BQ8nm0eAsKXmf@JIR8 z%K0_GuZ8r_0H{Pi0{kqie}(>9Km3F$k^T<-wVL=f!rwLZCmxQ5n^FHz*k9p)pA-KI eKfC`I_#ZQ*nlcJ}bO8WN_$L4^;=NSAUHu + + + + + + + + + + + @@ -7995,6 +8006,83 @@ WorkStage.aspx + + ArrivalStatistics.aspx + ASPXCodeBehind + + + ArrivalStatistics.aspx + + + OutPlanMaster.aspx + ASPXCodeBehind + + + OutPlanMaster.aspx + + + OutPlanMasterEdit.aspx + ASPXCodeBehind + + + OutPlanMasterEdit.aspx + + + InPlanMaster.aspx + ASPXCodeBehind + + + InPlanMaster.aspx + + + InPlanMasterDataIn.aspx + ASPXCodeBehind + + + InPlanMasterDataIn.aspx + + + InPlanMasterEdit.aspx + ASPXCodeBehind + + + InPlanMasterEdit.aspx + + + InputMaster.aspx + ASPXCodeBehind + + + InputMaster.aspx + + + InputMasterEdit.aspx + ASPXCodeBehind + + + InputMasterEdit.aspx + + + MaterialStock.aspx + ASPXCodeBehind + + + MaterialStock.aspx + + + OutputMaster.aspx + ASPXCodeBehind + + + OutputMaster.aspx + + + OutputMasterEdit.aspx + ASPXCodeBehind + + + OutputMasterEdit.aspx + main2.aspx ASPXCodeBehind diff --git a/SGGL/FineUIPro.Web/HJGL/WeldingManage/SelectTaskWeldJoint.aspx b/SGGL/FineUIPro.Web/HJGL/WeldingManage/SelectTaskWeldJoint.aspx index f36eef1e..2dd18a8b 100644 --- a/SGGL/FineUIPro.Web/HJGL/WeldingManage/SelectTaskWeldJoint.aspx +++ b/SGGL/FineUIPro.Web/HJGL/WeldingManage/SelectTaskWeldJoint.aspx @@ -93,7 +93,7 @@ - + diff --git a/SGGL/FineUIPro.Web/HJGL/WeldingManage/SelectTaskWeldJoint.aspx.cs b/SGGL/FineUIPro.Web/HJGL/WeldingManage/SelectTaskWeldJoint.aspx.cs index 89b58748..e19c6f55 100644 --- a/SGGL/FineUIPro.Web/HJGL/WeldingManage/SelectTaskWeldJoint.aspx.cs +++ b/SGGL/FineUIPro.Web/HJGL/WeldingManage/SelectTaskWeldJoint.aspx.cs @@ -105,7 +105,6 @@ namespace FineUIPro.Web.HJGL.WeldingManage Tree_hJGL_Pipelines = new List(); this.txtTaskDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now.AddDays(1)); - this.txtTaskCode.Text = BLL.WeldTaskService.GetTaskCodeByDate(this.CurrUser.LoginProjectId, this.txtTaskDate.Text); BLL.Base_WeldingLocationServie.InitWeldingLocationDropDownList(drpWeldingLocation, true); ///焊接属性 this.drpJointAttribute.DataTextField = "Text"; @@ -123,6 +122,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage string strList = Request.Params["strList"]; List list = Funs.GetStrListByStr(strList, '|'); + if (list.Count() == 3) { this.UnitWorkId = list[0]; @@ -134,6 +134,8 @@ namespace FineUIPro.Web.HJGL.WeldingManage Model.WBS_UnitWork UnitWork = BLL.UnitWorkService.getUnitWorkByUnitWorkId(this.UnitWorkId); BLL.UnitService.InitUnitDropDownListByUnitIds(this.drpUnit, UnitWork.UnitId, false);//单位 this.drpUnit.SelectedValue = unitId; + this.txtTaskCode.Text = BLL.WeldTaskService.GetTaskCodeByDate(this.CurrUser.LoginProjectId, this.txtTaskDate.Text, list[0], drpUnit.SelectedValue); + if (!string.IsNullOrEmpty(TaskDate)) { txtTaskDate.Text = TaskDate; @@ -166,6 +168,8 @@ namespace FineUIPro.Web.HJGL.WeldingManage Model.WBS_UnitWork UnitWork = BLL.UnitWorkService.getUnitWorkByUnitWorkId(this.UnitWorkId); BLL.UnitService.InitUnitDropDownListByUnitIds(this.drpUnit, UnitWork.UnitId, false);//单位 + this.txtTaskCode.Text = BLL.WeldTaskService.GetTaskCodeByDate(this.CurrUser.LoginProjectId, this.txtTaskDate.Text, list[0], drpUnit.SelectedValue); + if (!string.IsNullOrEmpty(TaskDate)) { txtTaskDate.Text = TaskDate; @@ -661,9 +665,13 @@ namespace FineUIPro.Web.HJGL.WeldingManage protected void txtTaskDate_TextChanged(object sender, EventArgs e) { - this.txtTaskCode.Text = BLL.WeldTaskService.GetTaskCodeByDate(this.CurrUser.LoginProjectId, this.txtTaskDate.Text); + this.txtTaskCode.Text = BLL.WeldTaskService.GetTaskCodeByDate(this.CurrUser.LoginProjectId, this.txtTaskDate.Text, UnitWorkId, drpUnit.SelectedValue); } + protected void drpUnit_SelectedIndexChanged(object sender, EventArgs e) + { + this.txtTaskCode.Text = BLL.WeldTaskService.GetTaskCodeByDate(this.CurrUser.LoginProjectId, this.txtTaskDate.Text, UnitWorkId, drpUnit.SelectedValue); + } protected void drpJointAttribute_SelectedIndexChanged(object sender, EventArgs e) { BindGrid(); @@ -720,5 +728,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage } } } + + } } \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldMatMatch.aspx b/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldMatMatch.aspx index 9b248fb7..a3fd5ef3 100644 --- a/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldMatMatch.aspx +++ b/SGGL/FineUIPro.Web/HJGL/WeldingManage/WeldMatMatch.aspx @@ -1,4 +1,5 @@ <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WeldMatMatch.aspx.cs" Inherits="FineUIPro.Web.HJGL.WeldingManage.WeldMatMatch" %> + <%@ Register Src="~/Controls/_3DLook.ascx" TagName="_3DLook" TagPrefix="uc1" %> @@ -35,21 +36,21 @@ - + - + - - + - + @@ -62,31 +63,127 @@ + + + + + + - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - @@ -101,9 +198,9 @@ FieldType="String" HeaderText="所需量" HeaderTextAlign="Center" TextAlign="Left"> - + + TextAlign="Center"> @@ -124,28 +221,27 @@ FieldType="String" HeaderText="类型" HeaderTextAlign="Center" TextAlign="Left"> - + - + -