317 lines
15 KiB
C#
317 lines
15 KiB
C#
|
using System;
|
|||
|
using System.Collections.Generic;
|
|||
|
using System.Linq;
|
|||
|
using System.Web;
|
|||
|
using System.Web.UI;
|
|||
|
using System.Web.UI.WebControls;
|
|||
|
using BLL;
|
|||
|
|
|||
|
namespace FineUIPro.Web.WeldMat.UsingSentMat
|
|||
|
{
|
|||
|
public partial class UsingMatCheck : PageBase
|
|||
|
{
|
|||
|
#region 加载
|
|||
|
/// <summary>
|
|||
|
/// 加载页面
|
|||
|
/// </summary>
|
|||
|
/// <param name="sender"></param>
|
|||
|
/// <param name="e"></param>
|
|||
|
protected void Page_Load(object sender, EventArgs e)
|
|||
|
{
|
|||
|
if (!IsPostBack)
|
|||
|
{
|
|||
|
string keyId = Request.Params["keyId"];
|
|||
|
string grid = Request.Params["grid"];
|
|||
|
|
|||
|
if (grid == "1") // 领料
|
|||
|
{
|
|||
|
var mat = BLL.UsingMatService.GetUsingMatById(keyId);
|
|||
|
if (mat != null)
|
|||
|
{
|
|||
|
var weld = BLL.WeldInfoService.GetWeldInfoById(mat.WeldId);
|
|||
|
var type = BLL.WeldTypeService.GetWeldTypeById(weld.WeldTypeId);
|
|||
|
var w = BLL.HJGL_PersonManageService.GetWelderByWenId(mat.UsingMan);
|
|||
|
var storeMan = BLL.StoremanInfoService.GetStoremanById(mat.StoreMan);
|
|||
|
|
|||
|
string unit = "";
|
|||
|
unit = "根";
|
|||
|
txtAmount.Text = (mat.Amount.Value + mat.TwoAmount.Value).ToString("0.##") + "根";
|
|||
|
//if (type.WeldTypeName.Contains("焊条"))
|
|||
|
//{
|
|||
|
// unit = "根";
|
|||
|
// txtAmount.Text = mat.Amount.Value.ToString("0.##") + "根";
|
|||
|
//}
|
|||
|
//else
|
|||
|
//{
|
|||
|
// unit = "公斤";
|
|||
|
// txtAmount.Text = mat.Amount.Value.ToString("0.##") + "Kg";
|
|||
|
//}
|
|||
|
|
|||
|
string[] weldNames = weld.WeldName.Split('/');
|
|||
|
string weldName = string.Empty;
|
|||
|
if (weldNames.Length > 1)
|
|||
|
{
|
|||
|
weldName = weldNames[1];
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
weldName = weldNames[0];
|
|||
|
}
|
|||
|
|
|||
|
string strSpeak = w.WED_Name + "领牌号为" + weldName + "的" + type.WeldTypeName + mat.Amount.Value.ToString("0.##") + unit + "请确认";
|
|||
|
ClientScript.RegisterStartupScript(ClientScript.GetType(), "", "<script type='text/javascript'>DoSpeak('" + strSpeak + "');</script>");
|
|||
|
|
|||
|
txtStoreMan.Text = storeMan.StoreName;
|
|||
|
txtName.Text = w.WED_Name;
|
|||
|
txtWeldName.Text = weld.WeldName;
|
|||
|
txtWeldSpec.Text = weld.WeldSpec;
|
|||
|
|
|||
|
txtDatetime.Text = mat.UsingDate.Value.ToShortDateString();
|
|||
|
txtWarrantybook.Text = mat.Warrantybook;
|
|||
|
txtNumber.Text = mat.Number;
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
if (grid == "2") // 退料
|
|||
|
{
|
|||
|
var recycle = BLL.RecycleMatService.GetRecycleMatById(keyId);
|
|||
|
var mat = BLL.UsingMatService.GetUsingMatById(recycle.UsingMatId);
|
|||
|
var weld = BLL.WeldInfoService.GetWeldInfoById(recycle.WeldId);
|
|||
|
var type = BLL.WeldTypeService.GetWeldTypeById(weld.WeldTypeId);
|
|||
|
var w = BLL.HJGL_PersonManageService.GetWelderByWenId(recycle.RecycleMan);
|
|||
|
var storeMan = BLL.StoremanInfoService.GetStoremanById(recycle.StockMan);
|
|||
|
//if (recycle.IsStoreManConfirm == true)
|
|||
|
//{
|
|||
|
// btnStoreMam.Text = "保管员已确认";
|
|||
|
//}
|
|||
|
if (recycle.IsWelderConfirm == true)
|
|||
|
{
|
|||
|
btnWelder.Text = "焊工已确认";
|
|||
|
}
|
|||
|
|
|||
|
string unit = "";
|
|||
|
unit = "根";
|
|||
|
txtAmount.Text = recycle.RecycleAmount.Value.ToString("0.##") + "根";
|
|||
|
if (type.WeldTypeName.Contains("焊条"))
|
|||
|
{
|
|||
|
this.lbRetrunTop.Visible = true;
|
|||
|
this.txtRetrunTop.Visible = true;
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
this.lbRetrunTop.Visible = false;
|
|||
|
this.txtRetrunTop.Visible = false;
|
|||
|
//unit = "公斤";
|
|||
|
//txtAmount.Text = recycle.RecycleAmount.Value.ToString("0.##") + "Kg";
|
|||
|
}
|
|||
|
|
|||
|
string[] weldNames = weld.WeldName.Split('/');
|
|||
|
string weldName = string.Empty;
|
|||
|
if (weldNames.Length > 1)
|
|||
|
{
|
|||
|
weldName = weldNames[1];
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
weldName = weldNames[0];
|
|||
|
}
|
|||
|
|
|||
|
string strSpeak = w.WED_Name + "退回牌号为" + weldName + "的" + type.WeldTypeName + recycle.RecycleAmount.Value.ToString("0.##") + unit;
|
|||
|
if (type.WeldTypeName.Contains("焊条"))
|
|||
|
{
|
|||
|
strSpeak = strSpeak + "退回焊条头" + (recycle.ReturnMatTop != null ? recycle.ReturnMatTop.Value.ToString() : "0") + unit;
|
|||
|
}
|
|||
|
strSpeak = strSpeak + "请确认";
|
|||
|
ClientScript.RegisterStartupScript(ClientScript.GetType(), "", "<script type='text/javascript'>DoSpeak('" + strSpeak + "');</script>");
|
|||
|
|
|||
|
lbAmount.Text = "退回数量:";
|
|||
|
lbDatetime.Text = "退回时间:";
|
|||
|
txtStoreMan.Text = storeMan.StoreName;
|
|||
|
txtName.Text = w.WED_Name;
|
|||
|
txtWeldName.Text = weld.WeldName;
|
|||
|
txtWeldSpec.Text = weld.WeldSpec;
|
|||
|
txtRetrunTop.Text = recycle.ReturnMatTop != null ? recycle.ReturnMatTop.Value.ToString() : "0";
|
|||
|
txtDatetime.Text = recycle.RecycleDate.Value.ToShortDateString();
|
|||
|
txtWarrantybook.Text = mat.Warrantybook;
|
|||
|
txtNumber.Text = mat.Number;
|
|||
|
}
|
|||
|
if (grid == "3") // 退回焊条头
|
|||
|
{
|
|||
|
//var recycleTop = BLL.RecycleMatTopService.GetRecycleMatTopByUsingMatId(keyId);
|
|||
|
//var w = BLL.HJGL_PersonManageService.GetWelderByWenId(recycleTop.RecycleMan);
|
|||
|
//var storeMan = BLL.StoremanInfoService.GetStoremanById(recycleTop.StockMan);
|
|||
|
|
|||
|
//lbAmount.Text = "退回焊条头:";
|
|||
|
|
|||
|
//string strSpeak = w.WED_Name + "退回焊条头" + recycleTop.RecycleAmount.Value.ToString("0.##") + "根请确认";
|
|||
|
//ClientScript.RegisterStartupScript(ClientScript.GetType(), "", "<script type='text/javascript'>DoSpeak('" + strSpeak + "');</script>");
|
|||
|
|
|||
|
//lbDatetime.Text = "退回时间:";
|
|||
|
//txtStoreMan.Text = storeMan.StoreName;
|
|||
|
//txtName.Text = w.WED_Name;
|
|||
|
//txtWeldName.Text = weld.WeldName;
|
|||
|
//txtWeldSpec.Text = weld.WeldSpec;
|
|||
|
//txtAmount.Text = recycleTop.RecycleAmount.Value.ToString("0.##") + "根";
|
|||
|
//txtDatetime.Text = recycleTop.RecycleDate.Value.ToShortDateString();
|
|||
|
//txtWarrantybook.Text = mat.Warrantybook;
|
|||
|
//txtNumber.Text = mat.Number;
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
#endregion
|
|||
|
|
|||
|
#region 焊工确认
|
|||
|
/// <summary>
|
|||
|
/// 焊工确认
|
|||
|
/// </summary>
|
|||
|
/// <param name="sender"></param>
|
|||
|
/// <param name="e"></param>
|
|||
|
protected void btnWelder_Click(object sender, EventArgs e)
|
|||
|
{
|
|||
|
string keyId = Request.Params["keyId"];
|
|||
|
string grid = Request.Params["grid"];
|
|||
|
string isFinger = Request.Params["isFinger"]; // 是否需指纹确认1-是,0-否
|
|||
|
string fingerOrFace = Request.Params["FingerOrFace"];//0-指纹,1-人脸识别
|
|||
|
|
|||
|
if (grid == "1")
|
|||
|
{
|
|||
|
var usingMat = BLL.UsingMatService.GetUsingMatById(keyId);
|
|||
|
if (usingMat.IsWelderConfirm != true)
|
|||
|
{
|
|||
|
if (fingerOrFace == "0")
|
|||
|
{
|
|||
|
if (isFinger == "1")
|
|||
|
{
|
|||
|
ClientScript.RegisterStartupScript(ClientScript.GetType(), "", "<script type='text/javascript'>FingerConfirm('" + keyId + "','1','" + grid + "');</script>");
|
|||
|
}
|
|||
|
}
|
|||
|
else if (fingerOrFace == "1")
|
|||
|
{
|
|||
|
ClientScript.RegisterStartupScript(ClientScript.GetType(), "", "<script type='text/javascript'>FaceConfirm('" + keyId + "','1','" + grid + "');</script>");
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
ClientScript.RegisterStartupScript(ClientScript.GetType(), "", "<script type='text/javascript'>CodeConfirm('" + keyId + "','1','" + grid + "');</script>");
|
|||
|
|
|||
|
}
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
ScriptManager.RegisterStartupScript(this, typeof(string), "_alert", "alert('焊工已确认!')", true);
|
|||
|
}
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
var recycle = BLL.RecycleMatService.GetRecycleMatById(keyId);
|
|||
|
if (recycle.IsWelderConfirm != true)
|
|||
|
{
|
|||
|
if (isFinger == "1")
|
|||
|
{
|
|||
|
if (fingerOrFace == "0")
|
|||
|
{
|
|||
|
ClientScript.RegisterStartupScript(ClientScript.GetType(), "", "<script type='text/javascript'>FingerConfirm('" + keyId + "','1','" + grid + "');</script>");
|
|||
|
}
|
|||
|
else if (fingerOrFace == "1")
|
|||
|
{
|
|||
|
ClientScript.RegisterStartupScript(ClientScript.GetType(), "", "<script type='text/javascript'>FaceConfirm('" + keyId + "','1','" + grid + "');</script>");
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
ClientScript.RegisterStartupScript(ClientScript.GetType(), "", "<script type='text/javascript'>CodeConfirm('" + keyId + "','1','" + grid + "');</script>");
|
|||
|
}
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
BLL.RecycleMatService.WelderConfirm(recycle.RecycleMatId, true);
|
|||
|
ScriptManager.RegisterStartupScript(this, typeof(string), "_alert", "alert('焊工确认成功!')", true);
|
|||
|
}
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
ScriptManager.RegisterStartupScript(this, typeof(string), "_alert", "alert('焊工已确认!')", true);
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
#endregion
|
|||
|
|
|||
|
#region 打印
|
|||
|
protected void btnPrinter_Click(object sender, EventArgs e)
|
|||
|
{
|
|||
|
string reportId = BLL.Const.CLGL_MaterialLabelReportId;
|
|||
|
ClientScript.RegisterStartupScript(ClientScript.GetType(), "", "<script type='text/javascript'>ReportPrint('" + reportId + "','" + Request.Params["keyId"] + "','');</script>");
|
|||
|
}
|
|||
|
#endregion
|
|||
|
|
|||
|
#region 保管员确认
|
|||
|
/// <summary>
|
|||
|
/// 保管员确认
|
|||
|
/// </summary>
|
|||
|
/// <param name="sender"></param>
|
|||
|
/// <param name="e"></param>
|
|||
|
protected void btnStoreMam_Click(object sender, EventArgs e)
|
|||
|
{
|
|||
|
string keyId = Request.Params["keyId"];
|
|||
|
string grid = Request.Params["grid"];
|
|||
|
string isFinger = Request.Params["isFinger"]; // 是否需指纹确认1-是,0-否
|
|||
|
string fingerOrFace = Request.Params["FingerOrFace"];//0-指纹,1-人脸识别
|
|||
|
|
|||
|
if (grid == "1")
|
|||
|
{
|
|||
|
if (fingerOrFace == "0")//指纹
|
|||
|
{
|
|||
|
if (isFinger == "1")
|
|||
|
{
|
|||
|
ClientScript.RegisterStartupScript(ClientScript.GetType(), "", "<script type='text/javascript'>FingerConfirm('" + keyId + "','2','" + grid + "');</script>");
|
|||
|
}
|
|||
|
}
|
|||
|
else if (fingerOrFace == "1")
|
|||
|
{
|
|||
|
ClientScript.RegisterStartupScript(ClientScript.GetType(), "", "<script type='text/javascript'>FaceConfirm('" + keyId + "','2','" + grid + "');</script>");
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
ClientScript.RegisterStartupScript(ClientScript.GetType(), "", "<script type='text/javascript'>CodeConfirm('" + keyId + "','2','" + grid + "');</script>");
|
|||
|
}
|
|||
|
}
|
|||
|
else if (grid == "2")
|
|||
|
{
|
|||
|
var recycle = BLL.RecycleMatService.GetRecycleMatById(keyId);
|
|||
|
var mat = BLL.UsingMatService.GetUsingMatById(recycle.UsingMatId);
|
|||
|
|
|||
|
|
|||
|
if (recycle.IsStoreManConfirm != true)
|
|||
|
{
|
|||
|
if (fingerOrFace == "0")
|
|||
|
{
|
|||
|
if (isFinger == "1")
|
|||
|
{
|
|||
|
ClientScript.RegisterStartupScript(ClientScript.GetType(), "", "<script type='text/javascript'>FingerConfirm('" + keyId + "','2','" + grid + "');</script>");
|
|||
|
}
|
|||
|
}
|
|||
|
else if (fingerOrFace == "1")
|
|||
|
{
|
|||
|
ClientScript.RegisterStartupScript(ClientScript.GetType(), "", "<script type='text/javascript'>FaceConfirm('" + keyId + "','2','" + grid + "');</script>");
|
|||
|
}
|
|||
|
else if (fingerOrFace == "2")
|
|||
|
{
|
|||
|
ClientScript.RegisterStartupScript(ClientScript.GetType(), "", "<script type='text/javascript'>CodeConfirm('" + keyId + "','2','" + grid + "');</script>");
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
if (!string.IsNullOrEmpty(mat.StockInId))
|
|||
|
{
|
|||
|
decimal recycleAmount = recycle.RecycleAmount.HasValue ? recycle.RecycleAmount.Value : 0;
|
|||
|
BLL.StockInService.UpdateStockInAmount(mat.StockInId, recycleAmount);
|
|||
|
}
|
|||
|
ScriptManager.RegisterStartupScript(this, typeof(string), "_alert", "alert('保管员确认成功!')", true);
|
|||
|
}
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
ScriptManager.RegisterStartupScript(this, typeof(string), "_alert", "alert('保管员已确认!')", true);
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
#endregion
|
|||
|
}
|
|||
|
}
|