SystemModuleLogicPartial.cs 54 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382
  1. /*******************************************************************************
  2. * Copyright(c) 2014 DongkeSoft All rights reserved. / Confidential
  3. * 类的信息:
  4. * 1.程序名称:SystemModuleLogic.cs
  5. * 2.功能描述:产品档案数据查询处理
  6. * 编辑履历:
  7. * 作者 日期 版本 修改内容
  8. * 张国印 2014/09/12 1.00 新建
  9. *******************************************************************************/
  10. using Dongke.IBOSS.PRD.Basics.DataAccess;
  11. using Dongke.IBOSS.PRD.Service.DataModels;
  12. using Dongke.IBOSS.PRD.WCF.DataModels;
  13. using Oracle.ManagedDataAccess.Client;
  14. using System;
  15. using System.Collections.Generic;
  16. using System.Data;
  17. using System.Text;
  18. namespace Dongke.IBOSS.PRD.Service.SystemModuleLogic
  19. {
  20. /// <summary>
  21. /// 产品档案数据查询处理
  22. /// </summary>
  23. public partial class SystemModuleLogic
  24. {
  25. #region 产品档案
  26. /// <summary>
  27. /// 查询产品信息
  28. /// </summary>
  29. /// <param name="sUserInfo">用户基本信息</param>
  30. /// <param name="goodsEntity">产品信息</param>
  31. /// <returns>DataSet</returns>
  32. /// <remarks>
  33. /// 陈冰 2014.09.01 新建
  34. /// </remarks>
  35. public static DataSet SerachGoods(SUserInfo sUserInfo, GoodsEntity goodsEntity)
  36. {
  37. IDBConnection con = ClsDbFactory.CreateDBConnection(DataBaseType.ORACLE, DataManager.ConnectionString);
  38. try
  39. {
  40. con.Open();
  41. if (!string.IsNullOrWhiteSpace(goodsEntity.GoodsCodeOnly))
  42. {
  43. string sql = "select goodsid from tp_mst_goods g where g.goodscode = :goodscode";
  44. OracleParameter[] paras1 = new OracleParameter[]{
  45. new OracleParameter(":goodscode",OracleDbType.Varchar2,
  46. goodsEntity.GoodsCodeOnly,ParameterDirection.Input),
  47. };
  48. return con.GetSqlResultToDs(sql, paras1);
  49. }
  50. OracleParameter[] paras = new OracleParameter[]{
  51. new OracleParameter("account",OracleDbType.Int32,
  52. sUserInfo.AccountID,ParameterDirection.Input),
  53. new OracleParameter("goodsID",OracleDbType.Int32,
  54. goodsEntity.GoodsID,ParameterDirection.Input),
  55. new OracleParameter("goodsCode",OracleDbType.NVarchar2,
  56. goodsEntity.GoodsCode,ParameterDirection.Input),
  57. new OracleParameter("goodsName",OracleDbType.NVarchar2,
  58. goodsEntity.GoodsName,ParameterDirection.Input),
  59. new OracleParameter("goodsSpecification",OracleDbType.NVarchar2,
  60. goodsEntity.GoodsSpecification,ParameterDirection.Input),
  61. new OracleParameter("goodsModel",OracleDbType.NVarchar2,
  62. goodsEntity.GoodsModel,ParameterDirection.Input),
  63. new OracleParameter("goodsTypeCode",OracleDbType.NVarchar2,
  64. goodsEntity.GoodsTypeCode,ParameterDirection.Input),
  65. new OracleParameter("glazeTypeID",OracleDbType.Int32,
  66. goodsEntity.GlazeTypeID,ParameterDirection.Input),
  67. new OracleParameter("ceaseFlag",OracleDbType.NVarchar2,
  68. goodsEntity.CeaseFlag,ParameterDirection.Input),
  69. new OracleParameter("remarks",OracleDbType.NVarchar2,
  70. goodsEntity.Remarks,ParameterDirection.Input),
  71. new OracleParameter("valueFlag",OracleDbType.NVarchar2,
  72. goodsEntity.ValueFlag,ParameterDirection.Input),
  73. new OracleParameter("planFlag",OracleDbType.NVarchar2,
  74. goodsEntity.PlanFlag,ParameterDirection.Input),
  75. new OracleParameter("rs_result",OracleDbType.RefCursor,ParameterDirection.Output),
  76. new OracleParameter("rs_result_img",OracleDbType.RefCursor,ParameterDirection.Output),
  77. };
  78. foreach (OracleParameter item in paras)
  79. {
  80. if (item.Value + "" == "")
  81. {
  82. item.Value = DBNull.Value;
  83. }
  84. }
  85. DataSet ds = con.ExecStoredProcedure("PRO_MST_SerachGoods", paras);
  86. return ds;
  87. }
  88. catch (Exception ex)
  89. {
  90. throw ex;
  91. }
  92. finally
  93. {
  94. if (con.ConnState == ConnectionState.Open)
  95. {
  96. con.Close();
  97. }
  98. }
  99. }
  100. /// <summary>
  101. /// 新建产品档案
  102. /// </summary>
  103. /// <param name="sUserInfo">用户基本信息</param>
  104. /// <param name="goodsEntity">产品实体</param>
  105. /// <param name="imgList">产品图片集合</param>
  106. /// <param name="attList">缺陷位置ID集合</param>
  107. /// <returns>int受影响行数</returns>
  108. /// <remarks>
  109. /// 庄天威 2014.09.04 新建
  110. /// </remarks>
  111. public static int AddGoods(SUserInfo sUserInfo, GoodsEntity goodsEntity
  112. , List<GoodsImageEntity> imgList, List<GoodsAttachmentEntity> attList)
  113. {
  114. int returnRows;
  115. IDBTransaction oracleTrConn = ClsDbFactory.CreateDBTransaction(DataBaseType.ORACLE, DataManager.ConnectionString);
  116. if (goodsEntity.MudQuantity == null)
  117. {
  118. goodsEntity.MudQuantity = 0;
  119. }
  120. if (goodsEntity.GlazeQuantity == null)
  121. {
  122. goodsEntity.GlazeQuantity = 0;
  123. }
  124. if (goodsEntity.Remarks == null)
  125. {
  126. goodsEntity.Remarks = "";
  127. }
  128. if (goodsEntity.GoodsSpecification == null)
  129. {
  130. goodsEntity.GoodsSpecification = "";
  131. }
  132. if (goodsEntity.GoodsModel == null)
  133. {
  134. goodsEntity.GoodsModel = "";
  135. }
  136. try
  137. {
  138. oracleTrConn.Connect();
  139. // 物料编码重复验证 add by chenxy 2017-07-11 begin
  140. // 有不同编码,同物料编码的情况 delete by chenxy 2017-11-10
  141. //string sqlString = "SELECT g.goodscode \n" +
  142. //" FROM tp_mst_goods g\n" +
  143. //" WHERE g.materialcode = :materialcode";
  144. //OracleParameter[] checkParas = new OracleParameter[]{
  145. // new OracleParameter(":materialcode",goodsEntity.MaterialCode),
  146. //};
  147. //string goodscode = oracleTrConn.GetSqlResultToStr(sqlString, checkParas);
  148. //if (!string.IsNullOrWhiteSpace(goodscode))
  149. //{
  150. // return -10;
  151. //}
  152. // 物料编码重复验证 add by chenxy 2017-07-11 end
  153. //2021年11月18日09:28:072 by fy modify 产品档案增加防伪码绑定标识、防伪码验证标识
  154. StringBuilder sbSql = new StringBuilder();
  155. sbSql.Append("select SEQ_MST_Goods_GoodsID.nextval from dual");
  156. int id = Convert.ToInt32(oracleTrConn.GetSqlResultToStr(sbSql.ToString()));
  157. sbSql.Clear();
  158. sbSql.Append(" INSERT INTO TP_MST_GOODS");
  159. sbSql.Append("(GoodsID,GoodsCode,GoodsName,GoodsSpecification,GoodsModel,GoodsTypeID,");
  160. sbSql.Append("GlazeTypeID,MudWeight,GlazeWeight,LusterwareWeight,ProductionCycle,CeaseFlag,Goods_Line_Type,Goods_Line_Code,");
  161. sbSql.Append("StartingDate,AutoLossCycle,DeliverLimitCycle,PlateLimitNum,UnitPrice,ReservedDays,");
  162. sbSql.Append("PackageNum,OutletDistance,MaterialCode,MaterialRemark,printcopies,");
  163. sbSql.Append("MouldWeight,MouldCost,ScrapSumFlag,SEATCOVERCODE,");
  164. sbSql.Append("WaterLabelCode,CertificateCode,StandardGroutingNum,MouldMaterialCode,MouldOutputCount,logoid,");
  165. sbSql.Append("Remarks,AccountID,ValueFlag,CreateUserID,UpdateUserID,MudStoreType,SecurityCodeBindFlag,SecurityCodeCheckFlag,PlanFlag)");
  166. sbSql.Append("VALUES( :GoodsId, :GoodsCode, :GoodsName, :GoodsSpecification, :GoodsModel, :GoodsTypeID,");
  167. sbSql.Append(" :GlazeTypeID, :MudWeight, :GlazeWeight,:LusterwareWeight, :ProductionCycle, :CeaseFlag,:Goods_Line_Type,:Goods_Line_Code,");
  168. sbSql.Append(" :StartingDate, :AutoLossCycle, :DeliverLimitCycle,:PlateLimitNum,:UnitPrice,:ReservedDays,");
  169. sbSql.Append(" :PackageNum, :OutletDistance, :MaterialCode,:MaterialRemark,:printcopies,");
  170. sbSql.Append(" :MouldWeight, :MouldCost,:ScrapSumFlag,:SEATCOVERCODE,");
  171. sbSql.Append(" :WaterLabelCode, :CertificateCode, :StandardGroutingNum, :MouldMaterialCode, :MouldOutputCount,:logoid,");
  172. sbSql.Append(" :Remarks, :AccountID, :ValueFlag, :CreateUserID, :UpdateUserID, :MudStoreType , :SecurityCodeBindFlag,:SecurityCodeCheckFlag,:PlanFlag)");
  173. OracleParameter[] paras = new OracleParameter[]{
  174. new OracleParameter(":GoodsId",id),
  175. new OracleParameter(":GoodsCode",goodsEntity.GoodsCode),
  176. new OracleParameter(":GoodsName",goodsEntity.GoodsName),
  177. new OracleParameter(":GoodsSpecification",goodsEntity.GoodsSpecification),
  178. new OracleParameter(":GoodsModel",goodsEntity.GoodsModel),
  179. new OracleParameter(":GoodsTypeID",goodsEntity.GoodsTypeID),
  180. new OracleParameter(":GlazeTypeID",goodsEntity.GlazeTypeID),
  181. new OracleParameter(":MudWeight",goodsEntity.MudQuantity),
  182. new OracleParameter(":GlazeWeight",goodsEntity.GlazeQuantity),
  183. new OracleParameter(":LusterwareWeight",goodsEntity.LusterwareWeight),
  184. new OracleParameter(":ProductionCycle",goodsEntity.ProductionCycle),
  185. new OracleParameter(":CeaseFlag",goodsEntity.CeaseFlag),
  186. new OracleParameter(":Goods_Line_Type",goodsEntity.GoodsLineType),
  187. new OracleParameter(":Goods_Line_Code",goodsEntity.GoodsLineCode),
  188. new OracleParameter(":StartingDate",goodsEntity.StartingDate),
  189. new OracleParameter(":AutoLossCycle",goodsEntity.AutoLossCycle),
  190. new OracleParameter(":DeliverLimitCycle",goodsEntity.DeliverLimitCycle),
  191. new OracleParameter(":PlateLimitNum",goodsEntity.PlateLimitNum),
  192. new OracleParameter(":ReservedDays",goodsEntity.ReservedDays),
  193. new OracleParameter(":UnitPrice",goodsEntity.UnitPrice),
  194. new OracleParameter(":PackageNum",goodsEntity.PackageNum),
  195. new OracleParameter(":OutletDistance",goodsEntity.OutletDistance),
  196. new OracleParameter(":MaterialCode",goodsEntity.MaterialCode),
  197. new OracleParameter(":MouldWeight",goodsEntity.MouldWeight),
  198. new OracleParameter(":MouldCost",goodsEntity.MouldCost),
  199. new OracleParameter(":ScrapSumFlag",goodsEntity.ScrapSumFlag),
  200. new OracleParameter(":MaterialRemark",goodsEntity.MaterialRemark),
  201. new OracleParameter(":printcopies",goodsEntity.PrintCopies),
  202. new OracleParameter(":SEATCOVERCODE", goodsEntity.SeatCoverCode),
  203. new OracleParameter(":WaterLabelCode", goodsEntity.WaterLabelCode),
  204. new OracleParameter(":CertificateCode", goodsEntity.CertificateCode),
  205. new OracleParameter(":StandardGroutingNum", goodsEntity.StandardGroutingNum),
  206. new OracleParameter(":MouldMaterialCode", goodsEntity.MouldMaterialCode),
  207. new OracleParameter(":MouldOutputCount", goodsEntity.MouldOutputCount),
  208. new OracleParameter(":logoid", goodsEntity.LogoID),
  209. new OracleParameter(":Remarks",goodsEntity.Remarks),
  210. new OracleParameter(":AccountID",sUserInfo.AccountID),
  211. new OracleParameter(":ValueFlag",goodsEntity.ValueFlag),
  212. //new OracleParameter(":CreateTime",OracleDbType.Date,DateTime.Now,ParameterDirection.Input),
  213. new OracleParameter(":CreateUserID",sUserInfo.UserID),
  214. //new OracleParameter(":UpdateTime",OracleDbType.Date,DateTime.Now,ParameterDirection.Input),
  215. new OracleParameter(":UpdateUserID",sUserInfo.UserID),
  216. new OracleParameter(":MudStoreType",goodsEntity.MudStoreType),
  217. new OracleParameter(":SecurityCodeBindFlag",goodsEntity.SecurityCodeBindFlag),
  218. new OracleParameter(":SecurityCodeCheckFlag",goodsEntity.SecurityCodeCheckFlag),
  219. new OracleParameter(":PlanFlag",goodsEntity.PlanFlag)
  220. //new OracleParameter(":OPTimeStamp",OracleDbType.TimeStamp,DateTime.Now,ParameterDirection.Input)
  221. };
  222. returnRows = oracleTrConn.ExecuteNonQuery(sbSql.ToString(), paras);
  223. //张忠帅 产品属性表添加功能 add 2022-12-28
  224. #region 产品属性表添加
  225. string sq2;
  226. sq2 = @"INSERT INTO TP_MST_PRODUCTATTRIBUTES(GOODSID,GOODSCODE,PRODUCEDAYS,ATTENDANCE,DAYGROUTINGNUMBER,PROTECTDAMRATE,YEARS)
  227. VALUES (:GOODSID,:GOODSCODE,:PRODUCEDAYS,:ATTENDANCE,:DAYGROUTINGNUMBER,:PROTECTDAMRATE,TO_DATE(:YEARS,'YYYY--MM'))";
  228. paras = new OracleParameter[]{
  229. new OracleParameter(":GOODSID",id),
  230. new OracleParameter(":GOODSCODE",goodsEntity.GoodsCode),
  231. new OracleParameter(":PRODUCEDAYS",goodsEntity.ProductDays),
  232. new OracleParameter(":ATTENDANCE",goodsEntity.Attendance),
  233. new OracleParameter(":DAYGROUTINGNUMBER",goodsEntity.DaygroutingNumber),
  234. new OracleParameter(":PROTECTDAMRATE",goodsEntity.ProtectdaMrate),
  235. new OracleParameter(":YEARS",DateTime.Now.ToString("yyyy-MM"))
  236. };
  237. returnRows += oracleTrConn.ExecuteNonQuery(sq2, paras);
  238. #endregion
  239. //张忠帅 产品属性表添加功能 add 2022-12-28
  240. //SAP物料信息
  241. string sql = "delete from TP_MST_GoodsLogoSAP where goodsid = " + id;
  242. returnRows += oracleTrConn.ExecuteNonQuery(sql);
  243. sql = "insert into TP_MST_GOODSLOGOSAP\n" +
  244. " (GOODSID, LOGOID, GOODSCODE, MATERIALCODE, MATERIALREMARK, CREATEUSERID, WaterLabelCode, CertificateCode, PLATELIMITNUM)\n" +
  245. "values\n" +
  246. " (:GOODSID, :LOGOID, :GOODSCODE, :MATERIALCODE, :MATERIALREMARK, :CREATEUSERID, :WaterLabelCode, :CertificateCode, :PlateLimitNum)";
  247. foreach (DataRow item in goodsEntity.SAPInfo.Rows)
  248. {
  249. string sapcode = item["MATERIALCODE"] + "";
  250. string sapremark = item["MATERIALREMARK"] + "";
  251. if (string.IsNullOrWhiteSpace(sapcode))
  252. {
  253. continue;
  254. }
  255. if (string.IsNullOrEmpty(sapremark))
  256. {
  257. sapremark = " ";
  258. }
  259. paras = new OracleParameter[]{
  260. new OracleParameter(":GOODSID",id),
  261. new OracleParameter(":LOGOID",item["LOGOID"]),
  262. new OracleParameter(":GOODSCODE",goodsEntity.GoodsCode),
  263. new OracleParameter(":MATERIALCODE",sapcode),
  264. new OracleParameter(":MATERIALREMARK",sapremark),
  265. new OracleParameter(":CREATEUSERID",sUserInfo.UserID),
  266. new OracleParameter(":WaterLabelCode",item["WaterLabelCode"]),
  267. new OracleParameter(":CertificateCode",item["CertificateCode"]),
  268. new OracleParameter(":PlateLimitNum",item["PlateLimitNum"]),
  269. };
  270. returnRows += oracleTrConn.ExecuteNonQuery(sql, paras);
  271. }
  272. //此处添加图片信息
  273. foreach (GoodsImageEntity img in imgList)
  274. {
  275. int imgReturn = 0;
  276. sbSql.Clear();
  277. sbSql.Append("select SEQ_MST_GoodsImage_ID.nextval from dual");
  278. int imgId = Convert.ToInt32(oracleTrConn.GetSqlResultToStr(sbSql.ToString()));
  279. sbSql.Clear();
  280. sbSql.Append("Insert into TP_MST_GoodsImage");
  281. sbSql.Append("(GoodsImageID,GoodsID,Thumbnail,Image,AccountID,ValueFlag,");
  282. sbSql.Append("CreateUserID,UpdateUserID)");
  283. sbSql.Append(" VALUES(:GoodsImageID,:GoodsID,:Thumbnail,:Image,:AccountID,:ValueFlag,");
  284. sbSql.Append(":CreateUserID,:UpdateUserID)");
  285. OracleParameter[] imgParas = new OracleParameter[] {
  286. new OracleParameter(":GoodsImageID",OracleDbType.Int32,imgId,ParameterDirection.Input),
  287. new OracleParameter(":GoodsID",OracleDbType.Int32,id,ParameterDirection.Input),
  288. new OracleParameter(":Thumbnail",OracleDbType.Blob,img.Thumbnail,ParameterDirection.Input),
  289. new OracleParameter(":Image",OracleDbType.Blob,img.Image,ParameterDirection.Input),
  290. new OracleParameter(":AccountID",OracleDbType.Int32,sUserInfo.AccountID,ParameterDirection.Input),
  291. new OracleParameter(":ValueFlag",OracleDbType.Int32,img.ValueFlag,ParameterDirection.Input),
  292. //new OracleParameter(":CreateTime",OracleDbType.Date,DateTime.Now,ParameterDirection.Input),
  293. new OracleParameter(":CreateUserID",OracleDbType.Int32,sUserInfo.UserID,ParameterDirection.Input),
  294. //new OracleParameter(":UpdateTime",OracleDbType.Date,DateTime.Now,ParameterDirection.Input),
  295. new OracleParameter(":UpdateUserID",OracleDbType.Int32,sUserInfo.UserID,ParameterDirection.Input),
  296. //new OracleParameter(":OPTimeStamp",OracleDbType.TimeStamp,DateTime.Now,ParameterDirection.Input)
  297. };
  298. imgReturn = oracleTrConn.ExecuteNonQuery(sbSql.ToString(), imgParas);
  299. }
  300. //此处添加产品附件
  301. //int AttReturn = AddAttachment(oracleTrConn, attList, id, sUserInfo);
  302. //此处添加缺陷位置关联
  303. //int dpCount = SaveGoodsDefectPosition(oracleTrConn, dpList, id, sUserInfo);
  304. oracleTrConn.Commit();
  305. oracleTrConn.Disconnect();
  306. }
  307. catch (Exception ex)
  308. {
  309. if (oracleTrConn.ConnState == System.Data.ConnectionState.Open)
  310. {
  311. oracleTrConn.Rollback();
  312. oracleTrConn.Disconnect();
  313. }
  314. throw ex;
  315. }
  316. return returnRows;
  317. }
  318. /// <summary>
  319. /// 修改产品档案
  320. /// </summary>
  321. /// <param name="sUserInfo">用户基本信息</param>
  322. /// <param name="goodsEntity">产品实体</param>
  323. /// <param name="imgList">产品图片集合</param>
  324. /// <param name="attList">缺陷位置ID集合</param>
  325. /// <returns>int受影响行数</returns>
  326. /// <remarks>
  327. /// 庄天威 2014.09.04 新建
  328. /// </remarks>
  329. public static int updateGoods(SUserInfo sUserInfo, GoodsEntity goodsEntity
  330. , List<GoodsImageEntity> imgList, List<GoodsAttachmentEntity> attList)
  331. {
  332. int returnRows = 0;
  333. IDBTransaction oracleTrConn = ClsDbFactory.CreateDBTransaction(DataBaseType.ORACLE, DataManager.ConnectionString);
  334. if (goodsEntity.MudQuantity == null)
  335. {
  336. goodsEntity.MudQuantity = 0;
  337. }
  338. if (goodsEntity.GlazeQuantity == null)
  339. {
  340. goodsEntity.GlazeQuantity = 0;
  341. }
  342. if (goodsEntity.Remarks == null)
  343. {
  344. goodsEntity.Remarks = "";
  345. }
  346. if (goodsEntity.GoodsSpecification == null)
  347. {
  348. goodsEntity.GoodsSpecification = "";
  349. }
  350. if (goodsEntity.GoodsModel == null)
  351. {
  352. goodsEntity.GoodsModel = "";
  353. }
  354. try
  355. {
  356. oracleTrConn.Connect();
  357. // 物料编码重复验证 add by chenxy 2017-07-11 begin
  358. // 有不同编码,同物料编码的情况 delete by chenxy 2017-11-10
  359. //string sqlString = "SELECT g.goodscode \n" +
  360. //" FROM tp_mst_goods g\n" +
  361. //" WHERE g.materialcode = :materialcode and g.goodsid <> :goodsid";
  362. //OracleParameter[] checkParas = new OracleParameter[]{
  363. // new OracleParameter(":materialcode",goodsEntity.MaterialCode),
  364. // new OracleParameter(":goodsid",goodsEntity.GoodsID),
  365. //};
  366. //string goodscode = oracleTrConn.GetSqlResultToStr(sqlString, checkParas);
  367. //if (!string.IsNullOrWhiteSpace(goodscode))
  368. //{
  369. // return -10;
  370. //}
  371. // 物料编码重复验证 add by chenxy 2017-07-11 end
  372. StringBuilder sbSql = new StringBuilder();
  373. sbSql.Append("update TP_MST_GOODS");
  374. //sbSql.Append(" set GoodsCode=:GoodsCode,GoodsName=:GoodsName,GoodsSpecification=:GoodsSpecification,");
  375. sbSql.Append(" set GoodsName=:GoodsName,GoodsSpecification=:GoodsSpecification,");
  376. sbSql.Append(" GoodsModel=:GoodsModel,GoodsTypeID=:GoodsTypeID,GlazeTypeID=:GlazeTypeID,MudWeight=:MudWeight,");
  377. sbSql.Append(" GlazeWeight=:GlazeWeight,LusterwareWeight=:LusterwareWeight,ProductionCycle=:ProductionCycle,CeaseFlag=:CeaseFlag,Goods_Line_Type=:Goods_Line_Type,Goods_Line_CODE=:Goods_Line_CODE,Remarks=:Remarks,");
  378. sbSql.Append(" StartingDate=:StartingDate, AutoLossCycle = :AutoLossCycle, DeliverLimitCycle=:DeliverLimitCycle, PlateLimitNum=:PlateLimitNum,");
  379. sbSql.Append(" UnitPrice=:UnitPrice,PackageNum=:PackageNum,OutletDistance=:OutletDistance,MaterialCode=:MaterialCode,MaterialRemark=:MaterialRemark,printcopies=:printcopies,");
  380. sbSql.Append(" MouldWeight=:MouldWeight, MouldCost=:MouldCost,ScrapSumFlag=:ScrapSumFlag, ReservedDays=:ReservedDays,SEATCOVERCODE=:SEATCOVERCODE,");
  381. sbSql.Append(" WaterLabelCode=:WaterLabelCode, CertificateCode=:CertificateCode, StandardGroutingNum=:StandardGroutingNum,MouldMaterialCode=:MouldMaterialCode, MouldOutputCount=:MouldOutputCount,");
  382. sbSql.Append(" AccountID=:AccountID,ValueFlag=:ValueFlag,UpdateUserID=:UpdateUserID,logoid=:logoid,");
  383. sbSql.Append(" MudStoreType=:MudStoreType,");
  384. sbSql.Append(" SecurityCodeBindFlag=:SecurityCodeBindFlag,");
  385. sbSql.Append(" SecurityCodeCheckFlag=:SecurityCodeCheckFlag,");
  386. sbSql.Append(" PlanFlag=:PlanFlag");
  387. //sbSql.Append(" CreateTime=:CreateTime,CreateUserID=:CreateUserID ");
  388. sbSql.Append(" where GoodsID=:GoodsID and OPTimeStamp=:OPTimeStamp");
  389. OracleParameter[] paras = new OracleParameter[]{
  390. // new OracleParameter(":GoodsCode",goodsEntity.GoodsCode),
  391. new OracleParameter(":GoodsName",goodsEntity.GoodsName),
  392. new OracleParameter(":GoodsSpecification",goodsEntity.GoodsSpecification),
  393. new OracleParameter(":GoodsModel",goodsEntity.GoodsModel),
  394. new OracleParameter(":GoodsTypeID",goodsEntity.GoodsTypeID),
  395. new OracleParameter(":GlazeTypeID",goodsEntity.GlazeTypeID),
  396. new OracleParameter(":MudWeight",goodsEntity.MudQuantity),
  397. new OracleParameter(":GlazeWeight",goodsEntity.GlazeQuantity),
  398. new OracleParameter(":LusterwareWeight",goodsEntity.LusterwareWeight),
  399. new OracleParameter(":ProductionCycle",goodsEntity.ProductionCycle),
  400. new OracleParameter(":CeaseFlag",goodsEntity.CeaseFlag),
  401. new OracleParameter(":Goods_Line_Type",goodsEntity.GoodsLineType),
  402. new OracleParameter(":Goods_Line_CODE",goodsEntity.GoodsLineCode),
  403. new OracleParameter(":StartingDate",goodsEntity.StartingDate),
  404. new OracleParameter(":AutoLossCycle",goodsEntity.AutoLossCycle),
  405. new OracleParameter(":DeliverLimitCycle",goodsEntity.DeliverLimitCycle),
  406. new OracleParameter(":PlateLimitNum",goodsEntity.PlateLimitNum),
  407. new OracleParameter(":ReservedDays",goodsEntity.ReservedDays),
  408. new OracleParameter(":UnitPrice",goodsEntity.UnitPrice),
  409. new OracleParameter(":PackageNum",goodsEntity.PackageNum),
  410. new OracleParameter(":OutletDistance",goodsEntity.OutletDistance),
  411. new OracleParameter(":MaterialCode",goodsEntity.MaterialCode),
  412. new OracleParameter(":MouldWeight",goodsEntity.MouldWeight),
  413. new OracleParameter(":MouldCost",goodsEntity.MouldCost),
  414. new OracleParameter(":ScrapSumFlag",goodsEntity.ScrapSumFlag),
  415. new OracleParameter(":MaterialRemark",goodsEntity.MaterialRemark),
  416. new OracleParameter(":printcopies",goodsEntity.PrintCopies),
  417. new OracleParameter(":Remarks",goodsEntity.Remarks),
  418. new OracleParameter(":SEATCOVERCODE",goodsEntity.SeatCoverCode),
  419. new OracleParameter(":WaterLabelCode",goodsEntity.WaterLabelCode),
  420. new OracleParameter(":CertificateCode",goodsEntity.CertificateCode),
  421. new OracleParameter(":StandardGroutingNum",goodsEntity.StandardGroutingNum),
  422. new OracleParameter(":MouldMaterialCode",goodsEntity.MouldMaterialCode),
  423. new OracleParameter(":MouldOutputCount",goodsEntity.MouldOutputCount),
  424. new OracleParameter(":logoid", goodsEntity.LogoID),
  425. new OracleParameter(":AccountID",goodsEntity.AccountID),
  426. new OracleParameter(":ValueFlag",goodsEntity.ValueFlag),
  427. //new OracleParameter(":UpdateTime",OracleDbType.Date,DateTime.Now,ParameterDirection.Input),
  428. new OracleParameter(":UpdateUserID",sUserInfo.UserID),
  429. //new OracleParameter(":CreateTime",OracleDbType.Date,goodsEntity.CreateTime,ParameterDirection.Input),
  430. //new OracleParameter(":CreateUserID",goodsEntity.CreateUserID),
  431. new OracleParameter(":OPTimeStamp",OracleDbType.TimeStamp,goodsEntity.OPTimeStamp,ParameterDirection.Input),
  432. new OracleParameter(":MudStoreType",goodsEntity.MudStoreType),
  433. new OracleParameter(":SecurityCodeBindFlag",goodsEntity.SecurityCodeBindFlag),
  434. new OracleParameter(":SecurityCodeCheckFlag",goodsEntity.SecurityCodeCheckFlag),
  435. new OracleParameter(":PlanFlag",goodsEntity.PlanFlag),
  436. new OracleParameter(":GoodsId",goodsEntity.GoodsID)
  437. };
  438. returnRows = oracleTrConn.ExecuteNonQuery(sbSql.ToString(), paras);
  439. if (returnRows == 0)
  440. {
  441. oracleTrConn.Rollback();
  442. oracleTrConn.Disconnect();
  443. return -500;
  444. }
  445. //SAP物料信息
  446. string sql = "delete from TP_MST_GoodsLogoSAP where goodsid = " + goodsEntity.GoodsID;
  447. returnRows += oracleTrConn.ExecuteNonQuery(sql);
  448. sql = "insert into TP_MST_GOODSLOGOSAP\n" +
  449. " (GOODSID, LOGOID, GOODSCODE, MATERIALCODE, MATERIALREMARK, CREATEUSERID,WaterLabelCode, CertificateCode,PLATELIMITNUM)\n" +
  450. "values\n" +
  451. " (:GOODSID, :LOGOID, :GOODSCODE, :MATERIALCODE, :MATERIALREMARK, :CREATEUSERID,:WaterLabelCode, :CertificateCode,:PlateLimitNum)";
  452. foreach (DataRow item in goodsEntity.SAPInfo.Rows)
  453. {
  454. string sapcode = item["MATERIALCODE"] + "";
  455. string sapremark = item["MATERIALREMARK"] + "";
  456. if (string.IsNullOrWhiteSpace(sapcode))
  457. {
  458. continue;
  459. }
  460. if (string.IsNullOrEmpty(sapremark))
  461. {
  462. sapremark = " ";
  463. }
  464. paras = new OracleParameter[]{
  465. new OracleParameter(":GOODSID",goodsEntity.GoodsID),
  466. new OracleParameter(":LOGOID",item["LOGOID"]),
  467. new OracleParameter(":GOODSCODE",goodsEntity.GoodsCode),
  468. new OracleParameter(":MATERIALCODE",sapcode),
  469. new OracleParameter(":MATERIALREMARK",sapremark),
  470. new OracleParameter(":CREATEUSERID",sUserInfo.UserID),
  471. new OracleParameter(":WaterLabelCode",item["WaterLabelCode"]),
  472. new OracleParameter(":CertificateCode",item["CertificateCode"]),
  473. new OracleParameter(":PlateLimitNum",item["PlateLimitNum"]),
  474. };
  475. returnRows += oracleTrConn.ExecuteNonQuery(sql, paras);
  476. }
  477. //张忠帅 产品属性表修改 add 2022-12-28
  478. #region 产品属性表修改
  479. //查询本月是否存在数据
  480. string sq2 = string.Empty;
  481. string sqls = "SELECT * FROM TP_MST_PRODUCTATTRIBUTES WHERE GOODSID=:GOODSID AND GOODSCODE=:GOODSCODE AND YEARS=TO_DATE(:YEARS, 'YYYY--MM')";
  482. paras = new OracleParameter[]{
  483. new OracleParameter(":GOODSID",goodsEntity.GoodsID),
  484. new OracleParameter(":GOODSCODE",goodsEntity.GoodsCode),
  485. new OracleParameter(":YEARS",DateTime.Now.ToString("yyyy-MM"))
  486. };
  487. DataSet dsGoodsButes = oracleTrConn.GetSqlResultToDs(sqls, paras);
  488. //判断
  489. if (dsGoodsButes != null && dsGoodsButes.Tables != null && dsGoodsButes.Tables[0].Rows.Count > 0)
  490. {
  491. //修改
  492. sq2 = @"UPDATE TP_MST_PRODUCTATTRIBUTES SET PRODUCEDAYS=:PRODUCEDAYS,ATTENDANCE=:ATTENDANCE,
  493. DAYGROUTINGNUMBER=:DAYGROUTINGNUMBER,PROTECTDAMRATE=:PROTECTDAMRATE,YEARS=TO_DATE(:YEARS, 'YYYY--MM')
  494. WHERE GOODSID=:GOODSID AND YEARS=TO_DATE(:YEARS, 'YYYY--MM')";
  495. paras = new OracleParameter[]{
  496. new OracleParameter(":GOODSID",goodsEntity.GoodsID),
  497. new OracleParameter(":GOODSCODE",goodsEntity.GoodsCode),
  498. new OracleParameter(":PRODUCEDAYS",goodsEntity.ProductDays),
  499. new OracleParameter(":ATTENDANCE",goodsEntity.Attendance),
  500. new OracleParameter(":DAYGROUTINGNUMBER",goodsEntity.DaygroutingNumber),
  501. new OracleParameter(":PROTECTDAMRATE",goodsEntity.ProtectdaMrate),
  502. new OracleParameter(":YEARS",DateTime.Now.ToString("yyyy-MM"))
  503. };
  504. }
  505. else
  506. {
  507. //新建
  508. sq2 = @"INSERT INTO TP_MST_PRODUCTATTRIBUTES(GOODSID,GOODSCODE,PRODUCEDAYS,ATTENDANCE,DAYGROUTINGNUMBER,PROTECTDAMRATE,YEARS)
  509. VALUES (:GOODSID,:GOODSCODE,:PRODUCEDAYS,:ATTENDANCE,:DAYGROUTINGNUMBER,:PROTECTDAMRATE,TO_DATE(:YEARS,'YYYY--MM'))";
  510. paras = new OracleParameter[]{
  511. new OracleParameter(":GOODSID",goodsEntity.GoodsID),
  512. new OracleParameter(":GOODSCODE",goodsEntity.GoodsCode),
  513. new OracleParameter(":PRODUCEDAYS",goodsEntity.ProductDays),
  514. new OracleParameter(":ATTENDANCE",goodsEntity.Attendance),
  515. new OracleParameter(":DAYGROUTINGNUMBER",goodsEntity.DaygroutingNumber),
  516. new OracleParameter(":PROTECTDAMRATE",goodsEntity.ProtectdaMrate),
  517. new OracleParameter(":YEARS",DateTime.Now.ToString("yyyy-MM"))
  518. };
  519. }
  520. returnRows += oracleTrConn.ExecuteNonQuery(sq2, paras);
  521. #endregion
  522. //张忠帅 产品属性表修改 add 2022-12-28
  523. foreach (GoodsImageEntity imgEntity in imgList)
  524. {
  525. if (imgEntity.GoodsImageID == 0)
  526. {
  527. int imgReturn = 0;
  528. sbSql.Clear();
  529. sbSql.Append("select SEQ_MST_GoodsImage_ID.nextval from dual");
  530. int imgId = Convert.ToInt32(oracleTrConn.GetSqlResultToStr(sbSql.ToString()));
  531. sbSql.Clear();
  532. sbSql.Append("Insert into TP_MST_GoodsImage");
  533. sbSql.Append("(GoodsImageID,GoodsID,Thumbnail,Image,AccountID,ValueFlag,");
  534. sbSql.Append("CreateUserID,UpdateUserID)");
  535. sbSql.Append(" VALUES(:GoodsImageID,:GoodsID,:Thumbnail,:Image,:AccountID,:ValueFlag,");
  536. sbSql.Append(":CreateUserID,:UpdateUserID)");
  537. OracleParameter[] imgParas = new OracleParameter[] {
  538. new OracleParameter(":GoodsImageID",OracleDbType.Int32,imgId,ParameterDirection.Input),
  539. new OracleParameter(":GoodsID",OracleDbType.Int32,goodsEntity.GoodsID,ParameterDirection.Input),
  540. new OracleParameter(":Thumbnail",OracleDbType.Blob,imgEntity.Thumbnail,ParameterDirection.Input),
  541. new OracleParameter(":Image",OracleDbType.Blob,imgEntity.Image,ParameterDirection.Input),
  542. new OracleParameter(":AccountID",OracleDbType.Int32,sUserInfo.AccountID,ParameterDirection.Input),
  543. new OracleParameter(":ValueFlag",OracleDbType.Int32,imgEntity.ValueFlag,ParameterDirection.Input),
  544. //new OracleParameter(":CreateTime",OracleDbType.Date,DateTime.Now,ParameterDirection.Input),
  545. new OracleParameter(":CreateUserID",OracleDbType.Int32,sUserInfo.UserID,ParameterDirection.Input),
  546. //new OracleParameter(":UpdateTime",OracleDbType.Date,DateTime.Now,ParameterDirection.Input),
  547. new OracleParameter(":UpdateUserID",OracleDbType.Int32,sUserInfo.UserID,ParameterDirection.Input),
  548. //new OracleParameter(":OPTimeStamp",OracleDbType.TimeStamp,DateTime.Now,ParameterDirection.Input)
  549. };
  550. imgReturn = oracleTrConn.ExecuteNonQuery(sbSql.ToString(), imgParas);
  551. }
  552. else
  553. {
  554. int imgReturn = 0;
  555. sbSql.Clear();
  556. sbSql.Append(" update TP_MST_GoodsImage");
  557. sbSql.Append(" set GoodsID=:GoodsID,AccountID=:AccountID,ValueFlag=:ValueFlag,");
  558. sbSql.Append(" UpdateUserID=:UpdateUserID");
  559. //sbSql.Append(" where GoodsImageID=:GoodsImageID And OPTimeStamp=to_date(:OPTimeStamp,'yyyy-mm-dd HH24:mi:ss')");
  560. sbSql.Append(" where GoodsImageID=:GoodsImageID");
  561. OracleParameter[] imgParas = new OracleParameter[] {
  562. new OracleParameter(":GoodsID",OracleDbType.Int32,
  563. goodsEntity.GoodsID,ParameterDirection.Input),
  564. new OracleParameter(":AccountID",OracleDbType.Int32,
  565. imgEntity.AccountID,ParameterDirection.Input),
  566. new OracleParameter(":ValueFlag",OracleDbType.Int32,
  567. imgEntity.ValueFlag,ParameterDirection.Input),
  568. //new OracleParameter(":UpdateTime",OracleDbType.NVarchar2,
  569. // DateTime.Now.ToString(),ParameterDirection.Input),
  570. new OracleParameter(":UpdateUserID",OracleDbType.Int32,
  571. sUserInfo.UserID,ParameterDirection.Input),
  572. new OracleParameter(":GoodsImageID",OracleDbType.Int32,
  573. imgEntity.GoodsImageID,ParameterDirection.Input)
  574. //,new OracleParameter(":OPTimeStamp",OracleDbType.TimeStamp, imgEntity.OPTimeStamp,ParameterDirection.Input)
  575. };
  576. imgReturn = oracleTrConn.ExecuteNonQuery(sbSql.ToString(), imgParas);
  577. }
  578. }
  579. //修改产品附件
  580. //int AttReturn = UpdateAttachment(oracleTrConn, attList, Convert.ToInt32(goodsEntity.GoodsID), sUserInfo);
  581. oracleTrConn.Commit();
  582. oracleTrConn.Disconnect();
  583. }
  584. catch (Exception ex)
  585. {
  586. if (oracleTrConn.ConnState == System.Data.ConnectionState.Open)
  587. {
  588. oracleTrConn.Rollback();
  589. oracleTrConn.Disconnect();
  590. }
  591. throw ex;
  592. }
  593. return returnRows;
  594. }
  595. /// <summary>
  596. /// 查询产品物料信息
  597. /// </summary>
  598. /// <param name="sUserInfo"></param>
  599. /// <param name="goodsID"></param>
  600. /// <returns></returns>
  601. public static ServiceResultEntity GetGoodsSAP(SUserInfo sUserInfo, int goodsID)
  602. {
  603. IDBConnection conn = null;
  604. try
  605. {
  606. conn = ClsDbFactory.CreateDBConnection(DataBaseType.ORACLE, DataManager.ConnectionString);
  607. string sqlString = @"
  608. SELECT
  609. '产品档案' LOGONAME,
  610. G.MATERIALCODE,
  611. G.MATERIALREMARK,
  612. G.WATERLABELCODE,
  613. G.CERTIFICATECODE,
  614. '1' VALUEFLAG, - 1 DISPLAYNO,
  615. G.PLATELIMITNUM
  616. FROM
  617. TP_MST_GOODS G
  618. WHERE
  619. G.GOODSID = :goodsid
  620. UNION ALL
  621. SELECT
  622. TO_CHAR( L.LOGONAME ),
  623. GLS.MATERIALCODE,
  624. GLS.MATERIALREMARK,
  625. GLS.WATERLABELCODE,
  626. GLS.CERTIFICATECODE,
  627. L.VALUEFLAG,
  628. L.DISPLAYNO,
  629. GLS.PLATELIMITNUM
  630. FROM
  631. TP_MST_GOODSLOGOSAP GLS
  632. INNER JOIN TP_MST_LOGO L ON L.LOGOID = GLS.LOGOID
  633. WHERE
  634. GLS.GOODSID = :goodsid
  635. ORDER BY
  636. VALUEFLAG DESC,
  637. DISPLAYNO
  638. ";
  639. OracleParameter[] paras = new OracleParameter[]{
  640. new OracleParameter(":goodsid",goodsID),
  641. };
  642. ServiceResultEntity sre = new ServiceResultEntity();
  643. sre.Data = conn.GetSqlResultToDs(sqlString, paras);
  644. return sre;
  645. }
  646. catch (Exception ex)
  647. {
  648. throw ex;
  649. }
  650. finally
  651. {
  652. if (conn != null &&
  653. conn.ConnState == ConnectionState.Open)
  654. {
  655. conn.Close();
  656. }
  657. }
  658. }
  659. /// <summary>
  660. /// 查询产品物料信息(编辑用)
  661. /// </summary>
  662. /// <param name="sUserInfo"></param>
  663. /// <param name="goodsID"></param>
  664. /// <returns></returns>
  665. public static ServiceResultEntity GetGoodsSAPByEdit(SUserInfo sUserInfo, int goodsID)
  666. {
  667. IDBConnection conn = null;
  668. try
  669. {
  670. conn = ClsDbFactory.CreateDBConnection(DataBaseType.ORACLE, DataManager.ConnectionString);
  671. string sqlString = "select l.logoid\n" +
  672. " ,l.logoname\n" +
  673. " ,gls.materialcode\n" +
  674. " ,gls.materialremark\n" +
  675. " ,gls.WaterLabelCode\n" +
  676. " ,gls.CertificateCode\n" +
  677. " ,gls.goodsid\n" +
  678. " ,l.valueflag\n" +
  679. " ,gls.platelimitnum\n" +
  680. " from tp_mst_logo l\n" +
  681. " left join tp_mst_goodslogosap gls\n" +
  682. " on gls.goodsid = :goodsid\n" +
  683. " and l.logoid = gls.logoid\n" +
  684. " where (l.valueflag = '1' or gls.goodsid is not null)\n" +
  685. " order by gls.goodsid, l.valueflag desc, l.displayno";
  686. OracleParameter[] paras = new OracleParameter[]{
  687. new OracleParameter(":goodsid",goodsID),
  688. };
  689. ServiceResultEntity sre = new ServiceResultEntity();
  690. sre.Data = conn.GetSqlResultToDs(sqlString, paras);
  691. return sre;
  692. }
  693. catch (Exception ex)
  694. {
  695. throw ex;
  696. }
  697. finally
  698. {
  699. if (conn != null &&
  700. conn.ConnState == ConnectionState.Open)
  701. {
  702. conn.Close();
  703. }
  704. }
  705. }
  706. #endregion
  707. #region 获得生产工号集合
  708. /// <summary>
  709. /// 获得生产工号集合
  710. /// </summary>
  711. /// <param name="sUserInfo">用户基本信息</param>
  712. /// <returns>DataSet</returns>
  713. /// <remarks>
  714. /// 陈冰 2014.09.03 新建
  715. /// </remarks>
  716. public static DataSet GetWorker(SUserInfo sUserInfo)
  717. {
  718. IDBConnection con = ClsDbFactory.CreateDBConnection(DataBaseType.ORACLE, DataManager.ConnectionString);
  719. try
  720. {
  721. con.Open();
  722. OracleParameter[] paras = new OracleParameter[]{
  723. new OracleParameter("accountID",OracleDbType.Int32,sUserInfo.AccountID,ParameterDirection.Input),
  724. new OracleParameter("rs_worker",OracleDbType.RefCursor,ParameterDirection.Output),
  725. };
  726. DataSet ds = con.ExecStoredProcedure("PRO_MST_GetWorker", paras);
  727. return ds;
  728. }
  729. catch (Exception ex)
  730. {
  731. throw ex;
  732. }
  733. finally
  734. {
  735. if (con.ConnState == ConnectionState.Open)
  736. {
  737. con.Close();
  738. }
  739. }
  740. }
  741. #endregion
  742. #region 获得工种集合
  743. /// <summary>
  744. /// 获得工种集合
  745. /// </summary>
  746. /// <param name="sUserInfo">用户基本信息</param>
  747. /// <returns>DataSet</returns>
  748. /// <remarks>
  749. /// 陈冰 2014.09.03 新建
  750. /// </remarks>
  751. public static DataSet GetJobs(SUserInfo sUserInfo)
  752. {
  753. IDBConnection con = ClsDbFactory.CreateDBConnection(DataBaseType.ORACLE, DataManager.ConnectionString);
  754. try
  755. {
  756. con.Open();
  757. OracleParameter[] paras = new OracleParameter[]{
  758. new OracleParameter("accountID",OracleDbType.Int32,sUserInfo.AccountID,ParameterDirection.Input),
  759. new OracleParameter("rs_jobs",OracleDbType.RefCursor,ParameterDirection.Output),
  760. };
  761. DataSet ds = con.ExecStoredProcedure("PRO_MST_GetJobs", paras);
  762. return ds;
  763. }
  764. catch (Exception ex)
  765. {
  766. throw ex;
  767. }
  768. finally
  769. {
  770. if (con.ConnState == ConnectionState.Open)
  771. {
  772. con.Close();
  773. }
  774. }
  775. }
  776. #endregion
  777. #region 获得缺陷集合
  778. /// <summary>
  779. /// 获得缺陷集合
  780. /// </summary>
  781. /// <param name="sUserInfo">用户基本信息</param>
  782. /// <returns>DataSet</returns>
  783. /// <remarks>
  784. /// 陈冰 2014.09.03 新建
  785. /// </remarks>
  786. public static DataSet GetDefect(SUserInfo sUserInfo)
  787. {
  788. IDBConnection con = ClsDbFactory.CreateDBConnection(DataBaseType.ORACLE, DataManager.ConnectionString);
  789. try
  790. {
  791. con.Open();
  792. OracleParameter[] paras = new OracleParameter[]{
  793. new OracleParameter("accountID",OracleDbType.Int32,sUserInfo.AccountID,ParameterDirection.Input),
  794. new OracleParameter("rs_defect",OracleDbType.RefCursor,ParameterDirection.Output),
  795. };
  796. DataSet ds = con.ExecStoredProcedure("PRO_MST_GetDefect", paras);
  797. return ds;
  798. }
  799. catch (Exception ex)
  800. {
  801. throw ex;
  802. }
  803. finally
  804. {
  805. if (con.ConnState == ConnectionState.Open)
  806. {
  807. con.Close();
  808. }
  809. }
  810. }
  811. #endregion
  812. #region 产品图片
  813. /// <summary>
  814. /// 根据产品ID获取产品图片
  815. /// </summary>
  816. /// <param name="sUserInfo">用户基本信息</param>
  817. /// <param name="goodsId">产品ID</param>
  818. /// <returns>DataSet</returns>
  819. /// <remarks>
  820. /// 庄天威 2014.09.04 新建
  821. /// </remarks>
  822. public static DataSet GetImageByGoodsId(SUserInfo sUserInfo, int goodsId)
  823. {
  824. IDBConnection con = ClsDbFactory.CreateDBConnection(DataBaseType.ORACLE, DataManager.ConnectionString);
  825. try
  826. {
  827. con.Open();
  828. OracleParameter[] paras = new OracleParameter[]{
  829. new OracleParameter("in_accountID",OracleDbType.Int32,sUserInfo.AccountID,ParameterDirection.Input),
  830. new OracleParameter("in_goodsID",OracleDbType.Int32,goodsId,ParameterDirection.Input),
  831. new OracleParameter("rs_result",OracleDbType.RefCursor,ParameterDirection.Output),
  832. };
  833. DataSet ds = con.ExecStoredProcedure("PRO_MST_GetImageByGoodsId", paras);
  834. return ds;
  835. }
  836. catch (Exception ex)
  837. {
  838. throw ex;
  839. }
  840. finally
  841. {
  842. if (con.ConnState == ConnectionState.Open)
  843. {
  844. con.Close();
  845. }
  846. }
  847. }
  848. #endregion
  849. #region 附件
  850. /// <summary>
  851. /// 新建附件信息
  852. /// </summary>
  853. /// <param name="AttList">附件实体集合</param>
  854. /// <param name="mainId">产品ID</param>
  855. /// <param name="userInfo">用户基本信息</param>
  856. /// <returns>int影响结果行数</returns>
  857. public static int AddAttachment(List<GoodsAttachmentEntity> AttList, int mainId, SUserInfo userInfo)
  858. {
  859. IDBTransaction oracleTrConn = ClsDbFactory.CreateDBTransaction(DataBaseType.ORACLE, DataManager.ConnectionString);
  860. try
  861. {
  862. oracleTrConn.Connect();
  863. int AttReturn = 0;
  864. int GAReturn = 0;
  865. StringBuilder sbSql = new StringBuilder();
  866. foreach (GoodsAttachmentEntity attFor in AttList)
  867. {
  868. sbSql.Clear();
  869. sbSql.Append("select SEQ_MST_Attachment_ID.nextval from dual");
  870. int id = Convert.ToInt32(oracleTrConn.GetSqlResultToStr(sbSql.ToString()));
  871. sbSql.Clear();
  872. sbSql.Append(@"Insert into TP_MST_Attachment(AttachmentID,FileName,FilePath,AccountID,ValueFlag,
  873. CreateUserID,UpdateUserID)
  874. Values(:AttachmentID,:FileName,:FilePath,:AccountID,:ValueFlag,
  875. :CreateUserID,:UpdateUserID)");
  876. OracleParameter[] attParas = new OracleParameter[] {
  877. new OracleParameter(":AttachmentID",OracleDbType.Int32,
  878. id,ParameterDirection.Input),
  879. new OracleParameter(":FileName",OracleDbType.NVarchar2,
  880. attFor.FileName,ParameterDirection.Input),
  881. new OracleParameter(":FilePath",OracleDbType.NVarchar2,
  882. attFor.FilePath,ParameterDirection.Input),
  883. new OracleParameter(":AccountID",OracleDbType.Int32,
  884. userInfo.AccountID,ParameterDirection.Input),
  885. new OracleParameter(":ValueFlag",OracleDbType.Int32,
  886. 1,ParameterDirection.Input),
  887. new OracleParameter(":CreateUserID",OracleDbType.Int32,
  888. userInfo.UserID,ParameterDirection.Input),
  889. new OracleParameter(":UpdateUserID",OracleDbType.Int32,
  890. userInfo.UserID,ParameterDirection.Input)
  891. };
  892. AttReturn += oracleTrConn.ExecuteNonQuery(sbSql.ToString(), attParas);
  893. sbSql.Clear();
  894. sbSql.Append(@"Insert into TP_MST_GoodsAttachment(GoodsID,AttachmentID,CreateUserID,UpdateUserID)
  895. Values(:GoodsID,:AttachmentID,:CreateUserID,:UpdateUserID)");
  896. OracleParameter[] gaParas = new OracleParameter[] {
  897. new OracleParameter(":GoodsID",OracleDbType.Int32,
  898. mainId,ParameterDirection.Input),
  899. new OracleParameter(":AttachmentID",OracleDbType.Int32,
  900. id,ParameterDirection.Input),
  901. new OracleParameter(":CreateUserID",OracleDbType.Int32,
  902. userInfo.UserID,ParameterDirection.Input),
  903. new OracleParameter(":UpdateUserID",OracleDbType.Int32,
  904. userInfo.UserID,ParameterDirection.Input)
  905. };
  906. GAReturn += oracleTrConn.ExecuteNonQuery(sbSql.ToString(), gaParas);
  907. sbSql.Clear();
  908. }
  909. oracleTrConn.Commit();
  910. oracleTrConn.Disconnect();
  911. return AttReturn;
  912. }
  913. catch (Exception ex)
  914. {
  915. if (oracleTrConn.ConnState == System.Data.ConnectionState.Open)
  916. {
  917. oracleTrConn.Rollback();
  918. oracleTrConn.Disconnect();
  919. }
  920. throw ex;
  921. }
  922. }
  923. /// <summary>
  924. /// 修改附件信息
  925. /// </summary>
  926. /// <param name="AttList">附件实体集合</param>
  927. /// <param name="mainId">产品ID</param>
  928. /// <param name="userInfo">用户基本信息</param>
  929. /// <returns>int受影响行数</returns>
  930. public static int UpdateAttachment(List<GoodsAttachmentEntity> AttList, int mainId, SUserInfo userInfo)
  931. {
  932. IDBTransaction oracleTrConn = ClsDbFactory.CreateDBTransaction(DataBaseType.ORACLE, DataManager.ConnectionString);
  933. try
  934. {
  935. oracleTrConn.Connect();
  936. int AttReturn = 0;
  937. int GAReturn = 0;
  938. StringBuilder sbSql = new StringBuilder();
  939. foreach (GoodsAttachmentEntity attFor in AttList)
  940. {
  941. if (attFor.IsUpdateAdd == 0) //不是新建的
  942. {
  943. sbSql.Clear();
  944. sbSql.Append(@"Update TP_MST_Attachment set ValueFlag = :ValueFlag,UpdateUserID=:UpdateUserID
  945. Where AttachmentID = :AttachmentID");
  946. OracleParameter[] attParas = new OracleParameter[] {
  947. new OracleParameter(":ValueFlag",OracleDbType.Int32,
  948. attFor.ValueFlag,ParameterDirection.Input),
  949. new OracleParameter(":UpdateUserID",OracleDbType.Int32,
  950. userInfo.UserID,ParameterDirection.Input),
  951. new OracleParameter(":AttachmentID",OracleDbType.Int32,
  952. attFor.AttachmentID,ParameterDirection.Input)
  953. };
  954. AttReturn += oracleTrConn.ExecuteNonQuery(sbSql.ToString(), attParas);
  955. sbSql.Clear();
  956. sbSql.Append(@"Update TP_MST_GoodsAttachment
  957. Set ValueFlag = :ValueFlag,UpdateUserID=:UpdateUserID
  958. Where AttachmentID = :AttachmentID");
  959. GAReturn += oracleTrConn.ExecuteNonQuery(sbSql.ToString(), attParas);
  960. sbSql.Clear();
  961. }
  962. else //新建的
  963. {
  964. sbSql.Clear();
  965. sbSql.Append("select SEQ_MST_Attachment_ID.nextval from dual");
  966. int id = Convert.ToInt32(oracleTrConn.GetSqlResultToStr(sbSql.ToString()));
  967. sbSql.Clear();
  968. sbSql.Append(@"Insert into TP_MST_Attachment(AttachmentID,FileName,FilePath,AccountID,ValueFlag,
  969. CreateUserID,UpdateUserID)
  970. Values(:AttachmentID,:FileName,:FilePath,:AccountID,:ValueFlag,
  971. :CreateUserID,:UpdateUserID)");
  972. OracleParameter[] attParas = new OracleParameter[] {
  973. new OracleParameter(":AttachmentID",OracleDbType.Int32,
  974. id,ParameterDirection.Input),
  975. new OracleParameter(":FileName",OracleDbType.NVarchar2,
  976. attFor.FileName,ParameterDirection.Input),
  977. new OracleParameter(":FilePath",OracleDbType.NVarchar2,
  978. attFor.FilePath,ParameterDirection.Input),
  979. new OracleParameter(":AccountID",OracleDbType.Int32,
  980. userInfo.AccountID,ParameterDirection.Input),
  981. new OracleParameter(":ValueFlag",OracleDbType.Int32,
  982. 1,ParameterDirection.Input),
  983. new OracleParameter(":CreateUserID",OracleDbType.Int32,
  984. userInfo.UserID,ParameterDirection.Input),
  985. new OracleParameter(":UpdateUserID",OracleDbType.Int32,
  986. userInfo.UserID,ParameterDirection.Input)
  987. };
  988. AttReturn += oracleTrConn.ExecuteNonQuery(sbSql.ToString(), attParas);
  989. sbSql.Clear();
  990. sbSql.Append(@"Insert into TP_MST_GoodsAttachment(GoodsID,AttachmentID,CreateUserID,UpdateUserID)
  991. Values(:GoodsID,:AttachmentID,:CreateUserID,:UpdateUserID)");
  992. OracleParameter[] gaParas = new OracleParameter[] {
  993. new OracleParameter(":GoodsID",OracleDbType.Int32,
  994. mainId,ParameterDirection.Input),
  995. new OracleParameter(":AttachmentID",OracleDbType.Int32,
  996. id,ParameterDirection.Input),
  997. new OracleParameter(":CreateUserID",OracleDbType.Int32,
  998. userInfo.UserID,ParameterDirection.Input),
  999. new OracleParameter(":UpdateUserID",OracleDbType.Int32,
  1000. userInfo.UserID,ParameterDirection.Input)
  1001. };
  1002. GAReturn += oracleTrConn.ExecuteNonQuery(sbSql.ToString(), gaParas);
  1003. sbSql.Clear();
  1004. }
  1005. }
  1006. oracleTrConn.Commit();
  1007. oracleTrConn.Disconnect();
  1008. return AttReturn;
  1009. }
  1010. catch (Exception ex)
  1011. {
  1012. if (oracleTrConn.ConnState == System.Data.ConnectionState.Open)
  1013. {
  1014. oracleTrConn.Rollback();
  1015. oracleTrConn.Disconnect();
  1016. }
  1017. throw ex;
  1018. }
  1019. }
  1020. /// <summary>
  1021. /// 根据产品ID获取附件
  1022. /// </summary>
  1023. /// <param name="goodsId">产品ID</param>
  1024. /// <returns>DataSet</returns>
  1025. public static DataSet GetAttachmentByGoodsId(int goodsId)
  1026. {
  1027. IDBConnection con = ClsDbFactory.CreateDBConnection(DataBaseType.ORACLE, DataManager.ConnectionString);
  1028. try
  1029. {
  1030. con.Open();
  1031. String strSql = @"Select goodsAtt.GoodsID,att.* from TP_MST_GoodsAttachment goodsAtt
  1032. Inner join TP_MST_Attachment att
  1033. On goodsAtt.AttachmentID = att.AttachmentID
  1034. Where goodsAtt.ValueFlag = 1 and goodsAtt.GoodsID = " + goodsId;
  1035. DataSet ds = con.GetSqlResultToDs(strSql, null);
  1036. return ds;
  1037. }
  1038. catch (Exception ex)
  1039. {
  1040. throw ex;
  1041. }
  1042. finally
  1043. {
  1044. if (con.ConnState == ConnectionState.Open)
  1045. {
  1046. con.Close();
  1047. }
  1048. }
  1049. }
  1050. #endregion
  1051. #region 缺陷位置
  1052. /// <summary>
  1053. /// 获取缺陷位置
  1054. /// </summary>
  1055. /// <param name="dpEntity">缺陷位置实体</param>
  1056. /// <param name="userInfo">用户基本信息</param>
  1057. /// <returns>DataSet</returns>
  1058. public static DataSet GetDefectPosition(DefectPositionEntity dpEntity, SUserInfo userInfo)
  1059. {
  1060. IDBConnection con = ClsDbFactory.CreateDBConnection(DataBaseType.ORACLE, DataManager.ConnectionString);
  1061. try
  1062. {
  1063. con.Open();
  1064. OracleParameter[] paras = new OracleParameter[]{
  1065. new OracleParameter("in_DefectPositionID",OracleDbType.Int32,
  1066. dpEntity.DefectPositionID,ParameterDirection.Input),
  1067. new OracleParameter("in_DefectPositionCode",OracleDbType.NVarchar2,
  1068. dpEntity.DefectPositionCode,ParameterDirection.Input),
  1069. new OracleParameter("in_DefectPositionName",OracleDbType.NVarchar2,
  1070. dpEntity.DefectPositionName,ParameterDirection.Input),
  1071. new OracleParameter("in_AccountID",OracleDbType.Int32,
  1072. userInfo.AccountID,ParameterDirection.Input),
  1073. new OracleParameter("out_rs_defect",OracleDbType.RefCursor,ParameterDirection.Output),
  1074. };
  1075. DataSet dsDefectPosition = con.ExecStoredProcedure("PRO_MST_GetDefectPosition", paras);
  1076. return dsDefectPosition;
  1077. }
  1078. catch (Exception ex)
  1079. {
  1080. throw ex;
  1081. }
  1082. finally
  1083. {
  1084. if (con.ConnState == ConnectionState.Open)
  1085. {
  1086. con.Close();
  1087. }
  1088. }
  1089. }
  1090. /// <summary>
  1091. /// 根据产品获得产品缺陷位置
  1092. /// </summary>
  1093. /// <param name="GoodsId">产品ID</param>
  1094. /// <returns>DataSet</returns>
  1095. public static DataSet getGoodsDefectPositionByGoodsId(int GoodsId)
  1096. {
  1097. IDBConnection con = ClsDbFactory.CreateDBConnection(DataBaseType.ORACLE, DataManager.ConnectionString);
  1098. try
  1099. {
  1100. con.Open();
  1101. string sql = @"select gdp.*,dp.DefectPositionCode,dp.DefectPositionName,dp.Remarks
  1102. from TP_MST_GoodsDefectPosition gdp
  1103. inner join TP_MST_DefectPosition dp
  1104. on gdp.DefectPositionID=dp.DefectPositionID
  1105. where gdp.GoodsID=" + GoodsId;
  1106. DataSet dsDefectPosition = con.GetSqlResultToDs(sql, null);
  1107. return dsDefectPosition;
  1108. }
  1109. catch (Exception ex)
  1110. {
  1111. throw ex;
  1112. }
  1113. finally
  1114. {
  1115. if (con.ConnState == ConnectionState.Open)
  1116. {
  1117. con.Close();
  1118. }
  1119. }
  1120. }
  1121. /// <summary>
  1122. /// 保存产品缺陷位置关联(依附在添加产品中)
  1123. /// </summary>
  1124. /// <param name="dpList">缺陷位置集</param>
  1125. /// <param name="GoodsId">产品ID</param>
  1126. /// <param name="userInfo">用户基本信息</param>
  1127. /// <returns>int</returns>
  1128. public static int SaveGoodsDefectPosition(IDBTransaction oracleTrConn, List<int> dpList, int GoodsId, SUserInfo userInfo)
  1129. {
  1130. try
  1131. {
  1132. int ReturnCount = 0;
  1133. string sql = "Delete from TP_MST_GoodsDefectPosition where GoodsId=" + GoodsId;
  1134. foreach (int dpFor in dpList)
  1135. {
  1136. string sqlAdd = @"Insert into TP_MST_GoodsDefectPosition(GoodsID,DefectPositionID,
  1137. CreateTime,CreateUserID) Values(:GoodsID,:DefectPositionID,sysdate,:CreateUserID)";
  1138. OracleParameter[] paras = new OracleParameter[]{
  1139. new OracleParameter(":GoodsID",OracleDbType.Int32,
  1140. GoodsId,ParameterDirection.Input),
  1141. new OracleParameter(":DefectPositionID",OracleDbType.Int32,
  1142. dpFor,ParameterDirection.Input),
  1143. new OracleParameter(":CreateUserID",OracleDbType.Int32,
  1144. userInfo.UserID,ParameterDirection.Input),
  1145. };
  1146. ReturnCount += oracleTrConn.ExecuteNonQuery(sqlAdd, paras);
  1147. }
  1148. return ReturnCount;
  1149. }
  1150. catch (Exception ex)
  1151. {
  1152. throw ex;
  1153. }
  1154. }
  1155. #endregion
  1156. #region 成型线类型
  1157. /// <summary>
  1158. /// 获取成型线类型
  1159. /// </summary>
  1160. /// <param name="userInfo">用户基本信息</param>
  1161. /// <returns>数据集</returns>
  1162. /// <remarks>
  1163. /// 庄天威 2014.09.04 新建
  1164. /// </remarks>
  1165. public static DataSet GetGMouldType(SUserInfo userInfo)
  1166. {
  1167. IDBConnection con = ClsDbFactory.CreateDBConnection(DataBaseType.ORACLE, DataManager.ConnectionString);
  1168. try
  1169. {
  1170. con.Open();
  1171. OracleParameter[] paras = new OracleParameter[]{
  1172. new OracleParameter("in_accountID",OracleDbType.Int32,
  1173. userInfo.AccountID,ParameterDirection.Input),
  1174. new OracleParameter("in_valueFlag",OracleDbType.Int32,
  1175. 1,ParameterDirection.Input),
  1176. new OracleParameter("out_result",OracleDbType.RefCursor,ParameterDirection.Output),
  1177. };
  1178. DataSet ds = con.ExecStoredProcedure("PRO_MST_GetMouldType", paras);
  1179. return ds;
  1180. }
  1181. catch (Exception ex)
  1182. {
  1183. throw ex;
  1184. }
  1185. finally
  1186. {
  1187. if (con.ConnState == ConnectionState.Open)
  1188. {
  1189. con.Close();
  1190. }
  1191. }
  1192. }
  1193. #endregion
  1194. #region 产品分级数据源
  1195. /// <summary>
  1196. /// 产品分级数据源
  1197. /// </summary>
  1198. /// <param name="type">1适用半成品2检验 2适用成品检验 3入窑前检验</param>
  1199. /// <param name="userInfo">用户基本信息</param>
  1200. /// <returns>DataSet</returns>
  1201. public static DataSet GetGoodsLevel(int type, SUserInfo userInfo)
  1202. {
  1203. IDBConnection con = ClsDbFactory.CreateDBConnection(DataBaseType.ORACLE, DataManager.ConnectionString);
  1204. try
  1205. {
  1206. con.Open();
  1207. string sqlString = "";
  1208. if (type == 1 || type == 3)
  1209. {
  1210. sqlString = "select GoodsLevelID as DefectFlagID,GoodsLevelName as DefectFlagName,GoodsLevelTypeID from TP_MST_GoodsLevel where IsSemiFinishedEx=1 and AccountID=:AccountID and ValueFlag=1 order by SFEDisplayNo";
  1211. }
  1212. else if (type == 2)
  1213. {
  1214. sqlString = "select GoodsLevelID as DefectFlagID,GoodsLevelName as DefectFlagName,GoodsLevelTypeID from TP_MST_GoodsLevel where IsFinishedEx=1 and AccountID=:AccountID and ValueFlag=1 order by FEDisplayNo";
  1215. }
  1216. OracleParameter[] paras = new OracleParameter[]{
  1217. new OracleParameter(":AccountID",userInfo.AccountID),
  1218. };
  1219. DataSet dsGoodsLevel = con.GetSqlResultToDs(sqlString, paras);
  1220. return dsGoodsLevel;
  1221. }
  1222. catch (Exception ex)
  1223. {
  1224. throw ex;
  1225. }
  1226. finally
  1227. {
  1228. if (con.ConnState == ConnectionState.Open)
  1229. {
  1230. con.Close();
  1231. }
  1232. }
  1233. }
  1234. #endregion
  1235. #region 审核状态
  1236. /// <summary>
  1237. /// 获取全部审核状态
  1238. /// </summary>
  1239. /// <returns>DataSet审核状态数据源</returns>
  1240. public static DataSet GetAuditStatus()
  1241. {
  1242. IDBConnection con = ClsDbFactory.CreateDBConnection(DataBaseType.ORACLE, DataManager.ConnectionString);
  1243. try
  1244. {
  1245. con.Open();
  1246. String strSql = "Select * from TP_SYS_AuditStatus Order by DisplayNo";
  1247. DataSet ds = con.GetSqlResultToDs(strSql, null);
  1248. return ds;
  1249. }
  1250. catch (Exception ex)
  1251. {
  1252. throw ex;
  1253. }
  1254. finally
  1255. {
  1256. if (con.ConnState == ConnectionState.Open)
  1257. {
  1258. con.Close();
  1259. }
  1260. }
  1261. }
  1262. #endregion
  1263. /// <summary>
  1264. /// 工序集合
  1265. /// </summary>
  1266. /// <param name="ProductionLineEntity">工序实体</param>
  1267. /// <param name="sUserInfo">用户<基本信息/param>
  1268. /// <returns>DataSet</returns>
  1269. /// <remarks>
  1270. /// 王鑫 2014.11.29 新建
  1271. /// </remarks>
  1272. public static DataSet GetProdureList(SearchProductionLineEntity productionLineEntity, SUserInfo sUserInfo)
  1273. {
  1274. IDBConnection con = ClsDbFactory.CreateDBConnection(DataBaseType.ORACLE, DataManager.ConnectionString);
  1275. try
  1276. {
  1277. con.Open();
  1278. OracleParameter[] paras = new OracleParameter[]{
  1279. new OracleParameter("in_procedureCode",OracleDbType.Varchar2,productionLineEntity.ProductionLineCode,ParameterDirection.Input),
  1280. new OracleParameter("in_procedureName",OracleDbType.Varchar2,productionLineEntity.ProductionLineName,ParameterDirection.Input),
  1281. new OracleParameter("in_procedureIDS",OracleDbType.Varchar2,productionLineEntity.ProcuteLineIDS,ParameterDirection.Input),
  1282. new OracleParameter("in_accountID",OracleDbType.Int32,sUserInfo.AccountID,ParameterDirection.Input),
  1283. new OracleParameter("out_result",OracleDbType.RefCursor, ParameterDirection.Output),
  1284. };
  1285. DataSet dsSearchReport = con.ExecStoredProcedure("PRO_PC_GetProcedureList", paras);
  1286. return dsSearchReport;
  1287. }
  1288. catch (Exception ex)
  1289. {
  1290. throw ex;
  1291. }
  1292. finally
  1293. {
  1294. if (con.ConnState == ConnectionState.Open)
  1295. {
  1296. con.Close();
  1297. }
  1298. }
  1299. }
  1300. /// <summary>
  1301. /// 获取全部工种计件方式
  1302. /// </summary>
  1303. /// <returns>DataSet工种计件方式集合</returns>
  1304. public static DataSet GetJobsPriceType()
  1305. {
  1306. IDBConnection con = ClsDbFactory.CreateDBConnection(DataBaseType.ORACLE, DataManager.ConnectionString);
  1307. try
  1308. {
  1309. con.Open();
  1310. String strSql = "Select * from TP_SYS_JobsPriceType Order by DisplayNo";
  1311. DataSet dsSearchReport = con.GetSqlResultToDs(strSql, null);
  1312. return dsSearchReport;
  1313. }
  1314. catch (Exception ex)
  1315. {
  1316. throw ex;
  1317. }
  1318. finally
  1319. {
  1320. if (con.ConnState == ConnectionState.Open)
  1321. {
  1322. con.Close();
  1323. }
  1324. }
  1325. }
  1326. }
  1327. }