F_PM_1107.cs 37 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911
  1. /*******************************************************************************
  2. * 类的信息:
  3. * 1.程序名称:F_PM_1107.cs
  4. * 2.功能描述:批量报废信息窗体
  5. * 编辑履历:
  6. * 作者 日期
  7. * 李士越 2024/05/29
  8. *******************************************************************************/
  9. using System;
  10. using System.Collections.Generic;
  11. using System.Data;
  12. using System.Windows.Forms;
  13. using Dongke.IBOSS.PRD.Basics.BaseResources;
  14. using Dongke.IBOSS.PRD.WCF.Proxys;
  15. using Dongke.IBOSS.PRD.WCF.Proxys.PMModuleService;
  16. using Dongke.IBOSS.PRD.Client.CommonModule;
  17. using Dongke.IBOSS.PRD.Basics.BaseControls;
  18. using Dongke.IBOSS.PRD.Basics.Library;
  19. using Dongke.IBOSS.PRD.WCF.DataModels;
  20. using Dongke.IBOSS.PRD.Client.Controls;
  21. namespace Dongke.IBOSS.PRD.Client.PMModule
  22. {
  23. /// <summary>
  24. /// 批量报废信息窗体
  25. /// </summary>
  26. public partial class F_PM_1107 : DKFormBase
  27. {
  28. #region 成员变量
  29. //窗体模式ID
  30. private Constant.FormMode _formType;
  31. //修改产品报损信息ID
  32. private string _barCode;
  33. //页面报损工序的数据源
  34. private List<ProductionDataEntity> _productionDataList = new List<ProductionDataEntity>();
  35. //该产品在产信息实体
  36. private InProductionEntity _isScrapProductEntity;
  37. //用户选择报损工序实体
  38. private ProductionDataEntity _scrapProductResponProcedure;
  39. //当前责任人集合
  40. private List<ScrapResponsibleEntity> _scrapResponsibleList = new List<ScrapResponsibleEntity>();
  41. //修改用废弃产品实体
  42. private ScrapProductEntity _updateEntity;
  43. //修改用废弃责任工序实体
  44. private ResponProcedureEntity _updateProcedureEntity;
  45. //修改用责任人集合
  46. private List<ScrapResponsibleEntity> _updateScrapResponsibleList;
  47. //有效条码标示
  48. private bool _yxBarCode = false;
  49. //产品分级类别ID
  50. private int _goodsLevelTypeID = Convert.ToInt32(Constant.GoodsLevelType.Damage);
  51. //产品分级ID
  52. private int _goodsLevelId;
  53. //报损信息ID
  54. private int _editSPId;
  55. //是否允许审批
  56. private bool _isScrap = false;
  57. //未干补
  58. int SpecialRepairFlag = 0;
  59. //完成工序
  60. int? _CompleteProcdureID = null;
  61. //完成工序编码
  62. string _CompleteProcdureCode = "";
  63. //完成工序名称
  64. string _CompleteProcdureName = "";
  65. // 商标ID
  66. int? _LogoID = null;
  67. //可以报损的产品条码集合
  68. List<string> ReportingLosses = new List<string>();
  69. #endregion
  70. #region 构造函数
  71. /// <summary>
  72. /// 窗体构造
  73. /// </summary>
  74. public F_PM_1107(Constant.FormMode formType, string BarCode, int EditSPId, bool isScrap)
  75. {
  76. InitializeComponent();
  77. this._formType = formType;
  78. this._barCode = BarCode;
  79. this._editSPId = EditSPId;
  80. this._isScrap = isScrap;
  81. //if (formType == Constant.FormMode.Add)
  82. //{
  83. this.Text = "批量报损";
  84. //}
  85. //else
  86. //{
  87. // this.Text = FormTitles.F_PM_1107_EDIT;
  88. //}
  89. //this.btnViewApprover.Text = ButtonText.BTN_VIEWAPPROVER;
  90. this.btnSave.Text = ButtonText.BTN_SAVE;
  91. this.btnCancel.Text = ButtonText.BTN_CLOSE;
  92. }
  93. #endregion
  94. #region 事件
  95. /// <summary>
  96. /// 窗体加载
  97. /// </summary>
  98. /// <param name="sender"></param>
  99. /// <param name="e"></param>
  100. private void F_PM_1107_Load(object sender, EventArgs e)
  101. {
  102. try
  103. {
  104. //获取当前产品分级ID
  105. this._goodsLevelId = Convert.ToInt32(SystemModuleProxy.Service.GetGoodsLevelDataById(_goodsLevelTypeID, null)
  106. .Tables[0].Rows[0]["GoodsLevelID"]);
  107. DataTable dt = new DataTable();
  108. dt.Columns.Add("DictionaryID", typeof(int));
  109. dt.Columns.Add("DictionaryValue", typeof(string));
  110. DataRow drbydt = dt.NewRow();
  111. drbydt["DictionaryID"] = 119;
  112. drbydt["DictionaryValue"] = "盘点报损";
  113. dt.Rows.Add(drbydt);
  114. this.cmbRreason.DisplayMember = "DictionaryValue";
  115. this.cmbRreason.ValueMember = "DictionaryID";
  116. this.cmbRreason.DataSource = dt;
  117. //绑定损坯状态
  118. DataTable dtAuditStatus = new DataTable();
  119. dtAuditStatus.Columns.Add("AuditStatusID");
  120. dtAuditStatus.Columns.Add("AuditStatusValue");
  121. DataRow dr = dtAuditStatus.NewRow();
  122. dr = dtAuditStatus.NewRow();
  123. dr["AuditStatusID"] = 1;
  124. dr["AuditStatusValue"] = "损坯通过";
  125. dtAuditStatus.Rows.Add(dr);
  126. this.cmbAuditStatus.DisplayMember = "AuditStatusValue";
  127. this.cmbAuditStatus.ValueMember = "AuditStatusID";
  128. this.cmbAuditStatus.DataSource = dtAuditStatus;
  129. if (this._formType == Constant.FormMode.Edit)
  130. {
  131. BindEntity();
  132. }
  133. }
  134. catch (Exception ex)
  135. {
  136. // 对异常进行共通处理
  137. ExceptionManager.HandleEventException(this.ToString(),
  138. System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
  139. }
  140. }
  141. /// <summary>
  142. /// 提交操作
  143. /// </summary>
  144. /// <param name="sender"></param>
  145. /// <param name="e"></param>
  146. private void btnSave_Click(object sender, EventArgs e)
  147. {
  148. try
  149. {
  150. if (this.txtBarCode.Text == string.Empty)
  151. {
  152. this.txtBarCode.Focus();
  153. return;
  154. }
  155. //模拟回车
  156. KeyPressEventArgs args = new KeyPressEventArgs('\r');
  157. //条码校验防止重复报损
  158. txtBarCode_KeyPress(sender, args);
  159. this.txtRemarks.Focus();//把光标移开,由于删除工号后,值未变
  160. if (ReportingLosses.Count == 0)
  161. {
  162. MessageBox.Show("未有可报损条码",
  163. this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
  164. }
  165. this.txtRemarks.Focus();//把光标移开,由于删除工号后,值未变
  166. DataTable dt = new DataTable();
  167. //备注
  168. dt.Columns.Add("notes");
  169. //产品编码
  170. dt.Columns.Add("ProductCode");
  171. foreach (var item in ReportingLosses) {
  172. DataRow dr = dt.NewRow();
  173. dr["notes"] = save(item);
  174. dr["ProductCode"] = item;
  175. dt.Rows.Add(dr);
  176. }
  177. this.detailsView.DataSource = dt;
  178. }
  179. catch (Exception ex)
  180. {
  181. // 对异常进行共通处理
  182. ExceptionManager.HandleEventException(this.ToString(),
  183. System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
  184. }
  185. }
  186. /// <summary>
  187. /// 保存方法
  188. /// </summary>
  189. /// <param name="barcode"></param>
  190. /// <returns></returns>
  191. public string save(string barcode) {
  192. string result = "";
  193. try
  194. {
  195. if (this.txtBarCode.Text == string.Empty)
  196. {
  197. this.txtBarCode.Focus();
  198. return "";
  199. }
  200. ServiceResultEntity sreByid = DoAsync<ServiceResultEntity>(() =>
  201. {
  202. ClientRequestEntity cre = new ClientRequestEntity();
  203. cre.NameSpace = "F_PM_1107";
  204. cre.Name = "ReadAllDataByProductCode";
  205. cre.Properties["BARCODE"] = barcode;
  206. return SystemModuleProxy.Service.DoRequest(cre);
  207. });
  208. if (sreByid.Data.Tables[0].Rows[0]["USERID"].ToString()==string.Empty || sreByid.Data.Tables[0].Rows[0]["USERID"].ToString()=="" || sreByid.Data.Tables[0].Rows[0]["USERID"].ToString()==null) {
  209. return "信息不全,此产品不做任何处理";
  210. }
  211. ServiceResultEntity sreByuserid = DoAsync<ServiceResultEntity>(() =>
  212. {
  213. ClientRequestEntity cre = new ClientRequestEntity();
  214. cre.NameSpace = "F_PM_1107";
  215. cre.Name = "ReadStaffInformation";
  216. cre.Properties["USERID"] = sreByid.Data.Tables[0].Rows[0]["USERID"].ToString();
  217. return SystemModuleProxy.Service.DoRequest(cre);
  218. });
  219. this.txtRemarks.Focus();//把光标移开,由于删除工号后,值未变
  220. if (this._formType == Constant.FormMode.Add)
  221. {
  222. //获取责任人集合
  223. List<ScrapResponsibleEntity> addResponsibleList = new List<ScrapResponsibleEntity>()
  224. {
  225. new ScrapResponsibleEntity() {
  226. BarCode = sreByid.Data.Tables[0].Rows[0]["BarCode"].ToString(),
  227. StaffID = Convert.ToInt32(sreByuserid.Data.Tables[0].Rows[0]["STAFFID"].ToString()),
  228. StaffStatus = Convert.ToInt32(sreByuserid.Data.Tables[0].Rows[0]["Staffstatus"].ToString()),
  229. UserID = Convert.ToInt32(sreByuserid.Data.Tables[0].Rows[0]["USERID"].ToString()),
  230. UserCode = sreByuserid.Data.Tables[0].Rows[0]["USERCODE"].ToString() + "",
  231. UJobsID = Convert.ToInt32(sreByuserid.Data.Tables[0].Rows[0]["UJobsId"].ToString()),
  232. SJobsID = Convert.ToInt32(sreByuserid.Data.Tables[0].Rows[0]["JOBS"].ToString()),
  233. }
  234. };
  235. //如果选择了责任工序就一定要选择责任人
  236. //if (cbResponProcedure.Text != string.Empty && addResponsibleList.Count == Constant.INT_IS_ZERO)
  237. if (addResponsibleList.Count == Constant.INT_IS_ZERO)
  238. {
  239. //MessageBox.Show("请选择责任人!",
  240. // this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1);
  241. return "请选择责任人!";
  242. }
  243. //首先判断责任类型
  244. int thisResponType = 0;
  245. if (sreByid.Data.Tables[0].Rows.Count == 0 && addResponsibleList.Count == Constant.INT_IS_ZERO)
  246. {
  247. thisResponType = 1;
  248. }
  249. else if (sreByid.Data.Tables[0].Rows.Count > 0 && addResponsibleList.Count != Constant.INT_IS_ZERO)
  250. {
  251. thisResponType = 3;
  252. }
  253. else if (sreByid.Data.Tables[0].Rows.Count == 0 && addResponsibleList.Count != Constant.INT_IS_ZERO)
  254. {
  255. thisResponType = 2;
  256. }
  257. if (thisResponType == Constant.INT_IS_ZERO)
  258. {
  259. //MessageBox.Show("责任类别不正确!",
  260. // this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1);
  261. return "责任类别不正确!";
  262. }
  263. //新建报损产品实体
  264. ScrapProductEntity addScrapProduct = new ScrapProductEntity();
  265. addScrapProduct.BarCode = sreByid.Data.Tables[0].Rows[0]["BarCode"].ToString();
  266. addScrapProduct.ProductionLineID = int.Parse(sreByid.Data.Tables[0].Rows[0]["PRODUCTIONLINEID"].ToString());
  267. addScrapProduct.ProductionLineCode = sreByid.Data.Tables[0].Rows[0]["PRODUCTIONLINECODE"].ToString();
  268. addScrapProduct.ProductionLineName = sreByid.Data.Tables[0].Rows[0]["PRODUCTIONLINENAME"].ToString();
  269. addScrapProduct.GoodsID = int.Parse(sreByid.Data.Tables[0].Rows[0]["GOODSID"].ToString());
  270. addScrapProduct.GoodsCode = sreByid.Data.Tables[0].Rows[0]["GOODSCODE"].ToString();
  271. addScrapProduct.GoodsName = sreByid.Data.Tables[0].Rows[0]["GOODSNAME"].ToString();
  272. addScrapProduct.GroutingDailyID = int.Parse(sreByid.Data.Tables[0].Rows[0]["GROUTINGDAILYID"].ToString());
  273. addScrapProduct.GroutingDailyDetailID = int.Parse(sreByid.Data.Tables[0].Rows[0]["GROUTINGDAILYDETAILID"].ToString());
  274. addScrapProduct.GroutingDate = Convert.ToDateTime(sreByid.Data.Tables[0].Rows[0]["GROUTINGDATE"].ToString());
  275. addScrapProduct.GroutingLineID = int.Parse(sreByid.Data.Tables[0].Rows[0]["GROUTINGLINEID"].ToString());
  276. addScrapProduct.GroutingLineCode = sreByid.Data.Tables[0].Rows[0]["GROUTINGLINECODE"].ToString();
  277. addScrapProduct.GroutingLineName = sreByid.Data.Tables[0].Rows[0]["GROUTINGLINENAME"].ToString();
  278. addScrapProduct.GMouldTypeID = int.Parse(sreByid.Data.Tables[0].Rows[0]["GMOULDTYPEID"].ToString());
  279. addScrapProduct.GroutingLineDetailID = int.Parse(sreByid.Data.Tables[0].Rows[0]["GROUTINGLINEDETAILID"].ToString());
  280. addScrapProduct.GroutingMouldCode = sreByid.Data.Tables[0].Rows[0]["GROUTINGMOULDCODE"].ToString();
  281. addScrapProduct.MouldCode = sreByid.Data.Tables[0].Rows[0]["MOULDCODE"].ToString();
  282. addScrapProduct.GoodsLevelTypeID = _goodsLevelTypeID;
  283. addScrapProduct.GoodsLevelID = _goodsLevelId;
  284. addScrapProduct.ScrapDate = DateTime.Now;
  285. addScrapProduct.Rreason = "盘点报损";
  286. addScrapProduct.ResponUserID = Convert.ToInt32(sreByuserid.Data.Tables[0].Rows[0]["USERID"].ToString());
  287. addScrapProduct.ResponUserCode = sreByuserid.Data.Tables[0].Rows[0]["USERCODE"].ToString() + "";
  288. addScrapProduct.ResponUserName = sreByuserid.Data.Tables[0].Rows[0]["USERNAME"].ToString();
  289. addScrapProduct.Remarks = this.txtRemarks.Text;
  290. addScrapProduct.AuditStatus = 0;
  291. addScrapProduct.SettlementFlag = 0;
  292. addScrapProduct.ResponType = thisResponType;
  293. addScrapProduct.GroutingUserID = Convert.ToInt32(sreByid.Data.Tables[0].Rows[0]["GROUTINGUSERID"].ToString());
  294. addScrapProduct.GroutingUserCode = sreByid.Data.Tables[0].Rows[0]["GROUTINGUSERCODE"].ToString();
  295. addScrapProduct.GroutingNum = decimal.Parse(sreByid.Data.Tables[0].Rows[0]["GROUTINGNUM"].ToString());
  296. addScrapProduct.IsPublicBody = Convert.ToInt32(sreByid.Data.Tables[0].Rows[0]["ISPUBLICBODY"].ToString());
  297. addScrapProduct.IsReFire = Convert.ToInt32(sreByid.Data.Tables[0].Rows[0]["ISREFIRE"].ToString());
  298. addScrapProduct.AuditStatus = Convert.ToInt32(cmbAuditStatus.SelectedValue);
  299. addScrapProduct.SpecialRepairflag = int.Parse(sreByid.Data.Tables[0].Rows[0]["SPECIALREPAIRFLAG"].ToString());
  300. addScrapProduct.LogoID = int.Parse(sreByid.Data.Tables[0].Rows[0]["LogoID"].ToString());
  301. if (sreByid.Data.Tables[0].Rows[0]["PROCEDUREID"].ToString() != null)
  302. {
  303. addScrapProduct.ProcedureID = int.Parse(sreByid.Data.Tables[0].Rows[0]["PROCEDUREID"].ToString());
  304. //addScrapProduct.ProcedureName = this.txtCompleteProcdure.Text;
  305. addScrapProduct.ProcedureName = sreByid.Data.Tables[0].Rows[0]["ProcedureName"].ToString();
  306. addScrapProduct.ProcedureCode = sreByid.Data.Tables[0].Rows[0]["ProcedureCode"].ToString();
  307. }
  308. ResponProcedureEntity addRProcedure = new ResponProcedureEntity();
  309. //如果存在责任工序的话,也要添加责任工序
  310. if (thisResponType == Constant.INT_IS_THREE)
  311. {
  312. addRProcedure.BarCode = sreByid.Data.Tables[0].Rows[0]["BarCode"].ToString();
  313. addRProcedure.ProductionDataID = int.Parse(sreByid.Data.Tables[0].Rows[0]["PRODUCTIONDATAID"].ToString());
  314. addRProcedure.ProductionLineID = int.Parse(sreByid.Data.Tables[0].Rows[0]["PRODUCTIONLINEID"].ToString());
  315. addRProcedure.ProductionLineCode = sreByid.Data.Tables[0].Rows[0]["PRODUCTIONLINECODE"].ToString();
  316. addRProcedure.ProductionLineName = sreByid.Data.Tables[0].Rows[0]["PRODUCTIONLINENAME"].ToString();
  317. addRProcedure.ProcedureID = int.Parse(sreByid.Data.Tables[0].Rows[0]["PROCEDUREID"].ToString());
  318. addRProcedure.ProcedureCode = sreByid.Data.Tables[0].Rows[0]["ProcedureCode"].ToString();
  319. addRProcedure.ProcedureName = sreByid.Data.Tables[0].Rows[0]["ProcedureName"].ToString();
  320. addRProcedure.UserID = Convert.ToInt32(sreByuserid.Data.Tables[0].Rows[0]["USERID"].ToString());
  321. addRProcedure.UserCode = sreByuserid.Data.Tables[0].Rows[0]["USERCODE"].ToString() + "";
  322. addRProcedure.UserName = sreByuserid.Data.Tables[0].Rows[0]["USERNAME"].ToString();
  323. addRProcedure.Remarks = "";
  324. }
  325. int addReturn = (int)DoAsync(new BaseAsyncMethod(() =>
  326. {
  327. return PMModuleProxy.Service.AddScrapProduct(addScrapProduct, addRProcedure, addResponsibleList);
  328. }));
  329. if (addReturn > Constant.INT_IS_ZERO)
  330. {
  331. //成功
  332. //MessageBox.Show(string.Format(Messages.MSG_CMN_I001, "废弃产品", "保存"),
  333. // this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
  334. //this.DialogResult = DialogResult.OK;
  335. return string.Format(Messages.MSG_CMN_I001, "废弃产品", "保存");
  336. }
  337. else if (addReturn == Constant.RETURN_IS_DATACHANGED)
  338. {
  339. //成功
  340. //MessageBox.Show(string.Format(Messages.MSG_CMN_W007, "操作的数据已经发生了变化"),
  341. // this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
  342. //this.DialogResult = DialogResult.OK;
  343. return string.Format(Messages.MSG_CMN_W007, "操作的数据已经发生了变化");
  344. }
  345. else
  346. {
  347. //失败
  348. //MessageBox.Show(string.Format(Messages.MSG_CMN_W001, "废弃产品", "保存"),
  349. // this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
  350. return string.Format(Messages.MSG_CMN_W001, "废弃产品", "保存");
  351. }
  352. }
  353. }
  354. catch (Exception ex)
  355. {
  356. // 对异常进行共通处理
  357. ExceptionManager.HandleEventException(this.ToString(),
  358. System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
  359. }
  360. return result;
  361. }
  362. /// <summary>
  363. /// 窗体关闭
  364. /// </summary>
  365. /// <param name="sender"></param>
  366. /// <param name="e"></param>
  367. private void btnCancel_Click(object sender, EventArgs e)
  368. {
  369. this.Close();
  370. }
  371. /// <summary>
  372. /// 按下回车后调用产品条码检验
  373. /// </summary>
  374. /// <param name="sender"></param>
  375. /// <param name="e"></param>
  376. private void txtBarCode_KeyPress(object sender, KeyPressEventArgs e)
  377. {
  378. try
  379. {
  380. //清除所有产品条码
  381. ReportingLosses.Clear();
  382. if ((int)e.KeyChar == 13 && (this.txtBarCode.Text != "" && this.txtBarCode.Text != string.Empty && this.txtBarCode.Text != null)) // 按了回车键
  383. {
  384. var dt = new DataTable();
  385. //备注
  386. dt.Columns.Add("notes");
  387. //产品编码
  388. dt.Columns.Add("ProductCode");
  389. var sss = SplitLong11(this.txtBarCode.Text);
  390. foreach (var item in sss)
  391. {
  392. var pubg = ReadAllDataByProductCode(item);
  393. DataRow dr = dt.NewRow();
  394. dr["notes"] = pubg ;
  395. dr["ProductCode"] = item;
  396. dt.Rows.Add(dr);
  397. if (pubg =="没有问题") { ReportingLosses.Add(item); }
  398. }
  399. this.dgvResponsible.DataSource = dt;
  400. }
  401. }
  402. catch (Exception ex)
  403. {
  404. // 对异常进行共通处理
  405. ExceptionManager.HandleEventException(this.ToString(),
  406. System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
  407. }
  408. }
  409. /// <summary>
  410. /// 字符串按11位分割
  411. /// </summary>
  412. /// <param name="item"></param>
  413. /// <returns></returns>
  414. public List<string> SplitLong11(string item) {
  415. List<string> result = new List<string>();
  416. // 检查字符串长度是否大于或等于分组大小
  417. if (item.Length >= 11)
  418. {
  419. for (int i = 0; i < item.Length; i += 11)
  420. {
  421. // 截取当前分组,注意不要超出字符串长度
  422. int length = Math.Min(11, this.txtBarCode.Text.Length - i);
  423. string chunk = this.txtBarCode.Text.Substring(i, length);
  424. result.Add(chunk);
  425. }
  426. }
  427. return result;
  428. }
  429. #endregion
  430. /// <summary>
  431. /// 产品条码检验
  432. /// </summary>
  433. /// <param name="item"></param>
  434. /// <returns></returns>
  435. private string ReadAllDataByProductCode(string item)
  436. {
  437. string notes = "没有问题";
  438. try
  439. {
  440. string doRuselt = (string)DoAsync(new BaseAsyncMethod(() =>
  441. {
  442. return PMModuleProxy.Service.ScrapProductChack(item);
  443. }));
  444. string[] doRuselts = doRuselt.Split(':');
  445. int isHave = Convert.ToInt32(doRuselts[0]);
  446. if (isHave == 2)
  447. {
  448. return notes = "不是在产产品不能报损!";
  449. //MessageBox.Show("产品编码为" + item + " 不是在产产品不能报损!",
  450. // this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1);
  451. //this.txtBarCode.Text = "";
  452. //this.txtBarCode.Focus();
  453. //Product = false;
  454. }
  455. if (isHave == 3)
  456. {
  457. return notes = "当前工号没有此产品所在工序"+ doRuselts[1] + "的操作权限,不能报损!";
  458. //MessageBox.Show(string.Format("产品编码为" + item + " 当前工号没有此产品所在工序【{0}】的操作权限,不能报损!", doRuselts[1]),
  459. // this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1);
  460. //this.txtBarCode.Text = "";
  461. //this.txtBarCode.Focus();
  462. //Product = false;
  463. }
  464. if (isHave == 4)
  465. {
  466. return notes = doRuselts[1];
  467. // MessageBox.Show(doRuselts[1],
  468. // this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1);
  469. //this.txtBarCode.Text = "";
  470. //this.txtBarCode.Focus();
  471. //Product = false;
  472. }
  473. if (isHave == Constant.INT_IS_ZERO)
  474. {
  475. return notes = "已经存在报损记录!";
  476. // MessageBox.Show("产品编码为" + item + " 已经存在报损记录!",
  477. // this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1);
  478. //this.txtBarCode.Text = "";
  479. //this.txtBarCode.Focus();
  480. //Product = false;
  481. }
  482. DataSet dsReturn = (DataSet)DoAsync(new BaseAsyncMethod(() =>
  483. {
  484. return PMModuleProxy.Service.GetInProductionAndProductionData(item);
  485. }));
  486. if (dsReturn != null)
  487. {
  488. if (dsReturn.Tables.Count == Constant.INT_IS_TWO)
  489. {
  490. if (dsReturn.Tables[0].Rows.Count == Constant.INT_IS_ZERO) //在产表中没有数据
  491. {
  492. //目前不在生产线上也只报损 2015/07/14 modify wangx
  493. DataSet dsDailyDetail = (DataSet)DoAsync(new BaseAsyncMethod(() =>
  494. {
  495. return PMModuleProxy.Service.GetBarCodeInGroutingDailyDetail(item);
  496. }));
  497. if (dsDailyDetail != null && dsDailyDetail.Tables[0].Rows.Count == 0)
  498. {
  499. return notes = "条码无效,无法报损!";
  500. //MessageBox.Show("产品编码为" + item + " 条码无效,无法报损!",
  501. // this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1);
  502. //this.txtBarCode.Text = "";
  503. //this.txtBarCode.Focus();
  504. //Product = false;
  505. }
  506. return notes = "不是在产产品不能报损!";
  507. // 2015/07/14 modify wangx end
  508. ////产品不在生产线上
  509. //MessageBox.Show("产品编码为" + item + " 不是在产产品不能报损!",
  510. // this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1);
  511. //this.txtBarCode.Text = "";
  512. //this.txtBarCode.Focus();
  513. //////判断条码是否有效
  514. //Product = false;
  515. }
  516. //获取产品情况以及经过工序情况
  517. DataTable dtInProduction = dsReturn.Tables[0];
  518. //2015-05-26 begin modify by wangx
  519. if (dtInProduction != null && dtInProduction.Rows.Count > 0)
  520. {
  521. if (dtInProduction.Rows[0]["endmode"].ToString() == "2")//代表已经产成品
  522. {
  523. return notes = "已经生产完成,无法报损!";
  524. //MessageBox.Show("产品编码为" + item + " 已经生产完成,无法报损!",
  525. // this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1);
  526. //this.txtBarCode.Text = "";
  527. //this.txtBarCode.Focus();
  528. //Product = false;
  529. }
  530. if (dtInProduction.Rows[0]["IsReworkFlag"].ToString() == "1")//代表已经返工
  531. {
  532. return notes = "已经是返工状态,无法报损!";
  533. //MessageBox.Show("产品编码为" + item + " 已经是返工状态,无法报损!",
  534. // this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1);
  535. //this.txtBarCode.Text = "";
  536. //this.txtBarCode.Focus();
  537. //Product = false;
  538. }
  539. }
  540. //2015-05-26 end
  541. //获取节点类型
  542. //如果存在该类型的字段的话,判断一下
  543. // string a = dtInProduction.Columns[dtInProduction.Columns.Count - 1].ColumnName;
  544. foreach (DataColumn dcFor in dtInProduction.Columns)
  545. {
  546. if (dcFor.ColumnName.ToLower() == "proceduremodeltypeid")
  547. {
  548. int modelType = Convert.ToInt32(dtInProduction.Rows[0]["ProcedureModelTypeID"]);
  549. // 装车,入窑,出窑,窑车补件不能报损
  550. if (modelType == Constant.INT_IS_ONE || modelType == Constant.INT_IS_TWO || modelType == Constant.INT_IS_THREE || modelType == Constant.INT_IS_SIX)
  551. {
  552. return notes = "处于无法报损的特殊工序中!";
  553. //某些特殊工序不可报损
  554. //MessageBox.Show("产品编码为" + item + " 处于无法报损的特殊工序中!",
  555. // this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1);
  556. //this.txtBarCode.Text = "";
  557. //this.txtBarCode.Focus();
  558. //Product = false;
  559. }
  560. }
  561. }
  562. List<InProductionEntity> inProductionList = DataConvert.TableConvertToObject<InProductionEntity>(dtInProduction);
  563. if (inProductionList.Count != Constant.INT_IS_ZERO)
  564. {
  565. this._isScrapProductEntity = inProductionList[0];
  566. }
  567. else
  568. {
  569. if (this._updateEntity == null)
  570. {
  571. return null;
  572. }
  573. if (this._updateEntity.GoodsLevelTypeID != this._goodsLevelTypeID)
  574. {
  575. return null;
  576. }
  577. //失败,条码不存在数据或无法转换
  578. MessageBox.Show(Messages.MSG_PM_W007,
  579. this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1);
  580. return null;
  581. }
  582. }
  583. else
  584. {
  585. if (this._updateEntity == null)
  586. {
  587. return null;
  588. }
  589. if (this._updateEntity.GoodsLevelTypeID != this._goodsLevelTypeID)
  590. {
  591. return null;
  592. }
  593. //失败
  594. MessageBox.Show(Messages.MSG_PM_W007,
  595. this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1);
  596. }
  597. }
  598. }
  599. catch (Exception ex)
  600. {
  601. // 对异常进行共通处理
  602. ExceptionManager.HandleEventException(this.ToString(),
  603. System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
  604. }
  605. return notes;
  606. }
  607. #region 私有方法
  608. /// <summary>
  609. /// 加载数据
  610. /// </summary>
  611. private void BindEntity()
  612. {
  613. try
  614. {
  615. //条码控件不可用
  616. this.txtBarCode.Enabled = false;
  617. this._updateEntity = new ScrapProductEntity();
  618. this._updateEntity.BarCode = _barCode;
  619. this._updateEntity.ScrapProductID = _editSPId;
  620. //绑定生产工序集合
  621. DataSet dsReturn = (DataSet)DoAsync(new BaseAsyncMethod(() =>
  622. {
  623. return PMModuleProxy.Service.GetInProductionAndProductionData(_barCode);
  624. }));
  625. if (dsReturn != null)
  626. {
  627. if (dsReturn.Tables.Count == Constant.INT_IS_TWO)
  628. {
  629. //获取产品情况以及经过工序情况
  630. DataTable dtInProduction = dsReturn.Tables[0];
  631. DataTable dtProductionData = dsReturn.Tables[1];
  632. //foreach (DataRow drFor in dtInProduction.Rows)
  633. //{
  634. // this.txtProductionLineName.Text = drFor["ProductionLineName"].ToString();
  635. // this.txtGoodsCode.Text = drFor["GoodsCode"].ToString();
  636. // this.txtGroutingLine.Text = drFor["GroutingLineCode"].ToString();
  637. // this.txtMouldCode.Text = drFor["GroutingMouldCode"].ToString();
  638. // this.txtGroutingUser.Text = drFor["GroutingUserCode"].ToString();
  639. //}
  640. //this.cbResponProcedure.DataSource = dtProductionData;
  641. //this.cbResponProcedure.DisplayMember = "ProcedureName";
  642. //this.cbResponProcedure.ValueMember = "ProcedureID";
  643. this._productionDataList = DataTableToListByProductionData(dtProductionData);
  644. if (this._productionDataList.Count != Constant.INT_IS_ZERO)
  645. {
  646. this._scrapProductResponProcedure = this._productionDataList[0];
  647. }
  648. }
  649. }
  650. //获取报废产品实体
  651. DataSet dsScrap = (DataSet)DoAsync(new BaseAsyncMethod(() =>
  652. {
  653. return PMModuleProxy.Service.GetScrapProduct(this._updateEntity);
  654. }));
  655. if (dsScrap != null)
  656. {
  657. if (dsScrap.Tables.Count != Constant.INT_IS_ZERO)
  658. {
  659. DataRow drScrap = dsScrap.Tables[0].Rows[0];
  660. this._updateEntity.BarCode = drScrap["BarCode"].ToString();
  661. if (drScrap["ProductionLineID"].ToString() != "")
  662. {
  663. this._updateEntity.ProductionLineID = Convert.ToInt32(drScrap["ProductionLineID"]);
  664. this._updateEntity.ProductionLineCode = drScrap["ProductionLineCode"].ToString();
  665. this._updateEntity.ProductionLineName = drScrap["ProductionLineName"].ToString();
  666. //this.txtGoodsCode.Text = drScrap["GoodsCode"].ToString();
  667. //this.txtGroutingLine.Text = drScrap["GroutingLineCode"].ToString();
  668. //this.txtMouldCode.Text = drScrap["GroutingMouldCode"].ToString();
  669. //this.txtGroutingUser.Text = drScrap["GroutingUserCode"].ToString();
  670. this._CompleteProcdureID = Convert.ToInt32(drScrap["ProcedureID"]);
  671. this._CompleteProcdureCode = drScrap["ProcedureCode"].ToString();
  672. //this.txtCompleteProcdure.Text = drScrap["ProcedureName"].ToString();
  673. }
  674. //else //等于空时,取模具信息
  675. //{
  676. // this.txtGoodsCode.Text = drScrap["GoodsCode"].ToString();
  677. // this.txtGroutingLine.Text = drScrap["GroutingLineCode"].ToString();
  678. // this.txtMouldCode.Text = drScrap["GroutingMouldCode"].ToString();
  679. // this.txtGroutingUser.Text = drScrap["GroutingUserCode"].ToString();
  680. //}
  681. if (drScrap["logoid"].ToString() != "")
  682. {
  683. this._LogoID = Convert.ToInt32(drScrap["logoid"]);
  684. }
  685. this._updateEntity.GoodsID = Convert.ToInt32(drScrap["GoodsID"]);
  686. this._updateEntity.GoodsCode = drScrap["GoodsCode"].ToString();
  687. this._updateEntity.GoodsName = drScrap["GoodsName"].ToString();
  688. this._updateEntity.GroutingDailyID = Convert.ToInt32(drScrap["GroutingDailyID"]);
  689. this._updateEntity.GroutingDailyDetailID = Convert.ToInt32(drScrap["GroutingDailyDetailID"]);
  690. this._updateEntity.GroutingDate = Convert.ToDateTime(drScrap["GroutingDate"]);
  691. this._updateEntity.GroutingLineID = Convert.ToInt32(drScrap["GroutingLineID"]);
  692. this._updateEntity.GroutingLineCode = drScrap["GroutingLineCode"].ToString();
  693. this._updateEntity.GroutingLineName = drScrap["GroutingLineName"].ToString();
  694. this._updateEntity.GMouldTypeID = Convert.ToInt32(drScrap["GMouldTypeID"]);
  695. this._updateEntity.GroutingLineDetailID = Convert.ToInt32(drScrap["GroutingLineDetailID"]);
  696. this._updateEntity.GroutingMouldCode = drScrap["GroutingMouldCode"].ToString();
  697. this._updateEntity.MouldCode = drScrap["MouldCode"].ToString();
  698. this._updateEntity.GoodsLevelTypeID = Convert.ToInt32(drScrap["GoodsLevelTypeID"]);
  699. this._updateEntity.GoodsLevelID = Convert.ToInt32(drScrap["GoodsLevelID"]);
  700. this._updateEntity.ScrapDate = Convert.ToDateTime(drScrap["ScrapDate"]);
  701. this._updateEntity.Rreason = drScrap["Rreason"].ToString();
  702. this._updateEntity.Remarks = drScrap["Remarks"].ToString();
  703. this._updateEntity.AuditStatus = Convert.ToInt32(drScrap["AuditStatus"]);
  704. this._updateEntity.ResponType = Convert.ToInt32(drScrap["ResponType"]);
  705. this._updateEntity.SpecialRepairflag = Convert.ToInt32(drScrap["SpecialRepairflag"]);
  706. this.SpecialRepairFlag = Convert.ToInt32(drScrap["SpecialRepairflag"]);
  707. if (drScrap["Auditor"] != DBNull.Value)
  708. {
  709. this._updateEntity.Auditor = Convert.ToInt32(drScrap["Auditor"]);
  710. }
  711. if (drScrap["AuditDate"] != DBNull.Value)
  712. {
  713. this._updateEntity.AuditlDate = Convert.ToDateTime(drScrap["AuditDate"]);
  714. }
  715. this._updateEntity.SettlementFlag = Convert.ToInt32(drScrap["SettlementFlag"]);
  716. if (drScrap["ResponProcedureID"] != DBNull.Value) //ProcedureID--改到ResponProcedureID
  717. {
  718. this._updateEntity.ResponProcedureID = Convert.ToInt32(drScrap["ResponProcedureID"]);
  719. }
  720. if (drScrap["UserID"] != DBNull.Value)
  721. {
  722. this._updateEntity.ResponUserID = Convert.ToInt32(drScrap["UserID"]);
  723. }
  724. if (drScrap["UserCode"] != DBNull.Value)
  725. {
  726. this._updateEntity.ResponUserCode = drScrap["UserCode"].ToString();
  727. }
  728. if (drScrap["UserName"] != DBNull.Value)
  729. {
  730. this._updateEntity.ResponUserName = drScrap["UserName"].ToString();
  731. }
  732. if (drScrap["ScrapFine"] != DBNull.Value)
  733. {
  734. this._updateEntity.ScrapFine = Convert.ToDecimal(drScrap["ScrapFine"]);
  735. }
  736. this.cmbAuditStatus.SelectedValue = this._updateEntity.AuditStatus;
  737. if (this._updateEntity.GoodsLevelTypeID != this._goodsLevelTypeID ||
  738. (this._updateEntity.AuditStatus == Constant.INT_IS_ONE || this._updateEntity.AuditStatus == Constant.INT_IS_TWO)) //除关闭窗体外所有功能不可用
  739. {
  740. this.txtBarCode.Enabled = false;
  741. //this.txtGoodsCode.Enabled = false;
  742. //this.txtProductionLineName.Enabled = false;
  743. //this.cbResponProcedure.Enabled = false;
  744. // 报损日期不能修改
  745. //this.txtScrapDate.Enabled = false;
  746. this.cmbRreason.Enabled = false;
  747. this.txtRemarks.Enabled = false;
  748. //this.scbUser.Enabled = false;
  749. this.dgvResponsible.Enabled = false;
  750. this.btnSave.Enabled = false;
  751. //this.btnViewApprover.Visible = false;
  752. this.cmbAuditStatus.Enabled = false;
  753. }
  754. }
  755. }
  756. else
  757. {
  758. this.Close();
  759. return;
  760. }
  761. //获取报废责任工序实体
  762. if (Convert.ToInt32(_updateEntity.ResponType) == Constant.INT_IS_THREE)
  763. {
  764. DataSet dsResPro = (DataSet)DoAsync(new BaseAsyncMethod(() =>
  765. {
  766. return PMModuleProxy.Service.GetResponProcedureBySPId(Convert.ToInt32(_updateEntity.ScrapProductID));
  767. }));
  768. this._updateProcedureEntity = new ResponProcedureEntity();
  769. if (dsResPro != null && dsResPro.Tables[0].Rows.Count > 0) //如果原来存在责任工序实体
  770. {
  771. DataRow drResPro = dsResPro.Tables[0].Rows[0];
  772. this._updateProcedureEntity.ResponProcedureID = Convert.ToInt32(drResPro["ResponProcedureID"]);
  773. //this.scbUser.Enabled = false;
  774. }
  775. this._updateProcedureEntity.BarCode = _updateEntity.BarCode;
  776. }
  777. //获取报废责任人实体集合
  778. if (Convert.ToInt32(_updateEntity.ResponType) != Constant.INT_IS_ONE)
  779. {
  780. this._updateScrapResponsibleList = new List<ScrapResponsibleEntity>();
  781. DataSet dsResponsible = (DataSet)DoAsync(new BaseAsyncMethod(() =>
  782. {
  783. return PMModuleProxy.Service.GetScrapResponsibleBySPId(Convert.ToInt32(_updateEntity.ScrapProductID));
  784. }));
  785. DataTableToListByScrapResponsible(dsResponsible);
  786. }
  787. //控件赋值
  788. this.txtBarCode.Text = _updateEntity.BarCode;
  789. //this.txtGoodsCode.Text = _updateEntity.GoodsCode;
  790. //this.txtProductionLineName.Text = _updateEntity.ProductionLineName;
  791. //this.cbResponProcedure.SelectedValue = _updateEntity.ResponProcedureID;
  792. try
  793. {
  794. this.cmbRreason.Text = _updateEntity.Rreason;
  795. }
  796. catch
  797. {
  798. this.cmbRreason.Text = "";
  799. }
  800. this.txtRemarks.Text = _updateEntity.Remarks;
  801. //this.txtScrapFine.Text = _updateEntity.ScrapFine.ToString();
  802. //this._updateEntity.ScrapFine
  803. if (this._updateEntity.ResponUserID != null)
  804. {
  805. // scbUser.SearchedPKMember = Convert.ToInt32(_updateEntity.ResponUserID);
  806. // scbUser.InitValue(_updateEntity.ResponUserName, _updateEntity.ResponUserCode);
  807. //this.dkUser.UserID = _updateEntity.ResponUserID;
  808. // this.dkUser.UserCode = _updateEntity.ResponUserCode;
  809. // this.dkUser.UserName = _updateEntity.ResponUserName;
  810. }
  811. else if (this._scrapResponsibleList.Count != Constant.INT_IS_ZERO)
  812. {
  813. //scbUser.SearchedPKMember = Convert.ToInt32(_scrapResponsibleList[0].UserID);
  814. //scbUser.InitValue(_scrapResponsibleList[0].UserName, _scrapResponsibleList[0].UserCode);
  815. //this.dkUser.UserID = _scrapResponsibleList[0].UserID;
  816. // this.dkUser.UserCode = _scrapResponsibleList[0].UserCode;
  817. // this.dkUser.UserName = _scrapResponsibleList[0].UserName;
  818. }
  819. }
  820. catch (Exception ex)
  821. {
  822. throw ex;
  823. }
  824. }
  825. /// <summary>
  826. /// 数据表到实体转换
  827. /// </summary>
  828. /// <param name="dsScrapResponsible"></param>
  829. private void DataTableToListByScrapResponsible(DataSet dsScrapResponsible)
  830. {
  831. foreach (DataRow drFor in dsScrapResponsible.Tables[0].Rows)
  832. {
  833. ScrapResponsibleEntity srEntity = new ScrapResponsibleEntity();
  834. srEntity.ResponsibleID = Convert.ToInt32(drFor["ResponsibleID"]);
  835. srEntity.ScrapProductID = Convert.ToInt32(drFor["ScrapProductID"]);
  836. srEntity.BarCode = drFor["BarCode"].ToString();
  837. srEntity.ResponType = Convert.ToInt32(drFor["ResponType"]);
  838. if (drFor["ResponProcedureID"] != DBNull.Value)
  839. {
  840. srEntity.ResponProcedureID = Convert.ToInt32(drFor["ResponProcedureID"]);
  841. }
  842. srEntity.StaffID = Convert.ToInt32(drFor["StaffID"]);
  843. srEntity.UserID = Convert.ToInt32(drFor["UserID"]);
  844. srEntity.UserCode = drFor["UserCode"].ToString();
  845. srEntity.UJobsID = Convert.ToInt32(drFor["UJobsID"]);
  846. srEntity.SJobsID = Convert.ToInt32(drFor["SJobsID"]);
  847. srEntity.StaffStatus = Convert.ToInt32(drFor["StaffStatus"]);
  848. srEntity.AccountID = Convert.ToInt32(drFor["AccountID"]);
  849. srEntity.CreateTime = Convert.ToDateTime(drFor["CreateTime"]);
  850. srEntity.CreateUserID = Convert.ToInt32(drFor["CreateUserID"]);
  851. srEntity.UpdateTime = Convert.ToDateTime(drFor["UpdateTime"]);
  852. srEntity.UpdateUserID = Convert.ToInt32(drFor["UpdateUserID"]);
  853. srEntity.OPTimeStamp = Convert.ToDateTime(drFor["OPTimeStamp"]);
  854. srEntity.UserName = drFor["userName"].ToString();
  855. this._scrapResponsibleList.Add(srEntity);
  856. }
  857. }
  858. /// <summary>
  859. /// 数据表到实体转换
  860. /// </summary>
  861. /// <param name="dtProductionData"></param>
  862. /// <returns></returns>
  863. private List<ProductionDataEntity> DataTableToListByProductionData(DataTable dtProductionData)
  864. {
  865. List<ProductionDataEntity> pdList = new List<ProductionDataEntity>();
  866. foreach (DataRow drFor in dtProductionData.Rows)
  867. {
  868. ProductionDataEntity pdEntity = new ProductionDataEntity();
  869. pdEntity.ProductionDataID = Convert.ToInt32(drFor["ProductionDataID"]);
  870. pdEntity.ProcedureID = Convert.ToInt32(drFor["ProcedureID"]);
  871. pdEntity.ProcedureCode = drFor["ProcedureCode"].ToString();
  872. pdEntity.ProcedureName = drFor["ProcedureName"].ToString();
  873. pdList.Add(pdEntity);
  874. }
  875. return pdList;
  876. }
  877. #endregion
  878. }
  879. }