This commit is contained in:
2024-09-27 18:17:21 +08:00
parent be070f85e2
commit 064a849b97
73 changed files with 3248 additions and 589 deletions
@@ -0,0 +1,55 @@
alter view dbo.View_HJGL_WeldingTask as
SELECT T.WeldTaskId,
T.WeldJointId,
T.CoverWelderId,
T.BackingWelderId,
cov.WelderCode AS CoverWelderCode,
back.WelderCode AS BackingWelderCode,
case when jot.JointAttribute is not null then jot.JointAttribute else T.JointAttribute end as JointAttribute,
T.WeldingMode,
T.ProjectId,
T.UnitWorkId,
T.UnitId,
T.TaskDate,
T.Tabler,
T.TableDate,
jot.WeldJointCode,
jot.Dia,
jot.DNDia,
jot.Thickness,
jot.Size,
jot.WeldingLocationId,
jot.Specification,
CASE WHEN jot.WeldingDailyId IS NULL THEN '·ñ' ELSE 'ÊÇ' END AS IsWelding,
P.PipelineCode,
p.PipelineId,
B.WeldTypeCode,
M.WeldingMethodCode,
L.WeldingLocationCode,
t.CanWelderCode,
t.CanWelderId,
rod.ConsumablesName AS WeldingRodCode,
T.CanWeldingRodName,
T.CanWeldingWireName,
wire.ConsumablesName AS WeldingWireCode,
jot.WeldingDailyId,
p.PipeArea,
mater.MaterialCode,
(case
when charindex('/', jot.WeldJointCode) > 0
then RIGHT(jot.WeldJointCode, CHARINDEX('/', REVERSE(jot.WeldJointCode)) - 1)
else jot.WeldJointCode end) as WeldJointNum
from HJGL_WeldTask T
left join HJGL_WeldJoint jot on T.WeldJointId = jot.WeldJointId
LEFT JOIN dbo.SitePerson_Person cov ON cov.PersonId = t.CoverWelderId and cov.ProjectId = t.ProjectId
LEFT JOIN dbo.SitePerson_Person back ON back.PersonId = t.BackingWelderId and back.ProjectId = t.ProjectId
LEFT join HJGL_Pipeline P on jot.PipelineId = P.PipelineId
left join Base_WeldType B on jot.WeldTypeId = B.WeldTypeId
LEFT join Base_WeldingMethod M on jot.WeldingMethodId = M.WeldingMethodId
left join Base_WeldingLocation L on jot.WeldingLocationId = L.WeldingLocationId
LEFT JOIN Base_Consumables AS wire ON wire.ConsumablesId = jot.WeldingWire
LEFT JOIN Base_Consumables AS rod ON rod.ConsumablesId = jot.WeldingRod
left join Base_Material as mater on jot.Material1Id = mater.MaterialId
go
+119 -1
View File
@@ -1,4 +1,5 @@
using System;
using FineUIPro;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -257,7 +258,124 @@ namespace BLL
BLL.PointBatchDetailService.AutoPoint(pointBatchId);
}
#endregion
/// <summary>
/// 手动点口
/// </summary>
/// <param name="weldJointId"></param>
/// <returns></returns>
public static string ManualPointSave(string weldJointId)
{
string res = "";
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
var PointBatchItemModel = db.HJGL_Batch_PointBatchItem.FirstOrDefault(e => e.WeldJointId == weldJointId);
var PointBatchId= PointBatchItemModel.PointBatchId;
var batch = BLL.PointBatchService.GetPointBatchById(PointBatchId);
if (!batch.EndDate.HasValue)
{
var weldJoint = (from x in db.View_HJGL_WeldJoint
where x.WeldJointId == weldJointId
select x).FirstOrDefault();
Model.Project_Sys_Set batchSet = BLL.Project_SysSetService.GetSysSetBySetId("5", weldJoint.ProjectId);
if (batchSet != null && weldJoint != null)
{
int needJointNum = 0;
int pointNumG = 0;
int pointNumA = 0;
if (batchSet.SetValue.Contains("6")) //按管线组批
{
var pipeline = (from x in db.HJGL_Pipeline
join y in db.HJGL_WeldJoint on x.PipelineId equals y.PipelineId
join z in db.HJGL_Batch_PointBatchItem on y.WeldJointId equals z.WeldJointId
where z.PointBatchId == PointBatchId
select x).FirstOrDefault();
if (pipeline != null)
{
Model.Base_DetectionRate rate = BLL.Base_DetectionRateService.GetDetectionRateByDetectionRateId(pipeline.DetectionRateId);
if (rate != null)
{
int totalJointCount = db.HJGL_WeldJoint.Count(x => x.PipelineId == pipeline.PipelineId);
needJointNum = Convert.ToInt32(Math.Ceiling((totalJointCount * rate.DetectionRateValue.Value) * 0.01));
// 安装口检测数量
pointNumG = Convert.ToInt32(Math.Ceiling(needJointNum * 0.4));
// 预制口要检测的数量
pointNumA = needJointNum - pointNumG;
var pointGNum = (from x in db.HJGL_Batch_PointBatchItem
join y in db.HJGL_WeldJoint on x.WeldJointId equals y.WeldJointId
where y.PipelineId == pipeline.PipelineId && x.PointState == "1" && y.JointAttribute == "安装口"
select x).Count();
var pointNotGNum = (from x in db.HJGL_Batch_PointBatchItem
join y in db.HJGL_WeldJoint on x.WeldJointId equals y.WeldJointId
where y.PipelineId == pipeline.PipelineId && x.PointState == "1" && y.JointAttribute == "预制口"
select x).Count();
if (weldJoint.JointAttribute == "安装口" && pointGNum >= pointNumG)
{
res = "安装口已达检测标准,无需再点此安装口!";
return res;
}
if (weldJoint.JointAttribute == "预制口" && pointNotGNum >= pointNumA)
{
res = "预制口已达检测标准,无需再点此预制口!";
return res;
}
}
}
}
else //不按管线组批
{
string unitWorkId = weldJoint.UnitWorkId;
string rateId = weldJoint.DetectionRateId;
string detectionType = weldJoint.DetectionType;
int totalJointNum = (from x in db.HJGL_WeldJoint
join y in db.HJGL_Pipeline on x.PipelineId equals y.PipelineId
where y.DetectionRateId == rateId && y.UnitWorkId == unitWorkId && y.DetectionType == detectionType
select x).Count();
Model.Base_DetectionRate rate = BLL.Base_DetectionRateService.GetDetectionRateByDetectionRateId(rateId);
if (rate != null)
{
needJointNum = Convert.ToInt32(Math.Ceiling((totalJointNum * rate.DetectionRateValue.Value) * 0.01));
// 安装口检测数量
pointNumG = Convert.ToInt32(Math.Ceiling(needJointNum * 0.4));
// 预制口要检测的数量
pointNumA = needJointNum - pointNumG;
var pointGNum = (from x in db.HJGL_Batch_PointBatchItem
join y in db.HJGL_Batch_PointBatch on x.PointBatchId equals y.PointBatchId
join z in db.HJGL_WeldJoint on x.WeldJointId equals z.WeldJointId
where y.DetectionRateId == rateId && y.UnitWorkId == unitWorkId && y.DetectionTypeId == detectionType
&& x.PointState == "1" && z.JointAttribute == "安装口"
select x).Count();
var pointNotGNum = (from x in db.HJGL_Batch_PointBatchItem
join y in db.HJGL_Batch_PointBatch on x.PointBatchId equals y.PointBatchId
join z in db.HJGL_WeldJoint on x.WeldJointId equals z.WeldJointId
where y.DetectionRateId == rateId && y.UnitWorkId == unitWorkId && y.DetectionTypeId == detectionType
&& x.PointState == "1" && z.JointAttribute == "预制口"
select x).Count();
if (weldJoint.JointAttribute == "安装口" && pointGNum >= pointNumG)
{
res = "安装口已达检测标准,无需再点此安装口!";
return res;
}
if (weldJoint.JointAttribute == "预制口" && pointNotGNum >= pointNumA)
{
res = "预制口已达检测标准,无需再点此预制口!";
return res;
}
}
}
}
PointBatchDetailService.UpdatePointBatchDetail(PointBatchItemModel.PointBatchItemId, "1", System.DateTime.Now);
}
else
{
res = "批已关闭,不能点口!";
}
}
return res;
}
#region
/// <summary>
/// 点口调整
@@ -67,6 +67,7 @@ namespace BLL
where PipelineComponentIdList.Contains(x.PipelineComponentId)
select new PackagingPrepipeItem
{
PipelineComponentId = x.PipelineComponentId,
PipelineComponentCode = x.PipelineComponentCode,
PreUnit = "1/个",
UnitWorkName = z.UnitWorkName,
@@ -101,6 +102,18 @@ namespace BLL
HJGL_PackagingmanageService.UpdateHJGL_PackagingManage(q);
}
}
public static void getSavePackagingInformationById(string packagingManageId, string PipelineComponentIds)
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
var table = db.HJGL_PackagingManage.FirstOrDefault(x => x.PackagingManageId == packagingManageId);
if (table != null)
{
table.PipelineComponentId = PipelineComponentIds;
}
BLL.HJGL_PackagingmanageService.UpdateHJGL_PackagingManage(table);
}
}
}
}
+13 -1
View File
@@ -1,4 +1,5 @@
using System;
using Microsoft.SqlServer.Dts.Runtime;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -45,6 +46,17 @@ namespace BLL
#endregion 线
public static Model.View_HJGL_WeldJoint GetHJGL_WeldJoint(string WeldJointId)
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
// 从数据库中获取符合条件的管线数据
var weldjoint = db.View_HJGL_WeldJoint
.Where(p => p.WeldJointId == WeldJointId)
.FirstOrDefault();
return weldjoint;
}
}
#region
+50 -1
View File
@@ -1,8 +1,11 @@
using System;
using Microsoft.SqlServer.Dts.Runtime;
using NPOI.SS.Formula.Functions;
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using static QRCoder.PayloadGenerator;
namespace BLL
{
@@ -254,6 +257,52 @@ namespace BLL
}
#endregion
public static string SaveWeldingDailyByWeldJointId(string WeldJointId, string Personid, string time)
{
string res = "";
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
var peson=db.Person_Persons.FirstOrDefault(x => x.PersonId == Personid);
if (peson == null)
{
res = "人员不存在";
return res;
}
var joint = db.View_HJGL_WeldJoint.FirstOrDefault(x => x.WeldJointId == WeldJointId);
if (joint == null)
{
res = "焊口不存在";
return res;
}
var weldingDaily = db.HJGL_WeldingDaily.FirstOrDefault(x => x.WeldingDate.Value.Date == Convert.ToDateTime(time).Date);
if (weldingDaily == null)
{
string perfix = string.Format("{0:yyyyMMdd}", System.DateTime.Now) + "-" + peson.PersonName + "-";
weldingDaily = new Model.HJGL_WeldingDaily();
weldingDaily.WeldingDailyId = Guid.NewGuid().ToString();
weldingDaily.WeldingDailyCode = BLL.SQLHelper.RunProcNewId("SpGetThreeNumber", "dbo.HJGL_WeldingDaily", "WeldingDailyCode", joint.ProjectId, perfix);
weldingDaily.WeldingDate = Convert.ToDateTime(time).Date;
weldingDaily.ProjectId = joint.ProjectId;
weldingDaily.UnitWorkId = joint.UnitWorkId;
weldingDaily.UnitId = joint.UnitId;
weldingDaily.Tabler = Personid;
weldingDaily.TableDate = Convert.ToDateTime(time).Date;
db.HJGL_WeldingDaily.InsertOnSubmit(weldingDaily);
db.SubmitChanges();
}
var batchC = BLL.Project_SysSetService.GetSysSetBySetId("5", joint.ProjectId);
if (batchC != null)
{
string batchCondition = batchC.SetValue;
InsertWeldingDailyItem(WeldJointId, Personid, Personid, joint.JointAttribute, weldingDaily.WeldingDate, batchCondition, true, weldingDaily.WeldingDailyId, joint.ProjectId);
}
BLL.WeldJointService.UpdateWeldJointAddG(WeldJointId, joint.JointAttribute, Const.BtnAdd);
}
return res;
}
#region
/// <summary>
/// 保存焊接日报明细
+140 -8
View File
@@ -1,15 +1,18 @@
using System;
using Microsoft.SqlServer.Dts.Runtime;
using Model;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
namespace BLL
{
public class TwArrivalStatisticsService
{
public static IEnumerable GetStatistics(string projectid,string materialCode)
public static List<Tw_ArrivalStatisticsOutPut> GetStatistics(string projectid,string materialCode)
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
@@ -36,12 +39,12 @@ namespace BLL
RealNum = g.Sum(x => x.ActNum) ?? 0,
};
var StatisticsList =from x in NeedOutMateriaList
var StatisticsList =(from x in NeedOutMateriaList
join y in RealInMateriaList on x.Key equals y.Key into gg
from y in gg.DefaultIfEmpty()
join z in db.HJGL_MaterialCodeLib on x.Key equals z.MaterialCode into zz
from z in zz.DefaultIfEmpty()
select new
select new Tw_ArrivalStatisticsOutPut
{
MaterialCode = x.Key,
NeedNum = x.NeedNum,
@@ -49,10 +52,139 @@ namespace BLL
MaterialName = z.MaterialName,
MaterialSpec=z.MaterialSpec,
MaterialUnit=z.MaterialUnit,
};
return StatisticsList.ToList();
MaterialDef = z.MaterialDef,
MatchRate = (x.NeedNum == 0 ?0:Math.Round((y == null ? 0 : y.RealNum) / x.NeedNum, 4,MidpointRounding.ToEven)),
}).ToList();
foreach (var item in StatisticsList)
{
item.MatchRateString = Math.Round(item.MatchRate*100, 2).ToString()+"%" ;
}
return StatisticsList ;
}
}
}
public static List<Tw_PipeMatMatchOutput> GetPipeMatMatch(string projectid, List<string> pipelineIds,string WarehouseCode)
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
var results = new List<Tw_PipeMatMatchOutput>();
// 获取所需材料列表
var requiredMaterials = (from x in db.HJGL_PipeLineMat
join y in db.HJGL_MaterialCodeLib on x.MaterialCode equals y.MaterialCode
join z in db.HJGL_Pipeline on x.PipelineId equals z.PipelineId
where z.ProjectId == projectid && pipelineIds.Contains(z.PipelineId)
select new Tw_PipeMatMatchOutput
{
Id= Guid.NewGuid().ToString(),
PipelineId =x.PipelineId,
PipelineCode=z.PipelineCode,
PrefabricatedComponents=x.PrefabricatedComponents,
MaterialCode = x.MaterialCode,
MaterialName= y.MaterialName,
MaterialSpec= y.MaterialSpec,
MaterialUnit= y.MaterialUnit,
MaterialDef= y.MaterialDef,
NeedNum=x.Number,
}
).ToList();
Tw_MaterialStockOutput tw_MaterialStockOutput=new Tw_MaterialStockOutput();
tw_MaterialStockOutput .WarehouseCode=WarehouseCode;
var stockList= TwMaterialstockService.GetTw_MaterialStockByModle(tw_MaterialStockOutput).ToList();//获取库存列表
// 模拟库存管理
foreach (var material in requiredMaterials)
{
var thisMaterialStockNum = stockList.FirstOrDefault(x => x.PipeLineMatCode == material.MaterialCode)?.StockNum??0;
if (thisMaterialStockNum >= material.NeedNum)
{
material.MatchNum=material.NeedNum;
material.MatchRate=1;
material.MatchRateString="100%";
}
else
{
material.MatchNum = thisMaterialStockNum<0?0:thisMaterialStockNum;
material.MatchRate = (material.NeedNum == 0 ? 0 : material.MatchNum??0 / material.NeedNum);
material.MatchRateString = Math.Round((decimal)material.MatchRate * 100, 2).ToString() + "%";
}
//修改stockList对应的库存数量
var stock = stockList.FirstOrDefault(x => x.PipeLineMatCode == material.MaterialCode);
if (stock != null)
{
stock.StockNum -= material.MatchNum;
}
}
results = requiredMaterials;
return results;
}
}
public static List<Tw_PipeMatMatchOutput> GetMatMatchByOutPlanMasterId(string outPlanMasterId)
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
var results = new List<Tw_PipeMatMatchOutput>();
// 获取所需材料列表
var requiredMaterials = (from x in db.Tw_InOutPlanDetail_Relation
join master in db.Tw_InOutPlanMaster on x.InOutPlanMasterId equals master.Id
join y in db.HJGL_MaterialCodeLib on x.MaterialCode equals y.MaterialCode
join z in db.HJGL_Pipeline on x.PipelineId equals z.PipelineId
where x.InOutPlanMasterId == outPlanMasterId
select new Tw_PipeMatMatchOutput
{
Id = Guid.NewGuid().ToString(),
PipelineId = x.PipelineId,
PipelineCode = z.PipelineCode,
PrefabricatedComponents = x.PrefabricatedComponents,
MaterialCode = x.MaterialCode,
MaterialName = y.MaterialName,
MaterialSpec = y.MaterialSpec,
MaterialUnit = y.MaterialUnit,
MaterialDef = y.MaterialDef,
NeedNum = x.Number,
}
).ToList();
var masterModle = db.Tw_InOutPlanMaster.FirstOrDefault(x => x.Id == outPlanMasterId);
Tw_MaterialStockOutput tw_MaterialStockOutput = new Tw_MaterialStockOutput();
tw_MaterialStockOutput.WarehouseCode = masterModle.WarehouseCode;
var stockList = TwMaterialstockService.GetTw_MaterialStockByModle(tw_MaterialStockOutput).ToList();//获取库存列表
// 模拟库存管理
foreach (var material in requiredMaterials)
{
var thisMaterialStockNum = stockList.FirstOrDefault(x => x.PipeLineMatCode == material.MaterialCode)?.StockNum ?? 0;
if (thisMaterialStockNum >= material.NeedNum)
{
material.MatchNum = material.NeedNum;
material.MatchRate = 1;
material.MatchRateString = "100%";
}
else
{
material.MatchNum = thisMaterialStockNum < 0 ? 0 : thisMaterialStockNum;
material.MatchRate = (material.NeedNum == 0 ? 0 : material.MatchNum ?? 0 / material.NeedNum);
material.MatchRateString = Math.Round((decimal)material.MatchRate * 100, 2).ToString() + "%";
}
//修改stockList对应的库存数量
var stock = stockList.FirstOrDefault(x => x.PipeLineMatCode == material.MaterialCode);
if (stock != null)
{
stock.StockNum -= material.MatchNum;
}
}
results = requiredMaterials;
return results;
}
}
}
}
+20
View File
@@ -42,6 +42,26 @@ namespace BLL
{ "补料出库" ,(int)TypeInt.},
{ "其他出库" ,(int)TypeInt.},
{ "散件出库" ,(int)TypeInt.}
};
public static Dictionary<string, int> PlanPrintMap = new Dictionary<string, int>
{
{ "采购通知单" ,(int)TypeInt.},
{ "退料通知单" ,(int)TypeInt.退},
{ "其他入库通知单" ,(int)TypeInt.},
{ "材料领用申请单" ,(int)TypeInt.},
{ "补料申请单" ,(int)TypeInt.},
{ "其他出库申请单" ,(int)TypeInt.},
{ "散件出库申请单" ,(int)TypeInt.}
};
public static Dictionary<string, int> PrintMap = new Dictionary<string, int>
{
{ "采购入库单" ,(int)TypeInt.},
{ "退料入库单" ,(int)TypeInt.退},
{ "其他入库单" ,(int)TypeInt.},
{ "材料出库单" ,(int)TypeInt.},
{ "补料出库单" ,(int)TypeInt.},
{ "其他出库单" ,(int)TypeInt.},
{ "散件出库单" ,(int)TypeInt.}
};
public static Dictionary<string, int> StateMap = new Dictionary<string, int>
{
@@ -70,7 +70,7 @@ namespace BLL
x.PrefabricatedComponents,
x.Number,
mat.MaterialName,
mat.MaterialDef
};
}
#endregion
+7 -1
View File
@@ -27,7 +27,11 @@ namespace BLL
join y in Funs.DB.HJGL_Pipeline_Component on x.PipelineComponentId equals y.PipelineComponentId into yy
from y in yy.DefaultIfEmpty()
join mat in Funs.DB.HJGL_MaterialCodeLib on x.MaterialCode equals mat.MaterialCode into mm
from mat in mm.DefaultIfEmpty()
from mat in mm.DefaultIfEmpty()
join master in Funs.DB.Tw_InOutPlanMaster on x.InOutPlanMasterId equals master.Id into masters
from master in masters.DefaultIfEmpty()
join stock in Funs.DB.Tw_MaterialStock on new { x.MaterialCode, master.WarehouseCode } equals new { MaterialCode = stock.PipeLineMatCode, stock.WarehouseCode } into st
from stock in st.DefaultIfEmpty()
where
(string.IsNullOrEmpty(table.Id) || x.Id.Contains(table.Id)) &&
(string.IsNullOrEmpty(table.InOutPlanMasterId) || x.InOutPlanMasterId.Contains(table.InOutPlanMasterId)) &&
@@ -43,6 +47,8 @@ namespace BLL
ActNum = x.ActNum,
PipelineComponentCode = y.PipelineComponentCode,
MaterialName = mat.MaterialName,
MaterialDef= mat.MaterialDef,
StockNum = stock.StockNum ?? 0,
}
;
+32 -7
View File
@@ -1,6 +1,7 @@
using EmitMapper;
using FineUIPro;
using Microsoft.Office.Interop.Word;
using Microsoft.SqlServer.Dts.Runtime;
using MiniExcelLibs;
using Model;
using NPOI.Util;
@@ -213,10 +214,6 @@ namespace BLL
responeData.message = "导入数据为空!";
return responeData;
}
var queryAll = new Tw_InOutMasterOutput()
{
ProjectId = projectid
};
var warehouseCodeList = temeplateDtoIns.Select(x => x.WarehouseCode).Distinct().ToList(); //获取导入文件的仓库编号
string errorWarehouseCode = "";
foreach (var item in warehouseCodeList)
@@ -251,7 +248,15 @@ namespace BLL
return responeData;
}
}
string cusbilcode = GetDataInCusBillCode(projectid,UnitService.GetUnitCodeByUnitId(Person_PersonsService.GetPerson_PersonsById(creatUserId).UnitId));
foreach (var item in temeplateDtoIns)
{
item.CusBillCode = cusbilcode;
}
/*var queryAll = new Tw_InOutMasterOutput()
{
ProjectId = projectid
};
var queryAllresult = GetModle(queryAll).Select(x => x.CusBillCode).Distinct().ToList();//查询所有的编号
var CusBillCodeList = temeplateDtoIns.Select(x => x.CusBillCode).Distinct().ToList(); //获取导入文件的编号
var IsContain = CusBillCodeList.Intersect(queryAllresult).ToList(); //判断导入文件中是有已存在的编号
@@ -260,7 +265,8 @@ namespace BLL
responeData.code = 0;
responeData.message = string.Join(",", IsContain)+ "编号已存在!";
return responeData;
}
}*/
var CusBillCodeList = temeplateDtoIns.Select(x => x.CusBillCode).Distinct().ToList(); //获取导入文件的编号
#endregion
//根据申请单编号分组插入数据
foreach (var CusBillCode in CusBillCodeList)
@@ -510,6 +516,23 @@ namespace BLL
return cusBillCode;
}
public static string GetDataInCusBillCode(string projectid, string unitcode)
{
//生成规则是20240919-unitcode-AP-GR01
string cusBillCode = string.Format("{0:yyyyMMdd}", DateTime.Now) + unitcode + "-AP-GR";
var queryAll = new Tw_InOutMasterOutput()
{
ProjectId = projectid,
CusBillCode=cusBillCode,
};
var queryAllresult = GetModle(queryAll).Count();
cusBillCode = cusBillCode + (queryAllresult + 1).ToString().PadLeft(2, '0');
return cusBillCode;
}
/// <summary>
/// 根据任务单生成出库计划单
/// </summary>
@@ -655,5 +678,7 @@ namespace BLL
}
}
}
}
+1
View File
@@ -45,6 +45,7 @@ namespace BLL
ActNum = x.ActNum,
PipelineComponentCode = y.PipelineComponentCode,
MaterialName = mat.MaterialName,
MaterialDef = mat.MaterialDef
}
;
+1 -1
View File
@@ -218,7 +218,7 @@ namespace BLL
/// <summary>
/// 根据计划单生成入库单
/// </summary>
public static void GenInMasterByPlanId(string planId, List<Model.Tw_InputDetail> detailLists)
public static void GenInMasterByPlanId(string planId, List<Model.Tw_InputDetail> detailLists,string remark)
{
//获取计划单
var planQueryModel = new Tw_InOutMasterOutput();
+2 -1
View File
@@ -42,7 +42,8 @@ namespace BLL
ProjectId = x.ProjectId,
MaterialName = mat.MaterialName,
MaterialSpec = mat.MaterialSpec,
MaterialUnit = mat.MaterialUnit,
MaterialUnit = mat.MaterialUnit,
MaterialDef = mat.MaterialDef
}
;
+6 -3
View File
@@ -27,9 +27,11 @@ namespace BLL
var q = from x in Funs.DB.Tw_OutputDetail
join y in Funs.DB.HJGL_Pipeline_Component on x.PipelineComponentId equals y.PipelineComponentId into yy
from y in yy.DefaultIfEmpty()
join mat in Funs.DB.HJGL_MaterialCodeLib on x.MaterialCode equals mat.MaterialCode into mm
join mat in Funs.DB.HJGL_MaterialCodeLib on x.MaterialCode equals mat.MaterialCode into mm
from mat in mm.DefaultIfEmpty()
join stock in Funs.DB.Tw_MaterialStock on x.MaterialCode equals stock.PipeLineMatCode into st
join master in Funs.DB.Tw_OutputMaster on x.OutputMasterId equals master.Id into masters
from master in masters.DefaultIfEmpty()
join stock in Funs.DB.Tw_MaterialStock on new { x.MaterialCode,master.WarehouseCode} equals new { MaterialCode=stock.PipeLineMatCode,stock.WarehouseCode } into st
from stock in st.DefaultIfEmpty()
where
(string.IsNullOrEmpty(table.Id) || x.Id.Contains(table.Id)) &&
@@ -48,7 +50,8 @@ namespace BLL
MaterialName = mat.MaterialName,
StockNum = stock.StockNum ?? 0,
DiffNum = (x.ActNum??0) - (x.PlanNum??0),
}
MaterialDef = mat.MaterialDef
}
;
return q;
@@ -203,7 +203,7 @@ namespace BLL
model.PipelineComponentId = SQLHelper.GetNewID();
model.PipelineId = PipelineId;
model.PipelineComponentCode = model_mat.PrefabricatedComponents;
model.DrawingName = model_mat.PrefabricatedComponents.Substring(0, model_mat.PrefabricatedComponents.LastIndexOf('-')).Replace("\"", "");
model.DrawingName = model_mat.PrefabricatedComponents?.Substring(0, model_mat.PrefabricatedComponents.LastIndexOf('-')).Replace("\"", "");
model.State = state_0;
model.ProductionState = 0;
model.IsPrint = false;
+29 -21
View File
@@ -340,30 +340,38 @@ namespace BLL
/// <returns></returns>
public static List<string> GetNoComPipelinesByUnitWordId(string unitworkId)
{
var q = (from x in Funs.DB.View_HJGL_WeldJoint
where x.UnitWorkId == unitworkId
select new
{
PipelineId = x.PipelineId,
WeldingDate = x.WeldingDate,
PipelineCode = x.PipelineCode
}).Distinct();
if (q.Count() == 0)
var q = Funs.DB.View_HJGL_WeldJoint
.Where(x => x.UnitWorkId == unitworkId)
.Select(x => new
{
x.PipelineId,
x.WeldingDate,
x.PipelineCode
})
.Distinct()
.ToList(); // 立即执行查询并加载数据
if (q.Count == 0)
{
return new List<string>();
}
var noCompipeline = from x in q
group x by x.PipelineId into g
select new
{
PipelineId = g.Key,
Count = (from x2 in g where x2.WeldingDate != null && x2.WeldingDate != "" select x2).Count(),
};
var NowComPipelineCode = (from x in q
join y in noCompipeline on x.PipelineId equals y.PipelineId
where y.Count == 0
select x.PipelineCode
).Distinct().ToList();
// 分组并计算焊接日期不为null或空字符串的数量
var noCompipeline = q.GroupBy(x => x.PipelineId)
.Select(g => new
{
PipelineId = g.Key,
Count = g.Count(x => !string.IsNullOrEmpty(x.WeldingDate)) // 直接计算
})
.ToList(); // 立即执行查询并加载数据
// 过滤出未完成的管道代码
var NowComPipelineCode = noCompipeline
.Where(y => y.Count == 0)
.Join(q, y => y.PipelineId, x => x.PipelineId, (y, x) => x.PipelineCode)
.Distinct()
.ToList();
return NowComPipelineCode;
}
/// <summary>
@@ -30,7 +30,7 @@
ShowHeader="false" Layout="VBox" BoxConfigAlign="Stretch">
<Items>
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="到货统计分析表" EnableCollapse="true"
runat="server" BoxFlex="1" DataKeyNames="MaterialCode" AllowCellEditing="true"
runat="server" BoxFlex="1" DataKeyNames="MaterialCode" AllowCellEditing="true" ForceFit="true"
ClicksToEdit="2" DataIDField="MaterialCode" AllowSorting="true" SortField="MaterialCode"
SortDirection="DESC" OnSort="Grid1_Sort" EnableColumnLines="true"
AllowPaging="true" IsDatabasePaging="true" PageSize="10" OnPageIndexChange="Grid1_PageIndexChange">
@@ -38,6 +38,7 @@
<f:Toolbar ID="Toolbar2" Position="Top" runat="server" ToolbarAlign="Right">
<Items>
<f:TextBox runat="server" ID="txtMaterialCode" Label="材料编码" EmptyText="输入查询条件" Width="230px" LabelWidth="70px"></f:TextBox>
<f:Label runat="server" ID="lbRate"></f:Label>
<f:ToolbarFill ID="ToolbarFill1" runat="server">
</f:ToolbarFill>
<f:Button ID="btnSearch" ToolTip="查询" Icon="SystemSearch" runat="server" Text="查询" OnClick="btnSearch_Click">
@@ -61,6 +62,9 @@
<f:RenderField Width="150px" ColumnID="MaterialName" DataField="MaterialName" SortField="MaterialName"
FieldType="String" HeaderText="类型" TextAlign="Left" HeaderTextAlign="Center">
</f:RenderField>
<f:RenderField Width="300px" ColumnID="MaterialDef" DataField="MaterialDef" SortField="MaterialDef"
FieldType="String" HeaderText="材料描述" TextAlign="Left" HeaderTextAlign="Center">
</f:RenderField>
<f:RenderField Width="150px" ColumnID="MaterialSpec" DataField="MaterialSpec" SortField="MaterialSpec"
FieldType="String" HeaderText="规格" TextAlign="Left" HeaderTextAlign="Center">
</f:RenderField>
@@ -73,7 +77,9 @@
<f:RenderField Width="150px" ColumnID="RealNum" DataField="RealNum" SortField="RealNum"
FieldType="String" HeaderText="到货量" TextAlign="Left" HeaderTextAlign="Center">
</f:RenderField>
<f:RenderField Width="150px" ColumnID="MatchRateString" DataField="MatchRateString" SortField="MatchRateString"
FieldType="String" HeaderText="匹配率" TextAlign="Left" HeaderTextAlign="Center">
</f:RenderField>
</Columns>
<%-- <Listeners>
<f:Listener Event="beforerowcontextmenu" Handler="onRowContextMenu" />
@@ -28,7 +28,9 @@ namespace FineUIPro.Web.CLGL
/// </summary>
private void BindGrid()
{
var tb = BLL.TwArrivalStatisticsService.GetStatistics(this.CurrUser.LoginProjectId, txtMaterialCode.Text.Trim());
var tb = BLL.TwArrivalStatisticsService.GetStatistics(this.CurrUser.LoginProjectId, txtMaterialCode.Text.Trim());
lbRate.Text="匹配率:"+ Math.Round( tb.Sum(x=>x.MatchRate)*100/tb.Count() ,4) + "%";
//tb = GetFilteredTable(Grid1.FilteredData, tb);
Grid1.DataSource = tb;
Grid1.DataBind();
+10 -1
View File
@@ -60,7 +60,7 @@ namespace FineUIPro.Web.CLGL
protected global::FineUIPro.Toolbar Toolbar2;
/// <summary>
/// txtMaterialCode 控件。
/// txtMaterialCode 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
@@ -68,6 +68,15 @@ namespace FineUIPro.Web.CLGL
/// </remarks>
protected global::FineUIPro.TextBox txtMaterialCode;
/// <summary>
/// lbRate 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Label lbRate;
/// <summary>
/// ToolbarFill1 控件。
/// </summary>
+16 -7
View File
@@ -22,6 +22,7 @@
.f-grid-row.red {
background-color: Yellow;
}
</style>
</head>
<body>
@@ -40,7 +41,7 @@
ClicksToEdit="2" DataIDField="Id" AllowSorting="true" SortField="Id"
SortDirection="DESC" OnSort="Grid1_Sort" EnableColumnLines="true"
AllowPaging="true" IsDatabasePaging="true" PageSize="10" OnPageIndexChange="Grid1_PageIndexChange"
EnableRowClickEvent="true" OnRowClick="Grid1_RowClick">
EnableRowClickEvent="true" OnRowClick="Grid1_RowClick" OnRowCommand="Grid1_RowCommand">
<Toolbars>
<f:Toolbar ID="Toolbar2" Position="Top" runat="server" ToolbarAlign="Right">
<Items>
@@ -107,6 +108,7 @@
<f:RenderField Width="150px" ColumnID="Remark" DataField="Remark" SortField="Remark"
FieldType="String" HeaderText="备注" TextAlign="Left" HeaderTextAlign="Center">
</f:RenderField>
<f:LinkButtonField Width="150px" ColumnID="btnInPlanMasterPrint" TextAlign="Center" CommandName="btnInPlanMasterPrint" Text="申请单打印" />
</Columns>
<Listeners>
<f:Listener Event="beforerowcontextmenu" Handler="onRowContextMenu" />
@@ -131,16 +133,16 @@
</Items>
</f:Panel>
<f:Panel runat="server" ID="panelBottomRegion" RegionPosition="Bottom" RegionSplit="true" RegionSplitWidth="20px" EnableCollapse="true"
<f:Panel runat="server" ID="panelBottomRegion" RegionPosition="Bottom" RegionSplit="true" RegionSplitWidth="20px" EnableCollapse="true"
Title="底部面板" ShowBorder="false" RegionPercent="40%" ShowHeader="false" BodyPadding="1px" Layout="Fit">
<Items>
<f:Panel ID="Panel3" runat="server" Margin="5px" BodyPadding="5px" ShowBorder="false" AutoScroll="true"
ShowHeader="false" Layout="VBox" BoxConfigAlign="Stretch">
<Items>
<f:Grid ID="Grid2" ShowBorder="true" ShowHeader="true" Title="入库申请明细表" EnableCollapse="true" ForceFit="true"
runat="server" BoxFlex="1" DataKeyNames="Id" AllowCellEditing="true"
<f:Grid ID="Grid2" ShowBorder="true" ShowHeader="true" Title="入库申请明细表" EnableCollapse="true" ForceFit="true"
runat="server" BoxFlex="1" DataKeyNames="Id" AllowCellEditing="true"
ClicksToEdit="2" DataIDField="Id" AllowSorting="true" SortField="MaterialCode"
SortDirection="DESC" EnableColumnLines="true" EnableBigData="true"
SortDirection="DESC" EnableColumnLines="true"
AllowPaging="true" IsDatabasePaging="true" PageSize="10000" >
<Columns>
<f:TemplateField ColumnID="tfNumber" Width="50px" HeaderText="序号" HeaderTextAlign="Center"
@@ -152,9 +154,12 @@
<f:RenderField Width="150px" ColumnID="MaterialCode" DataField="MaterialCode" SortField="MaterialCode"
FieldType="String" HeaderText="材料编码" TextAlign="Left" HeaderTextAlign="Center">
</f:RenderField>
<f:RenderField Width="150px" ColumnID="MaterialName" DataField="MaterialName" SortField="MaterialName"
<f:RenderField Width="100px" ColumnID="MaterialName" DataField="MaterialName" SortField="MaterialName"
FieldType="String" HeaderText="材料名称" TextAlign="Left" HeaderTextAlign="Center">
</f:RenderField>
<f:RenderField Width="300px" ColumnID="MaterialDef" DataField="MaterialDef" SortField="MaterialDef"
FieldType="String" HeaderText="材料描述" TextAlign="Left" HeaderTextAlign="Center">
</f:RenderField>
<f:RenderField Width="150px" ColumnID="PlanNum" DataField="PlanNum" SortField="PlanNum"
FieldType="String" HeaderText="数量" TextAlign="Left" HeaderTextAlign="Center">
</f:RenderField>
@@ -169,9 +174,13 @@
<f:Window ID="Window1" runat="server" Hidden="true" ShowHeader="true"
IsModal="true" Target="Parent" EnableMaximize="true" EnableResize="true" OnClose="Window1_Close"
Title="编辑Tw_InOutPlanMaster" EnableIFrame="true" Height="650px"
Title="入库申请" EnableIFrame="true" Height="650px"
Width="1200px">
</f:Window>
<f:Window ID="Window2" Title="打印" Hidden="true" EnableIFrame="true"
EnableMaximize="true" Target="Top" EnableResize="false" runat="server"
IsModal="true" Width="1010px" Height="660px">
</f:Window>
<f:Menu ID="Menu1" runat="server">
<f:MenuButton ID="btnMenuEdit" OnClick="btnEdit_Click" EnablePostBack="true"
Hidden="true" runat="server" Text="编辑" Icon="TableEdit">
@@ -1,7 +1,10 @@
using BLL;
using FineUIPro.Web.HSSE.EduTrain;
using Model;
using System;
using System.Collections.Generic;
using System.Data;
using System.IO;
using System.Linq;
using System.Text;
using System.Web;
@@ -395,8 +398,118 @@ namespace FineUIPro.Web.CLGL
return sb.ToString();
}
#endregion
protected void Grid1_RowCommand(object sender, GridCommandEventArgs e)
{
if (e.CommandName == "btnInPlanMasterPrint")
{
Print(e.RowID);
}
}
private void Print(string Id)
{
BLL.FastReportService.ResetData();
if (string.IsNullOrEmpty(Id))
{
ShowNotify("请选择要打印的项", MessageBoxIcon.Warning);
return;
}
Tw_InOutMasterOutput queryModel = new Tw_InOutMasterOutput()
{
Id = Id
};
var result =TwInOutplanmasterService.GetListData(queryModel).FirstOrDefault();
List<Model.Tw_PrintMaster> tw_PrintMasters = new List<Model.Tw_PrintMaster>();
List<Model.Tw_PrintDetail> tw_PrintDetails = new List<Model.Tw_PrintDetail>();
Model.Tw_PrintMaster printMaster = new Model.Tw_PrintMaster
{
ReqUnitName = result.ReqUnitName,
CusBillCode = result.CusBillCode,
CreateDate = result.CreateDate.Value.ToString("yyyy-MM-dd"),
ProjectName = ProjectService.GetProjectNameByProjectId(result.ProjectId),
CategoryString = result.CategoryString,
BillName = TwConst.PlanPrintMap.Where(x => x.Value == result.TypeInt).Select(x => x.Key).FirstOrDefault(),
};
tw_PrintMasters.Add(printMaster);
DataTable Table1 = LINQToDataTable(tw_PrintMasters);
if (Table1 != null)
{
Table1.TableName = "Table1";
}
Tw_InOutPlanDetail_Relation queryModel2 = new Tw_InOutPlanDetail_Relation()
{
InOutPlanMasterId = Id
};
var ListDetailRelation =TwInoutplandetailRelationService.GetTw_InOutPlanDetail_RelationByModle(queryModel2).ToList();
int SortIndex = 1;
int SortIndex2 = 1;
var tw_PrintDetailRelation=(from x in ListDetailRelation
join y in Funs.DB.HJGL_MaterialCodeLib on x.MaterialCode equals y.MaterialCode
join z in Funs.DB.HJGL_Pipeline on x.PipelineId equals z.PipelineId
join m in Funs.DB.WBS_UnitWork on z.UnitWorkId equals m.UnitWorkId
select new Model.Tw_PrintDetail
{
SortIndex=SortIndex++,
PipelineCode=z.PipelineCode,
PipelineComponentCode=x.PrefabricatedComponents,
MaterialCode=y.MaterialCode,
MaterialDef=y.MaterialDef,
MaterialSpec=y.MaterialSpec,
MaterialUnit=y.MaterialUnit,
PlanNum = (x.Number ?? 0).ToString(),
UnitWorkName = m.UnitWorkName,
}).ToList();
var UnitWorkName= tw_PrintDetailRelation.FirstOrDefault()?.UnitWorkName;
Tw_PrintDetail tw_PrintDetailRelation2 = new Tw_PrintDetail
{
MaterialDef = "材料编码合计"
};
var tw_PrintDetail = ( from x in Funs.DB.Tw_InOutPlanDetail
join y in Funs.DB.HJGL_MaterialCodeLib on x.MaterialCode equals y.MaterialCode
where x.InOutPlanMasterId==Id
select new Model.Tw_PrintDetail
{
SortIndex =0,
PipelineCode = "-",
PipelineComponentCode = "-",
MaterialCode = y.MaterialCode,
MaterialDef = y.MaterialDef,
MaterialSpec = y.MaterialSpec,
MaterialUnit = y.MaterialUnit,
PlanNum = (x.PlanNum ?? 0).ToString(),
ActNum = (x.ActNum ?? 0).ToString(),
UnitWorkName = UnitWorkName,
}).ToList();
foreach (var item in tw_PrintDetail)
{
item.SortIndex = SortIndex2++;
}
tw_PrintDetails.AddRange(tw_PrintDetailRelation);
tw_PrintDetails.Add(tw_PrintDetailRelation2);
tw_PrintDetails.AddRange(tw_PrintDetail);
DataTable Data = LINQToDataTable(tw_PrintDetails);
if (Data != null)
{
Data.TableName = "Data";
}
BLL.FastReportService.ResetData();
BLL.FastReportService.AddFastreportTable(Table1);
BLL.FastReportService.AddFastreportTable(Data);
string initTemplatePath = "";
string rootPath = Server.MapPath("~/");
initTemplatePath = "File\\Fastreport\\材料入库计划单.frx";
if (File.Exists(rootPath + initTemplatePath))
{
PageContext.RegisterStartupScript(Window2.GetShowReference(String.Format("~/Controls/Fastreport.aspx?ReportPath={0}", rootPath + initTemplatePath)));
}
}
}
}
+9
View File
@@ -239,6 +239,15 @@ namespace FineUIPro.Web.CLGL
/// </remarks>
protected global::FineUIPro.Window Window1;
/// <summary>
/// Window2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Window Window2;
/// <summary>
/// Menu1 控件。
/// </summary>
@@ -49,6 +49,8 @@
<f:TextBox ID="txtCreateDate" Label="发起时间" Readonly="true" ColumnWidth="30%" runat="server"></f:TextBox>
<f:TextBox ID="txtReqUnitName" Label="领料单位" ColumnWidth="30%" runat="server" Hidden="true">
</f:TextBox>
<f:TextBox ID="txtRemark" Label="备注" runat="server" ColumnWidth="30%">
</f:TextBox>
</Items>
</f:Panel>
@@ -57,9 +59,7 @@
DataIDField="Id" EnableColumnLines="true" Height="400" EnableBigData="true"
EnableTextSelection="True">
<Columns>
<f:RenderField Width="150px" ColumnID="PipelineComponent" DataField="PipelineComponent" SortField="PipelineComponent"
FieldType="String" HeaderText="预制组件号" TextAlign="Left" HeaderTextAlign="Center">
</f:RenderField>
<f:RenderField Width="150px" ColumnID="MaterialCode" DataField="MaterialCode" SortField="MaterialCode"
FieldType="String" HeaderText="材料编码" TextAlign="Left" HeaderTextAlign="Center">
</f:RenderField>
@@ -88,7 +88,7 @@ namespace FineUIPro.Web.CLGL
protected void btnSave_Click(object sender, EventArgs e)
{
TwInputmasterService.GenInMasterByPlanId(Id, SaveDetail(Id));
TwInputmasterService.GenInMasterByPlanId(Id, SaveDetail(Id),txtRemark.Text);
ShowNotify("保存成功!", MessageBoxIcon.Success);
PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference());
}
@@ -122,6 +122,15 @@ namespace FineUIPro.Web.CLGL
/// </remarks>
protected global::FineUIPro.TextBox txtReqUnitName;
/// <summary>
/// txtRemark 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtRemark;
/// <summary>
/// Grid1 控件。
/// </summary>
+12 -4
View File
@@ -20,7 +20,7 @@
}
.f-grid-row.red {
background-color: Yellow;
background-color: darkgoldenrod;
}
</style>
</head>
@@ -40,7 +40,7 @@
ClicksToEdit="2" DataIDField="Id" AllowSorting="true" SortField="Id"
SortDirection="DESC" OnSort="Grid1_Sort" EnableColumnLines="true"
AllowPaging="true" IsDatabasePaging="true" PageSize="10" OnPageIndexChange="Grid1_PageIndexChange"
EnableRowDoubleClickEvent="true" OnRowDoubleClick="Grid1_RowDoubleClick" EnableRowClickEvent="true" OnRowClick="Grid1_RowClick">
EnableRowDoubleClickEvent="true" OnRowDoubleClick="Grid1_RowDoubleClick" EnableRowClickEvent="true" OnRowClick="Grid1_RowClick" OnRowCommand="Grid1_RowCommand">
<Toolbars>
<f:Toolbar ID="Toolbar2" Position="Top" runat="server" ToolbarAlign="Right">
<Items>
@@ -93,6 +93,7 @@
<f:RenderField Width="150px" ColumnID="Remark" DataField="Remark" SortField="Remark"
FieldType="String" HeaderText="备注" TextAlign="Left" HeaderTextAlign="Center">
</f:RenderField>
<f:LinkButtonField Width="150px" ColumnID="btnInPlanMasterPrint" TextAlign="Center" CommandName="btnInPlanMasterPrint" Text="入库单打印" />
</Columns>
<Listeners>
<f:Listener Event="beforerowcontextmenu" Handler="onRowContextMenu" />
@@ -126,7 +127,7 @@
<f:Grid ID="Grid2" ShowBorder="true" ShowHeader="true" Title="入库申请明细表" EnableCollapse="true" ForceFit="true"
runat="server" BoxFlex="1" DataKeyNames="Id" AllowCellEditing="true"
ClicksToEdit="2" DataIDField="Id" AllowSorting="true" SortField="Id"
SortDirection="DESC" EnableColumnLines="true" EnableBigData="true"
SortDirection="DESC" EnableColumnLines="true"
AllowPaging="true" IsDatabasePaging="true" PageSize="10000">
<Columns>
<f:TemplateField ColumnID="tfNumber" Width="50px" HeaderText="序号" HeaderTextAlign="Center"
@@ -138,9 +139,12 @@
<f:RenderField Width="150px" ColumnID="MaterialCode" DataField="MaterialCode" SortField="MaterialCode"
FieldType="String" HeaderText="材料编码" TextAlign="Left" HeaderTextAlign="Center">
</f:RenderField>
<f:RenderField Width="150px" ColumnID="MaterialName" DataField="MaterialName" SortField="MaterialName"
<f:RenderField Width="100px" ColumnID="MaterialName" DataField="MaterialName" SortField="MaterialName"
FieldType="String" HeaderText="材料名称" TextAlign="Left" HeaderTextAlign="Center">
</f:RenderField>
<f:RenderField Width="300px" ColumnID="MaterialDef" DataField="MaterialDef" SortField="MaterialDef"
FieldType="String" HeaderText="材料描述" TextAlign="Left" HeaderTextAlign="Center">
</f:RenderField>
<f:RenderField Width="150px" ColumnID="PlanNum" DataField="PlanNum" SortField="PlanNum"
FieldType="String" HeaderText="计划数量" TextAlign="Left" HeaderTextAlign="Center">
</f:RenderField>
@@ -161,6 +165,10 @@
Title="编辑Tw_InOutPlanMaster" EnableIFrame="true" Height="650px"
Width="1200px">
</f:Window>
<f:Window ID="Window2" Title="打印" Hidden="true" EnableIFrame="true"
EnableMaximize="true" Target="Top" EnableResize="false" runat="server"
IsModal="true" Width="1010px" Height="660px">
</f:Window>
<f:Menu ID="Menu1" runat="server">
<f:MenuButton ID="btnMenuEdit" OnClick="btnEdit_Click" EnablePostBack="true"
Hidden="true" runat="server" Text="编辑" Icon="TableEdit">
+121
View File
@@ -1,6 +1,9 @@
using BLL;
using Model;
using System;
using System.Collections.Generic;
using System.Data;
using System.IO;
using System.Linq;
using System.Text;
using System.Web;
@@ -69,6 +72,15 @@ namespace FineUIPro.Web.CLGL
var tb = BLL.TwInputdetailService.GetListData(table, Grid2);
Grid2.DataSource = tb;
Grid2.DataBind();
for (int i = 0; i < Grid2.Rows.Count; i++)
{
var model = Grid2.Rows[i].DataItem as Model.Tw_InOutDetailOutput;
if (model.ActNum != model.PlanNum)
{
Grid2.Rows[i].RowCssClass = "red";
}
}
}
#endregion
@@ -278,8 +290,117 @@ namespace FineUIPro.Web.CLGL
return sb.ToString();
}
#endregion
protected void Grid1_RowCommand(object sender, GridCommandEventArgs e)
{
if (e.CommandName == "btnInPlanMasterPrint")
{
Print(e.RowID);
}
}
private void Print(string Id)
{
BLL.FastReportService.ResetData();
if (string.IsNullOrEmpty(Id))
{
ShowNotify("请选择要打印的项", MessageBoxIcon.Warning);
return;
}
Tw_InOutMasterOutput queryModel = new Tw_InOutMasterOutput()
{
Id = Id
};
var result = TwInputmasterService.GetListData(queryModel).FirstOrDefault();
List<Model.Tw_PrintMaster> tw_PrintMasters = new List<Model.Tw_PrintMaster>();
List<Model.Tw_PrintDetail> tw_PrintDetails = new List<Model.Tw_PrintDetail>();
Model.Tw_PrintMaster printMaster = new Model.Tw_PrintMaster
{
ReqUnitName = result.ReqUnitName,
CusBillCode = result.CusBillCode,
CreateDate = result.CreateDate.Value.ToString("yyyy-MM-dd"),
ProjectName = ProjectService.GetProjectNameByProjectId(result.ProjectId),
CategoryString = result.CategoryString,
BillName = TwConst.PrintMap.Where(x => x.Value == result.TypeInt).Select(x => x.Key).FirstOrDefault(),
};
tw_PrintMasters.Add(printMaster);
DataTable Table1 = LINQToDataTable(tw_PrintMasters);
if (Table1 != null)
{
Table1.TableName = "Table1";
}
Tw_InOutPlanDetail_Relation queryModel2 = new Tw_InOutPlanDetail_Relation()
{
InOutPlanMasterId = Id
};
var ListDetailRelation = TwInoutplandetailRelationService.GetTw_InOutPlanDetail_RelationByModle(queryModel2).ToList();
int SortIndex = 1;
int SortIndex2 = 1;
var tw_PrintDetailRelation = (from x in ListDetailRelation
join y in Funs.DB.HJGL_MaterialCodeLib on x.MaterialCode equals y.MaterialCode
join z in Funs.DB.HJGL_Pipeline on x.PipelineId equals z.PipelineId
join m in Funs.DB.WBS_UnitWork on z.UnitWorkId equals m.UnitWorkId
select new Model.Tw_PrintDetail
{
SortIndex = SortIndex++,
PipelineCode = z.PipelineCode,
PipelineComponentCode = x.PrefabricatedComponents,
MaterialCode = y.MaterialCode,
MaterialDef = y.MaterialDef,
MaterialSpec = y.MaterialSpec,
MaterialUnit = y.MaterialUnit,
PlanNum = (x.Number ?? 0).ToString(),
UnitWorkName = m.UnitWorkName,
}).ToList();
var UnitWorkName = tw_PrintDetailRelation.FirstOrDefault()?.UnitWorkName;
Tw_PrintDetail tw_PrintDetailRelation2 = new Tw_PrintDetail
{
MaterialDef = "材料编码合计"
};
var tw_PrintDetail = (from x in Funs.DB.Tw_InputDetail
join y in Funs.DB.HJGL_MaterialCodeLib on x.MaterialCode equals y.MaterialCode
where x.InputMasterId == Id
select new Model.Tw_PrintDetail
{
SortIndex = 0,
PipelineCode = "-",
PipelineComponentCode = "-",
MaterialCode = y.MaterialCode,
MaterialDef = y.MaterialDef,
MaterialSpec = y.MaterialSpec,
MaterialUnit = y.MaterialUnit,
PlanNum = (x.PlanNum ?? 0).ToString(),
ActNum = (x.ActNum ?? 0).ToString(),
UnitWorkName = UnitWorkName,
}).ToList();
foreach (var item in tw_PrintDetail)
{
item.SortIndex = SortIndex2++;
}
tw_PrintDetails.AddRange(tw_PrintDetailRelation);
tw_PrintDetails.Add(tw_PrintDetailRelation2);
tw_PrintDetails.AddRange(tw_PrintDetail);
DataTable Data = LINQToDataTable(tw_PrintDetails);
if (Data != null)
{
Data.TableName = "Data";
}
BLL.FastReportService.ResetData();
BLL.FastReportService.AddFastreportTable(Table1);
BLL.FastReportService.AddFastreportTable(Data);
string initTemplatePath = "";
string rootPath = Server.MapPath("~/");
initTemplatePath = "File\\Fastreport\\材料入库单.frx";
if (File.Exists(rootPath + initTemplatePath))
{
PageContext.RegisterStartupScript(Window2.GetShowReference(String.Format("~/Controls/Fastreport.aspx?ReportPath={0}", rootPath + initTemplatePath)));
}
}
}
}
+9
View File
@@ -194,6 +194,15 @@ namespace FineUIPro.Web.CLGL
/// </remarks>
protected global::FineUIPro.Window Window1;
/// <summary>
/// Window2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Window Window2;
/// <summary>
/// Menu1 控件。
/// </summary>
+17 -6
View File
@@ -31,17 +31,25 @@
<f:Panel ID="Panel1" runat="server" Margin="5px" BodyPadding="5px" ShowBorder="false" AutoScroll="true"
ShowHeader="false" Layout="VBox" BoxConfigAlign="Stretch">
<Items>
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="材料库存表" EnableCollapse="true"
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="材料库存表" EnableCollapse="true" ForceFit="true"
runat="server" BoxFlex="1" DataKeyNames="Id" AllowCellEditing="true"
ClicksToEdit="2" DataIDField="Id" AllowSorting="true" SortField="Id"
SortDirection="DESC" OnSort="Grid1_Sort" EnableColumnLines="true"
SortDirection="DESC" OnSort="Grid1_Sort" EnableColumnLines="true" EnableTextSelection="True"
AllowPaging="true" IsDatabasePaging="true" PageSize="10" OnPageIndexChange="Grid1_PageIndexChange" >
<Toolbars>
<f:Toolbar ID="Toolbar2" Position="Top" runat="server" ToolbarAlign="Right">
<Items>
<f:Toolbar ID="Toolbar2" Position="Top" runat="server" ToolbarAlign="Left">
<Items>
<f:DropDownList ID="drpWarehouse" runat="server" Label="仓库"
LabelWidth="70px" LabelAlign="Right" Width="170px">
</f:DropDownList>
<f:TextBox runat="server" ID="txtMatCode" Label="材料编码" LabelWidth="70px" LabelAlign="Right" Width="170px"></f:TextBox>
<f:ToolbarFill ID="ToolbarFill1" runat="server">
</f:ToolbarFill>
<f:Button ID="btnSearch" ToolTip="查询" Icon="SystemSearch" runat="server" Text="查询" OnClick="btnSearch_Click">
</f:Button>
<f:Button ID="btnOut" OnClick="btnOut_Click" runat="server" Text="导出" ToolTip="导出" Icon="FolderUp"
EnableAjax="false" DisableControlBeforePostBack="false">
</f:Button>
</f:Button>
</Items>
</f:Toolbar>
</Toolbars>
@@ -53,7 +61,7 @@
</ItemTemplate>
</f:TemplateField>
<f:RenderField Width="150px" ColumnID="WarehouseCode" DataField="WarehouseCode" SortField="WarehouseCode"
<f:RenderField Width="150px" ColumnID="WarehouseCode" DataField="WarehouseCode" SortField="WarehouseCode"
FieldType="String" HeaderText="仓库编码" TextAlign="Left" HeaderTextAlign="Center">
</f:RenderField>
<f:RenderField Width="150px" ColumnID="PipeLineMatCode" DataField="PipeLineMatCode" SortField="PipeLineMatCode"
@@ -62,6 +70,9 @@
<f:RenderField Width="150px" ColumnID="MaterialName" DataField="MaterialName" SortField="MaterialName"
FieldType="String" HeaderText="类型" TextAlign="Left" HeaderTextAlign="Center">
</f:RenderField>
<f:RenderField Width="300px" ColumnID="MaterialDef" DataField="MaterialDef" SortField="MaterialDef"
FieldType="String" HeaderText="材料描述" TextAlign="Left" HeaderTextAlign="Center">
</f:RenderField>
<f:RenderField Width="150px" ColumnID="MaterialSpec" DataField="MaterialSpec" SortField="MaterialSpec"
FieldType="String" HeaderText="规格" TextAlign="Left" HeaderTextAlign="Center">
</f:RenderField>
+16 -1
View File
@@ -17,6 +17,11 @@ namespace FineUIPro.Web.CLGL
if (!IsPostBack)
{
this.ddlPageSize.SelectedValue = this.Grid1.PageSize.ToString();
drpWarehouse.DataTextField = "Text";
drpWarehouse.DataValueField = "Value";
drpWarehouse.DataSource = BLL.DropListService.HJGL_WarehouseCode();
drpWarehouse.DataBind();
Funs.FineUIPleaseSelect(this.drpWarehouse);
// 绑定表格
this.BindGrid();
}
@@ -29,6 +34,11 @@ namespace FineUIPro.Web.CLGL
private void BindGrid()
{
Model.Tw_MaterialStockOutput table = new Model.Tw_MaterialStockOutput();
table.PipeLineMatCode = txtMatCode.Text.Trim();
if (drpWarehouse.SelectedValue!= Const._Null)
{
table.WarehouseCode = drpWarehouse.SelectedValue;
}
table.ProjectId = this.CurrUser.LoginProjectId;
var tb = BLL.TwMaterialstockService.GetListData(table, Grid1);
Grid1.RecordCount = TwMaterialstockService.Count;
@@ -218,6 +228,11 @@ namespace FineUIPro.Web.CLGL
return sb.ToString();
}
#endregion
#endregion
protected void btnSearch_Click(object sender, EventArgs e)
{
BindGrid();
}
}
}
+36
View File
@@ -59,6 +59,42 @@ namespace FineUIPro.Web.CLGL
/// </remarks>
protected global::FineUIPro.Toolbar Toolbar2;
/// <summary>
/// drpWarehouse 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpWarehouse;
/// <summary>
/// txtMatCode 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtMatCode;
/// <summary>
/// ToolbarFill1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.ToolbarFill ToolbarFill1;
/// <summary>
/// btnSearch 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnSearch;
/// <summary>
/// btnOut 控件。
/// </summary>
+58 -25
View File
@@ -16,6 +16,10 @@
color: blue;
font-weight: bold;
}
.f-grid-row-summary .f-grid-cell-inner {
font-weight: bold;
color: red;
}
</style>
</head>
<body>
@@ -81,19 +85,16 @@
<f:Button ID="btnGenInOutMaster" Text="出库" Icon="ArrowRefresh" runat="server" OnClick="btnGenInOutMaster_Click" Hidden="true">
</f:Button>
<f:Button ID="btnRevokeGenInOutMaster" Text="撤销出库" Icon="ArrowRefresh" runat="server" OnClick="btnRevokeGenInOutMaster_Click" Hidden="true">
</f:Button>
<f:Button ID="btnPrint" Text="打印申请单" Icon="Printer" runat="server"
OnClick="btnPrint_Click">
</f:Button>
</f:Button>
</Items>
</f:Toolbar>
</Toolbars>
<Items>
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="申请单" IsFluid="true"
EnableCollapse="true" runat="server" BoxFlex="1" DataKeyNames="Id"
EnableCollapse="true" runat="server" BoxFlex="1" DataKeyNames="Id"
EnableColumnLines="true" ClicksToEdit="2" DataIDField="Id"
AllowSorting="true" SortField="CusBillCode" SortDirection="ASC" OnSort="Grid1_Sort"
EnableTextSelection="True" EnableRowClickEvent="true" OnRowClick="Grid1_RowClick" EnableRowGroup="true" DataRowGroupField="WeldTaskCode">
AllowSorting="true" SortField="CusBillCode" SortDirection="ASC" OnSort="Grid1_Sort" OnRowCommand="Grid1_RowCommand"
EnableTextSelection="True" EnableRowClickEvent="true" OnRowClick="Grid1_RowClick" EnableRowGroup="true" DataRowGroupField="WeldTaskCode">
<Columns>
<f:TemplateField ColumnID="tfNumber" Width="50px" HeaderText="序号" HeaderTextAlign="Center"
TextAlign="Center">
@@ -143,7 +144,8 @@
<f:RenderField Width="150px" ColumnID="AuditDate2" DataField="AuditDate2" SortField="AuditDate2" Renderer="Date"
RendererArgument="yyyy-MM-dd" FieldType="Date" HeaderText="审核时间(材控)" TextAlign="Left" HeaderTextAlign="Center">
</f:RenderField>
<f:LinkButtonField Width="150px" ColumnID="btnInPlanMasterPrint" TextAlign="Center" CommandName="btnInPlanMasterPrint" Text="申请单打印" />
</Columns>
<Listeners>
<f:Listener Event="beforerowcontextmenu" Handler="onRowContextMenu1" />
@@ -163,19 +165,25 @@
<f:Grid ID="Grid2" ShowBorder="False" ShowHeader="False" Title="出库明细" EnableCollapse="true" ForceFit="true"
runat="server" BoxFlex="1" DataKeyNames="Id" AllowCellEditing="true"
ClicksToEdit="2" DataIDField="Id" AllowSorting="true" SortField="MaterialCode"
SortDirection="DESC" EnableColumnLines="true" EnableBigData="true"
SortDirection="DESC" EnableColumnLines="true"
AllowPaging="true" IsDatabasePaging="true" PageSize="10000">
<Columns>
<f:RenderField Width="150px" ColumnID="MaterialCode" DataField="MaterialCode" SortField="MaterialCode"
FieldType="String" HeaderText="材料编码" TextAlign="Left" HeaderTextAlign="Center">
</f:RenderField>
<f:RenderField Width="150px" ColumnID="MaterialName" DataField="MaterialName" SortField="MaterialName"
<f:RenderField Width="100px" ColumnID="MaterialName" DataField="MaterialName" SortField="MaterialName"
FieldType="String" HeaderText="材料名称" TextAlign="Left" HeaderTextAlign="Center">
</f:RenderField>
<f:RenderField Width="300px" ColumnID="MaterialDef" DataField="MaterialDef" SortField="MaterialDef"
FieldType="String" HeaderText="材料描述" TextAlign="Left" HeaderTextAlign="Center">
</f:RenderField>
<f:RenderField Width="150px" ColumnID="PlanNum" DataField="PlanNum" SortField="PlanNum"
FieldType="String" HeaderText="计划数量" TextAlign="Left" HeaderTextAlign="Center">
</f:RenderField>
<f:RenderField Width="150px" ColumnID="StockNum" DataField="StockNum" SortField="StockNum"
FieldType="String" HeaderText="实时库存" TextAlign="Left" HeaderTextAlign="Center">
</f:RenderField>
</Columns>
</f:Grid>
</Items>
@@ -183,24 +191,45 @@
<f:Tab ID="TabStrip2" Title="管线材料明细" BodyPadding="1px" Layout="VBox" runat="server" AutoScroll="true">
<Items>
<f:Grid ID="Grid3" ShowBorder="False" ShowHeader="False" Title="管线材料明细" EnableCollapse="true" ForceFit="true"
runat="server" BoxFlex="1" DataKeyNames="Id"
ClicksToEdit="2" DataIDField="Id" AllowSorting="true" SortField="MaterialCode"
SortDirection="DESC" EnableRowGroup="true" DataRowGroupField="PipelineCode" AllowPaging="true" IsDatabasePaging="true" PageSize="10000">
runat="server" BoxFlex="1" DataKeyNames="Id"
ClicksToEdit="2" DataIDField="Id" AllowSorting="true" SortField="MaterialCode" EnableSummary="true" SummaryPosition="Bottom"
SortDirection="DESC" EnableRowGroup="true" DataRowGroupField="PipelineCode" AllowPaging="true" IsDatabasePaging="true" PageSize="10000">
<Columns>
<f:RenderField Width="150px" ColumnID="PipelineCode" DataField="PipelineCode" SortField="PipelineCode"
FieldType="String" HeaderText="管线号" TextAlign="Left" HeaderTextAlign="Center">
<f:RenderField Width="100px" ColumnID="PipelineCode" DataField="PipelineCode" SortField="PipelineCode"
FieldType="String" HeaderText="管线号" HeaderTextAlign="Center"
TextAlign="Left">
</f:RenderField>
<f:RenderField Width="150px" ColumnID="PrefabricatedComponents" DataField="PrefabricatedComponents" SortField="PrefabricatedComponents"
FieldType="String" HeaderText="预制组件号" TextAlign="Left" HeaderTextAlign="Center">
<f:RenderField Width="100px" ColumnID="PrefabricatedComponents" DataField="PrefabricatedComponents" SortField="PrefabricatedComponents"
FieldType="String" HeaderText="预制组件号" HeaderTextAlign="Center"
TextAlign="Left">
</f:RenderField>
<f:RenderField Width="150px" ColumnID="MaterialCode" DataField="MaterialCode" SortField="MaterialCode"
FieldType="String" HeaderText="材料编码" TextAlign="Left" HeaderTextAlign="Center">
<f:RenderField Width="100px" ColumnID="MaterialCode" DataField="MaterialCode" SortField="MaterialCode"
FieldType="String" HeaderText="材料编码" HeaderTextAlign="Center"
TextAlign="Left">
</f:RenderField>
<f:RenderField Width="150px" ColumnID="MaterialName" DataField="MaterialName" SortField="MaterialName"
FieldType="String" HeaderText="材料名称" TextAlign="Left" HeaderTextAlign="Center">
<f:RenderField Width="100px" ColumnID="MaterialName" DataField="MaterialName" SortField="MaterialName"
FieldType="String" HeaderText="材料名称" HeaderTextAlign="Center"
TextAlign="Left">
</f:RenderField>
<f:RenderField Width="150px" ColumnID="Number" DataField="Number" SortField="Number"
FieldType="String" HeaderText="数量" TextAlign="Left" HeaderTextAlign="Center">
<f:RenderField Width="150px" ColumnID="MaterialDef" DataField="MaterialDef" SortField="MaterialDef"
FieldType="String" HeaderText="材料描述" HeaderTextAlign="Center"
TextAlign="Left">
</f:RenderField>
<f:RenderField Width="100px" ColumnID="MaterialUnit" DataField="MaterialUnit" SortField="MaterialUnit"
FieldType="String" HeaderText="单位" HeaderTextAlign="Center"
TextAlign="Left">
</f:RenderField>
<f:RenderField Width="100px" ColumnID="NeedNum" DataField="NeedNum" SortField="NeedNum"
FieldType="String" HeaderText="所需量" HeaderTextAlign="Center"
TextAlign="Left">
</f:RenderField>
<f:RenderField Width="100px" ColumnID="MatchNum" DataField="MatchNum" SortField="MatchNum"
FieldType="String" HeaderText="匹配量" HeaderTextAlign="Center"
TextAlign="Left">
</f:RenderField>
<f:RenderField Width="100px" ColumnID="MatchRateString" DataField="MatchRateString" SortField="MatchRateString"
FieldType="String" HeaderText="匹配率" HeaderTextAlign="Center"
TextAlign="Left">
</f:RenderField>
</Columns>
</f:Grid>
@@ -222,8 +251,12 @@
EnableIFrame="true" EnableMaximize="false" Target="Top" EnableResize="false" runat="server"
IsModal="true" Width="700px" Height="470px" OnClose="Window2_Close">
</f:Window>
<f:Window ID="Window3" Title="打印" Hidden="true" EnableIFrame="true"
EnableMaximize="true" Target="Top" EnableResize="false" runat="server"
IsModal="true" Width="1010px" Height="660px">
</f:Window>
<f:Menu ID="Menu1" runat="server">
<f:MenuButton ID="btnMenuInOutPlanMasterEdit" OnClick="btnMenuInOutPlanMasterEdit_Click" EnablePostBack="true"
<f:MenuButton ID="btnMenuInOutPlanMasterEdit" OnClick="btnMenuInOutPlanMasterEdit_Click" EnablePostBack="true"
runat="server" Text="编辑" Icon="TableEdit">
</f:MenuButton>
<f:MenuButton ID="btnMenuInOutPlanMasterDelete" OnClick="btnMenuInOutPlanMasterDelete_Click" EnablePostBack="true"
+132 -67
View File
@@ -2,11 +2,15 @@
using BLL;
using FineUIPro.Web.HSSE.EduTrain;
using FineUIPro.Web.ProjectData;
using Model;
using Newtonsoft.Json.Linq;
using NPOI.SS.Formula.Functions;
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
@@ -98,11 +102,25 @@ namespace FineUIPro.Web.CLGL
}
private void BindDetailRelationGrid(string inOutPlanMasterId)
{
Model.Tw_InOutPlanDetail_Relation table = new Model.Tw_InOutPlanDetail_Relation();
/* Model.Tw_InOutPlanDetail_Relation table = new Model.Tw_InOutPlanDetail_Relation();
table.InOutPlanMasterId = inOutPlanMasterId;
var tb = BLL.TwInoutplandetailRelationService.GetListData(table, Grid3);
Grid3.DataSource = tb;
Grid3.DataBind();
*/
var tb = BLL.TwArrivalStatisticsService.GetMatMatchByOutPlanMasterId(inOutPlanMasterId);
Grid3.DataSource = tb;
Grid3.DataBind();
string Rate = Math.Round((decimal)tb.Average(item => item.MatchRate) * 100, 2).ToString() + "%";
JObject summary = new JObject();
//summary.Add("Major", "全部合计");
summary.Add("MatchRateString", Rate);
Grid3.SummaryData = summary;
}
#endregion
@@ -220,6 +238,119 @@ namespace FineUIPro.Web.CLGL
#endregion
#region
protected void Grid1_RowCommand(object sender, GridCommandEventArgs e)
{
if (e.CommandName == "btnInPlanMasterPrint")
{
Print(e.RowID);
}
}
private void Print(string Id)
{
BLL.FastReportService.ResetData();
if (string.IsNullOrEmpty(Id))
{
ShowNotify("请选择要打印的项", MessageBoxIcon.Warning);
return;
}
Tw_InOutMasterOutput queryModel = new Tw_InOutMasterOutput()
{
Id = Id
};
var result = TwInOutplanmasterService.GetListData(queryModel).FirstOrDefault();
List<Model.Tw_PrintMaster> tw_PrintMasters = new List<Model.Tw_PrintMaster>();
List<Model.Tw_PrintDetail> tw_PrintDetails = new List<Model.Tw_PrintDetail>();
Model.Tw_PrintMaster printMaster = new Model.Tw_PrintMaster
{
ReqUnitName = result.ReqUnitName,
CusBillCode = result.CusBillCode,
CreateDate = result.CreateDate.Value.ToString("yyyy-MM-dd"),
ProjectName = ProjectService.GetProjectNameByProjectId(result.ProjectId),
CategoryString = result.CategoryString,
BillName = TwConst.PlanPrintMap.Where(x => x.Value == result.TypeInt).Select(x => x.Key).FirstOrDefault(),
};
tw_PrintMasters.Add(printMaster);
DataTable Table1 = LINQToDataTable(tw_PrintMasters);
if (Table1 != null)
{
Table1.TableName = "Table1";
}
Tw_InOutPlanDetail_Relation queryModel2 = new Tw_InOutPlanDetail_Relation()
{
InOutPlanMasterId = Id
};
var ListDetailRelation = TwInoutplandetailRelationService.GetTw_InOutPlanDetail_RelationByModle(queryModel2).ToList();
int SortIndex = 1;
int SortIndex2 = 1;
var tw_PrintDetailRelation = (from x in ListDetailRelation
join y in Funs.DB.HJGL_MaterialCodeLib on x.MaterialCode equals y.MaterialCode
join z in Funs.DB.HJGL_Pipeline on x.PipelineId equals z.PipelineId
join m in Funs.DB.WBS_UnitWork on z.UnitWorkId equals m.UnitWorkId
select new Model.Tw_PrintDetail
{
SortIndex = SortIndex++,
PipelineCode = z.PipelineCode,
PipelineComponentCode = x.PrefabricatedComponents,
MaterialCode = y.MaterialCode,
MaterialDef = y.MaterialDef,
MaterialSpec = y.MaterialSpec,
MaterialUnit = y.MaterialUnit,
PlanNum = (x.Number ??0).ToString(),
UnitWorkName = m.UnitWorkName,
}).ToList();
var UnitWorkName = tw_PrintDetailRelation.FirstOrDefault()?.UnitWorkName;
Tw_PrintDetail tw_PrintDetailRelation2 = new Tw_PrintDetail
{
MaterialDef = "材料编码合计"
};
var tw_PrintDetail = (from x in Funs.DB.Tw_InOutPlanDetail
join y in Funs.DB.HJGL_MaterialCodeLib on x.MaterialCode equals y.MaterialCode
where x.InOutPlanMasterId == Id
select new Model.Tw_PrintDetail
{
SortIndex = 0,
PipelineCode = "-",
PipelineComponentCode = "-",
MaterialCode = y.MaterialCode,
MaterialDef = y.MaterialDef,
MaterialSpec = y.MaterialSpec,
MaterialUnit = y.MaterialUnit,
PlanNum = (x.PlanNum ?? 0).ToString(),
ActNum = (x.ActNum ?? 0).ToString(),
UnitWorkName = UnitWorkName,
}).ToList();
foreach (var item in tw_PrintDetail)
{
item.SortIndex = SortIndex2++;
}
if (result.TypeInt == (int)TwConst.TypeInt.)
{
tw_PrintDetails.AddRange(tw_PrintDetailRelation);
}
tw_PrintDetails.Add(tw_PrintDetailRelation2);
tw_PrintDetails.AddRange(tw_PrintDetail);
DataTable Data = LINQToDataTable(tw_PrintDetails);
if (Data != null)
{
Data.TableName = "Data";
}
BLL.FastReportService.ResetData();
BLL.FastReportService.AddFastreportTable(Table1);
BLL.FastReportService.AddFastreportTable(Data);
string initTemplatePath = "";
string rootPath = Server.MapPath("~/");
initTemplatePath = "File\\Fastreport\\材料出库计划单.frx";
if (File.Exists(rootPath + initTemplatePath))
{
PageContext.RegisterStartupScript(Window3.GetShowReference(String.Format("~/Controls/Fastreport.aspx?ReportPath={0}", rootPath + initTemplatePath)));
}
}
protected void Grid1_RowClick(object sender, GridRowClickEventArgs e)
{
if (e.RowIndex >= 0)
@@ -415,71 +546,6 @@ namespace FineUIPro.Web.CLGL
#endregion
#region
/// <summary>
/// 报表打印
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnPrint_Click(object sender, EventArgs e)
{
string pipelineId = this.tvControlItem.SelectedNodeID;
var q = BLL.PipelineService.GetPipelineByPipelineId(pipelineId);
if (q != null)
{
var jotCount = (from x in Funs.DB.HJGL_WeldJoint where x.PipelineId == pipelineId select x).Count();
var weldJotCount = (from x in Funs.DB.HJGL_WeldJoint where x.PipelineId == pipelineId && x.WeldingDailyId != null select x).Count();
if (jotCount == weldJotCount)
{
string varValue = string.Empty;
var project = BLL.ProjectService.GetProjectByProjectId(this.CurrUser.LoginProjectId);
if (project != null)
{
varValue = project.ProjectName;
var unitWork = BLL.UnitWorkService.GetUnitWorkByUnitWorkId(q.UnitWorkId);
if (unitWork != null)
{
varValue = varValue + "|" + unitWork.UnitWorkName;
}
}
List<SqlParameter> listStr = new List<SqlParameter>();
listStr.Add(new SqlParameter("@IsoId", pipelineId));
listStr.Add(new SqlParameter("@Flag", "0"));
SqlParameter[] parameter = listStr.ToArray();
DataTable tb = BLL.SQLHelper.GetDataTableRunProc("HJGL_spJointWorkRecordNew", parameter);
string page = Funs.GetPagesCountByPageSize(11, 16, tb.Rows.Count).ToString();
varValue = varValue + "|" + page;
if (!string.IsNullOrEmpty(varValue))
{
varValue = HttpUtility.UrlEncodeUnicode(varValue);
}
if (tb.Rows.Count <= 11)
{
PageContext.RegisterStartupScript(Window2.GetShowReference(String.Format("../../ReportPrint/ExReportPrint.aspx?ispop=1&reportId={0}&replaceParameter={1}&varValue={2}&projectId={3}", BLL.Const.HJGL_JointInfoReport1Id, pipelineId, varValue, this.CurrUser.LoginProjectId)));
}
else
{
PageContext.RegisterStartupScript(Window2.GetShowReference(String.Format("../../ReportPrint/ExReportPrint.aspx?ispop=1&reportId={0}&replaceParameter={1}&varValue={2}&projectId={3}", BLL.Const.HJGL_JointInfoReport1Id, pipelineId, varValue, this.CurrUser.LoginProjectId)));
}
}
else
{
ShowNotify("请选择焊接完成管线!", MessageBoxIcon.Warning);
return;
}
}
else
{
ShowNotify("请选择管线!", MessageBoxIcon.Warning);
return;
}
}
#endregion
#region
/// <summary>
@@ -585,7 +651,6 @@ namespace FineUIPro.Web.CLGL
{
this.btnGenInOutMaster.Hidden = false;
this.btnRevokeGenInOutMaster.Hidden = false;
this.btnPrint.Hidden = false;
// this.btnMenuInOutPlanMasterEdit.Hidden = false;
}
if (buttonList.Contains(BLL.Const.BtnDelete))
+9 -9
View File
@@ -212,15 +212,6 @@ namespace FineUIPro.Web.CLGL
/// </remarks>
protected global::FineUIPro.Button btnRevokeGenInOutMaster;
/// <summary>
/// btnPrint 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnPrint;
/// <summary>
/// Grid1 控件。
/// </summary>
@@ -311,6 +302,15 @@ namespace FineUIPro.Web.CLGL
/// </remarks>
protected global::FineUIPro.Window Window2;
/// <summary>
/// Window3 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Window Window3;
/// <summary>
/// Menu1 控件。
/// </summary>
@@ -38,7 +38,7 @@
<f:Panel ID="Panel4" Layout="Column" ShowHeader="false" ShowBorder="false" runat="server">
<Items>
<f:TextBox ID="txtWeldTaskCode" Label="任务单编号" Readonly="true" ColumnWidth="20%" runat="server">
<f:TextBox ID="txtWeldTaskCode" Label="任务单编号" Readonly="true" ColumnWidth="20%" runat="server" Hidden="true">
</f:TextBox>
<f:DropDownList ID="drpWarehouse" runat="server" Label="仓库" ColumnWidth="20%"
@@ -47,10 +47,10 @@
<f:DropDownList ID="drpTypeInt" runat="server" Label="类型" ColumnWidth="20%"
LabelWidth="70px" LabelAlign="Right" Width="170px">
</f:DropDownList>
<f:DropDownList ID="drpCategory" runat="server" Label="类别" ColumnWidth="20%"
<f:DropDownList ID="drpCategory" runat="server" Label="类别" ColumnWidth="30%"
LabelWidth="70px" LabelAlign="Right" Width="170px">
</f:DropDownList>
<f:TextBox ID="txtCusBillCode" Label="编号" ColumnWidth="20%" runat="server" ShowRedStar="true" Required="true">
<f:TextBox ID="txtCusBillCode" Label="编号" ColumnWidth="30%" runat="server" ShowRedStar="true" Required="true">
</f:TextBox>
</Items>
</f:Panel>
@@ -82,16 +82,16 @@
<Columns>
<f:RenderField Width="150px" ColumnID="PipelineCode" DataField="PipelineCode" SortField="PipelineCode"
FieldType="String" HeaderText="管线号" TextAlign="Left" HeaderTextAlign="Center">
</f:RenderField>
<f:RenderField Width="150px" ColumnID="PrefabricatedComponents" DataField="PrefabricatedComponents" SortField="PrefabricatedComponents"
FieldType="String" HeaderText="预制组件号" TextAlign="Left" HeaderTextAlign="Center">
</f:RenderField>
</f:RenderField>
<f:RenderField Width="150px" ColumnID="MaterialCode" DataField="MaterialCode" SortField="MaterialCode"
FieldType="String" HeaderText="材料编码" TextAlign="Left" HeaderTextAlign="Center">
</f:RenderField>
<f:RenderField Width="150px" ColumnID="MaterialName" DataField="MaterialName" SortField="MaterialName"
FieldType="String" HeaderText="材料名称" TextAlign="Left" HeaderTextAlign="Center">
</f:RenderField>
<f:RenderField Width="300px" ColumnID="MaterialDef" DataField="MaterialDef" SortField="MaterialDef"
FieldType="String" HeaderText="材料描述" TextAlign="Left" HeaderTextAlign="Center">
</f:RenderField>
<f:RenderField Width="100px" ColumnID="Number" DataField="Number" FieldType="Float"
HeaderText="计划数量">
<Editor>
@@ -84,7 +84,8 @@ namespace FineUIPro.Web.CLGL
{
txtCreateMan.Text = this.CurrUser.PersonName;
txtCreateDate.Text = DateTime.Now.ToString("yyyy-MM-dd");
drpReqUnit.SelectedValue = this.CurrUser.UnitId;
drpReqUnit.SelectedValue = this.CurrUser.UnitId;
txtCusBillCode.Text = TwInOutplanmasterService.GetDataInCusBillCode(this.CurrUser.LoginProjectId, this.CurrUser.UnitId);
}
@@ -124,14 +124,13 @@ namespace FineUIPro.Web.CLGL
foreach (var item in pipeline)
{
TreeNode newNode = new TreeNode();
int totalJointNum = joints.Count(x => x.PipelineId == item.PipelineId);
int weldJointNum = joints.Count(x => x.PipelineId == item.PipelineId && x.WeldingDailyId != null);
//bool istrue = BLL.HJGL_MaterialService.isInStockByPipeline(item.PipelineId, this.CurrUser.LoginProjectId);
//if (istrue)
//{
// newNode.CssClass = "tn-color-green";
//}
newNode.Text = item.PipelineCode + "(" + (totalJointNum - weldJointNum).ToString() + ")";
newNode.Text = item.PipelineCode;
newNode.NodeID = item.PipelineId;
newNode.ToolTip = item.PipelineCode;
newNode.EnableClickEvent = true;
+13 -8
View File
@@ -22,7 +22,7 @@
}
.f-grid-row.yellow {
background-color: yellow;
background-color:darkgoldenrod;
}
</style>
</head>
@@ -83,10 +83,7 @@
<f:Button ID="btnGenInPlanMaster" Text="生成退料通知单" Icon="ArrowRefresh" runat="server" OnClick="btnGenInPlanMaster_Click" Hidden="true">
</f:Button>
<f:Button ID="btnGenOutPlanMaster" Text="生成补料申请单" Icon="ArrowRefresh" runat="server" OnClick="btnGenOutPlanMaster_Click" Hidden="true">
</f:Button>
<f:Button ID="btnPrint" Text="打印申请单" Icon="Printer" runat="server"
OnClick="btnPrint_Click">
</f:Button>
</f:Button>
</Items>
</f:Toolbar>
</Toolbars>
@@ -94,7 +91,7 @@
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="申请单"
EnableCollapse="true" runat="server" BoxFlex="1" DataKeyNames="Id"
AllowColumnLocking="true" EnableColumnLines="true" ClicksToEdit="2" DataIDField="Id"
AllowSorting="true" SortField="CusBillCode" SortDirection="ASC" OnSort="Grid1_Sort"
AllowSorting="true" SortField="CusBillCode" SortDirection="ASC" OnSort="Grid1_Sort" OnRowCommand="Grid1_RowCommand"
EnableTextSelection="True" EnableRowDoubleClickEvent="true" OnRowDoubleClick="Grid1_RowDoubleClick" EnableRowClickEvent="true" OnRowClick="Grid1_RowClick">
<Columns>
<f:TemplateField ColumnID="tfNumber" Width="50px" HeaderText="序号" HeaderTextAlign="Center"
@@ -139,7 +136,8 @@
</f:RenderField>
<f:RenderField Width="150px" ColumnID="AuditDate" DataField="AuditDate" SortField="AuditDate" Renderer="Date"
RendererArgument="yyyy-MM-dd" FieldType="Date" HeaderText="审核时间" TextAlign="Left" HeaderTextAlign="Center">
</f:RenderField>
</f:RenderField>
<f:LinkButtonField Width="150px" ColumnID="btnInPlanMasterPrint" TextAlign="Center" CommandName="btnInPlanMasterPrint" Text="出库单打印" />
</Columns>
<Listeners>
@@ -160,7 +158,7 @@
<f:Grid ID="Grid2" ShowBorder="False" ShowHeader="False" Title="入库申请明细表" EnableCollapse="true" ForceFit="true"
runat="server" BoxFlex="1" DataKeyNames="Id" AllowCellEditing="true"
ClicksToEdit="2" DataIDField="Id" AllowSorting="true" SortField="MaterialCode"
SortDirection="DESC" EnableColumnLines="true" EnableBigData="true"
SortDirection="DESC" EnableColumnLines="true"
AllowPaging="true" IsDatabasePaging="true" PageSize="10000">
<Columns>
<%--<f:RenderField Width="150px" ColumnID="PipelineComponent" DataField="PipelineComponent" SortField="PipelineComponent"
@@ -172,6 +170,9 @@
<f:RenderField Width="150px" ColumnID="MaterialName" DataField="MaterialName" SortField="MaterialName"
FieldType="String" HeaderText="材料名称" TextAlign="Left" HeaderTextAlign="Center">
</f:RenderField>
<f:RenderField Width="300px" ColumnID="MaterialDef" DataField="MaterialDef" SortField="MaterialDef"
FieldType="String" HeaderText="材料描述" TextAlign="Left" HeaderTextAlign="Center">
</f:RenderField>
<f:RenderField Width="150px" ColumnID="PlanNum" DataField="PlanNum" SortField="PlanNum"
FieldType="String" HeaderText="计划数量" TextAlign="Left" HeaderTextAlign="Center">
</f:RenderField>
@@ -204,6 +205,10 @@
EnableIFrame="true" EnableMaximize="false" Target="Top" EnableResize="false" runat="server"
IsModal="true" Width="700px" Height="470px" OnClose="Window2_Close">
</f:Window>
<f:Window ID="Window3" Title="打印" Hidden="true" EnableIFrame="true"
EnableMaximize="true" Target="Top" EnableResize="false" runat="server"
IsModal="true" Width="1010px" Height="660px">
</f:Window>
<f:Menu ID="Menu1" runat="server" Hidden="true">
<f:MenuButton ID="btnMenuInOutPlanMasterEdit" OnClick="btnMenuInOutPlanMasterEdit_Click" EnablePostBack="true" Hidden="true"
runat="server" Text="编辑" Icon="TableEdit">
+112 -1
View File
@@ -1,8 +1,10 @@
using BLL;
using Model;
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.IO;
using System.Linq;
using System.Text;
using System.Web;
@@ -519,7 +521,7 @@ namespace FineUIPro.Web.CLGL
}
if (buttonList.Contains(BLL.Const.BtnModify))
{
this.btnPrint.Hidden = false;
// this.btnPrint.Hidden = false;
//this.btnMenuInOutPlanMasterEdit.Hidden = false;
this.btnGenInPlanMaster.Hidden = false;
this.btnGenOutPlanMaster.Hidden = false;
@@ -530,6 +532,115 @@ namespace FineUIPro.Web.CLGL
}
}
}
protected void Grid1_RowCommand(object sender, GridCommandEventArgs e)
{
if (e.CommandName == "btnInPlanMasterPrint")
{
Print(e.RowID);
}
}
private void Print(string Id)
{
BLL.FastReportService.ResetData();
if (string.IsNullOrEmpty(Id))
{
ShowNotify("请选择要打印的项", MessageBoxIcon.Warning);
return;
}
Tw_InOutMasterOutput queryModel = new Tw_InOutMasterOutput()
{
Id = Id
};
var result = TwOutputmasterService.GetListData(queryModel).FirstOrDefault();
List<Model.Tw_PrintMaster> tw_PrintMasters = new List<Model.Tw_PrintMaster>();
List<Model.Tw_PrintDetail> tw_PrintDetails = new List<Model.Tw_PrintDetail>();
Model.Tw_PrintMaster printMaster = new Model.Tw_PrintMaster
{
ReqUnitName = result.ReqUnitName,
CusBillCode = result.CusBillCode,
CreateDate = result.CreateDate.Value.ToString("yyyy-MM-dd"),
ProjectName = ProjectService.GetProjectNameByProjectId(result.ProjectId),
CategoryString = result.CategoryString,
BillName = TwConst.PrintMap.Where(x => x.Value == result.TypeInt).Select(x => x.Key).FirstOrDefault(),
};
tw_PrintMasters.Add(printMaster);
DataTable Table1 = LINQToDataTable(tw_PrintMasters);
if (Table1 != null)
{
Table1.TableName = "Table1";
}
Tw_InOutPlanDetail_Relation queryModel2 = new Tw_InOutPlanDetail_Relation()
{
InOutPlanMasterId = Id
};
var ListDetailRelation = TwInoutplandetailRelationService.GetTw_InOutPlanDetail_RelationByModle(queryModel2).ToList();
int SortIndex = 1;
int SortIndex2 = 1;
var tw_PrintDetailRelation = (from x in ListDetailRelation
join y in Funs.DB.HJGL_MaterialCodeLib on x.MaterialCode equals y.MaterialCode
join z in Funs.DB.HJGL_Pipeline on x.PipelineId equals z.PipelineId
join m in Funs.DB.WBS_UnitWork on z.UnitWorkId equals m.UnitWorkId
select new Model.Tw_PrintDetail
{
SortIndex = SortIndex++,
PipelineCode = z.PipelineCode,
PipelineComponentCode = x.PrefabricatedComponents,
MaterialCode = y.MaterialCode,
MaterialDef = y.MaterialDef,
MaterialSpec = y.MaterialSpec,
MaterialUnit = y.MaterialUnit,
PlanNum = (x.Number ?? 0).ToString(),
UnitWorkName = m.UnitWorkName,
}).ToList();
var UnitWorkName = tw_PrintDetailRelation.FirstOrDefault()?.UnitWorkName;
Tw_PrintDetail tw_PrintDetailRelation2 = new Tw_PrintDetail
{
MaterialDef = "材料编码合计"
};
var tw_PrintDetail = (from x in Funs.DB.Tw_OutputDetail
join y in Funs.DB.HJGL_MaterialCodeLib on x.MaterialCode equals y.MaterialCode
where x.OutputMasterId == Id
select new Model.Tw_PrintDetail
{
SortIndex = 0,
PipelineCode = "-",
PipelineComponentCode = "-",
MaterialCode = y.MaterialCode,
MaterialDef = y.MaterialDef,
MaterialSpec = y.MaterialSpec,
MaterialUnit = y.MaterialUnit,
PlanNum = (x.PlanNum ?? 0).ToString(),
ActNum = (x.ActNum ?? 0).ToString(),
UnitWorkName = UnitWorkName,
}).ToList();
foreach (var item in tw_PrintDetail)
{
item.SortIndex = SortIndex2++;
}
tw_PrintDetails.AddRange(tw_PrintDetailRelation);
tw_PrintDetails.Add(tw_PrintDetailRelation2);
tw_PrintDetails.AddRange(tw_PrintDetail);
DataTable Data = LINQToDataTable(tw_PrintDetails);
if (Data != null)
{
Data.TableName = "Data";
}
BLL.FastReportService.ResetData();
BLL.FastReportService.AddFastreportTable(Table1);
BLL.FastReportService.AddFastreportTable(Data);
string initTemplatePath = "";
string rootPath = Server.MapPath("~/");
initTemplatePath = "File\\Fastreport\\材料出库单.frx";
if (File.Exists(rootPath + initTemplatePath))
{
PageContext.RegisterStartupScript(Window3.GetShowReference(String.Format("~/Controls/Fastreport.aspx?ReportPath={0}", rootPath + initTemplatePath)));
}
}
#endregion
+9 -9
View File
@@ -185,15 +185,6 @@ namespace FineUIPro.Web.CLGL
/// </remarks>
protected global::FineUIPro.Button btnGenOutPlanMaster;
/// <summary>
/// btnPrint 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnPrint;
/// <summary>
/// Grid1 控件。
/// </summary>
@@ -266,6 +257,15 @@ namespace FineUIPro.Web.CLGL
/// </remarks>
protected global::FineUIPro.Window Window2;
/// <summary>
/// Window3 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Window Window3;
/// <summary>
/// Menu1 控件。
/// </summary>
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,165 @@
<?xml version="1.0" encoding="utf-8"?>
<Report ScriptLanguage="CSharp" ReportInfo.Created="12/29/2021 10:56:08" ReportInfo.Modified="09/27/2024 12:44:45" ReportInfo.CreatorVersion="2017.1.16.0">
<ScriptText>using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Windows.Forms;
using System.Drawing;
using System.Data;
using FastReport;
using FastReport.Data;
using FastReport.Dialog;
using FastReport.Barcode;
using FastReport.Table;
using FastReport.Utils;
namespace FastReport
{
public class ReportScript
{
/**
private void Table3_ManualBuild(object sender, EventArgs e)
{
// get the data source by its name
DataSourceBase rowData = Report.GetDataSource(&quot;Data&quot;);
// init the data source
rowData.Init();
// print the first table row - it is a header
Tabel_Data.PrintRow(0);
// each PrintRow call must be followed by either PrintColumn or PrintColumns call
// to print cells on the row
Tabel_Data.PrintColumns();
// now enumerate the data source and print the table body
while (rowData.HasMoreRows)
{
// print the table body
Tabel_Data.PrintRow(0);
Tabel_Data.PrintColumns();
// go next data source row
rowData.Next();
}
// print the last table row - it is a footer
//Tabel_Data.PrintRow(2);
//Table3.PrintColumns();
}
private void Table4_ManualBuild(object sender, EventArgs e)
{
DataSourceBase rowData = Report.GetDataSource(&quot;Table1&quot;);
// init the data source
rowData.Init();
// print the first table row - it is a header
Table4.PrintRow(0);
// each PrintRow call must be followed by either PrintColumn or PrintColumns call
// to print cells on the row
Table4.PrintColumns();
// now enumerate the data source and print the table body
// print the table body
Table4.PrintRow(1);
Table4.PrintColumns();
Table4.PrintRow(2);
Table4.PrintColumns();
Table4.PrintRow(3);
Table4.PrintColumns();
Table4.PrintRow(4);
Table4.PrintColumns();
Table4.PrintRow(5);
Table4.PrintColumns();
Table4.PrintRow(6);
Table4.PrintColumns();
// go next data source row
rowData.Next();
}
private void Table5_ManualBuild(object sender, EventArgs e)
{
Table5.PrintRow(0);
Table5.PrintColumns();
Table5.PrintRow(1);
Table5.PrintColumns();
}
**/
}
}
</ScriptText>
<Dictionary>
<MsSqlDataConnection Name="Connection" ConnectionString="rijcmlqvJIqZbrmqGn7L0P56UFhaUHihKXxbhpqie4wmZgM2ymDKry7UxzO5md9ybQlkfKpN2rHYbp9GtH1LDQPa7z2vVu/kEnNnTKeHt9obmaC7TQDh0IvsUBSuzhGZdfAIK7YyBqykCgeZm5rvA6K5b7zHGdA+7pUpJ/9ZLpp1NuxWRErUX2GS/6pCJECV3Yly7nB"/>
<TableDataSource Name="Table1" ReferenceName="Table1" DataType="System.Int32" Enabled="true">
<Column Name="pipelineCode" DataType="System.String" PropName="PipelineComponentId"/>
<Column Name="Mat" DataType="System.String" PropName="PipelineComponentCode"/>
<Column Name="WeldJointId" DataType="System.String" PropName="BoxNumber"/>
<Column Name="Spec" DataType="System.String" PropName="UnitWorkName"/>
<Column Name="SortIndex" DataType="System.String" PropName="PipelineId"/>
<Column Name="PipelineCode" DataType="System.String"/>
</TableDataSource>
<TableDataSource Name="Data" ReferenceName="Data.Data" DataType="System.Int32" Enabled="true">
<Column Name="CH_TrustID" DataType="System.String"/>
<Column Name="ISO_IsoNo" DataType="System.Int32" PropName="Column" Calculated="true" Expression=""/>
<Column Name="ISO_IsoNumber" DataType="System.Int32" PropName="Column" Calculated="true" Expression=""/>
<Column Name="JOT_JointNo" DataType="System.Int32" PropName="Column1" Calculated="true" Expression=""/>
<Column Name="WED_Code2" DataType="System.Int32" PropName="Column2" Calculated="true" Expression=""/>
<Column Name="JOT_JointDesc" DataType="System.Int32" PropName="Column3" Calculated="true" Expression=""/>
<Column Name="STE_Name1" DataType="System.Int32" PropName="Column" Calculated="true" Expression=""/>
<Column Name="Remark" DataType="System.Int32" PropName="Column1" Calculated="true" Expression=""/>
</TableDataSource>
<TableDataSource Name="Products" ReferenceName="NorthWind.Products" DataType="System.Int32" Enabled="true">
<Column Name="ProductID" DataType="System.Int32"/>
<Column Name="ProductName" DataType="System.String"/>
<Column Name="SupplierID" DataType="System.Int32"/>
<Column Name="CategoryID" DataType="System.Int32"/>
<Column Name="QuantityPerUnit" DataType="System.String"/>
<Column Name="UnitPrice" DataType="System.Decimal"/>
<Column Name="UnitsInStock" DataType="System.Int16"/>
<Column Name="UnitsOnOrder" DataType="System.Int16"/>
<Column Name="ReorderLevel" DataType="System.Int16"/>
<Column Name="Discontinued" DataType="System.Boolean" BindableControl="CheckBox"/>
<Column Name="EAN13" DataType="System.String"/>
</TableDataSource>
<Parameter Name="CH_TrustID" DataType="System.Single"/>
<Parameter Name="supUnit" DataType="System.String"/>
<Parameter Name="totalUnit" DataType="System.String"/>
<Parameter Name="ConUnit" DataType="System.String"/>
<Parameter Name="CheckUnit" DataType="System.String"/>
</Dictionary>
<ReportPage Name="Page1" RawPaperSize="9" TopMargin="0" BottomMargin="0" MirrorMargins="true">
<PageHeaderBand Name="PageHeader1" Width="718.2"/>
<DataBand Name="Data1" Top="4" Width="718.2" Height="280.48" Guides="198.45" DataSource="Table1" Columns.Count="1">
<TableObject Name="Table2" Left="18.9" Width="500.86" Height="233.1" Border.Lines="All">
<TableColumn Name="Column3" Width="231.52"/>
<TableColumn Name="Column1" Width="269.34"/>
<TableRow Name="Row1" Height="37.17">
<TableCell Name="Cell23" Text="管线号:[Table1.pipelineCode]" VertAlign="Center" Font="宋体, 11pt" ColSpan="2"/>
<TableCell Name="Cell1" VertAlign="Center" Font="宋体, 11pt"/>
</TableRow>
<TableRow Name="Row2" Height="37.17">
<TableCell Name="Cell24" Text="规格:[Table1.Spec]" VertAlign="Center" Font="宋体, 11pt"/>
<TableCell Name="Cell6" Text="材质:[Table1.Mat]" VertAlign="Center" Font="宋体, 11pt"/>
</TableRow>
<TableRow Name="Row5" Height="158.76">
<TableCell Name="Cell35">
<BarcodeObject Name="Barcode1" Left="22.68" Width="151.2" Height="151.2" AutoSize="false" Text="[Table1.WeldJointId]" ShowText="false" AllowExpressions="true" Barcode="QR Code" Barcode.ErrorCorrection="L" Barcode.Encoding="UTF8" Barcode.QuietZone="true"/>
</TableCell>
<TableCell Name="Cell36" VertAlign="Center" Font="宋体, 11pt">
<TextObject Name="Text1" Top="18.9" Width="217.35" Height="103.95" Text="[Table1.SortIndex]#" Font="黑体, 72pt, style=Bold"/>
</TableCell>
</TableRow>
</TableObject>
</DataBand>
</ReportPage>
</Report>
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Report ScriptLanguage="CSharp" ReportInfo.Created="12/29/2021 10:56:08" ReportInfo.Modified="11/08/2023 17:16:01" ReportInfo.CreatorVersion="2017.1.16.0">
<Report ScriptLanguage="CSharp" ReportInfo.Created="12/29/2021 10:56:08" ReportInfo.Modified="09/27/2024 12:34:38" ReportInfo.CreatorVersion="2017.1.16.0">
<ScriptText>using System;
using System.Collections;
using System.Collections.Generic;
@@ -99,8 +99,25 @@ namespace FastReport
}
</ScriptText>
<Dictionary>
<MsSqlDataConnection Name="Connection" ConnectionString="rijcmlqvJIqZbrmqGn7L0P56UFhaUHihKXxbhpqie4wmZgM2ymDKry7UxzO5md9ybQlkfKpN2rHYbp9GtH1LDQPa7z2vVu/kEnNnTKeHt9obmaC7TQDh0IvsUBSuzhGZdfAIK7YyBqykCgeZm5rvA6K5b7zHGdA+7pUpJ/9ZLpp1NuxWRFkUU1z9ezk97FBAaKX0CT9"/>
<TableDataSource Name="Table1" ReferenceName="Table1" DataType="System.Int32" Enabled="true"/>
<MsSqlDataConnection Name="Connection" ConnectionString="rijcmlqvJIqZbrmqGn7L0P56UFhaUHihKXxbhpqie4wmZgM2ymDKry7UxzO5md9ybQlkfKpN2rHYbp9GtH1LDQPa7z2vVu/kEnNnTKeHt9obmaC7TQDh0IvsUBSuzhGZdfAIK7YyBqykCgeZm5rvA6K5b7zHGdA+7pUpJ/9ZLpp1NuxWRHxiQjJHKvj+h49TiuPxADa"/>
<TableDataSource Name="Table1" ReferenceName="Table1" DataType="System.Int32" Enabled="true">
<Column Name="PipelineComponentId" DataType="System.String"/>
<Column Name="PipelineComponentCode" DataType="System.String"/>
<Column Name="BoxNumber" DataType="System.String"/>
<Column Name="UnitWorkName" DataType="System.String"/>
<Column Name="PipelineId" DataType="System.String"/>
<Column Name="PreUnit" DataType="System.String"/>
<Column Name="AssembleUnit" DataType="System.String"/>
<Column Name="PrefabricatedComponents" DataType="System.String"/>
<Column Name="QRCode" DataType="System.String"/>
<Column Name="State" DataType="System.Int32"/>
<Column Name="PlanStartDate" DataType="System.String"/>
<Column Name="PipelineCode" DataType="System.String"/>
<Column Name="FlowingSection" DataType="System.String"/>
<Column Name="QRCode2" DataType="System.String"/>
<Column Name="MaterialCode" DataType="System.String"/>
<Column Name="IsPrint" DataType="System.Boolean" BindableControl="CheckBox"/>
</TableDataSource>
<TableDataSource Name="Data" ReferenceName="Data.Data" DataType="System.Int32" Enabled="true">
<Column Name="CH_TrustID" DataType="System.String"/>
<Column Name="ISO_IsoNo" DataType="System.Int32" PropName="Column" Calculated="true" Expression=""/>
@@ -24,19 +24,19 @@
<f:TextBox ID="tvPipeCode" runat="server" Label="管线号" LabelAlign="Right"
EmptyText="输入查询条件" Width="180px" LabelWidth="70px">
</f:TextBox>
<f:HiddenField runat="server" ID="hdUnitWorkId"></f:HiddenField>
</Items>
</f:Toolbar>
<f:Toolbar ID="Toolbar2" Position="Top" runat="server" ToolbarAlign="Left">
<Items>
<f:TextBox ID="txtMaterialCode" runat="server" Label="材料编码"
<f:TextBox ID="txtMaterialCode" runat="server" Label="材料编码"
EmptyText="输入查询条件" AutoPostBack="true"
Width="180px" LabelWidth="80px" LabelAlign="Right">
</f:TextBox>
<f:ToolbarFill runat="server"></f:ToolbarFill>
<f:Button ID="btnTreeFind" ToolTip="查询" Icon="SystemSearch"
<f:Button ID="btnTreeFind" ToolTip="查询" Icon="SystemSearch"
EnablePostBack="true" OnClick="btnTreeFind_Click" runat="server">
</f:Button>
</Items>
@@ -45,7 +45,7 @@
<Items>
<f:Tree ID="tvControlItem" ShowHeader="false" Height="560px" Title="单位工程"
OnNodeCommand="tvControlItem_NodeCommand" runat="server" ShowBorder="false" EnableCollapse="true"
AutoLeafIdentification="true"
AutoLeafIdentification="true"
EnableTextSelection="true" OnNodeExpand="tvControlItem_TreeNodeExpanded">
</f:Tree>
</Items>
@@ -72,7 +72,7 @@
EmptyText="输入查询条件" AutoPostBack="true" OnTextChanged="txtWeldJointCode_TextChanged"
Width="240px" LabelWidth="80px" LabelAlign="Right">
</f:TextBox>--%>
<f:TextBox ID="txtMaterialCode2" runat="server" Label="材料编码"
<f:TextBox ID="txtMaterialCode2" runat="server" Label="材料编码"
EmptyText="输入查询条件"
Width="240px" LabelWidth="100px" LabelAlign="Right">
</f:TextBox>
@@ -83,7 +83,7 @@
</f:Button>--%>
<f:Button ID="btnNew" Text="新增" Icon="Add" runat="server" OnClick="btnNew_Click" Hidden="true">
</f:Button>
<f:Button ID="btnQuery" ToolTip="查询" Icon="SystemSearch" Text="查询"
<f:Button ID="btnQuery" ToolTip="查询" Icon="SystemSearch" Text="查询"
EnablePostBack="true" OnClick="btnQuery_Click" runat="server">
</f:Button>
<f:Button ID="btnPrint" Text="打印" Icon="Printer" runat="server"
@@ -107,9 +107,9 @@
<Tabs>
<f:Tab ID="TabJoint" Title="工厂预制" BodyPadding="1px" Layout="VBox" runat="server" AutoScroll="true">
<Items>
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="工厂预制"
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="工厂预制"
EnableCollapse="true" runat="server" BoxFlex="1" DataKeyNames="PipeLineMatId"
EnableColumnLines="true" DataIDField="PipeLineMatId" AllowSorting="true" EnableCheckBoxSelect="true"
EnableColumnLines="true" DataIDField="PipeLineMatId" AllowSorting="true" EnableCheckBoxSelect="true"
SortField="PrefabricatedComponents" SortDirection="ASC" OnSort="Grid1_Sort"
EnableRowDoubleClickEvent="true" OnRowDoubleClick="Grid1_RowDoubleClick">
<Columns>
@@ -123,7 +123,7 @@
DataField="MaterialCode" SortField="MaterialCode" FieldType="String" HeaderTextAlign="Center"
TextAlign="Left" Width="100px">
</f:RenderField>
<f:RenderField Width="100px" ColumnID="MaterialSpec" DataField="MaterialSpec" SortField="MaterialSpec"
FieldType="String" HeaderText="规格" HeaderTextAlign="Center"
TextAlign="Left">
@@ -145,7 +145,7 @@
TextAlign="Left">
</f:RenderField>
<f:RenderField Width="600px" ColumnID="MaterialDef" DataField="MaterialDef" SortField="MaterialDef"
FieldType="String" HeaderText="材料描述" HeaderTextAlign="Center"
FieldType="String" HeaderText="材料描述" HeaderTextAlign="Center"
TextAlign="Left">
</f:RenderField>
</Columns>
@@ -158,7 +158,7 @@
</f:Tab>
<f:Tab ID="TabPipeMat" Title="现场施工" BodyPadding="1px" Layout="VBox" runat="server" AutoScroll="true">
<Items>
<f:Grid ID="Grid2" ShowBorder="true" ShowHeader="false" Title="现场施工"
<f:Grid ID="Grid2" ShowBorder="true" ShowHeader="false" Title="现场施工"
EnableCollapse="true" runat="server" BoxFlex="1" DataKeyNames="PipeLineMatId"
EnableColumnLines="true" DataIDField="PipeLineMatId" AllowSorting="true"
SortField="PipeLineMatId" SortDirection="ASC" OnSort="Grid2_Sort" EnableCheckBoxSelect="true"
@@ -174,7 +174,7 @@
FieldType="String" HeaderText="规格" HeaderTextAlign="Center"
TextAlign="Left">
</f:RenderField>
<%-- <f:RenderField Width="150px" ColumnID="MaterialMade" DataField="MaterialMade" SortField="MaterialMade"
<%-- <f:RenderField Width="150px" ColumnID="MaterialMade" DataField="MaterialMade" SortField="MaterialMade"
FieldType="String" HeaderText="材质" HeaderTextAlign="Center"
TextAlign="Left">
</f:RenderField>--%>
@@ -192,7 +192,52 @@
</f:RenderField>
<f:RenderField Width="600px" ColumnID="MaterialDef" DataField="MaterialDef" SortField="MaterialDef"
FieldType="String" HeaderText="材料描述" HeaderTextAlign="Center"
TextAlign="Left" >
TextAlign="Left">
</f:RenderField>
</Columns>
<Listeners>
<f:Listener Event="beforerowcontextmenu" Handler="onRowContextMenu2" />
</Listeners>
</f:Grid>
</Items>
</f:Tab>
<f:Tab ID="Tab3" Title="预制散件" BodyPadding="1px" Layout="VBox" runat="server" AutoScroll="true">
<Items>
<f:Grid ID="Grid3" ShowBorder="true" ShowHeader="false" Title="散件管理"
EnableCollapse="true" runat="server" BoxFlex="1" DataKeyNames="PipeLineMatId"
EnableColumnLines="true" DataIDField="PipeLineMatId" AllowSorting="true"
SortField="PipeLineMatId" SortDirection="ASC" OnSort="Grid3_Sort" EnableCheckBoxSelect="true"
EnableRowDoubleClickEvent="true" >
<Columns>
<f:RowNumberField EnablePagingNumber="true" HeaderText="序号"
Width="60px" HeaderTextAlign="Center" TextAlign="Center" />
<f:RenderField HeaderText="材料编码" ColumnID="MaterialCode"
DataField="MaterialCode" SortField="MaterialCode" FieldType="String" HeaderTextAlign="Center"
TextAlign="Left" Width="150px">
</f:RenderField>
<f:RenderField Width="100px" ColumnID="MaterialSpec" DataField="MaterialSpec" SortField="MaterialSpec"
FieldType="String" HeaderText="规格" HeaderTextAlign="Center"
TextAlign="Left">
</f:RenderField>
<%-- <f:RenderField Width="150px" ColumnID="MaterialMade" DataField="MaterialMade" SortField="MaterialMade"
FieldType="String" HeaderText="材质" HeaderTextAlign="Center"
TextAlign="Left">
</f:RenderField>--%>
<f:RenderField Width="80px" ColumnID="MaterialName" DataField="MaterialName" SortField="MaterialName"
FieldType="String" HeaderText="类型" HeaderTextAlign="Center"
TextAlign="Left">
</f:RenderField>
<f:RenderField Width="100px" ColumnID="Number" DataField="Number" SortField="Number"
FieldType="String" HeaderText="数量" HeaderTextAlign="Center"
TextAlign="Left">
</f:RenderField>
<f:RenderField Width="80px" ColumnID="MaterialUnit" DataField="MaterialUnit" SortField="MaterialUnit"
FieldType="String" HeaderText="单位" HeaderTextAlign="Center"
TextAlign="Left">
</f:RenderField>
<f:RenderField Width="600px" ColumnID="MaterialDef" DataField="MaterialDef" SortField="MaterialDef"
FieldType="String" HeaderText="材料描述" HeaderTextAlign="Center"
TextAlign="Left">
</f:RenderField>
</Columns>
<Listeners>
@@ -231,7 +276,7 @@
IsModal="true" Width="800px" Height="560px">
</f:Window>
<f:Menu ID="Menu1" runat="server">
<f:MenuButton ID="btnDelMatGrid1" OnClick="btnDelMatGrid1_Click" EnablePostBack="true"
<f:MenuButton ID="btnDelMatGrid1" OnClick="btnDelMatGrid1_Click" EnablePostBack="true"
ConfirmText="删除选中行?" ConfirmTarget="Top" runat="server"
Text="删除" Icon="Delete">
</f:MenuButton>
@@ -242,13 +287,22 @@
Text="删除" Icon="Delete">
</f:MenuButton>
</f:Menu>
<f:Menu ID="Menu3" runat="server">
<f:MenuButton ID="btnDelMat2" OnClick="btnDelMat_Click" EnablePostBack="true"
ConfirmText="删除选中行?" ConfirmTarget="Top" runat="server"
Text="删除" Icon="Delete">
</f:MenuButton>
</f:Menu>
</form>
<script type="text/javascript">
var menuID1 = '<%= Menu1.ClientID %>';
var menuID2 = '<%= Menu2.ClientID %>';
var menuID3 = '<%= Menu3.ClientID %>';
// 返回false,来阻止浏览器右键菜单
function onRowContextMenu3(event, rowId) {
F(menuID3).show(); //showAt(event.pageX, event.pageY);
return false;
}
function onRowContextMenu2(event, rowId) {
F(menuID2).show(); //showAt(event.pageX, event.pageY);
return false;
@@ -253,6 +253,7 @@ namespace FineUIPro.Web.HJGL.DataImport
this.BindGrid1(this.tvControlItem.SelectedNodeID, this.hdUnitWorkId.Text);
this.BindGrid2(this.tvControlItem.SelectedNodeID, this.hdUnitWorkId.Text);
this.BindGrid3(this.tvControlItem.SelectedNodeID, this.hdUnitWorkId.Text);
if (pipeline.PipeArea == PipelineService.PipeArea_SHOP)
{
TabStrip1.ActiveTabIndex = 0;
@@ -284,7 +285,7 @@ namespace FineUIPro.Web.HJGL.DataImport
FROM dbo.HJGL_PipeLineMat pipe
LEFT JOIN dbo.HJGL_MaterialCodeLib lib ON lib.MaterialCode = pipe.MaterialCode
LEFT JOIN HJGL_Pipeline line ON pipe.PipelineId=line.PipelineId
WHERE line.UnitWorkId=@UnitWorkId and line.PipeArea='1' ";
WHERE line.UnitWorkId=@UnitWorkId and line.PipeArea='1' and pipe.PrefabricatedComponents !='' ";
List<SqlParameter> listStr = new List<SqlParameter>();
//if (!string.IsNullOrEmpty(txtMaterialCode.Text.Trim()))
//{
@@ -342,6 +343,43 @@ namespace FineUIPro.Web.HJGL.DataImport
Grid2.DataSource = dt;
Grid2.DataBind();
}
private void BindGrid3(string pipelineId, string unitworkid)
{
string strSql = @" SELECT pipe.PipeLineMatId, lib.MaterialCode,lib.MaterialName,lib.MaterialUnit,
lib.MaterialSpec,lib.MaterialMade,lib.MaterialDef,pipe.Number,pipe.PrefabricatedComponents
FROM dbo.HJGL_PipeLineMat pipe
LEFT JOIN dbo.HJGL_MaterialCodeLib lib ON lib.MaterialCode = pipe.MaterialCode
LEFT JOIN HJGL_Pipeline line ON pipe.PipelineId=line.PipelineId
WHERE line.UnitWorkId=@UnitWorkId and line.PipeArea='1' and (pipe.PrefabricatedComponents is null or pipe.PrefabricatedComponents='') ";
List<SqlParameter> listStr = new List<SqlParameter>();
//if (!string.IsNullOrEmpty(txtMaterialCode.Text.Trim()))
//{
// strSql += " and lib.MaterialCode like @MaterialCode ";
// listStr.Add(new SqlParameter("@MaterialCode", "%" + txtMaterialCode.Text.Trim() + "%"));
//}
if (!string.IsNullOrEmpty(pipelineId))
{
strSql += " and pipe.PipelineId=@PipelineId ";
listStr.Add(new SqlParameter("@PipelineId", pipelineId));
}
if (!string.IsNullOrEmpty(txtMaterialCode2.Text.Trim()))
{
strSql += " and lib.MaterialCode like @MaterialCode ";
listStr.Add(new SqlParameter("@MaterialCode", "%" + txtMaterialCode2.Text.Trim() + "%"));
}
strSql += " order by PrefabricatedComponents ";
listStr.Add(new SqlParameter("@UnitWorkId", unitworkid));
SqlParameter[] parameter = listStr.ToArray();
DataTable dt = SQLHelper.GetDataTableRunText(strSql, parameter);
// 2.获取当前分页数据
Grid3.DataSource = dt;
Grid3.DataBind();
}
#endregion
#region
@@ -471,6 +509,8 @@ namespace FineUIPro.Web.HJGL.DataImport
this.BindGrid1(this.tvControlItem.SelectedNodeID, this.hdUnitWorkId.Text);
this.BindGrid2(this.tvControlItem.SelectedNodeID, this.hdUnitWorkId.Text);
this.BindGrid3(this.tvControlItem.SelectedNodeID, this.hdUnitWorkId.Text);
}
else
{
@@ -498,6 +538,8 @@ namespace FineUIPro.Web.HJGL.DataImport
this.BindGrid1(this.tvControlItem.SelectedNodeID, this.hdUnitWorkId.Text);
this.BindGrid2(this.tvControlItem.SelectedNodeID, this.hdUnitWorkId.Text);
this.BindGrid3(this.tvControlItem.SelectedNodeID, this.hdUnitWorkId.Text);
}
else
{
@@ -639,6 +681,11 @@ namespace FineUIPro.Web.HJGL.DataImport
{
BindGrid2(pipelineid, this.hdUnitWorkId.Text);
}
else if (this.TabStrip1.ActiveTabIndex == 2)
{
BindGrid3(pipelineid, this.hdUnitWorkId.Text);
}
}
@@ -937,8 +984,12 @@ namespace FineUIPro.Web.HJGL.DataImport
private void GetShowColumn(string column)
{
}
#endregion
protected void Grid3_Sort(object sender, GridSortEventArgs e)
{
}
}
}
@@ -266,6 +266,24 @@ namespace FineUIPro.Web.HJGL.DataImport
/// </remarks>
protected global::FineUIPro.Grid Grid2;
/// <summary>
/// Tab3 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Tab Tab3;
/// <summary>
/// Grid3 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Grid Grid3;
/// <summary>
/// Window1 控件。
/// </summary>
@@ -346,5 +364,23 @@ namespace FineUIPro.Web.HJGL.DataImport
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.MenuButton btnDelMat;
/// <summary>
/// Menu3 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Menu Menu3;
/// <summary>
/// btnDelMat2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.MenuButton btnDelMat2;
}
}
@@ -54,7 +54,7 @@
</Items>
</f:Panel>
<f:Panel runat="server" ID="panelCenterRegion" RegionPosition="Center" RegionSplit="true" ShowBorder="true"
<f:Panel runat="server" ID="panelCenterRegion" RegionPosition="Center" RegionSplit="true" ShowBorder="true"
Layout="Fit" ShowHeader="false" RegionSplitWidth="20px" BodyPadding="1px" Height="400px" IconFont="PlusCircle" Title="管线信息"
TitleToolTip="管线信息" AutoScroll="true" RegionPercent="40%">
<Toolbars>
@@ -100,7 +100,7 @@
<Items>
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="管线信息" ForceFit="true"
EnableCollapse="false" runat="server" BoxFlex="1" DataKeyNames="PipelineId" AllowCellEditing="true"
AllowColumnLocking="true" EnableColumnLines="true" ClicksToEdit="2" DataIDField="PipelineId"
EnableColumnLines="true" ClicksToEdit="2" DataIDField="PipelineId"
AllowSorting="true" OnSort="Grid1_Sort" EnableCheckBoxSelect="true" SortDirection="PipelineCode"
AllowPaging="true" OnPageIndexChange="Grid1_PageIndexChange"
OnRowClick="Grid1_RowClick" EnableRowClickEvent="true"
@@ -109,7 +109,7 @@
<Columns>
<f:RowNumberField EnablePagingNumber="true" HeaderText="序号"
Width="60px" HeaderTextAlign="Center" TextAlign="Center" />
<f:WindowField ColumnID="PipelineCode" HeaderTextAlign="Center" TextAlign="Left"
<f:WindowField ColumnID="PipelineCode" HeaderTextAlign="Center" TextAlign="Center"
Width="320px" WindowID="Window1" HeaderText="管线号" DataTextField="PipelineCode"
DataIFrameUrlFields="PipelineId" DataIFrameUrlFormatString="PipelingDivideEdit.aspx?PipelineId={0}"
Title="管线号" DataToolTipField="PipelineCode" SortField="PipelineCode"
@@ -48,7 +48,7 @@ namespace FineUIPro.Web.HJGL.PreDesign
}
protected void Page_Load(object sender, EventArgs e)
{
ctlAuditFlow.Url = BLL.Project_SysSetService.GetAvevaNetUrl(this.CurrUser.LoginProjectId);
// ctlAuditFlow.Url = BLL.Project_SysSetService.GetAvevaNetUrl(this.CurrUser.LoginProjectId);
if (!IsPostBack)
{
@@ -10,17 +10,17 @@
<body>
<form id="form1" runat="server">
<f:PageManager ID="PageManager1" AutoSizePanelID="Panel1" runat="server" OnCustomEvent="PageManager1_CustomEvent" />
<f:Form ID="SimpleForm1" ShowBorder="false" ShowHeader="false" AutoScroll="true"
<f:Form ID="SimpleForm1" ShowBorder="false" ShowHeader="false" AutoScroll="true"
BodyPadding="10px" runat="server" RedStarPosition="BeforeText" LabelAlign="Right">
<Toolbars>
<f:Toolbar ID="Toolbar2" Position="Top" ToolbarAlign="Right" runat="server">
<Items>
<f:FileUpload runat="server" ID="fuAttachUrl" EmptyText="选择要导入的文件" Label="选择要导入的文件"
<f:FileUpload runat="server" ID="fuAttachUrl" EmptyText="选择要导入的文件" Label="选择要导入的文件"
LabelWidth="150px">
</f:FileUpload>
<f:DropDownList ID="DrpType" runat="server" Label="导入类型">
<f:ListItem Text="补充导入" Value="0"/>
<f:ListItem Text="更新导入" Value="1"/>
<f:DropDownList ID="DrpType" runat="server" Label="导入类型">
<f:ListItem Text="补充导入" Value="0" />
<f:ListItem Text="更新导入" Value="1" />
</f:DropDownList>
<f:ToolbarFill runat="server"></f:ToolbarFill>
<f:HiddenField ID="hdFileName" runat="server">
@@ -32,9 +32,15 @@
</Items>
</f:Toolbar>
<f:Toolbar ID="Toolbar3" runat="server">
<f:Toolbar ID="Toolbar1" runat="server">
<Items>
<f:TextArea runat="server" ID="txtRemark" Label="更新原因:"></f:TextArea>
<f:Label ID="lbVersion2" runat="server" Text="预制散件导入时无需编辑组件"></f:Label>
</Items>
</f:Toolbar>
<f:Toolbar ID="Toolbar3" runat="server">
<Items>
<f:TextArea runat="server" ID="txtRemark" Label="更新原因:"></f:TextArea>
<f:ToolbarFill runat="server"></f:ToolbarFill>
<f:Button ID="btnAudit" Icon="ApplicationEdit" runat="server" ToolTip="审核" Text="审核" ValidateForms="SimpleForm1"
OnClick="btnAudit_Click">
@@ -42,7 +48,7 @@
<f:Button ID="btnImport" Icon="ApplicationGet" runat="server" ToolTip="导入" Text="导入" ValidateForms="SimpleForm1"
OnClick="btnImport_Click">
</f:Button>
<f:Button ID="btnSave" Icon="SystemSave" runat="server" ToolTip="提交" Text="提交" ValidateForms="SimpleForm1"
<f:Button ID="btnSave" Icon="SystemSave" runat="server" ToolTip="提交" Text="提交" ValidateForms="SimpleForm1"
OnClick="btnSave_Click">
</f:Button>
</Items>
@@ -51,39 +57,39 @@
<Rows>
<f:FormRow>
<Items>
<f:Grid ID="Grid2" ShowBorder="true" ShowHeader="false" Title="历史记录" IsFluid="true" ForceFit="true"
EnableCollapse="false" runat="server" BoxFlex="1" DataKeyNames="DesignBasisDataImportId"
AllowColumnLocking="true" EnableColumnLines="true" DataIDField="DesignBasisDataImportId"
AllowSorting="true" SortField="CreateDate" SortDirection="ASC" EnableMultiSelect="false"
IsDatabasePaging="false" AllowPaging="true" PageSize="300" EnableBigDataRowTip="false" EnableBigData="true">
<Columns>
<f:RowNumberField EnablePagingNumber="true" HeaderText="编号"
Width="60px" HeaderTextAlign="Center" TextAlign="Center" />
<f:RenderField HeaderText="名称" ColumnID="FileName"
DataField="FileName" SortField="FileName" FieldType="String" HeaderTextAlign="Center"
TextAlign="Left" Width="90px">
</f:RenderField>
<f:RenderField HeaderText="版本" ColumnID="Version"
DataField="Version" SortField="Version" FieldType="String" HeaderTextAlign="Center"
TextAlign="Left" Width="100px">
</f:RenderField>
<f:RenderField HeaderText="导入类型" ColumnID="ImportType"
DataField="ImportType" SortField="ImportType" FieldType="String" HeaderTextAlign="Center"
TextAlign="Left" Width="100px">
</f:RenderField>
<f:RenderField Width="200px" ColumnID="UserName" DataField="UserName" SortField="UserName"
FieldType="String" HeaderText="更新人" HeaderTextAlign="Center"
TextAlign="Left">
</f:RenderField>
<f:RenderField HeaderText="更新日期" ColumnID="CreateDate"
DataField="CreateDate" SortField="CreateDate" FieldType="String" HeaderTextAlign="Center"
TextAlign="Left" Width="90px">
</f:RenderField>
<f:RenderField Width="200px" ColumnID="Remark" DataField="Remark" FieldType="String"
HeaderText="更新原因" HeaderTextAlign="Center" TextAlign="Right">
</f:RenderField>
</Columns>
</f:Grid>
<f:Grid ID="Grid2" ShowBorder="true" ShowHeader="false" Title="历史记录" IsFluid="true" ForceFit="true"
EnableCollapse="false" runat="server" BoxFlex="1" DataKeyNames="DesignBasisDataImportId"
AllowColumnLocking="true" EnableColumnLines="true" DataIDField="DesignBasisDataImportId"
AllowSorting="true" SortField="CreateDate" SortDirection="ASC" EnableMultiSelect="false"
IsDatabasePaging="false" AllowPaging="true" PageSize="300" EnableBigDataRowTip="false" EnableBigData="true">
<Columns>
<f:RowNumberField EnablePagingNumber="true" HeaderText="编号"
Width="60px" HeaderTextAlign="Center" TextAlign="Center" />
<f:RenderField HeaderText="名称" ColumnID="FileName"
DataField="FileName" SortField="FileName" FieldType="String" HeaderTextAlign="Center"
TextAlign="Left" Width="90px">
</f:RenderField>
<f:RenderField HeaderText="版本" ColumnID="Version"
DataField="Version" SortField="Version" FieldType="String" HeaderTextAlign="Center"
TextAlign="Left" Width="100px">
</f:RenderField>
<f:RenderField HeaderText="导入类型" ColumnID="ImportType"
DataField="ImportType" SortField="ImportType" FieldType="String" HeaderTextAlign="Center"
TextAlign="Left" Width="100px">
</f:RenderField>
<f:RenderField Width="200px" ColumnID="UserName" DataField="UserName" SortField="UserName"
FieldType="String" HeaderText="更新人" HeaderTextAlign="Center"
TextAlign="Left">
</f:RenderField>
<f:RenderField HeaderText="更新日期" ColumnID="CreateDate"
DataField="CreateDate" SortField="CreateDate" FieldType="String" HeaderTextAlign="Center"
TextAlign="Left" Width="90px">
</f:RenderField>
<f:RenderField Width="200px" ColumnID="Remark" DataField="Remark" FieldType="String"
HeaderText="更新原因" HeaderTextAlign="Center" TextAlign="Right">
</f:RenderField>
</Columns>
</f:Grid>
</Items>
</f:FormRow>
</Rows>
@@ -95,6 +95,24 @@ namespace FineUIPro.Web.HJGL.WeldingManage
/// </remarks>
protected global::FineUIPro.Label lbVersion;
/// <summary>
/// Toolbar1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Toolbar Toolbar1;
/// <summary>
/// lbVersion2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Label lbVersion2;
/// <summary>
/// Toolbar3 控件。
/// </summary>
@@ -52,6 +52,7 @@
<f:Button ID="btnrefresh" ToolTip="同步NET" Icon="ArrowRefresh"
EnablePostBack="true" OnClick="btnrefresh_Click" runat="server">
</f:Button>
</Items>
</f:Toolbar>
</Toolbars>
@@ -64,161 +65,111 @@
</Items>
</f:Panel>
<f:Panel runat="server" ID="panel3" RegionPosition="Left" RegionSplit="true" EnableCollapse="true"
Width="200px" Title="左侧面板" ShowBorder="true" ShowHeader="true"
Width="200px" Title="匹配中管线" ShowBorder="true" ShowHeader="true"
BodyPadding="10px">
<Toolbars>
<f:Toolbar ID="Toolbar4" Position="Bottom" runat="server" ToolbarAlign="Left">
<Items>
<f:Button ID="btnAddPipelineMatchMat" Icon="Add" runat="server" OnClick="btnAddPipelineMatchMat_Click">
</f:Button>
<f:Button ID="btnDeletePipelineMatchMat" Icon="Delete" runat="server" OnClick="btnDeletePipelineMatchMat_Click">
</f:Button>
<f:Button ID="btnGenTask" ToolTip="生成任务单" Icon="ApplicationViewIcons" runat="server" OnClick="btnGenTask_Click" ConfirmText="确定生成任务单吗?">
</f:Button>
</Items>
</f:Toolbar>
</Toolbars>
<Items>
<f:Label ID="Label6" runat="server" Text="左侧面板的内容">
</f:Label>
<f:Grid ID="Grid3" ShowBorder="false" ShowHeader="false" runat="server" EnableCollapse="false"
DataKeyNames="Key" DataIDField="Key" ShowGridHeader="false" EnableRowLines="false" EnableAlternateRowColor="false">
<Columns>
<f:RenderField Width="150px" ColumnID="Value" DataField="Value" SortField="Value"
FieldType="String" HeaderText="管线" HeaderTextAlign="Center"
TextAlign="Left">
</f:RenderField>
</Columns>
</f:Grid>
</Items>
</f:Panel>
<f:Panel ID="Panel2" runat="server" Margin="5px" BodyPadding="5px" ShowBorder="false"
ShowHeader="false" Layout="Region" BoxConfigAlign="Stretch">
<Items>
<f:Panel runat="server" ID="panelTopRegion" RegionPosition="Top" ShowBorder="true"
<f:Panel runat="server" ID="panelTopRegion" RegionPosition="Top" ShowBorder="true" RegionPercent="30%" IsFluid="true"
Layout="VBox" ShowHeader="false" BodyPadding="5px" IconFont="PlusCircle" Title="三维模型"
TitleToolTip="三维模型显示" AutoScroll="true" IFrameUrl="../../CLGL/MaterialStock.aspx" EnableIFrame="true">
</f:Panel>
<f:Panel runat="server" ID="panelCenterRegion" RegionPosition="Center" ShowBorder="true" RegionPercent="40%"
Layout="VBox" ShowHeader="false" BodyPadding="5px" IconFont="PlusCircle" Title="三维模型"
TitleToolTip="三维模型显示" AutoScroll="true">
<Items>
<f:Grid ID="Grid3" ShowBorder="true" ShowHeader="false" Title="材料匹配明细" EnableRowClickEvent="true"
EnableCollapse="true" runat="server" BoxFlex="1" DataKeyNames="MaterialCode,Number" ForceFit="true"
EnableColumnLines="true" DataIDField="MaterialCode" AllowSorting="true"
SortField="MaterialCode" SortDirection="ASC">
<Columns>
<f:RowNumberField EnablePagingNumber="true" HeaderText="序号"
Width="60px" HeaderTextAlign="Center" TextAlign="Center" />
<f:RenderField HeaderText="材料编码" ColumnID="MaterialCode"
DataField="MaterialCode" SortField="MaterialCode" FieldType="String" HeaderTextAlign="Center"
TextAlign="Left" Width="150px">
</f:RenderField>
<f:RenderField Width="100px" ColumnID="Number" DataField="Number" SortField="Number"
FieldType="String" HeaderText="所需量" HeaderTextAlign="Center"
TextAlign="Left">
</f:RenderField>
<f:TemplateField Width="100px" HeaderText="匹配量" HeaderTextAlign="Center"
TextAlign="Center">
<ItemTemplate>
<asp:Label ID="Label3" runat="server" Text='<%# ConvertGetStockNum(Eval("MaterialCode")) %>'></asp:Label>
</ItemTemplate>
</f:TemplateField>
<f:RenderField Width="100px" ColumnID="MaterialSpec" DataField="MaterialSpec" SortField="MaterialSpec"
FieldType="String" HeaderText="规格" HeaderTextAlign="Center"
TextAlign="Left">
</f:RenderField>
<f:RenderField Width="100px" ColumnID="MaterialUnit" DataField="MaterialUnit" SortField="MaterialUnit"
FieldType="String" HeaderText="单位" HeaderTextAlign="Center"
TextAlign="Left">
</f:RenderField>
<f:RenderField Width="150px" ColumnID="MaterialDef" DataField="MaterialDef" SortField="MaterialDef"
FieldType="String" HeaderText="材料描述" HeaderTextAlign="Center"
TextAlign="Left">
</f:RenderField>
<f:RenderField Width="150px" ColumnID="MaterialName" DataField="MaterialName" SortField="MaterialName"
FieldType="String" HeaderText="类型" HeaderTextAlign="Center"
TextAlign="Left">
</f:RenderField>
</Columns>
</f:Grid>
</Items>
</f:Panel>
<f:Panel runat="server" ID="panelCenterRegion" RegionPosition="Center" ShowBorder="true"
Layout="VBox" ShowHeader="false" BodyPadding="5px" IconFont="PlusCircle" Title="三维模型"
TitleToolTip="三维模型显示" AutoScroll="true">
<Items>
<f:Grid ID="Grid2" ShowBorder="true" ShowHeader="false" Title="材料匹配明细" EnableRowClickEvent="true"
EnableCollapse="true" runat="server" BoxFlex="1" DataKeyNames="MaterialCode,Number" ForceFit="true"
EnableColumnLines="true" DataIDField="MaterialCode" AllowSorting="true"
SortField="MaterialCode" SortDirection="ASC">
<Columns>
<f:RowNumberField EnablePagingNumber="true" HeaderText="序号"
Width="60px" HeaderTextAlign="Center" TextAlign="Center" />
<f:RenderField HeaderText="材料编码" ColumnID="MaterialCode"
DataField="MaterialCode" SortField="MaterialCode" FieldType="String" HeaderTextAlign="Center"
TextAlign="Left" Width="150px">
</f:RenderField>
<f:RenderField Width="100px" ColumnID="Number" DataField="Number" SortField="Number"
FieldType="String" HeaderText="所需量" HeaderTextAlign="Center"
TextAlign="Left">
</f:RenderField>
<f:TemplateField Width="100px" HeaderText="匹配量" HeaderTextAlign="Center"
TextAlign="Center">
<ItemTemplate>
<asp:Label ID="Label2" runat="server" Text='<%# ConvertGetStockNum(Eval("MaterialCode")) %>'></asp:Label>
</ItemTemplate>
</f:TemplateField>
<f:RenderField Width="100px" ColumnID="MaterialSpec" DataField="MaterialSpec" SortField="MaterialSpec"
FieldType="String" HeaderText="规格" HeaderTextAlign="Center"
TextAlign="Left">
</f:RenderField>
<f:RenderField Width="100px" ColumnID="MaterialUnit" DataField="MaterialUnit" SortField="MaterialUnit"
FieldType="String" HeaderText="单位" HeaderTextAlign="Center"
TextAlign="Left">
</f:RenderField>
<f:RenderField Width="150px" ColumnID="MaterialDef" DataField="MaterialDef" SortField="MaterialDef"
FieldType="String" HeaderText="材料描述" HeaderTextAlign="Center"
TextAlign="Left">
</f:RenderField>
<f:RenderField Width="150px" ColumnID="MaterialName" DataField="MaterialName" SortField="MaterialName"
FieldType="String" HeaderText="类型" HeaderTextAlign="Center"
TextAlign="Left">
</f:RenderField>
</Columns>
</f:Grid>
</Items>
</f:Panel>
<f:Panel runat="server" ID="panelBottomRegion" RegionPosition="Bottom" RegionSplit="true" RegionSplitWidth="20px" EnableCollapse="true"
Title="底部面板" ShowBorder="false" Height="320px" ShowHeader="false" BodyPadding="1px" Layout="Fit">
<Toolbars>
<f:Toolbar ID="Toolbar3" Position="Top" runat="server" ToolbarAlign="Left">
<Items>
<f:Label ID="lbPlanStartDate" runat="server" Label="计划开始" LabelWidth="100px"></f:Label>
<f:Label ID="lbRate" runat="server" LabelWidth="100px"></f:Label>
</Items>
</f:Toolbar>
</f:Toolbar>
</Toolbars>
<Items>
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="材料匹配明细" OnRowClick="Grid1_RowClick" EnableRowClickEvent="true"
EnableCollapse="true" runat="server" BoxFlex="1" DataKeyNames="MaterialCode,Number" ForceFit="true"
EnableColumnLines="true" DataIDField="MaterialCode" AllowSorting="true" OnRowDataBound="Grid1_RowDataBound"
SortField="MaterialCode" SortDirection="ASC" OnSort="Grid1_Sort">
<f:Grid ID="Grid2" ShowBorder="true" ShowHeader="false" Title="材料匹配" EnableRowClickEvent="true"
EnableCollapse="true" runat="server" BoxFlex="1" DataKeyNames="PipelineId" ForceFit="true"
EnableColumnLines="true" DataIDField="PipelineId" AllowSorting="true" OnRowClick="Grid2_RowClick"
SortField="PipelineId" SortDirection="ASC">
<Columns>
<f:RowNumberField EnablePagingNumber="true" HeaderText="序号"
Width="60px" HeaderTextAlign="Center" TextAlign="Center" />
<f:RenderField HeaderText="材料编码" ColumnID="MaterialCode"
DataField="MaterialCode" SortField="MaterialCode" FieldType="String" HeaderTextAlign="Center"
TextAlign="Left" Width="150px">
</f:RenderField>
<f:RenderField Width="100px" ColumnID="Number" DataField="Number" SortField="Number"
FieldType="String" HeaderText="所需量" HeaderTextAlign="Center"
<f:RenderField Width="150px" ColumnID="PipelineCode" DataField="PipelineCode" SortField="PipelineCode"
FieldType="String" HeaderText="管线号" HeaderTextAlign="Center"
TextAlign="Left">
</f:RenderField>
<f:RenderField Width="150px" ColumnID="MatchRateString" DataField="MatchRateString" SortField="MatchRateString"
FieldType="String" HeaderText="匹配率" HeaderTextAlign="Center"
TextAlign="Left">
</f:RenderField>
</Columns>
</f:Grid>
<f:TemplateField Width="100px" HeaderText="匹配量" HeaderTextAlign="Center"
TextAlign="Center">
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# ConvertGetStockNum(Eval("MaterialCode")) %>'></asp:Label>
</ItemTemplate>
</f:TemplateField>
<f:RenderField Width="100px" ColumnID="MaterialSpec" DataField="MaterialSpec" SortField="MaterialSpec"
FieldType="String" HeaderText="规格" HeaderTextAlign="Center"
</Items>
</f:Panel>
<f:Panel runat="server" ID="panelBottomRegion" RegionPosition="Bottom" RegionSplit="true" RegionSplitWidth="20px" EnableCollapse="true" RegionPercent="30%"
Title="底部面板" ShowBorder="false" Height="320px" ShowHeader="false" BodyPadding="1px" Layout="Fit">
<Items>
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="材料匹配明细" OnRowClick="Grid1_RowClick" EnableRowClickEvent="true"
EnableCollapse="true" runat="server" BoxFlex="1" DataKeyNames="Id" ForceFit="true"
EnableColumnLines="true" DataIDField="Id" AllowSorting="true" OnRowDataBound="Grid1_RowDataBound"
SortField="Id" SortDirection="ASC" OnSort="Grid1_Sort">
<Columns>
<f:RenderField Width="100px" ColumnID="PipelineCode" DataField="PipelineCode" SortField="PipelineCode"
FieldType="String" HeaderText="管线号" HeaderTextAlign="Center"
TextAlign="Left">
</f:RenderField>
<f:RenderField Width="100px" ColumnID="MaterialUnit" DataField="MaterialUnit" SortField="MaterialUnit"
FieldType="String" HeaderText="单位" HeaderTextAlign="Center"
<f:RenderField Width="100px" ColumnID="PrefabricatedComponents" DataField="PrefabricatedComponents" SortField="PrefabricatedComponents"
FieldType="String" HeaderText="预制组件号" HeaderTextAlign="Center"
TextAlign="Left">
</f:RenderField>
<f:RenderField Width="100px" ColumnID="MaterialCode" DataField="MaterialCode" SortField="MaterialCode"
FieldType="String" HeaderText="材料编码" HeaderTextAlign="Center"
TextAlign="Left">
</f:RenderField>
<f:RenderField Width="100px" ColumnID="MaterialName" DataField="MaterialName" SortField="MaterialName"
FieldType="String" HeaderText="材料名称" HeaderTextAlign="Center"
TextAlign="Left">
</f:RenderField>
<f:RenderField Width="150px" ColumnID="MaterialDef" DataField="MaterialDef" SortField="MaterialDef"
FieldType="String" HeaderText="材料描述" HeaderTextAlign="Center"
TextAlign="Left">
</f:RenderField>
<f:RenderField Width="150px" ColumnID="MaterialName" DataField="MaterialName" SortField="MaterialName"
FieldType="String" HeaderText="类型" HeaderTextAlign="Center"
<f:RenderField Width="100px" ColumnID="MaterialUnit" DataField="MaterialUnit" SortField="MaterialUnit"
FieldType="String" HeaderText="单位" HeaderTextAlign="Center"
TextAlign="Left">
</f:RenderField>
<f:RenderField Width="100px" ColumnID="NeedNum" DataField="NeedNum" SortField="NeedNum"
FieldType="String" HeaderText="所需量" HeaderTextAlign="Center"
TextAlign="Left">
</f:RenderField>
<f:RenderField Width="100px" ColumnID="MatchNum" DataField="MatchNum" SortField="MatchNum"
FieldType="String" HeaderText="匹配量" HeaderTextAlign="Center"
TextAlign="Left">
</f:RenderField>
<f:RenderField Width="100px" ColumnID="MatchRateString" DataField="MatchRateString" SortField="MatchRateString"
FieldType="String" HeaderText="匹配率" HeaderTextAlign="Center"
TextAlign="Left">
</f:RenderField>
@@ -239,7 +190,7 @@
</f:Window>
</form>
<script type="text/javascript">
var panelTopRegionCD = '<%= panelTopRegion.ClientID %>';
var panelTopRegionCD = '<%= panelTopRegion.ClientID %>';
function getiframWidth() {
return F(panelTopRegionCD).getWidth();
@@ -1,4 +1,5 @@
using BLL;
using Model;
using System;
using System.Collections.Generic;
using System.Data;
@@ -10,7 +11,9 @@ namespace FineUIPro.Web.HJGL.WeldingManage
public partial class WeldMatMatch : PageBase
{
public int pageSize = PipelineService.pageSize;
//public Dictionary<string, string> dicSeclectPipeLine = new Dictionary<string, string>();
public static List<Model.Tw_PipeMatMatchOutput> tw_PipeMatMatchOutputs ;
public static decimal Rate = 0;
public string PipeArea
{
get
@@ -33,15 +36,27 @@ namespace FineUIPro.Web.HJGL.WeldingManage
ViewState["Line_No"] = value;
}
}
public Dictionary<string, string> dicSeclectPipeLine
{
get
{
return (Dictionary<string, string>)ViewState["dicSeclectPipeLine"];
}
set
{
ViewState["dicSeclectPipeLine"] = value;
}
}
protected void Page_Load(object sender, EventArgs e)
{
//ctlAuditFlow.Url = BLL.Project_SysSetService.GetAvevaNetUrl(this.CurrUser.LoginProjectId);
if (!IsPostBack)
{
tw_PipeMatMatchOutputs=new List<Model.Tw_PipeMatMatchOutput>();
PipeArea = Request.Params["PipeArea"];
HJGL_MaterialService.materialStockItems_FIELD = new List<Model.MaterialStockItem>();
HJGL_MaterialService.materialStockItems_SHOP = new List<Model.MaterialStockItem>();
dicSeclectPipeLine=new Dictionary<string, string>();
this.InitTreeMenu();//加载树
}
}
@@ -161,9 +176,10 @@ namespace FineUIPro.Web.HJGL.WeldingManage
}
var pipeline = (from x in Funs.DB.HJGL_Pipeline
where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == node.NodeID
&& x.PipelineCode.Contains(this.txtPipelineCode.Text.Trim())
&& x.PipelineCode.Contains(this.txtPipelineCode.Text.Trim())
orderby x.PipelineCode
select x).ToList();
pipeline= pipeline.Where(x => NowComPipelineCode.Contains(x.PipelineCode)).ToList();
int pageindex = int.Parse(node.CommandName.Split('|')[0]);
int pageCount = int.Parse(node.CommandName.Split('|')[1]);
if (pageindex <= pageCount)
@@ -171,10 +187,10 @@ namespace FineUIPro.Web.HJGL.WeldingManage
pipeline = pipeline.Skip(pageSize * (pageindex - 1)).Take(pageSize).ToList();
foreach (var item in pipeline)
{
if (!NowComPipelineCode.Contains(item.PipelineCode))
/*if (!NowComPipelineCode.Contains(item.PipelineCode))
{
continue;
}
}*/
TreeNode newNode = new TreeNode();
newNode.Text = item.PipelineCode ;
newNode.NodeID = item.PipelineId;
@@ -229,13 +245,137 @@ namespace FineUIPro.Web.HJGL.WeldingManage
}
else
{
this.BindGrid();
// this.BindGrid();
}
}
#endregion
#region
private void BindGrid()
{
string strSql = @"SELECT lib.MaterialCode,lib.MaterialName,lib.MaterialUnit,
lib.MaterialSpec,lib.MaterialMade,lib.MaterialDef,sum(pipe.Number)as Number ,
'0' as MatchNum,'否' AS CheckState
FROM dbo.HJGL_PipeLineMat pipe
LEFT JOIN dbo.HJGL_MaterialCodeLib lib ON lib.MaterialCode = pipe.MaterialCode
WHERE PipelineId=@PipelineId
group by lib.MaterialCode,lib.MaterialName,lib.MaterialUnit,
lib.MaterialSpec,lib.MaterialMade,lib.MaterialDef ";
List<SqlParameter> listStr = new List<SqlParameter>();
listStr.Add(new SqlParameter("@PipelineId", this.tvControlItem.SelectedNodeID));
SqlParameter[] parameter = listStr.ToArray();
DataTable dt = SQLHelper.GetDataTableRunText(strSql, parameter);
// 2.获取当前分页数据
Grid1.DataSource = dt;
Grid1.DataBind();
}
void BindGrid2()
{
var result = tw_PipeMatMatchOutputs
.GroupBy(item => new { item.PipelineId, item.PipelineCode }) // 按 PipelineId 和 PipelineCode 分组
.Select(group => new
{
PipelineId = group.Key.PipelineId, // 当前组的 PipelineId
PipelineCode = group.Key.PipelineCode, // 当前组的 PipelineCode
AverageMatchRate = group.Average(item => item.MatchRate) // 计算平均 MatchRate
})
.ToList(); // 转换为 List
// 如果需要将结果转换为自定义类型,可以这样做
List<Tw_PipeMatMatchOutput> output = result.Select(r => new Tw_PipeMatMatchOutput
{
PipelineId = r.PipelineId,
PipelineCode = r.PipelineCode,
MatchRate = r.AverageMatchRate,
MatchRateString = Math.Round((decimal)r.AverageMatchRate * 100, 2).ToString() + "%"
}).ToList();
Grid2.DataSource = output;
Grid2.DataBind();
Rate = Math.Round((decimal)output.Average(item => item.MatchRate) * 100, 2);
lbRate.Text = "匹配率:" + Rate.ToString() + "%";
}
void BindGrid3()
{
Grid3.DataSource = dicSeclectPipeLine;
Grid3.DataBind();
}
#endregion
#region
protected void Grid1_RowDataBound(object sender, GridRowEventArgs e)
{
// DataRowView row = e.DataItem as DataRowView;
/* string code = Grid1.DataKeys[e.RowIndex][0].ToString();
var num= decimal.Parse(Grid1.DataKeys[e.RowIndex][1].ToString()) ;
bool istrue = HJGL_MaterialService.isInStockByMaterialCode(code,num,PipeArea, this.CurrUser.LoginProjectId);
if (istrue)
{
e.RowCssClass = "color1";
}*/
}
protected void Grid2_RowClick(object sender, GridRowClickEventArgs e)
{
var tb = tw_PipeMatMatchOutputs.Where(x => x.PipelineId == Grid2.SelectedRowID).ToList();
Grid1.DataSource = tb;
Grid1.DataBind();
}
protected void Grid1_RowClick(object sender, GridRowClickEventArgs e)
{
Model.Parameter3D parameter3D = new Model.Parameter3D();
Model.ColorModel colorModel = new Model.ColorModel();
colorModel = BLL.Project_SysSetService.GetColorModel(this.CurrUser.LoginProjectId);
parameter3D.ColorModel = colorModel;
parameter3D.ButtonType = "3";
if (this.tvControlItem.SelectedNode.CommandName == "单位工程")
{
parameter3D.ModelName = HJGL_DataImportService.Getlatest3DModelNameByUnitWorkId(tvControlItem.SelectedNodeID);
}
else if (this.tvControlItem.SelectedNode.CommandName == "管线")
{
var modelpipe = PipelineService.GetPipelineByPipelineId(tvControlItem.SelectedNodeID);
if (modelpipe != null && !string.IsNullOrEmpty(modelpipe.UnitWorkId))
{
bool istrue = BLL.HJGL_MaterialService.isInStockByPipeline(tvControlItem.SelectedNodeID, this.CurrUser.LoginProjectId);
if (istrue)
{
Line_No = "/" + modelpipe.PipelineCode;
}
// parameter3D.Line_No = Line_No;
parameter3D.ModelName = HJGL_DataImportService.Getlatest3DModelNameByUnitWorkId(modelpipe.UnitWorkId);
var pipecode = "/" + modelpipe.PipelineCode;
parameter3D.TagNum = pipecode;
}
}
//ctlAuditFlow.Url_item = BLL.Project_SysSetService.GetAvevaNetUrl_Item(this.CurrUser.LoginProjectId) + parameter3D.ModelName;
//ctlAuditFlow.data = parameter3D;
//ctlAuditFlow.BindData();
}
protected void Grid1_Sort(object sender, GridSortEventArgs e)
{
Grid1.SortDirection = e.SortDirection;
Grid1.SortField = e.SortField;
BindGrid();
}
#endregion
#region
protected void btnNew_Click(object sender, EventArgs e)
{
}
protected void btnrefresh_Click(object sender, EventArgs e)
{
if (!string.IsNullOrEmpty(this.tvControlItem.SelectedNodeID))
@@ -276,20 +416,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
this.hdUnitWorkId.Text = this.tvControlItem.SelectedNode.ParentNode.NodeID;
this.BindGrid();
}
if (PipeArea == PipelineService.PipeArea_SHOP)
{
var list = BLL.HJGL_PipelineComponentService.GetComponentByPipelineId(pipeline.PipelineId);
if (list != null && list.Count() > 0)
{
lbPlanStartDate.Text = list.First().PlanStartDate.ToString();
}
}
else if (PipeArea == PipelineService.PipeArea_FIELD)
{
lbPlanStartDate.Text = pipeline.PlanStartDate.HasValue ? pipeline.PlanStartDate.Value.ToShortDateString() : "";
}
if (pipeline != null && !string.IsNullOrEmpty(pipeline.UnitWorkId))
{
bool istrue = BLL.HJGL_MaterialService.isInStockByPipeline(tvControlItem.SelectedNodeID, this.CurrUser.LoginProjectId);
@@ -311,103 +438,6 @@ namespace FineUIPro.Web.HJGL.WeldingManage
}
}
private void BindGrid()
{
string strSql = @"SELECT lib.MaterialCode,lib.MaterialName,lib.MaterialUnit,
lib.MaterialSpec,lib.MaterialMade,lib.MaterialDef,sum(pipe.Number)as Number ,
'0' as MatchNum,'否' AS CheckState
FROM dbo.HJGL_PipeLineMat pipe
LEFT JOIN dbo.HJGL_MaterialCodeLib lib ON lib.MaterialCode = pipe.MaterialCode
WHERE PipelineId=@PipelineId
group by lib.MaterialCode,lib.MaterialName,lib.MaterialUnit,
lib.MaterialSpec,lib.MaterialMade,lib.MaterialDef ";
List<SqlParameter> listStr = new List<SqlParameter>();
listStr.Add(new SqlParameter("@PipelineId", this.tvControlItem.SelectedNodeID));
SqlParameter[] parameter = listStr.ToArray();
DataTable dt = SQLHelper.GetDataTableRunText(strSql, parameter);
// 2.获取当前分页数据
Grid1.DataSource = dt;
Grid1.DataBind();
}
protected void Grid1_RowDataBound(object sender, GridRowEventArgs e)
{
// DataRowView row = e.DataItem as DataRowView;
string code = Grid1.DataKeys[e.RowIndex][0].ToString();
var num= decimal.Parse(Grid1.DataKeys[e.RowIndex][1].ToString()) ;
bool istrue = HJGL_MaterialService.isInStockByMaterialCode(code,num,PipeArea, this.CurrUser.LoginProjectId);
if (istrue)
{
e.RowCssClass = "color1";
}
}
protected string ConvertGetStockNum(object MaterialCode)
{
return BLL.HJGL_MaterialService.GetStockNumByCode(MaterialCode.ToString(), this.CurrUser.LoginProjectId, PipeArea).ToString();
}
#endregion
#region
/// <summary>
/// 排序
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Grid1_Sort(object sender, GridSortEventArgs e)
{
Grid1.SortDirection = e.SortDirection;
Grid1.SortField = e.SortField;
BindGrid();
}
#endregion
/// <summary>
/// 匹配
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnNew_Click(object sender, EventArgs e)
{
}
protected void Grid1_RowClick(object sender, GridRowClickEventArgs e)
{
Model.Parameter3D parameter3D = new Model.Parameter3D();
Model.ColorModel colorModel = new Model.ColorModel();
colorModel = BLL.Project_SysSetService.GetColorModel(this.CurrUser.LoginProjectId);
parameter3D.ColorModel = colorModel;
parameter3D.ButtonType = "3";
if (this.tvControlItem.SelectedNode.CommandName == "单位工程")
{
parameter3D.ModelName = HJGL_DataImportService.Getlatest3DModelNameByUnitWorkId(tvControlItem.SelectedNodeID);
}
else if (this.tvControlItem.SelectedNode.CommandName == "管线")
{
var modelpipe = PipelineService.GetPipelineByPipelineId(tvControlItem.SelectedNodeID);
if (modelpipe != null && !string.IsNullOrEmpty(modelpipe.UnitWorkId))
{
bool istrue = BLL.HJGL_MaterialService.isInStockByPipeline(tvControlItem.SelectedNodeID, this.CurrUser.LoginProjectId);
if (istrue)
{
Line_No ="/"+ modelpipe.PipelineCode;
}
// parameter3D.Line_No = Line_No;
parameter3D.ModelName = HJGL_DataImportService.Getlatest3DModelNameByUnitWorkId(modelpipe.UnitWorkId);
var pipecode = "/" + modelpipe.PipelineCode;
parameter3D.TagNum = pipecode;
}
}
//ctlAuditFlow.Url_item = BLL.Project_SysSetService.GetAvevaNetUrl_Item(this.CurrUser.LoginProjectId) + parameter3D.ModelName;
//ctlAuditFlow.data = parameter3D;
//ctlAuditFlow.BindData();
}
protected void btnStatisticsMat_Click(object sender, EventArgs e)
{
@@ -422,15 +452,167 @@ namespace FineUIPro.Web.HJGL.WeldingManage
}
}
/// <summary>
/// 查询
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
//protected void btnQuery_Click(object sender, EventArgs e)
//{
// this.BindGrid();
//}
protected void btnAddPipelineMatchMat_Click(object sender, EventArgs e)
{
if (this.tvControlItem.SelectedNode.CommandName == "管线")
{
if (dicSeclectPipeLine.Where(x => x.Key == this.tvControlItem.SelectedNodeID).Count() == 0)
{
dicSeclectPipeLine.Add(this.tvControlItem.SelectedNodeID, this.tvControlItem.SelectedNode.Text);
tw_PipeMatMatchOutputs = TwArrivalStatisticsService.GetPipeMatMatch(this.CurrUser.LoginProjectId, dicSeclectPipeLine.Keys.ToList(), "工厂预制");
BindGrid3();
BindGrid2();
}
}
}
protected void btnDeletePipelineMatchMat_Click(object sender, EventArgs e)
{
if (Grid3.SelectedRowID != "")
{
dicSeclectPipeLine.Remove(Grid3.SelectedRowID);
tw_PipeMatMatchOutputs = TwArrivalStatisticsService.GetPipeMatMatch(this.CurrUser.LoginProjectId, dicSeclectPipeLine.Keys.ToList(), "工厂预制");
BindGrid3();
BindGrid2();
}
}
protected void btnGenTask_Click(object sender, EventArgs e)
{
if (Rate<(decimal)0.8)
{
ShowNotify(" 匹配率小于80%,请重新匹配!", MessageBoxIcon.Warning);
return;
}
SaveTask();
Response.Redirect(Request.Url.ToString());
}
private void SaveTask()
{
var weldingRods = from x in Funs.DB.Base_Consumables where x.ConsumablesType == "2" select x;
var weldingWires = from x in Funs.DB.Base_Consumables where x.ConsumablesType == "1" select x;
var toDoMatterList = (from x in Funs.DB.View_HJGL_NoWeldJointFind
where dicSeclectPipeLine.Keys.ToList().Contains(x.PipelineId) && x.WeldingDailyId == null && x.WeldTaskId == null
select x).ToList();
var selectRowId = (from x in Funs.DB.View_HJGL_NoWeldJointFind
where dicSeclectPipeLine.Keys.ToList().Contains(x.PipelineId) && x.WeldingDailyId == null && x.WeldTaskId == null
select x).ToList();
foreach (var weldjoint in selectRowId)
{
string canWeldingRodName = string.Empty;
string canWeldingWireName = string.Empty;
Model.HJGL_WeldTask NewTask = new Model.HJGL_WeldTask();
NewTask.ProjectId = this.CurrUser.LoginProjectId;
NewTask.UnitWorkId = PipelineService.GetPipelineByPipelineId(weldjoint.PipelineId)?.UnitWorkId;
NewTask.UnitId = this.CurrUser.UnitId;
NewTask.TaskCode = BLL.WeldTaskService.GetTaskCodeByDate(this.CurrUser.LoginProjectId, DateTime.Now.Date.ToString("yyyy-MM-dd"), NewTask.UnitWorkId, this.CurrUser.UnitId);
NewTask.WeldTaskId = SQLHelper.GetNewID();
NewTask.WeldJointId = weldjoint.WeldJointId;
var oldWeldTask = BLL.WeldTaskService.GetWeldTaskByWeldJointId(NewTask.WeldJointId);
if (oldWeldTask != null)
{
ShowNotify("所选焊口已存在任务单,无法保存!", MessageBoxIcon.Warning);
return;
}
Model.HJGL_WeldJoint weldJoint = BLL.WeldJointService.GetWeldJointByWeldJointId(NewTask.WeldJointId);
if (weldJoint != null)
{
NewTask.WeldingRod = weldJoint.WeldingRod;
NewTask.WeldingWire = weldJoint.WeldingWire;
//获取可替代焊丝焊条
var mat = BLL.Base_MaterialService.GetMaterialByMaterialId(weldJoint.Material1Id);
string matClass = mat.MaterialClass;
var matRod = weldingRods.FirstOrDefault(x => x.ConsumablesId == weldJoint.WeldingRod);
if (matRod != null)
{
foreach (var item in weldingRods)
{
if (matClass == "Fe-1" || matClass == "Fe-3")
{
if (IsCoverClass(matRod.SteelType, item.SteelType))
{
canWeldingRodName = canWeldingRodName + item.ConsumablesName + ",";
}
}
else
{
if (matRod.SteelType == item.SteelType)
{
canWeldingRodName = canWeldingRodName + item.ConsumablesName + ",";
}
}
}
if (!string.IsNullOrEmpty(canWeldingRodName))
{
NewTask.CanWeldingRodName = canWeldingRodName.Substring(0, canWeldingRodName.Length - 1);
}
}
var matWire = weldingWires.FirstOrDefault(x => x.ConsumablesId == weldJoint.WeldingWire);
if (matWire != null)
{
foreach (var item in weldingWires)
{
if (matClass == "Fe-1" || matClass == "Fe-3")
{
if (IsCoverClass(matWire.SteelType, item.SteelType))
{
canWeldingWireName = canWeldingWireName + item.ConsumablesName + ",";
}
}
else
{
if (matWire.SteelType == item.SteelType)
{
canWeldingWireName = canWeldingWireName + item.ConsumablesName + ",";
}
}
}
if (!string.IsNullOrEmpty(canWeldingWireName))
{
NewTask.CanWeldingWireName = canWeldingWireName.Substring(0, canWeldingWireName.Length - 1);
}
}
}
NewTask.JointAttribute = weldJoint.JointAttribute;
NewTask.TaskDate = DateTime.Now.Date;
NewTask.Tabler = this.CurrUser.PersonId;
NewTask.TableDate = DateTime.Now;
weldJoint.WeldingMode = "手动";
BLL.WeldJointService.UpdateWeldJoint(weldJoint);
BLL.WeldTaskService.AddWeldTask(NewTask);
}
}
private bool IsCoverClass(string wpsClass, string matClass)
{
bool isCover = false;
int wpsSn = 0;
int matSn = 0;
if (wpsClass.Length > 2 && matClass.Length > 2)
{
string wpsPre = wpsClass.Substring(0, wpsClass.Length - 2);
string matPre = matClass.Substring(0, matClass.Length - 2);
string wps = wpsClass.Substring(wpsClass.Length - 1, 1);
wpsSn = Funs.GetNewInt(wps).HasValue ? Funs.GetNewInt(wps).Value : 0;
string mat = matClass.Substring(matClass.Length - 1, 1);
matSn = Funs.GetNewInt(mat).HasValue ? Funs.GetNewInt(mat).Value : 0;
if (wpsPre == matPre && matSn >= wpsSn)
{
return true;
}
}
return isCover;
}
#endregion
}
}
@@ -132,13 +132,49 @@ namespace FineUIPro.Web.HJGL.WeldingManage
protected global::FineUIPro.Panel panel3;
/// <summary>
/// Label6 控件。
/// Toolbar4 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Label Label6;
protected global::FineUIPro.Toolbar Toolbar4;
/// <summary>
/// btnAddPipelineMatchMat 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnAddPipelineMatchMat;
/// <summary>
/// btnDeletePipelineMatchMat 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnDeletePipelineMatchMat;
/// <summary>
/// btnGenTask 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnGenTask;
/// <summary>
/// Grid3 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Grid Grid3;
/// <summary>
/// Panel2 控件。
@@ -158,24 +194,6 @@ namespace FineUIPro.Web.HJGL.WeldingManage
/// </remarks>
protected global::FineUIPro.Panel panelTopRegion;
/// <summary>
/// Grid3 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Grid Grid3;
/// <summary>
/// Label3 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.WebControls.Label Label3;
/// <summary>
/// panelCenterRegion 控件。
/// </summary>
@@ -185,33 +203,6 @@ namespace FineUIPro.Web.HJGL.WeldingManage
/// </remarks>
protected global::FineUIPro.Panel panelCenterRegion;
/// <summary>
/// Grid2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Grid Grid2;
/// <summary>
/// Label2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.WebControls.Label Label2;
/// <summary>
/// panelBottomRegion 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Panel panelBottomRegion;
/// <summary>
/// Toolbar3 控件。
/// </summary>
@@ -222,13 +213,31 @@ namespace FineUIPro.Web.HJGL.WeldingManage
protected global::FineUIPro.Toolbar Toolbar3;
/// <summary>
/// lbPlanStartDate 控件。
/// lbRate 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Label lbPlanStartDate;
protected global::FineUIPro.Label lbRate;
/// <summary>
/// Grid2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Grid Grid2;
/// <summary>
/// panelBottomRegion 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Panel panelBottomRegion;
/// <summary>
/// Grid1 控件。
@@ -239,15 +248,6 @@ namespace FineUIPro.Web.HJGL.WeldingManage
/// </remarks>
protected global::FineUIPro.Grid Grid1;
/// <summary>
/// Label1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.WebControls.Label Label1;
/// <summary>
/// Window2 控件。
/// </summary>
@@ -95,7 +95,10 @@
</f:Button>
<f:Button ID="btnSave" Icon="SystemSave" runat="server" Text="保存" OnClick="btnSave_Click" Hidden="True">
</f:Button>
<f:Button ID="btnPrintJoint" Text="打印焊口贴纸" Icon="Printer" runat="server"
OnClick="btnPrintJoint_Click">
</f:Button>
</Items>
</f:Toolbar>
</Toolbars>
@@ -1288,5 +1288,49 @@ namespace FineUIPro.Web.HJGL.WeldingManage
}
}
}
protected void btnPrintJoint_Click(object sender, EventArgs e)
{
var rows = Grid1.SelectedRowIndexArray;
List<string> jointids = new List<string>();
foreach (int rowIndex in rows)
{
string jointid = Grid1.DataKeys[rowIndex][1].ToString();
jointids.Add(jointid);
}
if (jointids.Any())
{
BLL.FastReportService.ResetData();
var result = Funs.DB.View_HJGL_WeldJoint.Where(x => jointids.Contains(x.WeldJointId)).Select(x => new
{
pipelineCode = x.PipelineCode,
Mat = x.MaterialCode,
WeldJointId = x.WeldJointId,
Spec = x.Specification,
SortIndex = x.WeldJointCode.Replace(x.PipelineCode + "/", ""),
}).ToList();
var tb = LINQToDataTable(result);
if (tb != null && tb.Rows.Count > 0)
{
tb.TableName = "Table1";
}
BLL.FastReportService.AddFastreportTable(tb);
string initTemplatePath = "";
string rootPath = Server.MapPath("~/");
initTemplatePath = "File\\Fastreport\\焊口打印.frx";
if (File.Exists(rootPath + initTemplatePath))
{
PageContext.RegisterStartupScript(Window2.GetShowReference(String.Format("~/Controls/Fastreport.aspx?ReportPath={0}", rootPath + initTemplatePath)));
}
}
else
{
ShowNotify("请选择焊口", MessageBoxIcon.Question);
}
}
}
}
@@ -248,6 +248,15 @@ namespace FineUIPro.Web.HJGL.WeldingManage
/// </remarks>
protected global::FineUIPro.Button btnSave;
/// <summary>
/// btnPrintJoint 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnPrintJoint;
/// <summary>
/// drpJointAttribute 控件。
/// </summary>
@@ -24,6 +24,7 @@ namespace Model
}
public class PackagingPrepipeItem
{
public string PipelineComponentId { get; set; }
public string PipelineComponentCode { get; set; }
public string PreUnit { get; set; }
public string UnitWorkName { get; set; }
@@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Model
{
public class Tw_ArrivalStatisticsOutPut
{
public string MaterialCode { get; set; }
public string MaterialName { get; set; }
public string MaterialSpec { get; set; }
public string MaterialUnit { get; set; }
public string MaterialDef { get; set; }
public decimal NeedNum { get; set; }
public decimal RealNum { get; set; }
public decimal MatchRate { get; set; }
public string MatchRateString { get; set; }
}
}
+12 -2
View File
@@ -8,8 +8,18 @@ namespace Model
{
public class Tw_InOutDetailOutput:Model.Tw_InOutPlanDetail
{
public string PipelineComponentCode { get; set; } //预制组件代码
public string MaterialName { get; set; } //预制组件代码
/// <summary>
/// 预制组件代码
/// </summary>
public string PipelineComponentCode { get; set; }
/// <summary>
/// 材料名称
/// </summary>
public string MaterialName { get; set; }
/// <summary>
/// 材料描述
/// </summary>
public string MaterialDef { get; set; }
public string InputMasterId { get; set; }
public string OutputMasterId { get; set; }
/// <summary>
+4 -4
View File
@@ -7,18 +7,18 @@ namespace Model
/// <summary>
/// 申请单编号
/// </summary>
[ExcelColumnIndex("A")] public string CusBillCode { get; set; }
public string CusBillCode { get; set; }
/// <summary>
/// 仓库
/// </summary>
[ExcelColumnIndex("B")] public string WarehouseCode { get; set; }
[ExcelColumnIndex("A")] public string WarehouseCode { get; set; }
/// <summary>
/// 材料编码
/// </summary>
[ExcelColumnIndex("C")] public string MaterialCode { get; set; }
[ExcelColumnIndex("B")] public string MaterialCode { get; set; }
/// <summary>
/// 数量
/// </summary>
[ExcelColumnIndex("D")] public string PlanNum { get; set; }
[ExcelColumnIndex("C")] public string PlanNum { get; set; }
}
}
@@ -3,6 +3,7 @@
public class Tw_MaterialStockOutput: Tw_MaterialStock
{
public string MaterialName { get; set; }
public string MaterialDef { get; set; }
public string MaterialSpec { get; set; }
public string MaterialUnit { get; set; }
}
+25
View File
@@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Model
{
public class Tw_PipeMatMatchOutput
{
public string Id { get; set; }
public string PipelineId { get; set; }
public string PipelineCode { get; set; }
public string PrefabricatedComponents { get; set; }
public string MaterialCode { get; set; }
public string MaterialName { get; set; }
public string MaterialSpec { get; set; }
public string MaterialUnit { get; set; }
public string MaterialDef { get; set; }
public decimal? NeedNum { get; set; }
public decimal? MatchNum { get; set; }
public decimal? MatchRate { get; set; }
public string MatchRateString { get; set; }
}
}
+36
View File
@@ -0,0 +1,36 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Model
{
public class Tw_PrintMaster
{
public string BillName { get; set; }
public string ReqUnitName { get; set; }
public string AuditManName { get; set; }
public string CreateManName { get; set; }
public string AuditDate { get; set; }
public string CreateDate { get; set; }
public string CusBillCode { get; set; }
public string ProjectName { get; set; }
public string CategoryString { get; set; }
public string WarehouseManName { get; set; }
public string WarehouseManAuditDate { get; set; }
}
public class Tw_PrintDetail
{
public int SortIndex { get; set; }
public string PipelineCode { get; set; }
public string PipelineComponentCode { get; set; }
public string MaterialCode { get; set; }
public string MaterialDef { get; set; }
public string MaterialSpec { get; set; }
public string MaterialUnit { get; set; }
public string PlanNum { get; set; }
public string ActNum { get; set; }
public string UnitWorkName { get; set; }
}
}
+36
View File
@@ -279295,6 +279295,8 @@ namespace Model
private string _WeldingLocationId;
private string _Specification;
private string _IsWelding;
private string _PipelineCode;
@@ -279323,6 +279325,8 @@ namespace Model
private string _PipeArea;
private string _MaterialCode;
private string _WeldJointNum;
public View_HJGL_WeldingTask()
@@ -279649,6 +279653,22 @@ namespace Model
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Specification", DbType="NVarChar(20)")]
public string Specification
{
get
{
return this._Specification;
}
set
{
if ((this._Specification != value))
{
this._Specification = value;
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_IsWelding", DbType="VarChar(2) NOT NULL", CanBeNull=false)]
public string IsWelding
{
@@ -279873,6 +279893,22 @@ namespace Model
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_MaterialCode", DbType="NVarChar(50)")]
public string MaterialCode
{
get
{
return this._MaterialCode;
}
set
{
if ((this._MaterialCode != value))
{
this._MaterialCode = value;
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_WeldJointNum", DbType="NVarChar(50)")]
public string WeldJointNum
{
+3
View File
@@ -180,6 +180,9 @@
<Compile Include="Chart\DataSourceChart.cs" />
<Compile Include="Chart\DataSourcePoint.cs" />
<Compile Include="Chart\DataSourceTeam.cs" />
<Compile Include="CLGL\Tw_ArrivalStatisticsOutPut.cs" />
<Compile Include="CLGL\Tw_PipeMatMatchOutput.cs" />
<Compile Include="CLGL\Tw_PrintModel.cs" />
<Compile Include="CLGL\Tw_InOutDetailOutput.cs" />
<Compile Include="CLGL\Tw_InOutMasterOutput.cs" />
<Compile Include="CLGL\Tw_InputDataIn.cs" />
@@ -187,6 +187,32 @@ namespace WebAPI.Controllers
return responeData;
}
/// <summary>
/// 根据焊口手动点口
/// </summary>
/// <param name="weldJointId"></param>
/// <returns></returns>
public Model.ResponeData getManualPointSave(string weldJointId)
{
var responeData = new Model.ResponeData();
try
{
string res = APINDETrustService.ManualPointSave(weldJointId);
if (!string.IsNullOrEmpty(res))
{
responeData.code = 0;
responeData.message = res;
}
}
catch (Exception ex)
{
responeData.code = 0;
responeData.message = ex.Message;
}
return responeData;
}
/// <summary>
/// 对所选批次进行强制关闭批
@@ -50,6 +50,23 @@ namespace WebAPI.Controllers
return responeData;
}
public Model.ResponeData getSavePackagingInformationById(string packagingManageId, string PipelineComponentIds)
{
var responeData = new Model.ResponeData();
try
{
BLL.APIPackagingManageService.getSavePackagingInformationById(packagingManageId, PipelineComponentIds);
}
catch (Exception ex)
{
responeData.code = 0;
responeData.message = ex.Message;
}
return responeData;
}
public Model.ResponeData GetPackingInfoConfirmArrival( string packagingManageId,string PersonId)
{
var responeData = new Model.ResponeData();
@@ -167,6 +167,26 @@ namespace WebAPI.Controllers
return responeData;
}
/// <summary>
/// 根据焊口ID获取焊口详细信息
/// </summary>
/// <param name="WeldJointId"></param>
/// <returns></returns>
public Model.ResponeData getWeldJointByWeldJointId(string WeldJointId)
{
var responeData = new Model.ResponeData();
try
{
responeData.data = APIPipeJointService.GetHJGL_WeldJoint(WeldJointId);
}
catch (Exception ex)
{
responeData.code = 0;
responeData.message = ex.Message;
}
return responeData;
}
#endregion
#region 线
@@ -140,6 +140,35 @@ namespace WebAPI.Controllers
res.successful = true;
return res;
}
/// <summary>
/// 根据焊口id保存到日报
/// </summary>
/// <param name="WeldJointId"></param>
/// <param name="Personid"></param>
/// <param name="time"></param>
/// <returns></returns>
[HttpGet]
public Model.ResponeData SaveWeldingDailyByWeldJointId(string WeldJointId,string Personid,string time)
{
var responeData = new Model.ResponeData();
try
{
string res= APIPreWeldingDailyService.SaveWeldingDailyByWeldJointId(WeldJointId, Personid,time );
if (!string.IsNullOrEmpty(res))
{
responeData.code = 0;
responeData.message = res;
}
}
catch (Exception ex)
{
responeData.code = 0;
responeData.message = ex.Message;
}
return responeData;
}
#endregion
#region