11
This commit is contained in:
@@ -0,0 +1,138 @@
|
||||
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="PointForAudit.aspx.cs" Inherits="FineUIPro.Web.WeldingProcess.TrustManage.PointForAudit" %>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head runat="server">
|
||||
<title>点口待审核</title>
|
||||
<link href="../../res/css/common.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
<f:PageManager ID="PageManager1" AutoSizePanelID="Panel1" runat="server" />
|
||||
<f:Panel ID="Panel1" runat="server" Margin="5px" BodyPadding="5px" ShowBorder="false"
|
||||
ShowHeader="false" Layout="VBox" BoxConfigAlign="Stretch">
|
||||
<Items>
|
||||
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="点口待审核"
|
||||
EnableCollapse="true" runat="server" BoxFlex="1" DataKeyNames="PointBatchItemId"
|
||||
AllowColumnLocking="true" EnableColumnLines="true" DataIDField="PointBatchItemId"
|
||||
AllowSorting="true" SortField="PointDate,PipelineCode,WeldJointCode"
|
||||
SortDirection="DESC" OnSort="Grid1_Sort" AllowPaging="true" IsDatabasePaging="true"
|
||||
PageSize="25" OnPageIndexChange="Grid1_PageIndexChange" EnableTextSelection="True"
|
||||
EnableCheckBoxSelect="true">
|
||||
<Toolbars>
|
||||
<f:Toolbar ID="Toolbar1" Position="Top" runat="server" ToolbarAlign="Left">
|
||||
<Items>
|
||||
<f:DropDownList ID="drpNoAudit" runat="server" Label="未审核" LabelAlign="Right" Width="160" LabelWidth="70px">
|
||||
<f:ListItem Text="-请选择-" Value="0" />
|
||||
<f:ListItem Text="监理" Value="1" />
|
||||
<f:ListItem Text="管理公司" Value="2" />
|
||||
<f:ListItem Text="其它" Value="3" />
|
||||
</f:DropDownList>
|
||||
<f:TextBox ID="txtPipeCode" runat="server" Label="管线" LabelAlign="Right" Width="180" LabelWidth="65px"></f:TextBox>
|
||||
<f:DropDownList ID="drpNde" runat="server" Label="检测方法"
|
||||
LabelAlign="Right" EnableEdit="true" Width="170" LabelWidth="90px">
|
||||
</f:DropDownList>
|
||||
<f:DatePicker runat="server" ID="txtPointStartDate" LabelAlign="Right" LabelWidth="90px"
|
||||
Label="点口日期" Width="195px">
|
||||
</f:DatePicker>
|
||||
<f:DatePicker runat="server" ID="txtPointEndDate" LabelAlign="Right" LabelWidth="30px"
|
||||
Label="至" Width="135px">
|
||||
</f:DatePicker>
|
||||
<f:Button ID="BtnAnalyse" Icon="Find"
|
||||
runat="server" OnClick="BtnAnalyse_Click">
|
||||
</f:Button>
|
||||
<f:ToolbarFill ID="ToolbarFill1" runat="server">
|
||||
</f:ToolbarFill>
|
||||
<f:Button ID="btnJLAudit" Text="监理审核"
|
||||
runat="server" OnClick="btnJLAudit_Click">
|
||||
</f:Button>
|
||||
<f:Button ID="btnGLGSAudit" Text="管理公司审核" Icon="ChartPie"
|
||||
runat="server" OnClick="btnGLGSAudit_Click">
|
||||
</f:Button>
|
||||
<f:Button ID="btnOtherAudit" Text="其它审核" Icon="ChartPie"
|
||||
runat="server" OnClick="btnOtherAudit_Click">
|
||||
</f:Button>
|
||||
<f:Button ID="btnHandGenerate" Text="生成委托单" ToolTip="勾选需要生成委托单的焊口手动生成委托单" Icon="TableEdit" runat="server"
|
||||
OnClick="btnHandGenerate_Click">
|
||||
</f:Button>
|
||||
</Items>
|
||||
</f:Toolbar>
|
||||
</Toolbars>
|
||||
<Columns>
|
||||
<f:RenderField HeaderText="批次号" ColumnID="PointBatchCode" DataField="PointBatchCode"
|
||||
SortField="PointBatchCode" FieldType="String" HeaderTextAlign="Center" TextAlign="Left"
|
||||
Width="220px" Locked="true">
|
||||
</f:RenderField>
|
||||
<f:RenderField HeaderText="<%$ Resources:Lan,ConstructionArea %>" ColumnID="WorkAreaCode" DataField="WorkAreaCode"
|
||||
SortField="WorkAreaCode" FieldType="String" HeaderTextAlign="Center" TextAlign="Left"
|
||||
Width="80px" Locked="true">
|
||||
</f:RenderField>
|
||||
<f:RenderField HeaderText="管线号" ColumnID="PipelineCode" DataField="PipelineCode"
|
||||
SortField="PipelineCode" FieldType="String" HeaderTextAlign="Center" TextAlign="Left"
|
||||
Width="160px" Locked="true">
|
||||
</f:RenderField>
|
||||
<f:RenderField HeaderText="焊口代号" ColumnID="WeldJointCode" DataField="WeldJointCode"
|
||||
SortField="WeldJointCode" FieldType="String" HeaderTextAlign="Center" TextAlign="Left"
|
||||
Width="80px" Locked="true">
|
||||
</f:RenderField>
|
||||
<f:RenderField HeaderText="焊工号" ColumnID="WelderCode" DataField="WelderCode"
|
||||
SortField="WelderCode" FieldType="String" HeaderTextAlign="Center" TextAlign="Center"
|
||||
Width="100px">
|
||||
</f:RenderField>
|
||||
<f:RenderField HeaderText="焊接日期" ColumnID="WeldingDate" DataField="WeldingDate" SortField="WeldingDate"
|
||||
FieldType="Date" Renderer="Date" HeaderTextAlign="Center" TextAlign="Left" Width="100px">
|
||||
</f:RenderField>
|
||||
<f:RenderField HeaderText="点口类型" ColumnID="PointState" DataField="PointState" SortField="PointState"
|
||||
FieldType="String" HeaderTextAlign="Center" TextAlign="Center" Width="80px">
|
||||
</f:RenderField>
|
||||
<f:RenderField HeaderText="是否首二口" ColumnID="IsWelderFirst" DataField="IsWelderFirst"
|
||||
FieldType="String" HeaderTextAlign="Center" TextAlign="Center" Width="95px">
|
||||
</f:RenderField>
|
||||
<f:RenderField HeaderText="点口日期" ColumnID="PointDate" DataField="PointDate" SortField="PointDate"
|
||||
FieldType="Date" Renderer="Date" HeaderTextAlign="Center" TextAlign="Left" Width="100px">
|
||||
</f:RenderField>
|
||||
<f:RenderField HeaderText="实际寸径" ColumnID="Size" DataField="Size" SortField="Size"
|
||||
FieldType="Double" HeaderTextAlign="Center" TextAlign="Left" Width="80px">
|
||||
</f:RenderField>
|
||||
<f:RenderField HeaderText="管道等级" ColumnID="PipingClassName" DataField="PipingClassName"
|
||||
SortField="PipingClassName" FieldType="String" HeaderTextAlign="Center" TextAlign="Left"
|
||||
Width="80px">
|
||||
</f:RenderField>
|
||||
<f:RenderField HeaderText="监理审核" ColumnID="JLAudit" DataField="JLAudit"
|
||||
SortField="JLAudit" FieldType="String" HeaderTextAlign="Center" TextAlign="Left"
|
||||
Width="80px">
|
||||
</f:RenderField>
|
||||
<f:RenderField HeaderText="管理公司审核" ColumnID="GLGSAudit" DataField="GLGSAudit"
|
||||
SortField="GLGSAudit" FieldType="String" HeaderTextAlign="Center" TextAlign="Left"
|
||||
Width="110px">
|
||||
</f:RenderField>
|
||||
<f:RenderField HeaderText="其他审核" ColumnID="QTAudit" DataField="QTAudit"
|
||||
SortField="QTAudit" FieldType="String" HeaderTextAlign="Center" TextAlign="Left"
|
||||
Width="80px">
|
||||
</f:RenderField>
|
||||
<f:RenderField ColumnID="IsPointAudit" DataField="IsPointAudit"
|
||||
FieldType="String" Hidden="true">
|
||||
</f:RenderField>
|
||||
</Columns>
|
||||
|
||||
<PageItems>
|
||||
<f:ToolbarSeparator ID="ToolbarSeparator1" runat="server">
|
||||
</f:ToolbarSeparator>
|
||||
<f:ToolbarText ID="ToolbarText1" runat="server" Text="<%$ Resources:Lan,NumberOfRecordsPerPage %>">
|
||||
</f:ToolbarText>
|
||||
<f:DropDownList runat="server" ID="ddlPageSize" Width="80px" AutoPostBack="true"
|
||||
OnSelectedIndexChanged="ddlPageSize_SelectedIndexChanged">
|
||||
<f:ListItem Text="20" Value="20" />
|
||||
<f:ListItem Text="50" Value="50" />
|
||||
<f:ListItem Text="100" Value="100" />
|
||||
<f:ListItem Text="500" Value="500" />
|
||||
<f:ListItem Text="<%$ Resources:Lan,AllLines %>" Value="10000" />
|
||||
</f:DropDownList>
|
||||
</PageItems>
|
||||
</f:Grid>
|
||||
</Items>
|
||||
</f:Panel>
|
||||
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,352 @@
|
||||
using BLL;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
namespace FineUIPro.Web.WeldingProcess.TrustManage
|
||||
{
|
||||
public partial class PointForAudit : PageBase
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
this.ddlPageSize.SelectedValue = this.Grid1.PageSize.ToString();
|
||||
|
||||
BLL.Base_DetectionTypeService.InitDetectionTypeDropDownList(drpNde, "", false, "");
|
||||
drpNde.SelectedValue = "296add43-e979-4cf3-b13e-a68bb00a75d2"; // 默认RT
|
||||
BindGrid();
|
||||
}
|
||||
}
|
||||
|
||||
private void BindGrid()
|
||||
{
|
||||
string strSql = @"SELECT PointBatchItemId,PointBatchId,PointBatchCode,WeldJointId,PointState,PointDate,WorkAreaCode,
|
||||
WeldJointCode,JointArea,Size,WelderCode,WeldingDate,PipelineCode,PipingClassName,
|
||||
(CASE WHEN IsWelderFirst=1 THEN '是' ELSE '否' END) AS IsWelderFirst,
|
||||
JLAudit,GLGSAudit,QTAudit,IsPointAudit
|
||||
FROM dbo.View_Batch_PointBatchItem
|
||||
WHERE PointState IS NOT NULL AND TrustBatchItemId IS NULL";
|
||||
List<SqlParameter> listStr = new List<SqlParameter>();
|
||||
if (!string.IsNullOrEmpty(this.txtPipeCode.Text))
|
||||
{
|
||||
strSql += " AND PipelineCode LIKE @PipelineCode";
|
||||
listStr.Add(new SqlParameter("@PipelineCode", "%" + this.txtPipeCode.Text.Trim() + "%"));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(this.txtPointStartDate.Text))
|
||||
{
|
||||
strSql += " AND PointDate >= @PointStartDate";
|
||||
listStr.Add(new SqlParameter("@PointStartDate", Convert.ToDateTime(this.txtPointStartDate.Text)));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(this.txtPointEndDate.Text))
|
||||
{
|
||||
strSql += " AND PointDate < @PointEndDate";
|
||||
listStr.Add(new SqlParameter("@PointEndDate", Convert.ToDateTime(this.txtPointEndDate.Text).AddDays(1)));
|
||||
}
|
||||
if (drpNoAudit.SelectedValue != "0")
|
||||
{
|
||||
if (drpNoAudit.SelectedValue == "1")
|
||||
{
|
||||
strSql += " AND JLAudit='未审核'";
|
||||
}
|
||||
if (drpNoAudit.SelectedValue == "2")
|
||||
{
|
||||
strSql += " AND GLGSAudit='未审核'";
|
||||
}
|
||||
if (drpNoAudit.SelectedValue == "3")
|
||||
{
|
||||
strSql += " AND QTAudit='未审核'";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
strSql += " AND (JLAudit='未审核' OR GLGSAudit='未审核' OR QTAudit='未审核')";
|
||||
}
|
||||
|
||||
if (drpNde.SelectedValue != null)
|
||||
{
|
||||
strSql += " AND DetectionTypeId=@DetectionTypeId";
|
||||
listStr.Add(new SqlParameter("@DetectionTypeId", drpNde.SelectedValue));
|
||||
}
|
||||
|
||||
SqlParameter[] parameter = listStr.ToArray();
|
||||
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
|
||||
|
||||
Grid1.RecordCount = tb.Rows.Count;
|
||||
// tb = GetFilteredTable(Grid1.FilteredData, tb);
|
||||
var table = this.GetPagedDataTable(Grid1, tb);
|
||||
Grid1.DataSource = table;
|
||||
Grid1.DataBind();
|
||||
}
|
||||
|
||||
#region
|
||||
/// <summary>
|
||||
/// 改变索引事件
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e)
|
||||
{
|
||||
BindGrid();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 分页下拉选择事件
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue);
|
||||
BindGrid();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 排序
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Grid1_Sort(object sender, FineUIPro.GridSortEventArgs e)
|
||||
{
|
||||
this.BindGrid();
|
||||
}
|
||||
#endregion
|
||||
|
||||
protected void BtnAnalyse_Click(object sender, EventArgs e)
|
||||
{
|
||||
BindGrid();
|
||||
}
|
||||
protected void Window2_Close(object sender, WindowCloseEventArgs e)
|
||||
{
|
||||
this.BindGrid();
|
||||
}
|
||||
protected void btnJLAudit_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, Const.HJGL_PointForAuditMenuId, Const.BtnJLAudit))
|
||||
{
|
||||
if (Grid1.SelectedRowIndexArray.Length <= 0)
|
||||
{
|
||||
Alert.ShowInTop("最少选中一行!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
|
||||
string userId = CurrUser.UserId;
|
||||
foreach (string pointBatchItemId in Grid1.SelectedRowIDArray)
|
||||
{
|
||||
var pointBatchItem = BLL.Batch_PointBatchItemService.GetPointBatchItemByPointBatchItemId(pointBatchItemId);
|
||||
pointBatchItem.JLAudit = userId;
|
||||
BLL.Funs.DB.SubmitChanges();
|
||||
}
|
||||
Alert.ShowInTop("所选项审核完成!", MessageBoxIcon.Warning);
|
||||
BindGrid();
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowNotify(Resources.Lan.NoPrivilegePrompt, MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
}
|
||||
protected void btnGLGSAudit_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, Const.HJGL_PointForAuditMenuId, Const.BtnGLGSAudit))
|
||||
{
|
||||
if (Grid1.SelectedRowIndexArray.Length <= 0)
|
||||
{
|
||||
Alert.ShowInTop("最少选中一行!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
|
||||
string userId = CurrUser.UserId;
|
||||
foreach (string pointBatchItemId in Grid1.SelectedRowIDArray)
|
||||
{
|
||||
var pointBatchItem = BLL.Batch_PointBatchItemService.GetPointBatchItemByPointBatchItemId(pointBatchItemId);
|
||||
pointBatchItem.GLGSAudit = userId;
|
||||
BLL.Funs.DB.SubmitChanges();
|
||||
}
|
||||
Alert.ShowInTop("所选项审核完成!", MessageBoxIcon.Warning);
|
||||
BindGrid();
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowNotify(Resources.Lan.NoPrivilegePrompt, MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
}
|
||||
protected void btnOtherAudit_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, Const.HJGL_PointForAuditMenuId, Const.BtnQTAudit))
|
||||
{
|
||||
if (Grid1.SelectedRowIndexArray.Length <= 0)
|
||||
{
|
||||
Alert.ShowInTop("最少选中一行!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
|
||||
string userId = CurrUser.UserId;
|
||||
foreach (string pointBatchItemId in Grid1.SelectedRowIDArray)
|
||||
{
|
||||
var pointBatchItem = BLL.Batch_PointBatchItemService.GetPointBatchItemByPointBatchItemId(pointBatchItemId);
|
||||
pointBatchItem.QTAudit = userId;
|
||||
BLL.Funs.DB.SubmitChanges();
|
||||
}
|
||||
Alert.ShowInTop("所选项审核完成!", MessageBoxIcon.Warning);
|
||||
BindGrid();
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowNotify(Resources.Lan.NoPrivilegePrompt, MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 手动生成委托单
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnHandGenerate_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, Const.HJGL_PointManageMenuId, Const.BtnHandGenerate))
|
||||
{
|
||||
List<string> selectRow = new List<string>();
|
||||
|
||||
foreach (string pitem in Grid1.SelectedRowIDArray)
|
||||
{
|
||||
selectRow.Add(pitem);
|
||||
}
|
||||
|
||||
if (selectRow.Count() > 0)
|
||||
{
|
||||
List<string> weldMot = new List<string>();
|
||||
List<string> grooveType = new List<string>();
|
||||
List<bool> IsFist = new List<bool>();
|
||||
List<string> pointBatchIds = new List<string>();
|
||||
string error = string.Empty;
|
||||
|
||||
foreach (string pointItemId in selectRow)
|
||||
{
|
||||
var pointItem = BLL.Batch_PointBatchItemService.GetPointBatchItemByPointBatchItemId(pointItemId);
|
||||
var jot = BLL.Pipeline_WeldJointService.GetWeldJointByWeldJointId(pointItem.WeldJointId);
|
||||
weldMot.Add(jot.WeldingMethodId);
|
||||
grooveType.Add(jot.GrooveTypeId);
|
||||
IsFist.Add(pointItem.IsWelderFirst == true ? true : false);
|
||||
pointBatchIds.Add(pointItem.PointBatchId);
|
||||
}
|
||||
|
||||
if (pointBatchIds.Distinct().Count() > 1)
|
||||
{
|
||||
error = "勾选的焊口不在一个批次中,";
|
||||
}
|
||||
if (weldMot.Distinct().Count() > 1)
|
||||
{
|
||||
error = "勾选的焊口焊接方法不一至,";
|
||||
}
|
||||
if (grooveType.Distinct().Count() > 1)
|
||||
{
|
||||
error = error + "勾选的焊口坡口类型不一至,";
|
||||
}
|
||||
if (IsFist.Distinct().Count() > 1)
|
||||
{
|
||||
error = error + "勾选的焊口是否首三不一至,";
|
||||
}
|
||||
|
||||
if (error == string.Empty)
|
||||
{
|
||||
var point = BLL.Batch_PointBatchService.GetPointBatchById(pointBatchIds[0]);
|
||||
var iso = BLL.Pipeline_PipelineService.GetPipelineByPipelineId(point.PipelineId);
|
||||
var project = BLL.Base_ProjectService.GetProjectByProjectId(point.ProjectId);
|
||||
var unit = BLL.Base_UnitService.GetUnit(point.UnitId);
|
||||
var ndt = BLL.Base_DetectionTypeService.GetDetectionTypeByDetectionTypeId(point.DetectionTypeId);
|
||||
var work = BLL.Project_WorkAreaService.GetProject_WorkAreaByWorkAreaId(iso.WorkAreaId);
|
||||
|
||||
Model.Batch_BatchTrust newBatchTrust = new Model.Batch_BatchTrust();
|
||||
string perfix = string.Empty;
|
||||
//perfix = unit.UnitCode + "-" + ins.InstallationCode + "-GD-" + ndt.DetectionTypeCode + "-";
|
||||
perfix = ndt.DetectionTypeCode + "-" + unit.UnitCode + "-" + work.WorkAreaCode + "-PI" + "-";
|
||||
newBatchTrust.TrustBatchCode = BLL.SQLHelper.RunProcNewId("SpGetNewCode", "dbo.Batch_BatchTrust", "TrustBatchCode", project.ProjectId, perfix);
|
||||
|
||||
string trustBatchId = SQLHelper.GetNewID(typeof(Model.Batch_BatchTrust));
|
||||
newBatchTrust.TrustBatchId = trustBatchId;
|
||||
|
||||
newBatchTrust.TrustDate = DateTime.Now;
|
||||
newBatchTrust.ProjectId = point.ProjectId;
|
||||
newBatchTrust.UnitId = point.UnitId;
|
||||
newBatchTrust.InstallationId = point.InstallationId;
|
||||
newBatchTrust.WorkAreaId = iso.WorkAreaId;
|
||||
newBatchTrust.WeldingMethodId = weldMot[0];
|
||||
newBatchTrust.GrooveTypeId = grooveType[0];
|
||||
newBatchTrust.IsWelderFirst = IsFist[0];
|
||||
newBatchTrust.DetectionTypeId = point.DetectionTypeId;
|
||||
newBatchTrust.PipelineId = point.PipelineId;
|
||||
|
||||
BLL.Batch_BatchTrustService.AddBatchTrust(newBatchTrust); // 新增委托单
|
||||
|
||||
// 生成委托明细,并回写点口明细信息
|
||||
string toPointBatch = string.Empty;
|
||||
foreach (string pointItemId in selectRow)
|
||||
{
|
||||
var pointItem = BLL.Batch_PointBatchItemService.GetPointBatchItemByPointBatchItemId(pointItemId);
|
||||
if (BLL.Batch_PointBatchService.GetIsGenerateTrust(pointItem.PointBatchItemId)) ////生成委托单的条件判断
|
||||
{
|
||||
if (!toPointBatch.Contains(pointItem.PointBatchId))
|
||||
{
|
||||
toPointBatch = toPointBatch + pointItem.PointBatchId + ",";
|
||||
}
|
||||
|
||||
Model.Batch_BatchTrustItem trustItem = new Model.Batch_BatchTrustItem
|
||||
{
|
||||
TrustBatchItemId = SQLHelper.GetNewID(typeof(Model.Batch_BatchTrustItem)),
|
||||
TrustBatchId = trustBatchId,
|
||||
PointBatchItemId = pointItem.PointBatchItemId,
|
||||
WeldJointId = pointItem.WeldJointId,
|
||||
//FilmNum = fileNum,
|
||||
CreateDate = DateTime.Now
|
||||
};
|
||||
Batch_BatchTrustItemService.AddBatchTrustItem(trustItem);
|
||||
}
|
||||
|
||||
//Model.Batch_PointBatchItem pointBatchItem = Funs.DB.Batch_PointBatchItem.FirstOrDefault(e => e.PointBatchItemId == item.PointBatchItemId);
|
||||
|
||||
pointItem.IsBuildTrust = true;
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
// 回写委托批对应点口信息
|
||||
if (!string.IsNullOrEmpty(toPointBatch))
|
||||
{
|
||||
toPointBatch = toPointBatch.Substring(0, toPointBatch.Length - 1);
|
||||
var updateTrut = BLL.Batch_BatchTrustService.GetBatchTrustById(trustBatchId);
|
||||
if (updateTrut != null)
|
||||
{
|
||||
updateTrut.TopointBatch = toPointBatch;
|
||||
BLL.Batch_BatchTrustService.UpdateBatchTrust(updateTrut);
|
||||
}
|
||||
}
|
||||
|
||||
Alert.ShowInTop("委托单已生成!", MessageBoxIcon.Success);
|
||||
}
|
||||
else
|
||||
{
|
||||
Alert.ShowInTop(error + "不能组成一个委托单!", MessageBoxIcon.Warning);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Alert.ShowInTop("请勾选要生成委托单的焊口!", MessageBoxIcon.Warning);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowNotify(Resources.Lan.NoPrivilegePrompt, MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+188
@@ -0,0 +1,188 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <自动生成>
|
||||
// 此代码由工具生成。
|
||||
//
|
||||
// 对此文件的更改可能导致不正确的行为,如果
|
||||
// 重新生成代码,则所做更改将丢失。
|
||||
// </自动生成>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace FineUIPro.Web.WeldingProcess.TrustManage
|
||||
{
|
||||
|
||||
|
||||
public partial class PointForAudit
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// form1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
|
||||
|
||||
/// <summary>
|
||||
/// PageManager1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.PageManager PageManager1;
|
||||
|
||||
/// <summary>
|
||||
/// Panel1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Panel Panel1;
|
||||
|
||||
/// <summary>
|
||||
/// Grid1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Grid Grid1;
|
||||
|
||||
/// <summary>
|
||||
/// Toolbar1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Toolbar Toolbar1;
|
||||
|
||||
/// <summary>
|
||||
/// drpNoAudit 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList drpNoAudit;
|
||||
|
||||
/// <summary>
|
||||
/// txtPipeCode 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtPipeCode;
|
||||
|
||||
/// <summary>
|
||||
/// drpNde 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList drpNde;
|
||||
|
||||
/// <summary>
|
||||
/// txtPointStartDate 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DatePicker txtPointStartDate;
|
||||
|
||||
/// <summary>
|
||||
/// txtPointEndDate 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DatePicker txtPointEndDate;
|
||||
|
||||
/// <summary>
|
||||
/// BtnAnalyse 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button BtnAnalyse;
|
||||
|
||||
/// <summary>
|
||||
/// ToolbarFill1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.ToolbarFill ToolbarFill1;
|
||||
|
||||
/// <summary>
|
||||
/// btnJLAudit 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnJLAudit;
|
||||
|
||||
/// <summary>
|
||||
/// btnGLGSAudit 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnGLGSAudit;
|
||||
|
||||
/// <summary>
|
||||
/// btnOtherAudit 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnOtherAudit;
|
||||
|
||||
/// <summary>
|
||||
/// btnHandGenerate 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnHandGenerate;
|
||||
|
||||
/// <summary>
|
||||
/// ToolbarSeparator1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1;
|
||||
|
||||
/// <summary>
|
||||
/// ToolbarText1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.ToolbarText ToolbarText1;
|
||||
|
||||
/// <summary>
|
||||
/// ddlPageSize 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList ddlPageSize;
|
||||
}
|
||||
}
|
||||
@@ -118,7 +118,7 @@
|
||||
runat="server" OnClick="btnbtnOpenResetPoint_Click">
|
||||
</f:Button>
|
||||
<f:Button ID="btnClear" Text="手动关闭批" ToolTip="手动关闭批" Icon="ArrowOutLonger" runat="server"
|
||||
ConfirmText="确定要手动关闭批吗?" OnClick="btnbtnClear_Click">
|
||||
ConfirmText="确定要手动关闭批中待处理焊口吗?" OnClick="btnbtnClear_Click">
|
||||
</f:Button>
|
||||
<f:Button ID="btnSelectExpandPoint" Text="重新选择扩口" ToolTip="重新选择扩口" Icon="ArrowRefresh"
|
||||
runat="server" OnClick="btnSelectExpandPoint_Click" Hidden="true">
|
||||
|
||||
@@ -850,7 +850,7 @@ namespace FineUIPro.Web.WeldingProcess.TrustManage
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 手动结束批(暂不用)
|
||||
/// 手动结束批
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
@@ -858,23 +858,30 @@ namespace FineUIPro.Web.WeldingProcess.TrustManage
|
||||
{
|
||||
if (CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, Const.HJGL_PointManageMenuId, Const.BtnClearBatch))
|
||||
{
|
||||
string info = "该批次已关闭!";
|
||||
var point = BLL.Batch_PointBatchService.GetPointBatchById(this.PointBatchId);
|
||||
if (point != null && !point.EndDate.HasValue)
|
||||
string info = "该批次待处理状态的焊口已关闭!";
|
||||
var pointItemList = (from x in Funs.DB.Batch_PointBatchItem where x.PointBatchId == this.PointBatchId && (x.IsCompletedPoint == null || x.IsCompletedPoint == false) select x).ToList();
|
||||
foreach (var item in pointItemList)
|
||||
{
|
||||
var q = Funs.DB.Batch_PointBatchItem.FirstOrDefault(x => x.PointBatchId == PointBatchId && x.PointState == "1");
|
||||
if (q != null)
|
||||
{
|
||||
BLL.Batch_PointBatchService.UpdatePointBatch(PointBatchId, System.DateTime.Now);
|
||||
this.txtEndDate.Text = point.EndDate.Value.ToShortDateString();
|
||||
this.txtState.Text = "批关闭";
|
||||
BLL.Sys_LogService.AddLog(BLL.Const.System_3, this.CurrUser.LoginProjectId, this.CurrUser.UserId, Const.HJGL_PointManageMenuId, Const.BtnClearBatch, this.PointBatchId);
|
||||
}
|
||||
else
|
||||
{
|
||||
info = "该批次未点口,请手动点口后再结束批!";
|
||||
}
|
||||
item.IsCompletedPoint = true;
|
||||
}
|
||||
Funs.DB.SubmitChanges();
|
||||
|
||||
//var point = BLL.Batch_PointBatchService.GetPointBatchById(this.PointBatchId);
|
||||
//if (point != null && !point.EndDate.HasValue)
|
||||
//{
|
||||
// var q = Funs.DB.Batch_PointBatchItem.FirstOrDefault(x => x.PointBatchId == PointBatchId && x.PointState == "1");
|
||||
// if (q != null)
|
||||
// {
|
||||
// BLL.Batch_PointBatchService.UpdatePointBatch(PointBatchId, System.DateTime.Now);
|
||||
// this.txtEndDate.Text = point.EndDate.Value.ToShortDateString();
|
||||
// this.txtState.Text = "批关闭";
|
||||
// BLL.Sys_LogService.AddLog(BLL.Const.System_3, this.CurrUser.LoginProjectId, this.CurrUser.UserId, Const.HJGL_PointManageMenuId, Const.BtnClearBatch, this.PointBatchId);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// info = "该批次未点口,请手动点口后再结束批!";
|
||||
// }
|
||||
//}
|
||||
Alert.ShowInTop(info);
|
||||
}
|
||||
else
|
||||
|
||||
@@ -37,7 +37,7 @@ namespace FineUIPro.Web.WeldingProcess.TrustManage
|
||||
private void BindGrid()
|
||||
{
|
||||
string strSql = @"SELECT * FROM dbo.View_Batch_BatchTrustItemSelect
|
||||
WHERE PointBatchItemId IS NOT NULL AND ProjectId=@ProjectId ";
|
||||
WHERE ProjectId=@ProjectId ";
|
||||
|
||||
List<SqlParameter> listStr = new List<SqlParameter>();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user