using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Data.SqlClient; namespace FineUIPro.Web.RLSB { public partial class CheckConfirm : System.Web.UI.Page { protected string flag = "";//标志(1-焊工,2-保管员) protected string keyId = "";//接收用户ID protected string grid = "";//1-领料,2-退料,3-退回焊条头 protected string identityCard = "";//身份证号 protected string stockMan = ""; protected void Page_Load(object sender, EventArgs e) { keyId = Request.Params["keyId"];//用户ID flag = Request.Params["flag"];//1-焊工,2-保管员 grid = Request.Params["grid"];//1-领料,2-退料,3-退焊条头,4-保管员结束确认 identityCard = Request.Params["identityCard"]; checkFace(); } private void checkFace() { //查找是否符合对应人脸 var result = ""; var welder = BLL.HJGL_PersonManageService.GetWelderByIdentityCard(identityCard); if (welder != null) { if (welder.IsFaceTrain==true) { result = "1"; } } var storeman = BLL.StoremanInfoService.GetStoremanByIdentityCard(identityCard); if (storeman != null) { if (storeman.IsFaceTrain == true) { result = "2"; } } if (grid == "1") // 领料 { if (flag == "1" && result == "1") { BLL.UsingMatService.WelderConfirm(keyId, true); Response.Write("人脸对比成功,焊工已确认!"); } else if (flag == "2" && result == "2") { BLL.UsingMatService.StoreManConfirm(keyId, true); Response.Write("人脸对比成功,保管员已确认!"); } else { Response.Write("人脸不匹配!"); } } if (grid == "2") // 退料 { if (flag == "1" && result == "1") { BLL.RecycleMatService.WelderConfirm(keyId, true); Response.Write("人脸对比成功,焊工已确认!"); } else { if (result == "2") { BLL.RecycleMatService.StoreManConfirm(keyId, true); var recycle = BLL.RecycleMatService.GetRecycleMatById(keyId); var mat = BLL.UsingMatService.GetUsingMatById(recycle.UsingMatId); //var stock = BLL.StockInService.GetStockInById(mat.StockInId); //var stockIn = BLL.StockInService.GetStockInByWeldIdAndNum(recycle.WeldId, recycle.Number); //var weld = BLL.WeldInfoService.GetWeldInfoById(recycle.WeldId); if (!string.IsNullOrEmpty(mat.StockInId)) { decimal recycleAmount = recycle.RecycleAmount.HasValue ? recycle.RecycleAmount.Value : 0; BLL.StockInService.UpdateStockInAmount(mat.StockInId, recycleAmount); } #region 不用了 //Model.Weld_StockIn newStockIn = new Model.Weld_StockIn(); //newStockIn.WeldId = recycle.WeldId; //newStockIn.Amount = recycle.RecycleAmount; //newStockIn.Weight = recycle.RecycleAmount / weld.ConvertValue; //newStockIn.IsReview = false; //newStockIn.InStockDate = DateTime.Now; //newStockIn.Warrantybook = recycle.Warrantybook; //newStockIn.HeartNo = stock.HeartNo; //newStockIn.Materialman = stock.Materialman; //newStockIn.SupplierId = stock.SupplierId; //newStockIn.AttachUrl = stock.SupplierId; //newStockIn.Number = recycle.Number; //newStockIn.Flag = "2"; //if (stockIn == null) //{ // newStockIn.Amount = recycle.RecycleAmount; // newStockIn.Weight = recycle.RecycleAmount / weld.ConvertValue; // newStockIn.StockInId = BLL.SQLHelper.GetNewID(typeof(Model.Weld_StockIn)); // BLL.StockInService.AddStockIn(newStockIn); //} //else //{ // newStockIn.Amount = stockIn.Amount + recycle.RecycleAmount; // newStockIn.Weight = (stockIn.Amount + recycle.RecycleAmount) / weld.ConvertValue; // newStockIn.StockInId = stockIn.StockInId; // BLL.StockInService.UpdateStockIn(newStockIn); //} #endregion Response.Write("人脸对比成功,保管员已确认!"); } } } if (grid == "3") // 退焊条头 { if (flag == "1" && result == "1") { BLL.RecycleMatTopService.WelderConfirm(keyId, true); Response.Write("人脸对比成功,焊工已确认!"); } else if (flag == "2" && result == "2") { BLL.RecycleMatTopService.StoreManConfirm(keyId, true); Response.Write("人脸对比成功,保管员已确认!"); } } if (grid == "4") { BLL.UsingPlanService.UpdateIsFinish(keyId, stockMan); var s = BLL.StoremanInfoService.GetStoremanById(stockMan); Response.Write("保管员:" + s.StoreName + "确认此计划完成"); } } } }